adminizer 4.7.0-build.224 → 5.0.0-build.1

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 (307) hide show
  1. package/Readme.md +2 -1
  2. package/assets/add-De0wyF0A.js +1 -0
  3. package/assets/add-group-CMWybgIR.js +1 -0
  4. package/assets/add-user-BxP23daH.js +1 -0
  5. package/assets/app-CtWuWD5N.css +1 -0
  6. package/assets/app-layout-GYMU2HO1.js +1 -0
  7. package/assets/app.js +45 -50
  8. package/assets/catalog-tImW1BnS.js +6 -0
  9. package/assets/controls/chunks/_commonjsHelpers-C6fGbg64.js +6 -0
  10. package/assets/controls/chunks/index-CjiZ2FIa.js +93 -0
  11. package/assets/controls/chunks/jsx-runtime-jIxVPx5o.js +31 -0
  12. package/assets/controls/chunks/use-appearance-CFLOwiSX.js +38 -0
  13. package/assets/controls/chunks/use-window-size-BXgBKW65.js +19 -0
  14. package/assets/controls/chunks/vanilla-picker-Dg97NL4h.js +529 -0
  15. package/assets/controls/ckeditor.es.js +83683 -0
  16. package/assets/controls/handsontable.css +1 -0
  17. package/assets/controls/handsontable.es.js +70585 -0
  18. package/assets/controls/jsoneditor.css +1 -0
  19. package/assets/controls/jsoneditor.es.js +42082 -0
  20. package/assets/controls/leaflet.css +1 -0
  21. package/assets/controls/leaflet.es.js +10299 -0
  22. package/assets/controls/monaco.es.js +618 -0
  23. package/assets/controls/toast-ui.css +1 -0
  24. package/assets/controls/toast-ui.es.js +41797 -0
  25. package/assets/dashboard-CQ4atH3N.js +3 -0
  26. package/assets/debounce-BMmXVQ06.js +1 -0
  27. package/assets/history-BileQPEi.js +1 -0
  28. package/assets/init-user-8aUohVDq.js +1 -0
  29. package/assets/list-Pz_5mfSq.js +4 -0
  30. package/assets/login-CO4laf6m.js +1 -0
  31. package/assets/manifest.json +66 -602
  32. package/assets/media-manager-BDbpSSjH.js +6 -0
  33. package/assets/media-manager-BZPjl98I.css +1 -0
  34. package/assets/module-CQiOdgZN.js +1 -0
  35. package/assets/notification-BIyv1smE.js +20 -0
  36. package/assets/register-DBYIMXGQ.js +1 -0
  37. package/assets/ru-rYKdQbWF.js +1 -0
  38. package/assets/use-appearance-_EbbjHTh.js +1 -0
  39. package/assets/user-filters-list-Aq8CvCeh.js +1 -0
  40. package/assets/welcome-DxhWYzUL.js +1 -0
  41. package/controllers/add.d.ts +1 -1
  42. package/controllers/addGroup.js +3 -3
  43. package/controllers/addUser.js +3 -3
  44. package/controllers/catalog/Catalog.d.ts +1 -1
  45. package/controllers/catalog/Catalog.js +2 -1
  46. package/controllers/catalog/FrontendCatalogAdapter.d.ts +2 -12
  47. package/controllers/catalog/FrontendCatalogAdapter.js +3 -16
  48. package/controllers/catalog/FrontentCatalogAdapter.d.ts +2 -12
  49. package/controllers/catalog/FrontentCatalogAdapter.js +0 -16
  50. package/controllers/edit.js +6 -11
  51. package/controllers/editGroup.d.ts +1 -1
  52. package/controllers/editGroup.js +3 -3
  53. package/controllers/editUser.d.ts +1 -1
  54. package/controllers/editUser.js +3 -3
  55. package/controllers/feed.js +1 -1
  56. package/controllers/filter-fields/columns.js +1 -1
  57. package/controllers/filter-fields/getAllUserFilters.js +2 -2
  58. package/controllers/filter-fields/groups.js +2 -2
  59. package/controllers/filter-fields/savedFilters.js +1 -1
  60. package/controllers/history-actions/HistoryController.js +1 -1
  61. package/controllers/initUser.js +2 -2
  62. package/controllers/list.d.ts +1 -1
  63. package/controllers/login.d.ts +1 -1
  64. package/controllers/login.js +3 -3
  65. package/controllers/media-manager/ThumbController.js +2 -2
  66. package/controllers/media-manager/mediaManagerApi.js +13 -15
  67. package/controllers/register.d.ts +1 -1
  68. package/controllers/register.js +5 -5
  69. package/controllers/remove.d.ts +1 -1
  70. package/controllers/userApiKey.js +2 -2
  71. package/controllers/view.d.ts +1 -1
  72. package/controllers/view.js +5 -5
  73. package/controllers/widgets/Action.js +5 -2
  74. package/controllers/widgets/filterInfo.js +1 -1
  75. package/files/favicon.png +0 -0
  76. package/helpers/accessRightsHelper.d.ts +6 -4
  77. package/helpers/accessRightsHelper.js +13 -0
  78. package/helpers/diffHelpers.js +1 -1
  79. package/helpers/fieldsHelper.d.ts +1 -1
  80. package/helpers/fieldsHelper.js +8 -4
  81. package/helpers/filterDatetimeHelper.d.ts +1 -1
  82. package/helpers/inertiaAddHelper.d.ts +6 -5
  83. package/helpers/inertiaAddHelper.js +45 -37
  84. package/helpers/inertiaAutHelper.js +5 -5
  85. package/helpers/inertiaGroupHelper.d.ts +4 -4
  86. package/helpers/inertiaMenuHelper.js +1 -1
  87. package/helpers/inertiaUserHelper.d.ts +3 -3
  88. package/helpers/inertiaUserHelper.js +1 -1
  89. package/helpers/menuHelper.d.ts +2 -2
  90. package/index.d.ts +19 -6
  91. package/index.js +19 -6
  92. package/interfaces/adminpanelConfig.d.ts +10 -33
  93. package/interfaces/global.d.ts +10 -15
  94. package/interfaces/listQueryBuilder.d.ts +1 -1
  95. package/lib/Adminizer.d.ts +25 -2
  96. package/lib/Adminizer.js +124 -50
  97. package/lib/DataAccessor.d.ts +9 -5
  98. package/lib/DataAccessor.js +89 -42
  99. package/lib/access-rights/AccessRightsHandler.d.ts +17 -0
  100. package/lib/access-rights/AccessRightsHandler.js +63 -0
  101. package/lib/ai-assistant/AbstractAiModelService.d.ts +5 -8
  102. package/lib/ai-assistant/AbstractAiModelService.js +3 -14
  103. package/lib/ai-assistant/AiAssistantHandler.d.ts +2 -2
  104. package/lib/app-manager/AdminizerApp.d.ts +228 -0
  105. package/lib/app-manager/AdminizerApp.js +17 -0
  106. package/lib/app-manager/AppManager.d.ts +18 -0
  107. package/lib/app-manager/AppManager.js +537 -0
  108. package/lib/app-manager/AssetHandler.d.ts +17 -0
  109. package/lib/app-manager/AssetHandler.js +67 -0
  110. package/lib/app-manager/ConfigLayerHandler.d.ts +18 -0
  111. package/lib/app-manager/ConfigLayerHandler.js +119 -0
  112. package/lib/app-manager/ControllerHandler.d.ts +25 -0
  113. package/lib/app-manager/ControllerHandler.js +140 -0
  114. package/lib/catalog/AbstractCatalog.d.ts +28 -19
  115. package/lib/catalog/AbstractCatalog.js +41 -10
  116. package/lib/catalog/CatalogHandler.d.ts +13 -0
  117. package/lib/catalog/CatalogHandler.js +48 -2
  118. package/lib/catalog/CatalogTemplateComponentHandler.d.ts +23 -0
  119. package/lib/catalog/CatalogTemplateComponentHandler.js +59 -0
  120. package/lib/controls/Control.d.ts +17 -0
  121. package/lib/controls/Control.js +1 -0
  122. package/lib/controls/ControlsHandler.d.ts +5 -6
  123. package/lib/controls/ControlsHandler.js +0 -13
  124. package/lib/controls/codeEditor/MonacoEditor.d.ts +3 -4
  125. package/lib/controls/codeEditor/MonacoEditor.js +13 -8
  126. package/lib/controls/geojsoneditor/GeoEditor.d.ts +3 -4
  127. package/lib/controls/geojsoneditor/GeoEditor.js +14 -9
  128. package/lib/controls/jsoneditor/JsonEditor.d.ts +5 -6
  129. package/lib/controls/jsoneditor/JsonEditor.js +14 -13
  130. package/lib/controls/markdown/ToastUiEditor.d.ts +5 -6
  131. package/lib/controls/markdown/ToastUiEditor.js +14 -13
  132. package/lib/controls/table/Handsontable.d.ts +5 -6
  133. package/lib/controls/table/Handsontable.js +14 -13
  134. package/lib/controls/wysiwyg/CKeditor.d.ts +5 -6
  135. package/lib/controls/wysiwyg/CKeditor.js +14 -13
  136. package/lib/filters/ConditionValidator.d.ts +1 -1
  137. package/lib/filters/FilterService.d.ts +18 -18
  138. package/lib/filters/FilterService.js +11 -11
  139. package/lib/history-actions/AbstractHistoryAdapter.d.ts +14 -14
  140. package/lib/history-actions/AbstractHistoryAdapter.js +5 -6
  141. package/lib/history-actions/DefaultHistoryAdapter.d.ts +7 -7
  142. package/lib/history-actions/DefaultHistoryAdapter.js +2 -2
  143. package/lib/list-query-builder/ListQueryBuilder.d.ts +1 -1
  144. package/lib/media-manager/AbstractMediaManager.d.ts +14 -3
  145. package/lib/media-manager/AbstractMediaManager.js +16 -5
  146. package/lib/media-manager/MediaManagerHandler.d.ts +3 -0
  147. package/lib/media-manager/MediaManagerHandler.js +30 -5
  148. package/lib/media-manager/Thumb.js +7 -13
  149. package/lib/media-manager/helpers/MediaManagerHelper.d.ts +6 -4
  150. package/lib/media-manager/helpers/MediaManagerHelper.js +18 -18
  151. package/lib/model/AbstractModel.d.ts +9 -5
  152. package/lib/model/AbstractModel.js +9 -13
  153. package/lib/model/InternalModelAccessFactory.js +9 -10
  154. package/lib/model/ModelHandler.d.ts +45 -7
  155. package/lib/model/ModelHandler.js +168 -11
  156. package/lib/model/adapter/sequelize.d.ts +2 -4
  157. package/lib/model/adapter/sequelize.js +16 -193
  158. package/lib/model/adapter/typeorm.d.ts +2 -4
  159. package/lib/model/adapter/typeorm.js +2 -35
  160. package/lib/notifications/AbstractNotificationService.d.ts +9 -9
  161. package/lib/notifications/AbstractNotificationService.js +8 -8
  162. package/lib/notifications/GeneralNotificationService.js +1 -1
  163. package/lib/notifications/SystemNotificationService.js +1 -1
  164. package/lib/ui-i18n/uiTranslationKeys.d.ts +1 -1
  165. package/lib/ui-i18n/uiTranslationKeys.js +1 -0
  166. package/lib/widgets/abstractCustom.d.ts +5 -2
  167. package/lib/widgets/abstractCustom.js +4 -0
  168. package/lib/widgets/widgetHandler.d.ts +5 -2
  169. package/lib/widgets/widgetHandler.js +60 -14
  170. package/models/{FilterAP.d.ts → Filter.d.ts} +4 -70
  171. package/models/Filter.js +1 -0
  172. package/models/FilterColumn.d.ts +10 -0
  173. package/models/FilterColumn.js +1 -0
  174. package/models/Group.d.ts +8 -0
  175. package/models/Group.js +1 -0
  176. package/models/HistoryActions.d.ts +14 -0
  177. package/models/HistoryActions.js +1 -0
  178. package/models/MediaManagerAP.d.ts +2 -54
  179. package/models/MediaManagerAP.js +1 -51
  180. package/models/MediaManagerAssociationsAP.d.ts +1 -35
  181. package/models/MediaManagerAssociationsAP.js +1 -33
  182. package/models/MediaManagerMetaAP.d.ts +2 -30
  183. package/models/MediaManagerMetaAP.js +1 -27
  184. package/models/Notification.d.ts +13 -0
  185. package/models/Notification.js +1 -0
  186. package/models/User.d.ts +23 -0
  187. package/models/User.js +1 -0
  188. package/models/UserNotification.d.ts +7 -0
  189. package/models/UserNotification.js +1 -0
  190. package/package.json +25 -30
  191. package/services/FeedService.d.ts +5 -5
  192. package/services/FeedService.js +1 -1
  193. package/system/Router.js +2 -10
  194. package/system/bindAccessRights.js +1 -1
  195. package/system/bindAuthorization.js +2 -2
  196. package/system/bindControls.js +7 -6
  197. package/system/bindDashboardWidgets.js +3 -2
  198. package/system/bindDev.js +1 -1
  199. package/system/bindHistory.d.ts +1 -1
  200. package/system/bindHistory.js +1 -1
  201. package/system/bindInertia.js +0 -6
  202. package/system/bindMediaManager.js +4 -17
  203. package/system/bindNotifications.d.ts +1 -1
  204. package/system/bindNotifications.js +1 -1
  205. package/system/bindReqFunctions.d.ts +1 -0
  206. package/system/bindReqFunctions.js +20 -3
  207. package/system/buildInternalModelAccess.js +2 -15
  208. package/system/defaults.js +5 -10
  209. package/system/systemModelContracts.d.ts +22 -0
  210. package/system/systemModelContracts.js +155 -0
  211. package/system/validateSystemModels.d.ts +2 -0
  212. package/system/validateSystemModels.js +101 -0
  213. package/translations/ar.json +2 -1
  214. package/translations/cn.json +2 -1
  215. package/translations/de.json +2 -1
  216. package/translations/en.json +1 -0
  217. package/translations/es.json +2 -1
  218. package/translations/fr.json +2 -1
  219. package/translations/hi.json +2 -1
  220. package/translations/jp.json +2 -1
  221. package/translations/ko.json +2 -1
  222. package/translations/pt.json +2 -1
  223. package/translations/ru.json +2 -1
  224. package/translations/ua.json +2 -1
  225. package/translations/uz.json +2 -1
  226. package/translations/vi.json +2 -1
  227. package/assets/RelationDialogStack-DhThUMep.js +0 -20
  228. package/assets/add-group-L8lMigab.js +0 -1
  229. package/assets/add-group-form-o7F6t6qW.js +0 -1
  230. package/assets/add-user-BE4-TNJw.js +0 -1
  231. package/assets/add-user-form-BP_8TjxN.js +0 -1
  232. package/assets/add-w398ZkhF.js +0 -1
  233. package/assets/app-C7J5ccrI.css +0 -1
  234. package/assets/app-layout-Bg455MIY.js +0 -1
  235. package/assets/app-shell-BT2kF0We.js +0 -1
  236. package/assets/app-sidebar-CZfPUXck.js +0 -1
  237. package/assets/app-sidebar-header-UVcKhNm6.js +0 -1
  238. package/assets/breadcrumbs-CrqIBT84.js +0 -1
  239. package/assets/catalog-btkCCwiv.js +0 -6
  240. package/assets/dashboard-Bvasc1cr.js +0 -3
  241. package/assets/date-picker-kxQWOxHk.js +0 -1
  242. package/assets/del-modal-C39LR5aQ.js +0 -1
  243. package/assets/dynamic-controls-DyPP5sTC.js +0 -1
  244. package/assets/geo-json-CGNQFl6J.js +0 -1
  245. package/assets/handsontable-Dv59QFH5.js +0 -336
  246. package/assets/history-DwKR8MPu.js +0 -1
  247. package/assets/home-BrtAkCRj.js +0 -2
  248. package/assets/icon-DpUVVHmK.js +0 -1
  249. package/assets/init-user-8PiKR1zX.js +0 -1
  250. package/assets/input-error-Cbt-Y3Fj.js +0 -1
  251. package/assets/jsoneditor-CiPXPMho.js +0 -3869
  252. package/assets/list-DGsL_qii.js +0 -4
  253. package/assets/login-Br_FcBU_.js +0 -1
  254. package/assets/material-icon-DOkM71fv.js +0 -1
  255. package/assets/module-EgfgIEhF.js +0 -1
  256. package/assets/monaco-ompgKQ3_.js +0 -11
  257. package/assets/nav-footer-DzLwfBAE.js +0 -1
  258. package/assets/nav-main-CSEbjYgs.js +0 -1
  259. package/assets/nav-user-DJ0hfhfH.js +0 -1
  260. package/assets/notification-B19ZLro7.js +0 -20
  261. package/assets/pagination-render-8GvJxq55.js +0 -1
  262. package/assets/register-CZzIeT2G.js +0 -1
  263. package/assets/ru-1NdRIQNV.js +0 -1
  264. package/assets/theme-switcher-CBbEj1u-.js +0 -1
  265. package/assets/toast-editor-DwVqd1rz.js +0 -668
  266. package/assets/user-filters-list-7Im79QyS.js +0 -1
  267. package/assets/user-info-YiU17Mmy.js +0 -1
  268. package/assets/user-menu-content-gdpNF5-8.js +0 -1
  269. package/assets/vanilla-picker-B3LgXoKV.js +0 -2
  270. package/assets/vendor-l0sNRNKZ.js +0 -1
  271. package/assets/welcome-nT0eFWHb.js +0 -1
  272. package/controllers/navigation/edit.d.ts +0 -1
  273. package/controllers/navigation/edit.js +0 -8
  274. package/lib/ai-assistant/DummyAiModelService.d.ts +0 -8
  275. package/lib/ai-assistant/DummyAiModelService.js +0 -14
  276. package/lib/ai-assistant/OpenAiModelService.d.ts +0 -24
  277. package/lib/ai-assistant/OpenAiModelService.js +0 -184
  278. package/lib/catalog/Navigation.d.ts +0 -49
  279. package/lib/catalog/Navigation.js +0 -492
  280. package/lib/controls/AbstractControls.d.ts +0 -30
  281. package/lib/controls/AbstractControls.js +0 -14
  282. package/lib/media-manager/DefaultMediaManager.d.ts +0 -20
  283. package/lib/media-manager/DefaultMediaManager.js +0 -127
  284. package/lib/media-manager/Items.d.ts +0 -50
  285. package/lib/media-manager/Items.js +0 -296
  286. package/models/FilterAP.js +0 -68
  287. package/models/FilterColumnAP.d.ts +0 -32
  288. package/models/FilterColumnAP.js +0 -21
  289. package/models/GroupAP.d.ts +0 -31
  290. package/models/GroupAP.js +0 -22
  291. package/models/HistoryActionsAP.d.ts +0 -56
  292. package/models/HistoryActionsAP.js +0 -42
  293. package/models/NavigationAP.d.ts +0 -22
  294. package/models/NavigationAP.js +0 -16
  295. package/models/NotificationAP.d.ts +0 -44
  296. package/models/NotificationAP.js +0 -30
  297. package/models/UserAP.d.ts +0 -81
  298. package/models/UserAP.js +0 -57
  299. package/models/UserNotificationAP.d.ts +0 -26
  300. package/models/UserNotificationAP.js +0 -18
  301. package/system/bindAiAssistant.d.ts +0 -2
  302. package/system/bindAiAssistant.js +0 -30
  303. package/system/bindModels.d.ts +0 -2
  304. package/system/bindModels.js +0 -48
  305. package/system/bindNavigation.d.ts +0 -2
  306. package/system/bindNavigation.js +0 -38
  307. /package/assets/{RelationDialogStack-B00Ot5qS.css → controls/ckeditor.css} +0 -0
@@ -1,336 +0,0 @@
1
- import{g as q$}from"./jsoneditor-CiPXPMho.js";function Z6(n,e){for(var t=0;t<e.length;t++){const o=e[t];if(typeof o!="string"&&!Array.isArray(o)){for(const i in o)if(i!=="default"&&!(i in n)){const s=Object.getOwnPropertyDescriptor(o,i);s&&Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:()=>o[i]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}var q_={exports:{}},ze={};var EI;function Q6(){if(EI)return ze;EI=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),r=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),u=Symbol.iterator;function f(D){return D===null||typeof D!="object"?null:(D=u&&D[u]||D["@@iterator"],typeof D=="function"?D:null)}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,y={};function _(D,K,ye){this.props=D,this.context=K,this.refs=y,this.updater=ye||p}_.prototype.isReactComponent={},_.prototype.setState=function(D,K){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,K,"setState")},_.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function T(){}T.prototype=_.prototype;function P(D,K,ye){this.props=D,this.context=K,this.refs=y,this.updater=ye||p}var $=P.prototype=new T;$.constructor=P,C($,_.prototype),$.isPureReactComponent=!0;var F=Array.isArray;function N(){}var I={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function U(D,K,ye){var z=ye.ref;return{$$typeof:n,type:D,key:K,ref:z!==void 0?z:null,props:ye}}function G(D,K){return U(D.type,K,D.props)}function te(D){return typeof D=="object"&&D!==null&&D.$$typeof===n}function Q(D){var K={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ye){return K[ye]})}var be=/\/+/g;function Oe(D,K){return typeof D=="object"&&D!==null&&D.key!=null?Q(""+D.key):K.toString(36)}function Ve(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(N,N):(D.status="pending",D.then(function(K){D.status==="pending"&&(D.status="fulfilled",D.value=K)},function(K){D.status==="pending"&&(D.status="rejected",D.reason=K)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function Ke(D,K,ye,z,Ee){var Ge=typeof D;(Ge==="undefined"||Ge==="boolean")&&(D=null);var g=!1;if(D===null)g=!0;else switch(Ge){case"bigint":case"string":case"number":g=!0;break;case"object":switch(D.$$typeof){case n:case e:g=!0;break;case c:return g=D._init,Ke(g(D._payload),K,ye,z,Ee)}}if(g)return Ee=Ee(D),g=z===""?"."+Oe(D,0):z,F(Ee)?(ye="",g!=null&&(ye=g.replace(be,"$&/")+"/"),Ke(Ee,K,ye,"",function(m){return m})):Ee!=null&&(te(Ee)&&(Ee=G(Ee,ye+(Ee.key==null||D&&D.key===Ee.key?"":(""+Ee.key).replace(be,"$&/")+"/")+g)),K.push(Ee)),1;g=0;var b=z===""?".":z+":";if(F(D))for(var v=0;v<D.length;v++)z=D[v],Ge=b+Oe(z,v),g+=Ke(z,K,ye,Ge,Ee);else if(v=f(D),typeof v=="function")for(D=v.call(D),v=0;!(z=D.next()).done;)z=z.value,Ge=b+Oe(z,v++),g+=Ke(z,K,ye,Ge,Ee);else if(Ge==="object"){if(typeof D.then=="function")return Ke(Ve(D),K,ye,z,Ee);throw K=String(D),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return g}function He(D,K,ye){if(D==null)return D;var z=[],Ee=0;return Ke(D,z,"","",function(Ge){return K.call(ye,Ge,Ee++)}),z}function Ye(D){if(D._status===-1){var K=D._result;K=K(),K.then(function(ye){(D._status===0||D._status===-1)&&(D._status=1,D._result=ye)},function(ye){(D._status===0||D._status===-1)&&(D._status=2,D._result=ye)}),D._status===-1&&(D._status=0,D._result=K)}if(D._status===1)return D._result.default;throw D._result}var bt=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},sn={map:He,forEach:function(D,K,ye){He(D,function(){K.apply(this,arguments)},ye)},count:function(D){var K=0;return He(D,function(){K++}),K},toArray:function(D){return He(D,function(K){return K})||[]},only:function(D){if(!te(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return ze.Activity=d,ze.Children=sn,ze.Component=_,ze.Fragment=t,ze.Profiler=i,ze.PureComponent=P,ze.StrictMode=o,ze.Suspense=l,ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,ze.__COMPILER_RUNTIME={__proto__:null,c:function(D){return I.H.useMemoCache(D)}},ze.cache=function(D){return function(){return D.apply(null,arguments)}},ze.cacheSignal=function(){return null},ze.cloneElement=function(D,K,ye){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var z=C({},D.props),Ee=D.key;if(K!=null)for(Ge in K.key!==void 0&&(Ee=""+K.key),K)!j.call(K,Ge)||Ge==="key"||Ge==="__self"||Ge==="__source"||Ge==="ref"&&K.ref===void 0||(z[Ge]=K[Ge]);var Ge=arguments.length-2;if(Ge===1)z.children=ye;else if(1<Ge){for(var g=Array(Ge),b=0;b<Ge;b++)g[b]=arguments[b+2];z.children=g}return U(D.type,Ee,z)},ze.createContext=function(D){return D={$$typeof:r,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:s,_context:D},D},ze.createElement=function(D,K,ye){var z,Ee={},Ge=null;if(K!=null)for(z in K.key!==void 0&&(Ge=""+K.key),K)j.call(K,z)&&z!=="key"&&z!=="__self"&&z!=="__source"&&(Ee[z]=K[z]);var g=arguments.length-2;if(g===1)Ee.children=ye;else if(1<g){for(var b=Array(g),v=0;v<g;v++)b[v]=arguments[v+2];Ee.children=b}if(D&&D.defaultProps)for(z in g=D.defaultProps,g)Ee[z]===void 0&&(Ee[z]=g[z]);return U(D,Ge,Ee)},ze.createRef=function(){return{current:null}},ze.forwardRef=function(D){return{$$typeof:a,render:D}},ze.isValidElement=te,ze.lazy=function(D){return{$$typeof:c,_payload:{_status:-1,_result:D},_init:Ye}},ze.memo=function(D,K){return{$$typeof:h,type:D,compare:K===void 0?null:K}},ze.startTransition=function(D){var K=I.T,ye={};I.T=ye;try{var z=D(),Ee=I.S;Ee!==null&&Ee(ye,z),typeof z=="object"&&z!==null&&typeof z.then=="function"&&z.then(N,bt)}catch(Ge){bt(Ge)}finally{K!==null&&ye.types!==null&&(K.types=ye.types),I.T=K}},ze.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},ze.use=function(D){return I.H.use(D)},ze.useActionState=function(D,K,ye){return I.H.useActionState(D,K,ye)},ze.useCallback=function(D,K){return I.H.useCallback(D,K)},ze.useContext=function(D){return I.H.useContext(D)},ze.useDebugValue=function(){},ze.useDeferredValue=function(D,K){return I.H.useDeferredValue(D,K)},ze.useEffect=function(D,K){return I.H.useEffect(D,K)},ze.useEffectEvent=function(D){return I.H.useEffectEvent(D)},ze.useId=function(){return I.H.useId()},ze.useImperativeHandle=function(D,K,ye){return I.H.useImperativeHandle(D,K,ye)},ze.useInsertionEffect=function(D,K){return I.H.useInsertionEffect(D,K)},ze.useLayoutEffect=function(D,K){return I.H.useLayoutEffect(D,K)},ze.useMemo=function(D,K){return I.H.useMemo(D,K)},ze.useOptimistic=function(D,K){return I.H.useOptimistic(D,K)},ze.useReducer=function(D,K,ye){return I.H.useReducer(D,K,ye)},ze.useRef=function(D){return I.H.useRef(D)},ze.useState=function(D){return I.H.useState(D)},ze.useSyncExternalStore=function(D,K,ye){return I.H.useSyncExternalStore(D,K,ye)},ze.useTransition=function(){return I.H.useTransition()},ze.version="19.2.7",ze}var kI;function K$(){return kI||(kI=1,q_.exports=Q6()),q_.exports}var Be=K$();const Zn=q$(Be),f_e=Z6({__proto__:null,default:Zn},[Be]);var K_={exports:{}},$o={};var TI;function J6(){if(TI)return $o;TI=1;var n=K$();function e(l){var h="https://react.dev/errors/"+l;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)h+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+l+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var o={d:{f:t,r:function(){throw Error(e(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(l,h,c){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:d==null?null:""+d,children:l,containerInfo:h,implementation:c}}var r=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(l,h){if(l==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return $o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,$o.createPortal=function(l,h){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return s(l,h,null,c)},$o.flushSync=function(l){var h=r.T,c=o.p;try{if(r.T=null,o.p=2,l)return l()}finally{r.T=h,o.p=c,o.d.f()}},$o.preconnect=function(l,h){typeof l=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(l,h))},$o.prefetchDNS=function(l){typeof l=="string"&&o.d.D(l)},$o.preinit=function(l,h){if(typeof l=="string"&&h&&typeof h.as=="string"){var c=h.as,d=a(c,h.crossOrigin),u=typeof h.integrity=="string"?h.integrity:void 0,f=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;c==="style"?o.d.S(l,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:d,integrity:u,fetchPriority:f}):c==="script"&&o.d.X(l,{crossOrigin:d,integrity:u,fetchPriority:f,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},$o.preinitModule=function(l,h){if(typeof l=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var c=a(h.as,h.crossOrigin);o.d.M(l,{crossOrigin:c,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(l)},$o.preload=function(l,h){if(typeof l=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var c=h.as,d=a(c,h.crossOrigin);o.d.L(l,c,{crossOrigin:d,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},$o.preloadModule=function(l,h){if(typeof l=="string")if(h){var c=a(h.as,h.crossOrigin);o.d.m(l,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:c,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(l)},$o.requestFormReset=function(l){o.d.r(l)},$o.unstable_batchedUpdates=function(l,h){return l(h)},$o.useFormState=function(l,h,c){return r.H.useFormState(l,h,c)},$o.useFormStatus=function(){return r.H.useHostTransitionStatus()},$o.version="19.2.7",$o}var xI;function eG(){if(xI)return K_.exports;xI=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),K_.exports=J6(),K_.exports}var tG=eG();const X$=q$(tG);function MI(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,o=Array(e);t<e;t++)o[t]=n[t];return o}function nG(n){if(Array.isArray(n))return n}function oG(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var o,i,s,r,a=[],l=!0,h=!1;try{if(s=(t=t.call(n)).next,e!==0)for(;!(l=(o=s.call(t)).done)&&(a.push(o.value),a.length!==e);l=!0);}catch(c){h=!0,i=c}finally{try{if(!l&&t.return!=null&&(r=t.return(),Object(r)!==r))return}finally{if(h)throw i}}return a}}function iG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sG(n,e){return nG(n)||oG(n,e)||rG(n,e)||iG()}function rG(n,e){if(n){if(typeof n=="string")return MI(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?MI(n,e):void 0}}const Z$=Object.entries,II=Object.setPrototypeOf,aG=Object.isFrozen,lG=Object.getPrototypeOf,hG=Object.getOwnPropertyDescriptor;let Po=Object.freeze,Lo=Object.seal,fu=Object.create,Q$=typeof Reflect<"u"&&Reflect,yE=Q$.apply,_E=Q$.construct;Po||(Po=function(e){return e});Lo||(Lo=function(e){return e});yE||(yE=function(e,t){for(var o=arguments.length,i=new Array(o>2?o-2:0),s=2;s<o;s++)i[s-2]=arguments[s];return e.apply(t,i)});_E||(_E=function(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),i=1;i<t;i++)o[i-1]=arguments[i];return new e(...o)});const Mf=Qn(Array.prototype.forEach),cG=Qn(Array.prototype.lastIndexOf),HI=Qn(Array.prototype.pop),fd=Qn(Array.prototype.push),dG=Qn(Array.prototype.splice),eh=Array.isArray,jg=Qn(String.prototype.toLowerCase),X_=Qn(String.prototype.toString),AI=Qn(String.prototype.match),If=Qn(String.prototype.replace),OI=Qn(String.prototype.indexOf),uG=Qn(String.prototype.trim),fG=Qn(Number.prototype.toString),gG=Qn(Boolean.prototype.toString),DI=typeof BigInt>"u"?null:Qn(BigInt.prototype.toString),NI=typeof Symbol>"u"?null:Qn(Symbol.prototype.toString),_o=Qn(Object.prototype.hasOwnProperty),Hf=Qn(Object.prototype.toString),Ho=Qn(RegExp.prototype.test),xh=pG(TypeError);function Qn(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,o=new Array(t>1?t-1:0),i=1;i<t;i++)o[i-1]=arguments[i];return yE(n,e,o)}}function pG(n){return function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return _E(n,t)}}function mt(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:jg;if(II&&II(n,null),!eh(e))return n;let o=e.length;for(;o--;){let i=e[o];if(typeof i=="string"){const s=t(i);s!==i&&(aG(e)||(e[o]=s),i=s)}n[i]=!0}return n}function mG(n){for(let e=0;e<n.length;e++)_o(n,e)||(n[e]=null);return n}function di(n){const e=fu(null);for(const o of Z$(n)){var t=sG(o,2);const i=t[0],s=t[1];_o(n,i)&&(eh(s)?e[i]=mG(s):s&&typeof s=="object"&&s.constructor===Object?e[i]=di(s):e[i]=s)}return e}function wG(n){switch(typeof n){case"string":return n;case"number":return fG(n);case"boolean":return gG(n);case"bigint":return DI?DI(n):"0";case"symbol":return NI?NI(n):"Symbol()";case"undefined":return Hf(n);case"function":case"object":{if(n===null)return Hf(n);const e=n,t=Nr(e,"toString");if(typeof t=="function"){const o=t(e);return typeof o=="string"?o:Hf(o)}return Hf(n)}default:return Hf(n)}}function Nr(n,e){for(;n!==null;){const o=hG(n,e);if(o){if(o.get)return Qn(o.get);if(typeof o.value=="function")return Qn(o.value)}n=lG(n)}function t(){return null}return t}function bG(n){try{return Ho(n,""),!0}catch{return!1}}const PI=Po(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Z_=Po(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Q_=Po(["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"]),CG=Po(["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"]),J_=Po(["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"]),yG=Po(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),LI=Po(["#text"]),WI=Po(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),eS=Po(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$I=Po(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),hw=Po(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),_G=Lo(/{{[\w\W]*|^[\w\W]*}}/g),SG=Lo(/<%[\w\W]*|^[\w\W]*%>/g),vG=Lo(/\${[\w\W]*/g),RG=Lo(/^data-[\-\w.\u00B7-\uFFFF]+$/),EG=Lo(/^aria-[\-\w]+$/),FI=Lo(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),kG=Lo(/^(?:\w+script|data):/i),TG=Lo(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),xG=Lo(/^html$/i),MG=Lo(/^[a-z][.\w]*(-[.\w]+)+$/i),BI=Lo(/<[/\w!]/g),IG=Lo(/<[/\w]/g),HG=Lo(/<\/no(script|embed|frames)/i),AG=Lo(/\/>/i),vr={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},OG=function(){return typeof window>"u"?null:window},DG=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let o=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(o=t.getAttribute(i));const s="dompurify"+(o?"#"+o:"");try{return e.createPolicy(s,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},VI=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},_l=function(e,t,o,i){return _o(e,t)&&eh(e[t])?mt(i.base?di(i.base):{},e[t],i.transform):o};function J$(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:OG();const e=oe=>J$(oe);if(e.version="3.4.11",e.removed=[],!n||!n.document||n.document.nodeType!==vr.document||!n.Element)return e.isSupported=!1,e;let t=n.document;const o=t,i=o.currentScript;n.DocumentFragment;const s=n.HTMLTemplateElement,r=n.Node,a=n.Element,l=n.NodeFilter,h=n.NamedNodeMap;h===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const c=n.DOMParser,d=n.trustedTypes,u=a.prototype,f=Nr(u,"cloneNode"),p=Nr(u,"remove"),C=Nr(u,"nextSibling"),y=Nr(u,"childNodes"),_=Nr(u,"parentNode"),T=Nr(u,"shadowRoot"),P=Nr(u,"attributes"),$=r&&r.prototype?Nr(r.prototype,"nodeType"):null,F=r&&r.prototype?Nr(r.prototype,"nodeName"):null;if(typeof s=="function"){const oe=t.createElement("template");oe.content&&oe.content.ownerDocument&&(t=oe.content.ownerDocument)}let N,I="",j,U=!1,G=0;const te=function(){if(G>0)throw xh('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Q=function(k){te(),G++;try{return N.createHTML(k)}finally{G--}},be=function(k){te(),G++;try{return N.createScriptURL(k)}finally{G--}},Oe=function(){return U||(j=DG(d,i),U=!0),j},Ve=t,Ke=Ve.implementation,He=Ve.createNodeIterator,Ye=Ve.createDocumentFragment,bt=Ve.getElementsByTagName,sn=o.importNode;let D=VI();e.isSupported=typeof Z$=="function"&&typeof _=="function"&&Ke&&Ke.createHTMLDocument!==void 0;const K=_G,ye=SG,z=vG,Ee=RG,Ge=EG,g=kG,b=TG,v=MG;let m=FI,w=null;const S=mt({},[...PI,...Z_,...Q_,...J_,...LI]);let R=null;const x=mt({},[...WI,...eS,...$I,...hw]);let M=Object.seal(fu(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}})),L=null,E=null;const A=Object.seal(fu(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let W=!0,H=!0,q=!1,ge=!0,se=!1,Me=!0,xe=!1,Je=!1,De=null,et=null,Vt=!1,Hn=!1,co=!1,rn=!1,Yt=!0,Wo=!1;const uo="user-content-";let _n=!0,At=!1,_r={},eo=null;const wl=mt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let bl=null;const Sr=mt({},["audio","video","img","source","image","track"]);let kf=null;const sw=mt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Cl="http://www.w3.org/1998/Math/MathML",oi="http://www.w3.org/2000/svg",Sn="http://www.w3.org/1999/xhtml";let ua=Sn,cd=!1,B_=null;const N6=mt({},[Cl,oi,Sn],X_),fI=Po(["mi","mo","mn","ms","mtext"]);let V_=mt({},fI);const gI=Po(["annotation-xml"]);let z_=mt({},gI);const P6=mt({},["title","style","font","a","script"]);let Tf=null;const L6=["application/xhtml+xml","text/html"],W6="text/html";let vn=null,dd=null;const $6=t.createElement("form"),pI=function(k){return k instanceof RegExp||k instanceof Function},U_=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(dd&&dd===k)return;(!k||typeof k!="object")&&(k={}),k=di(k),Tf=L6.indexOf(k.PARSER_MEDIA_TYPE)===-1?W6:k.PARSER_MEDIA_TYPE,vn=Tf==="application/xhtml+xml"?X_:jg,w=_l(k,"ALLOWED_TAGS",S,{transform:vn}),R=_l(k,"ALLOWED_ATTR",x,{transform:vn}),B_=_l(k,"ALLOWED_NAMESPACES",N6,{transform:X_}),kf=_l(k,"ADD_URI_SAFE_ATTR",sw,{transform:vn,base:sw}),bl=_l(k,"ADD_DATA_URI_TAGS",Sr,{transform:vn,base:Sr}),eo=_l(k,"FORBID_CONTENTS",wl,{transform:vn}),L=_l(k,"FORBID_TAGS",di({}),{transform:vn}),E=_l(k,"FORBID_ATTR",di({}),{transform:vn}),_r=_o(k,"USE_PROFILES")?k.USE_PROFILES&&typeof k.USE_PROFILES=="object"?di(k.USE_PROFILES):k.USE_PROFILES:!1,W=k.ALLOW_ARIA_ATTR!==!1,H=k.ALLOW_DATA_ATTR!==!1,q=k.ALLOW_UNKNOWN_PROTOCOLS||!1,ge=k.ALLOW_SELF_CLOSE_IN_ATTR!==!1,se=k.SAFE_FOR_TEMPLATES||!1,Me=k.SAFE_FOR_XML!==!1,xe=k.WHOLE_DOCUMENT||!1,Hn=k.RETURN_DOM||!1,co=k.RETURN_DOM_FRAGMENT||!1,rn=k.RETURN_TRUSTED_TYPE||!1,Vt=k.FORCE_BODY||!1,Yt=k.SANITIZE_DOM!==!1,Wo=k.SANITIZE_NAMED_PROPS||!1,_n=k.KEEP_CONTENT!==!1,At=k.IN_PLACE||!1,m=bG(k.ALLOWED_URI_REGEXP)?k.ALLOWED_URI_REGEXP:FI,ua=typeof k.NAMESPACE=="string"?k.NAMESPACE:Sn,V_=_o(k,"MATHML_TEXT_INTEGRATION_POINTS")&&k.MATHML_TEXT_INTEGRATION_POINTS&&typeof k.MATHML_TEXT_INTEGRATION_POINTS=="object"?di(k.MATHML_TEXT_INTEGRATION_POINTS):mt({},fI),z_=_o(k,"HTML_INTEGRATION_POINTS")&&k.HTML_INTEGRATION_POINTS&&typeof k.HTML_INTEGRATION_POINTS=="object"?di(k.HTML_INTEGRATION_POINTS):mt({},gI);const B=_o(k,"CUSTOM_ELEMENT_HANDLING")&&k.CUSTOM_ELEMENT_HANDLING&&typeof k.CUSTOM_ELEMENT_HANDLING=="object"?di(k.CUSTOM_ELEMENT_HANDLING):fu(null);if(M=fu(null),_o(B,"tagNameCheck")&&pI(B.tagNameCheck)&&(M.tagNameCheck=B.tagNameCheck),_o(B,"attributeNameCheck")&&pI(B.attributeNameCheck)&&(M.attributeNameCheck=B.attributeNameCheck),_o(B,"allowCustomizedBuiltInElements")&&typeof B.allowCustomizedBuiltInElements=="boolean"&&(M.allowCustomizedBuiltInElements=B.allowCustomizedBuiltInElements),Lo(M),se&&(H=!1),co&&(Hn=!0),_r&&(w=mt({},LI),R=fu(null),_r.html===!0&&(mt(w,PI),mt(R,WI)),_r.svg===!0&&(mt(w,Z_),mt(R,eS),mt(R,hw)),_r.svgFilters===!0&&(mt(w,Q_),mt(R,eS),mt(R,hw)),_r.mathMl===!0&&(mt(w,J_),mt(R,$I),mt(R,hw))),A.tagCheck=null,A.attributeCheck=null,_o(k,"ADD_TAGS")&&(typeof k.ADD_TAGS=="function"?A.tagCheck=k.ADD_TAGS:eh(k.ADD_TAGS)&&(w===S&&(w=di(w)),mt(w,k.ADD_TAGS,vn))),_o(k,"ADD_ATTR")&&(typeof k.ADD_ATTR=="function"?A.attributeCheck=k.ADD_ATTR:eh(k.ADD_ATTR)&&(R===x&&(R=di(R)),mt(R,k.ADD_ATTR,vn))),_o(k,"ADD_URI_SAFE_ATTR")&&eh(k.ADD_URI_SAFE_ATTR)&&mt(kf,k.ADD_URI_SAFE_ATTR,vn),_o(k,"FORBID_CONTENTS")&&eh(k.FORBID_CONTENTS)&&(eo===wl&&(eo=di(eo)),mt(eo,k.FORBID_CONTENTS,vn)),_o(k,"ADD_FORBID_CONTENTS")&&eh(k.ADD_FORBID_CONTENTS)&&(eo===wl&&(eo=di(eo)),mt(eo,k.ADD_FORBID_CONTENTS,vn)),_n&&(w["#text"]=!0),xe&&mt(w,["html","head","body"]),w.table&&(mt(w,["tbody"]),delete L.tbody),k.TRUSTED_TYPES_POLICY){if(typeof k.TRUSTED_TYPES_POLICY.createHTML!="function")throw xh('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof k.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw xh('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ne=N;N=k.TRUSTED_TYPES_POLICY;try{I=Q("")}catch(Ce){throw N=ne,Ce}}else k.TRUSTED_TYPES_POLICY===null?(N=void 0,I=""):(N===void 0&&(N=Oe()),N&&typeof I=="string"&&(I=Q("")));Po&&Po(k),dd=k},mI=mt({},[...Z_,...Q_,...CG]),wI=mt({},[...J_,...yG]),F6=function(k,B,ne){return B.namespaceURI===Sn?k==="svg":B.namespaceURI===Cl?k==="svg"&&(ne==="annotation-xml"||V_[ne]):!!mI[k]},B6=function(k,B,ne){return B.namespaceURI===Sn?k==="math":B.namespaceURI===oi?k==="math"&&z_[ne]:!!wI[k]},V6=function(k,B,ne){return B.namespaceURI===oi&&!z_[ne]||B.namespaceURI===Cl&&!V_[ne]?!1:!wI[k]&&(P6[k]||!mI[k])},z6=function(k){let B=_(k);(!B||!B.tagName)&&(B={namespaceURI:ua,tagName:"template"});const ne=jg(k.tagName),Ce=jg(B.tagName);return B_[k.namespaceURI]?k.namespaceURI===oi?F6(ne,B,Ce):k.namespaceURI===Cl?B6(ne,B,Ce):k.namespaceURI===Sn?V6(ne,B,Ce):!!(Tf==="application/xhtml+xml"&&B_[k.namespaceURI]):!1},yl=function(k){fd(e.removed,{element:k});try{_(k).removeChild(k)}catch{if(p(k),!_(k))throw xh("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},bI=function(k){const B=y(k);if(B){const Ce=[];Mf(B,ot=>{fd(Ce,ot)}),Mf(Ce,ot=>{try{p(ot)}catch{}})}const ne=P(k);if(ne)for(let Ce=ne.length-1;Ce>=0;--Ce){const ot=ne[Ce],Ct=ot&&ot.name;if(typeof Ct=="string")try{k.removeAttribute(Ct)}catch{}}},Th=function(k,B){try{fd(e.removed,{attribute:B.getAttributeNode(k),from:B})}catch{fd(e.removed,{attribute:null,from:B})}if(B.removeAttribute(k),k==="is")if(Hn||co)try{yl(B)}catch{}else try{B.setAttribute(k,"")}catch{}},U6=function(k){const B=P(k);if(B)for(let ne=B.length-1;ne>=0;--ne){const Ce=B[ne],ot=Ce&&Ce.name;if(!(typeof ot!="string"||R[vn(ot)]))try{k.removeAttribute(ot)}catch{}}},Y6=function(k){const B=[k];for(;B.length>0;){const ne=B.pop();($?$(ne):ne.nodeType)===vr.element&&U6(ne);const ot=y(ne);if(ot)for(let Ct=ot.length-1;Ct>=0;--Ct)B.push(ot[Ct])}},CI=function(k){let B=null,ne=null;if(Vt)k="<remove></remove>"+k;else{const Ct=AI(k,/^[\r\n\t ]+/);ne=Ct&&Ct[0]}Tf==="application/xhtml+xml"&&ua===Sn&&(k='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+k+"</body></html>");const Ce=N?Q(k):k;if(ua===Sn)try{B=new c().parseFromString(Ce,Tf)}catch{}if(!B||!B.documentElement){B=Ke.createDocument(ua,"template",null);try{B.documentElement.innerHTML=cd?I:Ce}catch{}}const ot=B.body||B.documentElement;return k&&ne&&ot.insertBefore(t.createTextNode(ne),ot.childNodes[0]||null),ua===Sn?bt.call(B,xe?"html":"body")[0]:xe?B.documentElement:ot},yI=function(k){return He.call(k.ownerDocument||k,k,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},rw=function(k){return k=If(k,K," "),k=If(k,ye," "),k=If(k,z," "),k},Y_=function(k){var B;k.normalize();const ne=He.call(k.ownerDocument||k,k,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let Ce=ne.nextNode();for(;Ce;)Ce.data=rw(Ce.data),Ce=ne.nextNode();const ot=(B=k.querySelectorAll)===null||B===void 0?void 0:B.call(k,"template");ot&&Mf(ot,Ct=>{ud(Ct.content)&&Y_(Ct.content)})},aw=function(k){const B=F?F(k):null;return typeof B!="string"||vn(B)!=="form"?!1:typeof k.nodeName!="string"||typeof k.textContent!="string"||typeof k.removeChild!="function"||k.attributes!==P(k)||typeof k.removeAttribute!="function"||typeof k.setAttribute!="function"||typeof k.namespaceURI!="string"||typeof k.insertBefore!="function"||typeof k.hasChildNodes!="function"||k.nodeType!==$(k)||k.childNodes!==y(k)},ud=function(k){if(!$||typeof k!="object"||k===null)return!1;try{return $(k)===vr.documentFragment}catch{return!1}},xf=function(k){if(!$||typeof k!="object"||k===null)return!1;try{return typeof $(k)=="number"}catch{return!1}};function fa(oe,k,B){oe.length!==0&&Mf(oe,ne=>{ne.call(e,k,B,dd)})}const G6=function(k,B){return!!(Me&&k.hasChildNodes()&&!xf(k.firstElementChild)&&Ho(BI,k.textContent)&&Ho(BI,k.innerHTML)||Me&&k.namespaceURI===Sn&&B==="style"&&xf(k.firstElementChild)||k.nodeType===vr.processingInstruction||Me&&k.nodeType===vr.comment&&Ho(IG,k.data))},j6=function(k,B){if(!L[B]&&vI(B)&&(M.tagNameCheck instanceof RegExp&&Ho(M.tagNameCheck,B)||M.tagNameCheck instanceof Function&&M.tagNameCheck(B)))return!1;if(_n&&!eo[B]){const ne=_(k),Ce=y(k);if(Ce&&ne){const ot=Ce.length;for(let Ct=ot-1;Ct>=0;--Ct){const fo=At?Ce[Ct]:f(Ce[Ct],!0);ne.insertBefore(fo,C(k))}}}return yl(k),!0},_I=function(k){if(fa(D.beforeSanitizeElements,k,null),aw(k))return yl(k),!0;const B=vn(F?F(k):k.nodeName);if(fa(D.uponSanitizeElement,k,{tagName:B,allowedTags:w}),G6(k,B))return yl(k),!0;if(L[B]||!(A.tagCheck instanceof Function&&A.tagCheck(B))&&!w[B])return j6(k,B);if(($?$(k):k.nodeType)===vr.element&&!z6(k)||(B==="noscript"||B==="noembed"||B==="noframes")&&Ho(HG,k.innerHTML))return yl(k),!0;if(se&&k.nodeType===vr.text){const Ce=rw(k.textContent);k.textContent!==Ce&&(fd(e.removed,{element:k.cloneNode()}),k.textContent=Ce)}return fa(D.afterSanitizeElements,k,null),!1},SI=function(k,B,ne){if(E[B]||Yt&&(B==="id"||B==="name")&&(ne in t||ne in $6))return!1;const Ce=R[B]||A.attributeCheck instanceof Function&&A.attributeCheck(B,k);if(!(H&&Ho(Ee,B))){if(!(W&&Ho(Ge,B))){if(Ce){if(!kf[B]){if(!Ho(m,If(ne,b,""))){if(!((B==="src"||B==="xlink:href"||B==="href")&&k!=="script"&&OI(ne,"data:")===0&&bl[k])){if(!(q&&!Ho(g,If(ne,b,"")))){if(ne)return!1}}}}}else if(!(vI(k)&&(M.tagNameCheck instanceof RegExp&&Ho(M.tagNameCheck,k)||M.tagNameCheck instanceof Function&&M.tagNameCheck(k))&&(M.attributeNameCheck instanceof RegExp&&Ho(M.attributeNameCheck,B)||M.attributeNameCheck instanceof Function&&M.attributeNameCheck(B,k))||B==="is"&&M.allowCustomizedBuiltInElements&&(M.tagNameCheck instanceof RegExp&&Ho(M.tagNameCheck,ne)||M.tagNameCheck instanceof Function&&M.tagNameCheck(ne))))return!1}}return!0},q6=mt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),vI=function(k){return!q6[jg(k)]&&Ho(v,k)},K6=function(k,B,ne,Ce){if(N&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!ne)switch(d.getAttributeType(k,B)){case"TrustedHTML":return Q(Ce);case"TrustedScriptURL":return be(Ce)}return Ce},X6=function(k,B,ne,Ce){try{ne?k.setAttributeNS(ne,B,Ce):k.setAttribute(B,Ce),aw(k)?yl(k):HI(e.removed)}catch{Th(B,k)}},RI=function(k){fa(D.beforeSanitizeAttributes,k,null);const B=k.attributes;if(!B||aw(k))return;const ne={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:R,forceKeepAttr:void 0};let Ce=B.length;const ot=vn(k.nodeName);for(;Ce--;){const Ct=B[Ce],fo=Ct.name,Vn=Ct.namespaceURI,os=Ct.value,Hs=vn(fo),j_=os;let ii=fo==="value"?j_:uG(j_);if(ne.attrName=Hs,ne.attrValue=ii,ne.keepAttr=!0,ne.forceKeepAttr=void 0,fa(D.uponSanitizeAttribute,k,ne),ii=ne.attrValue,Wo&&(Hs==="id"||Hs==="name")&&OI(ii,uo)!==0&&(Th(fo,k),ii=uo+ii),Me&&Ho(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ii)){Th(fo,k);continue}if(Hs==="attributename"&&AI(ii,"href")){Th(fo,k);continue}if(!ne.forceKeepAttr){if(!ne.keepAttr){Th(fo,k);continue}if(!ge&&Ho(AG,ii)){Th(fo,k);continue}if(se&&(ii=rw(ii)),!SI(ot,Hs,ii)){Th(fo,k);continue}ii=K6(ot,Hs,Vn,ii),ii!==j_&&X6(k,fo,Vn,ii)}}fa(D.afterSanitizeAttributes,k,null)},lw=function(k){let B=null;const ne=yI(k);for(fa(D.beforeSanitizeShadowDOM,k,null);B=ne.nextNode();)if(fa(D.uponSanitizeShadowNode,B,null),_I(B),RI(B),ud(B.content)&&lw(B.content),($?$(B):B.nodeType)===vr.element){const ot=T(B);ud(ot)&&(G_(ot),lw(ot))}fa(D.afterSanitizeShadowDOM,k,null)},G_=function(k){const B=[{node:k,shadow:null}];for(;B.length>0;){const ne=B.pop();if(ne.shadow){lw(ne.shadow);continue}const Ce=ne.node,Ct=($?$(Ce):Ce.nodeType)===vr.element,fo=y(Ce);if(fo)for(let Vn=fo.length-1;Vn>=0;--Vn)B.push({node:fo[Vn],shadow:null});if(Ct){const Vn=F?F(Ce):null;if(typeof Vn=="string"&&vn(Vn)==="template"){const os=Ce.content;ud(os)&&B.push({node:os,shadow:null})}}if(Ct){const Vn=T(Ce);ud(Vn)&&B.push({node:null,shadow:Vn},{node:Vn,shadow:null})}}};return e.sanitize=function(oe){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},B=null,ne=null,Ce=null,ot=null;if(cd=!oe,cd&&(oe="<!-->"),typeof oe!="string"&&!xf(oe)&&(oe=wG(oe),typeof oe!="string"))throw xh("dirty is not a string, aborting");if(!e.isSupported)return oe;Je?(w=De,R=et):U_(k),(D.uponSanitizeElement.length>0||D.uponSanitizeAttribute.length>0)&&(w=di(w)),D.uponSanitizeAttribute.length>0&&(R=di(R)),e.removed=[];const Ct=At&&typeof oe!="string"&&xf(oe);if(Ct){const os=F?F(oe):oe.nodeName;if(typeof os=="string"){const Hs=vn(os);if(!w[Hs]||L[Hs])throw xh("root node is forbidden and cannot be sanitized in-place")}if(aw(oe))throw xh("root node is clobbered and cannot be sanitized in-place");try{G_(oe)}catch(Hs){throw bI(oe),Hs}}else if(xf(oe))B=CI("<!---->"),ne=B.ownerDocument.importNode(oe,!0),ne.nodeType===vr.element&&ne.nodeName==="BODY"||ne.nodeName==="HTML"?B=ne:B.appendChild(ne),G_(ne);else{if(!Hn&&!se&&!xe&&oe.indexOf("<")===-1)return N&&rn?Q(oe):oe;if(B=CI(oe),!B)return Hn?null:rn?I:""}B&&Vt&&yl(B.firstChild);const fo=yI(Ct?oe:B);try{for(;Ce=fo.nextNode();)_I(Ce),RI(Ce),ud(Ce.content)&&lw(Ce.content)}catch(os){throw Ct&&bI(oe),os}if(Ct)return Mf(e.removed,os=>{os.element&&Y6(os.element)}),se&&Y_(oe),oe;if(Hn){if(se&&Y_(B),co)for(ot=Ye.call(B.ownerDocument);B.firstChild;)ot.appendChild(B.firstChild);else ot=B;return(R.shadowroot||R.shadowrootmode)&&(ot=sn.call(o,ot,!0)),ot}let Vn=xe?B.outerHTML:B.innerHTML;return xe&&w["!doctype"]&&B.ownerDocument&&B.ownerDocument.doctype&&B.ownerDocument.doctype.name&&Ho(xG,B.ownerDocument.doctype.name)&&(Vn="<!DOCTYPE "+B.ownerDocument.doctype.name+`>
3
- `+Vn),se&&(Vn=rw(Vn)),N&&rn?Q(Vn):Vn},e.setConfig=function(){let oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};U_(oe),Je=!0,De=w,et=R},e.clearConfig=function(){dd=null,Je=!1,De=null,et=null,N=j,I=""},e.isValidAttribute=function(oe,k,B){dd||U_({});const ne=vn(oe),Ce=vn(k);return SI(ne,Ce,B)},e.addHook=function(oe,k){typeof k=="function"&&_o(D,oe)&&fd(D[oe],k)},e.removeHook=function(oe,k){if(_o(D,oe)){if(k!==void 0){const B=cG(D[oe],k);return B===-1?void 0:dG(D[oe],B,1)[0]}return HI(D[oe])}},e.removeHooks=function(oe){_o(D,oe)&&(D[oe]=[])},e.removeAllHooks=function(){D=VI()},e}var NG=J$();function PG(n){const e=n.length;let t=0;for(;t<e;)n[t]=[n[t]],t+=1}function zI(n,e){const t=e.length;let o=0;for(;o<t;)n.push(e[o]),o+=1}function $b(n){const e=[];if(!n||n.length===0||!n[0]||n[0].length===0)return e;const t=n.length,o=n[0].length;for(let i=0;i<t;i++)for(let s=0;s<o;s++)e[s]||(e[s]=[]),e[s][i]=n[i][s];return e}function Fi(n,e,t,o){let i=-1,s=n,r=t;Array.isArray(n)||(s=Array.from(n));const a=s.length;for(i+=1;i<a;)r=e(r,s[i],i,s),i+=1;return r}function Gc(n,e){let t=0,o=n;Array.isArray(n)||(o=Array.from(n));const i=o.length,s=[];let r=-1;for(;t<i;){const a=o[t];e(a,t,o)&&(r+=1,s[r]=a),t+=1}return s}function Mt(n,e){let t=0,o=n;Array.isArray(n)||(o=Array.from(n));const i=o.length,s=[];let r=-1;for(;t<i;){const a=o[t];r+=1,s[r]=e(a,t,o),t+=1}return s}function O(n,e){let t=0,o=n;Array.isArray(n)||(o=Array.from(n));const i=o.length;for(;t<i&&e(o[t],t,o)!==!1;)t+=1;return n}function LG(n){const e=[];return O(n,t=>{e.indexOf(t)===-1&&e.push(t)}),e}function UI(...n){const[e,...t]=[...n];let o=e;return O(t,i=>{o=o.filter(s=>!i.includes(s))}),o}function WG(...n){const e=n[n.length-1];let t,o=n;typeof e=="function"&&(t=e,o=o.slice(0,-1));const i=t?(l,h)=>h.some(c=>t(l,c)):(l,h)=>h.includes(l),[s,...r]=o;let a=s;return O(r,l=>{a=a.filter(h=>i(h,l))}),a}function YI(n,e=" "){return n.split(e)}function $G(n,e=" "){return n.join(e)}function pt(n,...e){return Fi(n,(o,i,s)=>{const r=i.replace(/\r?\n\s*/g,""),a=e[s]?e[s]:"";return o+r+a},"").trim()}function jc(n,...e){const t=document.createElement("template");t.innerHTML=n.reduce((s,r,a)=>s+r+(e[a]??""),"");const o=t.content.cloneNode(!0),i={};return o.querySelectorAll("[data-ref]").forEach(s=>{const r=s.getAttribute("data-ref");s.removeAttribute("data-ref"),i[r]=s}),{fragment:o,refs:i}}function yt(n){let e;switch(typeof n){case"string":case"number":e=`${n}`;break;case"object":e=n===null?"":n.toString();break;case"undefined":e="";break;default:e=n.toString();break}return e}function ee(n){return typeof n<"u"}function en(n){return typeof n>"u"}function ht(n){return n===null||n===""||en(n)}function FG(n){return Object.prototype.toString.call(n)==="[object RegExp]"}const qg="length",_p=n=>parseInt(n,16),GI=n=>parseInt(n,10),RC=(n,e,t)=>n.substr(e,t),Sp=n=>n.codePointAt(0)-65,SE=n=>`${n}`.replace(/\-/g,""),BG=n=>_p(RC(SE(n),_p("12"),Sp("F")))/(_p(RC(SE(n),Sp("B"),~~![][qg]))||9),VG=()=>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 jI=!1;const qI={invalid:()=>pt`
4
- The license key for Handsontable is invalid.\x20
5
- If you need any help, contact us at support@handsontable.com.`,expired:({keyValidityDate:n,hotVersion:e})=>pt`
6
- The license key for Handsontable expired on ${n}, and is not valid for the installed\x20
7
- version ${e}. Renew your license key at handsontable.com or downgrade to a version released prior\x20
8
- to ${n}. If you need any help, contact us at sales@handsontable.com.`,missing:()=>pt`
9
- The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
10
- Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
11
- passing the key: 'non-commercial-and-evaluation'. If you need any help, contact\x20
12
- us at support@handsontable.com.`,non_commercial:()=>""},KI={invalid:()=>pt`
13
- The license key for Handsontable is invalid.\x20
14
- <a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> on how to\x20
15
- install it properly or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,expired:({keyValidityDate:n,hotVersion:e})=>pt`
16
- The license key for Handsontable expired on ${n}, and is not valid for the installed\x20
17
- version ${e}. <a href="https://handsontable.com/pricing" target="_blank">Renew</a> your\x20
18
- license key or downgrade to a version released prior to ${n}. If you need any\x20
19
- help, contact us at <a href="mailto:sales@handsontable.com">sales@handsontable.com</a>.`,missing:()=>pt`
20
- The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
21
- Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
22
- passing the key: 'non-commercial-and-evaluation'.\x20
23
- <a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> about it in\x20
24
- the documentation or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,non_commercial:()=>""};function zG(n,e,t){const o=!ht(n),i=typeof n=="string"&&(n.toLowerCase()==="non-commercial-and-evaluation"||n.toLowerCase()==="ht68e-1f2b7-47158-70b05-0842f"),s="17.1.0";let r,a="invalid",l="invalid";n=SE(n||"");const h=UG(n);if(i)a="non_commercial",l="valid";else if(o||h)if(h){const[c,d,u]=t.split("/").map(Number),f=Math.floor(Date.UTC(u,d-1,c)/864e5),p=BG(n);r=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"long",day:"2-digit",timeZone:"UTC"}).format((p+1)*864e5),f>p?(a="expired",l="expired"):(a="valid",l="valid")}else a="invalid",l="invalid";else a="missing",l="missing";if(VG()&&(a="valid",l="valid"),!jI&&a!=="valid"&&(qI[a]({keyValidityDate:r,hotVersion:s})&&console[a==="non_commercial"?"info":"warn"](qI[a]({keyValidityDate:r,hotVersion:s})),jI=!0),l!=="valid"&&e&&KI[l]({keyValidityDate:r,hotVersion:s})){const d=document.createElement("div");d.className="handsontable hot-display-license-info",d.innerHTML=KI[l]({keyValidityDate:r,hotVersion:s}),e.appendChild(d)}}function UG(n){let e=[][qg],t=e;if(n[qg]!==Sp("Z"))return!1;for(let o="",i="B<H4P+".split(""),s=Sp(i.shift());s;s=Sp(i.shift()||"A"))--s<""[qg]?t=t|(GI(`${GI(_p(o)+(_p(RC(n,Math.abs(s),2))+[]).padStart(2,"0"))}`)%97||2)>>1:o=RC(n,s,s?i[qg]===1?9:8:6);return t===e}function mr(n){return n[0].toUpperCase()+n.substr(1)}function Q0(){function n(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return n()+n()+n()+n()}function eF(n){if(typeof n!="string")return!1;try{const e=JSON.parse(n);return typeof e=="object"&&e!==null}catch{return!1}}function tF(n){return/^([0-9][0-9]?%$)|(^100%$)/.test(n)}function Py(n,e={}){return`${n}`.replace(/(?:\\)?\[([^[\]]+)]/g,(t,o)=>t.charAt(0)==="\\"?t.substr(1,t.length-1):e[o]===void 0?"":e[o])}function gr(n){return EC(`${n}`,{ALLOWED_TAGS:[]})}function EC(n,e){return NG.sanitize(n,e)}function Qp(n){return typeof n!="string"?n:n.replace(/([A-Z])/g,"-$1").replace(/_/g,"-").toLowerCase()}const wr=n=>["tabindex",n],YG=()=>["role","treegrid"],qa=()=>["role","presentation"],GG=()=>["role","gridcell"],jG=()=>["role","gridcell button"],qG=()=>["role","rowheader"],nF=()=>["role","rowgroup"],KG=()=>["role","columnheader"],oF=()=>["role","row"],XG=()=>["role","menu"],ZG=()=>["role","menuitem"],QG=()=>["role","menuitemcheckbox"],JG=()=>["role","combobox"],iF=()=>["role","listbox"],e4=()=>["role","option"],t4=()=>["role","checkbox"],n4=()=>["role","dialog"],o4=()=>["role","alertdialog"],i4=()=>["role","group"],s4=()=>["scope","col"],r4=()=>["scope","row"],a4=()=>["type","text"],Pi=n=>["aria-label",n],l4=n=>["aria-labelledby",n],h4=n=>["aria-describedby",n],hl=()=>["aria-hidden","true"],Kg=(n=!0)=>["aria-disabled",n],c4=()=>["aria-multiselectable","true"],sF=n=>["aria-haspopup",n],rF=n=>["aria-rowcount",n],Ly=n=>["aria-colcount",n],aF=n=>["aria-rowindex",n],J0=n=>["aria-colindex",n],ks=n=>["aria-expanded",n],d4=n=>["aria-sort",n],XI=()=>["aria-readonly","true"],ZI=()=>["aria-invalid","true"],lF=n=>["aria-checked",n],ek=()=>["aria-selected","true"],u4=()=>["aria-autocomplete","list"],f4=n=>["aria-controls",n],g4=n=>["aria-activedescendant",n],p4=n=>["aria-live",n],m4=n=>["aria-relevant",n],w4=n=>["aria-setsize",n],b4=n=>["aria-posinset",n],C4=()=>["aria-modal","true"],QI=()=>["aria-busy","true"];function Y(n){throw new Error(n,{cause:{handsontable:!0}})}function Jp(n){let e;return Array.isArray(n)?e=n.length?new Array(n.length).fill(null):[]:(e={},nt(n,(t,o)=>{o!=="__children"&&(t&&typeof t=="object"&&!Array.isArray(t)?e[o]=Jp(t):Array.isArray(t)?t.length&&typeof t[0]=="object"&&!Array.isArray(t[0])?e[o]=[Jp(t[0])]:e[o]=[]:e[o]=null)})),e}function y4(n,e){return e.prototype.constructor=e,n.prototype=new e,n.prototype.constructor=n,n}function Fn(n,e,t){const o=Array.isArray(t);return nt(e,(i,s)=>{(o===!1||t.includes(s))&&(n[s]=i)}),n}function Wy(n,e){nt(e,(t,o)=>{e[o]&&typeof e[o]=="object"?(n[o]||(Array.isArray(e[o])?n[o]=[]:Object.prototype.toString.call(e[o])==="[object Date]"?n[o]=e[o]:n[o]={}),Wy(n[o],e[o])):n[o]=e[o]})}function Jn(n){return typeof n=="object"?JSON.parse(JSON.stringify(n)):n}function oa(n){const e={};return nt(n,(t,o)=>{e[o]=t}),e}function _t(n,...e){return n.MIXINS||(n.MIXINS=[]),O(e,t=>{n.MIXINS.push(t.MIXIN_NAME),nt(t,(o,i)=>{if(n.prototype[i]!==void 0&&Y(`Mixin conflict. Property '${i}' already exist and cannot be overwritten.`),typeof o=="function")n.prototype[i]=o;else{const s=function(l,h){const c=`_${l}`,d=u=>{let f=u;return(Array.isArray(f)||ie(f))&&(f=Jn(f)),f};return function(){return this[c]===void 0&&(this[c]=d(h)),this[c]}},r=function(l){const h=`_${l}`;return function(c){this[h]=c}};Object.defineProperty(n.prototype,i,{get:s(i,o),set:r(i),configurable:!0})}})}),n}function bh(n,e){return JSON.stringify(n)===JSON.stringify(e)}function ie(n){return Object.prototype.toString.call(n)==="[object Object]"}function cl(n,e,t,o){o.value=t,o.writable=o.writable!==!1,o.enumerable=o.enumerable!==!1,o.configurable=o.configurable!==!1,Object.defineProperty(n,e,o)}function nt(n,e){for(const t in n)if((!n.hasOwnProperty||n.hasOwnProperty&&Object.prototype.hasOwnProperty.call(n,t))&&e(n[t],t,n)===!1)break;return n}function kC(n,e){const t=e.split(".");let o=n;return nt(t,i=>{if(o=o[i],o===void 0)return o=void 0,!1}),o}function tS(n,e,t){if(typeof e!="string")return;const o=e.split(".");let i=n;o.forEach((s,r)=>{s==="__proto__"||s==="constructor"||s==="prototype"||(r!==o.length-1?(tn(i,s)||(i[s]={}),i=i[s]):i[s]=t)})}function tk(n){if(!ie(n))return 0;const e=function(t){let o=0;return ie(t)?nt(t,(i,s)=>{s!=="__children"&&(o+=e(i))}):o+=1,o};return e(n)}function Li(n,e="value"){const t=`_${e}`,o={_touched:!1,[t]:n,isTouched(){return this._touched}};return Object.defineProperty(o,e,{get(){return this[t]},set(i){this._touched=!0,this[t]=i},enumerable:!0,configurable:!0}),o}function tn(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Fb(n,e){if(typeof n!="object"||n===null)return e;if(typeof e!="object"||e===null)return n;const t={};return Object.keys(e).forEach(o=>{typeof e[o]=="object"&&e[o]!==null&&!Array.isArray(e[o])?t[o]=Fb(n[o],e[o]):t[o]=tn(n,o)&&n[o]!==void 0?n[o]:e[o]}),Object.keys(n).forEach(o=>{tn(t,o)||(t[o]=n[o])}),t}function nk(n={},e={}){const t={...n};return Object.keys(e).forEach(o=>{if(o==="__proto__"||o==="constructor"||o==="prototype")return;const i=e[o],s=t[o];ie(i)&&ie(s)?t[o]=nk(s,i):t[o]=i}),t}function $n(n){return ie(n)&&ee(n.key)&&ee(n.value)}function TC(n){return window.requestAnimationFrame(n)}function xC(n){window.cancelAnimationFrame(n)}function hF(){return"ontouchstart"in window}function _4(){return typeof window<"u"}let gd;function S4(n,e={}){return gd||(typeof Intl=="object"?gd=new Intl.Collator(n,e).compare:typeof String.prototype.localeCompare=="function"?gd=(t,o)=>`${t}`.localeCompare(o):gd=(t,o)=>t===o?0:t>o?-1:1,gd)}const ji=n=>{const e={value:!1};return e.test=(t,o)=>{e.value=n(t,o)},e},dl={chrome:ji((n,e)=>/Chrome/.test(n)&&/Google/.test(e)),chromeWebKit:ji(n=>/CriOS/.test(n)),edge:ji(n=>/Edge/.test(n)),edgeWebKit:ji(n=>/EdgiOS/.test(n)),firefox:ji(n=>/Firefox/.test(n)),firefoxWebKit:ji(n=>/FxiOS/.test(n)),mobile:ji(n=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(n)),safari:ji((n,e)=>/Safari/.test(n)&&/Apple Computer/.test(e)),safariBefore261:ji((n,e)=>{if(!/Safari/.test(n)||!/Apple Computer/.test(e))return!1;const t=/Version\/(\d+(?:\.\d+)?)/i.exec(n);return(t?Number.parseFloat(t[1]):0)<26.1})},Pm={mac:ji(n=>/^Mac/.test(n)),win:ji(n=>/^Win/.test(n)),linux:ji(n=>/^Linux/.test(n)),ios:ji(n=>/iPhone|iPad|iPod/i.test(n))};function v4({userAgent:n=navigator.userAgent,vendor:e=navigator.vendor}={}){nt(dl,({test:t})=>{t(n,e)})}function R4({platform:n=navigator.platform}={}){nt(Pm,({test:e})=>{e(n)})}_4()&&(v4(),R4());function E4(){return dl.chrome.value}function k4(){return dl.chromeWebKit.value}function vp(){return dl.firefox.value}function T4(){return dl.firefoxWebKit.value}function $y(){return dl.safari.value}function x4(){return dl.safariBefore261.value}function M4(){return dl.edge.value}function Qr(){return dl.mobile.value}function cF(){return Pm.ios.value}function ok({maxTouchPoints:n}=navigator){return n>2&&Pm.mac.value}function vE(){return Pm.win.value}function Xg(){return Pm.mac.value}function I4(...n){ee(console)&&console.log(...n)}function Ie(...n){ee(console)&&console.warn(...n)}function Ch(n){ee(console)&&console.warn(`Deprecated: ${n}`)}function il(...n){ee(console)&&console.error(...n)}function H4({logFunction:n=I4,message:e,items:t,maxSample:o=5,itemFormatter:i=s=>`${s}`}={}){if(!Array.isArray(t)||t.length===0)return;const s=t.length,r=t.slice(0,o).map(h=>` - ${i(h)}`),a=s>o?` - ...and ${s-o} more`:"",l=["Affected cells:",...r,...a?[a]:[]].join(`
25
- `);n(Py(e,{itemsCount:`${s} cell${s>1?"s":""}`,affectedCells:l}))}function A4(n,e=0){let t=-1,o=null,i=n;for(;i!==null;){if(t===e){o=i;break}i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:(t+=1,i=i.parentNode)}return o}function Bb(n,e){const t=n.closest(".handsontable");return!!t&&(t.parentNode===e||t===e)}function O4(n){return Object.getPrototypeOf(n.parent)&&n.frameElement}function yh(n){return O4(n)&&n.parent}function qc(n,e=[],t){const{ELEMENT_NODE:o,DOCUMENT_FRAGMENT_NODE:i}=Node;let s=n;for(;s!=null&&s!==t;){const{nodeType:r,nodeName:a}=s;if(r===o&&(e.includes(a)||e.includes(s)))return s;const{host:l}=s;l&&r===i?s=l:s=s.parentNode}return null}function cw(n,e,t){const o=[];let i=n;for(;i&&(i=qc(i,e,t),!(!i||t&&!t.contains(i)));)o.push(i),i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:i=i.parentNode;const s=o.length;return s?o[s-1]:null}function D4(n,e){const t={element:void 0,classNames:[]};let o=n;for(;o!==null&&o!==n.ownerDocument.documentElement&&!t.element;){if(typeof e=="string"&&o.classList.contains(e))t.element=o,t.classNames.push(e);else if(e instanceof RegExp){const i=Array.from(o.classList).filter(s=>e.test(s));i.length&&(t.element=o,t.classNames.push(...i))}o=o.parentElement}return t}function Lc(n,e){let t=n.parentNode,o=[];for(typeof e=="string"?n.defaultView?o=Array.prototype.slice.call(n.querySelectorAll(e),0):o=Array.prototype.slice.call(n.ownerDocument.querySelectorAll(e),0):o.push(e);t!==null;){if(o.indexOf(t)>-1)return!0;t=t.parentNode}return!1}function N4(n){let e=0,t=n;if(t.previousSibling)for(;t=t.previousSibling;)e+=1;return e}function Mh(n,e,t){const o=t.parentElement.querySelector(`.ht_clone_${n}`);return o?o.contains(e):null}function uf(n){if(!n||!n.classList||!n.parentNode||!n.parentNode.parentNode||n.classList.contains("hiddenHeader")||n.style.display==="none")return!1;const e=n.parentNode,t=Array.from(e.parentNode.childNodes),o=t.indexOf(e),i=Number.parseInt(n.getAttribute("rowspan"),10)||1;return o+i>=t.length}function dF(n){return!n||!n.length?[]:n.filter(e=>!!e)}function uF(n,e){if(!n||!n.length)return{regexFree:[],regexes:[]};const t=[],o=[];return o.push(...n.filter(i=>{const s=i instanceof RegExp;return s&&e&&t.push(i),!s})),{regexFree:o,regexes:t}}function Se(n,e){return n.classList===void 0||typeof e!="string"||e===""?!1:n.classList.contains(e)}function V(n,e){typeof e=="string"&&(e=e.split(" ")),e=dF(e),e.length>0&&n.classList.add(...e)}function re(n,e){typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);let{regexFree:t,regexes:o}=uF(e,!0);t=dF(t),t.length>0&&n.classList.remove(...t),o.forEach(i=>{n.classList.forEach(s=>{i.test(s)&&n.classList.remove(s)})})}function fe(n,e=[],t){Array.isArray(e)||(e=[[e,t]]),e.forEach(o=>{Array.isArray(o)&&o[0]!==""&&n.setAttribute(...o)})}function ta(n,e=[]){typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);const{regexFree:t,regexes:o}=uF(e,!0);t.forEach(i=>{i!==""&&n.removeAttribute(i)}),o.forEach(i=>{n.getAttributeNames().forEach(s=>{i.test(s)&&n.removeAttribute(s)})})}function fF(n){if(n.nodeType===3)n.parentNode.removeChild(n);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(n.nodeName)>-1){const e=n.childNodes;for(let t=e.length-1;t>=0;t--)fF(e[t])}}function sl(n){let e;for(;e=n.lastChild;)n.removeChild(e)}const P4=/(<(.*)>|&(.*);)/;let JI=!1;function id(n,e,t=EC){P4.test(e)?(!JI&&t===EC&&(JI=!0,Ch("The HTML sanitization using DOMPurify library is deprecated and will be removed in the next major release. Use the `sanitizer` option instead.\n\nMigration guide: https://handsontable.com/docs/migration-from-16.2-to-17.0/\n`sanitizer` documentation: https://handsontable.com/docs/api/options/#sanitizer")),n.innerHTML=typeof t=="function"?t(e,"innerHTML"):e):_h(n,e)}function _h(n,e){const t=n.firstChild;t&&t.nodeType===3&&t.nextSibling===null?t.textContent=e:(sl(n),n.appendChild(n.ownerDocument.createTextNode(e)))}function Kc(n){const e=n.ownerDocument.documentElement,t=n.ownerDocument.defaultView;let o=n;for(;o!==e;){if(o===null)return!1;if(o.nodeType===Node.DOCUMENT_FRAGMENT_NODE)if(o.host){if(o.host.impl)return Kc(o.host.impl);if(o.host)return Kc(o.host);Y("Lost in Web Components world")}else return!1;else if(t.getComputedStyle(o).display==="none")return!1;o=o.parentNode}return!0}function L4(n){const t=n.ownerDocument.defaultView;let o=n;for(;o.parentNode;){if(o.style.height==="0px"||o.style.height==="0"){const i=t.getComputedStyle(o).getPropertyValue("overflow");return i==="hidden"||i==="clip"}o=o.parentNode}return!1}function Jo(n){const e=n.ownerDocument,t=e.defaultView,o=e.documentElement;let i=n,s,r,a;for(s=i.offsetLeft,r=i.offsetTop,a=i;(i=i.offsetParent)&&!(i===e.body||!("offsetLeft"in i));)s+=i.offsetLeft,r+=i.offsetTop,a=i;return a&&a.style.position==="fixed"&&(s+=t.pageXOffset||o.scrollLeft,r+=t.pageYOffset||o.scrollTop),{left:s,top:r}}function gF(n=window){return n.scrollY}function ik(n=window){return n.scrollX}function sk(n,e=window){return n===e?gF(e):n.scrollTop}function pF(n,e=window){return n===e?ik(e):n.scrollLeft}function MC(n){let e=n.ownerDocument,t=e?e.defaultView:void 0;e||(e=n.document?n.document:n,t=e.defaultView);const o=["auto","scroll"];let i=n.parentNode;for(;i&&i.style&&e.body!==i;){let{overflow:s,overflowX:r,overflowY:a}=i.style;if([s,r,a].includes("scroll"))return i;if({overflow:s,overflowX:r,overflowY:a}=t.getComputedStyle(i),o.includes(s)||o.includes(r)||o.includes(a)||i.clientHeight<=i.scrollHeight+1&&(o.includes(a)||o.includes(s))||i.clientWidth<=i.scrollWidth+1&&(o.includes(r)||o.includes(s)))return i;i=i.parentNode}return t}function W4(n){return n.scrollHeight-n.clientHeight}function $4(n){return n.scrollWidth-n.clientWidth}function em(n){const e=n.ownerDocument,t=e.defaultView;let o=n.parentNode;for(;o&&o.style&&e.body!==o;){if(o.style.overflow!=="visible"&&o.style.overflow!=="")return o;const i=t.getComputedStyle(o),s=["scroll","hidden","auto","clip"],r=i.getPropertyValue("overflow"),a=i.getPropertyValue("overflow-y"),l=i.getPropertyValue("overflow-x");if(s.includes(r)||s.includes(a)||s.includes(l))return o;o=o.parentNode}return t}function IC(n,e,t=window){if(n){if(n===t)return e==="width"?`${t.innerWidth}px`:e==="height"?`${t.innerHeight}px`:void 0}else return;const o=n.style[e];if(o!==""&&o!==void 0)return o;const i=t.getComputedStyle(n);if(i[e]!==""&&i[e]!==void 0)return i[e]}function Cn(n){return n.offsetWidth}function xn(n){return n.offsetHeight}function Ou(n){return n.clientHeight||n.innerHeight}function mF(n){return n.clientWidth||n.innerWidth}function wF(n){return n.selectionStart?n.selectionStart:0}function F4(n){return n.selectionEnd?n.selectionEnd:0}function eH(n=window){n.getSelection&&(n.getSelection().empty?n.getSelection().empty():n.getSelection().removeAllRanges&&n.getSelection().removeAllRanges())}function Fy(n,e,t){if(t===void 0&&(t=e),n.setSelectionRange){n.focus();try{n.setSelectionRange(e,t)}catch{const i=n.parentNode,s=i.style.display;i.style.display="block",n.setSelectionRange(e,t),i.style.display=s}}}function B4(n=document){return vE()?Number.isInteger(n.defaultView.devicePixelRatio||1)?0:2:0}function V4(n=document){const e=(o=!1)=>{const i=n.createElement("div");i.style.height="200px",i.style.width="100%";const s=n.createElement("div");s.classList.add("htScrollbarTest"),o&&s.classList.add("htScrollbarSafariTest"),s.style.boxSizing="content-box",s.style.height="150px",s.style.left="0px",s.style.overflow="hidden",s.style.position="absolute",s.style.top="0px",s.style.width="200px",s.style.visibility="hidden",s.appendChild(i),n.body.appendChild(s);const r=i.offsetWidth;s.style.overflow="scroll";let a=i.offsetWidth;return r===a&&(a=s.clientWidth),n.body.removeChild(s),r-a},t=e();return t===0&&x4()&&!Qr()&&!ok()?e(!0):t}let nS;function Mn(n=document){return nS===void 0&&(nS=V4(n)),nS}function bF(n){return n instanceof Window?n.document.body.scrollHeight>n.innerHeight:n.offsetWidth!==n.clientWidth}function CF(n){return n instanceof Window?n.document.body.scrollWidth>n.innerWidth:n.offsetHeight!==n.clientHeight}function rk(n,e,t){n.style.transform=`translate3d(${e},${t},0)`}function By(n){n.style.transform&&n.style.transform!==""&&(n.style.transform="")}function Vb(n){return n&&(["INPUT","SELECT","TEXTAREA"].indexOf(n.nodeName)>-1||n.contentEditable==="true")}function yF(n){return Vb(n)&&n.hasAttribute("data-hot-input")===!1}function _F(n){return!n.parentNode}function z4(n,e){new IntersectionObserver((o,i)=>{o.forEach(s=>{s.isIntersecting&&(e(),i.disconnect())})}).observe(n)}function SF(n,e=!0,t=!0){const o=n.ownerDocument,i=o.createRange(),s=o.defaultView.getSelection();fe(n,"contenteditable",!0),t&&fe(n,...hl()),e&&V(n,"invisibleSelection"),i.selectNodeContents(n),s.removeAllRanges(),s.addRange(i)}function vF(n,e=!0){const t=n.ownerDocument.defaultView.getSelection();n.hasAttribute("aria-hidden")&&n.removeAttribute("aria-hidden"),t.removeAllRanges(),e&&re(n,"invisibleSelection"),n.removeAttribute("contenteditable")}function U4(n,e,t=!0){SF(n,t),e(),vF(n,t)}function na(n){const e=n?.ownerDocument?.defaultView.Element;return!!(e&&e!==null&&n instanceof e)}function _e(n){return typeof n=="function"}function Lm(n,e=200){let t=null,o;function i(...r){return t&&clearTimeout(t),t=setTimeout(()=>{t=null,o=n.apply(this,r)},e),o}function s(){t!==null&&(clearTimeout(t),t=null)}return i.cancel=s,i}function RF(n,...e){return function(...o){return n.apply(this,e.concat(o))}}function Y4(n){const e=n.length;function t(o){return function(...s){const r=o.concat(s);let a;return r.length>=e?a=n.apply(this,r):a=t(r),a}}return t([])}function RE(n,e,t,o,i,s,r,a){return ee(a)?n.call(e,t,o,i,s,r,a):ee(r)?n.call(e,t,o,i,s,r):ee(s)?n.call(e,t,o,i,s):ee(i)?n.call(e,t,o,i):ee(o)?n.call(e,t,o):ee(t)?n.call(e,t):n.call(e)}const ke={ALT:18,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39,ARROW_UP:38,AUDIO_DOWN:vp()?182:174,AUDIO_MUTE:vp()?181:173,AUDIO_UP:vp()?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},G4=[ke.ALT,ke.ARROW_DOWN,ke.ARROW_LEFT,ke.ARROW_RIGHT,ke.ARROW_UP,ke.AUDIO_DOWN,ke.AUDIO_MUTE,ke.AUDIO_UP,ke.BACKSPACE,ke.CAPS_LOCK,ke.DELETE,ke.END,ke.ENTER,ke.ESCAPE,ke.F1,ke.F2,ke.F3,ke.F4,ke.F5,ke.F6,ke.F7,ke.F8,ke.F9,ke.F10,ke.F11,ke.F12,ke.F13,ke.F14,ke.F15,ke.F16,ke.F17,ke.F18,ke.F19,ke.HOME,ke.INSERT,ke.MEDIA_NEXT,ke.MEDIA_PLAY_PAUSE,ke.MEDIA_PREV,ke.MEDIA_STOP,ke.NULL,ke.NUM_LOCK,ke.PAGE_DOWN,ke.PAGE_UP,ke.PAUSE,ke.SCROLL_LOCK,ke.SHIFT,ke.TAB];function EF(n){return n===32||n>=48&&n<=57||n>=96&&n<=111||n>=186&&n<=192||n>=219&&n<=222||n>=226||n>=65&&n<=90}function kF(n){return G4.includes(n)}function j4(n){return[ke.CONTROL,ke.COMMAND_LEFT,ke.COMMAND_RIGHT,ke.COMMAND_FIREFOX].includes(n)}function tf(n,e){const t=e.split("|");let o=!1;return O(t,i=>{if(n===ke[i])return o=!0,!1}),o}function es(n){n.isImmediatePropagationEnabled=!1,n.cancelBubble=!0}function th(n){return n.isImmediatePropagationEnabled===!1}function Xc(n){return n.button===2}function ak(n){return n.button===0}function q4(n){return typeof TouchEvent<"u"&&n instanceof TouchEvent}function K4(n,e){const t={x:n.offsetX,y:n.offsetY};let o=n.target;if(!na(e)||o!==e&&o.contains(e))return t;for(;o!==e;)t.x+=o.offsetLeft,t.y+=o.offsetTop,o=o.offsetParent;return t}const yc=["afterCellMetaReset","afterChange","afterContextMenuDefaultOptions","beforeContextMenuSetItems","afterDropdownMenuDefaultOptions","beforeDropdownMenuSetItems","afterContextMenuHide","beforeContextMenuShow","afterContextMenuShow","afterCopyLimit","beforeCreateCol","afterColumnSequenceCacheUpdate","afterColumnSequenceChange","afterCreateCol","beforeCreateRow","afterCreateRow","beforeAlter","afterDeselect","afterDestroy","afterDocumentKeyDown","afterDrawSelection","beforeRemoveCellClassNames","beforeCompositionStart","afterGetCellMeta","afterGetColHeader","afterGetRowHeader","afterInit","afterLoadData","afterUpdateData","afterDataProviderFetch","afterDataProviderFetchError","afterDataProviderFetchAbort","hasExternalDataSource","beforeRowsMutation","afterRowsMutation","afterRowsMutationError","afterMomentumScroll","afterOnCellCornerMouseDown","afterOnCellCornerDblClick","afterOnCellMouseDown","afterOnCellMouseUp","afterOnCellContextMenu","afterOnCellMouseOver","afterOnCellMouseOut","afterRemoveCol","afterRemoveRow","beforeRenderer","afterRenderer","afterRowSequenceCacheUpdate","afterRowSequenceChange","beforeViewportScrollVertically","beforeViewportScrollHorizontally","beforeViewportScroll","afterScrollHorizontally","afterScrollVertically","afterScroll","afterSelection","afterSelectionByProp","afterSelectionEnd","afterSelectionEndByProp","afterSelectionFocusSet","beforeSelectColumns","afterSelectColumns","beforeSelectRows","afterSelectRows","beforeSelectAll","afterSelectAll","afterSetCellMeta","afterRemoveCellMeta","afterSetDataAtCell","afterSetDataAtRowProp","afterSetSourceDataAtCell","afterSetTheme","afterUpdateSettings","afterValidate","beforeLanguageChange","afterLanguageChange","beforeAutofill","afterAutofill","beforeCellAlignment","beforeChange","beforeChangeRender","beforeHeightChange","beforeWidthChange","beforeDrawBorders","beforeGetCellMeta","beforeRemoveCellMeta","beforeInit","beforeInitWalkontable","beforeLoadData","beforeUpdateData","beforeDataProviderFetch","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","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","beforePageChange","afterPageChange","beforePageSizeChange","afterPageSizeChange","afterPageSizeVisibilityChange","afterPageCounterVisibilityChange","afterPageNavigationVisibilityChange","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","afterDialogHide","afterDialogShow","beforeDialogHide","beforeDialogShow","dialogFocusPreviousElement","dialogFocusNextElement","afterDialogFocus","beforeLoadingShow","afterLoadingShow","beforeLoadingHide","afterLoadingHide","beforeEmptyDataStateShow","afterEmptyDataStateShow","beforeEmptyDataStateHide","afterEmptyDataStateHide","beforeNotificationShow","afterNotificationShow","beforeNotificationHide","afterNotificationHide","afterBeginEditing","beforeMergeCells","afterMergeCells","beforeUnmergeCells","afterUnmergeCells","afterListen","afterUnlisten","afterRefreshDimensions","beforeRefreshDimensions","beforeColumnCollapse","afterColumnCollapse","beforeColumnExpand","afterColumnExpand","modifyAutoColumnSizeSeed"],oS=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"]]),iS=new Map([[]]);function TF(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function X4(n,e){return e.get?e.get.call(n):e.value}function Z4(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function xF(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Oo(n,e){var t=xF(n,e,"get");return X4(n,t)}function sS(n,e,t){TF(n,e),e.set(n,t)}function Af(n,e,t){var o=xF(n,e,"set");return Z4(n,o,t),t}function tH(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Q4(n,e){TF(n,e),e.add(n)}const J4=100;var Ei=new WeakMap,dc=new WeakMap,dw=new WeakMap,rS=new WeakSet;class nH{getHooks(e){return Oo(this,Ei).get(e)??[]}add(e,t,o={}){Oo(this,Ei).has(e)||(tH(this,rS,oH).call(this,e),yc.push(e));const i=Oo(this,Ei).get(e),s=i.find(c=>c.callback===t);if(s){s.skip===!0&&(s.skip=!1);return}const r=Number.isInteger(o.orderIndex)?o.orderIndex:0,a=!!o.runOnce,l=!!o.initialHook;let h=!1;if(l){const c=i.find(d=>d.initialHook);c&&(c.callback=t,h=!0)}if(!h){i.push({callback:t,orderIndex:r,runOnce:a,initialHook:l,skip:!1});let c=Oo(this,dw).has(e);!c&&r!==0&&(c=!0,Oo(this,dw).add(e)),c&&i.length>1&&Oo(this,Ei).set(e,i.toSorted((d,u)=>d.orderIndex-u.orderIndex))}}has(e){return Oo(this,Ei).has(e)&&Oo(this,Ei).get(e).length>0}remove(e,t){if(!Oo(this,Ei).has(e))return!1;const o=Oo(this,Ei).get(e),i=o.find(s=>s.callback===t);if(i){let s=Oo(this,dc).get(e);return i.skip=!0,s+=1,s>J4&&(Oo(this,Ei).set(e,o.filter(r=>!r.skip)),s=0),Oo(this,dc).set(e,s),!0}return!1}destroy(){Oo(this,Ei).clear(),Oo(this,dc).clear(),Af(this,Ei,null),Af(this,dc,null)}constructor(){Q4(this,rS),sS(this,Ei,{writable:!0,value:void 0}),sS(this,dc,{writable:!0,value:void 0}),sS(this,dw,{writable:!0,value:void 0}),Af(this,Ei,new Map),Af(this,dc,new Map),Af(this,dw,new Set),yc.forEach(e=>tH(this,rS,oH).call(this,e))}}function oH(n){Oo(this,Ei).set(n,[]),Oo(this,dc).set(n,0)}const e5=pt`The plugin hook "[hookName]" was removed in Handsontable [removedInVersion].\x20
26
- Please consult release notes https://github.com/handsontable/handsontable/releases/tag/[removedInVersion] to\x20
27
- learn about the migration path.`;class de{static getSingleton(){return n5()}getBucket(e=null){return e?(e.pluginHookBucket||(e.pluginHookBucket=new nH),e.pluginHookBucket):this.globalBucket}add(e,t,o=null,i){return Array.isArray(t)?O(t,s=>this.add(e,s,o)):(oS.has(e)&&Ie(Py(e5,{hookName:e,removedInVersion:oS.get(e)})),iS.has(e)&&Ie(iS.get(e)),this.getBucket(o).add(e,t,{orderIndex:i,runOnce:!1})),this}once(e,t,o=null,i){return Array.isArray(t)?O(t,s=>this.once(e,s,o)):this.getBucket(o).add(e,t,{orderIndex:i,runOnce:!0}),this}addAsFixed(e,t,o=null){return Array.isArray(t)?O(t,i=>this.addAsFixed(e,i,o)):this.getBucket(o).add(e,t,{initialHook:!0}),this}remove(e,t,o=null){return this.getBucket(o).remove(e,t)}has(e,t=null){return this.getBucket(t).has(e)}run(e,t,o,i,s,r,a,l){{const h=this.getBucket().getHooks(t),c=h?h.length:0;let d=0;if(c)for(;d<c;){if(!h[d]||h[d].skip){d+=1;continue}const u=RE(h[d].callback,e,o,i,s,r,a,l);u!==void 0&&(o=u),h[d]&&h[d].runOnce&&this.remove(t,h[d].callback),d+=1}}{const h=this.getBucket(e).getHooks(t),c=h?h.length:0;let d=0;if(c)for(;d<c;){if(!h[d]||h[d].skip){d+=1;continue}const u=RE(h[d].callback,e,o,i,s,r,a,l);u!==void 0&&(o=u),h[d]&&h[d].runOnce&&this.remove(t,h[d].callback,e),d+=1}}return o}destroy(e=null){this.getBucket(e).destroy()}register(e){this.isRegistered(e)||yc.push(e)}deregister(e){this.isRegistered(e)&&yc.splice(yc.indexOf(e),1)}isDeprecated(e){return iS.has(e)||oS.has(e)}isRegistered(e){return yc.indexOf(e)>=0}getRegistered(){return yc}constructor(){this.globalBucket=new nH}}const t5=new de;function n5(){return t5}const Zg=new Map;function ts(n="common"){Zg.has(n)||Zg.set(n,new Map);const e=Zg.get(n);function t(l,h){e.set(l,h)}function o(l){return e.get(l)}function i(l){return e.has(l)}function s(){return[...e.keys()]}function r(){return[...e.values()]}function a(){Zg.delete(n),e.clear()}return{register:t,getItem:o,hasItem:i,getNames:s,getValues:r,clear:a}}function o5(n,e){return Zg?.get(n.guid)?.get(e)}const EE=new WeakMap,{register:i5,getItem:MF,hasItem:IF,getNames:g_e,getValues:p_e}=ts("editors");function s5(n){const e={},t=n;this.getConstructor=function(){return n},this.getInstance=function(o){return o.guid in e||(e[o.guid]=new t(o)),e[o.guid]},de.getSingleton().add("afterDestroy",function(){e[this.guid]=null})}function HF(n,e){let t;return typeof n=="function"?(EE.get(n)||Yo(null,n),t=EE.get(n)):typeof n=="string"?t=MF(n):Y('Only strings and functions can be passed as "editor" parameter'),t||Y(`No editor registered under name "${n}"`),t.getInstance(e)}function kE(n){return typeof n=="function"?n:(IF(n)||Y(`No registered editor found under "${n}" name`),MF(n).getConstructor())}function Yo(n,e){n&&typeof n!="string"&&(e=n,n=e.EDITOR_TYPE);const t=new s5(e);typeof n=="string"&&i5(n,t),EE.set(e,t)}class $i{addEventListener(e,t,o,i=!1){function s(r){o.call(this,r5(r))}return this.context.eventListeners.push({element:e,event:t,callback:o,callbackProxy:s,options:i,eventManager:this}),e.addEventListener(t,s,i),()=>{this.removeEventListener(e,t,o)}}removeEventListener(e,t,o,i=!1){let s=this.context.eventListeners.length,r;for(;s;)if(s-=1,r=this.context.eventListeners[s],r.event===t&&r.element===e){if(o&&o!==r.callback||i&&r.eventManager!==this)continue;this.context.eventListeners.splice(s,1),r.element.removeEventListener(r.event,r.callbackProxy,r.options)}}clearEvents(e=!1){if(!this.context)return;let t=this.context.eventListeners.length;for(;t;){t-=1;const o=this.context.eventListeners[t];e&&o.eventManager!==this||(this.context.eventListeners.splice(t,1),o.element.removeEventListener(o.event,o.callbackProxy,o.options))}}clear(){this.clearEvents()}destroy(){this.clearEvents(),this.context=null}destroyWithOwnEventsOnly(){this.clearEvents(!0),this.context=null}fireEvent(e,t){let o=e.document,i=e;o||(o=e.ownerDocument?e.ownerDocument:e,i=o.defaultView);const s={bubbles:!0,cancelable:t!=="mousemove",view:i,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0};let r;o.createEvent?(r=o.createEvent("MouseEvents"),r.initMouseEvent(t,s.bubbles,s.cancelable,s.view,s.detail,s.screenX,s.screenY,s.clientX,s.clientY,s.ctrlKey,s.altKey,s.shiftKey,s.metaKey,s.button,o.body.parentNode)):r=o.createEventObject(),e.dispatchEvent?e.dispatchEvent(r):e.fireEvent(`on${t}`,r)}constructor(e=null){this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])}}function r5(n){const e=n.stopImmediatePropagation;return n.stopImmediatePropagation=function(){e.apply(this),es(this)},n}function a5(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function aS(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function iH(n,e){a5(n,e),e.add(n)}var lS=new WeakSet,sH=new WeakSet;class TE{getActiveEditor(){return this.activeEditor}prepareEditor(){if(this.activeEditor&&this.activeEditor.isWaiting()){this.closeEditor(!1,!1,l=>{l&&this.prepareEditor()});return}const e=this.hot.getSelectedRangeActive()?.highlight;if(!e||e.isHeader())return;const{row:t,col:o}=e,i=this.hot.runHooks("modifyGetCellCoords",t,o,!1,"meta");let s=t,r=o;if(Array.isArray(i)&&([s,r]=i),this.cellProperties=this.hot.getCellMeta(s,r),!this.isCellEditable()){this.clearActiveEditor();return}const a=this.hot.getCell(t,o,!0);if(a){const l=this.hot.getCellEditor(this.cellProperties),h=this.hot.colToProp(r),c=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(s),r);this.activeEditor=HF(l,this.hot),this.activeEditor.prepare(t,o,h,a,c,this.cellProperties)}}isEditorOpened(){return this.activeEditor&&this.activeEditor.isOpened()}openEditor(e,t,o=!1){if(!this.isCellEditable()){this.clearActiveEditor();return}const i=this.hot.getSelectedRangeActive();let s=this.hot.runHooks("beforeBeginEditing",i.highlight.row,i.highlight.col,e,t,o);if(t instanceof MouseEvent&&typeof s!="boolean"&&(s=this.hot.selection.getLayerLevel()===0&&i.isSingle()),s===!1){this.clearActiveEditor();return}this.activeEditor||(this.hot.scrollToFocusedCell(),this.prepareEditor()),this.activeEditor&&(o&&this.activeEditor.enableFullEditMode(),this.activeEditor.beginEditing(e,t))}closeEditor(e,t,o){this.activeEditor?this.activeEditor.finishEditing(e,t,o):o&&o(!1)}closeEditorAndSaveChanges(e){this.closeEditor(!1,e)}closeEditorAndRestoreOriginalValue(e){this.closeEditor(!0,e)}clearActiveEditor(){this.activeEditor=void 0}isCellEditable(){const e=this.hot.getSelectedRangeActive();if(!e)return!1;const t=this.hot.getCellEditor(this.cellProperties),{row:o,col:i}=e.highlight,{rowIndexMapper:s,columnIndexMapper:r}=this.hot,a=s.isHidden(this.hot.toPhysicalRow(o))||r.isHidden(this.hot.toPhysicalColumn(i));return!(this.cellProperties.readOnly||!t||a)}moveSelectionAfterEnter(e){if(!this.hot.getSelected())return;const t={...typeof this.tableMeta.enterMoves=="function"?this.tableMeta.enterMoves(e):this.tableMeta.enterMoves};e.shiftKey&&(t.row=-t.row,t.col=-t.col),this.hot.selection.isMultiple()?this.selection.transformFocus(t.row,t.col):this.selection.transformStart(t.row,t.col,!0)}destroy(){this.destroyed=!0,this.eventManager.destroy()}constructor(e,t,o){iH(this,lS),iH(this,sH),this.destroyed=!1,this.hot=e,this.tableMeta=t,this.selection=o,this.eventManager=new $i(e),this.hot.addHook("afterDocumentKeyDown",i=>aS(this,lS,rH).call(this,i)),this.hot.addHook("beforeCompositionStart",i=>aS(this,lS,rH).call(this,i)),this.hot.view._wt.update("onCellDblClick",(i,s,r)=>aS(this,sH,l5).call(this,i,s,r))}}function rH(n){const e=this.hot.getSelectedRangeActive();if(!this.hot.isListening()||!e||e.highlight.isHeader()||th(n))return;const{keyCode:t}=n,o=(n.ctrlKey||n.metaKey)&&!n.altKey;(!this.activeEditor||this.activeEditor&&!this.activeEditor.isWaiting())&&!kF(t)&&!j4(t)&&!o&&!this.isEditorOpened()&&this.openEditor("",n)}function l5(n,e){e.isCell()&&(this.hot.getShortcutManager().isCtrlPressed()?this.clearActiveEditor():this.openEditor(null,n,!0))}const aH=new WeakMap;TE.getInstance=function(n,e,t){let o=aH.get(n);return o||(o=new TE(n,e,t),aH.set(n,o)),o};const AF={"&nbsp;":" ","&amp;":"&","&lt;":"<","&gt;":">"},h5=new RegExp(Object.keys(AF).map(n=>`(${n})`).join("|"),"gi");function c5(n){return(n&&n.nodeName||"")==="TABLE"}function lH(n){const e=n.hasColHeaders(),t=n.hasRowHeaders(),o=[e?-1:0,t?-1:0,n.countRows()-1,n.countCols()-1],i=n.getData(...o),s=i.length,r=s>0?i[0].length:0,a=["<table>","</table>"],l=e?["<thead>","</thead>"]:[],h=["<tbody>","</tbody>"],c=t?1:0,d=e?1:0;for(let u=0;u<s;u+=1){const f=e&&u===0,p=[];for(let y=0;y<r;y+=1){const _=!f&&t&&y===0;let T="";if(f)T=`<th>${n.getColHeader(y-c)}</th>`;else if(_)T=`<th>${n.getRowHeader(u-d)}</th>`;else{const P=i[u][y],{hidden:$,rowspan:F,colspan:N}=n.getCellMeta(u-d,y-c);if(!$){const I=[];if(F&&I.push(`rowspan="${F}"`),N&&I.push(`colspan="${N}"`),ht(P))T=`<td ${I.join(" ")}></td>`;else{const j=P.toString().replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
28
- `).replace(/\x20/gi,"&nbsp;").replace(/\t/gi,"&#9;");T=`<td ${I.join(" ")}>${j}</td>`}}}p.push(T)}const C=["<tr>",...p,"</tr>"].join("");f?l.splice(1,0,C):h.splice(-1,0,C)}return a.splice(1,0,l.join(""),h.join("")),a.join("")}function hH(n){const e=n.length,t=["<table>"];for(let o=0;o<e;o+=1){const i=n[o],s=i.length,r=[];o===0&&t.push("<tbody>");for(let a=0;a<s;a+=1){const l=i[a],h=ht(l)?"":l.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
29
- `).replace(/\x20{2,}/gi,c=>`<span style="mso-spacerun: yes">${"&nbsp;".repeat(c.length-1)} </span>`).replace(/\t/gi,"&#9;");r.push(`<td>${h}</td>`)}t.push("<tr>",...r,"</tr>"),o+1===e&&t.push("</tbody>")}return t.push("</table>"),t.join("")}const OF=/<td\b[^>]*>/i,d5=/<\/\s*td\s*>/i,u5=/<p.*?>/g;function f5(n,e){let t=1,o=e;for(;t>0;){const i=n.substring(o),s=i.match(OF),r=i.match(d5);if(!r)return null;const a=o+r.index,l=r[0].length,h=s?o+s.index:n.length;if(h<a)t+=1,o=h+s[0].length;else{if(t-=1,t===0)return{start:a,length:l};o=a+l}}return null}function g5(n){const e=[];let t=0;for(;t<n.length;){const o=n.substring(t).match(OF);if(!o){e.push(n.substring(t));break}const i=t+o.index,s=o[0],r=i+s.length;e.push(n.substring(t,i));const a=f5(n,r);if(!a){e.push(n.substring(i));break}const l=n.substring(i,a.start+a.length),h=a.start-i,c=l.substring(s.length,h).trim().replaceAll(/\n\s+/g," ").replaceAll(u5,`
30
- `).replace(/^\n+/,"").replaceAll(/<\/(.*)>\s+$/mg,"</$1>").replace(/(<(?!br)([^>]+)>)/gi,"").replaceAll(/^&nbsp;$/mg,"");e.push(`${s}${c}</td>`),t=a.start+a.length}return e.join("")}function cH(n,e=document){const t={},o=e.createDocumentFragment(),i=e.createElement("div");o.appendChild(i);let s=n;if(typeof s=="string"){const P=g5(s);i.insertAdjacentHTML("afterbegin",`${P}`),s=i.querySelector("table")}if(!s||!c5(s))return;const r=i.querySelector('meta[name$="enerator"]'),a=s.querySelector("tbody th")!==null,l=s.querySelector("tr"),h=l?Array.from(l.cells).reduce((P,$)=>P+$.colSpan,0)-(a?1:0):0,c=s.tFoot&&Array.from(s.tFoot.rows)||[],d=[];let u=!1,f=0,p=0;if(s.tHead){const P=Array.from(s.tHead.rows).filter($=>{const F=$.querySelector("td")!==null;return F&&d.push($),!F});f=P.length,u=f>0,f>1?t.nestedHeaders=Array.from(P).reduce(($,F)=>{const N=Array.from(F.cells).reduce((I,j,U)=>{if(a&&U===0)return I;const{colSpan:G,innerHTML:te}=j,Q=G>1?{label:te,colspan:G}:te;return I.push(Q),I},[]);return $.push(N),$},[]):u&&(t.colHeaders=Array.from(P[0].children).reduce(($,F,N)=>(a&&N===0||$.push(F.innerHTML),$),[]))}d.length&&(t.fixedRowsTop=d.length),c.length&&(t.fixedRowsBottom=c.length);const C=[...d,...Array.from(s.tBodies).reduce((P,$)=>(Array.from($.rows).forEach(F=>{P.push(F)}),P),[]),...c];p=C.length;const y=new Array(p);for(let P=0;P<p;P++)y[P]=new Array(h);const _=[],T=[];for(let P=0;P<p;P++){const $=C[P],F=Array.from($.cells),N=F.length;for(let I=0;I<N;I++){const j=F[I],{nodeName:U,innerHTML:G,rowSpan:te,colSpan:Q}=j,be=y[P].findIndex(Oe=>Oe===void 0);if(U==="TD"){if(te>1||Q>1){for(let He=P;He<P+te;He++)if(He<p)for(let Ye=be;Ye<be+Q;Ye++)y[He][Ye]=null;const Ve=j.getAttribute("style");Ve&&Ve.includes("mso-ignore:colspan")||_.push({col:be,row:P,rowspan:te,colspan:Q})}let Oe="";r&&/excel/gi.test(r.content)?Oe=G.replace(/[\r\n][\x20]{0,2}/g," ").replace(/<br(\s*|\/)>[\r\n]?[\x20]{0,3}/gim,`\r
31
- `):Oe=G.replace(/<br(\s*|\/)>[\r\n]?/gim,`\r
32
- `),y[P][be]=Oe.replace(h5,Ve=>AF[Ve])}else T.push(G)}}return _.length&&(t.mergeCells=_),T.length&&(t.rowHeaders=T),y.length&&(t.data=y),t}function mi(n,e=[]){const t=typeof n;if(t==="number")return!isNaN(n)&&isFinite(n);if(t==="string"){if(n.length===0)return!1;if(n.length===1)return/\d/.test(n);const o=Array.from(new Set([".",...e])).map(i=>`\\${i}`).join("|");return new RegExp(`^[+-]?(((${o})?\\d+((${o})\\d+)?(e[+-]?\\d+)?)|(0x[a-f\\d]+))$`,"i").test(n.trim())}else if(t==="object")return!!n&&typeof n.valueOf()=="number"&&!(n instanceof Date);return!1}function p5(n){return mi(n,[","])}function DF(n,e){return e!=="."||typeof n!="string"?!1:/^[+-]?[1-9]\d{0,2}(,\d{3})+$/.test(n.trim())}function Re(n,e,t){let o=-1;for(typeof e=="function"?(t=e,e=n):o=n-1;++o<=e&&t(o)!==!1;);}function dH(n,e,t){let o=n+1;for(typeof e=="function"&&(t=e,e=0);--o>=e&&t(o)!==!1;);}function NF(n,e){return e=parseInt(e.toString().replace("%",""),10),e=isNaN(e)?0:e,parseInt(n*e/100,10)}function tt(n,e,t){return Math.min(n,e)===n?e:Math.max(n,t)===n?t:n}function m5(n,e={}){const{decimalSeparator:t}=e,o=n.trim();if(DF(n,t))return parseFloat(o.replace(/,/g,""));const i=o.replace(",",".");return isNaN(parseFloat(i))===!1?parseFloat(i):null}function Vu(n){return Number.isInteger(n)&&n>=0}const xE="asc",w5="desc",uH=new Map([[xE,[-1,1]],[w5,[1,-1]]]),b5=n=>`The priority '${n}' is already declared in a map.`,C5=n=>`The priority '${n}' is not a number.`;function y5({errorPriorityExists:n,errorPriorityNaN:e}={}){const t=new Map;n=_e(n)?n:b5,e=_e(e)?e:C5;function o(s,r){mi(s)||Y(e(s)),t.has(s)&&Y(n(s)),t.set(s,r)}function i(s=xE){const[r,a]=uH.get(s)||uH.get(xE);return[...t].sort((l,h)=>l[0]<h[0]?r:a).map(l=>l[1])}return{addItem:o,getItems:i}}const _5=n=>`The id '${n}' is already declared in a map.`;function Wm({errorIdExists:n}={}){const e=new Map;n=_e(n)?n:_5;function t(c,d){h(c)&&Y(n(c)),e.set(c,d)}function o(c){return e.delete(c)}function i(){e.clear()}function s(c){const[d]=a().find(([u,f])=>c===f?u:!1)||[null];return d}function r(c){return e.get(c)}function a(){return[...e]}function l(){return[...e.values()]}function h(c){return e.has(c)}return{addItem:t,clear:i,getId:s,getItem:r,getItems:a,getValues:l,hasItem:h,removeItem:o}}const S5=n=>`'${n}' value is already declared in a unique set.`;function v5({errorItemExists:n}={}){const e=new Set;n=_e(n)?n:S5;function t(s){e.has(s)&&Y(n(s)),e.add(s)}function o(){return[...e]}function i(){e.clear()}return{addItem:t,clear:i,getItems:o}}const lk=n=>`There is already registered "${n}" plugin.`,R5=n=>`There is already registered plugin on priority "${n}".`,E5=n=>`The priority "${n}" is not a number.`,PF=y5({errorPriorityExists:R5,errorPriorityNaN:E5}),LF=v5({errorItemExists:lk}),ME=Wm({errorIdExists:lk});function WF(){return[...PF.getItems(),...LF.getItems()]}function hk(n){const e=mr(n);return ME.getItem(e)}function k5(n){return!!hk(n)}function it(n,e,t){[n,e,t]=x5(n,e,t),hk(n)===void 0&&T5(n,e,t)}function T5(n,e,t){const o=mr(n);ME.hasItem(o)&&Y(lk(o)),t===void 0?LF.addItem(o):PF.addItem(t,o),ME.addItem(o,e)}function x5(n,e,t){return typeof n=="function"&&(e=n,n=e.PLUGIN_KEY,t=e.PLUGIN_PRIORITY),[n,e,t]}const{register:M5,getItem:I5,hasItem:$F,getNames:m_e,getValues:w_e}=ts("renderers");function IE(n){return typeof n=="function"?n:($F(n)||Y(`No registered renderer found under "${n}" name`),I5(n))}function ui(n,e){typeof n!="string"&&(e=n,n=e.RENDERER_TYPE),M5(n,e)}const{register:H5,getItem:A5,hasItem:FF,getNames:b_e,getValues:C_e}=ts("validators");function O5(n){return typeof n=="function"?n:(FF(n)||Y(`No registered validator found under "${n}" name`),A5(n))}function Da(n,e){typeof n!="string"&&(e=n,n=e.VALIDATOR_TYPE),H5(n,e)}class D5{initialize(){}process(e,t){const{totalCalculatedWidth:o,zeroBasedScrollOffset:i,viewportWidth:s,columnWidth:r}=t,a=i>0?s+1:s;o>=i&&o+r<=i+a&&((this.startColumn===null||this.startColumn===void 0)&&(this.startColumn=e),this.endColumn=e)}finalize(e){const{scrollOffset:t,viewportWidth:o,inlineStartOffset:i,zeroBasedScrollOffset:s,totalColumns:r,needReverse:a,positionCache:l,columnWidth:h}=e;if(this.endColumn===r-1&&a)for(this.startColumn=this.endColumn;this.startColumn>0;){const f=l.getOffset(this.endColumn)+h-l.getOffset(this.startColumn-1);if(f<=o&&(this.startColumn-=1),f>=o)break}this.startPosition=this.startColumn!==null?l.getOffset(this.startColumn):null;const c=s>0?o+1:o,d=t+o-c,u=this.startColumn===null?0:e.getColumnWidth(this.startColumn);d<-1*i||t>l.getOffset(e.lastProcessedIndex)||-1*t-o>-1*u?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,r<this.endColumn&&(this.endColumn=r-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}constructor(){this.count=0,this.startColumn=null,this.endColumn=null,this.startPosition=null,this.isVisibleInTrimmingContainer=!1}}class N5{initialize(){}process(e,t){const{totalCalculatedHeight:o,zeroBasedScrollOffset:i,innerViewportHeight:s,rowHeight:r}=t;o>=i&&o+r<=s&&(this.startRow===null&&(this.startRow=e),this.endRow=e)}finalize(e){const{scrollOffset:t,viewportHeight:o,horizontalScrollbarHeight:i,totalRows:s,needReverse:r,positionCache:a,rowHeight:l}=e;if(this.endRow===s-1&&r)for(this.startRow=this.endRow;this.startRow>0;){const d=a.getOffset(this.endRow)+l-a.getOffset(this.startRow-1);if(d<=o-i&&(this.startRow-=1),d>=o-i)break}this.startPosition=this.startRow!==null?a.getOffset(this.startRow):null;const h=t+o-i,c=this.startRow===null?0:e.getRowHeight(this.startRow);h<c||t>a.getOffset(e.lastProcessedIndex)?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,s<this.endRow&&(this.endRow=s-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}constructor(){this.count=0,this.startRow=null,this.endRow=null,this.startPosition=null,this.isVisibleInTrimmingContainer=!1}}class BF{initialize(){}process(e,t){const{totalCalculatedWidth:o,zeroBasedScrollOffset:i,viewportWidth:s}=t;o<=i&&(this.startColumn=e);const r=i>0?s+1:s;o>=i&&o<=i+r&&(this.startColumn===null||this.startColumn===void 0)&&(this.startColumn=e),this.endColumn=e}finalize(e){const{scrollOffset:t,viewportWidth:o,inlineStartOffset:i,zeroBasedScrollOffset:s,totalColumns:r,needReverse:a,positionCache:l,columnWidth:h}=e;if(this.endColumn===r-1&&a)for(this.startColumn=this.endColumn;this.startColumn>0;){const u=l.getOffset(this.endColumn)+h-l.getOffset(this.startColumn-1);if(this.startColumn-=1,u>o)break}this.startPosition=this.startColumn!==null?l.getOffset(this.startColumn):null;const c=s>0?o+1:o;t+o-c<-1*i||t>l.getOffset(e.lastProcessedIndex)+h||-1*t-o>0?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,r<this.endColumn&&(this.endColumn=r-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}constructor(){this.count=0,this.startColumn=null,this.endColumn=null,this.startPosition=null,this.isVisibleInTrimmingContainer=!1}}class VF{initialize(){}process(e,t){const{totalCalculatedHeight:o,zeroBasedScrollOffset:i,innerViewportHeight:s}=t;o<=i&&(this.startRow=e),o>=i&&o<=s&&this.startRow===null&&(this.startRow=e),this.endRow=e}finalize(e){const{scrollOffset:t,viewportHeight:o,horizontalScrollbarHeight:i,totalRows:s,needReverse:r,positionCache:a,rowHeight:l}=e;if(this.endRow===s-1&&r)for(this.startRow=this.endRow;this.startRow>0;){const c=a.getOffset(this.endRow)+l-a.getOffset(this.startRow-1);if(this.startRow-=1,c>=o-i)break}this.startPosition=this.startRow!==null?a.getOffset(this.startRow):null,t+o-i<0||t>a.getOffset(e.lastProcessedIndex)+l?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,s<this.endRow&&(this.endRow=s-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}constructor(){this.count=0,this.startRow=null,this.endRow=null,this.startPosition=null,this.isVisibleInTrimmingContainer=!1}}class P5{initialize({totalColumns:e}){this.count=e,this.endColumn=this.count-1}process(){}finalize(){}constructor(){this.count=0,this.startColumn=0,this.endColumn=0,this.startPosition=0,this.isVisibleInTrimmingContainer=!0}}class L5{initialize({totalRows:e}){this.count=e,this.endRow=this.count-1}process(){}finalize(){}constructor(){this.count=0,this.startRow=0,this.endRow=0,this.startPosition=0,this.isVisibleInTrimmingContainer=!0}}class W5 extends BF{finalize(e){super.finalize(e);const{overrideFn:t,totalColumns:o,positionCache:i}=e;if(this.startColumn!==null&&typeof t=="function"){const s=this.startColumn,r=this.endColumn;t(this),this.columnStartOffset=s-this.startColumn,this.columnEndOffset=this.endColumn-r}this.startColumn<0&&(this.startColumn=0),this.startPosition=this.startColumn!==null?i.getOffset(this.startColumn):null,o<this.endColumn&&(this.endColumn=o-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}constructor(...e){super(...e),this.columnStartOffset=0,this.columnEndOffset=0}}class $5 extends VF{finalize(e){super.finalize(e);const{overrideFn:t,totalRows:o,positionCache:i}=e;if(this.startRow!==null&&typeof t=="function"){const s=this.startRow,r=this.endRow;t(this),this.rowStartOffset=s-this.startRow,this.rowEndOffset=this.endRow-r}this.startRow<0&&(this.startRow=0),this.startPosition=this.startRow!==null?i.getOffset(this.startRow):null,o<this.endRow&&(this.endRow=o-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}constructor(...e){super(...e),this.rowStartOffset=0,this.rowEndOffset=0}}function zF(n,{totalCount:e,zeroBasedScrollOffset:t,scrollEnd:o,positionCache:i,setSizeField:s,setTotalCalculated:r,getTotalCalculated:a}){n._initialize(n);let l=0;t>0&&e>0&&(l=i.findIndexAtOffset(t),r(n,i.getOffset(l)));let h=-1;for(let c=l;c<e;c++){const d=i.getSizeAt(c);if(s(n,d),n._process(c,n),h=c,r(n,a(n)+d),a(n)>=o){n.needReverse=!1;break}}n.lastProcessedIndex=h,n._finalize(n)}class UF{_initialize(e){this.calculationTypes.forEach(([t,o])=>{this.calculationResults.set(t,o),o.initialize(e)})}_process(e,t){this.calculationTypes.forEach(([,o])=>o.process(e,t))}_finalize(e){this.calculationTypes.forEach(([,t])=>t.finalize(e))}getResultsFor(e){return this.calculationResults.get(e)}constructor(e){this.calculationTypes=[],this.calculationResults=new Map,this.calculationTypes=e}}class F5 extends UF{calculate(){zF(this,{totalCount:this.totalColumns,zeroBasedScrollOffset:this.zeroBasedScrollOffset,scrollEnd:this.zeroBasedScrollOffset+this.viewportWidth,positionCache:this.positionCache,setSizeField:(e,t)=>{e.columnWidth=t},setTotalCalculated:(e,t)=>{e.totalCalculatedWidth=t},getTotalCalculated:e=>e.totalCalculatedWidth})}getColumnWidth(e){return this.positionCache.getSizeAt(e)}constructor({calculationTypes:e,viewportWidth:t,scrollOffset:o,totalColumns:i,overrideFn:s,inlineStartOffset:r,columnWidthCache:a}){super(e),this.viewportWidth=0,this.scrollOffset=0,this.zeroBasedScrollOffset=0,this.totalColumns=0,this.columnWidth=0,this.overrideFn=null,this.inlineStartOffset=0,this.totalCalculatedWidth=0,this.needReverse=!0,this.viewportWidth=t,this.scrollOffset=o,this.zeroBasedScrollOffset=Math.max(o,0),this.totalColumns=i,this.overrideFn=s,this.inlineStartOffset=r,this.positionCache=a,this.calculate()}}class B5 extends UF{calculate(){zF(this,{totalCount:this.totalRows,zeroBasedScrollOffset:this.zeroBasedScrollOffset,scrollEnd:this.innerViewportHeight,positionCache:this.positionCache,setSizeField:(e,t)=>{e.rowHeight=t},setTotalCalculated:(e,t)=>{e.totalCalculatedHeight=t},getTotalCalculated:e=>e.totalCalculatedHeight})}getRowHeight(e){return this.positionCache.getSizeAt(e)}constructor({calculationTypes:e,viewportHeight:t,scrollOffset:o,totalRows:i,overrideFn:s,horizontalScrollbarHeight:r,rowHeightCache:a}){super(e),this.viewportHeight=0,this.scrollOffset=0,this.zeroBasedScrollOffset=0,this.totalRows=0,this.rowHeight=0,this.overrideFn=null,this.horizontalScrollbarHeight=0,this.innerViewportHeight=0,this.totalCalculatedHeight=0,this.needReverse=!0,this.viewportHeight=t,this.scrollOffset=o,this.zeroBasedScrollOffset=Math.max(o,0),this.totalRows=i,this.overrideFn=s,this.horizontalScrollbarHeight=r??0,this.innerViewportHeight=this.zeroBasedScrollOffset+this.viewportHeight-this.horizontalScrollbarHeight,this.positionCache=a,this.calculate()}}const nf=50;function V5(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function z5(n,e){return e.get?e.get.call(n):e.value}function U5(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function YF(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function pd(n,e){var t=YF(n,e,"get");return z5(n,t)}function Y5(n,e,t){V5(n,e),e.set(n,t)}function hS(n,e,t){var o=YF(n,e,"set");return U5(n,o,t),t}var Rr=new WeakMap;class Zc{isValid(e){const{countRows:t,countCols:o,countRowHeaders:i,countColHeaders:s}={countRows:0,countCols:0,countRowHeaders:0,countColHeaders:0,...e};return!(!Number.isInteger(this.row)||!Number.isInteger(this.col)||this.row<-s||this.col<-i||this.row>=t||this.col>=o)}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 pd(this,Rr)}isSouthEastOf(e){return this.row>=e.row&&(pd(this,Rr)?this.col<=e.col:this.col>=e.col)}isNorthWestOf(e){return this.row<=e.row&&(pd(this,Rr)?this.col>=e.col:this.col<=e.col)}isSouthWestOf(e){return this.row>=e.row&&(pd(this,Rr)?this.col>=e.col:this.col<=e.col)}isNorthEastOf(e){return this.row<=e.row&&(pd(this,Rr)?this.col<=e.col:this.col>=e.col)}normalize(){return this.row=this.row===null?this.row:Math.max(this.row,0),this.col=this.col===null?this.col:Math.max(this.col,0),this}assign(e){return Number.isInteger(e?.row)&&(this.row=e.row),Number.isInteger(e?.col)&&(this.col=e.col),e instanceof Zc&&hS(this,Rr,e.isRtl()),this}clone(){return new Zc(this.row,this.col,pd(this,Rr))}toObject(){return{row:this.row,col:this.col}}constructor(e,t,o=!1){Y5(this,Rr,{writable:!0,value:void 0}),this.row=null,this.col=null,hS(this,Rr,!1),hS(this,Rr,o),typeof e<"u"&&typeof t<"u"&&(this.row=e,this.col=t)}}function G5(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function j5(n,e){return e.get?e.get.call(n):e.value}function q5(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function GF(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function is(n,e){var t=GF(n,e,"get");return j5(n,t)}function K5(n,e,t){G5(n,e),e.set(n,t)}function fH(n,e,t){var o=GF(n,e,"set");return q5(n,o,t),t}var si=new WeakMap;class ff{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),t=Math.max(this.to.row,0);return Math.max(e,t)-Math.min(e,t)+1}getWidth(){if(this.from.col<0&&this.to.col<0)return 0;const e=Math.max(this.from.col,0),t=Math.max(this.to.col,0);return Math.max(e,t)-Math.min(e,t)+1}getCellsCount(){return this.getWidth()*this.getHeight()}includes(e){const{row:t,col:o}=e,i=this.getOuterTopStartCorner(),s=this.getOuterBottomEndCorner();return i.row<=t&&s.row>=t&&i.col<=o&&s.col>=o}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 t=this.getOuterTopStartCorner(),o=this.getOuterBottomEndCorner();return e.row<t.row||e.col<t.col||e.row>o.row||e.col>o.col?(this.from=this._createCellCoords(Math.min(t.row,e.row),Math.min(t.col,e.col)),this.to=this._createCellCoords(Math.max(o.row,e.row),Math.max(o.col,e.col)),!0):!1}expandByRange(e,t=!0){if(this.includesRange(e)||!this.overlaps(e))return!1;const o=this.getOuterTopStartCorner(),i=this.getOuterBottomEndCorner(),s=this.getDirection(),r=e.getOuterTopStartCorner(),a=e.getOuterBottomEndCorner(),l=Math.min(o.row,r.row),h=Math.min(o.col,r.col),c=Math.max(i.row,a.row),d=Math.max(i.col,a.col),u=this._createCellCoords(l,h),f=this._createCellCoords(c,d);return this.from=u,this.to=f,this.setDirection(s),t&&(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 is(this,si)?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 is(this,si)?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 is(this,si)?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 is(this,si)?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 is(this,si)?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 is(this,si)?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 is(this,si)?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 is(this,si)?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 Zc))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 t={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)},o={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 t.top===o.top&&i.push("top"),t.right===o.right&&i.push(is(this,si)?"left":"right"),t.bottom===o.bottom&&i.push("bottom"),t.left===o.left&&i.push(is(this,si)?"right":"left"),i}getInner(){const e=this.getOuterTopStartCorner(),t=this.getOuterBottomEndCorner(),o=[];for(let i=e.row;i<=t.row;i++)for(let s=e.col;s<=t.col;s++)!(this.from.row===i&&this.from.col===s)&&!(this.to.row===i&&this.to.col===s)&&o.push(this._createCellCoords(i,s));return o}getAll(){const e=this.getOuterTopStartCorner(),t=this.getOuterBottomEndCorner(),o=[];for(let i=e.row;i<=t.row;i++)for(let s=e.col;s<=t.col;s++)e.row===i&&e.col===s?o.push(e):t.row===i&&t.col===s?o.push(t):o.push(this._createCellCoords(i,s));return o}forAll(e){const t=this.getOuterTopStartCorner(),o=this.getOuterBottomEndCorner();for(let i=t.row;i<=o.row;i++)for(let s=t.col;s<=o.col;s++)if(e(i,s)===!1)return}clone(){return new ff(this.highlight,this.from,this.to,is(this,si))}toObject(){return{from:this.from.toObject(),to:this.to.toObject()}}_createCellCoords(e,t){return new Zc(e,t,is(this,si))}constructor(e,t=e,o=e,i=!1){K5(this,si,{writable:!0,value:void 0}),this.highlight=null,this.from=null,this.to=null,fH(this,si,!1),this.highlight=e.clone(),this.from=t.clone(),this.to=o.clone(),fH(this,si,i)}}function jF(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function X5(n,e){return e.get?e.get.call(n):e.value}function Z5(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function qF(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function ce(n,e){var t=qF(n,e,"get");return X5(n,t)}function ss(n,e,t){jF(n,e),e.set(n,t)}function So(n,e,t){var o=qF(n,e,"set");return Z5(n,o,t),t}function Ba(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function cS(n,e){jF(n,e),e.add(n)}const Q5=500,gH=10;var rs=new WeakMap,dS=new WeakMap,to=new WeakMap,md=new WeakMap,uw=new WeakMap,as=new WeakMap,uS=new WeakMap,Of=new WeakMap,Wr=new WeakMap,Gi=new WeakMap,dh=new WeakMap,uh=new WeakMap,pH=new WeakSet,nh=new WeakSet,mH=new WeakSet;let KF=class{registerEvents(){ce(this,as).addEventListener(ce(this,to).holder,"contextmenu",o=>this.onContextMenu(o)),ce(this,as).addEventListener(ce(this,to).TABLE,"mouseover",o=>this.onMouseOver(o)),ce(this,as).addEventListener(ce(this,to).TABLE,"mouseout",o=>this.onMouseOut(o));const e=()=>{ce(this,as).addEventListener(ce(this,to).holder,"touchstart",o=>this.onTouchStart(o)),ce(this,as).addEventListener(ce(this,to).holder,"touchend",o=>this.onTouchEnd(o)),ce(this,as).addEventListener(ce(this,to).holder,"touchmove",o=>Ba(this,mH,e9).call(this,o)),this.momentumScrolling||(this.momentumScrolling={}),ce(this,as).addEventListener(ce(this,to).holder,"scroll",()=>{Ba(this,nh,kc).call(this),clearTimeout(this.momentumScrolling._timeout),this.momentumScrolling.ongoing||ce(this,rs).getSetting("onBeforeTouchScroll"),this.momentumScrolling.ongoing=!0,this.momentumScrolling._timeout=setTimeout(()=>{this.touchApplied||(this.momentumScrolling.ongoing=!1,ce(this,rs).getSetting("onAfterMomentumScroll"))},200)})},t=()=>{ce(this,as).addEventListener(ce(this,to).holder,"mouseup",o=>this.onMouseUp(o)),ce(this,as).addEventListener(ce(this,to).holder,"mousedown",o=>this.onMouseDown(o))};Qr()?e():(hF()&&e(),t())}selectedCellWasTouched(e){const o=this.parentCell(e).coords;if(ce(this,Of)&&o){const[i,s]=[o.row,ce(this,Of).from.row],[r,a]=[o.col,ce(this,Of).from.col];return i===s&&r===a}return!1}parentCell(e){const t={},o=ce(this,to).TABLE,i=cw(e,["TD","TH"],o);return i?(t.coords=ce(this,to).getCoords(i),t.TD=i):Se(e,"wtBorder")&&Se(e,"current")?(t.coords=ce(this,md).getFocusSelection().cellRange.highlight,t.TD=ce(this,to).getCell(t.coords)):Se(e,"wtBorder")&&Se(e,"area")&&ce(this,md).getAreaSelection().cellRange&&(t.coords=ce(this,md).getAreaSelection().cellRange.to,t.TD=ce(this,to).getCell(t.coords)),t}onMouseDown(e){const t=ce(this,dS).rootDocument.activeElement,o=RF(A4,e.target),i=e.target;if(!["TD","TH"].includes(t.nodeName)&&(i===t||o(0)===t||o(1)===t))return;const s=this.parentCell(i);Se(i,"corner")?ce(this,rs).getSetting("onCellCornerMouseDown",e,i):s.TD&&ce(this,rs).has("onCellMouseDown")&&this.callListener("onCellMouseDown",e,s.coords,s.TD),(e.button===0||this.touchApplied)&&s.TD&&(ce(this,Gi)[0]=s.TD,clearTimeout(ce(this,Wr)[0]),ce(this,Wr)[0]=setTimeout(()=>{ce(this,Gi)[0]=null},1e3))}onContextMenu(e){if(Ba(this,nh,kc).call(this),ce(this,rs).has("onCellContextMenu")){const t=this.parentCell(e.target);t.TD&&this.callListener("onCellContextMenu",e,t.coords,t.TD)}}onMouseOver(e){if(!ce(this,rs).has("onCellMouseOver"))return;const t=ce(this,to).TABLE,o=cw(e.target,["TD","TH"],t),i=ce(this,uw)||this;o&&o!==i.lastMouseOver&&Lc(o,t)&&(i.lastMouseOver=o,this.callListener("onCellMouseOver",e,ce(this,to).getCoords(o),o))}onMouseOut(e){if(!ce(this,rs).has("onCellMouseOut"))return;const t=ce(this,to).TABLE,o=cw(e.target,["TD","TH"],t),i=cw(e.relatedTarget,["TD","TH"],t),s=ce(this,uw)||this;o&&o!==i&&Lc(o,t)&&(this.callListener("onCellMouseOut",e,ce(this,to).getCoords(o),o),i===null&&(s.lastMouseOver=null))}onMouseUp(e){const t=this.parentCell(e.target);t.TD&&ce(this,rs).has("onCellMouseUp")&&this.callListener("onCellMouseUp",e,t.coords,t.TD),!(e.button!==0&&!this.touchApplied)&&(t.TD===ce(this,Gi)[0]&&t.TD===ce(this,Gi)[1]?(Se(e.target,"corner")?this.callListener("onCellCornerDblClick",e,t.coords,t.TD):this.callListener("onCellDblClick",e,t.coords,t.TD),ce(this,Gi)[0]=null,ce(this,Gi)[1]=null):t.TD===ce(this,Gi)[0]&&(ce(this,Gi)[1]=t.TD,clearTimeout(ce(this,Wr)[1]),ce(this,Wr)[1]=setTimeout(()=>{ce(this,Gi)[1]=null},500)))}onTouchStart(e){So(this,Of,ce(this,md).getFocusSelection().cellRange),this.touchApplied=!0,this.onMouseDown(e),Ba(this,pH,J5).call(this,e)}onTouchEnd(e){Ba(this,nh,kc).call(this);const t=e.target,o=this.parentCell(t)?.coords,i=ee(o)&&o.row>=0&&o.col>=0;if(e.cancelable&&i&&ce(this,rs).getSetting("isDataViewInstance")){const r=["A","BUTTON","INPUT"];cF()&&(k4()||T4())&&this.selectedCellWasTouched(t)&&!r.includes(t.tagName)?e.preventDefault():this.selectedCellWasTouched(t)||e.preventDefault()}this.onMouseUp(e),this.touchApplied=!1}callListener(e,t,o,i){const s=ce(this,rs).getSettingPure(e);s&&s(t,o,i,ce(this,uS).call(this))}destroy(){clearTimeout(ce(this,Wr)[0]),clearTimeout(ce(this,Wr)[1]),Ba(this,nh,kc).call(this),ce(this,as).destroy()}constructor(e,t,o,i,s,r,a=null){cS(this,pH),cS(this,nh),cS(this,mH),ss(this,rs,{writable:!0,value:void 0}),ss(this,dS,{writable:!0,value:void 0}),ss(this,to,{writable:!0,value:void 0}),ss(this,md,{writable:!0,value:void 0}),ss(this,uw,{writable:!0,value:void 0}),ss(this,as,{writable:!0,value:void 0}),ss(this,uS,{writable:!0,value:void 0}),ss(this,Of,{writable:!0,value:void 0}),ss(this,Wr,{writable:!0,value:void 0}),ss(this,Gi,{writable:!0,value:void 0}),ss(this,dh,{writable:!0,value:void 0}),ss(this,uh,{writable:!0,value:void 0}),So(this,Wr,[null,null]),So(this,Gi,[null,null]),So(this,dh,null),So(this,uh,null),So(this,rs,o),So(this,dS,t),So(this,to,s),So(this,md,r),So(this,uw,a),So(this,as,i),So(this,uS,e),this.registerEvents()}};function J5(n){Ba(this,nh,kc).call(this);const e=n.touches[0];e&&(So(this,uh,{x:e.clientX,y:e.clientY}),So(this,dh,setTimeout(()=>{So(this,dh,null),So(this,uh,null),ce(this,Gi)[0]=null,ce(this,Gi)[1]=null,clearTimeout(ce(this,Wr)[0]),clearTimeout(ce(this,Wr)[1]);const t=n.target,o=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!0,clientX:e.clientX,clientY:e.clientY,screenX:e.screenX,screenY:e.screenY});t.dispatchEvent(o)},Q5)))}function kc(){ce(this,dh)!==null&&(clearTimeout(ce(this,dh)),So(this,dh,null)),So(this,uh,null)}function e9(n){if(ce(this,dh)===null||ce(this,uh)===null)return;const e=n.touches[0];if(!e){Ba(this,nh,kc).call(this);return}const t=Math.abs(e.clientX-ce(this,uh).x),o=Math.abs(e.clientY-ce(this,uh).y);(t>gH||o>gH)&&Ba(this,nh,kc).call(this)}class t9{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))}constructor(e,t,o){this.offset=e,this.total=t,this.countTH=o}}class n9{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))}constructor(e,t,o){this.offset=e,this.total=t,this.countTH=o}}class o9{setSize(e){this.currentSize=this.nextSize,this.nextSize=e}setOffset(e){this.currentOffset=this.nextOffset,this.nextOffset=e}constructor(){this.currentSize=0,this.nextSize=0,this.currentOffset=0,this.nextOffset=0}}const i9=0,HC=1,tm=2,s9=0,XF=1,ZF=2,QF=3,JF=4,eB=5;class r9{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=HC,e.workingSpace=tm,this.sharedSize=e.getViewSize()}prepend(e){this.workingSpace=tm,e.workingSpace=HC,this.sharedSize=e.getViewSize()}constructor(){this.size=new o9,this.workingSpace=i9,this.sharedSize=null}}function a9(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function l9(n,e){return e.get?e.get.call(n):e.value}function h9(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function tB(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Df(n,e){var t=tB(n,e,"get");return l9(n,t)}function c9(n,e,t){a9(n,e),e.set(n,t)}function d9(n,e,t){var o=tB(n,e,"set");return h9(n,o,t),t}var Ih=new WeakMap;class u9{get length(){return this.order.length}has(e){return Df(this,Ih).has(e)}get(e){return e<this.order.length?this.order[e]:-1}remove(e){const t=this.order.indexOf(e);t>-1&&(this.order.splice(t,1),Df(this,Ih).delete(e))}prepend(e){this.order.unshift(e),Df(this,Ih).add(e);const t=this.order.pop();return Df(this,Ih).delete(t),t}constructor(e,t){c9(this,Ih,{writable:!0,value:void 0}),this.order=[],d9(this,Ih,new Set);const o=new Array(t),i=Df(this,Ih);for(let s=0;s<t;s++){const r=e+s;o[s]=r,i.add(r)}this.order=o}}class f9{diff(){const{sizeSet:e}=this,{currentSize:t,nextSize:o,currentOffset:i,nextOffset:s}=e.getViewSize();let r=Math.max(o,t);if(r===0)return[];const a=new u9(i,t),h=!e.isShared()||e.isPlaceOn(tm),c=[];for(let d=0;d<r;d++){const u=a.get(d),f=d<o?s+d:-1;if(f===-1)c.push([XF,u]);else if(u===-1)h?c.push([ZF,f]):c.push([QF,f]);else if(f>u)a.has(f)&&(a.remove(f),o<=a.length&&(r-=1)),c.push([eB,f,u]);else if(f<u){const p=a.prepend(f);c.push([JF,f,u,p])}else c.push([s9,f])}return c}constructor(e){this.sizeSet=e}}class g9{applyCommand(e){const{rootNode:t}=this.orderView,[o,i,s,r]=e,a=this.orderView.nodesPool(i);switch(this.orderView.collectedNodes.push(a),o){case QF:t.insertBefore(a,t.firstChild);break;case ZF:t.appendChild(a);break;case JF:t.insertBefore(a,this.orderView.nodesPool(s)),t.removeChild(this.orderView.nodesPool(r));break;case eB:t.replaceChild(a,this.orderView.nodesPool(s));break;case XF:t.removeChild(a);break}}start(){this.orderView.collectedNodes.length=0,this.leads=this.orderView.viewDiffer.diff(),this.leadIndex=0}render(){this.leadIndex<this.leads.length&&(this.applyCommand(this.leads[this.leadIndex]),this.leadIndex+=1)}end(){const{leads:e}=this;for(;this.leadIndex<e.length;)this.applyCommand(e[this.leadIndex]),this.leadIndex+=1}constructor(e){this.leads=[],this.leadIndex=0,this.orderView=e}}class p9{getRenderedChildCount(){const{rootNode:e,sizeSet:t}=this.orderView;let o=0;if(this.orderView.isSharedViewSet()){let i=e.firstElementChild;for(;i;){if(i.tagName===this.orderView.childNodeType)o+=1;else if(t.isPlaceOn(HC))break;i=i.nextElementSibling}}else o=e.childElementCount;return o}start(){this.orderView.collectedNodes.length=0,this.visualIndex=0;const{rootNode:e,sizeSet:t}=this.orderView,o=this.orderView.isSharedViewSet(),{nextSize:i}=t.getViewSize();let s=this.getRenderedChildCount();for(;s<i;){const a=this.orderView.nodesPool();!o||o&&t.isPlaceOn(tm)?e.appendChild(a):e.insertBefore(a,e.firstChild),s+=1}const r=o&&t.isPlaceOn(HC);for(;s>i;)e.removeChild(r?e.firstChild:e.lastChild),s-=1}render(){const{rootNode:e,sizeSet:t}=this.orderView;let o=this.visualIndex;this.orderView.isSharedViewSet()&&t.isPlaceOn(tm)&&(o+=t.sharedSize.nextSize);let i=e.childNodes[o];if(i.tagName!==this.orderView.childNodeType){const s=this.orderView.nodesPool();e.replaceChild(s,i),i=s}this.orderView.collectedNodes.push(i),this.visualIndex+=1}end(){}constructor(e){this.visualIndex=0,this.orderView=e}}function m9(n){return vp()?new p9(n):new g9(n)}class $m{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}start(){this.rendererAdapter.start()}render(){this.rendererAdapter.render()}end(){this.rendererAdapter.end()}constructor(e,t,o){this.sizeSet=new r9,this.collectedNodes=[],this.viewDiffer=new f9(this.sizeSet),this.rootNode=e,this.nodesPool=t,this.childNodeType=o,this.rendererAdapter=m9(this)}}class nB extends $m{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}}const w9=1048576;class b9{setRootDocument(e){this.rootDocument=e}obtain(e,t){if(vp())return this.rootDocument.createElement(this.nodeType);const o=typeof t=="number"?e*w9+t:e;let i=this.pool.get(o);return i!==void 0||(i=this.rootDocument.createElement(this.nodeType),this.pool.set(o,i)),i}constructor(e){this.pool=new Map,this.nodeType=e.toUpperCase()}}class gf{setTable(e){this.nodesPool&&this.nodesPool.setRootDocument(e.rootDocument),this.table=e}render(){}constructor(e,t){this.nodesPool=null,this.table=null,this.renderedNodes=0,this.nodesPool=typeof e=="string"?new b9(e):null,this.nodeType=e,this.rootNode=t}}class C9 extends gf{obtainOrderView(e){let t;return this.orderViews.has(e)?t=this.orderViews.get(e):(t=new nB(e,o=>this.nodesPool.obtain(this.sourceRowIndex,o),this.nodeType),this.orderViews.set(e,t)),t}render(){const{rowsToRender:e,rowHeaderFunctions:t,rowHeadersCount:o,rows:i,cells:s}=this.table;for(let r=0;r<e;r++){const a=this.table.renderedRowToSource(r),l=i.getRenderedNode(r);this.sourceRowIndex=a;const h=this.obtainOrderView(l),c=s.obtainOrderView(l);h.appendView(c).setSize(o).setOffset(0).start();for(let d=o-1;d>=0;d--){h.render();const u=h.getCurrentNode();u.className="",u.removeAttribute("style"),ta(u,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&fe(u,[qG(),r4(),J0(d+1),wr(-1)]),t[d](a,u,d)}h.end()}}constructor(){super("TH"),this.orderViews=new WeakMap,this.sourceRowIndex=0}}class y9 extends gf{getRenderedNode(e){return this.orderView.getNode(e)}render(){const{columnHeadersCount:e}=this.table;this.table.isAriaEnabled()&&fe(this.rootNode,[nF()]),this.orderView.setSize(e).setOffset(0).start();for(let t=0;t<e;t++){this.orderView.render();const o=this.orderView.getCurrentNode();this.table.isAriaEnabled()&&fe(o,[oF(),aF(t+1)])}this.orderView.end()}constructor(e){super("TR",e),this.orderView=new $m(e,t=>this.nodesPool.obtain(t),this.nodeType)}}class _9 extends gf{obtainOrderView(e){let t;return this.orderViews.has(e)?t=this.orderViews.get(e):(t=new $m(e,o=>this.nodesPool.obtain(this.sourceRowIndex,o),this.nodeType),this.orderViews.set(e,t)),t}render(){const{columnHeadersCount:e,columnHeaderFunctions:t,columnsToRender:o,rowHeadersCount:i,columnHeaderRows:s}=this.table,r=o+i;for(let a=0;a<e;a++){const l=s.getRenderedNode(a);this.sourceRowIndex=a;const h=this.obtainOrderView(l);h.setSize(r).setOffset(0).start();for(let c=0;c<r;c++){h.render();const d=c-i,u=this.table.renderedColumnToSource(d),f=h.getCurrentNode();f.className="",f.removeAttribute("style"),ta(f,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&fe(f,[J0(c+1),wr(-1),KG(),...d>=0?[s4()]:[jG(),Pi("Select whole grid")]]),t[a](u,f,a)}h.end()}}constructor(){super("TH"),this.orderViews=new WeakMap,this.sourceRowIndex=0}}let wH=!1;class S9 extends gf{render(){const{columnsToRender:e,rowHeadersCount:t}=this.table,o=e+t;!wH&&e>1e3&&(wH=!0,Ie(pt`Performance tip: Handsontable rendered more than 1000 visible columns.\x20
33
- Consider limiting the number of rendered columns by specifying the table width and/or\x20
34
- turning off the "renderAllColumns" option.`)),this.orderView.setSize(o).setOffset(0).start();for(let s=0;s<o;s++){this.orderView.render();const r=this.orderView.getCurrentNode();if(s<t){const a=this.table.renderedColumnToSource(s);r.style.width=`${this.table.columnUtils.getHeaderWidth(a)}px`}else{const a=this.table.renderedColumnToSource(s-t);r.style.width=`${this.table.columnUtils.getWidth(a)}px`}}this.orderView.end();const i=this.rootNode.firstChild;i&&V(i,"rowHeader")}constructor(e){super("COL",e),this.orderView=new $m(e,t=>this.nodesPool.obtain(t),this.nodeType)}}const wd={rowEven:"ht__row_even",rowOdd:"ht__row_odd"};let bH=!1;class v9 extends gf{getRenderedNode(e){return this.orderView.getNode(e)}render(){const{rowsToRender:e}=this.table;!bH&&e>1e3&&(bH=!0,Ie(pt`Performance tip: Handsontable rendered more than 1000 visible rows.\x20
35
- Consider limiting the number of rendered rows by specifying the table height and/or\x20
36
- turning off the "renderAllRows" option.`)),this.table.isAriaEnabled()&&fe(this.rootNode,[nF()]),this.orderView.setSize(e).setOffset(this.table.renderedRowToSource(0)).start();for(let t=0;t<e;t++){this.orderView.render();const o=this.orderView.getCurrentNode(),i=this.table.renderedRowToSource(t);this.table.isAriaEnabled()&&fe(o,[oF(),aF(i+(this.table.rowUtils?.dataAccessObject?.columnHeaders.length??0)+1)]),(i+1)%2===0?Se(o,wd.rowEven)||(re(o,wd.rowOdd),V(o,wd.rowEven)):Se(o,wd.rowOdd)||(re(o,wd.rowEven),V(o,wd.rowOdd))}this.orderView.end()}constructor(e){super("TR",e),this.orderView=new $m(e,t=>this.nodesPool.obtain(t),this.nodeType)}}class R9 extends gf{obtainOrderView(e){let t;return this.orderViews.has(e)?t=this.orderViews.get(e):(t=new nB(e,o=>this.nodesPool.obtain(this.sourceRowIndex,o),this.nodeType),this.orderViews.set(e,t)),t}render(){const{rowsToRender:e,columnsToRender:t,rows:o,rowHeaders:i}=this.table;for(let s=0;s<e;s++){const r=this.table.renderedRowToSource(s),a=o.getRenderedNode(s);this.sourceRowIndex=r;const l=this.obtainOrderView(a),h=i.obtainOrderView(a);l.prependView(h).setSize(t).setOffset(0).start();for(let c=0;c<t;c++){l.render();const d=this.table.renderedColumnToSource(c),u=l.getCurrentNode();Se(u,"hide")||(u.className=""),u.removeAttribute("style"),u.removeAttribute("dir"),ta(u,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.cellRenderer(r,d,u),this.table.isAriaEnabled()&&fe(u,[...u.hasAttribute("role")?[]:[GG()],wr(-1),J0(d+(this.table.rowUtils?.dataAccessObject?.rowHeaders.length??0)+1)])}l.end()}}constructor(){super("TD"),this.orderViews=new WeakMap,this.sourceRowIndex=0}}class E9{setActiveOverlayName(e){this.activeOverlayName=e}setAxisUtils(e,t){this.rowUtils=e,this.columnUtils=t}setViewportSize(e,t){this.rowsToRender=e,this.columnsToRender=t}setFilters(e,t){this.rowFilter=e,this.columnFilter=t}setHeaderContentRenderers(e,t){this.rowHeaderFunctions=e,this.rowHeadersCount=e.length,this.columnHeaderFunctions=t,this.columnHeadersCount=t.length}setRenderers({rowHeaders:e,columnHeaderRows:t,columnHeaders:o,colGroup:i,rows:s,cells:r}={}){e.setTable(this),t.setTable(this),o.setTable(this),i.setTable(this),s.setTable(this),r.setTable(this),this.rowHeaders=e,this.columnHeaderRows=t,this.columnHeaders=o,this.colGroup=i,this.rows=s,this.cells=r}renderedRowToSource(e){return this.rowFilter.renderedToSource(e)}renderedColumnToSource(e){return this.columnFilter.renderedToSource(e)}isAriaEnabled(){return this.rowUtils.wtSettings.getSetting("ariaTags")}render(){this.columnHeaderRows.render(),this.columnHeaders.render(),this.rows.render(),this.rowHeaders.render(),this.cells.render(),this.columnUtils.calculateWidths(),this.colGroup.render();const{rowsToRender:e,rows:t}=this;for(let o=0;o<e;o++){const i=t.getRenderedNode(o),s=this.rowUtils;if(i.firstChild){const r=this.renderedRowToSource(o),a=s.getHeightByOverlayName(r,this.activeOverlayName),h=this.stylesHandler.areCellsBorderBox()?0:1;a?i.firstChild.style.height=`${a-h}px`:i.firstChild.style.height=""}}}constructor(e,{cellRenderer:t,stylesHandler:o}={}){this.rowHeaders=null,this.columnHeaderRows=null,this.columnHeaders=null,this.colGroup=null,this.rows=null,this.cells=null,this.rowFilter=null,this.columnFilter=null,this.rowUtils=null,this.columnUtils=null,this.rowsToRender=0,this.columnsToRender=0,this.rowHeaderFunctions=[],this.rowHeadersCount=0,this.columnHeaderFunctions=[],this.columnHeadersCount=0,this.rootNode=e,this.rootDocument=this.rootNode.ownerDocument,this.cellRenderer=t,this.stylesHandler=o}}class k9{setActiveOverlayName(e){return this.renderer.setActiveOverlayName(e),this}setFilters(e,t){return this.renderer.setFilters(e,t),this}setViewportSize(e,t){return this.renderer.setViewportSize(e,t),this}setHeaderContentRenderers(e,t){return this.renderer.setHeaderContentRenderers(e,t),this}render(){this.renderer.render()}constructor({TABLE:e,THEAD:t,COLGROUP:o,TBODY:i,rowUtils:s,columnUtils:r,cellRenderer:a,stylesHandler:l}={}){this.renderer=new E9(e,{cellRenderer:a,stylesHandler:l}),this.renderer.setRenderers({rowHeaders:new C9,columnHeaderRows:new y9(t),columnHeaders:new _9,colGroup:new S9(o),rows:new v9(i),cells:new R9}),this.renderer.setAxisUtils(s,r)}}class T9{getWidth(e){return this.wtSettings.getSetting("columnWidth",e)||this.wtSettings.getSetting("defaultColumnWidth")}getHeaderHeight(e){let t=this.wtSettings.getSetting("stylesHandler").getDefaultRowHeight();const o=this.dataAccessObject.wtViewport.oversizedColumnHeaders[e];return o!==void 0&&(t=t?Math.max(t,o):o),t}getHeaderWidth(e){return this.headerWidths.get(this.dataAccessObject.wtTable.columnFilter.sourceToRendered(e))}calculateWidths(){const{wtSettings:e}=this;let t=e.getSetting("rowHeaderWidth");if(t=e.getSetting("onModifyRowHeaderWidth",t),t!=null){const o=e.getSetting("rowHeaders").length,i=e.getSetting("defaultColumnWidth");for(let s=0;s<o;s++){let r=Array.isArray(t)?t[s]:t;r=r??i,this.headerWidths.set(s,r)}}}constructor(e,t){this.headerWidths=new Map,this.dataAccessObject=e,this.wtSettings=t}}class x9{getHeight(e){let t=this.wtSettings.getSetting("rowHeight",e);const o=this.dataAccessObject.wtViewport.oversizedRows[e];return o!==void 0&&(t=t===void 0?o:Math.max(t,o)),t}getHeightByOverlayName(e,t){let o=this.wtSettings.getSetting("rowHeightByOverlayName",e,t);const i=this.dataAccessObject.wtViewport.oversizedRows[e];return i!==void 0&&(o=o===void 0?i:Math.max(o,i)),o}constructor(e,t){this.dataAccessObject=e,this.wtSettings=t}}class pf{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 t=e.parentNode;let o;return(!t||t.nodeType!==Node.ELEMENT_NODE||!Se(t,"wtHolder"))&&(o=this.domBindings.rootDocument.createElement("div"),o.className="wtSpreader",t&&t.insertBefore(o,e),o.appendChild(e)),o.style.position="relative",this.wtSettings.getSetting("ariaTags")&&fe(o,[qa()]),o}createHider(e){const t=e.parentNode;let o;return(!t||t.nodeType!==Node.ELEMENT_NODE||!Se(t,"wtHolder"))&&(o=this.domBindings.rootDocument.createElement("div"),o.className="wtHider",t&&t.insertBefore(o,e),o.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&fe(o,[qa()]),o}createHolder(e){const t=e.parentNode;let o;return(!t||t.nodeType!==Node.ELEMENT_NODE||!Se(t,"wtHolder"))&&(o=this.domBindings.rootDocument.createElement("div"),o.style.position="relative",o.className="wtHolder",this.isMaster&&fe(o,[wr(-1)]),t&&t.insertBefore(o,e),this.isMaster&&(o.parentNode.className+="ht_master handsontable",o.parentNode.setAttribute("dir",this.wtSettings.getSettingPure("rtlMode")?"rtl":"ltr"),this.wtSettings.getSetting("ariaTags")&&fe(o.parentNode,[qa()])),o.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&fe(o,[qa()]),o}draw(e=!1){const{wtSettings:t}=this,{wtOverlays:o,wtViewport:i}=this.dataAccessObject,s=t.getSetting("totalRows"),r=t.getSetting("totalColumns"),a=t.getSetting("rowHeaders"),l=a.length,h=t.getSetting("columnHeaders"),c=h.length;let d=e;if(this.isMaster&&(o.beforeDraw(),this.holderOffset=Jo(this.holder),i.rowHeightCache.ensureBuilt(),i.columnWidthCache.ensureBuilt(),d=i.createCalculators(d),l&&!t.getSetting("fixedColumnsStart"))){const f=o.inlineStartOverlay.getScrollPosition(),p=this.correctHeaderWidth;this.correctHeaderWidth=f!==0,p!==this.correctHeaderWidth&&(d=!1)}if(d)this.isMaster&&o.refresh(!0);else{this.isMaster?this.tableOffset=Jo(this.TABLE):this.tableOffset=this.dataAccessObject.parentTableOffset;const f=Math.max(this.getFirstRenderedRow(),0),p=Math.max(this.getFirstRenderedColumn(),0);this.rowFilter=new n9(f,s,c),this.columnFilter=new t9(p,r,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,h),(this.is(Kr)||this.is(fh))&&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.syncOversizedColumnHeadersWithDOM(),(this.isMaster||this.is(Kr))&&this.markOversizedRows(),this.isMaster?(this.wtSettings.getSetting("externalRowCalculator")||(i.rowHeightCache.ensureBuilt(),i.columnWidthCache.ensureBuilt(),i.createVisibleCalculators()),o.refresh(!1),o.applyToDOM(),this.wtSettings.getSetting("onDraw",!0)):this.is(Kr)&&this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize())}let u=!1;return this.isMaster&&(u=o.topOverlay.resetFixedPosition(),o.bottomOverlay.clone&&(u=o.bottomOverlay.resetFixedPosition()||u),u=o.inlineStartOverlay.resetFixedPosition()||u,o.topInlineStartCornerOverlay&&o.topInlineStartCornerOverlay.resetFixedPosition(),o.bottomInlineStartCornerOverlay&&o.bottomInlineStartCornerOverlay.clone&&o.bottomInlineStartCornerOverlay.resetFixedPosition()),u?(o.refreshAll(),o.adjustElementsSize()):this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(d),this.isMaster&&o.afterDraw(),this.dataAccessObject.drawn=!0,this}markIfOversizedColumnHeader(e){const t=this.columnFilter.renderedToSource(e);let o=this.wtSettings.getSetting("columnHeaders").length;const i=this.wtSettings.getSetting("stylesHandler").getDefaultRowHeight();let s,r,a;const l=this.wtSettings.getSetting("columnHeaderHeight")||[];for(;o;)o-=1,s=this.getColumnHeaderHeight(o),r=this.getColumnHeader(t,o),r&&(a=Ou(r),(!s&&i<a||s<a)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[o]=a),Array.isArray(l)?l[o]!==null&&l[o]!==void 0&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[o]=l[o]):isNaN(l)||(this.dataAccessObject.wtViewport.oversizedColumnHeaders[o]=l),this.dataAccessObject.wtViewport.oversizedColumnHeaders[o]<(l[o]||l)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[o]=l[o]||l))}adjustColumnHeaderHeights(){const{wtSettings:e}=this,t=this.THEAD.childNodes,o=this.dataAccessObject.wtViewport.oversizedColumnHeaders,i=e.getSetting("columnHeaders");for(let s=0,r=i.length;s<r;s++)if(o[s]){if(!t[s]||t[s].childNodes.length===0)return;t[s].childNodes[0].style.height=`${o[s]}px`}}syncOversizedColumnHeadersWithDOM(){const{wtSettings:e}=this,t=this.THEAD.childNodes,o=this.dataAccessObject.wtViewport.oversizedColumnHeaders,i=e.getSetting("columnHeaders"),s=1;for(let r=0,a=i.length;r<a;r++){if(!t[r]||!o[r])continue;const l=Ou(t[r]);l>o[r]+s&&(o[r]=l)}}resetOversizedRows(){const{wtSettings:e}=this,{wtViewport:t}=this.dataAccessObject;if(!(!this.isMaster&&!this.is(Kr))&&!e.getSetting("externalRowCalculator")){const o=this.getRenderedRowsCount();for(let i=0;i<o;i++){const s=this.rowFilter.renderedToSource(i);t.oversizedRows&&t.oversizedRows[s]&&(t.oversizedRows[s]=void 0)}}}getCell(e){let t=e.row,o=e.col;const i=this.wtSettings.getSetting("onModifyGetCellCoords",t,o,!this.isMaster,"render");if(i&&Array.isArray(i)&&([t,o]=i),this.isRowBeforeRenderedRows(t))return-1;if(this.isRowAfterRenderedRows(t))return-2;if(this.isColumnBeforeRenderedColumns(o))return-3;if(this.isColumnAfterRenderedColumns(o))return-4;const s=this.getRow(t);!s&&t>=0&&Y("TR was expected to be rendered but is not");const r=s.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(o)];return!r&&o>=0&&Y("TD or TH was expected to be rendered but is not"),r}getRow(e){let t=null,o=null;return e<0?(t=this.rowFilter?.sourceRowToVisibleColHeadedRow(e),o=this.THEAD):(t=this.rowFilter?.sourceToRendered(e),o=this.TBODY),t!==void 0&&o!==void 0?o.childNodes.length<t+1?!1:o.childNodes[t]:!1}getColumnHeader(e,t=0){return this.THEAD.childNodes[t]?.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]}getColumnHeaders(e){const t=[],o=this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e);return this.THEAD.childNodes.forEach(i=>{const s=i.childNodes[o];s&&t.push(s)}),t}getRowHeader(e,t=0){const o=this.wtSettings.getSetting("rowHeaders").length;if(t>=o)return;const i=this.rowFilter.sourceToRendered(e),s=i<0?this.rowFilter.sourceRowToVisibleColHeadedRow(e):i;return(i<0?this.THEAD:this.TBODY).childNodes[s]?.childNodes[t]}getRowHeaders(e){const t=[],o=this.wtSettings.getSetting("rowHeaders").length;for(let i=0;i<o;i++){const r=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]?.childNodes[i];r&&t.push(r)}return t}getCoords(e){let t=e;if(t.nodeName!=="TD"&&t.nodeName!=="TH"&&(t=qc(t,["TD","TH"])),t===null)return null;const o=t.parentNode;if(!o)return null;const i=o.parentNode;let s=N4(o),r=t.cellIndex;Mh(ed,t,this.wtRootElement)||Mh(Qc,t,this.wtRootElement)?i.nodeName==="THEAD"&&(s-=i.childNodes.length):Mh(fh,t,this.wtRootElement)||Mh(Kr,t,this.wtRootElement)?s=this.wtSettings.getSetting("totalRows")-i.childNodes.length+s:i===this.THEAD?s=this.rowFilter.visibleColHeadedRowToSourceRow(s):this.rowFilter&&(s=this.rowFilter.renderedToSource(s)),Mh(ed,t,this.wtRootElement)||Mh(Jc,t,this.wtRootElement)||Mh(fh,t,this.wtRootElement)?r=this.columnFilter.offsettedTH(r):this.columnFilter&&(r=this.columnFilter.visibleRowHeadedColumnToSourceColumn(r));const a=this.wtSettings.getSetting("onModifyGetCoordsElement",s,r);return a&&Array.isArray(a)&&([s,r]=a),this.wot.createCellCoords(s,r)}markOversizedRows(){if(this.wtSettings.getSetting("externalRowCalculator"))return;let e=this.TBODY.childNodes.length;const t=this.wtSettings.getSetting("stylesHandler"),o=e*t.getDefaultRowHeight(),i=Ou(this.TBODY)-1,s=t.areCellsBorderBox(),r=s?xn:Ou,a=s?0:1,l=s?1:0;let h,c,d,u,f;if(o===i&&!this.wtSettings.getSetting("fixedRowsBottom"))return;const{wtViewport:p}=this.dataAccessObject;let C=!1;for(;e;){e-=1,d=this.rowFilter.renderedToSource(e),h=this.getRowHeight(d),u=this.getTrForRow(d),f=u.querySelector("th");const y=d===0?l:0;f?c=r(f):c=r(u)-a,(!h&&t.getDefaultRowHeight()<c-y||h<c)&&(s||(c+=1),p.oversizedRows[d]=c,C=!0)}C&&p.rowHeightCache.invalidate()}getTrForRow(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]}isColumnHeaderRendered(e){if(e>=0)return!1;const o=this.wtSettings.getSetting("rowHeaders").length;return Math.abs(e)<=o}isRowHeaderRendered(e){if(e>=0)return!1;const o=this.wtSettings.getSetting("columnHeaders").length;return Math.abs(e)<=o}isRowBeforeRenderedRows(e){const t=this.getFirstRenderedRow();return e<0&&t<=0?!this.isRowHeaderRendered(e):e<t}isRowAfterRenderedRows(e){return e>this.getLastRenderedRow()}isColumnBeforeRenderedColumns(e){const t=this.getFirstRenderedColumn();return e<0&&t<=0?!this.isColumnHeaderRendered(e):e<t}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 Cn(this.TABLE)}getHeight(){return xn(this.TABLE)}getTotalWidth(){const e=Cn(this.hider);return e!==0?e:this.getWidth()}getTotalHeight(){const e=xn(this.hider);return e!==0?e:this.getHeight()}isVisible(){return Kc(this.TABLE)}_modifyRowHeaderWidth(e){let t=_e(e)?e():null;return Array.isArray(t)?(t=[...t],t[t.length-1]=this._correctRowHeaderWidth(t[t.length-1])):t=this._correctRowHeaderWidth(t),t}_correctRowHeaderWidth(e){let t=e;return typeof e!="number"&&(t=this.wtSettings.getSetting("defaultColumnWidth")),this.correctHeaderWidth&&(t+=1),t}constructor(e,t,o,i,s){this.wtSettings=null,this.TBODY=null,this.THEAD=null,this.COLGROUP=null,this.hasTableHeight=!0,this.hasTableWidth=!0,this.isTableVisible=!1,this.tableOffset=0,this.holderOffset=0,this.domBindings=o,this.isMaster=s==="master",this.name=s,this.dataAccessObject=e,this.facadeGetter=t,this.wtSettings=i,this.instance=this.dataAccessObject.wot,this.wot=this.dataAccessObject.wot,this.TABLE=o.rootTable,fF(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 r=this.wtSettings.getSettingPure("rowHeaderWidth");this.wtSettings.update("rowHeaderWidth",()=>this._modifyRowHeaderWidth(r)),this.rowUtils=new x9(this.dataAccessObject,this.wtSettings),this.columnUtils=new T9(this.dataAccessObject,this.wtSettings),this.tableRenderer=new k9({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.wtSettings.getSetting("stylesHandler")})}}const M9="stickyRowsBottom",ck={getFirstRenderedRow(){const n=this.getRenderedRowsCount();return n===0?-1:this.wtSettings.getSetting("totalRows")-n},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}};cl(ck,"MIXIN_NAME",M9,{writable:!1,enumerable:!1});const I9="stickyColumnsStart",Vy={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}};cl(Vy,"MIXIN_NAME",I9,{writable:!1,enumerable:!1});class dk extends pf{constructor(e,t,o,i){super(e,t,o,i,fh)}}_t(dk,ck);_t(dk,Vy);const Qc="top",Kr="bottom",Jc="inline_start",ed="top_inline_start_corner",fh="bottom_inline_start_corner",oB=[Qc,Kr,Jc,ed,fh],H9=new Map([[Qc,`ht_clone_${Qc}`],[Kr,`ht_clone_${Kr}`],[Jc,`ht_clone_${Jc} ht_clone_left`],[ed,`ht_clone_${ed} ht_clone_top_left_corner`],[fh,`ht_clone_${fh} ht_clone_bottom_left_corner`]]);function A9(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fw(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function CH(n,e){A9(n,e),e.add(n)}var fS=new WeakSet,gS=new WeakSet;class O9{scrollViewport(e,t,o){if(e.col<0||e.row<0)return!1;const i=this.scrollViewportHorizontally(e.col,t),s=this.scrollViewportVertically(e.row,o);return i||s}scrollViewportHorizontally(e,t="auto"){const{drawn:o,totalColumns:i}=this.dataAccessObject;if(!o)return!1;const s=Li(t);if(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollHorizontally",e,s),!Number.isInteger(e)||e<0||e>i)return!1;t=s.value;const{fixedColumnsStart:r,inlineStartOverlay:a}=this.dataAccessObject,l=t==="auto";if(l&&e<r)return!1;const h=this.getFirstVisibleColumn(),c=this.getLastVisibleColumn();let d=!1;return(l&&(e<h||e>c)||!l)&&(d=a.scrollTo(e,l?e>=this.getLastPartiallyVisibleColumn():t==="end")),d}scrollViewportVertically(e,t="auto"){const{drawn:o,totalRows:i}=this.dataAccessObject;if(!o)return!1;const s=Li(t);if(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollVertically",e,s),!Number.isInteger(e)||e<0||e>i)return!1;t=s.value;const{fixedRowsBottom:r,fixedRowsTop:a,topOverlay:l}=this.dataAccessObject,h=t==="auto";if(h&&(e<a||e>i-r-1))return!1;const c=this.getFirstVisibleRow(),d=this.getLastVisibleRow();let u=!1;return(h&&(e<c||e>d)||!h)&&(u=l.scrollTo(e,h?e>=this.getLastPartiallyVisibleRow():t==="bottom")),u}getFirstVisibleRow(){return this.dataAccessObject.wtTable.getFirstVisibleRow()}getLastVisibleRow(){return fw(this,gS,_H).call(this,this.dataAccessObject.wtTable.getLastVisibleRow())}getFirstPartiallyVisibleRow(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleRow()}getLastPartiallyVisibleRow(){return fw(this,gS,_H).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleRow())}getFirstVisibleColumn(){return this.dataAccessObject.wtTable.getFirstVisibleColumn()}getLastVisibleColumn(){return fw(this,fS,yH).call(this,this.dataAccessObject.wtTable.getLastVisibleColumn())}getFirstPartiallyVisibleColumn(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleColumn()}getLastPartiallyVisibleColumn(){return fw(this,fS,yH).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleColumn())}constructor(e){CH(this,fS),CH(this,gS),this.dataAccessObject=e}}function yH(n){const{wtSettings:e,inlineStartOverlay:t,wtTable:o,wtViewport:i,totalColumns:s,rootWindow:r}=this.dataAccessObject;if(t.mainTableScrollableElement===r){const a=e.getSetting("rtlMode");let l=null;if(a){const c=o.TABLE.getBoundingClientRect(),u=this.dataAccessObject.rootWindow.document.documentElement.offsetWidth;l=Math.abs(c.right-u)}else l=Jo(o.wtRootElement).left;const h=Math.abs(pF(r,r));if(l>h){const c=mF(r);let d=i.getRowHeaderWidth();for(let u=1;u<=s;u++)if(d+=t.sumCellSizes(u-1,u),l+d-h>=c){n=u-2;break}}}return n}function _H(n){const{topOverlay:e,wtTable:t,wtViewport:o,totalRows:i,rootWindow:s}=this.dataAccessObject;if(e.mainTableScrollableElement===s){const r=Jo(t.wtRootElement),a=sk(s,s);if(r.top>a){const l=Ou(s);let h=o.getColumnHeaderHeight();for(let c=1;c<=i;c++)if(h+=e.sumCellSizes(c-1,c),r.top+h-a>=l){n=c-2;break}}}return n}class uk{get eventManager(){return new $i(this)}findOriginalHeaders(){const e=[];if(this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(let t=0,o=this.wtTable.THEAD.childNodes[0].childNodes.length;t<o;t++)e.push(this.wtTable.THEAD.childNodes[0].childNodes[t].innerHTML);this.wtSettings.getSetting("columnHeaders").length||this.wtSettings.update("columnHeaders",[function(t,o){_h(o,e[t])}])}}createCellCoords(e,t){return new Zc(e,t,this.wtSettings.getSetting("rtlMode"))}createCellRange(e,t,o){return new ff(e,t,o,this.wtSettings.getSetting("rtlMode"))}draw(e=!1){return this.drawInterrupted=!1,!this.wtTable.isVisible()||L4(this.wtTable.wtRootElement.parentNode)?this.drawInterrupted=!0:this.wtTable.draw(e),this}getCell(e,t=!1){if(!t)return this.wtTable.getCell(e);const o=this.wtSettings.getSetting("totalRows"),i=this.wtSettings.getSetting("fixedRowsTop"),s=this.wtSettings.getSetting("fixedRowsBottom"),r=this.wtSettings.getSetting("fixedColumnsStart");if(e.row<i&&e.col<r)return this.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.getCell(e);if(e.row<i)return this.wtOverlays.topOverlay.clone.wtTable.getCell(e);if(e.col<r&&e.row>=o-s){if(this.wtOverlays.bottomInlineStartCornerOverlay&&this.wtOverlays.bottomInlineStartCornerOverlay.clone)return this.wtOverlays.bottomInlineStartCornerOverlay.clone.wtTable.getCell(e)}else{if(e.col<r)return this.wtOverlays.inlineStartOverlay.clone.wtTable.getCell(e);if(e.row<o&&e.row>=o-s&&this.wtOverlays.bottomOverlay&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)}scrollViewport(e,t,o){return this.wtScroll.scrollViewport(e,t,o)}scrollViewportHorizontally(e,t){return this.wtScroll.scrollViewportHorizontally(e,t)}scrollViewportVertically(e,t){return this.wtScroll.scrollViewportVertically(e,t)}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 drawn(){return e.drawn},set drawn(t){e.drawn=t},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")}}}constructor(e,t){this.guid=`wt_${Q0()}`,this.drawInterrupted=!1,this.drawn=!1,this.activeOverlayName="master",this.domBindings={rootTable:e,rootDocument:e.ownerDocument,rootWindow:e.ownerDocument.defaultView},this.wtSettings=t,this.wtScroll=new O9(this.createScrollDao())}}class D9 extends uk{constructor(e,t,o){super(e,t);const i=this.wtSettings.getSetting("facade",this);this.cloneSource=o.source,this.cloneOverlay=o.overlay,this.wtTable=this.cloneOverlay.createTable(this.getTableDao(),i,this.domBindings,this.wtSettings),this.wtViewport=o.viewport,this.selectionManager=o.selectionManager,this.wtEvent=new KF(i,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager,o.event),this.findOriginalHeaders()}}class Fm{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=em(this.hider.parentNode.parentNode)}updateMainScrollableElement(){const{wtTable:e}=this.wot,{rootWindow:t}=this.domBindings,o=t.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow");o==="hidden"||o==="clip"?this.mainTableScrollableElement=this.wot.wtTable.holder:this.mainTableScrollableElement=MC(e.TABLE)}getRelativeCellPosition(e,t,o){if(this.clone.wtTable.holder.contains(e)===!1){Ie(`The provided element is not a child of the ${this.type} overlay`);return}const i=this.mainTableScrollableElement===this.domBindings.rootWindow,s=o<this.wtSettings.getSetting("fixedColumnsStart"),r=t<this.wtSettings.getSetting("fixedRowsTop"),a=t>=this.wtSettings.getSetting("totalRows")-this.wtSettings.getSetting("fixedRowsBottom"),l=this.clone.wtTable.spreader,h={start:this.getRelativeStartPosition(l),top:l.offsetTop},c={start:this.getRelativeStartPosition(e),top:e.offsetTop};let d=null;return i?d=this.getRelativeCellPositionWithinWindow(r,s,c,h):d=this.getRelativeCellPositionWithinHolder(r,a,s,c,h),d}getRelativeStartPosition(e){return this.isRtl()?e.offsetParent.offsetWidth-e.offsetLeft-e.offsetWidth:e.offsetLeft}getRelativeCellPositionWithinWindow(e,t,o,i){const s=this.wot.wtTable.wtRootElement.getBoundingClientRect();let r=0,a=0;if(!t)r=i.start;else{let l=s.left;this.isRtl()&&(l=this.domBindings.rootWindow.innerWidth-(s.left+s.width+Mn())),r=l<=0?-1*l:0}return e?a=this.clone.wtTable.TABLE.getBoundingClientRect().top-s.top:a=i.top,{start:o.start+r,top:o.top+a}}getRelativeCellPositionWithinHolder(e,t,o,i,s){const r={horizontal:this.wot.wtOverlays.inlineStartOverlay.getScrollPosition(),vertical:this.wot.wtOverlays.topOverlay.getScrollPosition()};let a=0,l=0;if(o||(a=r.horizontal-s.start),t){const h=this.wot.wtTable.wtRootElement.getBoundingClientRect();l=this.clone.wtTable.TABLE.getBoundingClientRect().top*-1+h.top}else e||(l=r.vertical-s.top);return{start:i.start-a,top:i.top-l}}makeClone(){oB.indexOf(this.type)===-1&&Y(`Clone type "${this.type}" is not supported.`);const{wtTable:e,wtSettings:t}=this.wot,{rootDocument:o,rootWindow:i}=this.domBindings,s=o.createElement("div"),r=o.createElement("table"),a=e.wtRootElement.parentNode;s.className=`${H9.get(this.type)} handsontable`,s.setAttribute("dir",this.isRtl()?"rtl":"ltr"),s.style.position="absolute",s.style.top=0,s.style.overflow="visible",this.isRtl()?s.style.right=0:s.style.left=0,t.getSetting("ariaTags")&&fe(s,[qa()]),r.className=e.TABLE.className,e.TABLE.getAttribute("role")&&r.setAttribute("role",e.TABLE.getAttribute("role")),s.appendChild(r),a.appendChild(s);const h=this.wtSettings.getSetting("preventOverflow"),c=i.getComputedStyle(a).getPropertyValue("overflow");return h===!0||h==="horizontal"&&this.type===Qc||h==="vertical"&&this.type===Jc?this.mainTableScrollableElement=i:c==="hidden"||c==="clip"?this.mainTableScrollableElement=e.holder:this.mainTableScrollableElement=MC(e.TABLE),new D9(r,this.wtSettings,{source:this.wot,overlay:this,viewport:this.wot.wtViewport,event:this.wot.wtEvent,selectionManager:this.wot.selectionManager})}refresh(e=!1){if(this.needFullRender){const t=this.clone.cloneSource;t.activeOverlayName=this.clone.wtTable.name,this.clone.draw(e),t.activeOverlayName="master"}}reset(){const e=this.clone.wtTable.holder,t=this.clone.wtTable.hider,o=e.style,i=t.style,s=e.parentNode.style;[o,i,s].forEach(r=>{r.width="",r.height=""})}isRtl(){return this.wtSettings.getSetting("rtlMode")}destroy(){this.clone.eventManager.destroy()}constructor(e,t,o,i,s){this.wtSettings=null,cl(this,"wot",e,{writable:!1}),this.domBindings=s,this.facadeGetter=t,this.wtSettings=i;const{TABLE:r,hider:a,spreader:l,holder:h,wtRootElement:c}=this.wot.wtTable;this.instance=this.wot,this.type=o,this.mainTableScrollableElement=null,this.TABLE=r,this.hider=a,this.spreader=l,this.holder=h,this.wtRootElement=c,this.trimmingContainer=em(this.hider.parentNode.parentNode),this.needFullRender=this.shouldBeRendered(),this.clone=this.makeClone()}}class N9 extends Fm{createTable(...e){return new dk(...e)}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 t=this.clone.wtTable.holder.parentNode;if(t.style.top="",this.trimmingContainer===this.domBindings.rootWindow){const s=this.inlineStartOverlay.getOverlayOffset(),r=this.bottomOverlay.getOverlayOffset();t.style[this.isRtl()?"right":"left"]=`${s}px`,t.style.bottom=`${r}px`}else By(t),this.repositionOverlay();let o=xn(this.clone.wtTable.TABLE);const i=Cn(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(o=0),t.style.height=`${o}px`,t.style.width=`${i}px`,!1}repositionOverlay(){const{wtTable:e,wtViewport:t}=this.wot,{rootDocument:o}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let s=0;t.hasVerticalScroll()||(s+=t.getWorkspaceHeight()-e.getTotalHeight()),t.hasVerticalScroll()&&t.hasHorizontalScroll()&&(s+=Mn(o)),i.style.bottom=`${s}px`}constructor(e,t,o,i,s,r){super(e,t,fh,o,i),this.bottomOverlay=s,this.inlineStartOverlay=r}}const P9="calculatedColumns",zy={getFirstRenderedColumn(){const n=this.dataAccessObject.startColumnRendered;return n===null?-1:n},getFirstVisibleColumn(){const n=this.dataAccessObject.startColumnVisible;return n===null?-1:n},getFirstPartiallyVisibleColumn(){const n=this.dataAccessObject.startColumnPartiallyVisible;return n===null?-1:n},getLastRenderedColumn(){const n=this.dataAccessObject.endColumnRendered;return n===null?-1:n},getLastVisibleColumn(){const n=this.dataAccessObject.endColumnVisible;return n===null?-1:n},getLastPartiallyVisibleColumn(){const n=this.dataAccessObject.endColumnPartiallyVisible;return n===null?-1:n},getRenderedColumnsCount(){return this.dataAccessObject.countColumnsRendered},getVisibleColumnsCount(){return this.dataAccessObject.countColumnsVisible},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};cl(zy,"MIXIN_NAME",P9,{writable:!1,enumerable:!1});class fk extends pf{constructor(e,t,o,i){super(e,t,o,i,Kr)}}_t(fk,ck);_t(fk,zy);class L9 extends Fm{createTable(...e){return new fk(...e)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.shouldBeRendered()||!this.wot.wtTable.holder.parentNode)return!1;const{rootWindow:e}=this.domBindings,t=this.clone.wtTable.holder.parentNode;t.style.top="";let o=0;const i=this.wtSettings.getSetting("preventOverflow");this.trimmingContainer===e&&(!i||i!=="vertical")?(o=this.getOverlayOffset(),t.style.bottom=`${o}px`):(o=this.getScrollPosition(),this.repositionOverlay());const s=this.adjustHeaderBordersPosition(o);return this.adjustElementsSize(),s}repositionOverlay(){const{wtTable:e,wtViewport:t}=this.wot,{rootDocument:o}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let s=0;t.hasVerticalScroll()||(s+=t.getWorkspaceHeight()-e.getTotalHeight()),t.hasVerticalScroll()&&t.hasHorizontalScroll()&&(s+=Mn(o)),i.style.bottom=`${s}px`}setScrollPosition(e){const{rootWindow:t}=this.domBindings,o=this.mainTableScrollableElement;let i=!1;if(o===t&&e!==t.scrollY){const s=t.scrollY;t.scrollTo(ik(t),top),i=s!==t.scrollY}else if(e!==o.scrollTop){const s=o.scrollTop;o.scrollTop=e,i=s!==o.scrollTop}return i}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,t){const{wtTable:o,wtSettings:i}=this.wot,s=i.getSetting("stylesHandler").getDefaultRowHeight();let r=e,a=0;for(;r<t;){const l=o.getRowHeight(r);a+=l===void 0?s:l,r+=1}return a}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:t}=this.wot,{rootDocument:o,rootWindow:i}=this.domBindings,r=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="horizontal"){let h=t.getWorkspaceWidth();t.hasVerticalScroll()&&(h-=Mn(o)),h=Math.min(h,e.wtRootElement.scrollWidth),r.width=`${h}px`}else r.width="";this.clone.wtTable.holder.style.width=r.width;let l=xn(this.clone.wtTable.TABLE);e.hasDefinedSize()||(l=0),r.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");typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number"?this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`:e===0?this.spreader.style.top="0":Y("Incorrect value of the rowsRenderCalculator"),this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){const e=this.isRtl()?"right":"left",{spreader:t}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?t.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:t.style[e]=""}scrollTo(e,t){let o=this.getTableParentOffset();const s=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder;let r=0;t&&s.offsetHeight!==s.clientHeight&&(r=Mn(this.domBindings.rootDocument)),t?(o+=this.sumCellSizes(0,e+1),o-=this.wot.wtViewport.getViewportHeight(),o+=1):o+=this.sumCellSizes(this.wtSettings.getSetting("fixedRowsBottom"),e),o+=r,this.setScrollPosition(o)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return sk(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,t=this.wtSettings.getSetting("preventOverflow");let o=0;if(this.trimmingContainer===e&&(!t||t!=="vertical")){const i=this.wot.wtTable.getTotalHeight(),s=this.clone.wtTable.getTotalHeight(),r=i-s,a=this.domBindings.rootDocument.documentElement.clientHeight;o=Math.max(this.getTableParentOffset()-this.getScrollPosition()-a+i,0),o>r&&(o=0)}return o}adjustHeaderBordersPosition(e){const t=this.wtSettings.getSetting("fixedRowsBottom"),o=this.cachedFixedRowsBottom!==t,i=this.wtSettings.getSetting("columnHeaders");let s=!1;if((o||t===0)&&i.length>0){const r=this.wot.wtTable.holder.parentNode,a=Se(r,"innerBorderBottom");this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom"),e||this.wtSettings.getSetting("totalRows")===0?(V(r,"innerBorderBottom"),s=!a):(re(r,"innerBorderBottom"),s=a)}return s}constructor(e,t,o,i){super(e,t,Kr,o,i),this.cachedFixedRowsBottom=-1,this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom")}}const W9="calculatedRows",gk={getFirstRenderedRow(){const n=this.dataAccessObject.startRowRendered;return n===null?-1:n},getFirstVisibleRow(){const n=this.dataAccessObject.startRowVisible;return n===null?-1:n},getFirstPartiallyVisibleRow(){const n=this.dataAccessObject.startRowPartiallyVisible;return n===null?-1:n},getLastRenderedRow(){const n=this.dataAccessObject.endRowRendered;return n===null?-1:n},getLastVisibleRow(){const n=this.dataAccessObject.endRowVisible;return n===null?-1:n},getLastPartiallyVisibleRow(){const n=this.dataAccessObject.endRowPartiallyVisible;return n===null?-1:n},getRenderedRowsCount(){return this.dataAccessObject.countRowsRendered},getVisibleRowsCount(){return this.dataAccessObject.countRowsVisible},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};cl(gk,"MIXIN_NAME",W9,{writable:!1,enumerable:!1});class pk extends pf{constructor(e,t,o,i){super(e,t,o,i,Jc)}}_t(pk,gk);_t(pk,Vy);const $9="localHooks",Bn={_localHooks:Object.create(null),addLocalHook(n,e){return this._localHooks[n]||(this._localHooks[n]=[]),this._localHooks[n].push(e),this},removeLocalHook(n,e){if(this._localHooks[n]){const t=this._localHooks[n].indexOf(e);t>-1&&this._localHooks[n].splice(t,1)}return this},runLocalHooks(n,e,t,o,i,s,r){if(this._localHooks[n]){const a=this._localHooks[n].length;for(let l=0;l<a;l++)RE(this._localHooks[n][l],this,e,t,o,i,s,r)}},clearLocalHooks(){return this._localHooks={},this}};cl(Bn,"MIXIN_NAME",$9,{writable:!1,enumerable:!1});let iB=class{isEmpty(){return this.cellRange===null}add(e){return this.isEmpty()?this.cellRange=this.settings.createCellRange(e):this.cellRange.expand(e),this}replace(e,t){if(!this.isEmpty()){if(this.cellRange.from.isEqual(e))return this.cellRange.from=t,!0;if(this.cellRange.to.isEqual(e))return this.cellRange.to=t,!0}return!1}clear(){return this.cellRange=null,this}getCorners(){const e=this.cellRange.getOuterTopStartCorner(),t=this.cellRange.getOuterBottomEndCorner();return[e.row,e.col,t.row,t.col]}destroy(){this.runLocalHooks("destroy")}constructor(e,t){this.settings=e,this.cellRange=t||null}};_t(iB,Bn);const sB="active-header",mk="header",wk="area",AC="focus",F9="fill",B9="row",V9="column",z9="custom-selection",bk=n=>{const e=n.wtSettings.getSetting("stylesHandler"),t=e.getCSSVariableValue("cell-autofill-size"),o=e.getCSSVariableValue("cell-autofill-border-width"),i=e.getCSSVariableValue("cell-autofill-border-color");return Object.freeze({width:t,height:t,borderWidth:o,borderStyle:"solid",borderColor:i})};function rB(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function U9(n,e){return e.get?e.get.call(n):e.value}function Y9(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function aB(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function mn(n,e){var t=aB(n,e,"get");return U9(n,t)}function SH(n,e,t){rB(n,e),e.set(n,t)}function vH(n,e,t){var o=aB(n,e,"set");return Y9(n,o,t),t}function pS(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function RH(n,e){rB(n,e),e.add(n)}var Ks=new WeakMap,Go=new WeakMap,EH=new WeakSet,mS=new WeakSet;class G9{setActiveOverlay(e){return vH(this,Go,e),this}setActiveSelection(e){return vH(this,Ks,e),this}scan(){const e=mn(this,Ks).settings.selectionType,t=new Set;return e==="active-header"?(this.scanColumnsInHeadersRange(o=>t.add(o)),this.scanRowsInHeadersRange(o=>t.add(o))):e==="area"?this.scanCellsRange(o=>t.add(o)):e==="focus"?(this.scanColumnsInHeadersRange(o=>t.add(o)),this.scanRowsInHeadersRange(o=>t.add(o)),this.scanCellsRange(o=>t.add(o))):e==="fill"?this.scanCellsRange(o=>t.add(o)):e==="header"?(this.scanColumnsInHeadersRange(o=>t.add(o)),this.scanRowsInHeadersRange(o=>t.add(o))):e==="row"?(this.scanRowsInHeadersRange(o=>t.add(o)),this.scanRowsInCellsRange(o=>t.add(o))):e==="column"&&(this.scanColumnsInHeadersRange(o=>t.add(o)),this.scanColumnsInCellsRange(o=>t.add(o))),t}scanColumnsInHeadersRange(e){const[t,o,i,s]=mn(this,Ks).getCorners(),{wtTable:r}=mn(this,Go),a=r.getRenderedColumnsCount(),l=r.getColumnHeadersCount();let h=0;for(let c=-r.getRowHeadersCount();c<a;c++){const d=r.columnFilter.renderedToSource(c);if(!(d<o||d>s)){for(let u=-l;u<0;u++){if(u<t||u>i)continue;const f=u+l;let p=r.getColumnHeader(d,f);const C=mn(this,Go).getSetting("onBeforeHighlightingColumnHeader",d,f,{selectionType:mn(this,Ks).settings.selectionType,columnCursor:h,selectionWidth:s-o+1});C!==null&&(C!==d&&(p=r.getColumnHeader(C,f)),e(p))}h+=1}}}scanRowsInHeadersRange(e){const[t,o,i,s]=mn(this,Ks).getCorners(),{wtTable:r}=mn(this,Go),a=r.getRenderedRowsCount(),l=r.getRowHeadersCount();let h=0;for(let c=-r.getColumnHeadersCount();c<a;c++){const d=r.rowFilter.renderedToSource(c);if(!(d<t||d>i)){for(let u=-l;u<0;u++){if(u<o||u>s)continue;const f=u+l;let p=r.getRowHeader(d,f);const C=mn(this,Go).getSetting("onBeforeHighlightingRowHeader",d,f,{selectionType:mn(this,Ks).settings.selectionType,rowCursor:h,selectionHeight:i-t+1});C!==null&&(C!==d&&(p=r.getRowHeader(C,f)),e(p))}h+=1}}}scanCellsRange(e){const{wtTable:t}=mn(this,Go);pS(this,EH,j9).call(this,(o,i)=>{const s=t.getCell(mn(this,Go).createCellCoords(o,i)),r=mn(this,Go).getSetting("onAfterDrawSelection",o,i,mn(this,Ks).settings.layerLevel);typeof r=="string"&&V(s,r),e(s)})}scanRowsInCellsRange(e){const[t,,o]=mn(this,Ks).getCorners(),{wtTable:i}=mn(this,Go);pS(this,mS,kH).call(this,(s,r)=>{if(s>=t&&s<=o){const a=i.getCell(mn(this,Go).createCellCoords(s,r));e(a)}})}scanColumnsInCellsRange(e){const[,t,,o]=mn(this,Ks).getCorners(),{wtTable:i}=mn(this,Go);pS(this,mS,kH).call(this,(s,r)=>{if(r>=t&&r<=o){const a=i.getCell(mn(this,Go).createCellCoords(s,r));e(a)}})}constructor(){RH(this,EH),RH(this,mS),SH(this,Ks,{writable:!0,value:void 0}),SH(this,Go,{writable:!0,value:void 0})}}function j9(n){let[e,t,o,i]=mn(this,Ks).getCorners();if(e<0&&o<0||t<0&&i<0)return;const{wtTable:s}=mn(this,Go),r=e!==o||t!==i;if(t=Math.max(t,0),i=Math.max(i,0),e=Math.max(e,0),o=Math.max(o,0),r){if(t=Math.max(t,s.getFirstRenderedColumn()),i=Math.min(i,s.getLastRenderedColumn()),e=Math.max(e,s.getFirstRenderedRow()),o=Math.min(o,s.getLastRenderedRow()),i<t||o<e)return}else{const a=s.getCell(mn(this,Go).createCellCoords(e,t));if(!na(a))return}for(let a=e;a<=o;a+=1)for(let l=t;l<=i;l+=1)n(a,l)}function kH(n){const{wtTable:e}=mn(this,Go),t=e.getRenderedRowsCount(),o=e.getRenderedColumnsCount();for(let i=0;i<t;i+=1){const s=e.rowFilter.renderedToSource(i);for(let r=0;r<o;r+=1)n(s,e.columnFilter.renderedToSource(r))}}const TH="ht-border-style-",q9="-vertical",K9="-horizontal";class xH{registerListeners(){const e=this.wot.rootDocument.body;this.eventManager.addEventListener(e,"mousedown",()=>this.onMouseDown()),this.eventManager.addEventListener(e,"mouseup",()=>this.onMouseUp());for(let t=0,o=this.main.childNodes.length;t<o;t++){const i=this.main.childNodes[t];this.eventManager.addEventListener(i,"mouseenter",s=>this.onMouseEnter(s,this.main.childNodes[t]))}}onMouseDown(){this.mouseDown=!0}onMouseUp(){this.mouseDown=!1}onMouseEnter(e,t){if(!this.mouseDown||!this.wot.getSetting("hideBorderOnMouseDownOver"))return;e.preventDefault(),es(e);const o=this,i=this.wot.rootDocument.body,s=t.getBoundingClientRect();t.style.display="none";function r(l){if(l.clientY<Math.floor(s.top)||l.clientY>Math.ceil(s.top+s.height)||l.clientX<Math.floor(s.left)||l.clientX>Math.ceil(s.left+s.width))return!0}function a(l){r(l)&&(o.eventManager.removeEventListener(i,"mousemove",a),t.style.display="block")}this.eventManager.addEventListener(i,"mousemove",a)}createBorders(e){const{rootDocument:t}=this.wot;this.main=t.createElement("div");const o=["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=o[a],h=t.createElement("div"),c=u=>this.settings[l]&&this.settings[l][u]?this.settings[l][u]:e.border[u];h.className=`wtBorder ${this.settings.className||""}`,this.settings[l]&&this.settings[l].hide&&(h.className+=" hidden"),i=h.style;const d=c("style");d?(["start","end"].includes(l)?h.className+=` ${TH}${d}${q9}`:h.className+=` ${TH}${d}${K9}`,i.setProperty("--ht-custom-border-size",`${c("width")}px`),i.setProperty("--ht-custom-border-color",c("color"))):i.backgroundColor=c("color"),i.height=`${c("width")}px`,i.width=`${c("width")}px`,this.main.appendChild(h)}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(" "),Qr()&&this.instance.getSetting("isDataViewInstance")&&this.createMultipleSelectorHandles(),this.disappear();const{wtTable:s}=this.wot;let r=s.bordersHolder;r||(r=t.createElement("div"),r.className="htBorders",s.bordersHolder=r,s.spreader.appendChild(r)),r.appendChild(this.main)}createMultipleSelectorHandles(){const{rootDocument:t}=this.wot;this.selectionHandles={top:t.createElement("DIV"),topHitArea:t.createElement("DIV"),bottom:t.createElement("DIV"),bottomHitArea:t.createElement("DIV")},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 o={position:"absolute",height:"40px",width:"40px","border-radius":`${parseInt(40/1.5,10)}px`};nt(o,(i,s)=>{this.selectionHandles.styles.bottomHitArea[s]=i,this.selectionHandles.styles.topHitArea[s]=i}),this.updateMultipleSelectorHandlesStyles(),this.main.appendChild(this.selectionHandles.top),this.main.appendChild(this.selectionHandles.bottom),this.main.appendChild(this.selectionHandles.topHitArea),this.main.appendChild(this.selectionHandles.bottomHitArea)}updateMultipleSelectorHandlesStyles(){if(!this.selectionHandles)return;const t=this.wot.wtSettings.getSetting("stylesHandler"),o=t.getCSSVariableValue("cell-mobile-handle-size"),i=t.getCSSVariableValue("cell-mobile-handle-border-radius"),s=t.getCSSVariableValue("cell-mobile-handle-background-color"),r=t.getCSSVariableValue("cell-mobile-handle-background-opacity"),a=t.getCSSVariableValue("cell-mobile-handle-border-width"),l=t.getCSSVariableValue("cell-mobile-handle-border-color"),h={position:"absolute",height:`${o}px`,width:`${o}px`,"border-radius":`${i}px`,background:`color-mix(in srgb, ${s} ${r}%, transparent)`,border:`${a}px solid ${l}`};nt(h,(c,d)=>{this.selectionHandles.styles.bottom[d]=c,this.selectionHandles.styles.top[d]=c})}isPartRange(e,t){const o=this.wot.selectionManager.getAreaSelection();return!!(o.cellRange&&(e!==o.cellRange.to.row||t!==o.cellRange.to.col))}updateMultipleSelectionHandlesPosition(e,t,o,i,s,r){const l=this.wot.wtSettings.getSetting("rtlMode")?"right":"left",{top:h,topHitArea:c,bottom:d,bottomHitArea:u}=this.selectionHandles.styles,f=parseInt(h.borderWidth,10),p=parseInt(h.width,10),C=parseInt(c.width,10),y=this.wot.wtTable.getWidth(),_=this.wot.wtTable.getHeight();h.top=`${parseInt(o-p-1,10)}px`,h[l]=`${parseInt(i-p-1,10)}px`,c.top=`${parseInt(o-C/4*3,10)}px`,c[l]=`${parseInt(i-C/4*3,10)}px`;const T=Math.min(parseInt(i+s,10),y-p-f*2),P=Math.min(parseInt(i+s-C/4,10),y-C-f*2);d[l]=`${T}px`,u[l]=`${P}px`;const $=Math.min(parseInt(o+r,10),_-p-f*2),F=Math.min(parseInt(o+r-C/4,10),_-C-f*2);d.top=`${$}px`,u.top=`${F}px`,this.settings.border.cornerVisible&&this.settings.border.cornerVisible()?(h.display="block",c.display="block",this.isPartRange(e,t)?(d.display="none",u.display="none"):(d.display="block",u.display="block")):(h.display="none",d.display="none",c.display="none",u.display="none"),e===this.wot.wtSettings.getSetting("fixedRowsTop")||t===this.wot.wtSettings.getSetting("fixedColumnsStart")?(h.zIndex="9999",c.zIndex="9999"):(h.zIndex="",c.zIndex="")}appear(e){if(this.disabled)return;let[t,o,i,s]=e;if(t<0&&i<0||o<0&&s<0){this.disappear();return}const{wtTable:r,rootDocument:a,rootWindow:l}=this.wot,h=t!==i||o!==s,c=r.getFirstRenderedRow(),d=r.getLastRenderedRow(),u=r.getFirstRenderedColumn(),f=r.getLastRenderedColumn();if(u<0&&f<0||c<0&&d<0){this.disappear();return}let p;if(h){if(o=Math.max(o,u),s=Math.min(s,f),t=Math.max(t,c),i=Math.min(i,d),s<o||i<t){this.disappear();return}p=r.getCell(this.wot.createCellCoords(t,o))}else if(p=r.getCell(this.wot.createCellCoords(t,o)),!na(p)){this.disappear();return}const C=h?r.getCell(this.wot.createCellCoords(i,s)):p,y=Jo(p),_=h?Jo(C):y,T=Jo(r.TABLE),P=y.top,$=y.left,F=this.wot.wtSettings.getSetting("rtlMode");let N=0,I=0;if(F){const He=Cn(r.TABLE),Ye=Cn(p),bt=l.innerWidth-T.left-He;I=$+Ye-_.left,N=l.innerWidth-$-Ye-bt-1}else I=_.left+Cn(C)-$,N=$-T.left-1;if(this.isEntireColumnSelected(t,i)){const He=t,Ye=this.getDimensionsFromHeader("columns",o,s,He,T);let bt=null;Ye&&([bt,N,I]=Ye),bt&&(p=bt)}let j=P-T.top-1,U=_.top+xn(C)-P;if(this.isEntireRowSelected(o,s)){const He=o,Ye=this.getDimensionsFromHeader("rows",t,i,He,T);let bt=null;Ye&&([bt,j,U]=Ye),bt&&(p=bt)}const G=l.getComputedStyle(p);parseInt(G.borderTopWidth,10)>0&&(j+=1,U=U>0?U-1:0),parseInt(G[F?"borderRightWidth":"borderLeftWidth"],10)>0&&(N+=1,I=I>0?I-1:0);const te=F?"right":"left",Q=Math.ceil(this.settings.border.width/2);this.topStyle.top=`${j}px`,this.topStyle[te]=`${N}px`,this.topStyle.width=`${I+Q}px`,this.topStyle.display="block",this.startStyle.top=`${j}px`,this.startStyle[te]=`${N}px`,this.startStyle.height=`${U+Q}px`,this.startStyle.display="block",this.bottomStyle.top=`${j+U-parseInt(this.bottomStyle.height,10)+Q}px`,this.bottomStyle[te]=`${N}px`,this.bottomStyle.width=`${I+Q}px`,this.bottomStyle.display="block",this.endStyle.top=`${j}px`,this.endStyle[te]=`${N+I-parseInt(this.endStyle.width,10)+Q}px`,this.endStyle.height=`${U+Q}px`,this.endStyle.display="block";let be=this.settings.border.cornerVisible;be=typeof be=="function"?be(this.settings.layerLevel):be;const Oe=this.wot.getSetting("onModifyGetCellCoords",i,s,!1,"render");let[Ve,Ke]=[i,s];if(Oe&&Array.isArray(Oe)&&([,,Ve,Ke]=Oe),Qr()||!be||this.isPartRange(Ve,Ke))this.cornerStyle.display="none";else{this.cornerStyle.top=`${j+U+this.cornerCenterPointOffset-this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle[te]=`${N+I+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 He=em(r.TABLE);const Ye=He===l;Ye&&(He=a.documentElement);const bt=parseInt(this.cornerDefaultStyle.borderWidth,10)-1,sn=Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),D=Math.ceil(parseInt(this.cornerDefaultStyle.height,10)/2);if(s===this.wot.getSetting("totalColumns")-1){const K=Ye?C.getBoundingClientRect().left:C.offsetLeft;let ye=!1,z=0;if(F?(z=K-parseInt(this.cornerDefaultStyle.width,10)/2,ye=z<0):(z=K+Cn(C)+parseInt(this.cornerDefaultStyle.width,10)/2,ye=z>=mF(He)),ye){const Ee=Math.floor(N+I+this.cornerCenterPointOffset-sn-bt);V(this.corner,"wtCornerInlineEndEdge"),this.cornerStyle[te]=`${Ee-1}px`}}else re(this.corner,"wtCornerInlineEndEdge");if(i===this.wot.getSetting("totalRows")-1){if((Ye?C.getBoundingClientRect().top:C.offsetTop)+xn(C)+parseInt(this.cornerDefaultStyle.height,10)/2>=Ou(He)){const Ee=Math.floor(j+U+this.cornerCenterPointOffset-D-bt);V(this.corner,"wtCornerBlockEndEdge"),this.cornerStyle.top=`${Ee-1}px`}}else re(this.corner,"wtCornerBlockEndEdge");this.cornerStyle.display="block"}Qr()&&this.instance.getSetting("isDataViewInstance")&&this.updateMultipleSelectionHandlesPosition(i,s,j,N,I,U)}isEntireColumnSelected(e,t){return e===this.wot.wtTable.getFirstRenderedRow()&&t===this.wot.wtTable.getLastRenderedRow()}isEntireRowSelected(e,t){return e===this.wot.wtTable.getFirstRenderedColumn()&&t===this.wot.wtTable.getLastRenderedColumn()}getDimensionsFromHeader(e,t,o,i,s){const{wtTable:r}=this.wot,a=r.wtRootElement.parentNode;let l=null,h=null,c=null,d=null,u=null,f=null,p=null,C=null;switch(e){case"rows":l=(...y)=>r.getRowHeader(...y),h=(...y)=>xn(...y),c="ht__selection--rows",f="top";break;case"columns":l=(...y)=>r.getColumnHeader(...y),h=(...y)=>Cn(...y),c="ht__selection--columns",f="left";break}if(a.classList.contains(c)){const y=this.wot.getSetting("columnHeaders").length;if(p=l(t,y-i),C=l(o,y-i),!p||!C)return!1;const _=Jo(p),T=Jo(C);return p&&C&&(d=_[f]-s[f]-1,u=T[f]+h(C)-_[f]),[p,d,u]}return!1}changeBorderStyle(e,t){const o=this[e].style,i=t[e];!i||i.hide?V(this[e],"hidden"):(Se(this[e],"hidden")&&re(this[e],"hidden"),o.backgroundColor=i.color,(e==="top"||e==="bottom")&&(o.height=`${i.width}px`),(e==="start"||e==="end")&&(o.width=`${i.width}px`))}changeBorderToDefaultStyle(e){const t={width:1,color:"#000"},o=this[e].style;o.backgroundColor=t.color,o.width=`${t.width}px`,o.height=`${t.width}px`}toggleHiddenClass(e,t){this.changeBorderToDefaultStyle(e),t?V(this[e],"hidden"):re(this[e],"hidden")}disappear(){this.topStyle.display="none",this.bottomStyle.display="none",this.startStyle.display="none",this.endStyle.display="none",this.cornerStyle.display="none",Qr()&&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)}constructor(e,t){t&&(this.eventManager=e.eventManager,this.instance=e,this.wot=e,this.settings=t,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=bk(this.instance),this.cornerCenterPointOffset=-Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),this.corner=null,this.cornerStyle=null,this.createBorders(t),this.registerListeners())}}function lB(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function X9(n,e){return e.get?e.get.call(n):e.value}function Z9(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function hB(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Xe(n,e){var t=hB(n,e,"get");return X9(n,t)}function bd(n,e,t){lB(n,e),e.set(n,t)}function Cd(n,e,t){var o=hB(n,e,"set");return Z9(n,o,t),t}function Q9(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function J9(n,e){lB(n,e),e.add(n)}var jo=new WeakMap,Ii=new WeakMap,gw=new WeakMap,gu=new WeakMap,pw=new WeakMap,ga=new WeakMap,MH=new WeakSet;class e7{setActiveOverlay(e){return Cd(this,jo,e),Xe(this,gw).setActiveOverlay(Xe(this,jo)),Xe(this,gu).has(Xe(this,jo))||Xe(this,gu).set(Xe(this,jo),new Set),this}getFocusSelection(){return Xe(this,Ii)!==null?Xe(this,Ii).getFocus():null}getAreaSelection(){return Xe(this,Ii)!==null?Xe(this,Ii).createLayeredArea():null}getBorderInstance(e){if(!e.settings.border)return null;if(Xe(this,ga).has(e)){const o=Xe(this,ga).get(e);if(o.has(Xe(this,jo)))return o.get(Xe(this,jo));const i=new xH(Xe(this,jo),e.settings);return o.set(Xe(this,jo),i),i}const t=new xH(Xe(this,jo),e.settings);return Xe(this,ga).set(e,new Map([[Xe(this,jo),t]])),t}getBorderInstances(e){return Array.from(Xe(this,ga).get(e)?.values()??[])}destroyBorders(e){Xe(this,ga).get(e).forEach(t=>t.destroy()),Xe(this,ga).delete(e)}refreshAllBorderHandleStyles(){Xe(this,ga).forEach(e=>{e.forEach(t=>{t.updateMultipleSelectorHandlesStyles?.()})})}render(e){if(Xe(this,Ii)===null)return;e&&Q9(this,MH,t7).call(this);const t=Array.from(Xe(this,Ii)),o=new Map,i=new Map;for(let s=0;s<t.length;s++){const r=t[s],{className:a,headerAttributes:l,createLayers:h,selectionType:c}=r.settings;Xe(this,pw).has(r)||(Xe(this,pw).add(r),r.addLocalHook("destroy",()=>this.destroyBorders(r)));const d=this.getBorderInstance(r);if(r.isEmpty()){d?.disappear();continue}a&&Xe(this,gw).setActiveSelection(r).scan().forEach(p=>{if(o.has(p)){const C=o.get(p);C.has(a)&&h===!0?C.set(a,C.get(a)+1):C.set(a,1)}else o.set(p,new Map([[a,1]]));l&&(i.has(p)||i.set(p,[]),p.nodeName==="TH"&&i.get(p).push(...l))});const u=r.getCorners();Xe(this,jo).getSetting("onBeforeDrawBorders",u,c),d?.appear(u)}o.forEach((s,r)=>{const a=Array.from(s).map(([l,h])=>h===1?l:[l,...Array.from({length:h-1},(c,d)=>`${l}-${d+1}`)]).flat();a.forEach(l=>Xe(this,gu).get(Xe(this,jo)).add(l)),V(r,a),r.nodeName==="TD"&&Array.isArray(Xe(this,Ii).options?.cellAttributes)&&fe(r,Xe(this,Ii).options.cellAttributes)}),Array.from(i.keys()).forEach(s=>{fe(s,[...i.get(s)])})}constructor(e){J9(this,MH),bd(this,jo,{writable:!0,value:void 0}),bd(this,Ii,{writable:!0,value:void 0}),bd(this,gw,{writable:!0,value:void 0}),bd(this,gu,{writable:!0,value:void 0}),bd(this,pw,{writable:!0,value:void 0}),bd(this,ga,{writable:!0,value:void 0}),Cd(this,gw,new G9),Cd(this,gu,new WeakMap),Cd(this,pw,new WeakSet),Cd(this,ga,new Map),Cd(this,Ii,e)}}function t7(){const n=Xe(this,gu).get(Xe(this,jo)),e=Xe(this,jo).wtSettings.getSetting("onBeforeRemoveCellClassNames");if(Array.isArray(e))for(let t=0;t<e.length;t++)n.add(e[t]);n.forEach(t=>{const o=Xe(this,jo).wtTable.TABLE.querySelectorAll(`.${t}`);let i=[];Array.isArray(Xe(this,Ii).options?.cellAttributes)&&(i=Xe(this,Ii).options.cellAttributes.map(s=>s[0])),Array.isArray(Xe(this,Ii).options?.headerAttributes)&&(i=[...i,...Xe(this,Ii).options.headerAttributes.map(s=>s[0])]);for(let s=0,r=o.length;s<r;s++)re(o[s],t),ta(o[s],i)}),n.clear()}class n7 extends Fm{createTable(...e){return new pk(...e)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){const{wtTable:e}=this.wot;if(!this.needFullRender||!this.shouldBeRendered()||!e.holder.parentNode)return!1;const{rootWindow:t}=this.domBindings,o=this.clone.wtTable.holder.parentNode,i=this.wtSettings.getSetting("preventOverflow");let s=0;this.trimmingContainer===t&&(!i||i!=="horizontal")?(s=this.getOverlayOffset()*(this.isRtl()?-1:1),rk(o,`${s}px`,"0px")):(s=this.getScrollPosition(),By(o));const r=this.adjustHeaderBordersPosition(s);return this.adjustElementsSize(),r}setScrollPosition(e){const{rootWindow:t}=this.domBindings;let o=!1;this.isRtl()&&(e=-e);const i=this.mainTableScrollableElement;if(i===t&&e!==t.scrollX){const s=t.scrollX;t.scrollTo(e,gF(t)),o=s!==t.scrollX}else if(e!==i.scrollLeft){const s=i.scrollLeft;i.scrollLeft=e,o=s!==i.scrollLeft}return o}onScroll(){this.wtSettings.getSetting("onScrollVertically")}sumCellSizes(e,t){const o=this.wtSettings.getSetting("defaultColumnWidth");let i=e,s=0;for(;i<t;)s+=this.wot.wtTable.getColumnWidth(i)||o,i+=1;return s}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:t}=this.wot,{rootDocument:o,rootWindow:i}=this.domBindings,r=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="vertical"){let h=t.getWorkspaceHeight();t.hasHorizontalScroll()&&(h-=Mn(o)),h=Math.min(h,e.wtRootElement.scrollHeight),r.height=`${h}px`}else r.height="";this.clone.wtTable.holder.style.height=r.height;const l=Cn(this.clone.wtTable.TABLE);r.width=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,t=bk(this.wot),o=this.wot.selectionManager.getFocusSelection()?parseInt(t.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)+o}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalColumns"),t=this.isRtl()?"right":"left";typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?this.spreader.style[t]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:e===0?this.spreader.style[t]="0":Y("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,t){const{wtSettings:o}=this,i=o.getSetting("rowHeaders"),s=o.getSetting("fixedColumnsStart"),a=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder,l=s===0&&i.length>0&&!Se(a.parentNode,"innerBorderInlineStart")?1:0;let h=this.getTableParentOffset(),c=0;if(t){const d=this.wot.wtTable.getColumnWidth(e),u=this.wot.wtViewport.getViewportWidth();d>u&&(t=!1)}return t&&a.offsetWidth!==a.clientWidth&&(c=Mn(this.domBindings.rootDocument)),t?(h+=this.sumCellSizes(0,e+1),h-=this.wot.wtViewport.getViewportWidth(),h+=l):h+=this.sumCellSizes(this.wtSettings.getSetting("fixedColumnsStart"),e),h+=c,$4(this.mainTableScrollableElement)===h-l&&l>0&&this.wot.wtOverlays.expandHiderHorizontallyBy(l),this.setScrollPosition(h)}getTableParentOffset(){const e=this.wtSettings.getSetting("preventOverflow");let t=0;return!e&&this.trimmingContainer===this.domBindings.rootWindow&&(t=this.wot.wtTable.holderOffset.left),t}getScrollPosition(){return Math.abs(pF(this.mainTableScrollableElement,this.domBindings.rootWindow))}getOverlayOffset(){const{rootWindow:e}=this.domBindings,t=this.wtSettings.getSetting("preventOverflow");let o=0;if(this.trimmingContainer===e&&(!t||t!=="horizontal")){this.isRtl()?o=Math.abs(Math.min(this.getTableParentOffset()-this.getScrollPosition(),0)):o=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0);const i=this.wot.wtTable.getTotalWidth(),s=this.clone.wtTable.getTotalWidth(),r=i-s;o>r&&(o=0)}return o}adjustHeaderBordersPosition(e){const{wtSettings:t}=this,o=this.wot.wtTable.holder.parentNode,i=t.getSetting("rowHeaders"),s=t.getSetting("fixedColumnsStart"),r=t.getSetting("totalRows"),a=t.getSetting("preventOverflow")==="vertical";r?re(o,"emptyRows"):V(o,"emptyRows");let l=!1;if(!a){if(s&&!i.length)V(o,"innerBorderLeft innerBorderInlineStart");else if(!s&&i.length){const h=Se(o,"innerBorderInlineStart");e?(V(o,"innerBorderLeft innerBorderInlineStart"),l=!h):(re(o,"innerBorderLeft innerBorderInlineStart"),l=h)}}return l}constructor(e,t,o,i){super(e,t,Jc,o,i)}}const o7="stickyRowsTop",Ck={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}};cl(Ck,"MIXIN_NAME",o7,{writable:!1,enumerable:!1});class yk extends pf{constructor(e,t,o,i){super(e,t,o,i,ed)}}_t(yk,Ck);_t(yk,Vy);class i7 extends Fm{createTable(...e){return new yk(...e)}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),s=this.topOverlay.getOverlayOffset();rk(e,`${i}px`,`${s}px`)}else By(e);let t=xn(this.clone.wtTable.TABLE);const o=Cn(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(t=0),e.style.height=`${t}px`,e.style.width=`${o}px`,!1}constructor(e,t,o,i,s,r){super(e,t,ed,o,i),this.topOverlay=s,this.inlineStartOverlay=r}}class _k extends pf{constructor(e,t,o,i){super(e,t,o,i,Qc)}}_t(_k,Ck);_t(_k,zy);class s7 extends Fm{createTable(...e){return new _k(...e)}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:t}=this.domBindings,o=this.wtSettings.getSetting("preventOverflow");let i=0,s=!1;if(this.trimmingContainer===t&&(!o||o!=="vertical")){const{wtTable:a}=this.wot,l=a.hider.getBoundingClientRect(),h=Math.ceil(l.bottom),c=e.offsetHeight;s=h===c,i=this.getOverlayOffset(),rk(e,"0px",`${i}px`)}else i=this.getScrollPosition(),By(e);const r=this.adjustHeaderBordersPosition(i,s);return this.adjustElementsSize(),r}setScrollPosition(e){const{rootWindow:t}=this.domBindings,o=this.mainTableScrollableElement;let i=!1;if(o===t&&e!==t.scrollY){const s=t.scrollY;t.scrollTo(ik(t),e),i=s!==t.scrollY}else if(e!==o.scrollTop){const s=o.scrollTop;o.scrollTop=e,i=s!==o.scrollTop}return i}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,t){const o=this.wtSettings.getSetting("stylesHandler").getDefaultRowHeight();let i=e,s=0;for(;i<t;){const r=this.wot.wtTable.getRowHeight(i);s+=r===void 0?o:r,i+=1}return s}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:t}=this.wot,{rootDocument:o,rootWindow:i}=this.domBindings,r=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="horizontal"){let h=t.getWorkspaceWidth();t.hasVerticalScroll()&&(h-=Mn(o)),h=Math.min(h,e.wtRootElement.scrollWidth),r.width=`${h}px`}else r.width="";this.clone.wtTable.holder.style.width=r.width;let l=xn(this.clone.wtTable.TABLE);e.hasDefinedSize()||(l=0),r.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,t=bk(this.wot),o=this.wot.selectionManager.getFocusSelection()?parseInt(t.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)+o}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number"?this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`:e===0?this.spreader.style.top="0":Y("Incorrect value of the rowsRenderCalculator"),this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){const e=this.isRtl()?"right":"left",{spreader:t}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?t.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:t.style[e]=""}scrollTo(e,t){const{wot:o,wtSettings:i}=this,r=(o.cloneSource?o.cloneSource:o).wtTable.holder,a=i.getSetting("columnHeaders"),h=i.getSetting("fixedRowsTop")===0&&a.length>0&&!Se(r.parentNode,"innerBorderTop")?1:0;let c=this.getTableParentOffset(),d=0;if(t){const u=this.wot.wtTable.getRowHeight(e),f=this.wot.wtViewport.getViewportHeight();u>f&&(t=!1)}if(t&&r.offsetHeight!==r.clientHeight&&(d=Mn(this.domBindings.rootDocument)),t){const u=i.getSetting("fixedRowsBottom"),f=i.getSetting("totalRows");c+=this.sumCellSizes(0,e+1),c-=o.wtViewport.getViewportHeight()-this.sumCellSizes(f-u,f),c+=1,c+=h}else c+=this.sumCellSizes(i.getSetting("fixedRowsTop"),e);return c+=d,W4(this.mainTableScrollableElement)===c-h&&h>0&&this.wot.wtOverlays.expandHiderVerticallyBy(h),this.setScrollPosition(c)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return sk(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,t=this.wtSettings.getSetting("preventOverflow");let o=0;if(this.trimmingContainer===e&&(!t||t!=="vertical")){const i=this.wot.wtTable.getTotalHeight(),s=this.clone.wtTable.getTotalHeight(),r=i-s;o=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0),o>r&&(o=0)}return o}adjustHeaderBordersPosition(e,t=!1){const{wtSettings:o}=this,i=this.wot.wtTable.holder.parentNode,s=o.getSetting("totalColumns"),r=o.getSetting("preventOverflow")==="horizontal";s?re(i,"emptyColumns"):V(i,"emptyColumns");let a=!1;if(!t&&!r){const l=o.getSetting("fixedRowsTop"),h=this.cachedFixedRowsTop!==l,c=o.getSetting("columnHeaders");if((h||l===0)&&c.length>0){const d=Se(i,"innerBorderTop");this.cachedFixedRowsTop=o.getSetting("fixedRowsTop"),e||o.getSetting("totalRows")===0?(V(i,"innerBorderTop"),a=!d):(re(i,"innerBorderTop"),a=d)}}return a}constructor(e,t,o,i){super(e,t,Qc,o,i),this.cachedFixedRowsTop=-1,this.cachedFixedRowsTop=this.wtSettings.getSetting("fixedRowsTop")}}function cB(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function r7(n,e){return e.get?e.get.call(n):e.value}function a7(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function dB(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function lo(n,e){var t=dB(n,e,"get");return r7(n,t)}function wS(n,e,t){cB(n,e),e.set(n,t)}function Xs(n,e,t){var o=dB(n,e,"set");return a7(n,o,t),t}function Kt(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function pa(n,e){cB(n,e),e.add(n)}var wi=new WeakMap,Zs=new WeakMap,Hh=new WeakMap,IH=new WeakSet,zb=new WeakSet,Ub=new WeakSet,HH=new WeakSet,Qg=new WeakSet,pu=new WeakSet,AH=new WeakSet,Bm=new WeakSet,nm=new WeakSet;class l7{registerListeners(){const{eventManager:e,domBindings:{rootDocument:t}}=lo(this,wi);lo(this,Zs)&&(Xs(this,Zs,!1),Kt(this,pu,Jg).call(this,"relative",0,0)),Xs(this,Hh,!1),e.addEventListener(t,"mousedown",o=>{Xs(this,Hh,Kt(this,AH,d7).call(this,o))}),e.addEventListener(t,"mouseup",()=>{Xs(this,Hh,!1),lo(this,Zs)&&this.deactivate()})}tryActivate(e,t){lo(this,Hh)&&!lo(this,Zs)&&!$y()&&(e||t)&&Kt(this,IH,h7).call(this)}syncOffsets(){if(!lo(this,Zs))return;const e=lo(this,wi),{wtViewport:t}=e.wot,o=t.rowsRenderCalculator.startPosition,i=t.columnsRenderCalculator.startPosition;if(typeof o!="number"||typeof i!="number")return;const s=o-Kt(this,zb,HE).call(this),r=i-Kt(this,Ub,AE).call(this);Kt(this,pu,Jg).call(this,"sticky",s,r)}destroy(){lo(this,Zs)&&Kt(this,pu,Jg).call(this,"relative",0,0),Xs(this,Zs,!1),Xs(this,Hh,!1)}deactivate(){const e=lo(this,wi),t=e.wtTable.spreader,{wtViewport:o}=e.wot,s=e.wtSettings.getSetting("rtlMode")?"right":"left";e.refreshAll();const r=parseInt(t.style.top,10)||0,a=parseInt(t.style[s],10)||0,l=o.rowsRenderCalculator.startPosition,h=o.columnsRenderCalculator.startPosition,c=typeof l=="number"?l-r:Kt(this,zb,HE).call(this),d=typeof h=="number"?h-a:Kt(this,Ub,AE).call(this);Kt(this,HH,c7).call(this,c,d),Xs(this,Zs,!1),Kt(this,pu,Jg).call(this,"relative",0,0),e.refreshAll(),e.applyToDOM()}constructor(e){pa(this,IH),pa(this,zb),pa(this,Ub),pa(this,HH),pa(this,Qg),pa(this,pu),pa(this,AH),pa(this,Bm),pa(this,nm),wS(this,wi,{writable:!0,value:void 0}),wS(this,Zs,{writable:!0,value:void 0}),wS(this,Hh,{writable:!0,value:void 0}),Xs(this,Zs,!1),Xs(this,Hh,!1),Xs(this,wi,e)}}function h7(){const n=lo(this,wi),e=n.wtTable.spreader,o=n.wtSettings.getSetting("rtlMode")?"right":"left",s=(parseInt(e.style.top,10)||0)-Kt(this,zb,HE).call(this),a=(parseInt(e.style[o],10)||0)-Kt(this,Ub,AE).call(this);Xs(this,Zs,!0),Kt(this,pu,Jg).call(this,"sticky",s,a)}function HE(){const{topOverlay:n}=lo(this,wi);return n.getScrollPosition()-n.getTableParentOffset()}function AE(){const{inlineStartOverlay:n}=lo(this,wi);return Kt(this,nm,OC).call(this)&&Kt(this,Bm,Uy).call(this)?Math.abs(n.getScrollPosition()):Math.abs(n.getScrollPosition())-n.getTableParentOffset()}function c7(n,e){const t=lo(this,wi);if(Kt(this,Bm,Uy).call(this)){const{rootWindow:o}=t.domBindings,i=Kt(this,nm,OC).call(this)?e:e+t.inlineStartOverlay.getTableParentOffset();o.scrollTo(i,n+t.topOverlay.getTableParentOffset())}else t.wtTable.holder.scrollTop=n,t.wtTable.holder.scrollLeft=Kt(this,nm,OC).call(this)?-e:e}function mw(n){n.style.top="",n.style.bottom="",n.style.left="",n.style.right=""}function Jg(n,e,t){const o=lo(this,wi),i=o.wtTable.spreader,s=Kt(this,nm,OC).call(this),r=s?"right":"left",a=n==="sticky";if(i.style.position=n,a?(i.style.top=`${e}px`,i.style.bottom="",i.style[r]=`${t}px`,i.style[s?"left":"right"]=""):Kt(this,Qg,mw).call(this,i),!Kt(this,Bm,Uy).call(this)){if(o.inlineStartOverlay.needFullRender){const l=o.inlineStartOverlay.clone.wtTable.spreader;l.style.position=n,a?l.style.top=`${e}px`:Kt(this,Qg,mw).call(this,l)}if(o.topOverlay.needFullRender){const l=o.topOverlay.clone.wtTable.spreader;l.style.position=n,a?(l.style[r]=`${t}px`,l.style[s?"left":"right"]=""):Kt(this,Qg,mw).call(this,l)}if(o.bottomOverlay.needFullRender&&o.bottomOverlay.clone){const l=o.bottomOverlay.clone.wtTable.spreader;l.style.position=n,a?(l.style[r]=`${t}px`,l.style[s?"left":"right"]=""):Kt(this,Qg,mw).call(this,l)}}}function d7(n){return Kt(this,Bm,Uy).call(this)?n.target===lo(this,wi).domBindings.rootDocument.documentElement:n.target===lo(this,wi).scrollableElement}function Uy(){return lo(this,wi).scrollableElement===lo(this,wi).domBindings.rootWindow}function OC(){return lo(this,wi).wtSettings.getSetting("rtlMode")}function uB(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function u7(n,e){return e.get?e.get.call(n):e.value}function f7(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function fB(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Yn(n,e){var t=fB(n,e,"get");return u7(n,t)}function Sl(n,e,t){uB(n,e),e.set(n,t)}function jn(n,e,t){var o=fB(n,e,"set");return f7(n,o,t),t}function Nf(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function ww(n,e){uB(n,e),e.add(n)}var Ah=new WeakMap,Pf=new WeakMap,om=new WeakMap,im=new WeakMap,Oh=new WeakMap,vl=new WeakMap,bw=new WeakMap,Dh=new WeakMap,OH=new WeakSet,DH=new WeakSet,NH=new WeakSet,bS=new WeakSet;class g7{getOverlays(e=!1){const t=[...Yn(this,Ah)];return e&&t.push(this.wtTable),t}initBrowserLineHeight(){const{rootWindow:e,rootDocument:t}=this.domBindings,o=e.getComputedStyle(t.body),i=parseInt(o.lineHeight,10),s=parseInt(o.fontSize,10)*1.2;this.browserLineHeight=i||s}initOverlays(){const e=[this.wot,this.facadeGetter,this.wtSettings,this.domBindings];this.topOverlay=new s7(...e),this.bottomOverlay=new L9(...e),this.inlineStartOverlay=new n7(...e),this.topInlineStartCornerOverlay=new i7(...e,this.topOverlay,this.inlineStartOverlay),this.bottomInlineStartCornerOverlay=new N9(...e,this.bottomOverlay,this.inlineStartOverlay),jn(this,Ah,[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay])}beforeDraw(){jn(this,Pf,Yn(this,Ah).reduce((e,t)=>t.hasRenderingStateChanged()||e,!1)),Yn(this,Ah).forEach(e=>e.updateStateOfRendering("before"))}afterDraw(){this.syncScrollWithMaster(),Yn(this,Ah).forEach(e=>{const t=e.hasRenderingStateChanged();e.updateStateOfRendering("after"),t&&!e.needFullRender&&e.reset()})}refreshAll(){if(this.wot.drawn){if(!this.wtTable.holder.parentNode){this.destroy();return}this.wot.draw(!0),this.verticalScrolling&&Nf(this,DH,m7).call(this)&&this.inlineStartOverlay.onScroll(),this.horizontalScrolling&&Nf(this,NH,w7).call(this)&&this.topOverlay.onScroll(),this.verticalScrolling=!1,this.horizontalScrolling=!1}}registerListeners(){const{rootDocument:e,rootWindow:t}=this.domBindings,{mainTableScrollableElement:o}=this.topOverlay,{mainTableScrollableElement:i}=this.inlineStartOverlay;this.eventManager.addEventListener(e.documentElement,"keydown",c=>this.onKeyDown(c)),this.eventManager.addEventListener(e.documentElement,"keyup",()=>this.onKeyUp()),this.eventManager.addEventListener(e,"visibilitychange",()=>this.onKeyUp()),Yn(this,Dh).registerListeners(),this.eventManager.addEventListener(o,"scroll",c=>this.onTableScroll(c),{passive:!0}),o!==i&&this.eventManager.addEventListener(i,"scroll",c=>this.onTableScroll(c),{passive:!0});const s=this.scrollableElement===t,r=this.wtSettings.getSetting("preventWheel"),a={passive:s};this.eventManager.addEventListener(this.wtTable.wtRootElement,"wheel",c=>this.onCloneWheel(c,r),a),[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay].forEach(c=>{this.eventManager.addEventListener(c.clone.wtTable.holder,"wheel",d=>this.onCloneWheel(d,r),a)});let h;this.eventManager.addEventListener(t,"resize",()=>{TC(()=>{clearTimeout(h),this.wtSettings.getSetting("onWindowResize"),h=setTimeout(()=>{jn(this,Oh,0)},200)})}),s||this.resizeObserver.observe(this.wtTable.wtRootElement.parentElement)}onTableScroll(e){const t=this.domBindings.rootWindow,o=this.inlineStartOverlay.mainTableScrollableElement,i=this.topOverlay.mainTableScrollableElement,s=e.target;this.keyPressed&&(i!==t&&s!==t&&!e.target.contains(i)||o!==t&&s!==t&&!e.target.contains(o))||this.syncScrollPositions(e)}onCloneWheel(e,t){if(e.ctrlKey)return;const{rootWindow:o}=this.domBindings,i=this.inlineStartOverlay.mainTableScrollableElement,s=this.topOverlay.mainTableScrollableElement,r=e.target,a=s!==o&&r!==o&&!r.contains(s),l=i!==o&&r!==o&&!r.contains(i);if(this.keyPressed&&(a||l)||this.scrollableElement===o)return;const h=this.translateMouseWheelToScroll(e);(t||this.scrollableElement!==o&&h)&&e.preventDefault()}onKeyDown(e){this.keyPressed=tf(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")}onKeyUp(){this.keyPressed=!1}translateMouseWheelToScroll(e){let t=isNaN(e.deltaY)?-1*e.wheelDeltaY:e.deltaY,o=isNaN(e.deltaX)?-1*e.wheelDeltaX:e.deltaX;e.deltaMode===1&&(o+=o*this.browserLineHeight,t+=t*this.browserLineHeight);const i=this.scrollVertically(t),s=this.scrollHorizontally(o);return i||s}scrollVertically(e){const t=this.scrollableElement.scrollTop;return this.scrollableElement.scrollTop+=e,t!==this.scrollableElement.scrollTop}scrollHorizontally(e){const t=this.scrollableElement.scrollLeft;return this.scrollableElement.scrollLeft+=e,t!==this.scrollableElement.scrollLeft}syncScrollPositions(){if(this.destroyed)return;const e=this.topOverlay.clone.wtTable.holder,t=this.inlineStartOverlay.clone.wtTable.holder,o=this.wtSettings.getSetting("preventOverflow");let i=this.scrollableElement.scrollLeft,s=this.scrollableElement.scrollTop;if(this.wot.wtViewport.isHorizontallyScrollableByWindow()&&(typeof o=="boolean"&&o||o!=="horizontal")&&(i=this.scrollableElement.scrollX),this.wot.wtViewport.isVerticallyScrollableByWindow()&&(typeof o=="boolean"&&o||o!=="vertical")&&(s=this.scrollableElement.scrollY),this.horizontalScrolling=this.lastScrollX!==i,this.verticalScrolling=this.lastScrollY!==s,this.lastScrollX=i,this.lastScrollY=s,Yn(this,Dh).tryActivate(this.verticalScrolling,this.horizontalScrolling),this.horizontalScrolling){e.scrollLeft=i;const r=this.bottomOverlay.needFullRender?this.bottomOverlay.clone.wtTable.holder:null;r&&(r.scrollLeft=i)}this.verticalScrolling&&(t.scrollTop=s),this.refreshAll(),Yn(this,Dh).syncOffsets()}syncScrollWithMaster(){if(!Yn(this,Pf))return;const e=this.topOverlay.mainTableScrollableElement,{scrollLeft:t,scrollTop:o}=e;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=t),this.bottomOverlay.needFullRender&&(this.bottomOverlay.clone.wtTable.holder.scrollLeft=t),this.inlineStartOverlay.needFullRender&&(this.inlineStartOverlay.clone.wtTable.holder.scrollTop=o),jn(this,Pf,!1)}updateMainScrollableElements(){this.eventManager.clearEvents(!0),this.inlineStartOverlay.updateMainScrollableElement(),this.topOverlay.updateMainScrollableElement(),this.bottomOverlay.needFullRender&&this.bottomOverlay.updateMainScrollableElement();const{wtTable:e}=this,{rootWindow:t}=this.domBindings,o=t.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow");o==="hidden"||o==="clip"?this.scrollableElement=e.holder:this.scrollableElement=MC(e.TABLE),this.registerListeners()}destroy(){Yn(this,bw).cancel(),Yn(this,vl)!==null&&(clearTimeout(Yn(this,vl)),jn(this,vl,null)),this.resizeObserver.disconnect(),Yn(this,Dh).destroy(),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(e=!1){this.verticalScrolling||this.horizontalScrolling?Yn(this,bw).call(this):Nf(this,bS,PH).call(this),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,t=e.clientWidth,o=e.clientHeight,i=t!==this.spreaderLastSize.width||o!==this.spreaderLastSize.height;return i&&(this.spreaderLastSize.width=t,this.spreaderLastSize.height=o),i}adjustElementsSize(){const{wtViewport:e}=this.wot,{wtTable:t}=this,{rootWindow:o}=this.domBindings,i=this.scrollableElement===o,s=this.wtSettings.getSetting("totalColumns"),r=this.wtSettings.getSetting("totalRows"),a=e.getRowHeaderWidth(),l=e.getColumnHeaderHeight(),h=this.wtSettings.getSetting("externalRowCalculator")?0:1,c=l+this.topOverlay.sumCellSizes(0,r)+h,d=a+this.inlineStartOverlay.sumCellSizes(0,s),f=t.hider.style,p=()=>i?!1:this.scrollableElement.scrollTop>Math.max(0,c-t.holder.clientHeight),C=()=>i?!1:this.scrollableElement.scrollLeft>Math.max(0,d-t.holder.clientWidth),y=p()?1:0,_=C()?1:0;f.width=`${d+_}px`,f.height=`${c+y}px`,this.topOverlay.adjustElementsSize(),this.inlineStartOverlay.adjustElementsSize(),this.bottomOverlay.adjustElementsSize()}expandHiderVerticallyBy(e){const{wtTable:t}=this;t.hider.style.height=`${parseInt(t.hider.style.height,10)+e}px`}expandHiderHorizontallyBy(e){const{wtTable:t}=this;t.hider.style.width=`${parseInt(t.hider.style.width,10)+e}px`}applyToDOM(){this.wtTable.isVisible()&&(this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.inlineStartOverlay.applyToDOM(),Yn(this,Dh).syncOffsets())}getParentOverlay(e){if(!e)return null;const t=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];let o=null;return O(t,i=>{i&&i.clone&&i.clone.wtTable.TABLE.contains(e)&&(o=i.clone)}),o}syncOverlayTableClassNames(){const e=this.wtTable.TABLE,t=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];O(t,o=>{o&&(o.clone.wtTable.TABLE.className=e.className)})}constructor(e,t,o,i,s,r){ww(this,OH),ww(this,DH),ww(this,NH),ww(this,bS),Sl(this,Ah,{writable:!0,value:void 0}),Sl(this,Pf,{writable:!0,value:void 0}),Sl(this,om,{writable:!0,value:void 0}),Sl(this,im,{writable:!0,value:void 0}),Sl(this,Oh,{writable:!0,value:void 0}),Sl(this,vl,{writable:!0,value:void 0}),Sl(this,bw,{writable:!0,value:void 0}),Sl(this,Dh,{writable:!0,value:void 0}),this.wot=null,jn(this,Ah,[]),this.topOverlay=null,this.bottomOverlay=null,this.inlineStartOverlay=null,this.topInlineStartCornerOverlay=null,this.bottomInlineStartCornerOverlay=null,this.browserLineHeight=void 0,this.wtSettings=null,jn(this,Pf,!1),jn(this,om,null),jn(this,im,null),jn(this,Oh,0),jn(this,vl,null),jn(this,bw,Lm(Nf(this,bS,PH).bind(this),200)),jn(this,Dh,new l7(this)),this.resizeObserver=new ResizeObserver(d=>{TC(()=>{!Array.isArray(d)||!d.length||(jn(this,Oh,Yn(this,Oh)+1),Yn(this,Oh)===300&&(Ie("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()),Yn(this,vl)!==null&&clearTimeout(Yn(this,vl)),jn(this,vl,setTimeout(()=>{jn(this,Oh,0)},100)),this.wtSettings.getSetting("onContainerElementResize"))})}),this.wot=e,this.wtSettings=i,this.domBindings=o,this.facadeGetter=t,this.wtTable=r;const{rootDocument:a,rootWindow:l}=this.domBindings;this.instance=this.wot,this.eventManager=s,this.scrollbarSize=Mn(a);const h=l.getComputedStyle(r.wtRootElement.parentNode).getPropertyValue("overflow"),c=h==="hidden"||h==="clip";this.scrollableElement=c?r.holder:MC(r.TABLE),this.initOverlays(),Nf(this,OH,p7).call(this),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}}function p7(){jn(this,om,this.topOverlay.getScrollPosition()),jn(this,im,this.inlineStartOverlay.getScrollPosition())}function m7(){const n=this.topOverlay.getScrollPosition();return Yn(this,om)===n?!1:(jn(this,om,n),!0)}function w7(){const n=this.inlineStartOverlay.getScrollPosition();return Yn(this,im)===n?!1:(jn(this,im,n),!0)}function PH(){if(this.destroyed)return;this.updateLastSpreaderSize()&&this.adjustElementsSize()}class b7{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,t,o)=>{const i=this.getSetting("data",e,t);_h(o,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,stylesHandler:null}}update(e,t){return t===void 0?nt(e,(o,i)=>{this.settings[i]=o}):this.settings[e]=t,this}getSetting(e,t,o,i,s){return typeof this.settings[e]=="function"?this.settings[e](t,o,i,s):t!==void 0&&Array.isArray(this.settings[e])?this.settings[e][t]:this.settings[e]}getSettingPure(e){return this.settings[e]}has(e){return!!this.settings[e]}constructor(e){this.settings={},this.defaults=Object.freeze(this.getDefaults()),nt(this.defaults,(t,o)=>{e[o]!==void 0?this.settings[o]=e[o]:t===void 0?Y(`A required setting "${o}" was not provided`):this.settings[o]=t})}}class Sk extends pf{alignOverlaysWithTrimmingContainer(){const e=em(this.wtRootElement),{rootWindow:t}=this.domBindings;if(e===t)this.wtSettings.getSetting("preventOverflow")||(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible");else{const o=e.parentElement,i=IC(e,"height",t),s=IC(e,"overflow",t),r=this.holder.style,{scrollWidth:a,scrollHeight:l}=e;let h=e.offsetWidth,c=e.offsetHeight;if(o&&["auto","hidden","scroll","clip"].includes(s)){const u=e.cloneNode(!1);u.style.overflow="auto",u.style.position="absolute",e.nextElementSibling?o.insertBefore(u,e.nextElementSibling):o.appendChild(u);const f=parseInt(t.getComputedStyle(u).height,10);o.removeChild(u),f===0&&(c=0)}c=Math.min(c,l),r.height=i==="auto"?"auto":`${c}px`,h=Math.min(h,a),r.width=`${h}px`,r.overflow="",this.hasTableHeight=r.height==="auto"?!0:c>0,this.hasTableWidth=h>0}this.isTableVisible=Kc(this.TABLE)}markOversizedColumnHeaders(){const{wtSettings:e}=this,{wtViewport:t}=this.dataAccessObject,o="master",s=e.getSetting("columnHeaders").length;if(s&&!t.hasOversizedColumnHeadersMarked[o]){const a=e.getSetting("rowHeaders").length,l=this.getRenderedColumnsCount();for(let h=0;h<s;h++)for(let c=-1*a;c<l;c++)this.markIfOversizedColumnHeader(c);t.hasOversizedColumnHeadersMarked[o]=!0}}constructor(e,t,o,i){super(e,t,o,i,"master")}}_t(Sk,gk);_t(Sk,zy);function C7(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function y7(n,e){return e.get?e.get.call(n):e.value}function _7(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function gB(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Cw(n,e){var t=gB(n,e,"get");return y7(n,t)}function CS(n,e,t){C7(n,e),e.set(n,t)}function yS(n,e,t){var o=gB(n,e,"set");return _7(n,o,t),t}var yw=new WeakMap,_S=new WeakMap,SS=new WeakMap;class LH{build(){const e=Cw(this,yw).call(this),t=Cw(this,_S),o=Cw(this,SS).call(this);this.totalItems=e,this.prefixSum=new Float64Array(e+1),this.prefixSum[0]=0;for(let i=0;i<e;i++){const s=t(i);this.prefixSum[i+1]=this.prefixSum[i]+(isNaN(s)?o:s)}}getOffset(e){return!this.prefixSum||e<=0?0:e>=this.totalItems?this.prefixSum[this.totalItems]:this.prefixSum[e]}findIndexAtOffset(e){if(!this.isBuilt()||e<=0||this.totalItems===0)return 0;let t=0,o=this.totalItems;for(;t<o;){const i=t+o>>>1;this.prefixSum[i+1]<=e?t=i+1:o=i}return Math.min(t,this.totalItems-1)}getSizeAt(e){return!this.prefixSum||e<0||e>=this.totalItems?0:this.prefixSum[e+1]-this.prefixSum[e]}ensureBuilt(){(!this.isBuilt()||this.totalItems!==Cw(this,yw).call(this))&&this.build()}getTotalSize(){return this.prefixSum?this.prefixSum[this.totalItems]:0}invalidate(){this.prefixSum=null,this.totalItems=0}isBuilt(){return this.prefixSum!==null}constructor({totalItemsFn:e,sizeFn:t,defaultSizeFn:o}){CS(this,yw,{writable:!0,value:void 0}),CS(this,_S,{writable:!0,value:void 0}),CS(this,SS,{writable:!0,value:void 0}),this.prefixSum=null,this.totalItems=0,yS(this,yw,e),yS(this,_S,t),yS(this,SS,o)}}class S7{getWorkspaceHeight(){const e=this.domBindings.rootDocument,t=this.dataAccessObject.topOverlayTrimmingContainer;let o=0;return t===this.domBindings.rootWindow?o=e.documentElement.clientHeight:o=xn(t)>0&&t.clientHeight>0?t.clientHeight:1/0,o}getViewportHeight(){let e=this.getWorkspaceHeight();if(e===1/0)return e;const t=this.getColumnHeaderHeight();return t>0&&(e-=t),e}getWorkspaceWidth(){const{rootDocument:e,rootWindow:t}=this.domBindings,o=this.dataAccessObject.inlineStartOverlayTrimmingContainer;let i;if(o===t){const s=this.wtSettings.getSetting("totalColumns");i=this.wtTable.holder.offsetWidth,this.getRowHeaderWidth()+this.sumColumnWidths(0,s)>i&&(i=e.documentElement.clientWidth)}else i=o.clientWidth;return i}getViewportWidth(){const e=this.getWorkspaceWidth();if(e===1/0)return e;const t=this.getRowHeaderWidth();return t>0?e-t:e}hasVerticalScroll(){if(this.isVerticallyScrollableByWindow()){const s=this.domBindings.rootDocument.documentElement;return s.scrollHeight>s.clientHeight}const{holder:e,hider:t}=this.wtTable,o=e.clientHeight,i=t.offsetHeight;return o<i?!0:i>this.getWorkspaceHeight()}hasHorizontalScroll(){if(this.isVerticallyScrollableByWindow()){const i=this.domBindings.rootDocument.documentElement;return i.scrollWidth>i.clientWidth}const{hider:e}=this.wtTable,t=e.offsetWidth,o=this.hasVerticalScroll()?Mn():0;return t>this.getWorkspaceWidth()-o}isVerticallyScrollableByWindow(){return this.dataAccessObject.topOverlayTrimmingContainer===this.domBindings.rootWindow}isHorizontallyScrollableByWindow(){return this.dataAccessObject.inlineStartOverlayTrimmingContainer===this.domBindings.rootWindow}sumColumnWidths(e,t){let o=0,i=e;for(;i<t;)o+=this.wtTable.getColumnWidth(i),i+=1;return o}getWorkspaceOffset(){return Jo(this.wtTable.holder)}getColumnHeaderHeight(){return this.wtSettings.getSetting("columnHeaders").length?isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=xn(this.wtTable.THEAD)):this.columnHeaderHeight=0,this.columnHeaderHeight}getRowHeaderWidth(){const e=this.wtSettings.getSetting("rowHeaderWidth"),t=this.wtSettings.getSetting("rowHeaders");if(e){this.rowHeaderWidth=0;for(let o=0,i=t.length;o<i;o++)this.rowHeaderWidth+=e[o]||e}if(isNaN(this.rowHeaderWidth))if(t.length){let o=this.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(let i=0,s=t.length;i<s;i++)o?(this.rowHeaderWidth+=Cn(o),o=o.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0;return this.rowHeaderWidth=this.wtSettings.getSetting("onModifyRowHeaderWidth",this.rowHeaderWidth)||this.rowHeaderWidth,this.rowHeaderWidth}createRowsCalculator(e=["rendered","fullyVisible","partiallyVisible"]){const{wtSettings:t,wtTable:o}=this,i=t.getSetting("totalRows");let s=this.getViewportHeight(),r,a;this.rowHeaderWidth=NaN;let l=this.dataAccessObject.topScrollPosition-this.dataAccessObject.topParentOffset;const h=t.getSetting("fixedRowsTop"),c=t.getSetting("fixedRowsBottom");return h&&l>=0&&(a=this.dataAccessObject.topOverlay.sumCellSizes(0,h),l+=a,s-=a),c&&this.dataAccessObject.bottomOverlay.clone&&(a=this.dataAccessObject.bottomOverlay.sumCellSizes(i-c,i),s-=a),o.holder.clientHeight===o.holder.offsetHeight?r=0:r=Mn(this.domBindings.rootDocument),new B5({calculationTypes:e.map(d=>[d,this.rowsCalculatorTypes.get(d)()]),viewportHeight:s,scrollOffset:l,totalRows:i,overrideFn:t.getSettingPure("viewportRowCalculatorOverride"),horizontalScrollbarHeight:r,rowHeightCache:this.rowHeightCache})}createColumnsCalculator(e=["rendered","fullyVisible","partiallyVisible"]){const{wtSettings:t,wtTable:o}=this,i=t.getSetting("totalColumns");let s=this.getViewportWidth(),r=Math.abs(this.dataAccessObject.inlineStartScrollPosition)-this.dataAccessObject.inlineStartParentOffset;this.columnHeaderHeight=NaN;const a=t.getSetting("fixedColumnsStart");if(a&&r>=0){const l=this.dataAccessObject.inlineStartOverlay.sumCellSizes(0,a);r+=l,s-=l}return o.holder.clientWidth!==o.holder.offsetWidth&&(s-=Mn(this.domBindings.rootDocument)),new F5({calculationTypes:e.map(l=>[l,this.columnsCalculatorTypes.get(l)()]),viewportWidth:s,scrollOffset:r,totalColumns:i,overrideFn:t.getSettingPure("viewportColumnCalculatorOverride"),inlineStartOffset:this.dataAccessObject.inlineStartParentOffset,columnWidthCache:this.columnWidthCache})}createCalculators(e=!1){const{wtSettings:t}=this,o=this.createRowsCalculator(),i=this.createColumnsCalculator();if(e&&!t.getSetting("renderAllRows")){const s=o.getResultsFor("fullyVisible"),r=o.getResultsFor("partiallyVisible");e=this.areAllProposedVisibleRowsAlreadyRendered(s,r)}if(e&&!t.getSetting("renderAllColumns")){const s=i.getResultsFor("fullyVisible"),r=i.getResultsFor("partiallyVisible");e=this.areAllProposedVisibleColumnsAlreadyRendered(s,r)}return e||(this.rowsRenderCalculator=o.getResultsFor("rendered"),this.columnsRenderCalculator=i.getResultsFor("rendered")),this.rowsVisibleCalculator=o.getResultsFor("fullyVisible"),this.columnsVisibleCalculator=i.getResultsFor("fullyVisible"),this.rowsPartiallyVisibleCalculator=o.getResultsFor("partiallyVisible"),this.columnsPartiallyVisibleCalculator=i.getResultsFor("partiallyVisible"),e}createVisibleCalculators(){const e=this.createRowsCalculator(["fullyVisible","partiallyVisible"]),t=this.createColumnsCalculator(["fullyVisible","partiallyVisible"]);this.rowsVisibleCalculator=e.getResultsFor("fullyVisible"),this.columnsVisibleCalculator=t.getResultsFor("fullyVisible"),this.rowsPartiallyVisibleCalculator=e.getResultsFor("partiallyVisible"),this.columnsPartiallyVisibleCalculator=t.getResultsFor("partiallyVisible")}areAllProposedVisibleRowsAlreadyRendered(e,t){if(!this.rowsVisibleCalculator)return!1;let{startRow:o,endRow:i}=e;const{startRow:s,endRow:r}=t;if(o===null&&i===null){if(!e.isVisibleInTrimmingContainer&&!this.wtTable.isRowBeforeRenderedRows(s)&&!this.wtTable.isRowAfterRenderedRows(r))return!0;o=s,i=r}const{startRow:a,endRow:l,rowStartOffset:h,rowEndOffset:c}=this.rowsRenderCalculator,d=this.wtSettings.getSetting("totalRows")-1,u=this.wtSettings.getSetting("viewportRowRenderingThreshold");return Number.isInteger(u)&&u>0?(o=Math.max(0,o-Math.min(h,u)),i=Math.min(d,i+Math.min(c,u))):u==="auto"&&(o=Math.max(0,o-Math.ceil(h/2)),i=Math.min(d,i+Math.ceil(c/2))),o<a||o===a&&o>0?!1:!(i>l||i===l&&i<d)}areAllProposedVisibleColumnsAlreadyRendered(e,t){if(!this.columnsVisibleCalculator)return!1;let{startColumn:o,endColumn:i}=e;const{startColumn:s,endColumn:r}=t;if(o===null&&i===null){if(!e.isVisibleInTrimmingContainer&&!this.wtTable.isColumnBeforeRenderedColumns(s)&&!this.wtTable.isColumnAfterRenderedColumns(r))return!0;o=s,i=r}const{startColumn:a,endColumn:l,columnStartOffset:h,columnEndOffset:c}=this.columnsRenderCalculator,d=this.wtSettings.getSetting("totalColumns")-1,u=this.wtSettings.getSetting("viewportColumnRenderingThreshold");return Number.isInteger(u)&&u>0?(o=Math.max(0,o-Math.min(h,u)),i=Math.min(d,i+Math.min(c,u))):u==="auto"&&(o=Math.max(0,o-Math.ceil(h/2)),i=Math.min(d,i+Math.ceil(c/2))),o<a||o===a&&o>0?!1:!(i>l||i===l&&i<d)}invalidateRowHeightCache(){this.rowHeightCache.invalidate()}invalidateColumnWidthCache(){this.columnWidthCache.invalidate()}invalidateAllCaches(){this.rowHeightCache.invalidate(),this.columnWidthCache.invalidate()}resetHasOversizedColumnHeadersMarked(){nt(this.hasOversizedColumnHeadersMarked,(e,t,o)=>{o[t]=void 0})}constructor(e,t,o,i,s){this.dataAccessObject=e,this.wot=e.wot,this.instance=this.wot,this.domBindings=t,this.wtSettings=o,this.wtTable=s,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 L5:new $5],["fullyVisible",()=>new N5],["partiallyVisible",()=>new VF]]),this.columnsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllColumns")?new P5:new W5],["fullyVisible",()=>new D5],["partiallyVisible",()=>new BF]]),this.rowHeightCache=new LH({totalItemsFn:()=>o.getSetting("totalRows"),sizeFn:r=>s.getRowHeight(r),defaultSizeFn:()=>o.getSetting("stylesHandler").getDefaultRowHeight()}),this.columnWidthCache=new LH({totalItemsFn:()=>o.getSetting("totalColumns"),sizeFn:r=>s.getColumnWidth(r),defaultSizeFn:()=>nf}),this.eventManager=i,this.eventManager.addEventListener(this.domBindings.rootWindow,"resize",()=>{this.clientHeight=this.getWorkspaceHeight()})}}class v7 extends uk{exportSettingsAsClassNames(){const e={rowHeaders:"htRowHeaders",columnHeaders:"htColumnHeaders"},t=[],o=[];nt(e,(i,s)=>{this.wtSettings.getSetting(s).length&&o.push(i),t.push(i)}),re(this.wtTable.wtRootElement.parentNode,t),V(this.wtTable.wtRootElement.parentNode,o)}getOverlayByName(e){if(!oB.includes(e))return null;const t=e.replace(/_([a-z])/g,o=>o[1].toUpperCase());return this.wtOverlays[`${t}Overlay`]??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}}}constructor(e,t){super(e,new b7(t));const o=this.wtSettings.getSetting("facade",this);this.wtTable=new Sk(this.getTableDao(),o,this.domBindings,this.wtSettings),this.wtViewport=new S7(this.getViewportDao(),this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.selectionManager=new e7(this.wtSettings.getSetting("selections")),this.wtEvent=new KF(o,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager),this.wtOverlays=new g7(this,o,this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.exportSettingsAsClassNames(),this.findOriginalHeaders()}}class vk{_initFromSettings(e){e.facade=t=>{const o=new vk(t);return()=>o},this._wot=new v7(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}createCellCoords(e,t){return this._wot.createCellCoords(e,t)}createCellRange(e,t,o){return this._wot.createCellRange(e,t,o)}draw(e=!1){return this._wot.draw(e),this}getCell(e,t=!1){return this._wot.getCell(e,t)}scrollViewport(e,t,o){return this._wot.scrollViewport(e,t,o)}scrollViewportHorizontally(e,t){return this._wot.scrollViewportHorizontally(e,t)}scrollViewportVertically(e,t){return this._wot.scrollViewportVertically(e,t)}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,t){return this._wot.wtSettings.update(e,t),this}getSetting(e,t,o,i,s){return this._wot.wtSettings.getSetting(e,t,o,i,s)}hasSetting(e){return this._wot.wtSettings.hasSetting(e)}destroy(){this._wot.destroy()}constructor(e){e instanceof uk?this._wot=e:this._initFromSettings(e)}}function WH({isShiftKey:n,isLeftClick:e,isRightClick:t,coords:o,selection:i,controller:s,cellCoordsFactory:r}){const a=i.isSelected()?i.getSelectedRange().current():null,l=i.isSelectedByCorner(),h=i.isSelectedByRowHeader();if(i.markSource("mouse"),n&&a)o.row>=0&&o.col>=0&&!s.cell?i.setRangeEnd(o):(l||h)&&o.row>=0&&o.col>=0&&!s.cell?i.setRangeEnd(r(o.row,o.col)):l&&o.row<0&&!s.column?i.setRangeEnd(r(a.to.row,o.col)):h&&o.col<0&&!s.row?i.setRangeEnd(r(o.row,a.to.col)):(!l&&!h&&o.col<0||l&&o.col<0)&&!s.row?i.selectRows(Math.max(a.from.row,0),o.row,o.col):(!l&&!h&&o.row<0||h&&o.row<0)&&!s.column&&i.selectColumns(Math.max(a.from.col,0),o.col,o.row);else{const c=!i.inInSelection(o),d=e||t&&c;o.row<0&&o.col>=0&&!s.column?d&&i.selectColumns(o.col,o.col,o.row):o.col<0&&o.row>=0&&!s.row?d&&i.selectRows(o.row,o.row,o.col):o.col>=0&&o.row>=0&&!s.cell?d&&i.setRangeStart(o):o.col<0&&o.row<0&&i.selectAll(!0,!0,{disableHeadersHighlight:!0,focusPosition:{row:0,col:0}})}i.markEndSource()}function R7({isLeftClick:n,coords:e,selection:t,controller:o,cellCoordsFactory:i}){if(!n)return;const s=t.isSelectedByRowHeader(),r=t.isSelectedByColumnHeader(),a=t.tableProps.countCols(),l=t.tableProps.countRows();t.markSource("mouse"),r&&!o.column?t.setRangeEnd(i(l-1,e.col)):s&&!o.row?t.setRangeEnd(i(e.row,a-1)):o.cell||t.setRangeEnd(e),t.markEndSource()}function $H({isLeftClick:n,selection:e,cellRangeMapper:t}){if(!n||e.settings.selectionMode!=="multiple")return;const o=e.getSelectedRange(),i=o.clone().map(r=>t.toRenderable(r)),s=i.current();if(i.size()>1&&!s.isHeader()&&!e.isMultiple(s)){const r=i.findAll(s);r.length===i.size()?(e.markSource("deselect"),o.pop(),e.refresh(),e.markEndSource()):r.length>1&&(e.markSource("deselect"),o.removeLayers(r.map(({layer:a})=>a)),e.refresh(),e.markEndSource())}}const E7=new Map([["touchstart",WH],["touchend",$H],["mousedown",WH],["mouseover",R7],["mouseup",$H]]);function vS(n,e){E7.get(n.type)({isShiftKey:n.shiftKey,isLeftClick:ak(n)||n.type==="touchstart",isRightClick:Xc(n),...e})}const pB=new WeakMap,Rk=Symbol("rootInstance");function k7(n){pB.set(n,!0)}function T7(n){return n===Rk}function Qs(n){return pB.has(n)}function mB(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function x7(n,e){return e.get?e.get.call(n):e.value}function M7(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function wB(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function ln(n,e){var t=wB(n,e,"get");return x7(n,t)}function Er(n,e,t){mB(n,e),e.set(n,t)}function Gt(n,e,t){var o=wB(n,e,"set");return M7(n,o,t),t}function Yl(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function _w(n,e){mB(n,e),e.add(n)}var Sw=new WeakMap,Lf=new WeakMap,Wf=new WeakMap,ma=new WeakMap,As=new WeakMap,vw=new WeakMap,Rw=new WeakMap,Nh=new WeakMap,ep=new WeakMap,yd=new WeakMap,$f=new WeakSet,OE=new WeakSet,FH=new WeakSet,BH=new WeakSet;class I7{render(){if(!this.hot.isRenderSuspended()){const e=this.hot.forceFullRender;this.hot.runHooks("beforeRender",e),this._wt.draw(!e),Yl(this,BH,A7).call(this),this.postponedAdjustElementsSize&&(this.postponedAdjustElementsSize=!1,this.adjustElementsSize(!0)),this.hot.runHooks("afterRender",e),this.hot.forceFullRender=!1}}adjustElementsSize(e=!1){e?this._wt.wtOverlays.adjustElementsSize():this.postponedAdjustElementsSize=!0}getCellAtCoords(e,t){const o=this._wt.getCell(e,t);return o<0?null:o}scrollViewport(e,t,o){return this._wt.scrollViewport(e,t,o)}scrollViewportHorizontally(e,t){return this._wt.scrollViewportHorizontally(e,t)}scrollViewportVertically(e,t){return this._wt.scrollViewportVertically(e,t)}createElements(){const{rootElement:e,rootDocument:t}=this.hot,o=e.getAttribute("style");o&&e.setAttribute("data-originalstyle",o),V(e,"handsontable"),Gt(this,As,t.createElement("TABLE")),V(ln(this,As),"htCore"),this.hot.getSettings().tableClassName&&V(ln(this,As),this.hot.getSettings().tableClassName),this.settings.ariaTags&&(fe(ln(this,As),[qa()]),fe(e,[YG(),rF(-1),Ly(this.hot.countCols()),c4()])),this.THEAD=t.createElement("THEAD"),ln(this,As).appendChild(this.THEAD),this.TBODY=t.createElement("TBODY"),ln(this,As).appendChild(this.TBODY),this.hot.table=ln(this,As),this.hot.container.insertBefore(ln(this,As),this.hot.container.firstChild)}registerEvents(){const{rootWrapperElement:e,rootElement:t,rootDocument:o,selection:i,rootWindow:s}=this.hot,r=o.documentElement;this.eventManager.addEventListener(t,"mousedown",l=>{Yl(this,$f,Ew).call(this,l)||(Gt(this,Wf,!0),this.isTextSelectionAllowed(l.target)||(eH(s),l.preventDefault(),s.focus()))}),this.eventManager.addEventListener(t,"mouseup",l=>{Yl(this,$f,Ew).call(this,l)||Gt(this,Wf,!1)}),this.eventManager.addEventListener(t,"mousemove",l=>{ln(this,Wf)&&!this.isTextSelectionAllowed(l.target)&&(this.settings.fragmentSelection&&eH(s),l.preventDefault())}),this.eventManager.addEventListener(r,"keyup",l=>{i.isInProgress()&&!l.shiftKey&&i.finish()}),this.eventManager.addEventListener(r,"mouseup",l=>{if(i.isInProgress()&&ak(l)&&i.finish(),Gt(this,ma,!1),Yl(this,$f,Ew).call(this,l))return;const h=yF(o.activeElement);Vb(o.activeElement)&&!h||(h||!i.isSelected()&&!i.isSelectedByAnyHeader()&&!(e??t).contains(l.target)&&!Xc(l))&&this.hot.unlisten()}),this.eventManager.addEventListener(r,"contextmenu",l=>{i.isInProgress()&&Xc(l)&&(i.finish(),Gt(this,ma,!1))}),this.eventManager.addEventListener(r,"touchend",()=>{i.isInProgress()&&i.finish(),Gt(this,ma,!1),Gt(this,ep,!0),ln(this,yd)!==null&&clearTimeout(ln(this,yd)),Gt(this,yd,this.hot._registerTimeout(()=>{Gt(this,ep,!1),Gt(this,yd,null)},400))}),this.eventManager.addEventListener(r,"mousedown",l=>{const h=l.target,c=l.x||l.clientX,d=l.y||l.clientY;let u=l.target;if(ln(this,ma)||!t||!this.hot.view||Yl(this,$f,Ew).call(this,l))return;const{holder:f}=this._wt.wtTable;if(u===f){const C=Mn(o);if(o.elementFromPoint(c+C,d)!==f||o.elementFromPoint(c,d+C)!==f)return}else for(;u!==r;){if(u===null){if(l.isTargetWebComponent)break;return}if(u===t)return;u=u.parentNode}(typeof this.settings.outsideClickDeselects=="function"?this.settings.outsideClickDeselects(h):this.settings.outsideClickDeselects)?this.hot.deselectCell():this.hot.destroyEditor(!1,!1)});let a=yh(s);for(;a!==null;)this.eventManager.addEventListener(a.document.documentElement,"click",()=>{this.hot.unlisten()}),a=yh(a);this.eventManager.addEventListener(ln(this,As),"selectstart",l=>{this.settings.fragmentSelection||Vb(l.target)||l.preventDefault()})}invalidateIndexSizesCache(){this._wt.wtViewport.invalidateRowHeightCache(),this._wt.wtViewport.invalidateColumnWidthCache()}invalidateColumnWidthCache(){this._wt.wtViewport.invalidateColumnWidthCache()}invalidateRowHeightCache(){this._wt.wtViewport.invalidateRowHeightCache()}translateFromRenderableToVisualCoords({row:e,col:t}){return this.hot._createCellCoords(...this.translateFromRenderableToVisualIndex(e,t))}translateFromRenderableToVisualIndex(e,t){let o=e>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(e):e,i=t>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(t):t;return o===null&&(o=e),i===null&&(i=t),[o,i]}countRenderableIndexes(e,t){const o=Math.min(e.getNotTrimmedIndexesLength(),t),i=e.getNearestNotHiddenIndex(o-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,t){return this.countNotHiddenIndexes(e,t,this.hot.rowIndexMapper,this.countRenderableRows())}countNotHiddenColumnIndexes(e,t){return this.countNotHiddenIndexes(e,t,this.hot.columnIndexMapper,this.countRenderableColumns())}countNotHiddenIndexes(e,t,o,i){if(isNaN(e)||e<0)return 0;const s=o.getNearestNotHiddenIndex(e,t),r=o.getRenderableFromVisualIndex(s);if(!Number.isInteger(r))return 0;let a=0;return t<0?a=r+1:t>0&&(a=i-r),a}countNotHiddenFixedColumnsStart(){const e=this.hot.countCols(),t=Math.min(parseInt(this.settings.fixedColumnsStart,10),e)-1;return this.countNotHiddenColumnIndexes(t,-1)}countNotHiddenFixedRowsTop(){const e=this.hot.countRows(),t=Math.min(parseInt(this.settings.fixedRowsTop,10),e)-1;return this.countNotHiddenRowIndexes(t,-1)}countNotHiddenFixedRowsBottom(){const e=this.hot.countRows(),t=Math.max(e-parseInt(this.settings.fixedRowsBottom,10),0);return this.countNotHiddenRowIndexes(t,1)}countRenderableColumnsInRange(e,t){let o=0;for(let i=e;i<=t;i++)this.hot.columnIndexMapper.getRenderableFromVisualIndex(i)!==null&&(o+=1);return o}countRenderableRowsInRange(e,t){let o=0;for(let i=e;i<=t;i++)this.hot.rowIndexMapper.getRenderableFromVisualIndex(i)!==null&&(o+=1);return o}addClassNameToLicenseElement(e){const t=this.hot.rootElement.parentNode?.querySelector(".hot-display-license-info");t&&V(t,e)}removeClassNameFromLicenseElement(e){const t=this.hot.rootElement.parentNode?.querySelector(".hot-display-license-info");t&&re(t,e)}isMainTableNotFullyCoveredByOverlays(){const e=this.countNotHiddenFixedRowsTop()+this.countNotHiddenFixedRowsBottom(),t=this.countNotHiddenFixedColumnsStart();return this.hot.countRenderedRows()>e&&this.hot.countRenderedCols()>t}initializeWalkontable(){const e={ariaTags:this.settings.ariaTags,rtlMode:this.hot.isRtl(),externalRowCalculator:this.hot.getPlugin("autoRowSize")&&this.hot.getPlugin("autoRowSize").isEnabled(),table:ln(this,As),isDataViewInstance:()=>Qs(this.hot),preventOverflow:()=>this.settings.preventOverflow,preventWheel:()=>this.settings.preventWheel,viewportColumnRenderingThreshold:()=>this.settings.viewportColumnRenderingThreshold,viewportRowRenderingThreshold:()=>this.settings.viewportRowRenderingThreshold,data:(s,r)=>this.hot.getDataAtCell(...this.translateFromRenderableToVisualIndex(s,r)),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 s=[];return this.hot.hasRowHeaders()&&s.push((r,a)=>{const l=r>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(r):r;this.appendRowHeader(l,a)}),this.hot.runHooks("afterGetRowHeaderRenderers",s),Gt(this,Lf,s.length),this.hot.getSettings().ariaTags&&Yl(this,OE,bB).call(this)===this.hot.countCols()&&Yl(this,FH,H7).call(this,ln(this,Lf)),s},columnHeaders:()=>{const s=[];return this.hot.hasColHeaders()&&s.push((r,a)=>{const l=r>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(r):r;this.appendColHeader(l,a)}),this.hot.runHooks("afterGetColumnHeaderRenderers",s),Gt(this,Sw,s.length),s},columnWidth:s=>{const r=this.hot.columnIndexMapper.getVisualFromRenderableIndex(s);return this.hot.getColWidth(r===null?s:r)},rowHeight:s=>{const r=this.hot.rowIndexMapper.getVisualFromRenderableIndex(s);return this.hot.getRowHeight(r===null?s:r)},rowHeightByOverlayName:(s,r)=>{const a=this.hot.rowIndexMapper.getVisualFromRenderableIndex(s),l=a===null?s:a;return this.hot.runHooks("modifyRowHeightByOverlayName",this.hot.getRowHeight(l),l,r)},cellRenderer:(s,r,a)=>{const[l,h]=this.translateFromRenderableToVisualIndex(s,r),c=this.hot.runHooks("modifyGetCellCoords",l,h,!1,"meta");let d=l,u=h;Array.isArray(c)&&([d,u]=c);const f=this.hot.getCellMeta(d,u),p=this.hot.colToProp(u);let C=this.hot.getDataAtRowProp(d,p);this.hot.hasHook("beforeValueRender")&&(C=this.hot.runHooks("beforeValueRender",C,f));const y=this.hot.getCellRenderer(f);let _=C;typeof f.valueFormatter=="function"?_=f.valueFormatter(_,f):typeof y.valueFormatter=="function"&&(_=y.valueFormatter.call(f,_,f)),this.hot.runHooks("beforeRenderer",a,l,h,p,C,f);const T=[this.hot,a,l,h,p,_,f];y(...T),f._isBaseRendererCalled||this.hot.getCellRenderer({renderer:"base"})(...T),this.hot.runHooks("afterRenderer",a,l,h,p,C,f),f._isBaseRendererCalled=!1},selections:this.hot.selection.highlight,hideBorderOnMouseDownOver:()=>this.settings.fragmentSelection,onWindowResize:()=>{this.hot&&!this.hot.isDestroyed&&this.hot.refreshDimensions()},onContainerElementResize:()=>{this.hot&&!this.hot.isDestroyed&&Kc(this.hot.rootElement)&&this.hot.refreshDimensions()},onCellMouseDown:(s,r,a,l)=>{const h=this.translateFromRenderableToVisualCoords(r),c={row:!1,column:!1,cell:!1};this.hot.listen(),this.activeWt=l,Gt(this,ma,!0),Gt(this,Nh,{x:s.clientX,y:s.clientY}),this.hot.runHooks("beforeOnCellMouseDown",s,h,a,c),!th(s)&&(vS(s,{coords:h,selection:this.hot.selection,controller:c,cellCoordsFactory:(d,u)=>this.hot._createCellCoords(d,u)}),this.hot.runHooks("afterOnCellMouseDown",s,h,a),this.activeWt=this._wt)},onCellContextMenu:(s,r,a,l)=>{const h=this.translateFromRenderableToVisualCoords(r);this.activeWt=l,Gt(this,ma,!1),this.hot.selection.isInProgress()&&this.hot.selection.finish(),this.hot.runHooks("beforeOnCellContextMenu",s,h,a),!th(s)&&(this.hot.runHooks("afterOnCellContextMenu",s,h,a),this.activeWt=this._wt)},onCellMouseOut:(s,r,a,l)=>{const h=this.translateFromRenderableToVisualCoords(r);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseOut",s,h,a),!th(s)&&(this.hot.runHooks("afterOnCellMouseOut",s,h,a),this.activeWt=this._wt)},onCellMouseOver:(s,r,a,l)=>{const h=this.translateFromRenderableToVisualCoords(r),c={row:!1,column:!1,cell:!1};this.activeWt=l,this.hot.runHooks("beforeOnCellMouseOver",s,h,a,c),!th(s)&&(ln(this,ma)&&(!ln(this,Nh)||ln(this,Nh).x!==s.clientX||ln(this,Nh).y!==s.clientY)&&vS(s,{coords:h,selection:this.hot.selection,controller:c,cellCoordsFactory:(d,u)=>this.hot._createCellCoords(d,u)}),this.hot.runHooks("afterOnCellMouseOver",s,h,a),this.activeWt=this._wt,Gt(this,Nh,null))},onCellMouseUp:(s,r,a,l)=>{const h=this.translateFromRenderableToVisualCoords(r);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseUp",s,h,a),!(th(s)||this.hot.isDestroyed)&&(vS(s,{coords:h,selection:this.hot.selection,cellRangeMapper:o5(this.hot,"cellRangeMapper")}),this.hot.runHooks("afterOnCellMouseUp",s,h,a),this.activeWt=this._wt)},onCellCornerMouseDown:s=>{s.preventDefault(),this.hot.runHooks("afterOnCellCornerMouseDown",s)},onCellCornerDblClick:s=>{s.preventDefault(),this.hot.runHooks("afterOnCellCornerDblClick",s)},beforeDraw:(s,r)=>this.beforeRender(s,r),onDraw:s=>this.afterRender(s),onBeforeViewportScrollVertically:(s,r)=>{const a=this.hot.rowIndexMapper,l=s<0;let h=s;return!l&&(h=a.getVisualFromRenderableIndex(s),h===null)?s:(h=this.hot.runHooks("beforeViewportScrollVertically",h,r),this.hot.runHooks("beforeViewportScroll"),l?h:a.getRenderableFromVisualIndex(h))},onBeforeViewportScrollHorizontally:(s,r)=>{const a=this.hot.columnIndexMapper,l=s<0;let h=s;return!l&&(h=a.getVisualFromRenderableIndex(s),h===null)?s:(h=this.hot.runHooks("beforeViewportScrollHorizontally",h,r),this.hot.runHooks("beforeViewportScroll"),l?h:a.getRenderableFromVisualIndex(h))},onScrollVertically:()=>{this.hot.runHooks("afterScrollVertically"),this.hot.runHooks("afterScroll")},onScrollHorizontally:()=>{this.hot.runHooks("afterScrollHorizontally"),this.hot.runHooks("afterScroll")},onBeforeRemoveCellClassNames:()=>this.hot.runHooks("beforeRemoveCellClassNames"),onBeforeHighlightingRowHeader:(s,r,a)=>{const l=this.hot.rowIndexMapper,h=s<0;let c=s;h||(c=l.getVisualFromRenderableIndex(s));const d=this.hot.runHooks("beforeHighlightingRowHeader",c,r,a);return h?d:l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(d,1))},onBeforeHighlightingColumnHeader:(s,r,a)=>{const l=this.hot.columnIndexMapper,h=s<0;let c=s;h||(c=l.getVisualFromRenderableIndex(s));const d=this.hot.runHooks("beforeHighlightingColumnHeader",c,r,a);return h?d:l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(d,1))},onAfterDrawSelection:(s,r,a)=>{let l;const[h,c]=this.translateFromRenderableToVisualIndex(s,r),d=this.hot.selection.getSelectedRange();if(d.size()>0){const f=d.peekByIndex(a??0);l=[f.from.row,f.from.col,f.to.row,f.to.col]}return this.hot.runHooks("afterDrawSelection",h,c,l,a)},onBeforeDrawBorders:(s,r)=>{const[a,l,h,c]=s,d=[this.hot.rowIndexMapper.getVisualFromRenderableIndex(a),this.hot.columnIndexMapper.getVisualFromRenderableIndex(l),this.hot.rowIndexMapper.getVisualFromRenderableIndex(h),this.hot.columnIndexMapper.getVisualFromRenderableIndex(c)];return this.hot.runHooks("beforeDrawBorders",d,r)},onBeforeTouchScroll:()=>this.hot.runHooks("beforeTouchScroll"),onAfterMomentumScroll:()=>this.hot.runHooks("afterMomentumScroll"),onModifyRowHeaderWidth:s=>this.hot.runHooks("modifyRowHeaderWidth",s),onModifyGetCellCoords:(s,r,a,l)=>{const h=this.hot.rowIndexMapper,c=this.hot.columnIndexMapper,d=r>=0?c.getVisualFromRenderableIndex(r):r,u=s>=0?h.getVisualFromRenderableIndex(s):s,f=this.hot.runHooks("modifyGetCellCoords",u,d,a,l);if(Array.isArray(f)){const[p,C,y,_]=f;return[p>=0?h.getRenderableFromVisualIndex(h.getNearestNotHiddenIndex(p,1)):p,C>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(C,1)):C,y>=0?h.getRenderableFromVisualIndex(h.getNearestNotHiddenIndex(y,-1)):y,_>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(_,-1)):_]}},onModifyGetCoordsElement:(s,r)=>{const a=this.hot.rowIndexMapper,l=this.hot.columnIndexMapper,h=r>=0?l.getVisualFromRenderableIndex(r):r,c=s>=0?a.getVisualFromRenderableIndex(s):s,d=this.hot.runHooks("modifyGetCoordsElement",c,h);if(Array.isArray(d)){const[u,f]=d;return[u>=0?a.getRenderableFromVisualIndex(a.getNearestNotHiddenIndex(u,1)):u,f>=0?l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(f,1)):f]}},viewportRowCalculatorOverride:s=>{let r=this.settings.viewportRowRenderingOffset;if(r==="auto"&&(r=1),r>0){const a=this.countRenderableRows(),l=s.startRow,h=s.endRow;s.startRow=Math.max(l-r,0),s.endRow=Math.min(h+r,a-1)}this.hot.runHooks("afterViewportRowCalculatorOverride",s)},viewportColumnCalculatorOverride:s=>{let r=this.settings.viewportColumnRenderingOffset;if(r==="auto"&&(r=1),r>0){const a=this.countRenderableColumns(),l=s.startColumn,h=s.endColumn;s.startColumn=Math.max(l-r,0),s.endColumn=Math.min(h+r,a-1)}this.hot.runHooks("afterViewportColumnCalculatorOverride",s)},rowHeaderWidth:()=>this.settings.rowHeaderWidth,columnHeaderHeight:()=>{const s=this.hot.runHooks("modifyColumnHeaderHeight");return this.settings.columnHeaderHeight||s},stylesHandler:()=>this.hot.stylesHandler};this.hot.runHooks("beforeInitWalkontable",e),this._wt=new vk(e),this.activeWt=this._wt;const t=this._wt.wtTable.spreader,{width:o,height:i}=this.hot.rootElement.getBoundingClientRect();this.setLastSize(o,i),this.eventManager.addEventListener(t,"mousedown",s=>{s.target===t&&s.which===3&&s.stopPropagation()}),this.eventManager.addEventListener(t,"contextmenu",s=>{s.target===t&&s.which===3&&s.stopPropagation()}),this.eventManager.addEventListener(this.hot.rootDocument.documentElement,"click",()=>{this.settings.observeDOMVisibility&&this._wt.drawInterrupted&&this.hot.render()})}isTextSelectionAllowed(e){if(Vb(e))return!0;const t=Lc(e,this._wt.wtTable.spreader);if(this.settings.fragmentSelection===!0&&t)return!0;const o=this.hot.getSelectedRangeActive()?.isSingleCell()??!1;return!!(this.settings.fragmentSelection==="cell"&&o&&t||!this.settings.fragmentSelection&&this.isCellEdited()&&o)}isMouseDown(){return ln(this,ma)}isCellEdited(){const e=this.hot.getActiveEditor();return e&&e.isOpened()}beforeRender(e,t){e&&this.hot.runHooks("beforeViewRender",this.hot.forceFullRender,t)}afterRender(e){e&&this.hot.runHooks("afterViewRender",this.hot.forceFullRender)}appendRowHeader(e,t){if(t.firstChild){const o=t.firstChild;if(!Se(o,"relative")){sl(t),this.appendRowHeader(e,t);return}this.updateCellHeader(o.querySelector(".rowHeader"),e,this.hot.getRowHeader)}else{const{rootDocument:o,getRowHeader:i}=this.hot,s=o.createElement("div"),r=o.createElement("span");s.className="relative",r.className="rowHeader",this.updateCellHeader(r,e,i),s.appendChild(r),t.appendChild(s)}this.hot.runHooks("afterGetRowHeader",e,t)}appendColHeader(e,t,o=this.hot.getColHeader,i=0){const s=()=>{const r=e>=0?this.hot.getColumnMeta(e).headerClassName:null;return r?r.split(" "):[]};if(t.firstChild){const r=t.firstChild;Se(r,"relative")?(this.updateCellHeader(r.querySelector(".colHeader"),e,o,i),r.className="",V(r,["relative",...s()])):(sl(t),this.appendColHeader(e,t,o,i))}else{const{rootDocument:r}=this.hot,a=r.createElement("div"),l=r.createElement("span"),h=s();a.classList.add("relative",...h),l.className="colHeader",this.settings.ariaTags&&(fe(a,...qa()),fe(l,...qa())),this.updateCellHeader(l,e,o,i),a.appendChild(l),t.appendChild(a)}this.hot.runHooks("afterGetColHeader",e,t,i)}updateCellHeader(e,t,o,i=0){let s=t;const r=this._wt.wtOverlays.getParentOverlay(e)||this._wt;e.parentNode&&(Se(e,"colHeader")?s=r.wtTable.columnFilter.sourceToRendered(t):Se(e,"rowHeader")&&(s=r.wtTable.rowFilter.sourceToRendered(t))),s>-1?id(e,o(t,i),this.hot.getSettings().sanitizer):(_h(e," "),V(e,"cornerHeader"))}maximumVisibleElementWidth(e){const o=this._wt.wtViewport.getWorkspaceWidth()-e;return o>0?o:0}maximumVisibleElementHeight(e){const o=this._wt.wtViewport.getWorkspaceHeight()-e;return o>0?o:0}setLastSize(e,t){Gt(this,vw,e),Gt(this,Rw,t)}getLastSize(){return{width:ln(this,vw),height:ln(this,Rw)}}getFirstRenderedVisibleRow(){if(!this._wt.wtViewport.rowsRenderCalculator)return null;const e=this.hot.rowIndexMapper,t=e.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedRow());return e.getNearestNotHiddenIndex(t??0,1)}getLastRenderedVisibleRow(){if(!this._wt.wtViewport.rowsRenderCalculator)return null;const e=this.hot.rowIndexMapper,t=e.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedRow());return e.getNearestNotHiddenIndex(t??this.hot.countRows()-1,-1)}getFirstRenderedVisibleColumn(){if(!this._wt.wtViewport.columnsRenderCalculator)return null;const e=this.hot.columnIndexMapper,t=e.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedColumn());return e.getNearestNotHiddenIndex(t??0,1)}getLastRenderedVisibleColumn(){if(!this._wt.wtViewport.columnsRenderCalculator)return null;const e=this.hot.columnIndexMapper,t=e.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedColumn());return e.getNearestNotHiddenIndex(t??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 ln(this,Sw)}getRowHeadersCount(){return ln(this,Lf)}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){return(this._wt.wtOverlays.getParentOverlay(e)??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()}getTotalTableWidth(){return this._wt.wtTable.getTotalWidth()}getTotalTableHeight(){return this._wt.wtTable.getTotalHeight()}getTableOffset(){return this._wt.wtViewport.getWorkspaceOffset()}getTableScrollPosition(){return{left:this._wt.wtTable.holder.scrollLeft,top:this._wt.wtTable.holder.scrollTop}}setTableScrollPosition(e){this._wt.wtTable.holder.scrollLeft=e.left,this._wt.wtTable.holder.scrollTop=e.top}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()}constructor(e){_w(this,$f),_w(this,OE),_w(this,FH),_w(this,BH),Er(this,Sw,{writable:!0,value:void 0}),Er(this,Lf,{writable:!0,value:void 0}),Er(this,Wf,{writable:!0,value:void 0}),Er(this,ma,{writable:!0,value:void 0}),Er(this,As,{writable:!0,value:void 0}),Er(this,vw,{writable:!0,value:void 0}),Er(this,Rw,{writable:!0,value:void 0}),Er(this,Nh,{writable:!0,value:void 0}),Er(this,ep,{writable:!0,value:void 0}),Er(this,yd,{writable:!0,value:void 0}),Gt(this,Sw,0),Gt(this,Lf,0),this.postponedAdjustElementsSize=!1,Gt(this,Wf,!1),Gt(this,vw,0),Gt(this,Rw,0),Gt(this,Nh,null),Gt(this,ep,!1),Gt(this,yd,null),this.hot=e,this.eventManager=new $i(this.hot),this.settings=this.hot.getSettings(),this.createElements(),this.registerEvents(),this.initializeWalkontable()}}function Ew(n){return n.sourceCapabilities?n.sourceCapabilities.firesTouchEvents===!0:ln(this,ep)}function bB(){return parseInt(this.hot.rootElement.getAttribute(Ly()[0]),10)}function H7(n){const e=Yl(this,OE,bB).call(this)+n;fe(this.hot.rootElement,...Ly(e))}function A7(){const n=this.hot.rootElement;this.hasVerticalScroll()?V(n,"htHasScrollY"):re(n,"htHasScrollY"),this.isVerticallyScrollableByWindow()?V(n,"htVerticallyScrollableByWindow"):re(n,"htVerticallyScrollableByWindow"),this.hasHorizontalScroll()?V(n,"htHasScrollX"):re(n,"htHasScrollX"),this.isHorizontallyScrollableByWindow()?V(n,"htHorizontallyScrollableByWindow"):re(n,"htHorizontallyScrollableByWindow"),Mn()===0?V(n,"htScrollbarHidden"):re(n,"htScrollbarHidden")}const O7="ABCDEFGHIJKLMNOPQRSTUVWXYZ",VH=O7.length;function D7(n){let e=n+1,t="",o;for(;e>0;)o=(e-1)%VH,t=String.fromCharCode(65+o)+t,e=parseInt((e-o)/VH,10);return t}function CB(n,e=0){let t=n;const o=[];return(!Array.isArray(n)||!Array.isArray(n[0]))&&(t=[n]),t.forEach((i,s)=>{Array.isArray(i)?i.forEach((r,a)=>{o.push([s+e,a,r])}):Object.keys(i).forEach(r=>{o.push([s+e,r,i[r]])})}),o}function N7(n,e,t){return n.some(([o,i])=>o===e&&i===t)}function yB(n){let e=0;return Array.isArray(n)&&(n[0]&&Array.isArray(n[0])?e=n[0].length:n[0]&&ie(n[0])&&(e=tk(n[0]))),e}function P7(n){return!!(Array.isArray(n)&&n.length&&n.every(e=>Array.isArray(e)))}function L7(n){return!!(Array.isArray(n)&&n.length&&n.every(e=>typeof e=="object"&&!Array.isArray(e)&&e!==null))}class sd{getValues(){return this.indexedValues}getValueAtIndex(e){const t=this.indexedValues;if(e<t.length)return t[e]}setValues(e){this.indexedValues=e.slice(),this.runLocalHooks("change")}setValueAtIndex(e,t){return e<this.indexedValues.length?(this.indexedValues[e]=t,this.runLocalHooks("change"),!0):!1}clear(){this.setDefaultValues()}getLength(){return this.getValues().length}setDefaultValues(e=this.indexedValues.length){this.indexedValues.length=0,_e(this.initValueOrFn)?Re(e-1,t=>this.indexedValues.push(this.initValueOrFn(t))):Re(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}constructor(e=null){this.indexedValues=[],this.initValueOrFn=e}}_t(sd,Bn);function Ek(n,e,t,o){const i=t.length?t[0]:void 0;return[...n.slice(0,i),...t.map((s,r)=>_e(o)?o(s,r):o),...i===void 0?[]:n.slice(i)]}function kk(n,e){return Gc(n,(t,o)=>e.includes(o)===!1)}class Eh extends sd{insert(e,t){this.indexedValues=Ek(this.indexedValues,e,t,this.initValueOrFn),super.insert(e,t)}remove(e){this.indexedValues=kk(this.indexedValues,e),super.remove(e)}}class sm extends Eh{getHiddenIndexes(){return Fi(this.getValues(),(e,t,o)=>(t&&e.push(o),e),[])}constructor(e=!1){super(e)}}function Tk(n,e,t){return[...n.slice(0,e),...t,...n.slice(e)]}function rm(n,e){return Gc(n,t=>e.includes(t)===!1)}function xk(n,e){return Mt(n,t=>t-e.filter(o=>o<t).length)}function Mk(n,e){const t=e[0],o=e.length;return Mt(n,i=>i>=t?i+o:i)}class Yy extends sd{getValues(){return this.orderOfIndexes.map(e=>this.indexedValues[e])}setValues(e){this.orderOfIndexes=[...Array(e.length).keys()],super.setValues(e)}setValueAtIndex(e,t,o=this.orderOfIndexes.length){return e<this.indexedValues.length?(this.indexedValues[e]=t,this.orderOfIndexes.includes(e)===!1&&this.orderOfIndexes.splice(o,0,e),this.runLocalHooks("change"),!0):!1}clearValue(e){this.orderOfIndexes=rm(this.orderOfIndexes,[e]),_e(this.initValueOrFn)?super.setValueAtIndex(e,this.initValueOrFn(e)):super.setValueAtIndex(e,this.initValueOrFn)}getLength(){return this.orderOfIndexes.length}setDefaultValues(e=this.indexedValues.length){this.orderOfIndexes.length=0,super.setDefaultValues(e)}insert(e,t){this.indexedValues=Ek(this.indexedValues,e,t,this.initValueOrFn),this.orderOfIndexes=Mk(this.orderOfIndexes,t),super.insert(e,t)}remove(e){this.indexedValues=kk(this.indexedValues,e),this.orderOfIndexes=rm(this.orderOfIndexes,e),this.orderOfIndexes=xk(this.orderOfIndexes,e),super.remove(e)}getEntries(){return this.orderOfIndexes.map(e=>[e,this.getValueAtIndex(e)])}constructor(...e){super(...e),this.orderOfIndexes=[]}}class of extends Eh{getTrimmedIndexes(){return Fi(this.getValues(),(e,t,o)=>(t&&e.push(o),e),[])}constructor(e=!1){super(e)}}const zH=new Map([["indexesSequence",{getListWithInsertedItems:Tk,getListWithRemovedItems:rm}],["physicallyIndexed",{getListWithInsertedItems:Ek,getListWithRemovedItems:kk}]]),_B=n=>(zH.has(n)===!1&&Y(`Alter strategy with ID '${n}' does not exist.`),zH.get(n));class SB extends sd{insert(e,t){const o=Mk(this.indexedValues,t);this.indexedValues=Tk(o,e,t),super.insert(e,t)}remove(e){const t=rm(this.indexedValues,e);this.indexedValues=xk(t,e),super.remove(e)}constructor(){super(e=>e)}}const UH=new Map([["hiding",sm],["index",sd],["linkedPhysicalIndexToValue",Yy],["physicalIndexToValue",Eh],["trimming",of]]);function W7(n,e=null){return UH.has(n)||Y(`The provided map type ("${n}") does not exist.`),new(UH.get(n))(e)}class Ik{register(e,t){this.collection.has(e)===!1&&(this.collection.set(e,t),t.addLocalHook("change",()=>this.runLocalHooks("change",t)))}unregister(e){const t=this.collection.get(e);ee(t)&&(t.destroy(),this.collection.delete(e),this.runLocalHooks("change",t))}unregisterAll(){this.collection.forEach((e,t)=>this.unregister(t)),this.collection.clear()}get(e){return en(e)?Array.from(this.collection.values()):this.collection.get(e)}getLength(){return this.collection.size}removeFromEvery(e){this.collection.forEach(t=>{t.remove(e)})}insertToEvery(e,t){this.collection.forEach(o=>{o.insert(e,t)})}initEvery(e){this.collection.forEach(t=>{t.init(e)})}constructor(){this.collection=new Map}}_t(Ik,Bn);class YH extends Ik{getMergedValues(e=!0){if(e===!0)return this.mergedValuesCache;if(this.getLength()===0)return[];const t=Mt(this.get(),s=>s.getValues()),o=[],i=ee(t[0])&&t[0].length||0;for(let s=0;s<i;s+=1){const r=[];for(let a=0;a<this.getLength();a+=1)r.push(t[a][s]);o.push(r)}return Mt(o,this.aggregationFunction)}getMergedValueAtIndex(e,t){const o=this.getMergedValues(t)[e];return ee(o)?o:this.fallbackValue}updateCache(){this.mergedValuesCache=this.getMergedValues(!1)}constructor(e,t){super(),this.mergedValuesCache=[],this.aggregationFunction=e,this.fallbackValue=t}}function $7(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function F7(n,e){return e.get?e.get.call(n):e.value}function B7(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function vB(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function V7(n,e){var t=vB(n,e,"get");return F7(n,t)}function z7(n,e,t){$7(n,e),e.set(n,t)}function GH(n,e,t){var o=vB(n,e,"set");return B7(n,o,t),t}var kw=new WeakMap;class RB{subscribe(e){return this.addLocalHook("change",e),this._write(V7(this,kw)),this}unsubscribe(){return this.runLocalHooks("unsubscribe"),this.clearLocalHooks(),this}_write(e){return e.length>0&&this.runLocalHooks("change",e),this}_writeInitialChanges(e){GH(this,kw,e)}constructor(){z7(this,kw,{writable:!0,value:void 0}),GH(this,kw,[])}}_t(RB,Bn);function jH(n,e){const t=[];let o=0,i=0;for(;o<n.length&&i<e.length;o++,i++)n[o]!==e[i]&&t.push({op:"replace",index:i,oldValue:n[o],newValue:e[i]});for(;o<e.length;o++)t.push({op:"insert",index:o,oldValue:void 0,newValue:e[o]});for(;i<n.length;i++)t.push({op:"remove",index:i,oldValue:n[i],newValue:void 0});return t}function U7(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Y7(n,e){return e.get?e.get.call(n):e.value}function G7(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function EB(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function ls(n,e){var t=EB(n,e,"get");return Y7(n,t)}function Ff(n,e,t){U7(n,e),e.set(n,t)}function wa(n,e,t){var o=EB(n,e,"set");return G7(n,o,t),t}var Bf=new WeakMap,_d=new WeakMap,Vf=new WeakMap,zf=new WeakMap,Uf=new WeakMap;class j7{createObserver(){const e=new RB;return ls(this,Bf).add(e),e.addLocalHook("unsubscribe",()=>{ls(this,Bf).delete(e)}),e._writeInitialChanges(jH(ls(this,_d),ls(this,Vf))),e}emit(e){let t=ls(this,Vf);(!ls(this,zf)||ls(this,_d).length!==e.length)&&(e.length===0?e=new Array(t.length).fill(ls(this,Uf)):wa(this,_d,new Array(e.length).fill(ls(this,Uf))),ls(this,zf)||(wa(this,zf,!0),t=ls(this,_d)));const o=jH(t,e);ls(this,Bf).forEach(i=>i._write(o)),wa(this,Vf,e)}constructor({initialIndexValue:e}={}){Ff(this,Bf,{writable:!0,value:void 0}),Ff(this,_d,{writable:!0,value:void 0}),Ff(this,Vf,{writable:!0,value:void 0}),Ff(this,zf,{writable:!0,value:void 0}),Ff(this,Uf,{writable:!0,value:void 0}),wa(this,Bf,new Set),wa(this,_d,[]),wa(this,Vf,[]),wa(this,zf,!1),wa(this,Uf,!1),wa(this,Uf,e??!1)}}function kB(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function q7(n,e){return e.get?e.get.call(n):e.value}function K7(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function TB(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function vs(n,e){var t=TB(n,e,"get");return q7(n,t)}function qH(n,e,t){kB(n,e),e.set(n,t)}function RS(n,e,t){var o=TB(n,e,"set");return K7(n,o,t),t}function DC(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function ES(n,e){kB(n,e),e.add(n)}var $r=new WeakMap,Wc=new WeakMap,KH=new WeakSet,Hk=new WeakSet,XH=new WeakSet;class DE{suspendOperations(){this.isBatched=!0}resumeOperations(){this.isBatched=!1,this.updateCache(),DC(this,XH,Z7).call(this)}createChangesObserver(e){return e!=="hiding"&&Y(`Unsupported index map type "${e}".`),this.hidingChangesObservable.createObserver()}createAndRegisterIndexMap(e,t,o){return this.registerMap(e,W7(t,o))}registerMap(e,t){(this.trimmingMapsCollection.get(e)||this.hidingMapsCollection.get(e)||this.variousMapsCollection.get(e))&&Y(`Map with name "${e}" has been already registered.`),t instanceof of?this.trimmingMapsCollection.register(e,t):t instanceof sm?this.hidingMapsCollection.register(e,t):this.variousMapsCollection.register(e,t);const o=this.getNumberOfIndexes();return o>0&&t.init(o),t}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 t=this.notTrimmedIndexesCache[e];return ee(t)?t:null}getPhysicalFromRenderableIndex(e){const t=this.renderablePhysicalIndexesCache[e];return ee(t)?t:null}getVisualFromPhysicalIndex(e){const t=this.fromPhysicalToVisualIndexesCache.get(e);return ee(t)?t:null}getVisualFromRenderableIndex(e){return this.getVisualFromPhysicalIndex(this.getPhysicalFromRenderableIndex(e))}getRenderableFromVisualIndex(e){const t=this.fromVisualToRenderableIndexesCache.get(e);return ee(t)?t:null}getNearestNotHiddenIndex(e,t,o=!1){if(this.getPhysicalFromVisualIndex(e)===null)return null;if(this.fromVisualToRenderableIndexesCache.has(e))return e;const s=Array.from(this.fromVisualToRenderableIndexesCache.keys());let r=-1;return t>0?r=s.findIndex(a=>a>e):r=s.reverse().findIndex(a=>a<e),r===-1?o?this.getNearestNotHiddenIndex(e,-t,!1):null:s[r]}initToLength(e=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 t=this.getNumberOfIndexes();if(e<t){const o=[...Array(this.getNumberOfIndexes()-e).keys()].map(i=>i+e);this.removeIndexes(o)}else this.insertIndexes(t,e-t)}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(e=!0){return e===!0?this.notTrimmedIndexesCache:this.getIndexesSequence().filter(o=>this.isTrimmed(o)===!1)}getNotTrimmedIndexesLength(){return this.getNotTrimmedIndexes().length}getNotHiddenIndexes(e=!0){return e===!0?this.notHiddenIndexesCache:this.getIndexesSequence().filter(o=>this.isHidden(o)===!1)}getNotHiddenIndexesLength(){return this.getNotHiddenIndexes().length}getRenderableIndexes(e=!0){return e===!0?this.renderablePhysicalIndexesCache:this.getNotTrimmedIndexes().filter(o=>this.isHidden(o)===!1)}getRenderableIndexesLength(){return this.getRenderableIndexes().length}getNumberOfIndexes(){return this.getIndexesSequence().length}moveIndexes(e,t){typeof e=="number"&&(e=[e]);const o=Mt(e,h=>this.getPhysicalFromVisualIndex(h)),i=this.getNotTrimmedIndexesLength(),s=e.length,r=rm(this.getIndexesSequence(),o),a=r.filter(h=>this.isTrimmed(h)===!1);let l=r.indexOf(a[a.length-1])+1;if(t+s<i){const h=a[t];l=r.indexOf(h)}this.indexesChangeSource="move",this.setIndexesSequence(Tk(r,l,o)),this.indexesChangeSource=void 0}isTrimmed(e){return this.trimmingMapsCollection.getMergedValueAtIndex(e)}isHidden(e){return this.hidingMapsCollection.getMergedValueAtIndex(e)}insertIndexes(e,t,o="start"){const i=this.getNotTrimmedIndexes()[e],s=ee(i)?i:this.getNumberOfIndexes(),r=this.getIndexesSequence().includes(i)?this.getIndexesSequence().indexOf(i):this.getNumberOfIndexes(),a=Mt(new Array(t).fill(s),(h,c)=>h+c);this.suspendOperations(),this.indexesChangeSource="insert",this.indexesSequence.insert(r,a),this.indexesChangeSource=void 0;const l=o==="end"?a.map(h=>h+1):a;this.trimmingMapsCollection.insertToEvery(r,l),this.hidingMapsCollection.insertToEvery(r,l),this.variousMapsCollection.insertToEvery(r,l),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()}observeMapChange(e,t){return(e instanceof of||e instanceof sm)&&Y('The "observeMapChange" method does not support trimming or hiding maps.'),vs(this,$r).has(e)||vs(this,$r).set(e,new Set),vs(this,$r).get(e).add(t),()=>{const o=vs(this,$r).get(e);o&&(o.delete(t),o.size===0&&vs(this,$r).delete(e))}}updateCache(e=!1){const t=this.indexesSequenceChanged||this.trimmedIndexesChanged||this.hiddenIndexesChanged;(e===!0||this.isBatched===!1&&t===!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 t=0;t<e;t+=1){const o=this.getPhysicalFromVisualIndex(t);this.fromPhysicalToVisualIndexesCache.set(o,t)}}cacheFromVisualToRenderableIndexes(){const e=this.getRenderableIndexesLength();this.fromVisualToRenderableIndexesCache.clear();for(let t=0;t<e;t+=1){const o=this.getPhysicalFromRenderableIndex(t),i=this.getVisualFromPhysicalIndex(o);this.fromVisualToRenderableIndexesCache.set(i,t)}}destroy(){RS(this,$r,new WeakMap),vs(this,Wc).clear(),this.unregisterAll()}constructor(){ES(this,KH),ES(this,Hk),ES(this,XH),qH(this,$r,{writable:!0,value:void 0}),qH(this,Wc,{writable:!0,value:void 0}),this.indexesSequence=new SB,this.trimmingMapsCollection=new YH(e=>e.some(t=>t===!0),!1),this.hidingMapsCollection=new YH(e=>e.some(t=>t===!0),!1),this.variousMapsCollection=new Ik,this.hidingChangesObservable=new j7({initialIndexValue:!1}),this.notTrimmedIndexesCache=[],this.notHiddenIndexesCache=[],this.isBatched=!1,this.indexesSequenceChanged=!1,this.indexesChangeSource=void 0,this.trimmedIndexesChanged=!1,this.hiddenIndexesChanged=!1,this.renderablePhysicalIndexesCache=[],this.fromPhysicalToVisualIndexesCache=new Map,this.fromVisualToRenderableIndexesCache=new Map,RS(this,$r,new WeakMap),RS(this,Wc,new Set),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=>{DC(this,KH,X7).call(this,e),this.runLocalHooks("change",e,this.variousMapsCollection)})}}function X7(n){vs(this,$r).has(n)&&(this.isBatched?vs(this,Wc).add(n):DC(this,Hk,xB).call(this,n))}function xB(n){const e=vs(this,$r).get(n);e&&e.forEach(t=>t(n))}function Z7(){vs(this,Wc).size>0&&(vs(this,Wc).forEach(n=>DC(this,Hk,xB).call(this,n)),vs(this,Wc).clear())}_t(DE,Bn);function Q7(n,e){return nt(e,(t,o)=>{en(n[o])&&(n[o]=t)}),n}function MB(n){const t=/^([a-zA-Z]{2})-([a-zA-Z]{2})$/.exec(n);return t?`${t[1].toLowerCase()}-${t[2].toUpperCase()}`:n}function IB(n){ee(n)&&il(pt`Language with code "${n}" was not found. You should register particular language\x20
37
- before using it. Read more about this issue at: https://docs.handsontable.com/i18n/missing-language-code.`)}function J7(n,e){return Array.isArray(n)&&Number.isInteger(e)?n[e]:n}function HB(n,e){return Array.isArray(n)?n.map(t=>HB(t,e)):Py(n,e)}const{register:ej,getValues:tj}=ts("phraseFormatters");function AB(n,e){ej(n,e)}function nj(){return tj()}AB("pluralize",J7);AB("substitute",HB);const Ak="Common:",NC=`${Ak}ok`,Ok=`${Ak}cancel`,OB="ContextMenu:items",Le=OB,Dk=`${Le}.noItems`,Nk=`${Le}.insertRowAbove`,Pk=`${Le}.insertRowBelow`,Lk=`${Le}.insertColumnOnTheLeft`,Wk=`${Le}.insertColumnOnTheRight`,$k=`${Le}.removeRow`,Fk=`${Le}.removeColumn`,Bk=`${Le}.undo`,Vk=`${Le}.redo`,PC=`${Le}.readOnly`,zk=`${Le}.clearColumn`,Uk=`${Le}.copy`,Yk=`${Le}.copyWithHeaders`,Gk=`${Le}.copyWithGroupHeaders`,jk=`${Le}.copyHeadersOnly`,qk=`${Le}.cut`,Kk=`${Le}.export`,Xk=`${Le}.exportFileCsv`,Zk=`${Le}.exportFileXlsx`,Qk=`${Le}.freezeColumn`,Jk=`${Le}.unfreezeColumn`,eT=`${Le}.mergeCells`,tT=`${Le}.unmergeCells`,nT=`${Le}.addComment`,oT=`${Le}.editComment`,iT=`${Le}.removeComment`,sT=`${Le}.readOnlyComment`,rT=`${Le}.align`,aT=`${Le}.align.left`,lT=`${Le}.align.center`,hT=`${Le}.align.right`,cT=`${Le}.align.justify`,dT=`${Le}.align.top`,uT=`${Le}.align.middle`,fT=`${Le}.align.bottom`,gT=`${Le}.borders`,pT=`${Le}.borders.top`,mT=`${Le}.borders.right`,wT=`${Le}.borders.bottom`,bT=`${Le}.borders.left`,CT=`${Le}.borders.remove`,yT=`${Le}.nestedHeaders.insertChildRow`,_T=`${Le}.nestedHeaders.detachFromParent`,ST=`${Le}.hideColumn`,vT=`${Le}.showColumn`,RT=`${Le}.hideRow`,ET=`${Le}.showRow`,Ci="Filters:",yn=`${Ci}conditions`,Gy=`${yn}.none`,kT=`${yn}.isEmpty`,TT=`${yn}.isNotEmpty`,xT=`${yn}.isEqualTo`,MT=`${yn}.isNotEqualTo`,IT=`${yn}.beginsWith`,HT=`${yn}.endsWith`,AT=`${yn}.contains`,OT=`${yn}.doesNotContain`,oj=`${yn}.byValue`,DT=`${yn}.greaterThan`,NT=`${yn}.greaterThanOrEqualTo`,PT=`${yn}.lessThan`,LT=`${yn}.lessThanOrEqualTo`,Vm=`${yn}.isBetween`,WT=`${yn}.isNotBetween`,zm=`${yn}.after`,Um=`${yn}.before`,jy=`${yn}.today`,qy=`${yn}.tomorrow`,Ky=`${yn}.yesterday`,$T=`${Ci}labels.filterByCondition`,FT=`${Ci}labels.filterByValue`,BT=`${Ci}labels.conjunction`,Xy=`${Ci}labels.disjunction`,LC=`${Ci}values.blankCells`,VT=`${Ci}buttons.selectAll`,zT=`${Ci}buttons.clear`,UT=`${Ci}buttons.ok`,YT=`${Ci}buttons.cancel`,GT=`${Ci}buttons.placeholder.search`,jT=`${Ci}buttons.placeholder.value`,qT=`${Ci}buttons.placeholder.secondValue`,aa="Pagination:",KT=`${aa}section.pagination`,XT=`${aa}.pageSize.auto`,WC=`${aa}section.pageSize`,ZT=`${aa}section.counter`,QT=`${aa}section.navigation`,JT=`${aa}firstPage`,ex=`${aa}prevPage`,tx=`${aa}nextPage`,nx=`${aa}lastPage`,ox="CheckboxRenderer:",ix=`${ox}checked`,sx=`${ox}unchecked`,DB="Loading:",rx=`${DB}title`,NB="Notification:",ax=`${NB}buttons.close`,PB="ExportFile:",lx=`${PB}dialog.title`,kh="EmptyDataState:",hx=`${kh}title`,cx=`${kh}description`,dx=`${kh}title.filters`,ux=`${kh}description.filters`,fx=`${kh}buttons.filters.reset`,gx=`${kh}title.loading`,px=`${kh}description.loading`,rd="DataProvider:",mx=`${rd}errors.fetch`,wx=`${rd}errors.create`,bx=`${rd}errors.update`,Cx=`${rd}errors.remove`,yx=`${rd}errors.requestFailed`,_x=`${rd}buttons.refetch`,ij=Object.freeze(Object.defineProperty({__proto__:null,CANCEL:Ok,CHECKBOX_CHECKED:ix,CHECKBOX_RENDERER_NAMESPACE:ox,CHECKBOX_UNCHECKED:sx,COMMON_NAMESPACE:Ak,CONTEXTMENU_ITEMS_ADD_COMMENT:nT,CONTEXTMENU_ITEMS_ALIGNMENT:rT,CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM:fT,CONTEXTMENU_ITEMS_ALIGNMENT_CENTER:lT,CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY:cT,CONTEXTMENU_ITEMS_ALIGNMENT_LEFT:aT,CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE:uT,CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT:hT,CONTEXTMENU_ITEMS_ALIGNMENT_TOP:dT,CONTEXTMENU_ITEMS_BORDERS:gT,CONTEXTMENU_ITEMS_BORDERS_BOTTOM:wT,CONTEXTMENU_ITEMS_BORDERS_LEFT:bT,CONTEXTMENU_ITEMS_BORDERS_RIGHT:mT,CONTEXTMENU_ITEMS_BORDERS_TOP:pT,CONTEXTMENU_ITEMS_CLEAR_COLUMN:zk,CONTEXTMENU_ITEMS_COPY:Uk,CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY:jk,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS:Gk,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS:Yk,CONTEXTMENU_ITEMS_CUT:qk,CONTEXTMENU_ITEMS_EDIT_COMMENT:oT,CONTEXTMENU_ITEMS_EXPORT:Kk,CONTEXTMENU_ITEMS_EXPORT_FILE_CSV:Xk,CONTEXTMENU_ITEMS_EXPORT_FILE_XLSX:Zk,CONTEXTMENU_ITEMS_FREEZE_COLUMN:Qk,CONTEXTMENU_ITEMS_HIDE_COLUMN:ST,CONTEXTMENU_ITEMS_HIDE_ROW:RT,CONTEXTMENU_ITEMS_INSERT_LEFT:Lk,CONTEXTMENU_ITEMS_INSERT_RIGHT:Wk,CONTEXTMENU_ITEMS_MERGE_CELLS:eT,CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD:_T,CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD:yT,CONTEXTMENU_ITEMS_NO_ITEMS:Dk,CONTEXTMENU_ITEMS_READ_ONLY:PC,CONTEXTMENU_ITEMS_READ_ONLY_COMMENT:sT,CONTEXTMENU_ITEMS_REDO:Vk,CONTEXTMENU_ITEMS_REMOVE_BORDERS:CT,CONTEXTMENU_ITEMS_REMOVE_COLUMN:Fk,CONTEXTMENU_ITEMS_REMOVE_COMMENT:iT,CONTEXTMENU_ITEMS_REMOVE_ROW:$k,CONTEXTMENU_ITEMS_ROW_ABOVE:Nk,CONTEXTMENU_ITEMS_ROW_BELOW:Pk,CONTEXTMENU_ITEMS_SHOW_COLUMN:vT,CONTEXTMENU_ITEMS_SHOW_ROW:ET,CONTEXTMENU_ITEMS_UNDO:Bk,CONTEXTMENU_ITEMS_UNFREEZE_COLUMN:Jk,CONTEXTMENU_ITEMS_UNMERGE_CELLS:tT,CONTEXT_MENU_ITEMS_NAMESPACE:OB,DATA_PROVIDER_BUTTONS_REFETCH:_x,DATA_PROVIDER_ERRORS_CREATE:wx,DATA_PROVIDER_ERRORS_FETCH:mx,DATA_PROVIDER_ERRORS_REMOVE:Cx,DATA_PROVIDER_ERRORS_REQUEST_FAILED:yx,DATA_PROVIDER_ERRORS_UPDATE:bx,DATA_PROVIDER_NAMESPACE:rd,EMPTY_DATA_STATE_BUTTONS_FILTERS_RESET:fx,EMPTY_DATA_STATE_DESCRIPTION:cx,EMPTY_DATA_STATE_DESCRIPTION_FILTERS:ux,EMPTY_DATA_STATE_DESCRIPTION_LOADING:px,EMPTY_DATA_STATE_NAMESPACE:kh,EMPTY_DATA_STATE_TITLE:hx,EMPTY_DATA_STATE_TITLE_FILTERS:dx,EMPTY_DATA_STATE_TITLE_LOADING:gx,EXPORT_FILE_DIALOG_TITLE:lx,EXPORT_FILE_NAMESPACE:PB,FILTERS_BUTTONS_CANCEL:YT,FILTERS_BUTTONS_CLEAR:zT,FILTERS_BUTTONS_OK:UT,FILTERS_BUTTONS_PLACEHOLDER_SEARCH:GT,FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE:qT,FILTERS_BUTTONS_PLACEHOLDER_VALUE:jT,FILTERS_BUTTONS_SELECT_ALL:VT,FILTERS_CONDITIONS_AFTER:zm,FILTERS_CONDITIONS_BEFORE:Um,FILTERS_CONDITIONS_BEGINS_WITH:IT,FILTERS_CONDITIONS_BETWEEN:Vm,FILTERS_CONDITIONS_BY_VALUE:oj,FILTERS_CONDITIONS_CONTAINS:AT,FILTERS_CONDITIONS_EMPTY:kT,FILTERS_CONDITIONS_ENDS_WITH:HT,FILTERS_CONDITIONS_EQUAL:xT,FILTERS_CONDITIONS_GREATER_THAN:DT,FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL:NT,FILTERS_CONDITIONS_LESS_THAN:PT,FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL:LT,FILTERS_CONDITIONS_NAMESPACE:yn,FILTERS_CONDITIONS_NONE:Gy,FILTERS_CONDITIONS_NOT_BETWEEN:WT,FILTERS_CONDITIONS_NOT_CONTAIN:OT,FILTERS_CONDITIONS_NOT_EMPTY:TT,FILTERS_CONDITIONS_NOT_EQUAL:MT,FILTERS_CONDITIONS_TODAY:jy,FILTERS_CONDITIONS_TOMORROW:qy,FILTERS_CONDITIONS_YESTERDAY:Ky,FILTERS_DIVS_FILTER_BY_CONDITION:$T,FILTERS_DIVS_FILTER_BY_VALUE:FT,FILTERS_LABELS_CONJUNCTION:BT,FILTERS_LABELS_DISJUNCTION:Xy,FILTERS_NAMESPACE:Ci,FILTERS_VALUES_BLANK_CELLS:LC,LOADING_NAMESPACE:DB,LOADING_TITLE:rx,NOTIFICATION_BUTTONS_CLOSE:ax,NOTIFICATION_NAMESPACE:NB,OK:NC,PAGINATION_COUNTER_SECTION:ZT,PAGINATION_FIRST_PAGE:JT,PAGINATION_LAST_PAGE:nx,PAGINATION_NAMESPACE:aa,PAGINATION_NAV_SECTION:QT,PAGINATION_NEXT_PAGE:tx,PAGINATION_PAGE_SIZE_AUTO:XT,PAGINATION_PAGE_SIZE_SECTION:WC,PAGINATION_PREV_PAGE:ex,PAGINATION_SECTION:KT},Symbol.toStringTag,{value:"Module"})),LB={languageCode:"en-US",[NC]:"OK",[Ok]:"Cancel",[Dk]:"No available options",[Nk]:"Insert row above",[Pk]:"Insert row below",[Lk]:"Insert column left",[Wk]:"Insert column right",[$k]:["Remove row","Remove rows"],[Fk]:["Remove column","Remove columns"],[Bk]:"Undo",[Vk]:"Redo",[PC]:"Read only",[zk]:"Clear column",[rT]:"Alignment",[aT]:"Left",[lT]:"Center",[hT]:"Right",[cT]:"Justify",[dT]:"Top",[uT]:"Middle",[fT]:"Bottom",[Qk]:"Freeze column",[Jk]:"Unfreeze column",[gT]:"Borders",[pT]:"Top",[mT]:"Right",[wT]:"Bottom",[bT]:"Left",[CT]:"Remove border(s)",[nT]:"Add comment",[oT]:"Edit comment",[iT]:"Delete comment",[sT]:"Read-only comment",[eT]:"Merge cells",[tT]:"Unmerge cells",[Uk]:"Copy",[Yk]:["Copy with header","Copy with headers"],[Gk]:["Copy with group header","Copy with group headers"],[jk]:["Copy header only","Copy headers only"],[qk]:"Cut",[Kk]:"Export",[Xk]:"To CSV",[Zk]:"To Excel",[lx]:"Exporting…",[yT]:"Insert child row",[_T]:"Detach from parent",[ST]:["Hide column","Hide columns"],[vT]:["Show column","Show columns"],[RT]:["Hide row","Hide rows"],[ET]:["Show row","Show rows"],[Gy]:"None",[kT]:"Is empty",[TT]:"Is not empty",[xT]:"Is equal to",[MT]:"Is not equal to",[IT]:"Begins with",[HT]:"Ends with",[AT]:"Contains",[OT]:"Does not contain",[DT]:"Greater than",[NT]:"Greater than or equal to",[PT]:"Less than",[LT]:"Less than or equal to",[Vm]:"Is between",[WT]:"Is not between",[zm]:"After",[Um]:"Before",[jy]:"Today",[qy]:"Tomorrow",[Ky]:"Yesterday",[LC]:"Blank cells",[$T]:"Filter by condition",[FT]:"Filter by value",[BT]:"And",[Xy]:"Or",[VT]:"Select all",[zT]:"Clear",[UT]:"OK",[YT]:"Cancel",[GT]:"Search",[jT]:"Value",[qT]:"Second value",[KT]:"Pagination",[WC]:"Page size",[XT]:"Auto",[ZT]:"[start] - [end] of [total]",[QT]:"Page [currentPage] of [totalPages]",[JT]:"Go to first page",[ex]:"Go to previous page",[tx]:"Go to next page",[nx]:"Go to last page",[ix]:"Checked",[sx]:"Unchecked",[rx]:"Loading...",[ax]:"Close",[hx]:"No data available",[cx]:"There’s nothing to display yet.",[dx]:"No results found",[ux]:"It looks like your current filters are hiding all results.",[fx]:"Reset filters",[gx]:"Loading data",[px]:"Please wait.",[mx]:"Could not load data",[wx]:"Could not create rows",[bx]:"Could not update rows",[Cx]:"Could not remove rows",[yx]:"Request failed",[_x]:"Refetch"},sj=ij,NE=LB.languageCode,{register:rj,getItem:WB,hasItem:aj,getValues:lj}=ts("languagesDictionaries");$B(LB);function $B(n,e){let t=n,o=e;return ie(n)&&(o=n,t=o.languageCode),hj(t,o),rj(t,Jn(o)),Jn(o)}function hj(n,e){n!==NE&&Q7(e,WB(NE))}function FB(n){return Sx(n)?Jn(WB(n)):null}function Sx(n){return aj(n)}function cj(){return lj()}function BB(n,e,t){const o=FB(n);if(o===null)return null;const i=o[e];if(en(i))return null;const s=dj(i,t);return Array.isArray(s)?s[0]:s}function dj(n,e){return nj().reduce((t,o)=>o(t,e),n)}function uj(n){let e=MB(n);return Sx(e)||(e=NE,IB(n)),e}class ul extends iB{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({from:e,to:t}){let o=this.getNearestNotHiddenCoords(e,1),i=this.getNearestNotHiddenCoords(t,-1);return o===null||i===null?null:((o.row>i.row||o.col>i.col)&&(o=e,i=t),this.settings.createCellRange(o,o,i))}getNearestNotHiddenCoords(e,t,o=t){const i=this.getNearestNotHiddenIndex(this.settings.rowIndexMapper,e.row,t);if(i===null)return null;const s=this.getNearestNotHiddenIndex(this.settings.columnIndexMapper,e.col,o);return s===null?null:this.settings.createCellCoords(i,s)}getNearestNotHiddenIndex(e,t,o){return t<0?t:e.getNearestNotHiddenIndex(t,o)}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 t=e.from.clone().normalize(),o=e.getVerticalDirection()==="N-S"?1:-1,i=e.getHorizontalDirection()==="W-E"?1:-1,s=this.settings.visualToRenderableCoords(this.visualCellRange.highlight);let r=null;if((s===null||s.col===null||s.row===null)&&(r=this.getNearestNotHiddenCoords(t,o,i)),r!==null&&e.overlaps(r)){const a=e.highlight.clone();if(a.row>=0&&(a.row=r.row),a.col>=0&&(a.col=r.col),this.cellRange===null){const l=this.settings.visualToRenderableCoords(a);this.cellRange=this.settings.createCellRange(l)}e.setHighlight(a)}return this.settings.selectionType==="focus"&&s!==null&&r===null&&e.setHighlight(this.visualCellRange.highlight),this}getCorners(){const{from:e,to:t}=this.cellRange;return[Math.min(e.row,t.row),Math.min(e.col,t.col),Math.max(e.row,t.row),Math.max(e.col,t.col)]}getVisualCorners(){const e=this.settings.renderableToVisualCoords(this.cellRange.getTopStartCorner()),t=this.settings.renderableToVisualCoords(this.cellRange.getBottomEndCorner());return[e.row,e.col,t.row,t.col]}createRenderableCellRange(e,t){const o=this.settings.visualToRenderableCoords(e),i=this.settings.visualToRenderableCoords(t);return o.row===null||o.col===null||i.row===null||i.col===null?null:this.settings.createCellRange(o,o,i)}constructor(e,t){super(e,null),this.visualCellRange=null,this.visualCellRange=t||null,this.commit()}}function kS({activeHeaderClassName:n,...e}){return new ul({className:n,...e,selectionType:sB})}function fj({areaCornerVisible:n,...e}){return new ul({className:"area",createLayers:!0,border:{width:1,color:"#4b89ff",cornerVisible:n},...e,selectionType:wk})}function gj({...n}){return new ul({className:"highlight",...n,selectionType:wk})}function pj({columnClassName:n,...e}){return new ul({className:n,...e,selectionType:V9})}function mj({cellCornerVisible:n,...e}){return new ul({className:"current",headerAttributes:[ek()],border:{width:2,color:"#4b89ff",cornerVisible:n},...e,selectionType:AC})}function wj({border:n,visualCellRange:e,...t}){return new ul({...n,...t,selectionType:z9},e)}function bj({...n}){return new ul({className:"fill",border:{width:1,color:"#ff0000"},...n,selectionType:F9})}function ZH({headerClassName:n,...e}){return new ul({className:n,...e,selectionType:mk})}function Cj({rowClassName:n,...e}){return new ul({className:n,...e,selectionType:B9})}function yj(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ba(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function _j(n,e){yj(n,e),e.add(n)}var kr=new WeakSet;class Sj{isEnabledFor(e,t){let o=e;e===AC&&(o="current");let i=this.options.disabledCellSelection(t.row,t.col);return typeof i=="string"&&(i=[i]),!i||Array.isArray(i)&&!i.includes(o)}useLayerLevel(e=0){return this.layerLevel=e,this}getFocus(){return this.focus}getFill(){return this.fill}createLayeredArea(){return ba(this,kr,Ca).call(this,this.layeredAreas,fj)}getLayeredAreas(){return[...this.layeredAreas.values()]}createArea(){return ba(this,kr,Ca).call(this,this.areas,gj)}getAreas(){return[...this.areas.values()]}createRowHeader(){return ba(this,kr,Ca).call(this,this.rowHeaders,ZH)}getRowHeaders(){return[...this.rowHeaders.values()]}createColumnHeader(){return ba(this,kr,Ca).call(this,this.columnHeaders,ZH)}getColumnHeaders(){return[...this.columnHeaders.values()]}createActiveRowHeader(){return ba(this,kr,Ca).call(this,this.activeRowHeaders,kS)}getActiveRowHeaders(){return[...this.activeRowHeaders.values()]}createActiveColumnHeader(){return ba(this,kr,Ca).call(this,this.activeColumnHeaders,kS)}getActiveColumnHeaders(){return[...this.activeColumnHeaders.values()]}createActiveCornerHeader(){return ba(this,kr,Ca).call(this,this.activeCornerHeaders,kS)}getActiveCornerHeaders(){return[...this.activeCornerHeaders.values()]}createRowHighlight(){return ba(this,kr,Ca).call(this,this.rowHighlights,Cj)}getRowHighlights(){return[...this.rowHighlights.values()]}createColumnHighlight(){return ba(this,kr,Ca).call(this,this.columnHighlights,pj)}getColumnHighlights(){return[...this.columnHighlights.values()]}getCustomSelections(){return[...this.customSelections.values()]}addCustomSelection(e){this.customSelections.push(wj({...this.options,...e}))}updateHighlightClassNames(e){"rowClassName"in e&&(this.options.rowClassName=e.rowClassName,O(this.rowHighlights.values(),t=>{t.settings.className=e.rowClassName})),"columnClassName"in e&&(this.options.columnClassName=e.columnClassName,O(this.columnHighlights.values(),t=>{t.settings.className=e.columnClassName})),"headerClassName"in e&&(this.options.headerClassName=e.headerClassName,O(this.rowHeaders.values(),t=>{t.settings.className=e.headerClassName}),O(this.columnHeaders.values(),t=>{t.settings.className=e.headerClassName})),"activeHeaderClassName"in e&&(this.options.activeHeaderClassName=e.activeHeaderClassName,O(this.activeRowHeaders.values(),t=>{t.settings.className=e.activeHeaderClassName}),O(this.activeColumnHeaders.values(),t=>{t.settings.className=e.activeHeaderClassName}),O(this.activeCornerHeaders.values(),t=>{t.settings.className=e.activeHeaderClassName}))}clear(){this.focus.clear(),this.fill.clear(),O(this.areas.values(),e=>{e.clear()}),O(this.layeredAreas.values(),e=>{e.clear()}),O(this.rowHeaders.values(),e=>{e.clear()}),O(this.columnHeaders.values(),e=>{e.clear()}),O(this.activeRowHeaders.values(),e=>{e.clear()}),O(this.activeColumnHeaders.values(),e=>{e.clear()}),O(this.activeCornerHeaders.values(),e=>{e.clear()}),O(this.rowHighlights.values(),e=>{e.clear()}),O(this.columnHighlights.values(),e=>{e.clear()})}[Symbol.iterator](){return[this.focus,this.fill,...this.areas.values(),...this.layeredAreas.values(),...this.rowHeaders.values(),...this.columnHeaders.values(),...this.activeRowHeaders.values(),...this.activeColumnHeaders.values(),...this.activeCornerHeaders.values(),...this.rowHighlights.values(),...this.columnHighlights.values(),...this.customSelections][Symbol.iterator]()}constructor(e){_j(this,kr),this.layerLevel=0,this.layeredAreas=new Map,this.areas=new Map,this.rowHeaders=new Map,this.columnHeaders=new Map,this.activeRowHeaders=new Map,this.activeColumnHeaders=new Map,this.activeCornerHeaders=new Map,this.rowHighlights=new Map,this.columnHighlights=new Map,this.customSelections=[],this.options=e,this.focus=mj(e),this.fill=bj(e)}}function Ca(n,e){const t=this.layerLevel;if(n.has(t))return n.get(t);const o=e({layerLevel:t,...this.options});return n.set(t,o),o}class vx{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}push(e){return this.ranges.push(e),this}pop(){return this.ranges.pop()}current(){return this.peekByIndex(this.size()-1)}previous(){return this.peekByIndex(this.size()-2)}includes(e,t=()=>!0){return this.ranges.some((o,i)=>o.includes(e)&&t(o,i))}findAll(e){const t=[];return this.ranges.forEach((o,i)=>{o.isEqual(e)&&t.push({range:o,layer:i})}),t}remove(e){return this.ranges=this.ranges.filter(t=>!e.some(o=>o.isEqual(t))),this}removeLayers(e){return this.ranges=this.ranges.filter((t,o)=>!e.includes(o)),this}clear(){return this.ranges.length=0,this}size(){return this.ranges.length}clone(){const e=new vx(this.createCellRange);return e.ranges=this.ranges.map(t=>t.clone()),e}map(e){return this.ranges=this.ranges.map((t,o)=>e(t,o)),this}peekByIndex(e=0){let t;return e>=0&&e<this.size()&&(t=this.ranges[e]),t}[Symbol.iterator](){return this.ranges[Symbol.iterator]()}constructor(e){this.ranges=[],this.createCellRange=e}}function VB(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function vj(n,e){return e.get?e.get.call(n):e.value}function Rj(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function zB(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Kn(n,e){var t=zB(n,e,"get");return vj(n,t)}function TS(n,e,t){VB(n,e),e.set(n,t)}function Xl(n,e,t){var o=zB(n,e,"set");return Rj(n,o,t),t}function Dt(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function ya(n,e){VB(n,e),e.add(n)}var La=new WeakMap,Zl=new WeakMap,Wi=new WeakMap,xS=new WeakSet,MS=new WeakSet,IS=new WeakSet,Yb=new WeakSet,Yf=new WeakSet,tp=new WeakSet,np=new WeakSet,HS=new WeakSet,Ph=new WeakSet;class Rx{setActiveLayerIndex(e){Xl(this,Zl,e)}getCurrentSelection(){return Kn(this,La).peekByIndex(Kn(this,Zl))}transformStart(e,t,o=!1){Xl(this,Wi,this.calculateOffset());const i=this.tableApi.createCellCoords(e,t);let s=this.getCurrentSelection().highlight;const r=this.tableApi.visualToRenderableCoords(s);let a=0,l=0;if(this.runLocalHooks("beforeTransformStart",i),r.row!==null&&r.col!==null){let{width:h,height:c}=Dt(this,Yb,PE).call(this);const{row:d,col:u}=Dt(this,HS,tA).call(this,s),f=this.tableApi.fixedRowsBottom(),p=this.tableApi.minSpareRows(),C=this.tableApi.minSpareCols(),y=this.tableApi.autoWrapRow(),_=this.tableApi.autoWrapCol(),T=this.tableApi.createCellCoords(d+i.row,u+i.col);if(T.row>=c){const F=Li(o&&p>0&&f===0),N=T.col+1,I=N>=h,j=this.tableApi.createCellCoords(T.row-c,I?N-h:N);if(this.runLocalHooks("beforeColumnWrap",F,Dt(this,Ph,Sd).call(this,j),I),F.value)this.runLocalHooks("insertRowRequire",this.countRenderableRows());else if(_){if(this.shouldSwitchSelectionLayer()&&I&&Kn(this,La).size()>1){Dt(this,xS,QH).call(this);const U=Dt(this,Yf,Tw).call(this,"forward");U!==null&&j.assign(U)}T.assign(j)}}else if(T.row<0){const F=Li(_),N=T.col-1,I=N<0,j=this.tableApi.createCellCoords(c+T.row,I?h+N:N);if(this.runLocalHooks("beforeColumnWrap",F,Dt(this,Ph,Sd).call(this,j),I),_){if(this.shouldSwitchSelectionLayer()&&I&&Kn(this,La).size()>1){Dt(this,MS,JH).call(this);const U=Dt(this,Yf,Tw).call(this,"backward");U!==null&&j.assign(U)}T.assign(j)}}if({width:h,height:c}=Dt(this,Yb,PE).call(this),T.col>=h){const F=Li(o&&C>0),N=T.row+1,I=N>=c,j=this.tableApi.createCellCoords(I?N-c:N,T.col-h);if(this.runLocalHooks("beforeRowWrap",F,Dt(this,Ph,Sd).call(this,j),I),F.value)this.runLocalHooks("insertColRequire",this.countRenderableColumns());else if(y){if(this.shouldSwitchSelectionLayer()&&I&&Kn(this,La).size()>1){Dt(this,xS,QH).call(this);const U=Dt(this,Yf,Tw).call(this,"forward");U!==null&&j.assign(U)}T.assign(j)}}else if(T.col<0){const F=Li(y),N=T.row-1,I=N<0,j=this.tableApi.createCellCoords(I?c+N:N,h+T.col);if(this.runLocalHooks("beforeRowWrap",F,Dt(this,Ph,Sd).call(this,j),I),y){if(this.shouldSwitchSelectionLayer()&&I&&Kn(this,La).size()>1){Dt(this,MS,JH).call(this);const U=Dt(this,Yf,Tw).call(this,"backward");U!==null&&j.assign(U)}T.assign(j)}}const{rowDir:P,colDir:$}=Dt(this,IS,eA).call(this,T);a=P,l=$,s=Dt(this,Ph,Sd).call(this,T)}return this.runLocalHooks("afterTransformStart",s,a,l),{selectionLayer:Kn(this,Zl),visualCoords:s}}transformEnd(e,t){Xl(this,Wi,this.calculateOffset());const o=this.tableApi.createCellCoords(e,t),i=this.getCurrentSelection(),s=this.tableApi.visualToRenderableCoords(i.highlight),r=Dt(this,tp,Gb).call(this,i.to.row,i.from.row),a=Dt(this,np,jb).call(this,i.to.col,i.from.col),l=i.to.clone();let h=0,c=0;if(this.runLocalHooks("beforeTransformEnd",o),s.row!==null&&s.col!==null&&r!==null&&a!==null){const{row:d,col:u}=Dt(this,HS,tA).call(this,i.highlight),f=this.tableApi.createCellCoords(r+o.row,a+o.col),p=i.getTopStartCorner(),C=i.getTopEndCorner(),y=i.getBottomEndCorner();if(o.col<0&&a>=u&&f.col<u){const $=f.col-u;f.col=Dt(this,np,jb).call(this,p.col,C.col)+$}else if(o.col>0&&a<=u&&f.col>u){const $=Dt(this,np,jb).call(this,C.col,p.col),F=Math.max(f.col-$,1);f.col=$+F}if(o.row<0&&r>=d&&f.row<d){const $=f.row-d;f.row=Dt(this,tp,Gb).call(this,p.row,y.row)+$}else if(o.row>0&&r<=d&&f.row>d){const $=Dt(this,tp,Gb).call(this,y.row,p.row),F=Math.max(f.row-$,1);f.row=$+F}const{rowDir:_,colDir:T}=Dt(this,IS,eA).call(this,f);h=_,c=T;const P=Dt(this,Ph,Sd).call(this,f);o.row===0&&o.col!==0?l.col=P.col:o.row!==0&&o.col===0?l.row=P.row:(l.row=P.row,l.col=P.col)}return this.runLocalHooks("afterTransformEnd",l,h,c),{selectionLayer:Kn(this,Zl),visualCoords:l}}calculateOffset(){Y("`calculateOffset` is not implemented")}countRenderableRows(){Y("`countRenderableRows` is not implemented")}countRenderableColumns(){Y("`countRenderableColumns` is not implemented")}shouldSwitchSelectionLayer(){Y("`shouldSwitchSelectionLayer` is not implemented")}constructor(e,t){ya(this,xS),ya(this,MS),ya(this,IS),ya(this,Yb),ya(this,Yf),ya(this,tp),ya(this,np),ya(this,HS),ya(this,Ph),TS(this,La,{writable:!0,value:void 0}),TS(this,Zl,{writable:!0,value:void 0}),TS(this,Wi,{writable:!0,value:void 0}),Xl(this,Zl,0),Xl(this,Wi,{x:0,y:0}),Xl(this,La,e),this.tableApi=t}}function QH(){const n=Kn(this,Zl)+1;this.setActiveLayerIndex(n>=Kn(this,La).size()?0:n),Xl(this,Wi,this.calculateOffset())}function JH(){const n=Kn(this,Zl)-1;this.setActiveLayerIndex(n<0?Kn(this,La).size()-1:n),Xl(this,Wi,this.calculateOffset())}function eA(n){const{width:e,height:t}=Dt(this,Yb,PE).call(this);let o=0,i=0;return n.row<0?(o=-1,n.row=0):n.row>0&&n.row>=t&&(o=1,n.row=t-1),n.col<0?(i=-1,n.col=0):n.col>0&&n.col>=e&&(i=1,n.col=e-1),{rowDir:o,colDir:i}}function PE(){return{width:Kn(this,Wi).x+this.countRenderableColumns(),height:Kn(this,Wi).y+this.countRenderableRows()}}function Tw(n){if(!["forward","backward"].includes(n))return null;const e=this.getCurrentSelection().getTopStartCorner(),t=this.getCurrentSelection().getBottomEndCorner(),[o,i,s,r]=n==="forward"?[e.row,t.row,e.col,t.col]:[t.row,e.row,t.col,e.col],a=Dt(this,tp,Gb).call(this,o,i),l=Dt(this,np,jb).call(this,s,r);return a===null||l===null?null:this.tableApi.createCellCoords(a,l)}function Gb(n,e){const t=this.tableApi.findFirstNonHiddenRenderableRow(n,e);return t===null?null:Kn(this,Wi).y+t}function jb(n,e){const t=this.tableApi.findFirstNonHiddenRenderableColumn(n,e);return t===null?null:Kn(this,Wi).x+t}function tA(n){const{row:e,col:t}=this.tableApi.visualToRenderableCoords(n);return(e===null||t===null)&&Y("Renderable coords are not visible."),this.tableApi.createCellCoords(Kn(this,Wi).y+e,Kn(this,Wi).x+t)}function Sd(n){const e=n.clone();return e.col=n.col-Kn(this,Wi).x,e.row=n.row-Kn(this,Wi).y,this.tableApi.renderableToVisualCoords(e)}_t(Rx,Bn);class Ej extends Rx{calculateOffset(){return{x:this.tableApi.navigableHeaders()?this.tableApi.countRowHeaders():0,y:this.tableApi.navigableHeaders()?this.tableApi.countColHeaders():0}}countRenderableRows(){return this.tableApi.countRenderableRows()}countRenderableColumns(){return this.tableApi.countRenderableColumns()}shouldSwitchSelectionLayer(){return!1}}class kj extends Rx{calculateOffset(){const e=this.getCurrentSelection(),{row:t,col:o}=e.getOuterTopStartCorner(),i=this.tableApi.countRenderableColumnsInRange(0,o-1),s=this.tableApi.countRenderableRowsInRange(0,t-1),r=e.highlight.isHeader(),a=r?Math.abs(o):0,l=r?Math.abs(t):0;return{x:o<0?a:-i,y:t<0?l:-s}}countRenderableRows(){const e=this.getCurrentSelection();return this.tableApi.countRenderableRowsInRange(0,e.getOuterBottomEndCorner().row)}countRenderableColumns(){const e=this.getCurrentSelection();return this.tableApi.countRenderableColumnsInRange(0,e.getOuterBottomEndCorner().col)}transformEnd(){Y("`transformEnd` is not valid for focus selection use `transformStart` instead")}shouldSwitchSelectionLayer(){return!0}}const Zy=0,Qy=1,UB=2,Ex=3,Tj=[Ex,UB],xj=[["number"],["number","string"],["number","undefined"],["number","string","undefined"]],AS=Symbol("root"),nA=Symbol("child");function sf(n,e=AS){e!==AS&&e!==nA&&Y("The second argument is used internally only and cannot be overwritten.");const t=Array.isArray(n),o=e===AS;let i=Zy;if(t){const s=n[0];n.length===0?i=Qy:o&&s instanceof ff?i=Ex:o&&Array.isArray(s)?i=sf(s,nA):n.length>=2&&n.length<=4&&!n.some((a,l)=>!xj[l].includes(typeof a))&&(i=UB)}return i}function am(n,{createCellCoords:e,createCellRange:t,keepDirection:o=!1,propToCol:i}={}){return Tj.includes(n)||Y("Unsupported selection ranges schema type was provided."),function(s){const r=n===Ex;let a=r?s.from.row:s[0],l=r?s.from.col:s[1],h=r?s.to.row:s[2],c=r?s.to.col:s[3];if(typeof i=="function"&&(typeof l=="string"&&(l=i(l)),typeof c=="string"&&(c=i(c))),en(h)&&(h=a),en(c)&&(c=l),!o){const p=a,C=l,y=h,_=c;a=Math.min(p,y),l=Math.min(C,_),h=Math.max(p,y),c=Math.max(C,_)}const d=r?s.highlight.clone():e(a,l),u=e(a,l),f=e(h,c);return t(d,u,f)}}function Mj(n){const e=sf(n.getSelected());if(e===Zy||e===Qy)return[];const t=am(e,{createCellCoords:n._createCellCoords.bind(n),createCellRange:n._createCellRange.bind(n)}),o=new Set;O(n.getSelected(),r=>{const{from:a,to:l}=t(r),h=Math.max(a.col,0),c=l.col-h+1;O(Array.from(new Array(c),(d,u)=>h+u),d=>{o.has(d)||o.add(d)})});const i=Array.from(o).sort((r,a)=>r-a);return Fi(i,(r,a,l,h)=>(l!==0&&a===h[l-1]+1?r[r.length-1][1]+=1:r.push([a,1]),r),[])}function Ij(n){const e=sf(n.getSelected());if(e===Zy||e===Qy)return[];const t=am(e,{createCellCoords:n._createCellCoords.bind(n),createCellRange:n._createCellRange.bind(n)}),o=new Set;O(n.getSelected(),r=>{const{from:a,to:l}=t(r),h=Math.max(a.row,0),c=l.row-h+1;O(Array.from(new Array(c),(d,u)=>h+u),d=>{o.has(d)||o.add(d)})});const i=Array.from(o).sort((r,a)=>r-a);return Fi(i,(r,a,l,h)=>(l!==0&&a===h[l-1]+1?r[r.length-1][1]+=1:r.push([a,1]),r),[])}function Hj(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Aj(n,e){return e.get?e.get.call(n):e.value}function Oj(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function YB(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function an(n,e){var t=YB(n,e,"get");return Aj(n,t)}function Lh(n,e,t){Hj(n,e),e.set(n,t)}function go(n,e,t){var o=YB(n,e,"set");return Oj(n,o,t),t}var Bi=new WeakMap,vd=new WeakMap,Gf=new WeakMap,_a=new WeakMap,jf=new WeakMap,Rd=new WeakMap,qf=new WeakMap;class GB{updateHighlightClassNames(){this.highlight.updateHighlightClassNames({rowClassName:this.settings.currentRowClassName,columnClassName:this.settings.currentColClassName,headerClassName:this.settings.currentHeaderClassName,activeHeaderClassName:this.settings.activeHeaderClassName})}getSelectedRange(){return this.selectedRange}getActiveSelectedRange(){return this.selectedRange.peekByIndex(an(this,qf))}getActiveSelectionLayerIndex(){return an(this,qf)}setActiveSelectionLayerIndex(e){go(this,qf,e)}markSource(e){go(this,jf,e)}markEndSource(){go(this,jf,"unknown")}getSelectionSource(){return an(this,jf)}setExpectedLayers(e){go(this,Rd,e)}begin(){this.inProgress=!0}finish(){this.runLocalHooks("afterSelectionFinished",Array.from(this.selectedRange)),this.inProgress=!1,go(this,Rd,-1)}isInProgress(){return this.inProgress}setRangeStart(e,t,o=!1,i=e){const s=this.settings.selectionMode==="multiple",r=en(t)?this.tableProps.getShortcutManager().isCtrlPressed():t,a=e.clone();go(this,_a,!1),go(this,Gf,!1),this.runLocalHooks(`beforeSetRangeStart${o?"Only":""}`,a),(!s||s&&!r&&en(t))&&(this.selectedRange.clear(),O(this.highlight.getAreas(),l=>{l.clear()}),O(this.highlight.getLayeredAreas(),l=>{l.clear()}),O(this.highlight.getRowHeaders(),l=>{l.clear()}),O(this.highlight.getColumnHeaders(),l=>{l.clear()}),O(this.highlight.getActiveRowHeaders(),l=>{l.clear()}),O(this.highlight.getActiveColumnHeaders(),l=>{l.clear()}),O(this.highlight.getActiveCornerHeaders(),l=>{l.clear()}),O(this.highlight.getRowHighlights(),l=>{l.clear()}),O(this.highlight.getColumnHighlights(),l=>{l.clear()})),this.selectedRange.add(a).current().setHighlight(i.clone()),this.getLayerLevel()===0&&(this.selectedByRowHeader.clear(),this.selectedByColumnHeader.clear()),o||this.setRangeEnd(e)}setRangeStartOnly(e,t,o=e){this.setRangeStart(e,t,!0,o)}setRangeEnd(e,t=this.getLayerLevel()){if(this.selectedRange.isEmpty())return;this.setActiveSelectionLayerIndex(t);const o=e.clone(),i=this.tableProps.countRows(),s=this.tableProps.countCols(),r=this.getActiveSelectedRange().clone().setTo(e).isSingleHeader();if((i>0||s>0)&&(i===0&&o.col<0&&!r||s===0&&o.row<0&&!r))return;this.runLocalHooks("beforeSetRangeEnd",o),this.begin();const a=this.getActiveSelectedRange();if(this.settings.navigableHeaders||a.highlight.normalize(),this.settings.selectionMode==="single")a.setFrom(a.highlight),a.setTo(a.highlight);else{const h=a.getHorizontalDirection(),c=a.getVerticalDirection(),d=this.isMultiple();a.setTo(o),d&&(h!==a.getHorizontalDirection()||a.getWidth()===1&&!a.includes(a.highlight))&&a.from.assign({col:a.highlight.col}),d&&(c!==a.getVerticalDirection()||a.getHeight()===1&&!a.includes(a.highlight))&&a.from.assign({row:a.highlight.row})}i>0&&s>0&&(!this.settings.navigableHeaders||this.settings.navigableHeaders&&!a.isSingleHeader())&&a.to.normalize(),this.runLocalHooks("beforeHighlightSet"),this.setRangeFocus(this.getActiveSelectedRange().highlight,t),this.applyAndCommit(this.getActiveSelectedRange(),t);const l=an(this,Rd)===-1||this.selectedRange.size()===an(this,Rd);this.runLocalHooks("afterSetRangeEnd",e,l)}applyAndCommit(e=this.getActiveSelectedRange(),t=this.getLayerLevel()){const o=this.tableProps.countRows(),i=this.tableProps.countCols();this.highlight.useLayerLevel(t);const s=this.highlight.createArea(),r=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),h=this.highlight.createActiveRowHeader(),c=this.highlight.createActiveColumnHeader(),d=this.highlight.createActiveCornerHeader(),u=this.highlight.createRowHighlight(),f=this.highlight.createColumnHighlight();if(s.clear(),r.clear(),a.clear(),l.clear(),h.clear(),c.clear(),d.clear(),u.clear(),f.clear(),this.highlight.isEnabledFor(wk,e.highlight)&&(this.isMultiple()||t>=1)&&(s.add(e.from).add(e.to).commit(),r.add(e.from).add(e.to).commit(),t===1)){const p=this.selectedRange.peekByIndex(t-1);this.highlight.useLayerLevel(t-1),this.highlight.createArea().add(p.from).commit().syncWith(p),this.highlight.createLayeredArea().add(p.from).commit().syncWith(p),this.highlight.useLayerLevel(t)}if(this.highlight.isEnabledFor(mk,e.highlight)){if(!e.isSingleHeader()){const y=this.tableProps.createCellCoords(Math.max(e.from.row,0),-1),_=this.tableProps.createCellCoords(e.to.row,-1),T=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(T).commit(),u.add(y).commit(),f.add(T).commit()):(a.add(y).add(_).commit(),l.add(T).add(P).commit(),u.add(y).add(_).commit(),f.add(T).add(P).commit())}const p=!an(this,_a)&&this.isEntireRowSelected()&&(i>0&&i===e.getWidth()||i===0&&this.isSelectedByRowHeader()),C=!an(this,_a)&&this.isEntireColumnSelected()&&(o>0&&o===e.getHeight()||o===0&&this.isSelectedByColumnHeader());p&&h.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(),p&&C&&d.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(),-this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1,-1)).commit()}}setRangeFocus(e,t=this.getLayerLevel()){if(this.selectedRange.isEmpty())return;this.setActiveSelectionLayerIndex(t),an(this,Bi).setActiveLayerIndex(t),an(this,vd).setActiveLayerIndex(t);const o=this.getActiveSelectedRange();this.inProgress||this.runLocalHooks("beforeSetFocus",e);const i=this.highlight.getFocus();i.clear(),o.setHighlight(e),this.inProgress||this.runLocalHooks("beforeHighlightSet"),this.highlight.isEnabledFor(AC,o.highlight)&&i.add(o.highlight).commit().syncWith(o),this.inProgress||(go(this,Gf,!0),this.runLocalHooks("afterSetFocus",o.highlight))}transformStart(e,t,o=!1){if(!this.isSelected())return;const{visualCoords:i}=an(this,Bi).transformStart(e,t,o);this.setRangeStart(i)}transformEnd(e,t){if(!this.isSelected())return;const{visualCoords:o,selectionLayer:i}=an(this,Bi).transformEnd(e,t);this.setRangeEnd(o,i)}transformFocus(e,t){if(!this.isSelected())return;const{selectionLayer:o,visualCoords:i}=an(this,vd).transformStart(e,t);this.setRangeFocus(i.normalize(),o)}shiftRows(e,t){if(!this.isSelected())return;const o=this.getActiveSelectedRange();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByColumnHeader()||o.getOuterTopStartCorner().row>=e){const{from:i,to:s,highlight:r}=o,a=this.tableProps.countRows(),l=this.isSelectedByRowHeader(),h=this.isSelectedByColumnHeader(),c=h?-1:0,d=h?0:t;this.getSelectedRange().pop();const u=this.tableProps.createCellCoords(tt(i.row+d,c,a-1),i.col),f=this.tableProps.createCellCoords(tt(s.row+t,c,a-1),s.col);this.markSource("shift"),r.row>=e?this.setRangeStartOnly(u,!0,this.tableProps.createCellCoords(tt(r.row+t,0,a-1),r.col)):this.setRangeStartOnly(u,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),h&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.markEndSource()}}shiftColumns(e,t){if(!this.isSelected())return;const o=this.getActiveSelectedRange();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByRowHeader()||o.getOuterTopStartCorner().col>=e){const{from:i,to:s,highlight:r}=o,a=this.tableProps.countCols(),l=this.isSelectedByRowHeader(),h=this.isSelectedByColumnHeader(),c=l?-1:0,d=l?0:t;this.getSelectedRange().pop();const u=this.tableProps.createCellCoords(i.row,tt(i.col+d,c,a-1)),f=this.tableProps.createCellCoords(s.row,tt(s.col+t,c,a-1));this.markSource("shift"),r.col>=e?this.setRangeStartOnly(u,!0,this.tableProps.createCellCoords(r.row,tt(r.col+t,0,a-1))):this.setRangeStartOnly(u,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),h&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.markEndSource()}}getLayerLevel(){return this.selectedRange.size()-1}isSelected(){return!this.selectedRange.isEmpty()}isMultiple(e=this.getActiveSelectedRange()){if(!this.isSelected())return!1;const t=Li(!e.isSingle());return this.runLocalHooks("afterIsMultipleSelection",t),t.value}isFocusSelectionChanged(){return this.isSelected()&&an(this,Gf)}isSelectedByRowHeader(e=this.getLayerLevel()){return!this.isSelectedByCorner(e)&&(e===-1?this.selectedByRowHeader.size>0:this.selectedByRowHeader.has(e))}isEntireRowSelected(e=this.getLayerLevel()){const t=i=>{const{col:s}=i.getOuterTopStartCorner(),r=this.tableProps.countRowHeaders(),a=this.tableProps.countCols();return(r>0&&s<0||r===0)&&i.getWidth()===a};if(e===-1)return Array.from(this.selectedRange).some(i=>t(i));const o=this.selectedRange.peekByIndex(e);return o?t(o):!1}isSelectedByColumnHeader(e=this.getLayerLevel()){return!this.isSelectedByCorner()&&(e===-1?this.selectedByColumnHeader.size>0:this.selectedByColumnHeader.has(e))}isEntireColumnSelected(e=this.getLayerLevel()){const t=i=>{const{row:s}=i.getOuterTopStartCorner(),r=this.tableProps.countColHeaders(),a=this.tableProps.countRows();return(r>0&&s<0||r===0)&&i.getHeight()===a};if(e===-1)return Array.from(this.selectedRange).some(i=>t(i));const o=this.selectedRange.peekByIndex(e);return o?t(o):!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 t=this.tableProps.visualToRenderableCoords(e);return t.row!==null&&t.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(e=!1,t=!1,o={focusPosition:!1,disableHeadersHighlight:!1}){const i=this.tableProps.countRows(),s=this.tableProps.countCols(),r=this.tableProps.countRowHeaders(),a=this.tableProps.countColHeaders(),l=t?-a:0,h=e?-r:0;if(l===0&&h===0&&(i===0||s===0))return;let c=this.getActiveSelectedRange()?.highlight;const{focusPosition:d,disableHeadersHighlight:u}=o;d&&Number.isInteger(d?.row)&&Number.isInteger(d?.col)&&(c=this.tableProps.createCellCoords(tt(d.row,l,i-1),tt(d.col,h,s-1)));const f=this.tableProps.createCellCoords(l,h),p=this.tableProps.createCellCoords(i-1,s-1);this.clear(),this.runLocalHooks("beforeSelectAll",f,p,c),this.setRangeStartOnly(f,void 0,c),go(this,_a,u),h<0&&this.selectedByRowHeader.add(this.getLayerLevel()),l<0&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(p),this.runLocalHooks("afterSelectAll",f,p,c),this.finish()}selectCells(e){const t=sf(e);if(t===Qy)return!1;t===Zy&&Y(pt`Unsupported format of the selection ranges was passed. To select cells pass\x20
38
- the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd,\x20
39
- columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);const o=am(t,{createCellCoords:(...a)=>this.tableProps.createCellCoords(...a),createCellRange:(...a)=>this.tableProps.createCellRange(...a),propToCol:a=>this.tableProps.propToCol(a),keepDirection:!0}),i=this.settings.navigableHeaders,s={countRows:this.tableProps.countRows(),countCols:this.tableProps.countCols(),countRowHeaders:i?this.tableProps.countRowHeaders():0,countColHeaders:i?this.tableProps.countColHeaders():0},r=!e.some(a=>{const l=o(a),h=l.isValid(s);return!(h&&!l.containsHeaders()||h&&l.containsHeaders()&&l.isSingleHeader())});return r&&(this.clear(),this.setExpectedLayers(e.length),O(e,a=>{const{from:l,to:h}=o(a);this.setRangeStartOnly(l.clone(),!1),this.setRangeEnd(h.clone())}),this.finish()),r}selectColumns(e,t=e,o=0){const i=typeof e=="string"?this.tableProps.propToCol(e):e,s=typeof t=="string"?this.tableProps.propToCol(t):t,r=this.tableProps.countRows(),a=this.tableProps.countCols(),l=this.tableProps.countColHeaders(),h=l===0?0:-l,c=this.tableProps.createCellCoords(h,i),d=this.tableProps.createCellCoords(r-1,s),u=this.tableProps.createCellRange(c,c,d).isValid({countRows:r,countCols:a,countRowHeaders:0,countColHeaders:l});if(u){let f=0,p=0;Number.isInteger(o?.row)&&Number.isInteger(o?.col)?(f=tt(o.row,h,r-1),p=tt(o.col,Math.min(i,s),Math.max(i,s))):(f=tt(o,h,r-1),p=i);const C=this.tableProps.createCellCoords(f,p),y=l===0?0:tt(C.row,h,-1),_=r-1,T=this.tableProps.createCellCoords(y,i),P=this.tableProps.createCellCoords(_,s);this.runLocalHooks("beforeSelectColumns",T,P,C),this.setRangeStartOnly(T,void 0,C),this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(P),this.runLocalHooks("afterSelectColumns",T,P,C),this.finish()}return u}selectRows(e,t=e,o=0){const i=this.tableProps.countRows(),s=this.tableProps.countCols(),r=this.tableProps.countRowHeaders(),a=r===0?0:-r,l=this.tableProps.createCellCoords(e,a),h=this.tableProps.createCellCoords(t,s-1),c=this.tableProps.createCellRange(l,l,h).isValid({countRows:i,countCols:s,countRowHeaders:r,countColHeaders:0});if(c){let d=0,u=0;Number.isInteger(o?.row)&&Number.isInteger(o?.col)?(d=tt(o.row,Math.min(e,t),Math.max(e,t)),u=tt(o.col,a,s-1)):(d=e,u=tt(o,a,s-1));const f=this.tableProps.createCellCoords(d,u),p=r===0?0:tt(f.col,a,-1),C=s-1,y=this.tableProps.createCellCoords(e,p),_=this.tableProps.createCellCoords(t,C);this.runLocalHooks("beforeSelectRows",y,_,f),this.setRangeStartOnly(y,void 0,f),this.selectedByRowHeader.add(this.getLayerLevel()),this.setRangeEnd(_),this.runLocalHooks("afterSelectRows",y,_,f),this.finish()}return c}importSelection({ranges:e,activeRange:t,activeSelectionLayer:o,selectedByRowHeader:i,selectedByColumnHeader:s,disableHeadersHighlight:r}){e.length!==0&&(this.selectedRange.clear(),this.highlight.clear(),this.inProgress=!1,go(this,_a,r),this.selectedByRowHeader=new Set(i),this.selectedByColumnHeader=new Set(s),this.setActiveSelectionLayerIndex(0),e.forEach((a,l)=>{this.selectedRange.push(a),this.applyAndCommit(a,l)}),this.setRangeFocus(t.highlight,o),go(this,_a,!1),this.inProgress=!1)}exportSelection(){return{ranges:Array.from(this.selectedRange).map(e=>e.clone()),activeRange:this.getActiveSelectedRange(),activeSelectionLayer:this.getActiveSelectionLayerIndex(),selectedByRowHeader:Array.from(this.selectedByRowHeader),selectedByColumnHeader:Array.from(this.selectedByColumnHeader),disableHeadersHighlight:an(this,_a)}}refresh(){if(!this.isSelected())return;const e=this.tableProps.countRows(),t=this.tableProps.countCols();if(e===0||t===0){this.deselect();return}const o=this.selectedRange.ranges.map(a=>a.clone());this.getSelectionSource()==="unknown"&&this.markSource("refresh");const s=new Set(this.selectedByRowHeader),r=new Set(this.selectedByColumnHeader);this.clear(),this.setExpectedLayers(o.length),o.forEach(a=>{const{from:l,to:h,highlight:c}=a,d=e-1,u=t-1;c.assign({row:tt(c.row,this.settings.navigableHeaders?-1/0:0,d),col:tt(c.col,this.settings.navigableHeaders?-1/0:0,u)}),l.assign({row:tt(l.row,-1/0,d),col:tt(l.col,-1/0,u)}),h.assign({row:tt(h.row,-1/0,d),col:tt(h.col,-1/0,u)}),this.setRangeStartOnly(l,!0,c),this.setRangeEnd(h)}),this.selectedByRowHeader=s,this.selectedByColumnHeader=r,this.finish(),this.markEndSource()}commit(){if(this.highlight.getCustomSelections().forEach(i=>{i.commit()}),!this.isSelected())return;const t=this.getLayerLevel(),o=this.getActiveSelectedRange();this.highlight.isEnabledFor(AC,o.highlight)&&this.highlight.getFocus().commit().syncWith(o);for(let i=0;i<this.selectedRange.size();i+=1){this.highlight.useLayerLevel(i);const s=this.highlight.createArea(),r=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),h=this.highlight.createActiveRowHeader(),c=this.highlight.createActiveColumnHeader(),d=this.highlight.createActiveCornerHeader(),u=this.highlight.createRowHighlight(),f=this.highlight.createColumnHighlight();s.commit(),r.commit(),a.commit(),l.commit(),h.commit(),c.commit(),d.commit(),u.commit(),f.commit()}this.highlight.useLayerLevel(t)}constructor(e,t){Lh(this,Bi,{writable:!0,value:void 0}),Lh(this,vd,{writable:!0,value:void 0}),Lh(this,Gf,{writable:!0,value:void 0}),Lh(this,_a,{writable:!0,value:void 0}),Lh(this,jf,{writable:!0,value:void 0}),Lh(this,Rd,{writable:!0,value:void 0}),Lh(this,qf,{writable:!0,value:void 0}),this.inProgress=!1,this.selectedRange=new vx((o,i,s)=>this.tableProps.createCellRange(o,i,s)),this.selectedByRowHeader=new Set,this.selectedByColumnHeader=new Set,go(this,Gf,!1),go(this,_a,!1),go(this,jf,"unknown"),go(this,Rd,-1),go(this,qf,0),this.settings=e,this.tableProps=t,this.highlight=new Sj({headerClassName:e.currentHeaderClassName,activeHeaderClassName:e.activeHeaderClassName,rowClassName:e.currentRowClassName,columnClassName:e.currentColClassName,cellAttributes:[ek()],rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,disabledCellSelection:(o,i)=>this.tableProps.isDisabledCellSelection(o,i),cellCornerVisible:(...o)=>this.isCellCornerVisible(...o),areaCornerVisible:(...o)=>this.isAreaCornerVisible(...o),visualToRenderableCoords:o=>this.tableProps.visualToRenderableCoords(o),renderableToVisualCoords:o=>this.tableProps.renderableToVisualCoords(o),createCellCoords:(o,i)=>this.tableProps.createCellCoords(o,i),createCellRange:(o,i,s)=>this.tableProps.createCellRange(o,i,s)}),go(this,Bi,new Ej(this.selectedRange,{...this.tableProps,navigableHeaders:()=>e.navigableHeaders,fixedRowsBottom:()=>e.fixedRowsBottom,minSpareRows:()=>e.minSpareRows,minSpareCols:()=>e.minSpareCols,autoWrapRow:()=>e.autoWrapRow,autoWrapCol:()=>e.autoWrapCol})),go(this,vd,new kj(this.selectedRange,{...this.tableProps,navigableHeaders:()=>e.navigableHeaders,fixedRowsBottom:()=>0,minSpareRows:()=>0,minSpareCols:()=>0,autoWrapRow:()=>!0,autoWrapCol:()=>!0})),an(this,Bi).addLocalHook("beforeTransformStart",(...o)=>this.runLocalHooks("beforeModifyTransformStart",...o)),an(this,Bi).addLocalHook("afterTransformStart",(...o)=>this.runLocalHooks("afterModifyTransformStart",...o)),an(this,Bi).addLocalHook("beforeTransformEnd",(...o)=>this.runLocalHooks("beforeModifyTransformEnd",...o)),an(this,Bi).addLocalHook("afterTransformEnd",(...o)=>this.runLocalHooks("afterModifyTransformEnd",...o)),an(this,Bi).addLocalHook("insertRowRequire",(...o)=>this.runLocalHooks("insertRowRequire",...o)),an(this,Bi).addLocalHook("insertColRequire",(...o)=>this.runLocalHooks("insertColRequire",...o)),an(this,Bi).addLocalHook("beforeRowWrap",(...o)=>this.runLocalHooks("beforeRowWrap",...o)),an(this,Bi).addLocalHook("beforeColumnWrap",(...o)=>this.runLocalHooks("beforeColumnWrap",...o)),an(this,vd).addLocalHook("beforeTransformStart",(...o)=>this.runLocalHooks("beforeModifyTransformFocus",...o)),an(this,vd).addLocalHook("afterTransformStart",(...o)=>this.runLocalHooks("afterModifyTransformFocus",...o))}}_t(GB,Bn);const oA=/^(\r\n|\n\r|\r|\n)/,Dj=/^[^\t\r\n]+/,iA=/^\t/;function Nj(n){const e=[[""]];if(n.length===0)return e;let t=0,o=0,i;for(;n.length>0&&i!==n.length;)if(i=n.length,n.match(iA))n=n.replace(iA,""),t+=1,e[o][t]="";else if(n.match(oA))n=n.replace(oA,""),t=0,o+=1,e[o]=[""];else{let s="";if(n.startsWith('"')){let r=0,a=!0;for(;a;){const l=n.slice(0,1);l==='"'&&(r+=1),s+=l,n=n.slice(1),(n.length===0||n.match(/^[\t\r\n]/)&&r%2===0)&&(a=!1)}s=s.replace(/^"/,"").replace(/"$/,"").replace(/["]*/g,l=>new Array(Math.floor(l.length/2)).fill('"').join(""))}else{const r=n.match(Dj);s=r?r[0]:"",n=n.slice(s.length)}e[o][t]=s}return e}function $C(n){let e,t,o,i,s="",r;for(e=0,t=n.length;e<t;e+=1){for(i=n[e].length,o=0;o<i;o+=1)o>0&&(s+=" "),r=n[e][o],typeof r=="string"?r.indexOf(`
40
- `)>-1?s+=`"${r.replace(/"/g,'""')}"`:s+=r:r==null?s+="":s+=r;e!==t-1&&(s+=`
41
- `)}return s}function OS(n,e){const{instance:t,visualRow:o,visualCol:i,valueSetter:s}=e;return _e(s)?s.call(t,n,o,i,e):n}function Jy(n,e){const{instance:t,visualRow:o,visualCol:i,valueGetter:s}=e;return _e(s)?s.call(t,n,o,i,e):n}class Du{static get DESTINATION_RENDERER(){return 1}static get DESTINATION_CLIPBOARD_GENERATOR(){return 2}createMap(){const e=this.getSchema();typeof e>"u"&&Y("trying to create `columns` definition but you didn't provide `schema` nor `data`");const t=this.tableMeta.columns;let o;if(this.colToPropCache=[],this.propToColCache=new Map,t){let i=0,s=0,r=!1;if(typeof t=="function"){const a=tk(e);i=a>0?a:this.countFirstRowKeys(),r=!0}else{const a=this.tableMeta.maxCols;i=Math.min(a,t.length)}for(o=0;o<i;o++){const a=r?t(o):t[o];if(ie(a)){if(typeof a.data<"u"){const l=r?s:o;this.colToPropCache[l]=a.data,this.propToColCache.set(a.data,l)}s+=1}}}else this.recursiveDuckColumns(e)}countFirstRowKeys(){return yB(this.dataSource)}recursiveDuckColumns(e,t,o){let i=t,s=o,r;return typeof i>"u"&&(i=0,s=""),typeof e=="object"&&!Array.isArray(e)&&nt(e,(a,l)=>{a===null?(r=s+l,this.colToPropCache.push(r),this.propToColCache.set(r,i),i+=1):i=this.recursiveDuckColumns(a,i,`${l}.`)}),i}colToProp(e){if(Number.isInteger(e)===!1)return e;const t=this.hot.toPhysicalColumn(e);return t===null?e:this.colToPropCache&&ee(this.colToPropCache[t])?this.colToPropCache[t]:t}propToCol(e){const t=this.propToColCache.get(e);if(ee(t))return this.hot.toVisualColumn(t);const o=this.hot.toVisualColumn(e);return o===null?e:o}getSchema(){const e=this.tableMeta.dataSchema;return e?typeof e=="function"?e():e:this.duckSchema}createDuckSchema(){return this.dataSource&&this.dataSource[0]?Jp(this.dataSource[0]):{}}refreshDuckSchema(){this.duckSchema=this.createDuckSchema()}createRow(e,t=1,{source:o,mode:i="above"}={}){const s=this.hot.countSourceRows();let r=s,a=0,l=e;if((typeof l!="number"||l>=s)&&(l=s),l<this.hot.countRows()&&(r=this.hot.toPhysicalRow(l)),this.hot.runHooks("beforeCreateRow",l,t,o)===!1||r===null)return{delta:0};const c=this.tableMeta.maxRows,d=this.getSchema().length,u=[];for(;a<t&&s+a<c;){let p=null;this.hot.dataType==="array"?this.tableMeta.dataSchema?p=Jn(this.getSchema()):(p=[],Re(d-1,()=>p.push(null))):this.hot.dataType==="function"?p=this.tableMeta.dataSchema(l+a):(p={},Wy(p,this.getSchema())),u.push(p),a+=1}this.hot.rowIndexMapper.insertIndexes(l,a),i==="below"&&(r=Math.min(r+1,s)),this.spliceData(r,0,u);const f=this.hot.toVisualRow(r);return this.hot.countSourceRows()===u.length&&this.hot.columnIndexMapper.initToLength(this.hot.getInitialColumnCount()),a>0&&(e==null?this.metaManager.createRow(null,a):o!=="auto"&&this.metaManager.createRow(r,t)),this.hot.runHooks("afterCreateRow",f,a,o),{delta:a,startPhysicalIndex:r}}createCol(e,t=1,{source:o,mode:i="start"}={}){this.hot.isColumnModificationAllowed()||Y("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 s=this.dataSource,r=this.tableMeta.maxCols,a=this.hot.countSourceCols(),l=this.hot.countCols(),h=this.hot.countSourceRows(),c=typeof e=="number"&&e<=a?e:l;if(this.hot.runHooks("beforeCreateCol",c,t,o)===!1)return{delta:0};const d=c<l?this.hot.toPhysicalColumn(c):a,u=i==="end"?Math.min(d+1,a):d;let f=0;for(let p=u;f<t&&l+f<r;p++){if(typeof c!="number"||c>=l+f)if(h>0)for(let C=0;C<h;C+=1)typeof s[C]>"u"&&(s[C]=[]),s[C].push(null);else s.push([null]);else for(let C=0;C<h;C++)s[C].splice(p,0,null);f+=1}return f>0&&(e==null?this.metaManager.createColumn(null,f):o!=="auto"&&this.metaManager.createColumn(u,t)),this.hot.columnIndexMapper.insertIndexes(c,f,i),this.hot.runHooks("afterCreateCol",this.hot.toVisualColumn(u),f,o),this.refreshDuckSchema(),{delta:f,startPhysicalIndex:u}}removeRow(e,t=1,o){let i=Number.isInteger(e)?e:-t;const s=this.visualRowsToPhysical(i,t),r=this.hot.countSourceRows();if(i=(r+i)%r,this.hot.runHooks("beforeRemoveRow",i,s.length,s,o)===!1)return!1;const l=s.length;if(this.filterData(i,l,s),i<this.hot.countRows()){this.hot.rowIndexMapper.removeIndexes(s);const c=ee(this.tableMeta.columns)||ee(this.tableMeta.dataSchema)||this.tableMeta.colHeaders;this.hot.rowIndexMapper.getNotTrimmedIndexesLength()===0&&!c&&this.hot.columnIndexMapper.setIndexesSequence([])}return s.slice(0).sort((c,d)=>d-c).forEach(c=>{this.metaManager.removeRow(c,1)}),this.hot.runHooks("afterRemoveRow",i,l,s,o),!0}removeCol(e,t=1,o){(this.hot.dataType==="object"||this.tableMeta.columns)&&Y("cannot remove column with object data source or columns option specified");let i=typeof e!="number"?-t:e;i=(this.hot.countCols()+i)%this.hot.countCols();const s=this.visualColumnsToPhysical(i,t),r=s.slice(0).sort((d,u)=>u-d);if(this.hot.runHooks("beforeRemoveCol",i,t,s,o)===!1)return!1;let l=!0;const h=r.length,c=this.dataSource;for(let d=0;d<h;d++)l&&s[0]!==s[d]-d&&(l=!1);if(l)for(let d=0,u=this.hot.countSourceRows();d<u;d++)c[d].splice(s[0],t),d===0&&this.metaManager.removeColumn(s[0],t);else for(let d=0,u=this.hot.countSourceRows();d<u;d++)for(let f=0;f<h;f++)c[d].splice(r[f],1),d===0&&this.metaManager.removeColumn(r[f],1);return i<this.hot.countCols()&&(this.hot.columnIndexMapper.removeIndexes(s),!this.tableMeta.rowHeaders&&this.hot.columnIndexMapper.getNotTrimmedIndexesLength()===0&&this.hot.rowIndexMapper.setIndexesSequence([])),this.hot.runHooks("afterRemoveCol",i,t,s,o),this.refreshDuckSchema(),!0}spliceCol(e,t,o,...i){const s=this.hot.getDataAtCol(e),r=s.slice(t,t+o),a=s.slice(t+o);zI(i,a);let l=0;for(;l<o;)i.push(null),l+=1;return PG(i),this.hot.populateFromArray(t,e,i,null,null,"spliceCol"),r}spliceRow(e,t,o,...i){const s=this.hot.getSourceDataAtRow(e),r=s.slice(t,t+o),a=s.slice(t+o);zI(i,a);let l=0;for(;l<o;)i.push(null),l+=1;return this.hot.populateFromArray(e,t,[i],null,null,"spliceRow"),r}spliceData(e,t,o){if(this.hot.runHooks("beforeDataSplice",e,t,o)!==!1){const s=[...this.dataSource.slice(0,e),...o,...this.dataSource.slice(e)];this.dataSource.length=0,s.forEach(r=>this.dataSource.push(r))}}filterData(e,t,o){let i=this.hot.runHooks("filterData",e,t,o);Array.isArray(i)===!1&&(i=this.dataSource.filter((s,r)=>o.indexOf(r)===-1)),this.dataSource.length=0,Array.prototype.push.apply(this.dataSource,i)}get(e,t){const o=this.hot.toPhysicalRow(e);let i=this.dataSource[o];const s=this.hot.runHooks("modifyRowData",o);i=isNaN(s)?s:i;const{dataDotNotation:r}=this.hot.getSettings();let a=null;if(i&&i.hasOwnProperty&&tn(i,t))a=i[t];else if(r&&typeof t=="string"&&t.indexOf(".")>-1){let c=i;if(!c)return null;const d=t.split(".");for(let u=0,f=d.length;u<f;u++)if(c=c[d[u]],typeof c>"u")return null;a=c}else typeof t=="function"&&(a=t(this.dataSource.slice(o,o+1)[0]));const l=this.propToCol(t),h=this.hot.toPhysicalColumn(l);if(Vu(o)&&Vu(h)&&(a=Jy(a,this.metaManager.getCellMeta(o,h,{visualRow:e,visualColumn:l,skipMetaExtension:!0}))),this.hot.hasHook("modifyData")){const c=Li(a);this.hot.runHooks("modifyData",e,l,c,"get"),c.isTouched()&&(a=c.value)}return a}getCopyable(e,t){return this.hot.getCellMeta(e,this.propToCol(t)).copyable?this.get(e,t):""}set(e,t,o){const i=this.hot.toPhysicalRow(e);let s=o,r=this.dataSource[i];const a=this.hot.runHooks("modifyRowData",i);if(r=isNaN(a)?a:r,this.hot.hasHook("modifyData")){const h=Li(s);this.hot.runHooks("modifyData",e,this.propToCol(t),h,"set"),h.isTouched()&&(s=h.value)}const{dataDotNotation:l}=this.hot.getSettings();if(r&&r.hasOwnProperty&&tn(r,t))r[t]=s;else if(l&&typeof t=="string"&&t.indexOf(".")>-1){let h=r,c=0,d;const u=t.split(".");for(c=0,d=u.length-1;c<d;c++){if(u[c]==="__proto__"||u[c]==="constructor"||u[c]==="prototype")return;typeof h[u[c]]>"u"&&(h[u[c]]={}),h=h[u[c]]}h[u[c]]=s}else if(typeof t=="function")t(this.dataSource.slice(i,i+1)[0],s);else{if(t==="__proto__"||t==="constructor"||t==="prototype")return;r[t]=s}}visualRowsToPhysical(e,t){const o=this.hot.countSourceRows(),i=[];let s=(o+e)%o,r=t,a;for(;s<o&&r;)a=this.hot.toPhysicalRow(s),i.push(a),r-=1,s+=1;return i}visualColumnsToPhysical(e,t){const o=this.hot.countCols(),i=[];let s=(o+e)%o,r=t;for(;s<o&&r;){const a=this.hot.toPhysicalColumn(s);i.push(a),r-=1,s+=1}return i}clear(){for(let e=0;e<this.hot.countSourceRows();e++)for(let t=0;t<this.hot.countCols();t++)this.set(e,this.colToProp(t),"")}getLength(){const e=this.tableMeta.maxRows;let t;e<0||e===0?t=0:t=e||1/0;const o=this.hot.rowIndexMapper.getNotTrimmedIndexesLength();return Math.min(o,t)}getAll(){const e={row:0,col:0},t={row:Math.max(this.hot.countRows()-1,0),col:Math.max(this.hot.countCols()-1,0)};return e.row-t.row===0&&!this.hot.countSourceRows()?[]:this.getRange(e,t,Du.DESTINATION_RENDERER)}countCachedColumns(){return this.colToPropCache.length}getRange(e,t,o){const i=[];let s,r,a;const l=this.tableMeta.maxRows,h=this.tableMeta.maxCols;if(l===0||h===0)return[];const c=o===Du.DESTINATION_CLIPBOARD_GENERATOR?this.getCopyable:this.get,d=Math.min(Math.max(l-1,0),Math.max(e.row,t.row)),u=Math.min(Math.max(h-1,0),Math.max(e.col,t.col));for(s=Math.min(e.row,t.row);s<=d;s++){a=[];const f=s>=0?this.hot.toPhysicalRow(s):s;for(r=Math.min(e.col,t.col);r<=u&&f!==null;r++)a.push(c.call(this,s,this.colToProp(r)));f!==null&&i.push(a)}return i}getText(e,t){return $C(this.getRange(e,t,Du.DESTINATION_RENDERER))}getCopyableText(e,t){return $C(this.getRange(e,t,Du.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}constructor(e,t,o){this.hot=e,this.metaManager=o,this.tableMeta=o.getTableMeta(),this.dataSource=t,this.refreshDuckSchema(),this.createMap()}}class Pj{modifyRowData(e){let t;return this.hot.hasHook("modifyRowData")&&(t=this.hot.runHooks("modifyRowData",e)),t!==void 0&&!Number.isInteger(t)?t:this.data[e]}getData(e=!1){return!this.data||this.data.length===0?this.data:this.getByRange(null,null,e)}setData(e){this.data=e}getAtColumn(e){const t=[];return O(this.data,(o,i)=>{const s=this.getAtCell(i,e);t.push(s)}),t}getAtRow(e,t,o,i=!1){const s=t===void 0&&o===void 0,{dataDotNotation:r}=this.hot.getSettings();let a=null,l=null;if(a=this.modifyRowData(e),Array.isArray(a))l=[],s?a.forEach((h,c)=>{l[c]=this.getAtPhysicalCell(e,c,a)}):Re(t,o,h=>{l[h-t]=this.getAtPhysicalCell(e,h,a)});else if(ie(a)||_e(a))if(i?l=[]:l={},!s||i){const c=this.countFirstRowKeys()-1;Re(0,c,d=>{const u=this.colToProp(d);if(d>=(t||0)&&d<=(o||c)&&!Number.isInteger(u)){const f=this.getAtPhysicalCell(e,u,a);i?l.push(f):r?tS(l,u,f):l[u]=f}})}else nt(a,(h,c)=>{const d=this.getAtPhysicalCell(e,c,a);r?tS(l,c,d):l[c]=d});return l}setAtCell(e,t,o){if(e>=this.countRows()||t>=this.countFirstRowKeys())return;if(this.hot.hasHook("modifySourceData")){const s=Li(o);this.hot.runHooks("modifySourceData",e,t,s,"set"),s.isTouched()&&(o=s.value)}if(["__proto__","constructor","prototype"].includes(e))return;const i=this.modifyRowData(e);Number.isInteger(t)?i[t]=o:tS(i,t,o)}getAtPhysicalCell(e,t,o){let i=null;if(o)if(typeof t=="string"){const{dataDotNotation:s}=this.hot.getSettings();i=s?kC(o,t):o[t]}else typeof t=="function"?i=t(o):i=o[t];if(this.hot.hasHook("modifySourceData")){const s=Li(i);this.hot.runHooks("modifySourceData",e,t,s,"get"),s.isTouched()&&(i=s.value)}return i}getAtCell(e,t){const o=this.modifyRowData(e);return this.getAtPhysicalCell(e,this.colToProp(t),o)}getByRange(e=null,t=null,o=!1){let i=!1,s=null,r=null,a=null,l=null;e===null||t===null?(i=!0,s=0,a=this.countRows()-1):(s=Math.min(e.row,t.row),r=Math.min(e.col,t.col),a=Math.max(e.row,t.row),l=Math.max(e.col,t.col));const h=[];return Re(s,a,c=>{h.push(i?this.getAtRow(c,void 0,void 0,o):this.getAtRow(c,r,l,o))}),h}getCopyable(e,t){const o=this.propToCol(t);return this.hot.getCellMeta(e,o).copyable?this.getAtCell(this.hot.toPhysicalRow(e),o):""}countRows(){if(this.hot.hasHook("modifySourceLength")){const e=this.hot.runHooks("modifySourceLength");if(Number.isInteger(e))return e}return this.data.length}countFirstRowKeys(){return yB(this.data)}destroy(){this.data=null,this.hot=null}constructor(e,t=[]){this.dataType="array",this.colToProp=()=>{},this.propToCol=()=>{},this.hot=e,this.data=t}}const{register:Lj,getItem:Wj,hasItem:jB,getNames:S_e,getValues:v_e}=ts("cellTypes");function $j(n){return jB(n)||Y(`You declared cell type "${n}" as a string that is not mapped to a known object.
42
- Cell type must be an object or a string mapped to an object registered by
43
- "Handsontable.cellTypes.registerCellType" method`),Wj(n)}function ki(n,e){typeof n!="string"&&(e=n,n=e.CELL_TYPE);const{editor:t,renderer:o,validator:i}=e;t&&Yo(n,t),o&&ui(n,o),i&&Da(n,i),Lj(n,e)}function Fj(n,e){return n==="CELL_TYPE"?!1:e._automaticallyAssignedMetaProps?.has(n)||!tn(e,n)}function e_(n,e,t=n){const o=typeof e.type=="string"?$j(e.type):e.type;if(n._automaticallyAssignedMetaProps&&nt(e,(s,r)=>{n._automaticallyAssignedMetaProps.delete(r)}),!ie(o))return;t===n&&!n._automaticallyAssignedMetaProps&&(n._automaticallyAssignedMetaProps=new Set);const i={};nt(o,(s,r)=>{Fj(r,t)&&(i[r]=s,n._automaticallyAssignedMetaProps?.add(r))}),Fn(n,i)}function Bj(n,e=[]){function t(){}y4(t,n);for(let o=0;o<e.length;o++)t.prototype[e[o]]=void 0;return t}function qb(n,e){n()||Y(`Assertion failed: ${e}`)}function op(n){return n==null}const qB=(()=>({_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,dataProvider:void 0,dataDotNotation:!0,dataSchema:void 0,dateFormat:"DD/MM/YYYY",timeFormat:"h:mm:ss a",datePickerConfig:void 0,defaultDate:void 0,disableVisualSelection:!1,dialog:!1,dragToScroll:!0,dropdownMenu:void 0,editor:void 0,emptyDataState:!1,enterBeginsEditing:!0,enterCommits:!0,enterMoves:{col:0,row:1},exportFile:void 0,fillHandle:{autoInsertRow:!1},filter:!0,filteringCaseSensitive:!1,filters:void 0,filterSelectedItems:!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,initialState:void 0,invalidCellClassName:"htInvalid",imeFastEdit:!1,isEmptyCol(n){let e,t,o;const i=!!this.getSettings().dataSchema,s=this.getSchema(),r=this.colToProp(n);for(e=0,t=this.countRows();e<t;e++)if(o=this.getDataAtCell(e,n),ht(o)===!1){if(typeof o=="object"){if(bh(s[r],o)===!1)return!1;continue}if(i&&s[r]===o)continue;return!1}return!0},isEmptyRow(n){let e,t,o;const i=!!this.getSettings().dataSchema,s=this.getSchema();for(e=0,t=this.countCols();e<t;e++)if(o=this.getDataAtCell(n,e),ht(o)===!1){const r=this.colToProp(e);if(typeof o=="object"){if(bh(s[r],o)===!1)return!1;continue}if(i&&s[r]===o)continue;return!1}return!0},label:void 0,language:"en-US",layoutDirection:"inherit",licenseKey:void 0,locale:"en-US",loading:!1,notification:!1,manualColumnFreeze:void 0,manualColumnMove:void 0,manualColumnResize:void 0,manualRowMove:void 0,manualRowResize:void 0,maxCols:1/0,maxRows:1/0,maxSelections:void 0,mergeCells:!1,minCols:0,minRowHeights:void 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,pagination:void 0,placeholder:void 0,placeholderCellClassName:"htPlaceholder",preventOverflow:!1,preventWheel:!1,readOnly:!1,readOnlyCellClassName:"htDimmed",renderAllRows:!1,renderAllColumns:!1,renderer:void 0,valueFormatter:void 0,valueParser:void 0,rowHeaders:void 0,rowHeaderWidth:void 0,rowHeights:void 0,search:!1,searchInput:!0,selectionMode:"multiple",selectOptions:void 0,skipColumnOnPaste:!1,skipRowOnPaste:!1,sortByRelevance:!0,sourceSortFunction:void 0,source:void 0,startCols:5,startRows:5,stretchH:"none",strict:void 0,tableClassName:void 0,textEllipsis:!1,themeName:void 0,theme:void 0,injectCoreCss:!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,sourceDataValidator:void 0,sourceDataWarningMessage:void 0,valueGetter:void 0,valueSetter:void 0,viewportColumnRenderingOffset:"auto",viewportRowRenderingOffset:"auto",viewportColumnRenderingThreshold:0,viewportRowRenderingThreshold:0,visibleRows:10,width:void 0,wordWrap:!0,sanitizer:void 0,parsePastedValue:!1}));function Vj(){return class{}}class zj{getMetaConstructor(){return this.metaCtor}getMeta(){return this.meta}updateMeta(e){Fn(this.meta,e),e_(this.meta,{...e,type:e.type??this.meta.type},e)}constructor(e){this.metaCtor=Vj(),this.meta=this.metaCtor.prototype,Fn(this.meta,qB()),this.meta.instance=e}}class Uj{getMeta(){return this.meta}updateMeta(e){Fn(this.meta,e),e_(this.meta,e,e)}constructor(e){const t=e.getMetaConstructor();this.meta=new t}}class FC{obtain(e){qb(()=>Vu(e),"Expecting an unsigned number.");const t=this._getStorageIndexByKey(e);let o;if(t>=0)o=this.data[t],o===void 0&&(o=this.valueFactory(e),this.data[t]=o);else if(o=this.valueFactory(e),this.holes.size>0){const i=this.holes.values().next().value;this.holes.delete(i),this.data[i]=o,this.index[e]=i}else this.data.push(o),this.index[e]=this.data.length-1;return o}insert(e,t=1){qb(()=>Vu(e)||op(e),"Expecting an unsigned number or null/undefined argument.");const o=[],i=this.data.length;for(let r=0;r<t;r++)o.push(i+r),this.data.push(void 0);const s=op(e)?this.index.length:e;this.index=[...this.index.slice(0,s),...o,...this.index.slice(s)]}remove(e,t=1){qb(()=>Vu(e)||op(e),"Expecting an unsigned number or null/undefined argument.");const o=this.index.splice(op(e)?this.index.length-t:e,t);for(let i=0;i<o.length;i++){const s=o[i];typeof s=="number"&&this.holes.add(s)}}size(){return this.data.length-this.holes.size}values(){return this.data.filter((e,t)=>e!==void 0&&!this.holes.has(t))[Symbol.iterator]()}entries(){const e=[];for(let o=0;o<this.data.length;o++){const i=this._getKeyByStorageIndex(o);i!==-1&&this.data[o]!==void 0&&e.push([i,this.data[o]])}let t=0;return{next:()=>{if(t<e.length){const o=e[t];return t+=1,{value:o,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()}constructor(e){this.data=[],this.index=[],this.holes=new Set,this.valueFactory=e}}const Yj=["data","width"];class Gj{updateMeta(e,t){const o=this.getMeta(e);Fn(o,t),e_(o,t)}createColumn(e,t){this.metas.insert(e,t)}removeColumn(e,t){this.metas.remove(e,t)}getMeta(e){return this.metas.obtain(e)}getMetaConstructor(e){return this.metas.obtain(e).constructor}clearCache(){this.metas.clear()}_createMeta(){return Bj(this.globalMeta.getMetaConstructor(),Yj).prototype}constructor(e){this.metas=new FC(()=>this._createMeta()),this.globalMeta=e,this.metas=new FC(()=>this._createMeta())}}class jj{updateMeta(e,t,o){const i=this.getMeta(e,t);Fn(i,o),e_(i,o)}createRow(e,t){this.metas.insert(e,t)}createColumn(e,t){for(let o=0;o<this.metas.size();o++)this.metas.obtain(o).insert(e,t)}removeRow(e,t){this.metas.remove(e,t)}removeColumn(e,t){for(let o=0;o<this.metas.size();o++)this.metas.obtain(o).remove(e,t)}getMeta(e,t,o){const i=this.metas.obtain(e).obtain(t);return o===void 0?i:i[o]}setMeta(e,t,o,i){const s=this.metas.obtain(e).obtain(t);s._automaticallyAssignedMetaProps?.delete(o),s[o]=i}removeMeta(e,t,o){const i=this.metas.obtain(e).obtain(t);delete i[o]}getMetas(){const e=[],t=Array.from(this.metas.values());for(let o=0;o<t.length;o++)ee(t[o])&&e.push(...t[o].values());return e}getMetasAtRow(e){qb(()=>Vu(e),"Expecting an unsigned number.");const t=new Map(this.metas);return t.has(e)?Array.from(t.get(e)).sort(([o],[i])=>o-i).map(([,o])=>o):[]}clearCache(){this.metas.clear()}_createRow(){return new FC(e=>this._createMeta(e))}_createMeta(e){const t=this.columnMeta.getMetaConstructor(e);return new t}constructor(e){this.metas=new FC(()=>this._createRow()),this.columnMeta=e}}class KB{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,t){this.columnMeta.updateMeta(e,t)}getCellMeta(e,t,o){const i=this.cellMeta.getMeta(e,t);return i.visualRow=o.visualRow,i.visualCol=o.visualColumn,i.row=e,i.col=t,o.skipMetaExtension||this.runLocalHooks("afterGetCellMeta",i),i}getCellMetaKeyValue(e,t,o){return typeof o!="string"&&Y("The passed cell meta object key is not a string"),this.cellMeta.getMeta(e,t,o)}setCellMeta(e,t,o,i){this.cellMeta.setMeta(e,t,o,i)}updateCellMeta(e,t,o){this.cellMeta.updateMeta(e,t,o)}removeCellMeta(e,t,o){this.cellMeta.removeMeta(e,t,o)}getCellsMeta(){return this.cellMeta.getMetas()}getCellsMetaAtRow(e){return this.cellMeta.getMetasAtRow(e)}createRow(e,t=1){this.cellMeta.createRow(e,t)}removeRow(e,t=1){this.cellMeta.removeRow(e,t)}createColumn(e,t=1){this.cellMeta.createColumn(e,t),this.columnMeta.createColumn(e,t)}removeColumn(e,t=1){this.cellMeta.removeColumn(e,t),this.columnMeta.removeColumn(e,t)}clearCellsCache(){this.cellMeta.clearCache()}clearCache(){this.cellMeta.clearCache(),this.columnMeta.clearCache()}constructor(e,t={},o=[]){this.hot=e,this.globalMeta=new zj(e),this.tableMeta=new Uj(this.globalMeta),this.columnMeta=new Gj(this.globalMeta),this.cellMeta=new jj(this.columnMeta),o.forEach(i=>new i(this)),this.globalMeta.updateMeta(t)}}_t(KB,Bn);function qj(n,e,t){const o=e.sourceDataValidator;if(!_e(o)||o(n,e,t)===!0)return!0;const{row:s,col:r,sourceDataWarningMessage:a,allowInvalid:l}=e;return a&&ZB(a,[{row:s,col:r,value:n}]),l===!0}function XB(n,e){const t=n.countSourceRows(),o=n.countSourceCols();if(t===0||o===0)return;const i=new Map;for(let s=0;s<t;s+=1)for(let r=0;r<o;r+=1){const a=n.toVisualRow(s),l=n.toVisualColumn(r);if(a===null||l===null)continue;const h=n.getCellMeta(a,l),{sourceDataWarningMessage:c,sourceDataValidator:d,allowInvalid:u}=h;if(!_e(d))continue;const f=n._getDataSource(),p=f.getAtCell(s,r,null);if(d(p,h,e)!==!0&&(u===!1&&f.setAtCell(s,r,null),c)){const y=c,_=i.get(y)??[];_.push({row:s,col:r,value:p,message:y}),i.set(y,_)}}i.forEach((s,r)=>{ZB(r,s)})}function ZB(n,e){H4({logFunction:Ie,message:n,items:e,itemFormatter:({row:t,col:o,value:i})=>{const s=yt(i),r=s.length>64?`${s.slice(0,64)}...`:s;return`row ${t}, col ${o}, value: "${r}"`}})}function sA(n,e,t,o){const{hotInstance:i,dataMap:s,dataSource:r,internalSource:a,source:l,metaManager:h,firstRun:c}=o,d=mr(a),u=i.getSettings();Array.isArray(u.dataSchema)?i.dataType="array":_e(u.dataSchema)?i.dataType="function":i.dataType="object",s&&s.destroy(),n=i.runHooks(`before${d}`,n,c,l);const f=new Du(i,n,h);if(e(f),typeof n=="object"&&n!==null)n.push&&n.splice||(n=[n]);else if(n===null){const p=f.getSchema();n=[];let C,y=0,_=0;for(y=0,_=u.startRows;y<_;y++)if((i.dataType==="object"||i.dataType==="function")&&u.dataSchema)C=Jn(p),n.push(C);else if(i.dataType==="array")C=Jn(p[0]),n.push(C);else{C=[];for(let T=0,P=u.startCols;T<P;T++)C.push(null);n.push(C)}}else Y(`${a} only accepts array of objects or array of arrays (${typeof n} given)`);Array.isArray(n[0])&&(i.dataType="array"),u.data=n,f.dataSource=n,r.data=n,r.dataType=i.dataType,r.colToProp=f.colToProp.bind(f),r.propToCol=f.propToCol.bind(f),r.countCachedColumns=f.countCachedColumns.bind(f),t(f),c||XB(i,a),i.runHooks(`after${d}`,n,c,l),c||(i.runHooks("afterChange",null,a),i.view.adjustElementsSize(),i.render()),i.getSettings().ariaTags&&fe(i.rootElement,[rF(-1),Ly(i.countCols()+(i.view?i.countRowHeaders():0))])}class Kj{extendCellMeta(e){const{row:t,col:o}=e;if(this.metaSyncMemo.get(t)?.has(o))return;const{visualRow:i,visualCol:s}=e,r=this.metaManager.hot,a=r.colToProp(s);e.prop=a,r.runHooks("beforeGetCellMeta",i,s,e);const l=tn(e,"type")?e.type:null;let h=_e(e.cells)?e.cells(t,o,a):null;l&&(h?h.type=h.type??l:h={type:l}),h&&this.metaManager.updateCellMeta(t,o,h),r.runHooks("afterGetCellMeta",i,s,e),this.metaSyncMemo.has(t)||this.metaSyncMemo.set(t,new Set),this.metaSyncMemo.get(t).add(o)}constructor(e){this.metaSyncMemo=new Map,this.metaManager=e,e.addLocalHook("afterGetCellMeta",(...t)=>this.extendCellMeta(...t)),de.getSingleton().add("beforeRender",t=>{t&&this.metaSyncMemo.clear()},this.metaManager.hot)}}function Xj(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Zj(n,e){return e.get?e.get.call(n):e.value}function Qj(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function QB(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Jj(n,e){var t=QB(n,e,"get");return Zj(n,t)}function e8(n,e,t){Xj(n,e),e.set(n,t)}function t8(n,e,t){var o=QB(n,e,"set");return Qj(n,o,t),t}const rA=new WeakSet,aA=new WeakSet;var DS=new WeakMap;class n8{extendMetaProps(){this.propDescriptors.forEach((e,t)=>{const{initOnly:o,target:i,onChange:s}=e,r=typeof i=="string",a=r?i:t,l=`_${a}`;this.metaManager.globalMeta.meta[l]=this.metaManager.globalMeta.meta[a],s?(this.installPropWatcher(t,l,s),r&&this.installPropWatcher(i,l,s)):o&&(this.installPropWatcher(t,l,Jj(this,DS)),this.metaManager.globalMeta.meta._initOnlySettings||(this.metaManager.globalMeta.meta._initOnlySettings=[]),this.metaManager.globalMeta.meta._initOnlySettings.push(t))})}installPropWatcher(e,t,o){const i=this;Object.defineProperty(this.metaManager.globalMeta.meta,e,{get(){return this[t]},set(s){const r=!i.usageTracker.has(e);i.usageTracker.add(e),o.call(i,e,s,r),this[t]=s},enumerable:!0,configurable:!0})}constructor(e){e8(this,DS,{writable:!0,value:void 0}),this.usageTracker=new Set,this.propDescriptors=new Map([["ariaTags",{initOnly:!0}],["fixedColumnsLeft",{target:"fixedColumnsStart",onChange(t){this.metaManager.hot.isRtl()&&t==="fixedColumnsLeft"&&Y("The `fixedColumnsLeft` is not supported for RTL. Please use option `fixedColumnsStart`."),this.usageTracker.has("fixedColumnsLeft")&&this.usageTracker.has("fixedColumnsStart")&&Y("The `fixedColumnsLeft` and `fixedColumnsStart` should not be used together. Please use only the option `fixedColumnsStart`.")}}],["correctFormat",{onChange(){rA.has(this.metaManager.hot)||(rA.add(this.metaManager.hot),Ch("The `correctFormat` option is deprecated and will be removed in the next major release.\n\nMigration guide: https://handsontable.com/docs/migration-from-16.2-to-17.0/"))}}],["datePickerConfig",{onChange(){aA.has(this.metaManager.hot)||(aA.add(this.metaManager.hot),Ch("The `datePickerConfig` option is deprecated and will be removed in the next major release.\n\nMigration guide: https://handsontable.com/docs/migration-from-16.2-to-17.0/"))}}],["layoutDirection",{initOnly:!0}],["renderAllColumns",{initOnly:!0}],["renderAllRows",{initOnly:!0}]]),t8(this,DS,(t,o,i)=>{i||Y(`The \`${t}\` option can not be updated after the Handsontable is initialized.`)}),this.metaManager=e,this.extendMetaProps()}}function JB(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function o8(n,e){return e.get?e.get.call(n):e.value}function i8(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function eV(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function lA(n,e){var t=eV(n,e,"get");return o8(n,t)}function hA(n,e,t){JB(n,e),e.set(n,t)}function cA(n,e,t){var o=eV(n,e,"set");return i8(n,o,t),t}function BC(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function dA(n,e){JB(n,e),e.add(n)}var LE=new WeakMap,WE=new WeakMap,NS=new WeakSet,$E=new WeakSet;class s8{toRenderable(e){const t=e.getVerticalDirection()==="N-S"?1:-1,o=e.getHorizontalDirection()==="W-E"?1:-1,i=BC(this,NS,uA).call(this,e.from,t,o);if(i===null)return null;const s=BC(this,NS,uA).call(this,e.to,-t,-o);if(s===null)return null;const r=e.clone();return r.from=i,r.to=s,r.includes(e.highlight)||(r.highlight=i),r}constructor({rowIndexMapper:e,columnIndexMapper:t}){dA(this,NS),dA(this,$E),hA(this,LE,{writable:!0,value:void 0}),hA(this,WE,{writable:!0,value:void 0}),cA(this,LE,e),cA(this,WE,t)}}function uA(n,e,t=e){const o=BC(this,$E,fA).call(this,lA(this,LE),n.row,e);if(o===null)return null;const i=BC(this,$E,fA).call(this,lA(this,WE),n.col,t);return i===null?null:n.clone().assign({row:o,col:i})}function fA(n,e,t){return e<0?e:n.getNearestNotHiddenIndex(e,t)}function mf(n){na(n)&&n.scrollIntoView({block:"nearest",inline:"nearest"})}function t_(n){const{selection:e,view:t}=n,o=n.getSelectedRangeActive(),i=e.getSelectionSource(),s=t.getFirstFullyVisibleColumn(),r=t.getLastFullyVisibleColumn(),a=o.getTopStartCorner().col,l=o.getBottomEndCorner().col,h=a<=s,c=l>=r,d=t.getFirstFullyVisibleRow(),u=t.getLastFullyVisibleRow(),f=o.getTopStartCorner().row,p=o.getBottomEndCorner().row,C=f<=d,y=p>=u;return{getComputedColumnTarget(_){return i==="mouse"||i==="keyboard"?_.col:h&&c?o.highlight.col:h?a:c?l:_.col},getComputedRowTarget(_){return i==="mouse"||i==="keyboard"?_.row:C&&y?o.highlight.row:C?f:y?p:_.row}}}function r8(n){return e=>{const t=t_(n).getComputedColumnTarget(e);n.scrollViewportTo({col:t},()=>{const o=!!n.getSettings().colHeaders;mf(n.getCell(o?-1:0,t,!0))})}}function a8(){return()=>{}}function l8(n){return e=>{n.scrollViewportTo(e.toObject(),()=>{const t=n.getSelectedRangeActive();if(!t)return;const{row:o,col:i}=t.highlight;mf(n.getCell(o,i,!0))})}}function h8(n){return e=>{const t=t_(n),o={row:t.getComputedRowTarget(e),col:t.getComputedColumnTarget(e)};n.scrollViewportTo(o,()=>{const{row:i,col:s}=o;mf(n.getCell(i,s,!0))})}}function c8(n){return e=>{const t=t_(n),o={row:t.getComputedRowTarget(e),col:t.getComputedColumnTarget(e)};n.scrollViewportTo(o,()=>{const{row:i,col:s}=o;mf(n.getCell(i,s,!0))})}}function d8(n){return e=>{const t=t_(n).getComputedRowTarget(e);n.scrollViewportTo({row:t},()=>{const o=!!n.getSettings().rowHeaders;mf(n.getCell(t,o?-1:0,!0))})}}function u8(n){return e=>{const t=n.selection.getSelectionSource(),{row:o,col:i}=e,s=()=>{mf(n.getCell(o,i,!0))};if(o<0&&i>=0)n.scrollViewportTo({col:i},s);else if(i<0&&o>=0)n.scrollViewportTo({row:o},s);else{if(t==="mouse"&&(i===n.view.getLastPartiallyVisibleColumn()||o===n.view.getLastPartiallyVisibleRow()))return;n.scrollViewportTo({row:o,col:i},s)}}}function f8(n){const{selection:e}=n;let t=!1,o=!1;return{resume(){o=!1},suspend(){o=!0},skipNextScrollCycle(){t=!0},scrollTo(i){if(t||o){t=!1;return}let s;e.isFocusSelectionChanged()?s=l8(n):e.isSelectedByCorner()?s=a8():e.isSelectedByRowHeader()?s=d8(n):e.isSelectedByColumnHeader()?s=r8(n):e.getSelectedRange().size()===1&&e.isMultiple()?s=h8(n):e.getSelectedRange().size()===1&&!e.isMultiple()?s=u8(n):e.getSelectedRange().size()>1&&(s=c8(n)),s?.(i)}}}const g8=Object.freeze({INLINE:"inline",MODAL:"modal"}),jr=Object.freeze({UNKNOWN:"unknown",CLICK:"click",TAB_FROM_ABOVE:"tab_from_above",TAB_FROM_BELOW:"tab_from_below"}),p8="grid";function m8(n,e){const t=gA(n,jr.TAB_FROM_ABOVE),o=gA(n,jr.TAB_FROM_BELOW);return e.prepend(t),e.append(o),{activate(){t.tabIndex=0,o.tabIndex=0},deactivate(){t.tabIndex=-1,o.tabIndex=-1},destroy(){t.remove(),o.remove()}}}function gA(n,e){const o=n.rootDocument.createElement("div");return o.style.display="none",o.classList.add("htFocusCatcher"),o.dataset.htFocusSource=e,o}function w8(n,e,t={}){const o={shortcutsContextName:p8,type:g8.INLINE,contains:f=>f===e||e.contains(f),runOnlyIf:()=>!0,enableFocusCatchers:!0,...t},i=o.enableFocusCatchers===!1?null:m8(n,e);return{getType:()=>o.type,hasContainerDetached:()=>!n.rootWrapperElement.contains(e),getShortcutsContextName:()=>o.shortcutsContextName,runOnlyIf:()=>o.runOnlyIf(),contains:f=>o.contains(f),activate:(f=jr.UNKNOWN)=>{o.onActivate?.(f)},deactivate:()=>{o.onDeactivate?.()},activateFocusCatchers:()=>{i?.activate()},deactivateFocusCatchers:()=>{i?.deactivate()},enable:()=>{e.removeAttribute("inert")},disable:()=>{e.setAttribute("inert","true")},destroy:()=>{i?.destroy()}}}function b8(n,e={}){let t=!1;function o(c){t||e.onFocus?.(c)}function i(c){e.onClick?.(c)}function s(c){c.key==="Tab"&&e.onTabKeyDown?.(c)}function r(){t=!0}function a(){t=!1}return{mount:()=>{let c=n;for(;c;){const{documentElement:d}=c.document;d.addEventListener("focusin",o),d.addEventListener("click",i),d.addEventListener("keydown",s),d.addEventListener("mousedown",r),d.addEventListener("mouseup",a),c=yh(c)}},unmount:()=>{let c=n;for(;c;){const{documentElement:d}=c.document;d.removeEventListener("focusin",o),d.removeEventListener("click",i),d.removeEventListener("keydown",s),d.removeEventListener("mousedown",r),d.removeEventListener("mouseup",a),c=yh(c)}}}}function C8(n){const e=Wm({errorIdExists:p=>`The "${p}" focus scope is already registered.`}),t=n.getShortcutManager();let o=null;function i(){return o?e.getId(o):null}function s(p,C,y={}){e.hasItem(p)&&Y(`Scope with id "${p}" already registered`);const _=w8(n,C,y);e.addItem(p,_),t.getOrCreateContext(_.getShortcutsContextName())}function r(p){e.hasItem(p)||Y(`Scope with id "${p}" not found`),e.getItem(p).destroy(),e.removeItem(p)}function a(p,C=jr.UNKNOWN){e.hasItem(p)||Y(`Scope with id "${p}" not found`);const y=C??jr.UNKNOWN;h(e.getItem(p),y)}function l(p){e.hasItem(p)||Y(`Scope with id "${p}" not found`),c(e.getItem(p))}function h(p,C=jr.UNKNOWN){o!==p&&(o!==null&&c(o),o=p,o.activate(C),t.setActiveContextName(p.getShortcutsContextName()))}function c(p){d(),o===p&&(o=null,p.deactivate())}function d(){const p=e.getValues(),C=p.filter(y=>y.runOnlyIf()&&y.getType()==="modal");p.forEach(y=>{C.length>0&&C.includes(y)||C.length===0||y.hasContainerDetached()?y.enable():y.disable(),y===o?y.contains(n.rootDocument.activeElement)?y.deactivateFocusCatchers():y.activateFocusCatchers():y.runOnlyIf()?y.activateFocusCatchers():y.deactivateFocusCatchers()})}function u(p,C){if(!p.isConnected||!Kc(p))return;const y=e.getValues().filter(T=>T.runOnlyIf());let _=!1;y.forEach(T=>{!_&&T.contains(p)&&(_=!0,C!==jr.UNKNOWN&&n.listen(),h(T,C))}),!_&&o&&(c(o),n.unlisten())}const f=b8(n.rootWindow,{onFocus:p=>{u(p.target,p.target.dataset.htFocusSource??jr.UNKNOWN)},onClick:p=>{u(p.target,jr.CLICK)},onTabKeyDown:()=>{d()}});return f.mount(),{getActiveScopeId:i,registerScope:s,unregisterScope:r,activateScope:(p,C)=>a(p,C),deactivateScope:p=>l(p),destroy:()=>f.unmount()}}function tV(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function y8(n,e){return e.get?e.get.call(n):e.value}function _8(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function nV(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Nt(n,e){var t=nV(n,e,"get");return y8(n,t)}function Ed(n,e,t){tV(n,e),e.set(n,t)}function tr(n,e,t){var o=nV(n,e,"set");return _8(n,o,t),t}function Va(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function kd(n,e){tV(n,e),e.add(n)}const zu=Object.freeze({CELL:"cell",MIXED:"mixed"});var kn=new WeakMap,xw=new WeakMap,Kf=new WeakMap,Xf=new WeakMap,Zf=new WeakMap,lm=new WeakMap,VC=new WeakSet,oV=new WeakSet,pA=new WeakSet,PS=new WeakSet,mA=new WeakSet,wA=new WeakSet;class S8{init(){const e=Nt(this,kn).getSettings();tr(this,xw,e.imeFastEdit?zu.MIXED:zu.CELL),Nt(this,kn).addHook("afterUpdateSettings",(...t)=>Va(this,wA,k8).call(this,...t)),Nt(this,kn).addHook("afterSelection",(...t)=>Va(this,PS,bA).call(this,...t)),Nt(this,kn).addHook("afterSelectionFocusSet",(...t)=>Va(this,PS,bA).call(this,...t)),Nt(this,kn).addHook("afterSelectionEnd",(...t)=>Va(this,pA,R8).call(this,...t)),Nt(this,kn).addHook("afterRender",(...t)=>Va(this,mA,E8).call(this,...t))}getFocusMode(){return Nt(this,xw)}setFocusMode(e){Object.values(zu).includes(e)?tr(this,xw,e):Ie(`"${e}" is not a valid focus mode.`)}getRefocusDelay(){return Nt(this,Kf)}setRefocusDelay(e){tr(this,Kf,e)}setRefocusElementGetter(e){tr(this,Xf,e)}getRefocusElement(){return typeof Nt(this,Xf)=="function"?Nt(this,Xf).call(this):Nt(this,kn).getActiveEditor()?.TEXTAREA}focusElement(e,t){return!na(e)||!e.isConnected?!1:(e.focus(t),!0)}focusOnHighlightedCell(e){const t=o=>{const i=Nt(this,kn).getSelectedRangeActive()?.highlight;if(!i)return;let s=Nt(this,kn).runHooks("modifyFocusedElement",i.row,i.col,o);na(s)||(s=o),s&&!Nt(this,kn).getActiveEditor()?.isOpened()&&this.focusElement(s,{preventScroll:!0})};e?t(e):Va(this,VC,kx).call(this,o=>t(o))}refocusToEditorTextarea(e=Nt(this,Kf)){Nt(this,kn).getSettings().imeFastEdit&&!Nt(this,kn).getActiveEditor()?.isOpened()&&(Nt(this,kn).getActiveEditor()?.refreshValue?.(),Nt(this,Zf).has(e)||Nt(this,Zf).set(e,Lm(()=>{Nt(this,kn).isDestroyed||this.getRefocusElement()?.select()},e)),Nt(this,Zf).get(e)())}constructor(e){kd(this,VC),kd(this,oV),kd(this,pA),kd(this,PS),kd(this,mA),kd(this,wA),Ed(this,kn,{writable:!0,value:void 0}),Ed(this,xw,{writable:!0,value:void 0}),Ed(this,Kf,{writable:!0,value:void 0}),Ed(this,Xf,{writable:!0,value:void 0}),Ed(this,Zf,{writable:!0,value:void 0}),Ed(this,lm,{writable:!0,value:void 0}),tr(this,Kf,1),tr(this,Xf,null),tr(this,Zf,new Map),tr(this,lm,!1),tr(this,kn,e)}}function kx(n){const e=Nt(this,kn).getSelectedRangeActive()?.highlight;if(!e||!Nt(this,kn).selection.isCellVisible(e)){n(null);return}const t=Nt(this,kn).getCell(e.row,e.col,!0);t===null?Nt(this,kn).addHookOnce("afterScroll",()=>{n(Nt(this,kn).getCell(e.row,e.col,!0))}):n(t)}function v8(){Va(this,VC,kx).call(this,n=>{const{activeElement:e}=Nt(this,kn).rootDocument;e&&yF(e)&&e.blur(),this.focusOnHighlightedCell(n)})}function R8(){Va(this,VC,kx).call(this,n=>{this.getFocusMode()===zu.MIXED&&n?.nodeName==="TD"&&this.refocusToEditorTextarea()})}function bA(){tr(this,lm,!0)}function E8(){Nt(this,lm)&&(tr(this,lm,!1),Va(this,oV,v8).call(this))}function k8(n){typeof n.imeFastEdit=="boolean"&&this.setFocusMode(n.imeFastEdit?zu.MIXED:zu.CELL)}function T8(n){return e=>{if(!e)return null;const{rowIndexMapper:t,columnIndexMapper:o}=n;if(t.isHidden(e.row)||o.isHidden(e.col))return null;const i=FE(n),s=BE(n);return i===null||s===null?null:(e.row=tt(e.row,i.row,s.row),e.col=tt(e.col,i.col,s.col),e)}}function FE(n){const{rowIndexMapper:e,columnIndexMapper:t}=n,{navigableHeaders:o}=n.getSettings();let i=o&&n.countColHeaders()>0?-n.countColHeaders():0,s=o&&n.countRowHeaders()>0?-n.countRowHeaders():0;return i===0&&(i=e.getVisualFromRenderableIndex(i)),s===0&&(s=t.getVisualFromRenderableIndex(s)),i===null||s===null?null:n._createCellCoords(i,s)}function BE(n){const{rowIndexMapper:e,columnIndexMapper:t}=n,{navigableHeaders:o}=n.getSettings();let i=e.getRenderableIndexesLength()-1,s=t.getRenderableIndexesLength()-1;if(i<0){if(!o||n.countColHeaders()===0)return null;i=-1}if(s<0){if(!o||n.countColHeaders()===0)return null;s=-1}return n._createCellCoords(e.getVisualFromRenderableIndex(i)??i,t.getVisualFromRenderableIndex(s)??s)}const Rp="gridDefault",Sh="grid",zC="grid.tabNavigation",fl="editorManager.handlingEditor",x8="editor",M8={name:"editorCloseAndSave",callback(n){n._getEditorManager().closeEditorAndSaveChanges()}},I8="hooksRefRegisterer",iV={_hooksStorage:Object.create(null),addHook(n,e){return this._hooksStorage[n]||(this._hooksStorage[n]=[]),this.hot.addHook(n,e),this._hooksStorage[n].push(e),this},removeHooksByKey(n){O(this._hooksStorage[n]||[],e=>{this.hot.removeHook(n,e)})},clearHooks(){nt(this._hooksStorage,(n,e)=>this.removeHooksByKey(e)),this._hooksStorage={}}};cl(iV,"MIXIN_NAME",I8,{writable:!1,enumerable:!1});const H8="base",Tn=Object.freeze({VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"});class ad{static get EDITOR_TYPE(){return H8}_fireCallbacks(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)}init(){}getValue(){Y("Editor getValue() method unimplemented")}setValue(){Y("Editor setValue() method unimplemented")}open(){Y("Editor open() method unimplemented")}close(){Y("Editor close() method unimplemented")}prepare(e,t,o,i,s,r){this.TD=i,this.row=e,this.col=t,this.prop=o,this.originalValue=s,this.cellProperties=r,this.state=this.isOpened()?this.state:Tn.VIRGIN}extend(){return class extends this.constructor{}}saveValue(e,t){let o,i,s,r;if(t){const l=this.hot.getSelectedRangeActive(),h=l.getTopStartCorner(),c=l.getBottomEndCorner();o=h.row,i=h.col,s=c.row,r=c.col}else[o,i,s,r]=[this.row,this.col,null,null];const a=this.hot.runHooks("modifyGetCellCoords",o,i,!1,"meta");Array.isArray(a)&&([o,i]=a),this.hot.populateFromArray(o,i,e,s,r,"edit")}beginEditing(e,t){if(this.state!==Tn.VIRGIN)return;const o=this.hot,i=o.rowIndexMapper.getRenderableFromVisualIndex(this.row),s=o.columnIndexMapper.getRenderableFromVisualIndex(this.col);if(o.view.scrollViewport(o._createCellCoords(i,s)),this.state=Tn.EDITING,this.isInFullEditMode()){const r=Jy(this.originalValue,this.hot.getCellMeta(this.row,this.col)),a=typeof e=="string"?e:yt(r);this.setValue(a)}this.open(t),this._opened=!0,this.focus(),o.view.render(),o.runHooks("afterBeginEditing",this.row,this.col),this.addHook("beforeDialogShow",()=>this.cancelChanges())}finishEditing(e,t,o){if(o){const i=this._closeCallback;this._closeCallback=s=>{i&&i(s),o(s),this.hot.view.render()}}if(!this.isWaiting()){if(this.state===Tn.VIRGIN){this.hot._registerTimeout(()=>{this._fireCallbacks(!0)});return}if(this.state===Tn.EDITING){if(e){this.cancelChanges(),this.hot.view.render();return}let i=this.getValue();this.cellProperties.trimWhitespace&&(i=typeof i=="string"?String.prototype.trim.call(i||""):i),typeof this.cellProperties.valueParser=="function"&&(i=this.cellProperties.valueParser(i,this.cellProperties)),this.state=Tn.WAITING,this.saveValue([[i]],t),this.hot.getCellValidator(this.cellProperties)?this.hot.addHookOnce("postAfterValidate",s=>{this.state=Tn.FINISHED,this.discardEditor(s)}):(this.state=Tn.FINISHED,this.discardEditor(!0))}}}cancelChanges(){this.state=Tn.FINISHED,this.discardEditor()}discardEditor(e){this.state===Tn.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.hot.selectCell(this.row,this.col),this.focus(),this.state=Tn.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Tn.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===Tn.WAITING}getEditedCellRect(){const e=this.getEditedCell();if(!e)return;const{wtOverlays:t,wtViewport:o}=this.hot.view._wt,i=this.hot.rootWindow,s=Jo(e),r=Cn(e),a=Jo(this.hot.rootElement),l=Cn(this.hot.rootElement),h=t.topOverlay.holder,c=t.inlineStartOverlay.holder,d=h!==i?h.scrollTop:0,u=c!==i?c.scrollLeft:0,f=i.innerWidth-a.left-l,{wtTable:p}=t.getParentOverlay(e)??this.hot.view._wt,C=p.name,y=["master","inline_start"].includes(C)?d:0,_=["master","top","bottom"].includes(C)?u:0,T=s.top===a.top?0:1;let P=s.top-a.top-T-y,$=0;this.hot.isRtl()?$=i.innerWidth-s.left-r-f-1+_:$=s.left-a.left-1-_,["top","top_inline_start_corner"].includes(C)&&(P+=t.topOverlay.getOverlayOffset()),["inline_start","top_inline_start_corner"].includes(C)&&($+=Math.abs(t.inlineStartOverlay.getOverlayOffset()));const F=this.hot.hasColHeaders(),N=this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row),I=this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col),U=this.hot.rowIndexMapper.getRenderableIndexesLength()-this.hot.view._wt.getSetting("fixedRowsBottom");(F&&N<=0||N===U)&&(P+=1),I<=0&&($+=1);const G=o.rowsRenderCalculator.startPosition,te=o.columnsRenderCalculator.startPosition,Q=Math.abs(t.inlineStartOverlay.getScrollPosition()),be=t.topOverlay.getScrollPosition(),Oe=Mn(this.hot.rootDocument);let Ve=e.offsetTop;if(["inline_start","master"].includes(C)&&(Ve+=G-be),["bottom","bottom_inline_start_corner"].includes(C)){const{wtViewport:g,wtTable:b}=t.bottomOverlay.clone;Ve+=g.getWorkspaceHeight()-b.getHeight()-Oe}let Ke=e.offsetLeft;this.hot.isRtl()?(Ke>=0?Ke=p.getWidth()-e.offsetLeft:Ke=Math.abs(Ke),Ke+=te-Q-r):["top","master","bottom"].includes(C)&&(Ke+=te-Q);const He=i.getComputedStyle(this.TD),Ye=this.hot.isRtl()?"borderRightWidth":"borderLeftWidth",bt=parseInt(He[Ye],10)>0?0:1,sn=parseInt(He.borderTopWidth,10)>0?0:1,D=Cn(e)+bt,K=xn(e)+sn,ye=bF(h)?Oe:0,z=CF(c)?Oe:0,Ee=this.hot.view.maximumVisibleElementWidth(Ke)-ye+bt,Ge=Math.max(this.hot.view.maximumVisibleElementHeight(Ve)-z+sn,this.hot.stylesHandler.getDefaultRowHeight());return{top:P,start:$,height:K,maxHeight:Ge,width:D,maxWidth:Ee}}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 t="";return this.row<this.hot.getSettings().fixedRowsTop?this.col<this.hot.getSettings().fixedColumnsStart?t="top-inline-start-corner":t="top":this.hot.getSettings().fixedRowsBottom&&this.row>=e-this.hot.getSettings().fixedRowsBottom?this.col<this.hot.getSettings().fixedColumnsStart?t="bottom-inline-start-corner":t="bottom":this.col<this.hot.getSettings().fixedColumnsStart&&(t="inline-start"),t}constructor(e){this.state=Tn.VIRGIN,this._opened=!1,this._fullEditMode=!1,this._closeCallback=null,this._closeAfterDataChange=!0,this.TD=null,this.row=null,this.col=null,this.prop=null,this.originalValue=null,this.cellProperties=null,this.hot=e,this.init()}}_t(ad,iV);const A8={name:"editorCloseAndSaveByArrowKeys",callback(n,e,t){const o=n._getEditorManager(),i=o.getActiveEditor();i.isInFullEditMode()&&i.state===Tn.EDITING||(o.closeEditorAndSaveChanges(),n.getSelected()&&(t.includes("arrowdown")?n.selection.transformStart(1,0):t.includes("arrowup")?n.selection.transformStart(-1,0):t.includes("arrowleft")?n.selection.transformStart(0,-1*n.getDirectionFactor()):t.includes("arrowright")&&n.selection.transformStart(0,n.getDirectionFactor())),e.preventDefault())}},O8={name:"editorCloseAndSaveByEnter",callback(n,e){const t=n._getEditorManager();t.closeEditorAndSaveChanges(e.ctrlKey||e.metaKey),t.moveSelectionAfterEnter(e)}},D8={name:"editorCloseWithoutSaving",callback(n){const e=n._getEditorManager();e.closeEditorAndRestoreOriginalValue(n.getShortcutManager().isCtrlPressed()),e.activeEditor.focus()}},N8={name:"editorFastOpen",callback(n,e){const{highlight:t}=n.getSelectedRangeActive();t.isHeader()||n._getEditorManager().openEditor(null,e,!0)}},P8={name:"editorOpen",callback(n,e,t){const{selection:o}=n,i=n._getEditorManager(),s=n.getSelectedRange(),r=n.getSelectedRangeActive(),{highlight:a}=r;if((s.some(l=>o.isMultiple(l))||s.length>1)&&!r.isHeader()&&n.countRenderedCols()>0&&n.countRenderedRows()>0){const l=n.getSettings(),h=typeof l.enterMoves=="function"?l.enterMoves(e):l.enterMoves;t.includes("shift")?o.transformFocus(-h.row,-h.col):o.transformFocus(h.row,h.col);return}a.isHeader()||(n.getSettings().enterBeginsEditing?i.cellProperties.readOnly?i.moveSelectionAfterEnter(e):i.openEditor(null,e,!0):i.moveSelectionAfterEnter(e),es(e))}};function L8(){return[M8,A8,O8,D8,N8,P8]}const W8={name:"extendCellsSelectionDown",callback(n){const{selection:e}=n,{highlight:t}=n.getSelectedRangeActive();!e.isSelectedByColumnHeader()&&!e.isSelectedByCorner()&&(t.isCell()||t.isHeader()&&e.isSelectedByRowHeader())&&(e.markSource("keyboard"),e.transformEnd(1,0),e.markEndSource())}},$8={name:"extendCellsSelectionDownByViewportHeight",callback(n){const{selection:e,rowIndexMapper:t}=n,{to:o}=n.getSelectedRangeActive(),i=Math.min(o.row+n.countVisibleRows(),n.countRows()-1),s=t.getNearestNotHiddenIndex(i,-1);if(s!==null){const r=n._createCellCoords(s,o.col),a=o.row-n.getFirstFullyVisibleRow(),l=Math.min(r.row-a,n.countRows()-1);e.markSource("keyboard"),e.setRangeEnd(r,n.getActiveSelectionLayerIndex()),e.markEndSource(),n.scrollViewportTo({row:l,verticalSnap:"top",horizontalSnap:"start"})}}},F8={name:"extendCellsSelectionLeft",callback(n){const{selection:e}=n,{highlight:t}=n.getSelectedRangeActive();!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&(t.isCell()||t.isHeader()&&e.isSelectedByColumnHeader())&&(e.markSource("keyboard"),e.transformEnd(0,-1*n.getDirectionFactor()),e.markEndSource())}},B8={name:"extendCellsSelectionRight",callback(n){const{selection:e}=n,{highlight:t}=n.getSelectedRangeActive();!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&(t.isCell()||t.isHeader()&&e.isSelectedByColumnHeader())&&(e.markSource("keyboard"),e.transformEnd(0,n.getDirectionFactor()),e.markEndSource())}},V8={name:"extendCellsSelectionToColumns",callback(n){const{selection:e}=n,{highlight:t,from:o,to:i}=n.getSelectedRangeActive();e.markSource("keyboard"),e.isSelectedByRowHeader()?e.selectAll(!0,!0):n.selectColumns(o.col,i.col,t),e.markEndSource()}},z8={name:"extendCellsSelectionToMostBottom",callback(n){const{selection:e,rowIndexMapper:t}=n,{highlight:o,from:i,to:s}=n.getSelectedRangeActive(),r=o.isHeader()&&e.isSelectedByRowHeader();if(o.isCell()||r){const a=t.getNearestNotHiddenIndex(n.countRows()-1,-1),l=i.clone();l.row=o.row,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,o.clone()),r&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(n._createCellCoords(a,s.col)),e.markEndSource()}}},U8={name:"extendCellsSelectionToMostInlineEnd",callback(n){const{selection:e,columnIndexMapper:t}=n,{highlight:o,from:i,to:s}=n.getSelectedRangeActive();if(!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&o.isCell()){const r=t.getNearestNotHiddenIndex(n.countCols()-1,-1),a=i.clone();a.col=o.col,e.markSource("keyboard"),e.setRangeStart(a,void 0,!1,o.clone()),e.setRangeEnd(n._createCellCoords(s.row,r)),e.markEndSource()}}},Y8={name:"extendCellsSelectionToMostInlineStart",callback(n){const{selection:e,columnIndexMapper:t}=n,{highlight:o,from:i,to:s}=n.getSelectedRangeActive();if(!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&o.isCell()){const r=parseInt(n.getSettings().fixedColumnsStart,10),a=t.getNearestNotHiddenIndex(r,1),l=i.clone();l.col=o.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,o.clone()),e.setRangeEnd(n._createCellCoords(s.row,a)),e.markEndSource()}}},G8={name:"extendCellsSelectionToMostLeft",callback(n){const{selection:e,columnIndexMapper:t}=n,{highlight:o,from:i,to:s}=n.getSelectedRangeActive(),r=o.isHeader()&&e.isSelectedByColumnHeader();if(o.isCell()||r){const a=t.getNearestNotHiddenIndex(...n.isRtl()?[n.countCols()-1,-1]:[0,1]),l=i.clone();l.col=o.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,o.clone()),r&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(n._createCellCoords(s.row,a)),e.markEndSource()}}},j8={name:"extendCellsSelectionToMostRight",callback(n){const{selection:e,columnIndexMapper:t}=n,{highlight:o,from:i,to:s}=n.getSelectedRangeActive(),r=o.isHeader()&&e.isSelectedByColumnHeader();if(o.isCell()||r){const a=t.getNearestNotHiddenIndex(...n.isRtl()?[0,1]:[n.countCols()-1,-1]),l=i.clone();l.col=o.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,o.clone()),r&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(n._createCellCoords(s.row,a)),e.markEndSource()}}},q8={name:"extendCellsSelectionToMostTop",callback(n){const{selection:e,rowIndexMapper:t}=n,{highlight:o,from:i,to:s}=n.getSelectedRangeActive(),r=o.isHeader()&&e.isSelectedByRowHeader();if(o.isCell()||r){const a=t.getNearestNotHiddenIndex(0,1),l=i.clone();l.row=o.row,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,o.clone()),r&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(n._createCellCoords(a,s.col)),e.markEndSource()}}},K8={name:"extendCellsSelectionToRows",callback(n){const{selection:e}=n,{highlight:t,from:o,to:i}=n.getSelectedRangeActive();e.markSource("keyboard"),e.isSelectedByColumnHeader()?e.selectAll(!0,!0):n.selectRows(o.row,i.row,t),e.markEndSource()}},X8={name:"extendCellsSelectionUp",callback(n){const{selection:e}=n,{highlight:t}=n.getSelectedRangeActive();!e.isSelectedByColumnHeader()&&!e.isSelectedByCorner()&&(t.isCell()||t.isHeader()&&e.isSelectedByRowHeader())&&(e.markSource("keyboard"),e.transformEnd(-1,0),e.markEndSource())}},Z8={name:"extendCellsSelectionUpByViewportHeight",callback(n){const{selection:e,rowIndexMapper:t}=n,{to:o}=n.getSelectedRangeActive(),i=Math.max(o.row-n.countVisibleRows(),0),s=t.getNearestNotHiddenIndex(i,1);if(s!==null){const r=n._createCellCoords(s,o.col),a=o.row-n.getFirstFullyVisibleRow(),l=Math.max(r.row-a,0);e.markSource("keyboard"),e.setRangeEnd(r,n.getActiveSelectionLayerIndex()),e.markEndSource(),n.scrollViewportTo({row:l,verticalSnap:"top",horizontalSnap:"start"})}}};function Q8(){return[W8,$8,F8,B8,V8,z8,U8,Y8,G8,j8,q8,K8,X8,Z8]}const J8={name:"moveCellSelectionDown",callback({selection:n}){n.markSource("keyboard"),n.transformStart(1,0),n.markEndSource()}},eq={name:"moveCellSelectionDownByViewportHeight",callback(n){const{selection:e}=n,{navigableHeaders:t}=n.getSettings(),o=t?n.countColHeaders():0,{row:i}=n.getSelectedRangeActive().highlight;let s=n.countVisibleRows()+o;s=s===0?1:s,i===n.countRows()-1?s=1:i+s>n.countRows()&&(s=n.countRows()-i-1),e.markSource("keyboard"),e.transformStart(s,0),e.markEndSource(),n.getSelectedRangeActive().highlight.row<0&&n.scrollViewportTo({row:0})}},tq={name:"moveCellSelectionInlineEnd",callback(n,e){const{selection:t}=n,o=n.getSettings(),i=n.getSelectedRange(),s=n.getSelectedRangeActive(),r=typeof o.tabMoves=="function"?o.tabMoves(e):o.tabMoves;t.markSource("keyboard"),(i.some(a=>t.isMultiple(a))||i.length>1)&&!s.isHeader()&&n.countRenderedCols()>0&&n.countRenderedRows()>0?t.transformFocus(-r.row,-r.col):t.transformStart(-r.row,-r.col),t.markEndSource()}},nq={name:"moveCellSelectionInlineStart",callback(n,e){const{selection:t}=n,o=n.getSettings(),i=n.getSelectedRange(),s=n.getSelectedRangeActive(),r=typeof o.tabMoves=="function"?o.tabMoves(e):o.tabMoves;t.markSource("keyboard"),(i.some(a=>t.isMultiple(a))||i.length>1)&&!s.isHeader()&&n.countRenderedCols()>0&&n.countRenderedRows()>0?t.transformFocus(r.row,r.col):t.transformStart(r.row,r.col),t.markEndSource()}},oq={name:"moveCellSelectionLeft",callback(n){const{selection:e}=n;e.markSource("keyboard"),e.transformStart(0,-1*n.getDirectionFactor()),e.markEndSource()}},iq={name:"moveCellSelectionRight",callback(n){const{selection:e}=n;e.markSource("keyboard"),e.transformStart(0,n.getDirectionFactor()),e.markEndSource()}},sq={name:"moveCellSelectionToMostBottom",callback(n){const{selection:e}=n,{col:t}=n.getSelectedRangeActive().highlight;let o=n.rowIndexMapper.getNearestNotHiddenIndex(n.countRows()-1,-1);o===null&&(o=-1),e.setRangeStart(n._createCellCoords(o,t))}},rq={name:"moveCellSelectionToMostBottomInlineEnd",callback(n){const{selection:e,rowIndexMapper:t,columnIndexMapper:o}=n,i=parseInt(n.getSettings().fixedRowsBottom,10),s=t.getNearestNotHiddenIndex(n.countRows()-i-1,-1),r=o.getNearestNotHiddenIndex(n.countCols()-1,-1);e.markSource("keyboard"),e.setRangeStart(n._createCellCoords(s,r)),e.markEndSource()}},aq={name:"moveCellSelectionToMostInlineEnd",callback(n){const{selection:e,columnIndexMapper:t}=n;e.markSource("keyboard"),e.setRangeStart(n._createCellCoords(n.getSelectedRangeActive().highlight.row,t.getNearestNotHiddenIndex(n.countCols()-1,-1))),e.markEndSource()}},lq={name:"moveCellSelectionToMostInlineStart",callback(n){const{selection:e,columnIndexMapper:t}=n,o=parseInt(n.getSettings().fixedColumnsStart,10),i=n.getSelectedRangeActive().highlight.row,s=t.getNearestNotHiddenIndex(o,1);e.markSource("keyboard"),e.setRangeStart(n._createCellCoords(i,s)),e.markEndSource()}},hq={name:"moveCellSelectionToMostLeft",callback(n){const{selection:e,columnIndexMapper:t}=n,o=n.getSelectedRangeActive().highlight.row;let i=t.getNearestNotHiddenIndex(...n.isRtl()?[n.countCols()-1,-1]:[0,1]);i===null&&(i=n.isRtl()?-1:-n.countRowHeaders()),e.markSource("keyboard"),e.setRangeStart(n._createCellCoords(o,i)),e.markEndSource()}},cq={name:"moveCellSelectionToMostRight",callback(n){const{selection:e,columnIndexMapper:t}=n,{row:o}=n.getSelectedRangeActive().highlight;let i=t.getNearestNotHiddenIndex(...n.isRtl()?[0,1]:[n.countCols()-1,-1]);i===null&&(i=n.isRtl()?-n.countRowHeaders():-1),e.markSource("keyboard"),e.setRangeStart(n._createCellCoords(o,i)),e.markEndSource()}},dq={name:"moveCellSelectionToMostTop",callback(n){const{selection:e}=n,{col:t}=n.getSelectedRangeActive().highlight;let o=n.rowIndexMapper.getNearestNotHiddenIndex(0,1);o===null&&(o=-n.countColHeaders()),e.markSource("keyboard"),e.setRangeStart(n._createCellCoords(o,t)),e.markEndSource()}},uq={name:"moveCellSelectionToMostTopInlineStart",callback(n){const{selection:e,rowIndexMapper:t,columnIndexMapper:o}=n,i=parseInt(n.getSettings().fixedRowsTop,10),s=parseInt(n.getSettings().fixedColumnsStart,10),r=t.getNearestNotHiddenIndex(i,1),a=o.getNearestNotHiddenIndex(s,1);e.markSource("keyboard"),e.setRangeStart(n._createCellCoords(r,a)),e.markEndSource()}},fq={name:"moveCellSelectionUp",callback({selection:n}){n.markSource("keyboard"),n.transformStart(-1,0),n.markEndSource()}},gq={name:"moveCellSelectionUpByViewportHight",callback(n){const{selection:e}=n,{navigableHeaders:t}=n.getSettings(),o=t?n.countColHeaders():0,{row:i}=n.getSelectedRangeActive().highlight;let s=n.countVisibleRows()+o;s=s===0?-1:-s,i===-o?s=-1:i+s<o&&(s=-(i+o)),e.markSource("keyboard"),e.transformStart(s,0),e.markEndSource(),n.getSelectedRangeActive().highlight.row<0&&n.scrollViewportTo({row:0})}};function pq(){return[J8,eq,tq,nq,oq,iq,sq,rq,aq,lq,hq,cq,dq,uq,fq,gq]}const mq={name:"emptySelectedCells",callback(n){n.emptySelectedCells(),n._getEditorManager().prepareEditor()}},wq={name:"scrollToFocusedCell",callback(n){const{highlight:e}=n.getSelectedRangeActive(),t=n.getFirstFullyVisibleRow()-1,o=n.getFirstFullyVisibleColumn()-1,i=n.getLastFullyVisibleRow()+1,s=n.getLastFullyVisibleColumn()+1,r=n._createCellCoords(t,o),a=n._createCellCoords(i,s);if(!n._createCellRange(r,r,a).includes(e)&&(e.row>=0||e.col>=0)){const h={};if(e.col>=0){const c=Math.floor(n.countVisibleCols()/2);h.col=Math.max(e.col-c,0)}if(e.row>=0){const c=Math.floor(n.countVisibleRows()/2);h.row=Math.max(e.row-c,0)}n.scrollViewportTo({...h,verticalSnap:"top",horizontalSnap:"start"})}}},bq={name:"selectAllCells",callback({selection:n}){n.markSource("keyboard"),n.selectAll(!0,!0,{disableHeadersHighlight:!0}),n.markEndSource()}},Cq={name:"selectAllCellsAndHeaders",callback({selection:n}){n.markSource("keyboard"),n.selectAll(!0,!0,{disableHeadersHighlight:!1}),n.markEndSource()}},yq={name:"populateSelectedCellsData",callback(n){const e=n.getSelectedRange(),{row:t,col:o}=e[e.length-1].highlight.normalize(),i=n.getDataAtCell(t,o),s=new Map;for(let r=0;r<e.length;r++)e[r].forAll((a,l)=>{if(a>=0&&l>=0&&(a!==t||l!==o)){const{readOnly:h}=n.getCellMeta(a,l);h||s.set(`${a}x${l}`,[a,l,i])}});n.setDataAtCell(Array.from(s.values()))}},_q={name:"tabNavigation",callback(n){const e={wrapped:!1,flipped:!1};let t=!1,o=!1;return n.addHook("afterSelection",(i,s,r,a,l)=>{t&&(e.wrapped&&e.flipped||o)&&(o=!1,l.value=!0)}),n.addHook("beforeRowWrap",(i,s,r)=>{e.wrapped=!0,e.flipped=r}),{before(){const{tabNavigation:i}=n.getSettings();t=!0,i||(o=!0)},after(i){const{tabNavigation:s,autoWrapRow:r}=n.getSettings();if(t=!1,!s||!n.selection.isSelected()||r&&e.wrapped&&e.flipped||!r&&e.wrapped)return e.wrapped=!1,e.flipped=!1,n.deselectCell(),!1;i.preventDefault()}}}},Sq=[...L8(),...Q8(),...pq(),mq,wq,bq,Cq,yq,_q];function sV(n){const e={};return Sq.forEach(({name:t,callback:o})=>{e[t]=(...i)=>o(n,...i)}),e}function vq(n){const e=n.getShortcutManager().addContext(x8),t=sV(n),o={group:fl};e.addShortcuts([{keys:[["Enter"],["Enter","Shift"]],callback:(i,s)=>t.editorCloseAndSaveByEnter(i,s)},{keys:[["Enter","Control/Meta"],["Enter","Control/Meta","Shift"]],captureCtrl:!0,callback:(i,s)=>t.editorCloseAndSaveByEnter(i,s)},{keys:[["Tab"],["Tab","Shift"],["PageDown"],["PageUp"]],forwardToContext:n.getShortcutManager().getContext(Sh),callback:(i,s)=>t.editorCloseAndSave(i,s)},{keys:[["ArrowDown"],["ArrowUp"],["ArrowLeft"],["ArrowRight"]],preventDefault:!1,callback:(i,s)=>t.editorCloseAndSaveByArrowKeys(i,s)},{keys:[["Escape"],["Escape","Control/Meta"]],callback:()=>t.editorCloseWithoutSaving()}],o)}function Rq(n){const e=n.getShortcutManager().addContext(Sh),t=sV(n),o={runOnlyIf:()=>{const{navigableHeaders:s}=n.getSettings();return ee(n.getSelected())&&(s||!s&&n.countRenderedRows()>0&&n.countRenderedCols()>0)},group:Rp};e.addShortcuts([{keys:[["F2"]],callback:s=>t.editorFastOpen(s)},{keys:[["Enter"],["Enter","Shift"]],callback:(s,r)=>t.editorOpen(s,r)},{keys:[["Backspace"],["Delete"]],callback:()=>t.emptySelectedCells()}],{group:fl,runOnlyIf:()=>ee(n.getSelected())}),e.addShortcuts([{keys:[["Control/Meta","A"]],callback:()=>t.selectAllCells(),runOnlyIf:()=>ee(n.getSelected())&&!n.getSelectedRangeActive()?.highlight.isHeader()},{keys:[["Control/Meta","A"]],callback:()=>{},runOnlyIf:()=>ee(n.getSelected())&&n.getSelectedRangeActive()?.highlight.isHeader(),preventDefault:!0},{keys:[["Control/Meta","Shift","Space"]],callback:()=>t.selectAllCellsAndHeaders()},{keys:[["Control/Meta","Enter"]],callback:()=>t.populateSelectedCellsData(),runOnlyIf:()=>ee(n.getSelected())&&!n.getSelectedRangeActive().highlight.isHeader()&&n.getSelectedRangeActive().getCellsCount()>1},{keys:[["Control","Space"]],captureCtrl:!0,callback:()=>t.extendCellsSelectionToColumns()},{keys:[["Shift","Space"]],stopPropagation:!0,callback:()=>t.extendCellsSelectionToRows()},{keys:[["ArrowUp"]],callback:()=>t.moveCellSelectionUp()},{keys:[["ArrowUp","Control/Meta"]],captureCtrl:!0,callback:()=>t.moveCellSelectionToMostTop()},{keys:[["ArrowUp","Shift"]],callback:()=>t.extendCellsSelectionUp()},{keys:[["ArrowUp","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>t.extendCellsSelectionToMostTop(),runOnlyIf:()=>ee(n.getSelected())&&!(n.selection.isSelectedByCorner()||n.selection.isSelectedByColumnHeader())},{keys:[["ArrowDown"]],callback:()=>t.moveCellSelectionDown()},{keys:[["ArrowDown","Control/Meta"]],captureCtrl:!0,callback:()=>t.moveCellSelectionToMostBottom()},{keys:[["ArrowDown","Shift"]],callback:()=>t.extendCellsSelectionDown()},{keys:[["ArrowDown","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>t.extendCellsSelectionToMostBottom(),runOnlyIf:()=>ee(n.getSelected())&&!(n.selection.isSelectedByCorner()||n.selection.isSelectedByColumnHeader())},{keys:[["ArrowLeft"]],callback:()=>t.moveCellSelectionLeft()},{keys:[["ArrowLeft","Control/Meta"]],captureCtrl:!0,callback:()=>t.moveCellSelectionToMostLeft()},{keys:[["ArrowLeft","Shift"]],callback:()=>t.extendCellsSelectionLeft()},{keys:[["ArrowLeft","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>t.extendCellsSelectionToMostLeft(),runOnlyIf:()=>ee(n.getSelected())&&!(n.selection.isSelectedByCorner()||n.selection.isSelectedByRowHeader())},{keys:[["ArrowRight"]],callback:()=>t.moveCellSelectionRight()},{keys:[["ArrowRight","Control/Meta"]],captureCtrl:!0,callback:()=>t.moveCellSelectionToMostRight()},{keys:[["ArrowRight","Shift"]],callback:()=>t.extendCellsSelectionRight()},{keys:[["ArrowRight","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>t.extendCellsSelectionToMostRight(),runOnlyIf:()=>ee(n.getSelected())&&!(n.selection.isSelectedByCorner()||n.selection.isSelectedByRowHeader())},{keys:[["Home"]],captureCtrl:!0,callback:()=>t.moveCellSelectionToMostInlineStart(),runOnlyIf:()=>ee(n.getSelected())&&n.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["Home","Shift"]],callback:()=>t.extendCellsSelectionToMostInlineStart()},{keys:[["Home","Control/Meta"]],captureCtrl:!0,callback:()=>t.moveCellSelectionToMostTopInlineStart(),runOnlyIf:()=>ee(n.getSelected())&&n.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End"]],captureCtrl:!0,callback:()=>t.moveCellSelectionToMostInlineEnd(),runOnlyIf:()=>ee(n.getSelected())&&n.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End","Shift"]],callback:()=>t.extendCellsSelectionToMostInlineEnd()},{keys:[["End","Control/Meta"]],captureCtrl:!0,callback:()=>t.moveCellSelectionToMostBottomInlineEnd(),runOnlyIf:()=>ee(n.getSelected())&&n.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["PageUp"]],callback:()=>t.moveCellSelectionUpByViewportHight()},{keys:[["PageUp","Shift"]],callback:()=>t.extendCellsSelectionUpByViewportHeight()},{keys:[["PageDown"]],callback:()=>t.moveCellSelectionDownByViewportHeight()},{keys:[["PageDown","Shift"]],callback:()=>t.extendCellsSelectionDownByViewportHeight()},{keys:[["Tab"]],preventDefault:!1,callback:s=>t.moveCellSelectionInlineStart(s)},{keys:[["Shift","Tab"]],preventDefault:!1,callback:s=>t.moveCellSelectionInlineEnd(s)},{keys:[["Control/Meta","Backspace"]],callback:()=>t.scrollToFocusedCell()}],o);const i=t.tabNavigation();e.addShortcuts([{keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:Rp,group:zC,position:"before",callback:s=>i.before(s)},{keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:Rp,group:zC,callback:s=>i.after(s),position:"after"}])}function Eq(n){[Rq,vq].forEach(e=>e(n))}function kq(n){const e=T8(n),t={wrapped:!1,flipped:!1};let o,i=!0,s=!1;n.addHook("afterSelection",()=>{i&&(o=n.getSelectedRangeActive()?.highlight)}),n.addHook("beforeRowWrap",(l,h,c)=>{t.wrapped=!0,t.flipped=c}),n.addHook("beforeEmptyDataStateShow",()=>{s=!0}),n.addHook("beforeEmptyDataStateHide",()=>{s=!1}),n.getShortcutManager().getContext(Sh).addShortcuts([{keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:Rp,group:zC,position:"before",callback(){const{tabNavigation:l}=n.getSettings();n.getSelectedRangeActive()&&!l&&(i=!1)}},{keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:Rp,group:zC,callback(l){const{tabNavigation:h,autoWrapRow:c}=n.getSettings();i=!0,(!h||!n.selection.isSelected()||c&&t.wrapped&&t.flipped||!c&&t.wrapped)&&(c&&t.wrapped&&t.flipped&&(o=l.shiftKey?FE(n):BE(n)),t.wrapped=!1,t.flipped=!1)},position:"after"}]);const a=n.rootGridElement??n.rootElement;n.getFocusScopeManager().registerScope("grid",a,{contains:l=>a===l||a.contains(l)?!0:l.closest(".htMenu")!==null?!1:n.rootPortalElement.contains(l),runOnlyIf:()=>{const{navigableHeaders:l}=n.getSettings();return(s||!l)&&n.countRenderedRows()===0&&n.countRenderedCols()===0&&n.countRowHeaders()>0&&n.countColHeaders()>0?!1:!l&&n.countRenderedRows()>0&&n.countRenderedCols()>0||l&&(n.countRowHeaders()>0||n.countColHeaders()>0)},onActivate:l=>{if(l==="tab_from_above"){const h=e(o)??FE(n);h&&n.runHooks("modifyFocusOnTabNavigation","from_above",h)!==!1&&(n.selectCell(h.row,h.col),n.getFocusManager().focusOnHighlightedCell())}else if(l==="tab_from_below"){const h=e(o)??BE(n);h&&n.runHooks("modifyFocusOnTabNavigation","from_below",h)!==!1&&n.selectCell(h.row,h.col)}}})}function Tq(n){[kq].forEach(e=>e(n))}const CA=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"]]),Mw=n=>n.map(e=>{const t=e.toLowerCase();return CA.has(t)?CA.get(t):t}).sort().join("+"),xq=n=>n.split("+"),yA=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"]]),ip=({which:n,key:e})=>{if(yA.has(n))return yA.get(n);const t=String.fromCharCode(n).toLowerCase();return/^[a-z0-9]$/.test(t)?t:e.toLowerCase()},Mq=["meta","alt","shift","control"],sp=n=>Mq.includes(n),Nu=(n,e=!1)=>{const t=[];return n.altKey&&t.push("alt"),e&&(n.ctrlKey||n.metaKey)?t.push("control/meta"):(n.ctrlKey&&t.push("control"),n.metaKey&&t.push("meta")),n.shiftKey&&t.push("shift"),t},Iq=(n,e)=>{if(typeof n.key!="string")return[];const t=ip(n),o=sp(t),i=o?[]:Nu(n),r=[[t].concat(i)];return o||((typeof e=="function"?e():!1)?i.includes("meta"):i.includes("control"))&&r.push([t].concat(Nu(n,!0))),r},rV=Symbol("shortcut-context");function aV(n){return ie(n)&&n.__kindOf===rV}const Hq=(n,e="table")=>{const t=Wm({errorIdExists:h=>`The "${h}" shortcut is already registered in the "${n}" context.`}),o=({keys:h,callback:c,group:d,runOnlyIf:u=()=>!0,captureCtrl:f=!1,preventDefault:p=!0,stopPropagation:C=!1,relativeToGroup:y,position:_,forwardToContext:T}={})=>{en(d)&&Y("You need to define the shortcut's group."),_e(c)===!1&&Y("The shortcut's callback needs to be a function."),Array.isArray(h)===!1&&Y(pt`Pass the shortcut\'s keys as an array of arrays,\x20
44
- using the KeyboardEvent.key properties:\x20
45
- https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.`);const P={callback:c,group:d,runOnlyIf:u,captureCtrl:f,preventDefault:p,stopPropagation:C};ee(y)&&(P.relativeToGroup=y,P.position=_),aV(T)&&(P.forwardToContext=T),h.forEach($=>{const F=Mw($);if(t.hasItem(F)){const I=t.getItem(F);let j=I.findIndex(U=>U.group===y);j!==-1?_==="before"?j-=1:j+=1:j=I.length,I.splice(j,0,P)}else t.addItem(F,[P])})},i=(h,c={})=>{h.forEach(d=>{nt(c,(u,f)=>{Object.prototype.hasOwnProperty.call(d,f)===!1&&(d[f]=c[f])}),o(d)})},s=h=>{const c=Mw(h);t.removeItem(c)};return{__kindOf:rV,scope:e,addShortcut:o,addShortcuts:i,getShortcuts:h=>{const c=Mw(h),d=t.getItem(c);return ee(d)?d.slice():[]},hasShortcut:h=>{const c=Mw(h);return t.hasItem(c)},removeShortcutsByKeys:s,removeShortcutsByGroup:h=>{t.getItems().forEach(([d,u])=>{const f=u.filter(p=>p.group!==h);f.length===0?s(xq(d)):(u.length=0,u.push(...f))})}}};function Aq(){const n=new Set;return{press(e){n.add(e)},release(e){n.delete(e)},releaseAll(){n.clear()},isPressed(e){return n.has(e)}}}const Qf=Aq(),Jf=[];let Iw=0;function Oq(n,e,t,o,i,s=null){const r=u=>{if(e(u)!==!1){if(t(u)===!1||u.keyCode===229||typeof u.key!="string"||th(u))return;const P=ip(u);let $=[];sp(P)||($=Nu(u));const F=[P].concat($);let N=i(u,F);!N&&(Xg()&&$.includes("meta")||!Xg()&&$.includes("control"))&&(N=i(u,[P].concat(Nu(u,!0)))),o(u);return}if(_e(s)===!1||u.keyCode===229||typeof u.key!="string"||th(u))return;const p=ip(u);let C=[];sp(p)||(C=Nu(u));const y=[p].concat(C);let _=s(u,y);!_&&(Xg()&&C.includes("meta")||!Xg()&&C.includes("control"))&&(_=s(u,[p].concat(Nu(u,!0)))),o(u)},a=u=>{if(typeof u.key=="string"){const f=ip(u);sp(f)&&Qf.press(f)}},l=u=>{if(typeof u.key=="string"){const f=ip(u);sp(f)&&Qf.release(f)}},h=()=>{Qf.releaseAll()};return{mount:()=>{let u=n;for(Iw+=1;u;)Iw===1&&(u.document.documentElement.addEventListener("keydown",a),Jf.push({event:"keydown",listener:a}),u.document.documentElement.addEventListener("keyup",l),Jf.push({event:"keyup",listener:l})),u.document.documentElement.addEventListener("keydown",r),u.document.documentElement.addEventListener("blur",h),u=yh(u)},unmount:()=>{let u=n;for(Iw-=1;u;){if(Iw===0){for(let f=0;f<Jf.length;f++){const{event:p,listener:C}=Jf[f];u.document.documentElement.removeEventListener(p,C)}Jf.length=0}u.document.documentElement.removeEventListener("keydown",r),u.document.documentElement.removeEventListener("blur",h),u=yh(u)}},isPressed:u=>Qf.isPressed(u),releasePressedKeys:()=>Qf.releaseAll()}}const Dq=({ownerWindow:n,handleEvent:e,beforeKeyDown:t,afterKeyDown:o})=>{const i=Wm({errorIdExists:_=>`The "${_}" context name is already registered.`});let s="grid";const r=(_,T="table")=>{const P=Hq(_,T);return i.addItem(_,P),P},a=()=>s,l=_=>i.getItem(_),h=(_,T="table")=>l(_)??r(_,T),c=_=>{i.hasItem(_)||Y(pt`You've tried to activate the "${_}" shortcut context\x20
46
- that does not exist. Before activation, register the context using the "addContext" method.`),s=_};let d=!1;const u=(_,T,P=a())=>{const $=aV(P)?P:l(P);let F=!1;if(!$.hasShortcut(T))return F;const N=$.getShortcuts(T);for(let I=0;I<N.length;I++){const{callback:j,runOnlyIf:U,preventDefault:G,stopPropagation:te,captureCtrl:Q,forwardToContext:be}=N[I];if(U(_)===!0){if(d=Q,F=j(_,T)===!1,d=!1,G&&_.preventDefault(),te&&(es(_),_.stopPropagation()),F)break;be&&u(_,T,be)}}return F},C=Oq(n,_=>{const T=a(),P=l(T);return e(_,P?.scope??"table")},t,o,u,(_,T)=>{const P=i.getItems();for(let $=0;$<P.length;$+=1){const[,F]=P[$];if(F.scope==="global"&&u(_,T,F))return!0}return!1});return C.mount(),{addContext:r,getActiveContextName:a,getContext:l,getOrCreateContext:h,setActiveContextName:c,hasEventShortcut:(_,T)=>{const P=l(_);return P?Iq(T,Xg).some(F=>P.hasShortcut(F)):!1},isCtrlPressed:()=>!d&&(C.isPressed("control")||C.isPressed("meta")),releasePressedKeys:()=>C.releasePressedKeys(),destroy:()=>C.unmount()}};function LS(n){const{classNames:e}=D4(n,/ht-theme-[a-zA-Z0-9_-]+/);return e.pop()}const Nq=`/*!
47
- * Copyright (c) HANDSONCODE sp. z o. o.
48
- *
49
- * HANDSONTABLE is a software distributed by HANDSONCODE sp. z o. o., a Polish corporation based in
50
- * Gdynia, Poland, at Aleja Zwyciestwa 96-98, registered by the District Court in Gdansk under number
51
- * 538651, EU tax ID number: PL5862294002, share capital: PLN 62,800.00.
52
- *
53
- * This software is protected by applicable copyright laws, including international treaties, and dual-
54
- * licensed - depending on whether your use for commercial purposes, meaning intended for or
55
- * resulting in commercial advantage or monetary compensation, or not.
56
- *
57
- * If your use is strictly personal or solely for evaluation purposes, meaning for the purposes of testing
58
- * the suitability, performance, and usefulness of this software outside the production environment,
59
- * you agree to be bound by the terms included in the "handsontable-non-commercial-license.pdf" file.
60
- *
61
- * Your use of this software for commercial purposes is subject to the terms included in an applicable
62
- * license agreement.
63
- *
64
- * In any case, you must not make any such use of this software as to develop software which may be
65
- * considered competitive with this software.
66
- *
67
- * UNLESS EXPRESSLY AGREED OTHERWISE, HANDSONCODE PROVIDES THIS SOFTWARE ON AN "AS IS"
68
- * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, AND IN NO EVENT AND UNDER NO
69
- * LEGAL THEORY, SHALL HANDSONCODE BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT,
70
- * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
71
- * USE OR INABILITY TO USE THIS SOFTWARE.
72
- *
73
- * Version: 17.1.0
74
- * Release date: 19/05/2026 (built at 19/05/2026 14:51:40)
75
- */
76
- .ht-root-wrapper{font-family:var(--ht-font-family),-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;flex-direction:column;height:100%;display:flex;position:relative}.htFocusCatcher{opacity:0;z-index:-1;border:0;outline:0;width:0;height:0;margin:0;padding:0;position:absolute;display:block!important}.ht-grid{flex:auto;min-height:0}.htScrollbarTest{scrollbar-width:auto;scrollbar-color:var(--ht-scrollbar-thumb-color)var(--ht-scrollbar-track-color)}.htScrollbarSafariTest::-webkit-scrollbar{width:9px;height:9px}.handsontable{font-family:var(--ht-font-family),-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:var(--ht-font-size);line-height:var(--ht-line-height);font-weight:var(--ht-font-weight);letter-spacing:var(--ht-letter-spacing);color:var(--ht-foreground-color);touch-action:manipulation;position:relative}.handsontable .wtHolder{scrollbar-width:auto;scrollbar-color:var(--ht-scrollbar-thumb-color)var(--ht-scrollbar-track-color)}.handsontable .wtHolder::-webkit-scrollbar{width:9px;height:9px}.handsontable .wtHolder::-webkit-scrollbar-track{background:var(--ht-scrollbar-track-color);border-radius:var(--ht-scrollbar-border-radius)}.handsontable .wtHolder::-webkit-scrollbar-thumb{background-color:var(--ht-scrollbar-thumb-color);border-radius:var(--ht-scrollbar-border-radius)}.handsontable .wtHolder::-webkit-scrollbar-corner{background:var(--ht-scrollbar-track-color)}.handsontable .wtHolder:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))::-webkit-scrollbar-corner{border-bottom-right-radius:var(--ht-scrollbar-border-radius)}.handsontable .wtHolder:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))::-webkit-scrollbar-corner{border-bottom-left-radius:var(--ht-scrollbar-border-radius)}.handsontable.ht-wrapper{border-radius:var(--ht-wrapper-border-radius,0);width:100%;height:100%}.handsontable.ht-wrapper:not(.htFirstDatasetColumnNotRendered) td:first-of-type{border-inline-start-width:1px}.handsontable.ht-wrapper:before{content:"";border:var(--ht-wrapper-border-width)solid var(--ht-wrapper-border-color);border-radius:var(--ht-wrapper-border-radius,0);z-index:999;pointer-events:none;display:block;position:absolute;inset:0;overflow:hidden}.handsontable.htGhostTable.htNestedHeaders table{border-spacing:0;border-collapse:collapse}.handsontable.htGhostTable table thead th{border-bottom-width:0}.handsontable.htGhostTable table tbody tr:first-of-type th:first-child,.handsontable.htGhostTable table tbody tr:first-of-type td:first-child{height:calc(var(--ht-cell-vertical-padding)*2 + var(--ht-line-height) + 1px)}.handsontable.htGhostTable table tbody tr th,.handsontable.htGhostTable table tbody tr td{height:calc(var(--ht-cell-vertical-padding)*2 + var(--ht-line-height) + 1px);border-top-width:0}.handsontable.htHasScrollX:not(.htHorizontallyScrollableByWindow):not(.htScrollbarHidden) .ht_master .wtHolder,.handsontable.htHasScrollY:not(.htVerticallyScrollableByWindow):not(.htScrollbarHidden) .ht_master .wtHolder{border-radius:var(--ht-wrapper-border-radius,0)}.handsontable:not(.htHorizontallyScrollableByWindow).htPagination .ht_master .wtHolder,.handsontable:not(.htHorizontallyScrollableByWindow).htHasScrollX .ht_master .wtHolder,.handsontable:not(.htHorizontallyScrollableByWindow).htHasScrollY .ht_master .wtHolder,.handsontable:not(.htVerticallyScrollableByWindow).htPagination .ht_master .wtHolder,.handsontable:not(.htVerticallyScrollableByWindow).htHasScrollX .ht_master .wtHolder,.handsontable:not(.htVerticallyScrollableByWindow).htHasScrollY .ht_master .wtHolder{background-color:var(--ht-background-color)}.handsontable tr.ht__row_even th{background-color:var(--ht-row-header-even-background-color)}.handsontable tr.ht__row_even td{background-color:var(--ht-row-cell-even-background-color)}.handsontable tr.ht__row_odd th{background-color:var(--ht-row-header-odd-background-color)}.handsontable tr.ht__row_odd td{background-color:var(--ht-row-cell-odd-background-color)}.handsontable th,.handsontable td{height:calc(var(--ht-cell-vertical-padding)*2 + var(--ht-line-height) + 1px);padding:var(--ht-cell-vertical-padding)var(--ht-cell-horizontal-padding);vertical-align:top;border-top-width:0;border-inline-width:0 1px;font-size:var(--ht-font-size);line-height:var(--ht-line-height);white-space:pre-wrap;empty-cells:show;box-sizing:border-box;color:var(--ht-foreground-color);border-style:solid;border-bottom-width:1px;border-top-color:var(--ht-cell-vertical-border-color);border-bottom-color:var(--ht-cell-vertical-border-color);border-inline-start-color:var(--ht-cell-horizontal-border-color);border-inline-end-color:var(--ht-cell-horizontal-border-color);outline:0;overflow:hidden}.handsontable th.invisibleSelection,.handsontable td.invisibleSelection{outline:none}.handsontable th.invisibleSelection::selection,.handsontable td.invisibleSelection::selection{background:0 0}.handsontable th{text-align:center;font-weight:var(--ht-header-font-weight);white-space:nowrap;color:var(--ht-header-foreground-color);background-color:var(--ht-header-background-color);position:relative;overflow:visible}.handsontable th:last-child{border-inline-width:0 1px;border-bottom-width:1px;border-inline-end-color:var(--ht-border-color)}.handsontable th:last-child.ht__active_highlight{border-inline-end-color:var(--ht-header-active-border-color)}.handsontable th:first-child{border-inline-start-color:var(--ht-border-color)}.handsontable th:first-child.ht__active_highlight{border-inline-start-color:var(--ht-header-active-border-color)}.handsontable th:first-child,.handsontable th:nth-child(2){border-inline-start-width:1px}.handsontable th.current{box-shadow:inset 0 0 0 1px var(--ht-cell-selection-border-color)}.handsontable th.active{color:var(--ht-header-active-foreground-color);background-color:var(--ht-header-active-background-color)}.handsontable th.ht__highlight{color:var(--ht-header-highlighted-foreground-color);background-color:var(--ht-header-highlighted-background-color)}.handsontable th.ht__active_highlight{border-color:var(--ht-header-active-border-color);color:var(--ht-header-active-foreground-color);background-color:var(--ht-header-active-background-color)}.handsontable tbody tr.ht__row_odd th.ht__highlight,.handsontable tbody tr.ht__row_even th.ht__highlight{color:var(--ht-header-row-highlighted-foreground-color);background-color:var(--ht-header-row-highlighted-background-color)}.handsontable tbody tr.ht__row_odd th.ht__active_highlight,.handsontable tbody tr.ht__row_even th.ht__active_highlight{color:var(--ht-header-row-active-foreground-color);background-color:var(--ht-header-row-active-background-color)}.handsontable tbody tr:first-of-type th:first-child:empty:after,.handsontable tbody tr:first-of-type td:first-child:empty:after{content:"";min-height:var(--ht-line-height);display:block}.handsontable tbody tr th{color:var(--ht-header-row-foreground-color);background-color:var(--ht-header-row-background-color);padding:0}.handsontable tbody tr th.ht__active_highlight{box-shadow:0 -1px 0 0 var(--ht-header-active-border-color)}.handsontable tbody tr th .relative{padding:var(--ht-cell-vertical-padding)var(--ht-cell-horizontal-padding);min-height:100%}.handsontable tbody tr td:first-child{border-inline-start-color:var(--ht-border-color)}.handsontable tbody tr td:last-child{border-inline-end-color:var(--ht-border-color)}.handsontable thead tr th{padding:0}.handsontable thead tr th.ht__active_highlight{box-shadow:-1px 0 0 0 var(--ht-header-active-border-color)}.handsontable thead tr th .relative{padding:var(--ht-cell-vertical-padding)var(--ht-cell-horizontal-padding);flex-direction:row;align-items:center;gap:2px;display:flex}.handsontable thead tr th .relative .colHeader{text-overflow:ellipsis;vertical-align:top;flex:auto;min-width:0;overflow:hidden}.handsontable tr:first-child th,.handsontable tr:first-child td{border-top-color:var(--ht-border-color);border-top-width:1px}.handsontable tr:first-child th.ht__active_highlight,.handsontable tr:first-child td.ht__active_highlight{border-top-color:var(--ht-header-active-border-color)}.handsontable tr:last-child th,.handsontable tr:last-child td{border-bottom-color:var(--ht-border-color)}.handsontable tr:last-child th.ht__active_highlight,.handsontable tr:last-child td.ht__active_highlight{border-bottom-color:var(--ht-header-active-border-color)}.handsontable div[class^=ht_clone] thead .ht__highlight .relative:after{content:"";height:var(--ht-header-highlighted-shadow-size);background-color:var(--ht-accent-color);display:block;position:absolute;bottom:-1px;left:-1px;right:-1px}.handsontable div[class^=ht_clone] thead tr:only-of-type .ht__highlight .relative:after{bottom:0}.handsontable div[class^=ht_clone] tbody .ht__highlight .relative:after{content:"";width:var(--ht-header-highlighted-shadow-size);background-color:var(--ht-accent-color);display:block;position:absolute;top:-1px;bottom:-1px;right:-1px}.handsontable div[class^=ht_clone] td:first-of-type{border-inline-start-width:1px}.handsontable thead tr:not(:last-child) th{overflow:hidden}.handsontable .hide{display:none}.handsontable .relative{box-sizing:border-box;position:relative}.handsontable .wtHider{width:0}.handsontable .wtSpreader{width:0;height:auto;position:relative}.handsontable .htAutoSize{visibility:hidden;position:absolute;top:-99000px;left:-99000px}.handsontable .htTextEllipsis{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.handsontable table,.handsontable tbody,.handsontable thead,.handsontable input,.handsontable textarea,.handsontable div{box-sizing:content-box}.handsontable input,.handsontable textarea{min-height:initial}.handsontable .htCore{border-spacing:0;border-collapse:separate;table-layout:fixed;cursor:default;background-color:var(--ht-background-color);border-width:0;outline-width:0;width:0;margin:0}.handsontable col,.handsontable col.rowHeader{width:64px}.handsontable col.hidden{width:0!important}.handsontable span.colHeader,.handsontable span.rowHeader{font-size:var(--ht-font-size);line-height:var(--ht-line-height);display:inline-block}.handsontable tr.hidden,.handsontable tr.hidden td,.handsontable tr.hidden th{display:none}.handsontable a{color:var(--ht-link-color)}.handsontable a:hover{color:var(--ht-link-hover-color)}.handsontable .ht_clone_top th:nth-child(2),.handsontable .ht_clone_top_inline_start_corner th:nth-child(2){border-inline-width:0 1px}.handsontable.htRowHeaders thead tr th:nth-child(2){border-inline-start-width:1px}.handsontable .ht_master:not(.innerBorderInlineStart):not(.emptyColumns) tbody tr th,.handsontable .ht_master:not(.innerBorderInlineStart):not(.emptyColumns) thead tr th:first-child,.handsontable .ht_master:not(.innerBorderInlineStart):not(.emptyColumns)~.handsontable:not(.htGhostTable) tbody tr th,.handsontable .ht_master:not(.innerBorderInlineStart):not(.emptyColumns)~.handsontable:not(.ht_clone_top):not(.htGhostTable) thead tr th:first-child{border-inline-width:1px 0}.handsontable .ht_master:not(.innerBorderTop):not(.innerBorderBottom) thead tr:last-child th,.handsontable .ht_master:not(.innerBorderTop):not(.innerBorderBottom)~.handsontable thead tr:last-child th,.handsontable .ht_master:not(.innerBorderTop):not(.innerBorderBottom) thead tr.lastChild th,.handsontable .ht_master:not(.innerBorderTop):not(.innerBorderBottom)~.handsontable thead tr.lastChild th{border-bottom-width:0}.handsontable.htAutoRowSize .ht_master.innerBorderTop tbody tr:first-child th,.handsontable.htAutoRowSize .ht_master.innerBorderTop tbody tr:first-child td,.handsontable.htAutoRowSize .ht_master.innerBorderTop~.ht_clone_inline_start tbody tr:first-child th,.handsontable.htAutoRowSize .ht_master.innerBorderTop~.ht_clone_inline_start tbody tr:first-child td{border-top-width:0}.handsontable .ht_master table.htCore>thead,.handsontable .ht_master table.htCore>tbody>tr>th,.handsontable .ht_clone_inline_start table.htCore>thead{visibility:hidden}.ht_master,.ht_clone_inline_start,.ht_clone_top,.ht_clone_bottom,.ht_master .wtHolder,.ht_clone_inline_start .wtHolder,.ht_clone_top .wtHolder,.ht_clone_bottom .wtHolder{overflow:hidden}.ht_master .wtHolder{overflow:auto}[dir=rtl].handsontable td[dir=ltr]{border-inline-width:1px 0}[dir=rtl].handsontable tbody tr td[dir=ltr]:last-child{border-inline-start-color:var(--ht-border-color)}[dir=rtl].handsontable div[class^=ht_clone] tbody .ht__highlight .relative:after{left:-1px;right:auto}.handsontable.ht-wrapper:not(.htColumnHeaders) .ht_master .htCore tbody tr:first-child td:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-left-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper:not(.htColumnHeaders) .ht_master .htCore tbody tr:first-child td:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-right-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper:not(.htColumnHeaders) .ht_master .htCore tbody tr:first-child td:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-right-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper:not(.htColumnHeaders) .ht_master .htCore tbody tr:first-child td:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-left-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper:not(.htColumnHeaders) .ht_clone_top_inline_start_corner .htCore tbody tr:first-child td:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-left-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper:not(.htColumnHeaders) .ht_clone_top_inline_start_corner .htCore tbody tr:first-child td:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-right-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper:not(.htColumnHeaders) .ht_clone_top .htCore tbody tr:first-child td:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-left-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper:not(.htColumnHeaders) .ht_clone_top .htCore tbody tr:first-child td:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-right-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper:not(.htColumnHeaders) .ht_clone_top .htCore tbody tr:first-child td:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-right-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper:not(.htColumnHeaders) .ht_clone_top .htCore tbody tr:first-child td:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-left-radius:var(--ht-wrapper-border-radius)}:is(.handsontable.ht-wrapper:not(.htColumnHeaders) .ht_clone_inline_start .htCore tbody tr:first-child th:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper:not(.htColumnHeaders) .ht_clone_inline_start .htCore tbody tr:first-child td:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-top-left-radius:var(--ht-wrapper-border-radius)}:is(.handsontable.ht-wrapper:not(.htColumnHeaders) .ht_clone_inline_start .htCore tbody tr:first-child th:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper:not(.htColumnHeaders) .ht_clone_inline_start .htCore tbody tr:first-child td:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-top-right-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_master .htCore{border-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_master .htCore thead tr:first-child th:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-left-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_master .htCore thead tr:first-child th:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-right-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_master .htCore thead tr:first-child th:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-right-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_master .htCore thead tr:first-child th:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-left-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_master .htCore thead tr:last-child th:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-bottom-left-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_master .htCore thead tr:last-child th:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-bottom-right-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_master .htCore thead tr:last-child th:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-bottom-right-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_master .htCore thead tr:last-child th:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-bottom-left-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_master .htCore tbody tr:last-child td:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-bottom-left-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_master .htCore tbody tr:last-child td:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-bottom-right-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_master .htCore tbody tr:last-child td:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-bottom-right-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_master .htCore tbody tr:last-child td:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-bottom-left-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_top_inline_start_corner .htCore:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-left-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_top_inline_start_corner .htCore:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-right-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_top_inline_start_corner .htCore thead tr:first-child th:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-left-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_top_inline_start_corner .htCore thead tr:first-child th:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-right-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_top .htCore:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-left-radius:var(--ht-wrapper-border-radius);border-top-right-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_top .htCore:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-right-radius:var(--ht-wrapper-border-radius);border-top-left-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_top .htCore thead tr:first-child th:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-left-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_top .htCore thead tr:first-child th:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-right-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_top .htCore thead tr:first-child th:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-right-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_top .htCore thead tr:first-child th:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-left-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_inline_start .htCore:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-left-radius:var(--ht-wrapper-border-radius);border-bottom-left-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_inline_start .htCore:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-right-radius:var(--ht-wrapper-border-radius);border-bottom-right-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_inline_start .htCore thead tr:first-child th:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-left-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_inline_start .htCore thead tr:first-child th:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-right-radius:var(--ht-wrapper-border-radius)}:is(.handsontable.ht-wrapper .ht_clone_inline_start .htCore tbody tr:last-child th:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper .ht_clone_inline_start .htCore tbody tr:last-child td:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-bottom-left-radius:var(--ht-wrapper-border-radius)}:is(.handsontable.ht-wrapper .ht_clone_inline_start .htCore tbody tr:last-child th:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper .ht_clone_inline_start .htCore tbody tr:last-child td:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-bottom-right-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_bottom_inline_start_corner .htCore:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-bottom-left-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_bottom_inline_start_corner .htCore:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-bottom-right-radius:var(--ht-wrapper-border-radius)}:is(.handsontable.ht-wrapper .ht_clone_bottom_inline_start_corner .htCore tr:last-child th:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper .ht_clone_bottom_inline_start_corner .htCore tr:last-child td:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-bottom-left-radius:var(--ht-wrapper-border-radius)}:is(.handsontable.ht-wrapper .ht_clone_bottom_inline_start_corner .htCore tr:last-child th:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper .ht_clone_bottom_inline_start_corner .htCore tr:last-child td:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-bottom-right-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_bottom .htCore:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-bottom-right-radius:var(--ht-wrapper-border-radius);border-bottom-left-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_bottom .htCore:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-bottom-left-radius:var(--ht-wrapper-border-radius);border-bottom-right-radius:var(--ht-wrapper-border-radius)}:is(.handsontable.ht-wrapper .ht_clone_bottom .htCore tr:last-child th:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper .ht_clone_bottom .htCore tr:last-child td:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-bottom-left-radius:var(--ht-wrapper-border-radius)}:is(.handsontable.ht-wrapper .ht_clone_bottom .htCore tr:last-child th:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper .ht_clone_bottom .htCore tr:last-child td:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-bottom-right-radius:var(--ht-wrapper-border-radius)}:is(.handsontable.ht-wrapper .ht_clone_bottom .htCore tr:last-child th:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper .ht_clone_bottom .htCore tr:last-child td:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-bottom-right-radius:var(--ht-wrapper-border-radius)}:is(.handsontable.ht-wrapper .ht_clone_bottom .htCore tr:last-child th:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper .ht_clone_bottom .htCore tr:last-child td:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-bottom-left-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper.htHasScrollX .htCore:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htHasScrollX .htCore:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-bottom-right-radius:0;border-bottom-left-radius:0}:is(.handsontable.ht-wrapper.htHasScrollX .htCore thead tr:last-child th:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htHasScrollX .htCore tbody tr:last-child td:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htHasScrollX .htCore tbody tr:last-child th:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-bottom-left-radius:0}:is(.handsontable.ht-wrapper.htHasScrollX .htCore thead tr:last-child th:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htHasScrollX .htCore tbody tr:last-child td:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htHasScrollX .htCore tbody tr:last-child th:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-bottom-right-radius:0}:is(.handsontable.ht-wrapper.htHasScrollX .htCore thead tr:last-child th:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htHasScrollX .htCore tbody tr:last-child td:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htHasScrollX .htCore tbody tr:last-child th:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-bottom-right-radius:0}:is(.handsontable.ht-wrapper.htHasScrollX .htCore thead tr:last-child th:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htHasScrollX .htCore tbody tr:last-child td:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htHasScrollX .htCore tbody tr:last-child th:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-bottom-left-radius:0}.handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-right-radius:0;border-bottom-right-radius:0}.handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-left-radius:0;border-bottom-left-radius:0}:is(.handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore thead tr:first-child th:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore tbody tr:first-child td:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore tbody tr:first-child th:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-top-right-radius:0}:is(.handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore thead tr:first-child th:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore tbody tr:first-child td:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore tbody tr:first-child th:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-top-left-radius:0}:is(.handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore thead tr:last-child th:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore tbody tr:last-child td:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore tbody tr:last-child th:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-bottom-right-radius:0}:is(.handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore thead tr:last-child th:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore tbody tr:last-child td:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore tbody tr:last-child th:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-bottom-left-radius:0}.handsontable.mobile,.handsontable.mobile .wtHolder{-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:#0000;-webkit-overflow-scrolling:touch}.handsontable.mobile .handsontableInput:focus{box-shadow:inset 0 0 0 2px var(--ht-accent-color);-webkit-appearance:none}.handsontable .topSelectionHandle,.handsontable .topSelectionHandle-HitArea,.handsontable .bottomSelectionHandle,.handsontable .bottomSelectionHandle-HitArea{inset-inline-start:-10000px;inset-inline-end:unset;z-index:9999;top:-10000px}.handsontable.hide-tween{animation:.2s forwards opacity-hide}.handsontable.show-tween{animation:.3s forwards opacity-show}.ht_clone_master{z-index:100}.ht_clone_inline_start{z-index:120}.ht_clone_bottom{z-index:130}.ht_clone_bottom_inline_start_corner{z-index:150}.ht_clone_top{z-index:160}.ht_clone_top_inline_start_corner{z-index:180}.ht_editor_hidden{z-index:-1}.ht_editor_visible{z-index:200}.handsontable td.area{position:relative}.handsontable td.area:before{content:"";background:var(--ht-cell-selection-background-color,#1a42e8);position:absolute;inset:0}.handsontable td.area-1{position:relative}.handsontable td.area-1:before{content:"";background:var(--ht-cell-selection-background-color,#1a42e8);position:absolute;inset:0}.handsontable td.area-2{position:relative}.handsontable td.area-2:before{content:"";background:var(--ht-cell-selection-background-color,#1a42e8);position:absolute;inset:0}.handsontable td.area-3{position:relative}.handsontable td.area-3:before{content:"";background:var(--ht-cell-selection-background-color,#1a42e8);position:absolute;inset:0}.handsontable td.area-4{position:relative}.handsontable td.area-4:before{content:"";background:var(--ht-cell-selection-background-color,#1a42e8);position:absolute;inset:0}.handsontable td.area-5{position:relative}.handsontable td.area-5:before{content:"";background:var(--ht-cell-selection-background-color,#1a42e8);position:absolute;inset:0}.handsontable td.area-6{position:relative}.handsontable td.area-6:before{content:"";background:var(--ht-cell-selection-background-color,#1a42e8);position:absolute;inset:0}.handsontable td.area-7{position:relative}.handsontable td.area-7:before{content:"";background:var(--ht-cell-selection-background-color,#1a42e8);position:absolute;inset:0}.handsontable td.area:before{opacity:.14}.handsontable td.area-1:before{opacity:.21}.handsontable td.area-2:before{opacity:.28}.handsontable td.area-3:before{opacity:.35}.handsontable td.area-4:before{opacity:.42}.handsontable td.area-5:before{opacity:.49}.handsontable td.area-6:before{opacity:.56}.handsontable td.area-7:before{opacity:.63}.handsontable td.area{border-color:color-mix(in srgb,var(--ht-border-color),var(--ht-foreground-color)10%)}.handsontable .wtBorder{font-size:0;position:absolute}.handsontable .wtBorder:first-child,.handsontable .wtBorder:nth-child(3){z-index:2}.handsontable .wtBorder:nth-child(2),.handsontable .wtBorder:nth-child(4){z-index:1}.handsontable .wtBorder.hidden{display:none!important}.handsontable .wtBorder.current{z-index:10;background-color:var(--ht-cell-selection-border-color)!important}.handsontable .wtBorder.area{z-index:8;background-color:var(--ht-cell-selection-border-color)!important}.handsontable .wtBorder.fill{z-index:6;background-color:var(--ht-cell-autofill-fill-border-color,#68696c)!important}.handsontable .wtBorder.corner{cursor:crosshair;z-index:10;font-size:0;border-radius:var(--ht-cell-autofill-border-radius)!important;background-color:var(--ht-cell-autofill-background-color,#1a42e8)!important;border-color:var(--ht-cell-autofill-border-color)!important}.handsontable .wtBorder.corner:after{content:"";border-radius:var(--ht-cell-autofill-border-radius);inset:min(0px,(var(--ht-cell-autofill-size) - var(--ht-cell-autofill-hit-area-size))/2);background:0 0;position:absolute}.handsontable .wtBorder.corner.wtCornerInlineEndEdge:after{inset-inline-end:0}.handsontable .wtBorder.corner.wtCornerBlockEndEdge:after{inset-block-end:0}.hot-display-license-info{font-family:var(--ht-font-family),-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;padding:var(--ht-license-vertical-padding,16px)var(--ht-license-horizontal-padding,16px);font-size:var(--ht-font-size-small);line-height:var(--ht-line-height-small);color:var(--ht-license-foreground-color);background-color:var(--ht-license-background-color,#f7f7f9);text-align:left;border:1px solid var(--ht-border-color,#f7f7f9);border-radius:var(--ht-wrapper-border-radius);margin-top:10px}.hot-display-license-info a{font-size:var(--ht-license-font-size);color:var(--ht-link-color)}.hot-display-license-info a:hover{color:var(--ht-link-hover-color)}.handsontable .htAutocompleteArrow{cursor:default;width:var(--ht-icon-size);height:var(--ht-icon-size);float:right;top:calc((var(--ht-line-height) - var(--ht-icon-size))/2);margin-inline-start:calc(var(--ht-gap-size)*2);margin-inline-end:1px;font-size:0;position:relative}.handsontable .htAutocompleteArrow:after{content:"";opacity:.6;display:block;position:absolute;top:0;left:0}[dir=rtl].handsontable .htAutocompleteArrow{float:left}.handsontable .htCheckboxRendererInput{width:var(--ht-checkbox-size);height:var(--ht-checkbox-size);vertical-align:middle;cursor:pointer;margin:0;outline:none;margin-top:-2px;display:inline-block;position:relative}.handsontable .htCheckboxRendererInput:first-child{margin-inline-end:var(--ht-gap-size)}.handsontable .htCheckboxRendererInput:last-child{margin-inline-start:var(--ht-gap-size)}.handsontable .htCheckboxRendererInput:before{content:"";width:var(--ht-checkbox-size);height:var(--ht-checkbox-size);border-radius:var(--ht-checkbox-border-radius);border:1px solid var(--ht-checkbox-border-color);background-color:var(--ht-checkbox-background-color);box-sizing:border-box;pointer-events:none;transition:all var(--ht-table-transition)ease-in-out;display:inline-block;position:absolute;top:0;left:0}.handsontable .htCheckboxRendererInput:after{content:"";color:var(--ht-checkbox-icon-color);pointer-events:none;display:block;position:absolute;top:0;left:0;width:var(--ht-checkbox-size)!important;height:var(--ht-checkbox-size)!important}.handsontable .htCheckboxRendererInput:checked:before{border-color:var(--ht-checkbox-checked-border-color);background-color:var(--ht-checkbox-checked-background-color)}.handsontable .htCheckboxRendererInput:checked:after{color:var(--ht-checkbox-checked-icon-color)}.handsontable .htCheckboxRendererInput:checked:disabled:before{border-color:var(--ht-checkbox-checked-disabled-border-color);background-color:var(--ht-checkbox-checked-disabled-background-color)}.handsontable .htCheckboxRendererInput:checked:disabled:after{color:var(--ht-checkbox-checked-disabled-icon-color)}.handsontable .htCheckboxRendererInput:checked:focus:before{border-color:var(--ht-checkbox-checked-focus-border-color);background-color:var(--ht-checkbox-checked-focus-background-color)}.handsontable .htCheckboxRendererInput:checked:focus:after{color:var(--ht-checkbox-checked-focus-icon-color)}.handsontable .htCheckboxRendererInput:focus:before{border-color:var(--ht-checkbox-focus-border-color);background-color:var(--ht-checkbox-focus-background-color);outline:1px solid var(--ht-checkbox-focus-ring-color)}.handsontable .htCheckboxRendererInput:focus:after{color:var(--ht-checkbox-focus-icon-color)}.handsontable .htCheckboxRendererInput:disabled{cursor:initial}.handsontable .htCheckboxRendererInput:disabled:before{border-color:var(--ht-checkbox-disabled-border-color);background-color:var(--ht-checkbox-disabled-background-color)}.handsontable .htCheckboxRendererInput:disabled:after{color:var(--ht-checkbox-disabled-icon-color)}.handsontable .htCheckboxRendererInput:indeterminate:before{border-color:var(--ht-checkbox-indeterminate-border-color);background-color:var(--ht-checkbox-indeterminate-background-color)}.handsontable .htCheckboxRendererInput:indeterminate:after{color:var(--ht-checkbox-indeterminate-icon-color)}.handsontable .htCheckboxRendererInput:indeterminate:disabled:before{border-color:var(--ht-checkbox-indeterminate-disabled-border-color);background-color:var(--ht-checkbox-indeterminate-disabled-background-color)}.handsontable .htCheckboxRendererInput:indeterminate:disabled:after{color:var(--ht-checkbox-indeterminate-disabled-icon-color)}.handsontable .htCheckboxRendererInput:indeterminate:focus:before{border-color:var(--ht-checkbox-indeterminate-focus-border-color);background-color:var(--ht-checkbox-indeterminate-focus-background-color)}.handsontable .htCheckboxRendererInput:indeterminate:focus:after{color:var(--ht-checkbox-indeterminate-focus-icon-color)}.handsontable .htCheckboxRendererInput.noValue{opacity:.5}.handsontable .htCheckboxRendererLabel{font-size:inherit;line-height:inherit;cursor:pointer;color:inherit;margin:0;display:inline-block;position:relative}.handsontable .htCheckboxRendererLabel.fullWidth{width:100%}.handsontable .htPlaceholder{color:var(--ht-placeholder-color)}.handsontable .htDimmed{color:var(--ht-read-only-color)!important;background-color:var(--ht-cell-read-only-background-color)!important}.handsontable .htLeft{text-align:left}.handsontable .htCenter{text-align:center}.handsontable .htRight{text-align:right}.handsontable .htJustify{text-align:justify}.handsontable .htTop{vertical-align:top}.handsontable .htMiddle{vertical-align:middle}.handsontable .htBottom{vertical-align:bottom}.handsontable .htInvalid{background-color:var(--ht-cell-error-background-color)!important}.handsontable .htNoWrap{white-space:nowrap}.handsontable .htSearchResult{background-color:var(--ht-cell-success-background-color)!important}.handsontable .ht-multi-select-renderer{padding:var(--ht-cell-vertical-padding)var(--ht-cell-horizontal-padding);overflow:hidden}.handsontable .ht-multi-select-chips-container{align-items:center;gap:var(--ht-gap-size);flex-wrap:nowrap;max-width:100%;display:flex;overflow:hidden}.handsontable .ht-multi-select-chip{align-items:center;gap:var(--ht-gap-size);padding:var(--ht-chip-vertical-padding)calc((var(--ht-line-height) - var(--ht-icon-size))/2)var(--ht-chip-vertical-padding)var(--ht-chip-horizontal-padding);border-radius:var(--ht-chip-border-radius);background:var(--ht-chip-background);white-space:nowrap;box-sizing:border-box;flex-shrink:0;max-width:100px;display:inline-flex}.handsontable .ht-multi-select-chip-label{text-overflow:ellipsis;color:var(--ht-foreground-color);font-style:normal;font-weight:var(--ht-font-weight);line-height:var(--ht-line-height,40px);letter-spacing:var(--ht-letter-spacing,0);padding:0 var(--ht-chip-gap);overflow:hidden}.handsontable .ht-multi-select-chip-remove{cursor:pointer;color:var(--ht-icon-button-icon-color);background-position:50%;background-repeat:no-repeat;background-size:contain;flex-shrink:0;justify-content:center;align-items:center;padding:0;display:flex;position:relative;width:var(--ht-icon-size)!important;height:var(--ht-icon-size)!important}.handsontable .ht-multi-select-chip-remove:before{content:"";display:block;position:absolute;top:0;left:0}.handsontable .ht-multi-select-chip-remove:hover{background-color:var(--ht-icon-button-hover-background-color)}.handsontable .ht-multi-select-overflow{padding:var(--ht-chip-vertical-padding)var(--ht-chip-horizontal-padding);background:var(--ht-chip-background);border-radius:var(--ht-chip-border-radius);color:var(--ht-foreground-color);white-space:nowrap;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.handsontableInputHolder{position:absolute;top:0;left:0}.handsontableInputHolder .handsontableInput{padding:calc(var(--ht-cell-vertical-padding,4px) + 1px)calc(var(--ht-cell-horizontal-padding,8px) + 1px);color:var(--ht-cell-editor-foreground-color);background-color:var(--ht-cell-editor-background-color,#fff);box-shadow:inset 0 0 0 var(--ht-cell-editor-border-width,2px)var(--ht-cell-editor-border-color,#1a42e8),0 0 var(--ht-cell-editor-shadow-blur-radius,0)0 var(--ht-cell-editor-shadow-color,transparent);box-sizing:border-box;border:none;border-radius:0;outline-width:0;margin:0;display:block;font-family:inherit!important;font-size:inherit!important;line-height:inherit!important;-webkit-appearance:none!important}.handsontableInputHolder .handsontableInput:focus{outline:none}.htSelectEditor{position:absolute}.htSelectEditor select{width:100%;height:100%;padding:calc(var(--ht-cell-vertical-padding,4px) + 1px)calc(var(--ht-cell-horizontal-padding,8px) + 1px);white-space:nowrap;text-overflow:ellipsis;color:var(--ht-cell-editor-foreground-color);background-color:var(--ht-cell-editor-background-color,#fff);box-shadow:inset 0 0 0 var(--ht-cell-editor-border-width,2px)var(--ht-cell-editor-border-color,#1a42e8),0 0 var(--ht-cell-editor-shadow-blur-radius,0)0 var(--ht-cell-editor-shadow-color,transparent);box-sizing:border-box;border:none;border-radius:0;margin:0;padding-inline-end:26px;position:absolute;inset:0;overflow:hidden;font-family:inherit!important;font-size:inherit!important;line-height:inherit!important;-webkit-appearance:none!important}.htSelectEditor select:focus{outline:none}.htSelectEditor .htAutocompleteArrow{z-index:1;pointer-events:none;margin-inline-end:4px;top:50%;transform:translateY(-50%)}.handsontable.listbox{box-shadow:var(--ht-menu-shadow-x,0)var(--ht-menu-shadow-y,0)var(--ht-menu-shadow-blur,8px)color-mix(in srgb,var(--ht-menu-shadow-color,#000)var(--ht-menu-shadow-opacity,100%),transparent);border:var(--ht-menu-border-width,1px)solid var(--ht-menu-border-color,#e5e5e9);margin:0}.handsontable.listbox .ht_master{background-color:var(--ht-background-color);overflow:hidden}.handsontable.listbox .wtHolder{overflow:auto;border-radius:0!important}.handsontable.listbox .wtHider,.handsontable.listbox .htCore{border-radius:0!important}.handsontable.listbox table{overflow:hidden}.handsontable.listbox table th,.handsontable.listbox table tr:first-child th,.handsontable.listbox table tr:last-child th,.handsontable.listbox table tr:first-child td,.handsontable.listbox table td{border-color:#0000!important}.handsontable.listbox table th,.handsontable.listbox table td{white-space:nowrap;text-overflow:ellipsis;border-radius:0!important}.handsontable.listbox table .wtBorder{visibility:hidden}.handsontable.listbox table strong{color:inherit;font-weight:700}.handsontable.listbox table tr td:hover td{cursor:pointer;background:color-mix(in srgb,var(--ht-menu-item-hover-color)var(--ht-menu-item-hover-color-opacity,100%),transparent)!important;box-shadow:none!important}.handsontable.listbox table td{transition:var(--ht-table-transition)background ease-in-out}.handsontable.listbox table td:hover{cursor:pointer;background-color:color-mix(in srgb,var(--ht-menu-item-hover-color)var(--ht-menu-item-hover-color-opacity,100%),transparent)!important}.handsontable.listbox table td.current:not([aria-expanded=true]){box-shadow:inset 0 0 0 1px var(--ht-accent-color)}.handsontable.listbox table td.htDimmed{cursor:default;font-style:inherit;color:inherit!important}.handsontable.listbox table td.htDimmed:not(.handsontable.listbox table td:hover){background-color:inherit!important}.handsontable.listbox table thead th{text-align:left;height:auto!important}.handsontable.listbox table thead th .relative{padding-top:calc(var(--ht-cell-vertical-padding) + var(--ht-gap-size));padding-bottom:calc(var(--ht-cell-vertical-padding) + var(--ht-gap-size))}.handsontable.listbox .ht_clone_top .wtHider{overflow:hidden}.handsontable.listbox .ht_clone_top table{border-radius:0}.handsontable.listbox .htBorders div{background:0 0!important}.handsontable.autocompleteEditor tr.ht__row_even th,.handsontable.autocompleteEditor tr.ht__row_even td,.handsontable.autocompleteEditor tr.ht__row_odd th,.handsontable.autocompleteEditor tr.ht__row_odd td{background-color:var(--ht-background-color,#fff)}[dir=rtl].handsontable.listbox table thead th{text-align:right}.pika-single{font-family:var(--ht-font-family),-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:var(--ht-menu-shadow-x,0)var(--ht-menu-shadow-y,0)var(--ht-menu-shadow-blur,8px)color-mix(in srgb,var(--ht-menu-shadow-color,#000)var(--ht-menu-shadow-opacity,100%),transparent);font-size:var(--ht-font-size);line-height:var(--ht-line-height);font-weight:var(--ht-font-weight);color:var(--ht-foreground-color);background:var(--ht-background-color,#fff);border:var(--ht-menu-border-width,1px)solid var(--ht-menu-border-color,#e5e5e9);border-radius:var(--ht-menu-border-radius);z-index:9999;padding:10px;display:block;position:relative}.pika-single.is-hidden{display:none}.pika-single .pika-row{background-color:#0000}.pika-single .pika-title{justify-content:center;align-items:center;display:flex}.pika-single .pika-label{color:var(--ht-accent-color);order:2;padding:5px;position:relative}.pika-single .pika-label .pika-select{opacity:0;cursor:pointer;position:absolute;inset:0}.pika-single .pika-prev,.pika-single .pika-next{white-space:nowrap;text-indent:-9999px;cursor:pointer;width:20px;height:20px;color:var(--ht-accent-color);background:0 0;border:none;padding:0}.pika-single .pika-prev{order:1;margin-right:auto}.pika-single .pika-next{order:3;margin-left:auto}.pika-single .pika-table thead{height:50px}.pika-single .pika-table th{vertical-align:middle;padding:1px}.pika-single .pika-table th abbr{cursor:initial;border:none;font-weight:400;text-decoration:none}.pika-single .pika-table td{vertical-align:middle;padding:1px}.pika-single .pika-table td.is-disabled .pika-button{pointer-events:none;opacity:.5}.pika-single .pika-table td.is-today .pika-button{background:color-mix(in srgb,var(--ht-menu-item-hover-color)var(--ht-menu-item-hover-color-opacity,100%),transparent)}.pika-single .pika-table td.is-selected .pika-button{background:var(--ht-accent-color,#1a42e8);color:var(--ht-primary-button-foreground-color,#fff)}.pika-single .pika-table td.pika-week{text-align:center;width:12.5%}.pika-single .pika-table .pika-button{aspect-ratio:1;width:100%;color:var(--ht-foreground-color);border-radius:var(--ht-button-border-radius);cursor:pointer;font-size:inherit;background:0 0;border:none;margin:0;padding:10px}.pika-single .pika-table .pika-button:hover{background:color-mix(in srgb,var(--ht-menu-item-hover-color)var(--ht-menu-item-hover-color-opacity,100%),transparent)}[dir=rtl].htDatepickerHolder .pika-single .pika-next{margin-left:0;margin-right:auto;transform:rotate(180deg)}[dir=rtl].htDatepickerHolder .pika-single .pika-prev{margin-left:auto;margin-right:0;transform:rotate(180deg)}.handsontableEditor{position:absolute}.handsontableEditor .ht-multi-select-editor{box-shadow:var(--ht-menu-shadow-x,0)var(--ht-menu-shadow-y,0)var(--ht-menu-shadow-blur,8px)color-mix(in srgb,var(--ht-menu-shadow-color,#000)var(--ht-menu-shadow-opacity,100%),transparent);scrollbar-width:auto;scrollbar-color:var(--ht-scrollbar-thumb-color)var(--ht-scrollbar-track-color);border-radius:0 0 var(--ht-menu-border-radius)var(--ht-menu-border-radius);border:var(--ht-menu-border-width)solid var(--ht-menu-border-color);background:var(--ht-background-color);width:max-content;min-width:120px;padding:var(--ht-menu-vertical-padding)var(--ht-menu-horizontal-padding);overflow-y:auto}.handsontableEditor .ht-multi-select-editor .ht-multi-select-editor-search-input-wrapper{padding:var(--ht-menu-item-vertical-padding)var(--ht-menu-item-horizontal-padding);align-items:center;gap:var(--ht-gap-size);align-self:stretch;display:flex;position:relative}.handsontableEditor .ht-multi-select-editor .ht-multi-select-editor-search-icon{left:calc(var(--ht-menu-item-horizontal-padding) + 10px);opacity:.5;pointer-events:none;z-index:1;background-position:50%;background-repeat:no-repeat;background-size:contain;width:16px;height:16px;position:absolute;top:50%;transform:translateY(-50%)}.handsontableEditor .ht-multi-select-editor input.ht-multi-select-editor-search-input{box-sizing:border-box;border-radius:var(--ht-input-border-radius);width:100%;color:var(--ht-input-foreground-color);background-color:var(--ht-input-background-color);border:1px solid var(--ht-input-border-color);transition:var(--ht-table-transition)all ease-in-out;line-height:var(--ht-line-height);font-size:var(--ht-font-size);padding:var(--ht-input-vertical-padding)var(--ht-menu-item-horizontal-padding)var(--ht-input-vertical-padding)32px}.handsontableEditor .ht-multi-select-editor input.ht-multi-select-editor-search-input:hover{border-color:var(--ht-input-hover-border-color);color:var(--ht-input-hover-foreground-color);background-color:var(--ht-input-hover-background-color)}.handsontableEditor .ht-multi-select-editor input.ht-multi-select-editor-search-input:disabled{border-color:var(--ht-input-disabled-border-color);color:var(--ht-input-disabled-foreground-color);background-color:var(--ht-input-disabled-background-color)}.handsontableEditor .ht-multi-select-editor input.ht-multi-select-editor-search-input:focus{border-color:var(--ht-input-focus-border-color);color:var(--ht-input-focus-foreground-color);background-color:var(--ht-input-focus-background-color);outline-offset:0;box-shadow:none;outline:none}.handsontableEditor .ht-multi-select-editor input.ht-multi-select-editor-search-input::placeholder{color:var(--ht-foreground-color);opacity:.6}.handsontableEditor .ht-multi-select-editor .ht-multi-select-editor-separator{background-color:var(--ht-menu-border-color);width:100%;height:1px;margin:var(--ht-menu-vertical-padding)0 var(--ht-menu-vertical-padding)0;padding:0}.handsontableEditor .ht-multi-select-editor ul{width:100%;padding:var(--ht-gap-size)var(--ht-menu-horizontal-padding);flex-direction:column;align-items:flex-start;margin:0;list-style:none;display:flex}.handsontableEditor .ht-multi-select-editor ul li{background:var(--ht-background-color);padding:var(--ht-menu-item-vertical-padding)var(--ht-menu-item-horizontal-padding);-webkit-user-select:none;user-select:none;cursor:pointer;align-self:stretch;align-items:center;display:flex}.handsontableEditor .ht-multi-select-editor ul li *{cursor:pointer}.handsontableEditor .ht-multi-select-editor ul li.ht-multi-select-editor-item-selected{background:color-mix(in srgb,var(--ht-menu-item-active-color)var(--ht-menu-item-active-color-opacity,100%),transparent)}.handsontableEditor .ht-multi-select-editor ul li div{flex:1 0 0;align-items:center;display:flex}.handsontableEditor .ht-multi-select-editor ul li div input{-webkit-appearance:none;appearance:none;width:var(--ht-checkbox-size);height:var(--ht-checkbox-size);margin:0;padding:0;display:flex;position:relative}.handsontableEditor .ht-multi-select-editor ul li div input:after{content:"";display:block;position:absolute;top:0;left:0}.handsontableEditor .ht-multi-select-editor ul li div input:before{content:"";box-sizing:border-box;width:var(--ht-checkbox-size);height:var(--ht-checkbox-size);border-radius:var(--ht-checkbox-border-radius);border:1px solid var(--ht-checkbox-border-color);background:var(--ht-checkbox-background-color);background-position:50%;background-repeat:no-repeat;display:block;position:absolute;top:0;left:0}.handsontableEditor .ht-multi-select-editor ul li div input:checked:before{border-color:var(--ht-checkbox-checked-border-color);background:var(--ht-checkbox-checked-background-color)}.handsontableEditor .ht-multi-select-editor ul li div input:checked:after{color:var(--ht-checkbox-checked-icon-color);background-color:currentColor}.handsontableEditor .ht-multi-select-editor ul li div input:focus{outline:none}.handsontableEditor .ht-multi-select-editor ul li div label{color:var(--ht-foreground-color);text-overflow:ellipsis;font-size:var(--ht-font-size);font-style:normal;font-weight:400;line-height:var(--ht-line-height);letter-spacing:var(--ht-letter-spacing);width:100%;padding:0 0 0 calc(var(--ht-gap-size)*2);overflow:hidden}.handsontableEditor .ht-multi-select-editor ul li:hover{background:color-mix(in srgb,var(--ht-menu-item-hover-color)var(--ht-menu-item-hover-color-opacity,100%),transparent)}.handsontableEditor .ht-multi-select-editor ul li:has(input:focus){background:color-mix(in srgb,var(--ht-menu-item-hover-color)var(--ht-menu-item-hover-color-opacity,100%),transparent)}.handsontable .htUISelectCaption{width:100%;padding:var(--ht-input-vertical-padding)var(--ht-input-horizontal-padding);font-family:inherit;font-size:var(--ht-font-size);line-height:var(--ht-line-height);font-weight:var(--ht-font-weight);border-radius:var(--ht-input-border-radius);box-sizing:border-box;cursor:pointer;border:var(--ht-input-border-width)solid var(--ht-input-border-color);color:var(--ht-input-foreground-color);background-color:var(--ht-input-background-color);text-overflow:ellipsis;white-space:nowrap;transition:var(--ht-table-transition)all ease-in-out;margin:0;padding-inline-end:calc(var(--ht-input-horizontal-padding) + var(--ht-icon-size));overflow:hidden;outline:none!important}.handsontable .htUISelectCaption:after{content:"";right:calc(var(--ht-input-horizontal-padding) - var(--ht-icon-size)/4);display:block;position:absolute;top:50%;transform:translateY(-50%)}.handsontable .htUISelectCaption:hover{border-color:var(--ht-input-hover-border-color);color:var(--ht-input-hover-foreground-color);background-color:var(--ht-input-hover-background-color)}.handsontable .htUISelectCaption:disabled{border-color:var(--ht-input-disabled-border-color);color:var(--ht-input-disabled-foreground-color);background-color:var(--ht-input-disabled-background-color)}.handsontable .htUISelectCaption:focus{border-color:var(--ht-input-focus-border-color);color:var(--ht-input-focus-foreground-color);background-color:var(--ht-input-focus-background-color)}.handsontable .htUISelect{cursor:pointer;position:relative;outline:none!important}.handsontable .htUISelect:focus .htUISelectCaption{border-color:var(--ht-input-focus-border-color);color:var(--ht-input-focus-foreground-color);background-color:var(--ht-input-focus-background-color)}[dir=rtl].handsontable .htUISelectCaption:after{right:auto;left:calc(var(--ht-input-horizontal-padding) - var(--ht-icon-size)/4)}.handsontable .htFiltersMenuCondition .htUIInput input,.handsontable .htFiltersMenuValue .htUIMultipleSelectSearch input{width:100%;padding:var(--ht-input-vertical-padding)var(--ht-input-horizontal-padding);font-family:inherit;font-size:var(--ht-font-size);line-height:var(--ht-line-height);font-weight:var(--ht-font-weight);border-radius:var(--ht-input-border-radius);box-sizing:border-box;cursor:pointer;border:var(--ht-input-border-width)solid var(--ht-input-border-color);color:var(--ht-input-foreground-color);background-color:var(--ht-input-background-color);transition:var(--ht-table-transition)all ease-in-out;outline:none!important}.handsontable .htFiltersMenuCondition .htUIInput input:hover,.handsontable .htFiltersMenuValue .htUIMultipleSelectSearch input:hover{border-color:var(--ht-input-hover-border-color);color:var(--ht-input-hover-foreground-color);background-color:var(--ht-input-hover-background-color)}.handsontable .htFiltersMenuCondition .htUIInput input:disabled,.handsontable .htFiltersMenuValue .htUIMultipleSelectSearch input:disabled{border-color:var(--ht-input-disabled-border-color);color:var(--ht-input-disabled-foreground-color);background-color:var(--ht-input-disabled-background-color)}.handsontable .htFiltersMenuCondition .htUIInput input:focus,.handsontable .htFiltersMenuValue .htUIMultipleSelectSearch input:focus{border-color:var(--ht-input-focus-border-color);color:var(--ht-input-focus-foreground-color);background-color:var(--ht-input-focus-background-color)}.handsontable .htUIInput{text-align:center;padding:0;position:relative;outline:none!important}.handsontable .htUIInputIcon{position:absolute}.handsontable .htUIInput.htUIButton input,.handsontable .ht-button{min-width:64px;padding:var(--ht-button-vertical-padding)var(--ht-button-horizontal-padding);font-family:inherit;font-size:var(--ht-font-size);line-height:var(--ht-line-height);font-weight:var(--ht-font-weight);border-radius:var(--ht-button-border-radius);box-sizing:border-box;cursor:pointer;transition:var(--ht-table-transition)all ease-in-out;border-style:solid;border-width:1px;outline:none!important}.handsontable .htUIInput.htUIButtonCancel input,.handsontable .ht-button--secondary{border-color:var(--ht-secondary-button-border-color);background-color:var(--ht-secondary-button-background-color);color:var(--ht-secondary-button-foreground-color)}.handsontable .htUIInput.htUIButtonCancel input:hover,.handsontable .ht-button--secondary:hover{border-color:var(--ht-secondary-button-hover-border-color);background-color:var(--ht-secondary-button-hover-background-color);color:var(--ht-secondary-button-hover-foreground-color)}.handsontable .htUIInput.htUIButtonCancel input:disabled,.handsontable .ht-button--secondary:disabled{border-color:var(--ht-secondary-button-disabled-border-color);background-color:var(--ht-secondary-button-disabled-background-color);color:var(--ht-secondary-button-disabled-foreground-color)}.handsontable .htUIInput.htUIButtonCancel input:focus,.handsontable .ht-button--secondary:focus{border-color:var(--ht-secondary-button-focus-border-color);background-color:var(--ht-secondary-button-focus-background-color);color:var(--ht-secondary-button-focus-foreground-color);box-shadow:0 0 0 1px var(--ht-accent-color)}.htUIInput.htUIButtonOK input,.ht-button--primary{border-color:var(--ht-primary-button-border-color);background-color:var(--ht-primary-button-background-color);color:var(--ht-primary-button-foreground-color)}.htUIInput.htUIButtonOK input:hover,.ht-button--primary:hover{border-color:var(--ht-primary-button-hover-border-color);background-color:var(--ht-primary-button-hover-background-color);color:var(--ht-primary-button-hover-foreground-color)}.htUIInput.htUIButtonOK input:disabled,.ht-button--primary:disabled{border-color:var(--ht-primary-button-disabled-border-color);background-color:var(--ht-primary-button-disabled-background-color);color:var(--ht-primary-button-disabled-foreground-color)}.htUIInput.htUIButtonOK input:focus,.ht-button--primary:focus{border-color:var(--ht-primary-button-focus-border-color);background-color:var(--ht-primary-button-focus-background-color);color:var(--ht-primary-button-focus-foreground-color);box-shadow:0 0 0 1px var(--ht-accent-color)}.handsontable .htUIRadio{padding:var(--ht-gap-size)calc(2*var(--ht-gap-size));align-items:center;gap:var(--ht-gap-size);cursor:pointer;margin:0;padding-bottom:0;display:inline-flex;position:relative}.handsontable .htUIRadio:first-child{padding-inline-start:0}.handsontable .htUIRadio>input[type=radio]{width:var(--ht-radio-size);height:var(--ht-radio-size);-webkit-appearance:none;appearance:none;cursor:pointer;border-radius:calc(.5*var(--ht-radio-size));outline:none;margin:0;position:relative}.handsontable .htUIRadio>input[type=radio]:before{content:"";border-radius:calc(.5*var(--ht-radio-size));border:1px solid var(--ht-radio-border-color);background-color:var(--ht-radio-background-color);display:block;position:absolute;inset:0}.handsontable .htUIRadio>input[type=radio]:after{content:"";color:var(--ht-radio-icon-color);display:block;position:absolute}.handsontable .htUIRadio>input[type=radio]:checked:before{border-color:var(--ht-radio-checked-border-color);background-color:var(--ht-radio-checked-background-color)}.handsontable .htUIRadio>input[type=radio]:checked:after{color:var(--ht-radio-checked-icon-color)}.handsontable .htUIRadio>input[type=radio]:checked:disabled{cursor:initial}.handsontable .htUIRadio>input[type=radio]:checked:disabled:before{border-color:var(--ht-radio-checked-disabled-border-color);background-color:var(--ht-radio-checked-disabled-background-color)}.handsontable .htUIRadio>input[type=radio]:checked:disabled:after{color:var(--ht-radio-checked-disabled-icon-color)}.handsontable .htUIRadio>input[type=radio]:checked:focus:before{border-color:var(--ht-radio-checked-focus-border-color);background-color:var(--ht-radio-checked-focus-background-color)}.handsontable .htUIRadio>input[type=radio]:checked:focus:after{color:var(--ht-radio-checked-focus-icon-color)}.handsontable .htUIRadio>input[type=radio]:disabled{cursor:initial}.handsontable .htUIRadio>input[type=radio]:disabled:before{border-color:var(--ht-radio-disabled-border-color);background-color:var(--ht-radio-disabled-background-color)}.handsontable .htUIRadio>input[type=radio]:disabled:after{color:var(--ht-radio-disabled-icon-color)}.handsontable .htUIRadio>input[type=radio]:focus:before{border-color:var(--ht-radio-focus-border-color);background-color:var(--ht-radio-focus-background-color);outline:1px solid var(--ht-radio-focus-ring-color)}.handsontable .htUIRadio>input[type=radio]:focus:after{color:var(--ht-radio-focus-icon-color)}.handsontable .htUIRadio label{vertical-align:middle;cursor:pointer;color:inherit}.handsontable .htUIRadio label:before{content:"";display:block;position:absolute;inset:0}.handsontable .collapsibleIndicator,.handsontable .ht_nestingButton{width:var(--ht-icon-button-hit-area-size);height:var(--ht-icon-button-hit-area-size);margin:calc(-1*(var(--ht-icon-button-hit-area-size) - var(--ht-icon-size))/2 + 1px);box-sizing:border-box;cursor:pointer;text-indent:-100px;flex-shrink:0;font-size:0;position:relative;overflow:visible}.handsontable .collapsibleIndicator:before,.handsontable .ht_nestingButton:before{content:"";width:var(--ht-icon-size);height:var(--ht-icon-size);margin-top:calc(-.5*var(--ht-icon-size));margin-left:calc(-.5*var(--ht-icon-size));border-radius:var(--ht-collapse-button-border-radius);transition:var(--ht-table-transition)all ease-in-out;z-index:1;display:block;position:absolute;top:50%;left:50%}.handsontable .collapsibleIndicator:after,.handsontable .ht_nestingButton:after{content:"";width:var(--ht-icon-size);height:var(--ht-icon-size);margin-top:calc(-.5*var(--ht-icon-size));margin-left:calc(-.5*var(--ht-icon-size));border-radius:var(--ht-collapse-button-border-radius);transition:var(--ht-table-transition)all ease-in-out;z-index:0;display:block;position:absolute;top:50%;left:50%}.handsontable .collapsibleIndicator.expanded:before,.handsontable .collapsibleIndicator.ht_nestingCollapse:before,.handsontable .ht_nestingButton.expanded:before,.handsontable .ht_nestingButton.ht_nestingCollapse:before{color:var(--ht-collapse-button-open-icon-color)}.handsontable .collapsibleIndicator.expanded:after,.handsontable .collapsibleIndicator.ht_nestingCollapse:after,.handsontable .ht_nestingButton.expanded:after,.handsontable .ht_nestingButton.ht_nestingCollapse:after{background-color:var(--ht-collapse-button-open-background-color);box-shadow:0 0 0 1px var(--ht-collapse-button-open-border-color)}.handsontable .collapsibleIndicator.expanded:hover:before,.handsontable .collapsibleIndicator.ht_nestingCollapse:hover:before,.handsontable .ht_nestingButton.expanded:hover:before,.handsontable .ht_nestingButton.ht_nestingCollapse:hover:before{color:var(--ht-collapse-button-open-hover-icon-color)}.handsontable .collapsibleIndicator.expanded:hover:after,.handsontable .collapsibleIndicator.ht_nestingCollapse:hover:after,.handsontable .ht_nestingButton.expanded:hover:after,.handsontable .ht_nestingButton.ht_nestingCollapse:hover:after{background-color:var(--ht-collapse-button-open-hover-background-color);box-shadow:0 0 0 1px var(--ht-collapse-button-open-hover-border-color)}.handsontable .collapsibleIndicator.collapsed:before,.handsontable .collapsibleIndicator.ht_nestingExpand:before,.handsontable .ht_nestingButton.collapsed:before,.handsontable .ht_nestingButton.ht_nestingExpand:before{color:var(--ht-collapse-button-close-icon-color)}.handsontable .collapsibleIndicator.collapsed:after,.handsontable .collapsibleIndicator.ht_nestingExpand:after,.handsontable .ht_nestingButton.collapsed:after,.handsontable .ht_nestingButton.ht_nestingExpand:after{background-color:var(--ht-collapse-button-close-background-color);box-shadow:0 0 0 1px var(--ht-collapse-button-close-border-color)}.handsontable .collapsibleIndicator.collapsed:hover:before,.handsontable .collapsibleIndicator.ht_nestingExpand:hover:before,.handsontable .ht_nestingButton.collapsed:hover:before,.handsontable .ht_nestingButton.ht_nestingExpand:hover:before{color:var(--ht-collapse-button-close-hover-icon-color)}.handsontable .collapsibleIndicator.collapsed:hover:after,.handsontable .collapsibleIndicator.ht_nestingExpand:hover:after,.handsontable .ht_nestingButton.collapsed:hover:after,.handsontable .ht_nestingButton.ht_nestingExpand:hover:after{background-color:var(--ht-collapse-button-close-hover-background-color);box-shadow:0 0 0 1px var(--ht-collapse-button-close-hover-border-color)}.handsontable th.ht__active_highlight .collapsibleIndicator.collapsed:before,.handsontable th.ht__active_highlight .collapsibleIndicator.ht_nestingExpand:before,.handsontable th.ht__active_highlight .ht_nestingButton.collapsed:before,.handsontable th.ht__active_highlight .ht_nestingButton.ht_nestingExpand:before{color:var(--ht-collapse-button-close-icon-active-color)}.handsontable th.ht__active_highlight .collapsibleIndicator.collapsed:hover:before,.handsontable th.ht__active_highlight .collapsibleIndicator.ht_nestingExpand:hover:before,.handsontable th.ht__active_highlight .ht_nestingButton.collapsed:hover:before,.handsontable th.ht__active_highlight .ht_nestingButton.ht_nestingExpand:hover:before{color:var(--ht-collapse-button-close-hover-icon-active-color)}.handsontable th.ht__active_highlight .collapsibleIndicator.expanded:before,.handsontable th.ht__active_highlight .collapsibleIndicator.ht_nestingCollapse:before,.handsontable th.ht__active_highlight .ht_nestingButton.expanded:before,.handsontable th.ht__active_highlight .ht_nestingButton.ht_nestingCollapse:before{color:var(--ht-collapse-button-open-icon-active-color)}.handsontable th.ht__active_highlight .collapsibleIndicator.expanded:hover:before,.handsontable th.ht__active_highlight .collapsibleIndicator.ht_nestingCollapse:hover:before,.handsontable th.ht__active_highlight .ht_nestingButton.expanded:hover:before,.handsontable th.ht__active_highlight .ht_nestingButton.ht_nestingCollapse:hover:before{color:var(--ht-collapse-button-open-hover-icon-active-color)}.handsontable thead th.htRowspanHeader+th{border-inline-start-width:0}.handsontable thead th.htRowspanHeader{vertical-align:bottom;height:auto;overflow:visible}.handsontable thead th.htRowspanHeader.ht__active_highlight{border-inline-start-color:var(--ht-header-active-border-color);z-index:1}.handsontable.htRowHeaders.htHasRowspanHeaders thead tr:last-child th:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-bottom-left-radius:0}.handsontable.htRowHeaders.htHasRowspanHeaders thead tr:last-child th:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-bottom-right-radius:0}.handsontable.htHasRowspanHeaders .ht_clone_inline_start .htCore tbody tr:first-child th:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-left-radius:0}.handsontable.htHasRowspanHeaders .ht_clone_inline_start .htCore tbody tr:first-child th:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-right-radius:0}.handsontable .ht_master:not(.innerBorderTop):not(.innerBorderBottom) thead th.htRowspanBottomLevel,.handsontable .ht_master:not(.innerBorderTop):not(.innerBorderBottom)~.handsontable thead th.htRowspanBottomLevel{border-bottom-width:0}.handsontable thead th.hiddenHeader:not(:first-of-type){display:none}.handsontable thead th.hiddenHeaderText .colHeader{opacity:0}.handsontable th.ht_nestingLevels>.relative{align-items:center;gap:5px;display:flex}.handsontable th.ht_nestingLevels span:last-child{padding-left:calc(var(--ht-icon-size) + 5px)}.handsontable th.ht_nestingLevels span.ht_nestingLevel{display:inline-block}.handsontable th.ht_nestingLevels span.ht_nestingLevel_empty{order:-2;width:5px;height:1px;display:inline-block;position:relative}.handsontable th.ht_nestingLevels .ht_nestingButton{cursor:pointer;order:-1;position:relative}.handsontable th.beforeHiddenColumn,.handsontable th.afterHiddenColumn{position:relative}.handsontable th.beforeHiddenColumn:before,.handsontable th.beforeHiddenColumn:after,.handsontable th.afterHiddenColumn:before,.handsontable th.afterHiddenColumn:after{color:var(--ht-hidden-indicator-color);position:absolute;top:50%;transform:translateY(-50%);width:10px!important;height:10px!important}.handsontable th.beforeHiddenColumn:after{content:"";display:block;right:-2px}.handsontable th.afterHiddenColumn:before{content:"";display:block;left:-2px}.handsontable th.ht__active_highlight.beforeHiddenColumn:before,.handsontable th.ht__active_highlight.beforeHiddenColumn:after,.handsontable th.ht__active_highlight.afterHiddenColumn:before,.handsontable th.ht__active_highlight.afterHiddenColumn:after{color:var(--ht-icon-button-active-icon-color,var(--ht-icon-active-button-icon-color))}[dir=rtl].handsontable th.beforeHiddenColumn:after{right:initial;left:-2px;transform:translateY(-50%)rotate(180deg)}[dir=rtl].handsontable th.afterHiddenColumn:before{right:-2px;left:initial;transform:translateY(-50%)rotate(180deg)}.handsontable th.beforeHiddenRow,.handsontable th.afterHiddenRow{position:relative}.handsontable th.beforeHiddenRow:before,.handsontable th.beforeHiddenRow:after,.handsontable th.afterHiddenRow:before,.handsontable th.afterHiddenRow:after{color:var(--ht-hidden-indicator-color);position:absolute;left:50%;transform:translate(-50%);width:10px!important;height:10px!important}.handsontable th.beforeHiddenRow:after{content:"";display:block;bottom:-2px}.handsontable th.afterHiddenRow:before{content:"";display:block;top:-2px}.handsontable th.ht__active_highlight.beforeHiddenRow:before,.handsontable th.ht__active_highlight.beforeHiddenRow:after,.handsontable th.ht__active_highlight.afterHiddenRow:before,.handsontable th.ht__active_highlight.afterHiddenRow:after{color:var(--ht-icon-button-active-icon-color,var(--ht-icon-active-button-icon-color))}.handsontable .changeType{box-sizing:border-box;width:var(--ht-icon-button-hit-area-size);height:var(--ht-icon-button-hit-area-size);margin:calc(-1*(var(--ht-icon-button-hit-area-size) - var(--ht-icon-size))/2 + 1px);box-shadow:none;color:inherit;z-index:1;background:0 0;border:none;outline:none;flex-shrink:0;padding:0;position:relative;overflow:visible}.handsontable .changeType:before{content:"";width:var(--ht-icon-size);height:var(--ht-icon-size);margin-top:calc(-.5*var(--ht-icon-size));margin-left:calc(-.5*var(--ht-icon-size));color:var(--ht-icon-button-icon-color);z-index:1;display:block;position:absolute;top:50%;left:50%}.handsontable .changeType:after{content:"";width:var(--ht-icon-size);height:var(--ht-icon-size);margin-top:calc(-.5*var(--ht-icon-size));margin-left:calc(-.5*var(--ht-icon-size));border-radius:var(--ht-icon-button-border-radius);box-shadow:0 0 0 1px var(--ht-icon-button-border-color);background-color:var(--ht-icon-button-background-color);z-index:0;display:block;position:absolute;top:50%;left:50%}.handsontable .changeType:hover{cursor:pointer}.handsontable .changeType:hover:before{color:var(--ht-icon-button-hover-icon-color)}.handsontable .changeType:hover:after{box-shadow:0 0 0 1px var(--ht-icon-button-hover-border-color);background-color:var(--ht-icon-button-hover-background-color)}.handsontable .ht__active_highlight .changeType:before{color:var(--ht-icon-button-active-icon-color,var(--ht-icon-active-button-icon-color))}.handsontable .ht__active_highlight .changeType:after{box-shadow:0 0 0 1px var(--ht-icon-button-active-border-color,var(--ht-icon-active-button-border-color));background-color:var(--ht-icon-button-active-background-color,var(--ht-icon-active-button-background-color))}.handsontable .ht__active_highlight .changeType:hover:before{color:var(--ht-icon-button-active-hover-icon-color,var(--ht-icon-active-button-hover-icon-color))}.handsontable .ht__active_highlight .changeType:hover:after{box-shadow:0 0 0 1px var(--ht-icon-button-active-hover-border-color,var(--ht-icon-active-button-hover-border-color));background-color:var(--ht-icon-button-active-hover-background-color,var(--ht-icon-active-button-hover-background-color))}.handsontable th.htFiltersActive{background-color:var(--ht-header-filter-background-color)}.handsontable th.htFiltersActive.ht__active_highlight{background-color:color-mix(in srgb,var(--ht-header-active-background-color),var(--ht-header-filter-background-color)20%)}.handsontable.htDropdownMenu>.ht_master,.handsontable.htContextMenu>.ht_master,.handsontable.htFiltersConditionsMenu>.ht_master{box-shadow:var(--ht-menu-shadow-x,0)var(--ht-menu-shadow-y,0)var(--ht-menu-shadow-blur,8px)color-mix(in srgb,var(--ht-menu-shadow-color,#000)var(--ht-menu-shadow-opacity,100%),transparent);border:var(--ht-menu-border-width,1px)solid var(--ht-menu-border-color,#e5e5e9);border-radius:var(--ht-menu-border-radius);padding:var(--ht-menu-vertical-padding,8px)var(--ht-menu-horizontal-padding,0);background-color:var(--ht-background-color,#fff);overflow:hidden}.handsontable.htDropdownMenu:not(.htGhostTable),.handsontable.htContextMenu:not(.htGhostTable),.handsontable.htFiltersConditionsMenu:not(.htGhostTable){z-index:1060;display:none;position:absolute}.handsontable.htDropdownMenu .ht_clone_top,.handsontable.htDropdownMenu .ht_clone_bottom,.handsontable.htDropdownMenu .ht_clone_inline_start,.handsontable.htDropdownMenu .ht_clone_top_inline_start_corner,.handsontable.htDropdownMenu .ht_clone_bottom_inline_start_corner,.handsontable.htContextMenu .ht_clone_top,.handsontable.htContextMenu .ht_clone_bottom,.handsontable.htContextMenu .ht_clone_inline_start,.handsontable.htContextMenu .ht_clone_top_inline_start_corner,.handsontable.htContextMenu .ht_clone_bottom_inline_start_corner,.handsontable.htFiltersConditionsMenu .ht_clone_top,.handsontable.htFiltersConditionsMenu .ht_clone_bottom,.handsontable.htFiltersConditionsMenu .ht_clone_inline_start,.handsontable.htFiltersConditionsMenu .ht_clone_top_inline_start_corner,.handsontable.htFiltersConditionsMenu .ht_clone_bottom_inline_start_corner{display:none}.handsontable.htDropdownMenu table.htCore,.handsontable.htContextMenu table.htCore,.handsontable.htFiltersConditionsMenu table.htCore{overflow:hidden}.handsontable.htDropdownMenu .htCustomMenuRenderer .table.htCore,.handsontable.htContextMenu .htCustomMenuRenderer .table.htCore,.handsontable.htFiltersConditionsMenu .htCustomMenuRenderer .table.htCore{box-shadow:none}.handsontable.htDropdownMenu.handsontable:focus,.handsontable.htContextMenu.handsontable:focus,.handsontable.htFiltersConditionsMenu.handsontable:focus{outline:none}.handsontable.htDropdownMenu .wtBorder,.handsontable.htContextMenu .wtBorder,.handsontable.htFiltersConditionsMenu .wtBorder{visibility:hidden}.handsontable.htDropdownMenu tbody tr:first-of-type td:first-child,.handsontable.htDropdownMenu tbody tr:first-of-type th:first-child,.handsontable.htContextMenu tbody tr:first-of-type td:first-child,.handsontable.htContextMenu tbody tr:first-of-type th:first-child,.handsontable.htFiltersConditionsMenu tbody tr:first-of-type td:first-child,.handsontable.htFiltersConditionsMenu tbody tr:first-of-type th:first-child{height:calc(var(--ht-cell-vertical-padding)*2 + var(--ht-line-height) + 1px)}.handsontable.htDropdownMenu table tbody tr td,.handsontable.htContextMenu table tbody tr td,.handsontable.htFiltersConditionsMenu table tbody tr td{padding:var(--ht-menu-item-vertical-padding,4px)var(--ht-menu-item-horizontal-padding,8px);white-space:nowrap;text-overflow:ellipsis;background:var(--ht-background-color,#fff);cursor:pointer;transition:var(--ht-table-transition)background ease-in-out;border-width:0;position:relative;overflow:hidden}.handsontable.htDropdownMenu table tbody tr td:first-child,.handsontable.htContextMenu table tbody tr td:first-child,.handsontable.htFiltersConditionsMenu table tbody tr td:first-child{border-top-width:0;border-inline-end-width:0;border-bottom-width:0;border-inline-start-width:0}.handsontable.htDropdownMenu table tbody tr td.htDimmed,.handsontable.htContextMenu table tbody tr td.htDimmed,.handsontable.htFiltersConditionsMenu table tbody tr td.htDimmed{font-style:normal;color:inherit!important;background-color:inherit!important}.handsontable.htDropdownMenu table tbody tr td:not(.handsontable.htDropdownMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htDropdownMenu table tbody tr td.htDisabled,.handsontable.htContextMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htContextMenu table tbody tr td.htDisabled,.handsontable.htFiltersConditionsMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled):hover,.handsontable.htContextMenu table tbody tr td:not(.handsontable.htDropdownMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htDropdownMenu table tbody tr td.htDisabled,.handsontable.htContextMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htContextMenu table tbody tr td.htDisabled,.handsontable.htFiltersConditionsMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled):hover,.handsontable.htFiltersConditionsMenu table tbody tr td:not(.handsontable.htDropdownMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htDropdownMenu table tbody tr td.htDisabled,.handsontable.htContextMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htContextMenu table tbody tr td.htDisabled,.handsontable.htFiltersConditionsMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled):hover{cursor:pointer;background:color-mix(in srgb,var(--ht-menu-item-hover-color)var(--ht-menu-item-hover-color-opacity,100%),transparent)!important}.handsontable.htDropdownMenu table tbody tr td:not(.handsontable.htDropdownMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htDropdownMenu table tbody tr td.htDisabled,.handsontable.htContextMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htContextMenu table tbody tr td.htDisabled,.handsontable.htFiltersConditionsMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled).current:not([aria-expanded=true]),.handsontable.htContextMenu table tbody tr td:not(.handsontable.htDropdownMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htDropdownMenu table tbody tr td.htDisabled,.handsontable.htContextMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htContextMenu table tbody tr td.htDisabled,.handsontable.htFiltersConditionsMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled).current:not([aria-expanded=true]),.handsontable.htFiltersConditionsMenu table tbody tr td:not(.handsontable.htDropdownMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htDropdownMenu table tbody tr td.htDisabled,.handsontable.htContextMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htContextMenu table tbody tr td.htDisabled,.handsontable.htFiltersConditionsMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled).current:not([aria-expanded=true]){box-shadow:inset 0 0 0 1px var(--ht-accent-color)}.handsontable.htDropdownMenu table tbody tr td.htSubmenu .htItemWrapper,.handsontable.htContextMenu table tbody tr td.htSubmenu .htItemWrapper,.handsontable.htFiltersConditionsMenu table tbody tr td.htSubmenu .htItemWrapper{margin-inline-end:calc(2*var(--ht-gap-size,4px) + var(--ht-icon-size))}.handsontable.htDropdownMenu table tbody tr td.htSubmenu .htItemWrapper:after,.handsontable.htContextMenu table tbody tr td.htSubmenu .htItemWrapper:after,.handsontable.htFiltersConditionsMenu table tbody tr td.htSubmenu .htItemWrapper:after{content:"";top:50%;right:calc(var(--ht-menu-item-horizontal-padding) + var(--ht-gap-size)*2);display:block;position:absolute;transform:translateY(-50%)}.handsontable.htDropdownMenu table tbody tr td.htSeparator,.handsontable.htContextMenu table tbody tr td.htSeparator,.handsontable.htFiltersConditionsMenu table tbody tr td.htSeparator{border-top:1px solid var(--ht-border-color);cursor:default;height:0;padding:0}.handsontable.htDropdownMenu table tbody tr td.htDisabled,.handsontable.htContextMenu table tbody tr td.htDisabled,.handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled{color:var(--ht-disabled-color);cursor:default}.handsontable.htDropdownMenu table tbody tr td.htDisabled:hover,.handsontable.htContextMenu table tbody tr td.htDisabled:hover,.handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled:hover{background:var(--ht-background-color);color:var(--ht-disabled-color)}.handsontable.htDropdownMenu table tbody tr td.htHidden,.handsontable.htContextMenu table tbody tr td.htHidden,.handsontable.htFiltersConditionsMenu table tbody tr td.htHidden{display:none}:is(.handsontable.htDropdownMenu table tbody tr td:has(.htItemWrapper .selected),.handsontable.htContextMenu table tbody tr td:has(.htItemWrapper .selected),.handsontable.htFiltersConditionsMenu table tbody tr td:has(.htItemWrapper .selected)){background-color:color-mix(in srgb,var(--ht-menu-item-active-color)var(--ht-menu-item-active-color-opacity,100%),transparent)}.handsontable.htDropdownMenu table tbody tr td .htItemWrapper,.handsontable.htContextMenu table tbody tr td .htItemWrapper,.handsontable.htFiltersConditionsMenu table tbody tr td .htItemWrapper{margin-inline:calc(2*var(--ht-gap-size,4px))}.handsontable.htDropdownMenu table tbody tr td .htItemWrapper:before,.handsontable.htContextMenu table tbody tr td .htItemWrapper:before,.handsontable.htFiltersConditionsMenu table tbody tr td .htItemWrapper:before{vertical-align:text-bottom;margin-right:12px}.handsontable.htDropdownMenu table tbody tr td .htItemWrapper span.selected,.handsontable.htContextMenu table tbody tr td .htItemWrapper span.selected,.handsontable.htFiltersConditionsMenu table tbody tr td .htItemWrapper span.selected{font-size:0;inset:0}.handsontable.htDropdownMenu table tbody tr td .htItemWrapper span.selected:after,.handsontable.htContextMenu table tbody tr td .htItemWrapper span.selected:after,.handsontable.htFiltersConditionsMenu table tbody tr td .htItemWrapper span.selected:after{content:"";top:50%;right:calc(var(--ht-menu-item-horizontal-padding) + var(--ht-gap-size)*2);color:var(--ht-accent-color);display:block;position:absolute;transform:translateY(-50%)}.handsontable.htDropdownMenu table tbody tr td div span.selected,.handsontable.htContextMenu table tbody tr td div span.selected,.handsontable.htFiltersConditionsMenu table tbody tr td div span.selected{position:absolute;inset-inline-end:0}.handsontable.htDropdownMenu table tbody tr td .htUIButton,.handsontable.htContextMenu table tbody tr td .htUIButton,.handsontable.htFiltersConditionsMenu table tbody tr td .htUIButton{width:calc(50% - var(--ht-gap-size))}.handsontable.htDropdownMenu table tbody tr td .htUIButton input,.handsontable.htContextMenu table tbody tr td .htUIButton input,.handsontable.htFiltersConditionsMenu table tbody tr td .htUIButton input{width:100%}.handsontable .htUIClearAll a,.handsontable .htUISelectAll a{padding:var(--ht-gap-size);text-decoration:none;display:inline-block}.handsontable .htUIMultipleSelect .ht_master .wtHolder{background:0 0;border-radius:0!important;overflow-y:scroll!important}.handsontable .htUIMultipleSelect .ht_master .wtHolder .htCore{box-shadow:none}[dir=rtl].handsontable.htDropdownMenu table tbody tr td.htSubmenu .htItemWrapper:after,[dir=rtl].handsontable.htContextMenu table tbody tr td.htSubmenu .htItemWrapper:after,[dir=rtl].handsontable.htFiltersConditionsMenu table tbody tr td.htSubmenu .htItemWrapper:after{left:calc(4*var(--ht-gap-size));right:auto;transform:translateY(-50%)rotate(180deg)}[dir=rtl].handsontable.htDropdownMenu table tbody tr td .htItemWrapper span.selected:after,[dir=rtl].handsontable.htContextMenu table tbody tr td .htItemWrapper span.selected:after,[dir=rtl].handsontable.htFiltersConditionsMenu table tbody tr td .htItemWrapper span.selected:after{left:calc(4*var(--ht-gap-size));right:auto}.handsontable.htFiltersConditionsMenu:not(.htGhostTable){z-index:1070}.handsontable .ht_master table td.htCustomMenuRenderer{cursor:auto}.handsontable .ht_master table td.htCustomMenuRenderer.htFiltersMenuActionBar{padding-top:calc(var(--ht-menu-item-vertical-padding,4px)*2)}.handsontable .htFiltersMenuLabel{font-size:var(--ht-font-size-small);line-height:var(--ht-line-height-small);font-weight:var(--ht-font-weight);margin-bottom:calc(var(--ht-gap-size,2px)*2)}.handsontable .htFiltersMenuLabel:empty{display:none}.handsontable .htFiltersMenuCondition{padding-top:calc(var(--ht-gap-size,2px)*3)!important;padding-bottom:0!important}.handsontable .htFiltersMenuCondition .border{border-bottom:1px solid var(--ht-border-color)!important}.handsontable .htFiltersMenuCondition .htUIInput{margin-top:calc(var(--ht-gap-size,2px)*2)}.handsontable .htFiltersMenuValue{padding-top:calc(var(--ht-gap-size,2px)*3)!important;border-bottom:1px solid var(--ht-border-color)!important;padding-bottom:0!important}.handsontable .htFiltersMenuOperators{padding-top:calc(var(--ht-gap-size,2px)*2)!important;padding-bottom:0!important}.handsontable .htUISelectionControls{margin:0 calc(var(--ht-gap-size,2px)*-1);padding-top:calc(var(--ht-gap-size,2px)*2)!important;padding-bottom:var(--ht-gap-size,2px)!important}.handsontable .htUIMultipleSelectHot{--ht-cell-horizontal-padding:calc(var(--ht-menu-item-horizontal-padding,2px) + var(--ht-gap-size,2px)*2);width:calc(100% + var(--ht-menu-item-horizontal-padding,2px)*2 + var(--ht-gap-size,2px)*4);margin:0 calc((var(--ht-menu-item-horizontal-padding,2px) + var(--ht-gap-size,2px)*2)*-1);overflow:initial!important}.handsontable .htUIMultipleSelectHot:before{content:"";background-color:var(--ht-border-color);width:100%;height:1px;display:block;position:absolute;top:-1px;left:0}.handsontable .htUIMultipleSelectHot .wtHolder{box-sizing:border-box;padding:0;overflow-x:hidden}.handsontable .htUIMultipleSelectHot .wtHolder .wtSpreader{padding:calc(var(--ht-gap-size)*2)0}.handsontable .htUIMultipleSelectHot .wtHolder td{padding:4px var(--ht-cell-horizontal-padding);height:auto!important}.handsontable .htUIClearAll,.handsontable .htUISelectAll{margin-right:var(--ht-gap-size,4px);margin-bottom:var(--ht-gap-size,4px);display:inline-block}.handsontable .htUIClearAll a,.handsontable .htUISelectAll a{font-size:var(--ht-font-size);line-height:var(--ht-line-height);color:var(--ht-link-color);border-radius:var(--ht-button-border-radius)}.handsontable .htUIClearAll a:hover,.handsontable .htUISelectAll a:hover{color:var(--ht-link-hover-color)}.handsontable .htUIClearAll a:focus,.handsontable .htUISelectAll a:focus{outline:1px solid var(--ht-link-hover-color)}.handsontable .htUIMultipleSelect .ht_master .wtHolder{overflow:auto}.handsontable .htUIMultipleSelect .ht_master .wtHolder .wtHider,.handsontable .htUIMultipleSelect .ht_master .wtHolder .htCore,.handsontable .htUIMultipleSelect .ht_master .wtHolder tr,.handsontable .htUIMultipleSelect .ht_master .wtHolder td{background:0 0}.handsontable .htUIInput.htUIButton{cursor:pointer;display:inline-block}.handsontable .htUIInput.htUIButtonOK{margin-inline-start:0;margin-inline-end:calc(2*var(--ht-gap-size,2px))}.handsontable .htCommentCell{position:relative}.handsontable .htCommentCell:after{content:"";top:0;border-inline-start:var(--ht-comments-indicator-size,4px)solid #0000;border-inline-end:none;border-top:var(--ht-comments-indicator-size,4px)solid var(--ht-comments-indicator-color,#1a42e8);display:block;position:absolute;inset-inline-start:unset;inset-inline-end:0}.htCommentsContainer .htComments{z-index:1059;display:none;position:absolute}.htCommentsContainer .htCommentTextArea{font-family:var(--ht-font-family),-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:var(--ht-menu-shadow-x,0)var(--ht-menu-shadow-y,0)var(--ht-menu-shadow-blur,8px)color-mix(in srgb,var(--ht-menu-shadow-color,#000)var(--ht-menu-shadow-opacity,100%),transparent);width:240px;height:88px;font-size:var(--ht-font-size);line-height:var(--ht-line-height);font-weight:var(--ht-font-weight);padding:var(--ht-comments-textarea-vertical-padding)var(--ht-comments-textarea-horizontal-padding);border:var(--ht-comments-textarea-border-width,1px)solid var(--ht-comments-textarea-border-color,transparent);border-inline-start:var(--ht-comments-textarea-border-width,1px)solid var(--ht-comments-textarea-border-color,#1a42e8);color:var(--ht-comments-textarea-foreground-color);background-color:var(--ht-comments-textarea-background-color,#fff);box-sizing:border-box;-webkit-appearance:none;margin:0 -1px;outline:0!important}.htCommentsContainer .htCommentTextArea:focus{border:var(--ht-comments-textarea-focus-border-width,1px)solid var(--ht-comments-textarea-focus-border-color,#1a42e8);color:var(--ht-comments-textarea-focus-foreground-color);background-color:var(--ht-comments-textarea-focus-background-color,#fff)}.htBorders .wtBorder.ht-border-style-dashed-vertical{background-image:repeating-linear-gradient(to bottom,var(--ht-custom-border-color)0 5px,transparent 0 10px)}.htBorders .wtBorder.ht-border-style-dashed-horizontal{background-image:repeating-linear-gradient(to right,var(--ht-custom-border-color)0 5px,transparent 0 10px)}.htBorders .wtBorder.ht-border-style-dotted-horizontal{background-image:radial-gradient(circle,var(--ht-custom-border-color)calc(var(--ht-custom-border-size)/2),transparent 0);background-size:calc(var(--ht-custom-border-size)*2)var(--ht-custom-border-size);background-repeat:repeat-x}.htBorders .wtBorder.ht-border-style-dotted-vertical{background-image:radial-gradient(circle,var(--ht-custom-border-color)calc(var(--ht-custom-border-size)/2),transparent 0);background-size:var(--ht-custom-border-size)calc(var(--ht-custom-border-size)*2);background-repeat:repeat-y}.handsontable .columnSorting:not(.indicatorDisabled){position:relative}.handsontable .columnSorting:not(.indicatorDisabled).sortAction.ascending,.handsontable .columnSorting:not(.indicatorDisabled).sortAction.descending{padding-inline-end:calc(var(--ht-icon-size,16px) + 2px)}.handsontable .columnSorting:not(.indicatorDisabled).sortAction:hover{cursor:pointer;text-decoration:none}.handsontable .columnSorting:not(.indicatorDisabled).sortAction:before{content:"";width:var(--ht-icon-size,16px);text-align:right;display:block;position:absolute;top:50%;right:2px;transform:translateY(-50%)}.handsontable .htRight .columnSorting.sortAction.ascending,.handsontable .htRight .columnSorting.sortAction.descending{padding-inline-start:calc(var(--ht-icon-size,16px) + 2px);padding-inline-end:0}.handsontable .htRight .columnSorting.sortAction:before,[dir=rtl] .handsontable .columnSorting.sortAction:before{text-align:left;left:2px;right:auto}[dir=rtl] .handsontable .htRight .columnSorting.sortAction.ascending,[dir=rtl] .handsontable .htRight .columnSorting.sortAction.descending{padding-inline-start:0;padding-inline-end:calc(var(--ht-icon-size,16px) + 2px)}[dir=rtl] .handsontable .htLeft .columnSorting.sortAction.ascending,[dir=rtl] .handsontable .htLeft .columnSorting.sortAction.descending{padding-inline-start:calc(var(--ht-icon-size,16px) + 2px);padding-inline-end:0}[dir=rtl] .handsontable .htLeft .columnSorting.sortAction:before{text-align:right;left:auto;right:2px}.htGhostTable .htCore span.colHeader.columnSorting:not(.indicatorDisabled):before{content:"*";padding-inline-end:calc(var(--ht-icon-size,16px) + 2px);display:inline-block;position:relative}.handsontable .colHeader.columnSorting:after{content:"";text-align:right;width:8px;margin-top:4px;font-size:8px;display:block;position:absolute;top:50%;right:0;transform:translateY(-50%)}.handsontable .colHeader.columnSorting[class^=sort-]:after,.handsontable .colHeader.columnSorting[class*=\\ sort-]:after{content:"+"}.handsontable .colHeader.columnSorting.sort-1:after{content:"1"}.handsontable .colHeader.columnSorting.sort-2:after{content:"2"}.handsontable .colHeader.columnSorting.sort-3:after{content:"3"}.handsontable .colHeader.columnSorting.sort-4:after{content:"4"}.handsontable .colHeader.columnSorting.sort-5:after{content:"5"}.handsontable .colHeader.columnSorting.sort-6:after{content:"6"}.handsontable .colHeader.columnSorting.sort-7:after{content:"7"}.handsontable .htRight .colHeader.columnSorting:after,[dir=rtl] .handsontable .colHeader.columnSorting:after{text-align:left;left:0;right:auto}[dir=rtl] .handsontable .htLeft .colHeader.columnSorting:after{text-align:right;left:auto;right:0}.htGhostTable th div:has(.changeType) span.colHeader.columnSorting:not(.indicatorDisabled){padding-inline-end:var(--ht-gap-size)}.handsontable .htRowHeaders .ht_master.innerBorderInlineStart~.ht_clone_top_inline_start_corner th:nth-child(2),.handsontable .htRowHeaders .ht_master.innerBorderInlineStart~.ht_clone_inline_start td:first-of-type{border-left:0}.handsontable .ht_clone_top_inline_start_corner th.ht__active_highlight{box-shadow:none}.handsontable .manualColumnResizer{cursor:col-resize;opacity:0;z-index:210;background:0 0;width:10px;margin:0;position:absolute;top:0}.handsontable .manualColumnResizer:before,.handsontable .manualColumnResizer:after{content:"";background:var(--ht-resize-indicator-color);border-radius:2px;width:2px;height:calc(100% - 12px);max-height:16px;margin-top:.5px;display:block;position:absolute;top:50%;left:1px;transform:translateY(-50%)}.handsontable .manualColumnResizer:after{left:auto;right:0}.handsontable .manualColumnResizer:hover,.handsontable .manualColumnResizer.active{opacity:1}.handsontable .manualColumnResizerGuide{inset-inline-end:unset;width:0;border-inline-end:1px solid var(--ht-accent-color);border-inline-start:none;margin-inline-start:5px;margin-inline-end:unset;display:none;position:absolute;top:0}.handsontable .manualColumnResizerGuide.active{z-index:209;display:block}.handsontable .manualRowResizer{z-index:210;cursor:row-resize;opacity:0;background:0 0;height:10px;margin:0;position:absolute;left:0}.handsontable .manualRowResizer:before,.handsontable .manualRowResizer:after{content:"";background:var(--ht-resize-indicator-color);border-radius:2px;width:calc(100% - 12px);max-width:16px;height:2px;display:block;position:absolute;top:1px;left:50%;transform:translate(-50%)}.handsontable .manualRowResizer:after{top:auto;bottom:0}.handsontable .manualRowResizer:hover,.handsontable .manualRowResizer.active{opacity:1}.handsontable .manualRowResizerGuide{border-bottom:1px solid var(--ht-accent-color);border-top:none;height:0;margin-top:5px;display:none;position:absolute;bottom:0;left:0}.handsontable .manualRowResizerGuide.active{z-index:209;display:block}.handsontable tbody td[rowspan][class*=area][class*=highlight]:not([class*=fullySelectedMergedCell]):before{opacity:0}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-multiple]:before,.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-0]:before{opacity:.14}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-1]:before{opacity:.21}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-2]:before{opacity:.28}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-3]:before{opacity:.35}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-4]:before{opacity:.42}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-5]:before{opacity:.49}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-6]:before{opacity:.56}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-7]:before{opacity:.63}.handsontable .ht__manualColumnMove.after-selection--columns thead th.ht__highlight,.handsontable.ht__manualColumnMove.after-selection--columns thead th.ht__highlight{cursor:move;cursor:-moz-grab;cursor:-webkit-grab;cursor:grab}.handsontable .ht__manualColumnMove.on-moving--columns *,.handsontable .ht__manualColumnMove.on-moving--columns thead th.ht__highlight,.handsontable.ht__manualColumnMove.on-moving--columns *,.handsontable.ht__manualColumnMove.on-moving--columns thead th.ht__highlight{cursor:move;cursor:-moz-grabbing;cursor:-webkit-grabbing;cursor:grabbing}.handsontable .ht__manualColumnMove.on-moving--columns .manualColumnResizer,.handsontable.ht__manualColumnMove.on-moving--columns .manualColumnResizer{display:none}.handsontable .ht__manualColumnMove--guideline,.handsontable .ht__manualColumnMove--backlight,.handsontable.ht__manualColumnMove--guideline,.handsontable.ht__manualColumnMove--backlight{height:100%;display:none;position:absolute}.handsontable .ht__manualColumnMove--guideline,.handsontable.ht__manualColumnMove--guideline{z-index:205;background:var(--ht-move-indicator-color,#1a42e8);width:1px;margin-inline:-.5px 0;top:0}.handsontable .ht__manualColumnMove--backlight,.handsontable.ht__manualColumnMove--backlight{z-index:205;pointer-events:none;background:color-mix(in srgb,var(--ht-move-backlight-color)var(--ht-move-backlight-opacity,100%),transparent);display:none}.handsontable .on-moving--columns.show-ui .ht__manualColumnMove--guideline,.handsontable .on-moving--columns .ht__manualColumnMove--backlight,.handsontable.on-moving--columns.show-ui .ht__manualColumnMove--guideline,.handsontable.on-moving--columns .ht__manualColumnMove--backlight{display:block}.handsontable .wtHider{position:relative}.handsontable .ht__manualRowMove.after-selection--rows tbody th.ht__highlight,.handsontable.ht__manualRowMove.after-selection--rows tbody th.ht__highlight{cursor:move;cursor:-moz-grab;cursor:-webkit-grab;cursor:grab}.handsontable .ht__manualRowMove.on-moving--rows *,.handsontable .ht__manualRowMove.on-moving--rows tbody th.ht__highlight,.handsontable.ht__manualRowMove.on-moving--rows *,.handsontable.ht__manualRowMove.on-moving--rows tbody th.ht__highlight{cursor:move;cursor:-moz-grabbing;cursor:-webkit-grabbing;cursor:grabbing}.handsontable .ht__manualRowMove.on-moving--rows .manualRowResizer,.handsontable.ht__manualRowMove.on-moving--rows .manualRowResizer{display:none}.handsontable .ht__manualRowMove--guideline,.handsontable .ht__manualRowMove--backlight,.handsontable.ht__manualRowMove--guideline,.handsontable.ht__manualRowMove--backlight{width:100%;display:none;position:absolute}.handsontable .ht__manualRowMove--guideline,.handsontable.ht__manualRowMove--guideline{border-top:1px solid var(--ht-move-indicator-color);z-index:205;left:0}.handsontable .ht__manualRowMove--backlight,.handsontable.ht__manualRowMove--backlight{z-index:205;pointer-events:none;background:color-mix(in srgb,var(--ht-move-backlight-color)var(--ht-move-backlight-opacity,100%),transparent);display:none}.handsontable .on-moving--rows.show-ui .ht__manualRowMove--guideline,.handsontable .on-moving--rows .ht__manualRowMove--backlight,.handsontable.on-moving--rows.show-ui .ht__manualRowMove--guideline,.handsontable.on-moving--rows .ht__manualRowMove--backlight{display:block}.ht-dialog{scrollbar-width:auto;scrollbar-color:var(--ht-scrollbar-thumb-color)var(--ht-scrollbar-track-color);font-size:var(--ht-font-size);line-height:var(--ht-line-height);letter-spacing:var(--ht-letter-spacing);z-index:1060;opacity:0;border-radius:var(--ht-wrapper-border-radius);border:1px solid var(--ht-border-color);width:100%;height:100%;display:none;position:absolute;top:0;left:0;overflow-y:auto;box-sizing:border-box!important}.ht-dialog[dir=rtl]{left:auto;right:0}.ht-dialog:focus{border:1px solid var(--ht-accent-color);outline:none}.ht-dialog:has(.htFocusCatcher:focus){border:1px solid var(--ht-accent-color);outline:none}.ht-dialog *{box-sizing:border-box!important}.ht-dialog--background-solid{background-color:var(--ht-dialog-solid-background-color)}.ht-dialog--background-semi-transparent{background-color:color-mix(in srgb,var(--ht-dialog-semi-transparent-background-color)var(--ht-dialog-semi-transparent-background-opacity,100%),transparent)}.ht-dialog--animation{transition:opacity var(--ht-table-transition)ease-in-out}.ht-dialog--show{opacity:1}.ht-dialog__content-wrapper{width:100%;min-height:100%;padding:calc(var(--ht-gap-size)*4);border-radius:var(--ht-wrapper-border-radius);justify-content:center;align-items:center;display:flex}.ht-dialog__content{padding:var(--ht-dialog-content-padding-horizontal)var(--ht-dialog-content-padding-vertical);max-width:480px;color:var(--ht-foreground-color);position:relative}.ht-dialog__content--background{box-shadow:var(--ht-shadow-x,0)var(--ht-shadow-y,0)var(--ht-shadow-blur,8px)color-mix(in srgb,var(--ht-shadow-color,#000)var(--ht-shadow-opacity,100%),transparent);border-radius:var(--ht-dialog-content-border-radius);background-color:var(--ht-dialog-content-background-color)}.ht-dialog--confirm .ht-dialog__content-wrapper{text-align:center;padding:calc(var(--ht-gap-size)*2)}.ht-dialog--confirm .ht-dialog__content-wrapper-inner{max-width:480px;padding:calc(var(--ht-gap-size)*2);border-radius:var(--ht-wrapper-border-radius);flex-direction:column;justify-content:center;align-items:center;display:flex}.ht-dialog--confirm .ht-dialog__content-wrapper-inner--background{box-shadow:var(--ht-shadow-x,0)var(--ht-shadow-y,0)var(--ht-shadow-blur,8px)color-mix(in srgb,var(--ht-shadow-color,#000)var(--ht-shadow-opacity,100%),transparent);border-radius:var(--ht-dialog-content-border-radius);background-color:var(--ht-dialog-content-background-color)}.ht-dialog--confirm .ht-dialog__content-wrapper-inner:focus{box-shadow:0 0 0 1px var(--ht-accent-color);outline:none}.ht-dialog--confirm .ht-dialog__content{justify-content:center;align-items:center;gap:var(--ht-gap-size);flex-direction:column;display:flex}.ht-dialog--confirm .ht-dialog__content:has(.ht-dialog__buttons){gap:calc(var(--ht-gap-size)*2)}.ht-dialog--confirm .ht-dialog__title{font-size:var(--ht-font-size);font-weight:var(--ht-font-weight);line-height:var(--ht-line-height);margin:0}.ht-dialog--confirm .ht-dialog__description{color:var(--ht-foreground-secondary-color);font-size:var(--ht-font-size-small);line-height:var(--ht-line-height-small);font-weight:var(--ht-font-weight);margin:0}.ht-dialog--confirm .ht-dialog__buttons{justify-content:center;gap:calc(var(--ht-gap-size)*2);flex-flow:wrap;display:flex}.ht-notification{z-index:1070;pointer-events:none;position:absolute;inset:0;overflow:visible}.ht-notification__stack{overscroll-behavior:contain;pointer-events:auto;-webkit-overflow-scrolling:touch;scrollbar-width:auto;scrollbar-color:var(--ht-scrollbar-thumb-color)var(--ht-scrollbar-track-color);flex-direction:column;gap:10px;max-width:min(420px,100% - 40px);min-height:0;padding:10px;display:flex;position:absolute;overflow:hidden auto}.ht-notification__stack--top-start{top:10px;align-items:flex-start;max-height:calc(100% - 40px);inset-inline-start:10px}.ht-notification__stack--top-end{top:10px;align-items:flex-end;max-height:calc(100% - 40px);inset-inline-end:10px}.ht-notification__stack--bottom-start{bottom:10px;align-items:flex-start;max-height:calc(100% - 40px);inset-inline-start:10px}.ht-notification__stack--bottom-end{bottom:10px;align-items:flex-end;max-height:calc(100% - 40px);inset-inline-end:10px}.ht-notification__toast{box-shadow:var(--ht-shadow-x,0)var(--ht-shadow-y,0)var(--ht-shadow-blur,8px)color-mix(in srgb,var(--ht-shadow-color,#000)var(--ht-shadow-opacity,100%),transparent);pointer-events:auto;max-width:100%;color:var(--ht-notification-foreground-color,var(--ht-foreground-color));background-color:var(--ht-notification-background-color,var(--ht-background-color));border:1px solid var(--ht-notification-border-color,var(--ht-border-color));border-radius:var(--ht-wrapper-border-radius,4px);font-size:var(--ht-font-size);line-height:var(--ht-line-height);letter-spacing:var(--ht-letter-spacing);outline:none;flex-shrink:0;display:flex;position:relative}.ht-notification__toast:focus-visible{box-shadow:0 0 0 1px var(--ht-accent-color)}.ht-notification__toast--animate{opacity:0;transition:opacity var(--ht-table-transition,.15s)ease-out,transform var(--ht-table-transition,.15s)ease-out}.ht-notification__toast--animate.ht-notification__toast--stack-top:not(.ht-notification__toast--visible){transform:translateY(-6px)}.ht-notification__toast--animate.ht-notification__toast--stack-bottom:not(.ht-notification__toast--visible){transform:translateY(6px)}.ht-notification__toast--visible{opacity:1;transform:translateY(0)}.ht-notification__toast--info .ht-notification__accent{display:none}.ht-notification__toast--success .ht-notification__accent{background-color:var(--ht-notification-success-accent,#37bc6c)}.ht-notification__toast--warning .ht-notification__accent{background-color:var(--ht-notification-warning-accent,#fbe952)}.ht-notification__toast--error .ht-notification__accent{background-color:var(--ht-notification-error-accent,#fa4d32)}.ht-notification__toast-inner{width:100%;min-width:0;direction:inherit;flex-direction:row;align-items:stretch;gap:0;padding:10px;display:flex}.ht-notification__accent{box-sizing:border-box;border-radius:4px;flex:0 0 4px;align-self:stretch;margin-inline-end:10px}.ht-notification__body{flex:auto;min-width:0}.ht-notification__title{margin:0 0 var(--ht-gap-size);font-size:var(--ht-font-size);font-weight:var(--ht-font-weight,600)}.ht-notification__message{font-size:var(--ht-font-size-small);word-break:break-word;margin:0}.ht-notification__actions{gap:var(--ht-gap-size);margin-top:var(--ht-gap-size);flex-wrap:wrap;display:flex}.ht-notification__close{box-sizing:border-box;width:var(--ht-icon-button-hit-area-size);height:var(--ht-icon-button-hit-area-size);color:var(--ht-icon-button-icon-color,inherit);cursor:pointer;border-radius:var(--ht-icon-button-border-radius,var(--ht-wrapper-border-radius,4px));background:0 0;border:none;flex:none;align-self:flex-start;margin-inline-start:4px;padding:0;position:relative;overflow:visible}.ht-notification__close:before{content:"";top:50%;margin-top:calc(-.5*var(--ht-icon-size));margin-inline-start:calc(-.5*var(--ht-icon-size));display:block;position:absolute;inset-inline-start:50%}.ht-notification__close:hover{color:var(--ht-icon-button-hover-icon-color,inherit);background-color:var(--ht-icon-button-hover-background-color,color-mix(in srgb,var(--ht-foreground-color)8%,transparent))}.ht-notification__close:focus-visible{outline:2px solid var(--ht-accent-color);outline-offset:2px}.handsontable.ht-pagination{color:var(--ht-pagination-bar-foreground-color);background:var(--ht-pagination-bar-background-color);border:1px solid var(--ht-wrapper-border-color);border-radius:0 0 var(--ht-wrapper-border-radius)var(--ht-wrapper-border-radius);font-size:var(--ht-font-size);line-height:var(--ht-line-height);box-sizing:border-box;border-top-color:#0000;overflow-x:auto}.handsontable.ht-pagination--bordered{border-top-color:var(--ht-wrapper-border-color)}.handsontable.ht-pagination .ht-pagination__inner{justify-content:space-between;align-items:center;gap:calc(var(--ht-gap-size)*4);border-radius:0 0 var(--ht-wrapper-border-radius)var(--ht-wrapper-border-radius);padding-inline:var(--ht-pagination-bar-horizontal-padding);padding-block:var(--ht-pagination-bar-vertical-padding);flex-wrap:wrap;min-width:230px;display:flex}.handsontable.ht-pagination .ht-page-size-section{align-items:center;gap:calc(var(--ht-gap-size)*2);display:flex}.handsontable.ht-pagination .ht-page-size-section__label{white-space:nowrap}.handsontable.ht-pagination .ht-page-size-section__select-wrapper{border-radius:var(--ht-input-border-radius);position:relative}.handsontable.ht-pagination .ht-page-size-section__select-wrapper select{padding-inline-start:var(--ht-gap-size);padding-inline-end:calc(var(--ht-gap-size) + var(--ht-icon-size));padding-top:var(--ht-gap-size);padding-bottom:var(--ht-gap-size);border-radius:var(--ht-input-border-radius);color:var(--ht-input-foreground-color);background-color:var(--ht-input-background-color);border:1px solid var(--ht-input-border-color);line-height:calc(var(--ht-line-height) - 4px);-webkit-appearance:none;font-size:inherit;cursor:pointer}.handsontable.ht-pagination .ht-page-size-section__select-wrapper select:disabled{opacity:.4;cursor:default;color:var(--ht-input-disabled-foreground-color);background-color:var(--ht-input-disabled-background-color);border-color:var(--ht-input-disabled-border-color)}.handsontable.ht-pagination .ht-page-size-section__select-wrapper select:hover:not(:disabled){color:var(--ht-input-hover-foreground-color);background-color:var(--ht-input-hover-background-color);border-color:var(--ht-input-hover-border-color)}.handsontable.ht-pagination .ht-page-size-section__select-wrapper select:focus{color:var(--ht-input-focus-foreground-color);background-color:var(--ht-input-focus-background-color);border-color:var(--ht-input-focus-border-color);outline:none}.handsontable.ht-pagination .ht-page-size-section__select-wrapper:after{content:"";background-color:var(--ht-foreground-color);pointer-events:none;display:block;position:absolute;inset-block-end:50%;inset-inline-end:var(--ht-gap-size);transform:translateY(50%)}.handsontable.ht-pagination .ht-page-counter-section{margin-inline-end:auto}.handsontable.ht-pagination .ht-page-navigation-section{align-items:center;gap:1px;display:flex}.handsontable.ht-pagination .ht-page-navigation-section__button{font-size:inherit;border:1px solid var(--ht-pagination-button-border-color);color:var(--ht-pagination-button-foreground-color);background-color:var(--ht-pagination-button-background-color);border-radius:var(--ht-icon-button-large-border-radius);padding:var(--ht-icon-button-large-padding);cursor:pointer}.handsontable.ht-pagination .ht-page-navigation-section__button:before{content:"";display:block}.handsontable.ht-pagination .ht-page-navigation-section__button--disabled{cursor:default;pointer-events:none;color:var(--ht-pagination-button-disabled-foreground-color);background-color:var(--ht-pagination-button-disabled-background-color);border-color:var(--ht-pagination-button-disabled-border-color)}.handsontable.ht-pagination .ht-page-navigation-section__button:hover:not(:disabled){border-color:var(--ht-pagination-button-hover-border-color);color:var(--ht-pagination-button-hover-foreground-color);background-color:var(--ht-pagination-button-hover-background-color)}.handsontable.ht-pagination .ht-page-navigation-section__button:focus{border-color:var(--ht-pagination-button-focus-border-color);color:var(--ht-pagination-button-focus-foreground-color);background-color:var(--ht-pagination-button-focus-background-color);outline:none}.handsontable.ht-pagination .ht-page-navigation-section__label{white-space:nowrap;text-align:center;min-width:100px}.handsontable.ht-wrapper.htPagination:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htPagination:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-bottom-right-radius:0;border-bottom-left-radius:0}.handsontable.ht-wrapper.htPagination .htCore:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htPagination .htCore:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-bottom-right-radius:0;border-bottom-left-radius:0}:is(.handsontable.ht-wrapper.htPagination .htCore thead tr:last-child th:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htPagination .htCore tbody tr:last-child td:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htPagination .htCore tbody tr:last-child th:first-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-bottom-left-radius:0}:is(.handsontable.ht-wrapper.htPagination .htCore thead tr:last-child th:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htPagination .htCore tbody tr:last-child td:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htPagination .htCore tbody tr:last-child th:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-bottom-right-radius:0}:is(.handsontable.ht-wrapper.htPagination .htCore thead tr:last-child th:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htPagination .htCore tbody tr:last-child td:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htPagination .htCore tbody tr:last-child th:last-child:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-bottom-right-radius:0}:is(.handsontable.ht-wrapper.htPagination .htCore thead tr:last-child th:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htPagination .htCore tbody tr:last-child td:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.handsontable.ht-wrapper.htPagination .htCore tbody tr:last-child th:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-bottom-left-radius:0}.ht-loading__icon-svg{width:var(--ht-icon-size);height:var(--ht-icon-size);color:var(--ht-accent-color);transform-origin:50%;animation:1s linear infinite ht-loading-spin;display:block}.ht-loading__content{align-items:center;gap:calc(var(--ht-gap-size)*2);display:flex}.ht-loading__title{font-size:var(--ht-font-size);font-weight:var(--ht-font-weight);line-height:var(--ht-line-height);margin:0}.ht-loading__description{color:var(--ht-foreground-secondary-color);font-size:var(--ht-font-size-small);line-height:var(--ht-line-height-small);font-weight:var(--ht-font-weight);margin:0}@keyframes ht-loading-spin{to{transform:rotate(360deg)}}.ht-empty-data-state{scrollbar-width:auto;scrollbar-color:var(--ht-scrollbar-thumb-color)var(--ht-scrollbar-track-color);z-index:999;border:1px solid var(--ht-border-color);border-radius:var(--ht-wrapper-border-radius);box-sizing:border-box;background-color:var(--ht-background-color);width:100%;display:none;position:absolute;left:0;overflow-y:auto}.ht-empty-data-state *{box-sizing:border-box!important}.ht-empty-data-state__content-wrapper{text-align:center;width:100%;min-height:100%;padding:calc(var(--ht-gap-size)*2);border-radius:var(--ht-wrapper-border-radius);justify-content:center;align-items:center;display:flex}.ht-empty-data-state__content-wrapper-inner{max-width:480px;padding:calc(var(--ht-gap-size)*2);border-radius:var(--ht-wrapper-border-radius);flex-direction:column;justify-content:center;align-items:center;display:flex}.ht-empty-data-state__content-wrapper-inner:focus{box-shadow:0 0 0 1px var(--ht-accent-color);outline:none}.ht-empty-data-state__content{justify-content:center;align-items:center;gap:var(--ht-gap-size);flex-direction:column;display:flex}.ht-empty-data-state__title{font-size:var(--ht-font-size);font-weight:var(--ht-font-weight);line-height:var(--ht-line-height);margin:0}.ht-empty-data-state__description{color:var(--ht-foreground-secondary-color);font-size:var(--ht-font-size-small);line-height:var(--ht-line-height-small);font-weight:var(--ht-font-weight);margin:0}.ht-empty-data-state__buttons{justify-content:center;gap:calc(var(--ht-gap-size)*2);flex-flow:wrap;display:flex}.ht-empty-data-state__buttons--has-buttons{margin-top:calc(var(--ht-gap-size)*2)}.ht-empty-data-state__spinner{width:28px;height:28px;margin-bottom:calc(var(--ht-gap-size)*2);border:2px solid var(--ht-border-color);border-top-color:var(--ht-accent-color);border-radius:50%;flex-shrink:0;animation:.75s linear infinite ht-empty-data-state-spin}@media (prefers-reduced-motion:reduce){.ht-empty-data-state__spinner{border-top-color:var(--ht-border-color);animation:none}}.ht-empty-data-state--loading .ht-empty-data-state__content{gap:calc(var(--ht-gap-size)*.5)}.ht-empty-data-state--disable-top-border{border-top-width:0}.ht-empty-data-state--disable-top-border:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.ht-empty-data-state--disable-top-border:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-left-radius:0;border-top-right-radius:0}.ht-empty-data-state--disable-inline-border{border-inline-start-width:0}.ht-empty-data-state--disable-inline-border:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-left-radius:0;border-bottom-left-radius:0}.ht-empty-data-state--disable-inline-border:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-right-radius:0;border-bottom-right-radius:0}:is(.ht-empty-data-state--disable-bottom-border,.ht-empty-data-state:has(~.ht-pagination)){border-bottom-width:0}:is(.ht-empty-data-state--disable-bottom-border,.ht-empty-data-state:has(~.ht-pagination)):not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),:is(.ht-empty-data-state--disable-bottom-border,.ht-empty-data-state:has(~.ht-pagination)):is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-bottom-right-radius:0;border-bottom-left-radius:0}@keyframes ht-empty-data-state-spin{to{transform:rotate(360deg)}}`;function lV(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Pq(n,e){return e.get?e.get.call(n):e.value}function Lq(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function hV(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Pn(n,e){var t=hV(n,e,"get");return Pq(n,t)}function Rl(n,e,t){lV(n,e),e.set(n,t)}function zr(n,e,t){var o=hV(n,e,"set");return Lq(n,o,t),t}function Fr(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Wh(n,e){lV(n,e),e.add(n)}const _A="handsontable-core-styles";var Kb=new WeakMap,eg=new WeakMap,UC=new WeakMap,Tx=new WeakMap,oh=new WeakMap,mu=new WeakMap,Uu=new WeakMap,WS=new WeakMap,SA=new WeakSet,vA=new WeakSet,$S=new WeakSet,cV=new WeakSet,RA=new WeakSet,VE=new WeakSet,FS=new WeakSet;class Wq{getCSSVariableValue(e){if(Pn(this,mu)[`--ht-${e}`])return Pn(this,mu)[`--ht-${e}`];const t=Fr(this,RA,Vq).call(this,`--ht-${e}`)??Fr(this,VE,dV).call(this,`--ht-${e}`);if(t!==null)return Pn(this,mu)[`--ht-${e}`]=t,t}getStyleForTD(e){return Pn(this,Uu)?.td?.[e]}getDefaultRowHeight(e){const t=Fr(this,vA,Fq).call(this);return e!==void 0&&e===Pn(this,Kb).view.getFirstRenderedVisibleRow()?t+1:t}areCellsBorderBox(){return this.getStyleForTD("box-sizing")==="border-box"}useTheme(e){if(!/ht-theme-.*/.test(e)){Ie(`${e} isn't a valid theme name. Please ensure it follows the format ht-theme-<theme-name>.`);return}Fr(this,FS,kA).call(this),e&&e!==Pn(this,eg)&&zr(this,eg,e),Pn(this,WS).call(this,Pn(this,eg)),Fr(this,$S,EA).call(this)}getThemeName(){return Pn(this,eg)}clearCache(){Fr(this,FS,kA).call(this),Fr(this,$S,EA).call(this)}constructor({hot:e,rootElement:t,rootDocument:o,onThemeChange:i=()=>{},injectCoreCss:s=!0}){Wh(this,SA),Wh(this,vA),Wh(this,$S),Wh(this,cV),Wh(this,RA),Wh(this,VE),Wh(this,FS),Rl(this,Kb,{writable:!0,value:void 0}),Rl(this,eg,{writable:!0,value:void 0}),Rl(this,UC,{writable:!0,value:void 0}),Rl(this,Tx,{writable:!0,value:void 0}),Rl(this,oh,{writable:!0,value:void 0}),Rl(this,mu,{writable:!0,value:void 0}),Rl(this,Uu,{writable:!0,value:void 0}),Rl(this,WS,{writable:!0,value:void 0}),zr(this,mu,{}),zr(this,Uu,{}),zr(this,Kb,e),zr(this,UC,t),zr(this,oh,o),zr(this,WS,i),s&&Fr(this,SA,$q).call(this)}}function $q(){if(!Pn(this,Kb)||!Pn(this,oh)||!Pn(this,oh).head)return;const n=Pn(this,oh).getElementById(_A);if(n&&n instanceof HTMLStyleElement)return;const e=Pn(this,oh).createElement("style");e.id=_A,e.textContent=Nq,Pn(this,oh).head.appendChild(e)}function Fq(){const n=this.getCSSVariableValue("line-height"),e=this.getCSSVariableValue("cell-vertical-padding"),t=Math.ceil(parseFloat(this.getStyleForTD("border-bottom-width")));return n===null||e===null||isNaN(t)?null:n+2*e+t}function EA(){zr(this,Tx,getComputedStyle(Pn(this,UC)));const n=Fr(this,cV,Bq).call(this,["box-sizing","border-bottom-width"]);Pn(this,Uu).td={...Pn(this,Uu).td,"box-sizing":n["box-sizing"],"border-bottom-width":n["border-bottom-width"]}}function Bq(n){const e=Pn(this,oh),t=Pn(this,UC),o=e.createElement("table"),i=e.createElement("tbody"),s=e.createElement("tr"),r=e.createElement("tr"),a=e.createElement("td");r.appendChild(a),i.appendChild(s),i.appendChild(r),o.appendChild(i),t.appendChild(o);const l=getComputedStyle(a),h={};return n.forEach(c=>{h[c]=l.getPropertyValue(c)}),t.removeChild(o),h}function Vq(n){const e=Math.ceil(parseFloat(Fr(this,VE,dV).call(this,n)));return Number.isNaN(e)?null:e}function dV(n){const e=Pn(this,Tx)?.getPropertyValue(n);return e===""?null:e}function kA(){zr(this,Uu,{}),zr(this,mu,{})}let Ki=null,Xb=0;function zq(n){const e=n.ownerDocument;if(!Ki){Ki=e.createElement("div"),Ki.setAttribute("role","status"),Ki.setAttribute("aria-live","assertive"),Ki.setAttribute("aria-atomic","true");const t=Ki.style;t.position="absolute",t.width="1px",t.height="1px",t.margin="-1px",t.overflow="hidden",t.clipPath="rect(0 0 0 0)",t.whiteSpace="nowrap",n.appendChild(Ki)}Xb+=1}function Uq(){Xb!==0&&(Xb===1&&(Ki.remove(),Ki=null),Xb-=1)}function Yq(n){Ki&&(Ki.textContent="",setTimeout(()=>{Ki&&(Ki.textContent=n)},100))}const Gq={size_0:"0px",size_0_5:"2px",size_1:"4px",size_2:"8px",size_1_5:"6px",size_3:"12px",size_4:"16px",size_5:"20px",size_6:"24px",size_7:"28px",size_8:"32px",size_9:"36px",size_10:"40px",size_0_25:"1px"},jq={default:{cellVertical:"sizing.size_1",cellHorizontal:"sizing.size_2",barsHorizontal:"sizing.size_4",barsVertical:"sizing.size_2",gap:"sizing.size_1",buttonHorizontal:"sizing.size_3",buttonVertical:"sizing.size_1_5",dialogHorizontal:"sizing.size_2",dialogVertical:"sizing.size_2",inputHorizontal:"sizing.size_3",inputVertical:"sizing.size_1_5",menuVertical:"sizing.size_2",menuHorizontal:"sizing.size_0",menuItemVertical:"sizing.size_1",menuItemHorizontal:"sizing.size_3"},compact:{cellVertical:"sizing.size_0_5",cellHorizontal:"sizing.size_1_5",barsHorizontal:"sizing.size_2",barsVertical:"sizing.size_1",gap:"sizing.size_0_5",buttonHorizontal:"sizing.size_2",buttonVertical:"sizing.size_0_5",dialogHorizontal:"sizing.size_1_5",dialogVertical:"sizing.size_1_5",inputHorizontal:"sizing.size_2",inputVertical:"sizing.size_0_5",menuVertical:"sizing.size_2",menuHorizontal:"sizing.size_0",menuItemVertical:"sizing.size_0_5",menuItemHorizontal:"sizing.size_2"},comfortable:{cellVertical:"sizing.size_2",cellHorizontal:"sizing.size_3",barsHorizontal:"sizing.size_4",barsVertical:"sizing.size_2",gap:"sizing.size_1_5",buttonHorizontal:"sizing.size_4",buttonVertical:"sizing.size_2",dialogHorizontal:"sizing.size_3",dialogVertical:"sizing.size_3",inputHorizontal:"sizing.size_4",inputVertical:"sizing.size_2",menuVertical:"sizing.size_3",menuHorizontal:"sizing.size_0",menuItemVertical:"sizing.size_2",menuItemHorizontal:"sizing.size_2"}},qq=new Set(["name","sizing","density","icons","colors","tokens","colorScheme"]),TA=new Set(["light","dark","auto"]),zE=new Set(["default","compact","comfortable"]),Kq=new Set(["arrowRight","arrowRightWithBar","arrowLeft","arrowLeftWithBar","arrowDown","menu","selectArrow","arrowNarrowUp","arrowNarrowDown","check","checkbox","caretHiddenLeft","caretHiddenRight","caretHiddenUp","caretHiddenDown","collapseOff","collapseOn","radio","chipClose","search"]),Xq=new Set(["fontFamily","fontSize","fontSizeSmall","lineHeight","lineHeightSmall","fontWeight","letterSpacing","gapSize","iconSize","tableTransition","borderColor","accentColor","foregroundColor","foregroundSecondaryColor","backgroundColor","backgroundSecondaryColor","placeholderColor","readOnlyColor","disabledColor","shadowColor","shadowX","shadowY","shadowBlur","shadowOpacity","barForegroundColor","barBackgroundColor","barHorizontalPadding","barVerticalPadding","cellHorizontalBorderColor","cellVerticalBorderColor","cellHorizontalPadding","cellVerticalPadding","wrapperBorderWidth","wrapperBorderRadius","wrapperBorderColor","rowHeaderOddBackgroundColor","rowHeaderEvenBackgroundColor","rowCellOddBackgroundColor","rowCellEvenBackgroundColor","cellEditorBorderWidth","cellEditorBorderColor","cellEditorForegroundColor","cellEditorBackgroundColor","cellEditorShadowBlurRadius","cellEditorShadowColor","cellSuccessBackgroundColor","cellErrorBackgroundColor","cellReadOnlyBackgroundColor","cellSelectionBorderColor","cellSelectionBackgroundColor","cellAutofillSize","cellAutofillHitAreaSize","cellAutofillBorderWidth","cellAutofillBorderRadius","cellAutofillBorderColor","cellAutofillBackgroundColor","cellAutofillFillBorderColor","cellMobileHandleSize","cellMobileHandleBorderWidth","cellMobileHandleBorderRadius","cellMobileHandleBorderColor","cellMobileHandleBackgroundColor","cellMobileHandleBackgroundOpacity","resizeIndicatorColor","moveBacklightColor","moveBacklightOpacity","moveIndicatorColor","hiddenIndicatorColor","scrollbarBorderRadius","scrollbarTrackColor","scrollbarThumbColor","headerFontWeight","headerForegroundColor","headerBackgroundColor","headerHighlightedShadowSize","headerHighlightedForegroundColor","headerHighlightedBackgroundColor","headerActiveBorderColor","headerActiveForegroundColor","headerActiveBackgroundColor","headerFilterBackgroundColor","headerRowForegroundColor","headerRowBackgroundColor","headerRowHighlightedForegroundColor","headerRowHighlightedBackgroundColor","headerRowActiveForegroundColor","headerRowActiveBackgroundColor","checkboxSize","checkboxBorderRadius","checkboxBorderColor","checkboxBackgroundColor","checkboxIconColor","checkboxFocusBorderColor","checkboxFocusBackgroundColor","checkboxFocusIconColor","checkboxFocusRingColor","checkboxDisabledBorderColor","checkboxDisabledBackgroundColor","checkboxDisabledIconColor","checkboxCheckedBorderColor","checkboxCheckedBackgroundColor","checkboxCheckedIconColor","checkboxCheckedFocusBorderColor","checkboxCheckedFocusBackgroundColor","checkboxCheckedFocusIconColor","checkboxCheckedDisabledBorderColor","checkboxCheckedDisabledBackgroundColor","checkboxCheckedDisabledIconColor","checkboxIndeterminateBorderColor","checkboxIndeterminateBackgroundColor","checkboxIndeterminateIconColor","checkboxIndeterminateFocusBorderColor","checkboxIndeterminateFocusBackgroundColor","checkboxIndeterminateFocusIconColor","checkboxIndeterminateDisabledBorderColor","checkboxIndeterminateDisabledBackgroundColor","checkboxIndeterminateDisabledIconColor","radioSize","radioBorderColor","radioBackgroundColor","radioIconColor","radioFocusBorderColor","radioFocusBackgroundColor","radioFocusIconColor","radioFocusRingColor","radioDisabledBorderColor","radioDisabledBackgroundColor","radioDisabledIconColor","radioCheckedBorderColor","radioCheckedBackgroundColor","radioCheckedIconColor","radioCheckedFocusBorderColor","radioCheckedFocusBackgroundColor","radioCheckedFocusIconColor","radioCheckedDisabledBorderColor","radioCheckedDisabledBackgroundColor","radioCheckedDisabledIconColor","iconButtonBorderRadius","iconButtonLargeBorderRadius","iconButtonLargePadding","iconButtonBorderColor","iconButtonBackgroundColor","iconButtonIconColor","iconButtonHitAreaSize","iconButtonHoverBorderColor","iconButtonHoverBackgroundColor","iconButtonHoverIconColor","iconButtonActiveBorderColor","iconButtonActiveBackgroundColor","iconButtonActiveIconColor","iconButtonActiveHoverBorderColor","iconButtonActiveHoverBackgroundColor","iconButtonActiveHoverIconColor","collapseButtonBorderRadius","collapseButtonOpenBorderColor","collapseButtonOpenBackgroundColor","collapseButtonOpenIconColor","collapseButtonOpenIconActiveColor","collapseButtonOpenHoverBorderColor","collapseButtonOpenHoverBackgroundColor","collapseButtonOpenHoverIconColor","collapseButtonOpenHoverIconActiveColor","collapseButtonCloseBorderColor","collapseButtonCloseBackgroundColor","collapseButtonCloseIconColor","collapseButtonCloseIconActiveColor","collapseButtonCloseHoverBorderColor","collapseButtonCloseHoverBackgroundColor","collapseButtonCloseHoverIconColor","collapseButtonCloseHoverIconActiveColor","buttonBorderRadius","buttonHorizontalPadding","buttonVerticalPadding","primaryButtonBorderColor","primaryButtonForegroundColor","primaryButtonBackgroundColor","primaryButtonDisabledBorderColor","primaryButtonDisabledForegroundColor","primaryButtonDisabledBackgroundColor","primaryButtonHoverBorderColor","primaryButtonHoverForegroundColor","primaryButtonHoverBackgroundColor","primaryButtonFocusBorderColor","primaryButtonFocusForegroundColor","primaryButtonFocusBackgroundColor","secondaryButtonBorderColor","secondaryButtonForegroundColor","secondaryButtonBackgroundColor","secondaryButtonDisabledBorderColor","secondaryButtonDisabledForegroundColor","secondaryButtonDisabledBackgroundColor","secondaryButtonHoverBorderColor","secondaryButtonHoverForegroundColor","secondaryButtonHoverBackgroundColor","secondaryButtonFocusBorderColor","secondaryButtonFocusForegroundColor","secondaryButtonFocusBackgroundColor","commentsTextareaHorizontalPadding","commentsTextareaVerticalPadding","commentsTextareaBorderWidth","commentsTextareaBorderColor","commentsTextareaForegroundColor","commentsTextareaBackgroundColor","commentsTextareaFocusBorderWidth","commentsTextareaFocusBorderColor","commentsTextareaFocusForegroundColor","commentsTextareaFocusBackgroundColor","commentsIndicatorSize","commentsIndicatorColor","licenseHorizontalPadding","licenseVerticalPadding","licenseForegroundColor","licenseBackgroundColor","linkColor","linkHoverColor","inputBorderWidth","inputBorderRadius","inputHorizontalPadding","inputVerticalPadding","inputBorderColor","inputForegroundColor","inputBackgroundColor","inputHoverBorderColor","inputHoverForegroundColor","inputHoverBackgroundColor","inputDisabledBorderColor","inputDisabledForegroundColor","inputDisabledBackgroundColor","inputFocusBorderColor","inputFocusForegroundColor","inputFocusBackgroundColor","menuBorderWidth","menuBorderRadius","menuHorizontalPadding","menuVerticalPadding","menuItemHorizontalPadding","menuItemVerticalPadding","menuBorderColor","menuShadowX","menuShadowY","menuShadowBlur","menuShadowColor","menuShadowOpacity","menuItemHoverColor","menuItemHoverColorOpacity","menuItemActiveColor","menuItemActiveColorOpacity","dialogSemiTransparentBackgroundColor","dialogSemiTransparentBackgroundOpacity","dialogSolidBackgroundColor","dialogContentPaddingHorizontal","dialogContentPaddingVertical","dialogContentBorderRadius","dialogContentBackgroundColor","notificationForegroundColor","notificationBackgroundColor","notificationBorderColor","notificationSuccessAccent","notificationWarningAccent","notificationErrorAccent","paginationBarForegroundColor","paginationBarBackgroundColor","paginationBarHorizontalPadding","paginationBarVerticalPadding","paginationButtonBorderColor","paginationButtonForegroundColor","paginationButtonBackgroundColor","paginationButtonHoverBorderColor","paginationButtonHoverForegroundColor","paginationButtonHoverBackgroundColor","paginationButtonDisabledForegroundColor","paginationButtonDisabledBackgroundColor","paginationButtonDisabledBorderColor","paginationButtonFocusBorderColor","paginationButtonFocusForegroundColor","paginationButtonFocusBackgroundColor","chipBackground","chipBorderRadius","chipVerticalPadding","chipHorizontalPadding","chipGap"]);function Zq(n,e){return(typeof n!="string"||n.trim()==="")&&Y(`[ThemeBuilder] ${e}.name must be a non-empty string.`),n}function uV(n){if(!TA.has(n)){const e=[...TA].join(", ");Y(`[ThemeBuilder] Invalid color scheme: "${n}". Must be one of: ${e}.`)}return n}function UE(n){if(!zE.has(n)){const e=[...zE].join(", ");Y(`[ThemeBuilder] Invalid density: "${n}". Must be one of: ${e}.`)}return n}function Qq(n,e){ie(n)||Y(`[ThemeBuilder] ${e}.sizes must be an object.`),Object.keys(n).forEach(t=>{zE.has(t)||Ie(`[ThemeBuilder] Unknown density size key: "${t}" in ${e}.sizes. This may be a custom density size or a typo.`)})}function Jq(n,e){ie(n)?((!n.type||!n.sizes)&&Y(`[ThemeBuilder] ${e} must be a string or an object with a 'type' and 'sizes' property.`),UE(n.type),Qq(n.sizes,`${e}.sizes`)):typeof n=="string"&&UE(n)}function fV(n,e){Object.entries(n).forEach(([t,o])=>{const i=`${e}.${t}`;typeof o!="string"&&(ie(o)?fV(o,i):Y(`[ThemeBuilder] ${i} must be a string or an object.`))})}function BS(n,e,t,o={}){const{type:i="key",warnMissing:s=!1}=o;if(!n){s&&Ie(`[ThemeBuilder] No ${i}s provided in ${t}. All ${i}s are missing.`);return}if(Object.keys(n).forEach(a=>{e.has(a)||Ie(`[ThemeBuilder] Unknown ${i} key: "${a}" in ${t}. This may be a custom ${i} or a typo.`)}),s){const a=[];e.forEach(l=>{l in n||a.push(l)}),a.length>0&&Ie(`[ThemeBuilder] Missing ${i}(s) in ${t}: ${a.join(", ")}`)}}function xA(n,e,t={}){const{requiredFields:o=[]}=t;(typeof n!="object"||n===null)&&Y(`[ThemeBuilder] ${e} must be an object.`);const{name:i,sizing:s,density:r,icons:a,colors:l,tokens:h,colorScheme:c}=n;BS(n,qq,e,{type:"param"}),o.forEach(d=>{n[d]===void 0&&Y(`[ThemeBuilder] ${e}.${d} is required.`)}),i!==void 0&&Zq(i,e),s!==void 0&&(ie(s)||Y(`[ThemeBuilder] ${e}.sizing must be an object.`)),r!==void 0&&(!ie(r)&&typeof r!="string"&&Y(`[ThemeBuilder] ${e}.density must be a string or an object.`),Jq(r,`${e}.density`)),a!==void 0&&(ie(a)||Y(`[ThemeBuilder] ${e}.icons must be an object.`),BS(a,Kq,`${e}.icons`,{type:"icon",warnMissing:o.includes("icons")})),l!==void 0&&(ie(l)||Y(`[ThemeBuilder] ${e}.colors must be an object.`),fV(l,`${e}.colors`)),h!==void 0&&(ie(h)||Y(`[ThemeBuilder] ${e}.tokens must be an object.`),BS(h,Xq,`${e}.tokens`,{type:"token",warnMissing:o.includes("tokens")})),c!==void 0&&uV(c)}function gV(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function eK(n,e){return e.get?e.get.call(n):e.value}function tK(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function pV(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function bn(n,e){var t=pV(n,e,"get");return eK(n,t)}function tg(n,e,t){gV(n,e),e.set(n,t)}function ar(n,e,t){var o=pV(n,e,"set");return tK(n,o,t),t}function wu(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function VS(n,e){gV(n,e),e.add(n)}const nK=["sizing","icons","colors","tokens"],oK=["name","icons","colors","tokens"];var Zi=new WeakMap,bu=new WeakMap,rp=new WeakMap,uc=new WeakMap,Ql=new WeakMap,Hw=new WeakSet,mV=new WeakSet,zS=new WeakSet;class iK{subscribe(e){return typeof e!="function"&&Y("[ThemeBuilder] listener must be a function."),bn(this,rp).add(e),()=>bn(this,rp).delete(e)}params(e){return xA(e,"params"),wu(this,zS,MA).call(this,e),wu(this,Hw,US).call(this),this}setColorScheme(e){return ar(this,uc,uV(e)),bn(this,bu).colorScheme=bn(this,uc),bn(this,Zi).colorScheme=bn(this,uc),wu(this,Hw,US).call(this),this}setDensityType(e){return ar(this,Ql,UE(e)),bn(this,bu).density.type=bn(this,Ql),bn(this,Zi).density.type=bn(this,Ql),wu(this,Hw,US).call(this),this}getThemeConfig(){return bn(this,bu)}constructor(e){VS(this,Hw),VS(this,mV),VS(this,zS),tg(this,Zi,{writable:!0,value:void 0}),tg(this,bu,{writable:!0,value:void 0}),tg(this,rp,{writable:!0,value:void 0}),tg(this,uc,{writable:!0,value:void 0}),tg(this,Ql,{writable:!0,value:void 0}),ar(this,rp,new Set),ar(this,uc,"auto"),ar(this,Ql,"default"),xA(e,"themeConfig",{requiredFields:oK}),ar(this,Zi,{name:void 0,sizing:Gq,density:{type:bn(this,Ql),sizes:jq},icons:{},colors:{},tokens:{},colorScheme:bn(this,uc)}),wu(this,zS,MA).call(this,e),ar(this,Zi,bn(this,bu))}}function US(){const n=this.getThemeConfig();bn(this,rp).forEach(e=>e(n))}function sK(n,e){ie(e)?(n.density=nk(n.density,e),ar(this,Ql,e.type),bn(this,Zi)?.density&&(bn(this,Zi).density.type=e.type)):typeof e=="string"&&(n.density.type=e,ar(this,Ql,e),bn(this,Zi)?.density&&(bn(this,Zi).density.type=e))}function MA(n){const e=Jn(bn(this,Zi));n.name!==void 0&&(bn(this,Zi).name!==void 0?Ie('[ThemeBuilder] The "name" property can only be set during `registerTheme()` and cannot be updated via `params()`.'):e.name=n.name),nK.forEach(t=>{n[t]!==void 0&&ie(n[t])&&(e[t]=nk(e[t],n[t]))}),n.density!==void 0&&wu(this,mV,sK).call(this,e,n.density),n.colorScheme!==void 0&&(e.colorScheme=n.colorScheme,ar(this,uc,n.colorScheme),bn(this,Zi)?.colorScheme&&(bn(this,Zi).colorScheme=n.colorScheme)),ar(this,bu,e)}function rK(n){return new iK(n)}const Lt=(n,e)=>`width: var(--ht-icon-size);
77
- height: var(--ht-icon-size);
78
- -webkit-mask-size: contain;
79
- -webkit-mask-image: url("${n[e]}");
80
- background-color: currentColor;`,aK=(n,e)=>`.htDropdownMenu table tbody tr td.htSubmenu .htItemWrapper::after,
81
- .htContextMenu table tbody tr td.htSubmenu .htItemWrapper::after,
82
- .htFiltersConditionsMenu table tbody tr td.htSubmenu .htItemWrapper::after,
83
- .pika-single .pika-next {
84
- ${Lt(n,"arrowRight")}
85
- }
86
-
87
- .pika-single .pika-prev {
88
- ${Lt(n,"arrowLeft")}
89
- }
90
-
91
- .ht-page-size-section__select-wrapper::after {
92
- ${Lt(n,"arrowDown")}
93
- }
94
-
95
- .changeType::before {
96
- ${Lt(n,"menu")}
97
- }
98
-
99
- .htUISelectCaption::after,
100
- .htAutocompleteArrow::after {
101
- ${Lt(n,"selectArrow")}
102
- }
103
-
104
- .columnSorting.sortAction.ascending::before {
105
- ${Lt(n,"arrowNarrowUp")}
106
- }
107
-
108
- .columnSorting.sortAction.descending::before {
109
- ${Lt(n,"arrowNarrowDown")}
110
- }
111
-
112
- .ht-page-navigation-section .ht-page-first::before {
113
- ${Lt(n,"arrowLeftWithBar")}
114
- }
115
-
116
- [dir="rtl"] .ht-page-navigation-section .ht-page-first::before {
117
- ${Lt(n,"arrowRightWithBar")}
118
- }
119
-
120
- .ht-page-navigation-section .ht-page-prev::before {
121
- ${Lt(n,"arrowLeft")}
122
- }
123
-
124
- [dir="rtl"] .ht-page-navigation-section .ht-page-prev::before {
125
- ${Lt(n,"arrowRight")}
126
- }
127
-
128
- .ht-page-navigation-section .ht-page-next::before {
129
- ${Lt(n,"arrowRight")}
130
- }
131
-
132
- [dir="rtl"] .ht-page-navigation-section .ht-page-next::before {
133
- ${Lt(n,"arrowLeft")}
134
- }
135
-
136
- .ht-page-navigation-section .ht-page-last::before {
137
- ${Lt(n,"arrowRightWithBar")}
138
- }
139
-
140
- [dir="rtl"] .ht-page-navigation-section .ht-page-last::before {
141
- ${Lt(n,"arrowLeftWithBar")}
142
- }
143
-
144
- .htDropdownMenu table tbody tr td .htItemWrapper span.selected::after,
145
- .htContextMenu table tbody tr td .htItemWrapper span.selected::after,
146
- .htFiltersConditionsMenu table tbody tr td .htItemWrapper span.selected::after {
147
- ${Lt(n,"check")}
148
- }
149
-
150
- .htCheckboxRendererInput {
151
- appearance: none;
152
- }
153
-
154
- .htCheckboxRendererInput::after {
155
- ${Lt(n,"checkbox")}
156
- }
157
-
158
- th.beforeHiddenColumn::after {
159
- ${Lt(n,"caretHiddenLeft")}
160
- }
161
-
162
- th.afterHiddenColumn::before {
163
- ${Lt(n,"caretHiddenRight")}
164
- }
165
-
166
- th.beforeHiddenRow::after {
167
- ${Lt(n,"caretHiddenUp")}
168
- }
169
-
170
- th.afterHiddenRow::before {
171
- ${Lt(n,"caretHiddenDown")}
172
- }
173
-
174
- .collapsibleIndicator::before,
175
- .ht_nestingButton::before {
176
- ${Lt(n,"collapseOff")}
177
- }
178
-
179
- .collapsibleIndicator.collapsed::before,
180
- .ht_nestingButton.ht_nestingExpand::before {
181
- ${Lt(n,"collapseOn")}
182
- }
183
-
184
- .htUIRadio > input[type="radio"]::after {
185
- ${Lt(n,"radio")}
186
- }
187
-
188
- .ht-multi-select-chip-remove::before {
189
- ${Lt(n,"chipClose")}
190
- }
191
-
192
- .ht-notification__close::before {
193
- ${Lt(n,"chipClose")}
194
- }
195
-
196
- .ht-multi-select-editor-search-icon {
197
- ${Lt(n,"search")}
198
- }
199
-
200
- .ht-multi-select-editor-item-selected input::after {
201
- ${Lt(n,"checkbox")}
202
- }`,YE="--ht-",lK=["font-family"],hK=["tokens.","colors.","sizing.","density."];function cK(n){return typeof n=="string"&&hK.some(e=>n.includes(e))}function dK(n){return n.includes("tokens.")?`var(${YE}${Qp(n.split(".").slice(1).join("-"))})`:`var(${YE}${Qp(n.split(".").join("-"))})`}function uK(n,e){return`${YE}${n?`${n}-`:""}${Qp(e)}`}function Cu(n,e){if(cK(n))return dK(n);if(Array.isArray(n)){if(n.length>=2){const[t,o]=n;return typeof t=="string"&&typeof o=="string"?`light-dark(${Cu(t,e)}, ${Cu(o,e)})`:typeof t=="string"?Cu(t,e):typeof o=="string"?Cu(o,e):""}return Cu(n[0],e)}return e&&lK.includes(e)?String(n):Qp(n)}function fK(n,e,t){return`${uK(n,e)}: ${Cu(t,e)};`}function ap(n,e="",t=""){let o="";return Object.entries(n).forEach(([i,s])=>{const r=Qp(i),a=t?`${t}-${r}`:r;ie(s)?o+=ap(s,e,a):o+=`${fK(e,a,s)}
203
- `}),o}function wV(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gK(n,e){return e.get?e.get.call(n):e.value}function pK(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function bV(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function IA(n,e){var t=bV(n,e,"get");return gK(n,t)}function mK(n,e,t){wV(n,e),e.set(n,t)}function HA(n,e,t){var o=bV(n,e,"set");return pK(n,o,t),t}function AA(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function wK(n,e){wV(n,e),e.add(n)}const bK="ht-theme-";var ng=new WeakMap,YS=new WeakSet;class CK{getClassName(){return this.themeClassName}update(e){var t,o;this.hot&&(e.getThemeConfig===void 0&&Y('[ThemeManager] The "theme" option must be an instance of ThemeBuilder.'),this.themeConfig=e.getThemeConfig(),this.themeClassName=`${bK}${this.themeConfig.name}`,typeof e.subscribe=="function"&&((t=IA(o=this,ng))===null||t===void 0||t.call(o),HA(this,ng,e.subscribe(i=>{this.hot?.stylesHandler&&(this.themeConfig=i,AA(this,YS,OA).call(this),this.hot.stylesHandler.clearCache(),this.hot.render(),this.hot.runHooks("afterSetTheme",this.themeClassName,!1))}))),this.mount(),this.hot.runHooks("afterSetTheme",this.themeClassName,!0))}mount(){AA(this,YS,OA).call(this)}unmount(){this.themeStyles&&this.themeStyles.remove()}destroy(){var e,t;(e=IA(t=this,ng))===null||e===void 0||e.call(t),this.unmount(),this.hot.themeManager=null}constructor({hot:e,themeObject:t}){wK(this,YS),mK(this,ng,{writable:!0,value:void 0}),HA(this,ng,null),this.hot=e,this.update(t)}}function OA(){if(!this.themeConfig||!this.hot||!this.hot.rootDocument||!this.hot.rootWrapperElement)return;const n=this.themeConfig.colorScheme==="auto"?"light dark":this.themeConfig.colorScheme;this.themeStyles?this.themeStyles.textContent="":this.themeStyles=this.hot.rootDocument.createElement("style"),this.themeStyles.textContent=`:where(.${this.themeClassName}) {
204
- `,this.themeConfig.sizing&&(this.themeStyles.textContent+=ap(this.themeConfig.sizing,"sizing")),this.themeConfig.density&&this.themeConfig.density.type&&this.themeConfig.density.sizes&&this.themeConfig.density.sizes[this.themeConfig.density.type]&&(this.themeStyles.textContent+=ap(this.themeConfig.density.sizes[this.themeConfig.density.type],"density")),this.themeConfig.colors&&(this.themeStyles.textContent+=ap(this.themeConfig.colors,"colors")),this.themeConfig.tokens&&(this.themeStyles.textContent+=ap(this.themeConfig.tokens)),this.themeConfig.icons&&(this.themeStyles.textContent+=aK(this.themeConfig.icons)),this.themeStyles.textContent+=`}
205
- `,this.themeStyles.textContent+=`.${this.themeClassName} {
206
- color-scheme: ${n};
207
- }`,this.hot.rootWrapperElement&&this.hot.rootWrapperElement.querySelector("style")?this.hot.rootWrapperElement.querySelector("style").textContent=this.themeStyles.textContent:this.hot.rootWrapperElement.prepend(this.themeStyles)}function yK({hot:n,themeObject:e}){return new CK({hot:n,themeObject:e})}const _K={arrowRight:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.64648 10.9393L9.93938 7.64644L6.64648 4.35354' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A",arrowRightWithBar:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.9292 4.64188L8.27934 7.99203L4.9292 11.3422M11.0711 4.08353V11.3422' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E",arrowLeft:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.49268 11.2929L6.19978 8.00001L9.49268 4.70712' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A",arrowLeftWithBar:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.0713 4.64188L7.72115 7.99203L11.0713 11.3422M4.92936 4.08353L4.92936 11.3422' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E",arrowDown:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg opacity='0.6'%3E%3Cpath d='M11.5859 6L8.29304 9.29289L5.00015 6' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3C/svg%3E",menu:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.0002 6.66663C11.4262 6.66663 11.6487 7.15963 11.3917 7.47813L11.3537 7.52013L8.35372 10.5201C8.26762 10.6062 8.15307 10.6579 8.03156 10.6656C7.91005 10.6732 7.78992 10.6363 7.69372 10.5616L7.64672 10.5201L4.64672 7.52013L4.60522 7.47313L4.57822 7.43463L4.55122 7.38663L4.54272 7.36863L4.52922 7.33513L4.51322 7.28113L4.50822 7.25463L4.50322 7.22463L4.50122 7.19613V7.13713L4.50372 7.10813L4.50822 7.07813L4.51322 7.05213L4.52922 6.99813L4.54272 6.96463L4.57772 6.89863L4.61022 6.85363L4.64672 6.81313L4.69372 6.77163L4.73222 6.74463L4.78022 6.71763L4.79822 6.70913L4.83172 6.69563L4.88572 6.67963L4.91222 6.67463L4.94222 6.66963L4.97072 6.66763L11.0002 6.66663Z' fill='currentColor'/%3E%3C/svg%3E%0A",selectArrow:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.0002 6.66663C11.4262 6.66663 11.6487 7.15963 11.3917 7.47813L11.3537 7.52013L8.35372 10.5201C8.26762 10.6062 8.15307 10.6579 8.03156 10.6656C7.91005 10.6732 7.78992 10.6363 7.69372 10.5616L7.64672 10.5201L4.64672 7.52013L4.60522 7.47313L4.57822 7.43463L4.55122 7.38663L4.54272 7.36863L4.52922 7.33513L4.51322 7.28113L4.50822 7.25463L4.50322 7.22463L4.50122 7.19613V7.13713L4.50372 7.10813L4.50822 7.07813L4.51322 7.05213L4.52922 6.99813L4.54272 6.96463L4.57772 6.89863L4.61022 6.85363L4.64672 6.81313L4.69372 6.77163L4.73222 6.74463L4.78022 6.71763L4.79822 6.70913L4.83172 6.69563L4.88572 6.67963L4.91222 6.67463L4.94222 6.66963L4.97072 6.66763L11.0002 6.66663Z' fill='currentColor'/%3E%3C/svg%3E%0A",arrowNarrowUp:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.00008 12.6667L8.00008 3.33335M8.00008 3.33335L5.33342 6.00002M8.00008 3.33335L10.6667 6.00002' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A",arrowNarrowDown:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.00004 3.33331V12.6666M8.00004 12.6666L10.6667 9.99998M8.00004 12.6666L5.33337 9.99998' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A",check:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.33337 8.00002L6.66671 11.3334L13.3334 4.66669' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A",checkbox:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 8L7 10L11 6' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A",caretHiddenLeft:"data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.08482 1.35771L6.11503 1.3551H6.17649L6.2067 1.35771L6.23795 1.36239L6.26503 1.3676L6.32128 1.38427L6.35618 1.39833L6.42493 1.43479L6.4718 1.46864L6.51399 1.50667L6.55722 1.55562L6.58534 1.59573L6.61347 1.64573L6.62232 1.66448L6.63639 1.69937L6.65305 1.75562L6.65826 1.78323L6.66347 1.81448L6.66555 1.84417L6.66659 1.87489V8.12489C6.66659 8.56864 6.15305 8.80042 5.82128 8.53271L5.77753 8.49312L2.65253 5.36812C2.56286 5.27844 2.50899 5.15912 2.50103 5.03254C2.49307 4.90596 2.53157 4.78083 2.6093 4.68062L2.65253 4.63167L5.77753 1.50667L5.82649 1.46344L5.86659 1.43531L5.91659 1.40719L5.93534 1.39833L5.97024 1.38427L6.02649 1.3676L6.05409 1.36239L6.08482 1.35771Z' fill='currentColor'/%3E%3C/svg%3E",caretHiddenRight:"data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.33337 1.87499C3.33337 1.43124 3.84692 1.19947 4.17869 1.46718L4.22244 1.50676L7.34744 4.63176C7.43711 4.72145 7.49098 4.84077 7.49894 4.96735C7.5069 5.09392 7.4684 5.21905 7.39067 5.31926L7.34744 5.36822L4.22244 8.49322L4.17348 8.53645L4.13337 8.56457L4.08337 8.5927L4.06462 8.60155L4.02973 8.61562L3.97348 8.63228L3.94587 8.63749L3.91462 8.6427L3.88494 8.64478L3.85421 8.64582L3.82348 8.64478L3.79327 8.64218L3.76202 8.63749L3.73494 8.63228L3.67869 8.61562L3.64379 8.60155L3.57504 8.5651L3.52817 8.53124L3.48598 8.49322L3.44275 8.44426L3.41462 8.40416L3.3865 8.35416L3.37764 8.33541L3.36358 8.30051L3.34692 8.24426L3.34171 8.21666L3.3365 8.18541L3.33442 8.15572L3.33337 1.87499Z' fill='currentColor'/%3E%3C/svg%3E",caretHiddenUp:"data:image/svg+xml;charset=utf-8,%3Csvg width='8' height='8' viewBox='0 0 8 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.76425 2.43099C3.82165 2.3736 3.89801 2.33913 3.97902 2.33403C4.06003 2.32894 4.14012 2.35358 4.20425 2.40333L4.23558 2.43099L6.23558 4.43099L6.26325 4.46233L6.28125 4.48799L6.29925 4.51999L6.30492 4.53199L6.31392 4.55433L6.32458 4.59033L6.32792 4.60799L6.33125 4.62799L6.33258 4.64699L6.33325 4.66666L6.33258 4.68633L6.33092 4.70566L6.32792 4.72566L6.32458 4.74299L6.31392 4.77899L6.30492 4.80133L6.28158 4.84533L6.25992 4.87533L6.23558 4.90233L6.20425 4.92999L6.17858 4.94799L6.14658 4.96599L6.13458 4.97166L6.11225 4.98066L6.07625 4.99133L6.05858 4.99466L6.03858 4.99799L6.01958 4.99933L5.99992 4.99999H1.99992C1.71592 4.99999 1.56758 4.67133 1.73892 4.45899L1.76425 4.43099L3.76425 2.43099Z' fill='currentColor'/%3E%3C/svg%3E%0A",caretHiddenDown:"data:image/svg+xml;charset=utf-8,%3Csvg width='8' height='8' viewBox='0 0 8 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.9999 3C6.2839 3 6.43224 3.32867 6.2609 3.541L6.23557 3.569L4.23557 5.569C4.17817 5.62639 4.10181 5.66087 4.0208 5.66596C3.93979 5.67106 3.8597 5.64642 3.79557 5.59667L3.76424 5.569L1.76424 3.569L1.73657 3.53767L1.71857 3.512L1.70057 3.48L1.6949 3.468L1.6859 3.44567L1.67524 3.40967L1.6719 3.392L1.66857 3.372L1.66724 3.353V3.31367L1.6689 3.29433L1.6719 3.27433L1.67524 3.257L1.6859 3.221L1.6949 3.19867L1.71824 3.15467L1.7399 3.12467L1.76424 3.09767L1.79557 3.07L1.82124 3.052L1.85324 3.034L1.86524 3.02833L1.88757 3.01933L1.92357 3.00867L1.94124 3.00533L1.96124 3.002L1.98024 3.00067L5.9999 3Z' fill='currentColor'/%3E%3C/svg%3E%0A",collapseOff:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.33325 8H11.6666' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A",collapseOn:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M7.49988 11.6667C7.49988 11.9428 7.72374 12.1667 7.99988 12.1667C8.27602 12.1667 8.49988 11.9428 8.49988 11.6667V8.50002H11.6666C11.9427 8.50002 12.1666 8.27616 12.1666 8.00002C12.1666 7.72388 11.9427 7.50002 11.6666 7.50002H8.49988V4.33337C8.49988 4.05723 8.27602 3.83337 7.99988 3.83337C7.72374 3.83337 7.49988 4.05723 7.49988 4.33337V7.50002H4.33325C4.05711 7.50002 3.83325 7.72388 3.83325 8.00002C3.83325 8.27616 4.05711 8.50002 4.33325 8.50002H7.49988V11.6667Z' fill='currentColor'/%3E%3C/svg%3E%0A",radio:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='8' r='4' fill='currentColor'/%3E%3C/svg%3E%0A",chipClose:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4L4 12M4 4L12 12' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A",search:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32' fill='none'%3E%3Cg opacity='0.5'%3E%3Cpath d='M28 28L20 20M4 13.3333C4 14.559 4.24141 15.7727 4.71046 16.905C5.1795 18.0374 5.86699 19.0663 6.73367 19.933C7.60035 20.7997 8.62925 21.4872 9.76162 21.9562C10.894 22.4253 12.1077 22.6667 13.3333 22.6667C14.559 22.6667 15.7727 22.4253 16.905 21.9562C18.0374 21.4872 19.0663 20.7997 19.933 19.933C20.7997 19.0663 21.4872 18.0374 21.9562 16.905C22.4253 15.7727 22.6667 14.559 22.6667 13.3333C22.6667 12.1077 22.4253 10.894 21.9562 9.76162C21.4872 8.62925 20.7997 7.60035 19.933 6.73367C19.0663 5.86699 18.0374 5.1795 16.905 4.71046C15.7727 4.24141 14.559 4 13.3333 4C12.1077 4 10.894 4.24141 9.76162 4.71046C8.62925 5.1795 7.60035 5.86699 6.73367 6.73367C5.86699 7.60035 5.1795 8.62925 4.71046 9.76162C4.24141 10.894 4 12.1077 4 13.3333Z' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3C/svg%3E"},SK={white:"#ffffffff",black:"#000000ff",primary:{100:"#6180ffff",200:"#5573f0ff",300:"#4669f6ff",400:"#2e56fcff",500:"#1a42e8ff",600:"#1535bcff"},palette:{50:"#f7f7f9ff",100:"#e7e7e9ff",200:"#b9b9bbff",300:"#a3a3a3ff",400:"#68696cff",500:"#404144ff",600:"#313132ff",700:"#282829ff",800:"#222222ff",900:"#1e1e1fff",950:"#050506ff"},transparent:"#ffffff00"},vK={fontFamily:"Inter",fontSize:"14px",fontSizeSmall:"12px",lineHeight:"20px",lineHeightSmall:"18px",fontWeight:"400",letterSpacing:"0px",borderColor:["colors.palette.100","colors.palette.700"],accentColor:["colors.primary.500","colors.primary.300"],foregroundColor:["colors.palette.800","colors.palette.200"],foregroundSecondaryColor:["colors.palette.400","colors.palette.300"],backgroundColor:["colors.white","colors.palette.950"],backgroundSecondaryColor:["colors.palette.50","colors.palette.900"],placeholderColor:["colors.palette.300","colors.palette.400"],readOnlyColor:["colors.palette.400","colors.palette.300"],disabledColor:["colors.palette.300","colors.palette.400"],gapSize:"density.gap",iconSize:"sizing.size_4",tableTransition:"0.15s",wrapperBorderWidth:"0px",wrapperBorderRadius:"sizing.size_1",wrapperBorderColor:"tokens.borderColor",barForegroundColor:"tokens.foregroundColor",barBackgroundColor:"tokens.backgroundSecondaryColor",barHorizontalPadding:"density.barsHorizontal",barVerticalPadding:"density.barsVertical",shadowColor:["colors.palette.800","colors.palette.200"],shadowX:"sizing.size_0",shadowY:"sizing.size_2",shadowBlur:"sizing.size_4",shadowOpacity:"8%",cellHorizontalPadding:"density.cellHorizontal",cellVerticalPadding:"density.cellVertical",cellHorizontalBorderColor:"tokens.borderColor",cellVerticalBorderColor:"tokens.borderColor",cellSelectionBorderColor:"tokens.accentColor",cellSelectionBackgroundColor:["colors.primary.400","colors.primary.200"],cellSuccessBackgroundColor:"#37bc6c33",cellErrorBackgroundColor:"#fa4d3233",cellReadOnlyBackgroundColor:"tokens.backgroundSecondaryColor",cellAutofillSize:"sizing.size_1_5",cellAutofillHitAreaSize:"sizing.size_3",cellAutofillBorderWidth:"sizing.size_0_25",cellAutofillBorderRadius:"sizing.size_1",cellAutofillBorderColor:"tokens.backgroundColor",cellAutofillBackgroundColor:"tokens.accentColor",cellAutofillFillBorderColor:"tokens.foregroundColor",cellEditorBorderWidth:"2px",cellEditorBorderColor:"tokens.accentColor",cellEditorForegroundColor:["colors.palette.950","colors.white"],cellEditorBackgroundColor:"tokens.backgroundColor",cellEditorShadowBlurRadius:"0px",cellEditorShadowColor:"tokens.accentColor",cellMobileHandleSize:"sizing.size_3",cellMobileHandleBorderWidth:"sizing.size_0_25",cellMobileHandleBorderRadius:"sizing.size_3",cellMobileHandleBorderColor:"tokens.accentColor",cellMobileHandleBackgroundColor:"tokens.accentColor",cellMobileHandleBackgroundOpacity:"40%",headerFontWeight:"tokens.fontWeight",headerForegroundColor:"tokens.foregroundColor",headerBackgroundColor:"tokens.backgroundSecondaryColor",headerHighlightedShadowSize:"0px",headerHighlightedForegroundColor:["colors.palette.950","colors.white"],headerHighlightedBackgroundColor:["colors.palette.100","colors.palette.700"],headerActiveBorderColor:["colors.primary.400","colors.primary.200"],headerActiveForegroundColor:"colors.white",headerActiveBackgroundColor:"tokens.accentColor",headerFilterBackgroundColor:"tokens.cellSuccessBackgroundColor",headerRowForegroundColor:"tokens.foregroundColor",headerRowBackgroundColor:"tokens.backgroundSecondaryColor",headerRowHighlightedForegroundColor:["colors.palette.950","colors.white"],headerRowHighlightedBackgroundColor:["colors.palette.100","colors.palette.700"],headerRowActiveForegroundColor:"colors.white",headerRowActiveBackgroundColor:"tokens.accentColor",rowHeaderOddBackgroundColor:"tokens.headerRowBackgroundColor",rowHeaderEvenBackgroundColor:"tokens.headerRowBackgroundColor",rowCellOddBackgroundColor:"tokens.backgroundColor",rowCellEvenBackgroundColor:"tokens.backgroundColor",buttonBorderRadius:"sizing.size_1",buttonHorizontalPadding:"density.buttonHorizontal",buttonVerticalPadding:"density.buttonVertical",primaryButtonBorderColor:"colors.transparent",primaryButtonForegroundColor:"colors.white",primaryButtonBackgroundColor:"tokens.accentColor",primaryButtonDisabledBorderColor:"colors.transparent",primaryButtonDisabledForegroundColor:"tokens.disabledColor",primaryButtonDisabledBackgroundColor:["colors.palette.100","colors.palette.700"],primaryButtonHoverBorderColor:"colors.transparent",primaryButtonHoverForegroundColor:"tokens.backgroundColor",primaryButtonHoverBackgroundColor:["colors.primary.600","colors.primary.100"],primaryButtonFocusBorderColor:"tokens.backgroundColor",primaryButtonFocusForegroundColor:"tokens.backgroundColor",primaryButtonFocusBackgroundColor:"tokens.accentColor",secondaryButtonBorderColor:"tokens.borderColor",secondaryButtonForegroundColor:"tokens.foregroundColor",secondaryButtonBackgroundColor:"tokens.backgroundColor",secondaryButtonDisabledBorderColor:"tokens.borderColor",secondaryButtonDisabledForegroundColor:"tokens.disabledColor",secondaryButtonDisabledBackgroundColor:["colors.palette.100","colors.palette.700"],secondaryButtonHoverBorderColor:"tokens.borderColor",secondaryButtonHoverForegroundColor:"tokens.foregroundColor",secondaryButtonHoverBackgroundColor:["colors.palette.100","colors.palette.700"],secondaryButtonFocusBorderColor:"tokens.borderColor",secondaryButtonFocusForegroundColor:"tokens.foregroundColor",secondaryButtonFocusBackgroundColor:"tokens.backgroundColor",iconButtonBorderRadius:"sizing.size_0_5",iconButtonLargeBorderRadius:"sizing.size_1",iconButtonLargePadding:"sizing.size_1",iconButtonBorderColor:["colors.palette.50","colors.palette.900"],iconButtonBackgroundColor:"tokens.backgroundSecondaryColor",iconButtonIconColor:["colors.palette.300","colors.palette.400"],iconButtonHitAreaSize:"sizing.size_6",iconButtonHoverBorderColor:["colors.palette.100","colors.palette.700"],iconButtonHoverBackgroundColor:["colors.palette.100","colors.palette.700"],iconButtonHoverIconColor:["colors.palette.300","colors.palette.400"],iconButtonActiveBorderColor:["colors.primary.400","colors.primary.200"],iconButtonActiveBackgroundColor:"tokens.accentColor",iconButtonActiveIconColor:"colors.white",iconButtonActiveHoverBorderColor:["colors.primary.400","colors.primary.200"],iconButtonActiveHoverBackgroundColor:["colors.primary.400","colors.primary.200"],iconButtonActiveHoverIconColor:"colors.white",collapseButtonBorderRadius:"sizing.size_1",collapseButtonOpenBorderColor:["colors.palette.200","colors.palette.500"],collapseButtonOpenBackgroundColor:["colors.white","colors.palette.950"],collapseButtonOpenIconColor:["colors.palette.400","colors.palette.300"],collapseButtonOpenIconActiveColor:["colors.palette.400","colors.palette.300"],collapseButtonOpenHoverBorderColor:["colors.palette.200","colors.palette.500"],collapseButtonOpenHoverBackgroundColor:["colors.palette.50","colors.palette.900"],collapseButtonOpenHoverIconColor:["colors.palette.400","colors.palette.300"],collapseButtonOpenHoverIconActiveColor:["colors.palette.400","colors.palette.300"],collapseButtonCloseBorderColor:["colors.palette.200","colors.palette.500"],collapseButtonCloseBackgroundColor:["colors.palette.100","colors.palette.700"],collapseButtonCloseIconColor:["colors.palette.400","colors.palette.300"],collapseButtonCloseIconActiveColor:["colors.palette.400","colors.palette.300"],collapseButtonCloseHoverBorderColor:["colors.palette.200","colors.palette.500"],collapseButtonCloseHoverBackgroundColor:["colors.palette.100","colors.palette.700"],collapseButtonCloseHoverIconColor:["colors.palette.400","colors.palette.300"],collapseButtonCloseHoverIconActiveColor:["colors.palette.400","colors.palette.300"],linkColor:["colors.primary.600","colors.primary.100"],linkHoverColor:"tokens.accentColor",inputBorderWidth:"1px",inputBorderRadius:"sizing.size_1",inputHorizontalPadding:"density.inputHorizontal",inputVerticalPadding:"density.inputVertical",inputBorderColor:"tokens.borderColor",inputForegroundColor:"tokens.foregroundColor",inputBackgroundColor:"tokens.backgroundSecondaryColor",inputHoverBorderColor:"tokens.borderColor",inputHoverForegroundColor:"tokens.foregroundColor",inputHoverBackgroundColor:"tokens.backgroundColor",inputDisabledBorderColor:"tokens.borderColor",inputDisabledForegroundColor:"tokens.disabledColor",inputDisabledBackgroundColor:["colors.palette.200","colors.palette.500"],inputFocusBorderColor:"tokens.accentColor",inputFocusForegroundColor:"tokens.foregroundColor",inputFocusBackgroundColor:"tokens.backgroundColor",checkboxSize:"tokens.iconSize",checkboxBorderRadius:"sizing.size_1",checkboxBorderColor:["colors.palette.200","colors.palette.500"],checkboxBackgroundColor:"tokens.backgroundColor",checkboxIconColor:"colors.transparent",checkboxFocusBorderColor:["colors.palette.200","colors.palette.500"],checkboxFocusBackgroundColor:"tokens.backgroundColor",checkboxFocusIconColor:"colors.transparent",checkboxFocusRingColor:"tokens.accentColor",checkboxDisabledBorderColor:["colors.palette.200","colors.palette.500"],checkboxDisabledBackgroundColor:["colors.palette.100","colors.palette.700"],checkboxDisabledIconColor:"colors.transparent",checkboxCheckedBorderColor:["colors.primary.400","colors.primary.200"],checkboxCheckedBackgroundColor:"tokens.accentColor",checkboxCheckedIconColor:"colors.white",checkboxCheckedFocusBorderColor:"tokens.backgroundColor",checkboxCheckedFocusBackgroundColor:"tokens.accentColor",checkboxCheckedFocusIconColor:"colors.white",checkboxCheckedDisabledBorderColor:["colors.palette.200","colors.palette.500"],checkboxCheckedDisabledBackgroundColor:["colors.palette.100","colors.palette.700"],checkboxCheckedDisabledIconColor:"tokens.disabledColor",checkboxIndeterminateBorderColor:["colors.primary.400","colors.primary.200"],checkboxIndeterminateBackgroundColor:"tokens.accentColor",checkboxIndeterminateIconColor:"colors.white",checkboxIndeterminateFocusBorderColor:"tokens.backgroundColor",checkboxIndeterminateFocusBackgroundColor:"tokens.accentColor",checkboxIndeterminateFocusIconColor:"colors.white",checkboxIndeterminateDisabledBorderColor:["colors.palette.200","colors.palette.600"],checkboxIndeterminateDisabledBackgroundColor:["colors.palette.200","colors.palette.500"],checkboxIndeterminateDisabledIconColor:"tokens.disabledColor",radioSize:"tokens.iconSize",radioBorderColor:["colors.palette.200","colors.palette.500"],radioBackgroundColor:"tokens.backgroundColor",radioIconColor:"colors.transparent",radioFocusBorderColor:"tokens.borderColor",radioFocusBackgroundColor:"tokens.backgroundColor",radioFocusIconColor:"colors.transparent",radioFocusRingColor:"tokens.accentColor",radioDisabledBorderColor:["colors.palette.200","colors.palette.500"],radioDisabledBackgroundColor:["colors.palette.100","colors.palette.700"],radioDisabledIconColor:"colors.transparent",radioCheckedBorderColor:"tokens.accentColor",radioCheckedBackgroundColor:"tokens.backgroundColor",radioCheckedIconColor:"tokens.accentColor",radioCheckedFocusBorderColor:["colors.primary.400","colors.primary.200"],radioCheckedFocusBackgroundColor:"tokens.backgroundColor",radioCheckedFocusIconColor:["colors.primary.400","colors.primary.200"],radioCheckedDisabledBorderColor:["colors.palette.200","colors.palette.500"],radioCheckedDisabledBackgroundColor:["colors.palette.100","colors.palette.700"],radioCheckedDisabledIconColor:"tokens.disabledColor",moveBacklightColor:["colors.palette.800","colors.palette.200"],moveBacklightOpacity:"8%",moveIndicatorColor:"tokens.accentColor",resizeIndicatorColor:["colors.palette.300","colors.palette.400"],hiddenIndicatorColor:["colors.palette.300","colors.palette.400"],menuBorderWidth:"1px",menuBorderRadius:"sizing.size_1",menuHorizontalPadding:"density.menuHorizontal",menuVerticalPadding:"density.menuVertical",menuItemHorizontalPadding:"density.menuItemHorizontal",menuItemVerticalPadding:"density.menuItemVertical",menuBorderColor:"tokens.borderColor",menuShadowX:"tokens.shadowX",menuShadowY:"tokens.shadowY",menuShadowBlur:"tokens.shadowBlur",menuShadowColor:["colors.palette.950","colors.white"],menuShadowOpacity:"8%",menuItemHoverColor:["colors.palette.800","colors.palette.200"],menuItemHoverColorOpacity:"4%",menuItemActiveColor:"tokens.accentColor",menuItemActiveColorOpacity:"8%",commentsTextareaHorizontalPadding:"density.cellHorizontal",commentsTextareaVerticalPadding:"density.cellVertical",commentsTextareaBorderWidth:"1px",commentsTextareaBorderColor:"colors.transparent",commentsTextareaForegroundColor:"tokens.foregroundColor",commentsTextareaBackgroundColor:"tokens.backgroundSecondaryColor",commentsTextareaFocusBorderWidth:"1px",commentsTextareaFocusBorderColor:"tokens.accentColor",commentsTextareaFocusForegroundColor:"tokens.foregroundColor",commentsTextareaFocusBackgroundColor:"tokens.backgroundColor",commentsIndicatorSize:"sizing.size_1_5",commentsIndicatorColor:"tokens.accentColor",licenseHorizontalPadding:"tokens.barHorizontalPadding",licenseVerticalPadding:"tokens.barVerticalPadding",licenseForegroundColor:"tokens.barForegroundColor",licenseBackgroundColor:"tokens.barBackgroundColor",paginationBarForegroundColor:"tokens.barForegroundColor",paginationBarBackgroundColor:"tokens.barBackgroundColor",paginationBarHorizontalPadding:"tokens.barHorizontalPadding",paginationBarVerticalPadding:"tokens.barVerticalPadding",paginationButtonBorderColor:"tokens.paginationBarBackgroundColor",paginationButtonForegroundColor:"tokens.foregroundSecondaryColor",paginationButtonBackgroundColor:"tokens.paginationBarBackgroundColor",paginationButtonHoverBorderColor:["colors.palette.100","colors.palette.700"],paginationButtonHoverForegroundColor:"tokens.foregroundColor",paginationButtonHoverBackgroundColor:["colors.palette.100","colors.palette.700"],paginationButtonDisabledBorderColor:"tokens.paginationBarBackgroundColor",paginationButtonDisabledForegroundColor:"tokens.disabledColor",paginationButtonDisabledBackgroundColor:"tokens.paginationBarBackgroundColor",paginationButtonFocusBorderColor:"tokens.accentColor",paginationButtonFocusForegroundColor:"tokens.foregroundColor",paginationButtonFocusBackgroundColor:"tokens.paginationBarBackgroundColor",dialogSemiTransparentBackgroundColor:["colors.white","colors.palette.950"],dialogSemiTransparentBackgroundOpacity:"80%",dialogSolidBackgroundColor:["colors.white","colors.palette.950"],dialogContentPaddingHorizontal:"density.dialogHorizontal",dialogContentPaddingVertical:"density.dialogVertical",dialogContentBorderRadius:"sizing.size_2",dialogContentBackgroundColor:"tokens.backgroundSecondaryColor",notificationForegroundColor:"tokens.foregroundColor",notificationBackgroundColor:"tokens.backgroundColor",notificationBorderColor:"tokens.backgroundColor",notificationSuccessAccent:"#37bc6cff",notificationWarningAccent:"#fbe952ff",notificationErrorAccent:"#fa4d32ff",chipBackground:"tokens.backgroundSecondaryColor",chipBorderRadius:"sizing.size_0_5",chipVerticalPadding:"sizing.size_0",chipHorizontalPadding:"sizing.size_0_5",chipGap:"sizing.size_1",scrollbarBorderRadius:"sizing.size_2",scrollbarTrackColor:"tokens.backgroundSecondaryColor",scrollbarThumbColor:["colors.palette.300","colors.palette.400"]},RK={name:"main",density:"default",icons:_K,colors:SK,tokens:vK},{hasItem:EK,getItem:kK,getNames:TK,getValues:xK,register:MK}=ts("themes");function n_(n){return EK(n)}function YC(n){if(!n_(n)){Ie(`Theme "${n}" is not registered. Please ensure it is registered before using it.`);return}return kK(n)}function IK(){return TK()}function HK(){return xK()}function AK(n,e){let t=n,o=Jn(e);return typeof n=="string"&&ie(e)?o.name=n:ie(n)&&(o=Jn(n),t=o.name),{themeName:t,themeConfigObject:o}}function Zb(n,e){const{themeName:t,themeConfigObject:o}=AK(n,e),i=rK(o);return n_(t)?(Ie(`Theme "${t}" is already registered. Registration skipped.`),YC(t)):(MK(t,i),i)}let GS=null;const jS=new Map;function CV(n,e,t=!1){let o=this;const i=new $i(o);let s,r,a,l,h,c,d=!0;const u={...e.initialState,...e};T7(t)&&k7(this),this.rootContainer=n,this.rootWrapperElement=void 0,this.rootGridElement=void 0,this.rootPortalElement=void 0,this.rootElement=Qs(this)?n.ownerDocument.createElement("div"):n,this.rootDocument=n.ownerDocument,this.rootWindow=this.rootDocument.defaultView,Qs(this)&&(this.rootWrapperElement=this.rootDocument.createElement("div"),this.rootGridElement=this.rootDocument.createElement("div"),this.rootPortalElement=this.rootDocument.createElement("div"),V(this.rootElement,["ht-wrapper","handsontable"]),V(this.rootWrapperElement,"ht-root-wrapper"),V(this.rootGridElement,"ht-grid"),this.rootGridElement.appendChild(this.rootElement),this.rootWrapperElement.appendChild(this.rootGridElement),this.rootContainer.appendChild(this.rootWrapperElement),this.rootWrapperElement.__hotInstance=this,V(this.rootPortalElement,"ht-portal"),this.rootDocument.body.appendChild(this.rootPortalElement)),this.isDestroyed=!1,this.renderSuspendedCounter=0,this.executionSuspendedCounter=0;const f=u?.layoutDirection??"inherit",p=["rtl","ltr"].includes(f)?f:this.rootWindow.getComputedStyle(this.rootElement).direction;this.rootElement.setAttribute("dir",p),this.rootWrapperElement?.setAttribute("dir",p),this.isRtl=function(){return p==="rtl"},this.isLtr=function(){return!o.isRtl()},this.getDirectionFactor=function(){return o.isLtr()?1:-1},this.stylesHandler=new Wq({hot:o,rootElement:o.rootElement,rootDocument:o.rootDocument,onThemeChange:g=>{Qs(this)&&(re(this.rootWrapperElement,/ht-theme-.*/g),re(this.rootPortalElement,/ht-theme-.*/g),g&&(V(this.rootWrapperElement,g),V(this.rootPortalElement,g),getComputedStyle(this.rootWrapperElement).getPropertyValue("--ht-line-height")||Ie(`The "${g}" theme is enabled, but its stylesheets are missing or not imported correctly. Import the correct CSS files in order to use that theme.`)),this.view?._wt?.selectionManager?.refreshAllBorderHandleStyles())},injectCoreCss:typeof e?.injectCoreCss=="boolean"?e.injectCoreCss:!0}),this.themeManager=null,u.language=uj(u.language);const C=Object.fromEntries(Object.entries(u).filter(([g])=>!(de.getSingleton().isRegistered(g)||de.getSingleton().isDeprecated(g)))),y=new KB(o,C,[Kj,n8]),_=y.getTableMeta(),T=y.getGlobalMeta(),P=Wm();this.container=this.rootDocument.createElement("div"),this.rootElement.insertBefore(this.container,this.rootElement.firstChild),this.guid=`ht_${Q0()}`,jS.set(this.guid,this),this.columnIndexMapper=new DE,this.rowIndexMapper=new DE,this.columnIndexMapper.addLocalHook("indexesSequenceChange",g=>{o.runHooks("afterColumnSequenceChange",g)}),this.rowIndexMapper.addLocalHook("indexesSequenceChange",g=>{o.runHooks("afterRowSequenceChange",g)}),i.addEventListener(this.rootDocument.documentElement,"compositionstart",g=>{o.runHooks("beforeCompositionStart",g)}),r=new Pj(o);const $=ts(this.guid);$.register("cellRangeMapper",new s8({rowIndexMapper:this.rowIndexMapper,columnIndexMapper:this.columnIndexMapper})),(!this.rootElement.id||this.rootElement.id.substring(0,3)==="ht_")&&(this.rootElement.id=this.guid);const F=g=>{const{row:b,col:v}=g;return o._createCellCoords(b>=0?o.rowIndexMapper.getRenderableFromVisualIndex(b):b,v>=0?o.columnIndexMapper.getRenderableFromVisualIndex(v):v)},N=g=>{const{row:b,col:v}=g;return o._createCellCoords(b>=0?o.rowIndexMapper.getVisualFromRenderableIndex(b):b,v>=0?o.columnIndexMapper.getVisualFromRenderableIndex(v):v)},I=(g,b)=>{const v=b>g?1:-1,m=Math.min(g,b),w=Math.max(g,b),S=o.rowIndexMapper.getNearestNotHiddenIndex(g,v);return S===null||v===1&&S>w||v===-1&&S<m?null:S>=0?o.rowIndexMapper.getRenderableFromVisualIndex(S):S},j=(g,b)=>{const v=b>g?1:-1,m=Math.min(g,b),w=Math.max(g,b),S=o.columnIndexMapper.getNearestNotHiddenIndex(g,v);return S===null||v===1&&S>w||v===-1&&S<m?null:S>=0?o.columnIndexMapper.getRenderableFromVisualIndex(S):S};let U=new GB(_,{rowIndexMapper:o.rowIndexMapper,columnIndexMapper:o.columnIndexMapper,countCols:()=>o.countCols(),countRows:()=>o.countRows(),propToCol:g=>s.propToCol(g),isEditorOpened:()=>o.getActiveEditor()?o.getActiveEditor().isOpened():!1,countRenderableColumns:()=>this.view.countRenderableColumns(),countRenderableRows:()=>this.view.countRenderableRows(),countRowHeaders:()=>this.countRowHeaders(),countColHeaders:()=>this.countColHeaders(),countRenderableRowsInRange:(...g)=>this.view.countRenderableRowsInRange(...g),countRenderableColumnsInRange:(...g)=>this.view.countRenderableColumnsInRange(...g),getShortcutManager:()=>o.getShortcutManager(),createCellCoords:(g,b)=>o._createCellCoords(g,b),createCellRange:(g,b,v)=>o._createCellRange(g,b,v),visualToRenderableCoords:F,renderableToVisualCoords:N,findFirstNonHiddenRenderableRow:I,findFirstNonHiddenRenderableColumn:j,isDisabledCellSelection:(g,b)=>g<0||b<0?o.getSettings().disableVisualSelection:o.getCellMeta(g,b).disableVisualSelection});this.selection=U;const G=({hiddenIndexesChanged:g})=>{this.forceFullRender=!0,g&&this.selection.commit()};this.columnIndexMapper.addLocalHook("cacheUpdated",g=>{G(g),this.runHooks("afterColumnSequenceCacheUpdate",g)}),this.rowIndexMapper.addLocalHook("cacheUpdated",g=>{G(g),this.runHooks("afterRowSequenceCacheUpdate",g)}),this.selection.addLocalHook("afterSetRangeEnd",(g,b)=>{const v=Li(!1),m=this.selection.getSelectedRange(),{from:w,to:S}=m.current(),R=m.size()-1;this.runHooks("afterSelection",w.row,w.col,S.row,S.col,v,R),this.runHooks("afterSelectionByProp",w.row,o.colToProp(w.col),S.row,o.colToProp(S.col),v,R);const x=U.getSelectionSource();b&&!["loadData","updateData","deselect","shift"].includes(x)&&(!v.isTouched()||v.isTouched()&&!v.value)&&c.scrollTo(g);const L=U.isSelectedByRowHeader(),E=U.isSelectedByColumnHeader();L&&E?V(this.rootElement,["ht__selection--rows","ht__selection--columns"]):L?(re(this.rootElement,"ht__selection--columns"),V(this.rootElement,"ht__selection--rows")):E?(re(this.rootElement,"ht__selection--rows"),V(this.rootElement,"ht__selection--columns")):re(this.rootElement,["ht__selection--rows","ht__selection--columns"]),["shift","refresh","loadData","updateData","deselect"].includes(x)||l.closeEditor(null),["refresh","loadData","updateData","deselect"].includes(x)||(o.view.render(),l.prepareEditor())}),this.selection.addLocalHook("beforeSetFocus",g=>{this.runHooks("beforeSelectionFocusSet",g.row,g.col)}),this.selection.addLocalHook("afterSetFocus",g=>{const b=Li(!1);this.runHooks("afterSelectionFocusSet",g.row,g.col,b),(!b.isTouched()||b.isTouched()&&!b.value)&&c.scrollTo(g),l.closeEditor(),o.view.render(),l.prepareEditor()}),this.selection.addLocalHook("afterSelectionFinished",g=>{const b=g.length-1,{from:v,to:m}=g[b];this.runHooks("afterSelectionEnd",v.row,v.col,m.row,m.col,b),this.runHooks("afterSelectionEndByProp",v.row,o.colToProp(v.col),m.row,o.colToProp(m.col),b),["refresh","deselect"].includes(U.getSelectionSource())&&(o.view.render(),l.prepareEditor())}),this.selection.addLocalHook("afterIsMultipleSelection",g=>{const b=this.runHooks("afterIsMultipleSelection",g.value);g.value&&(g.value=b)}),this.selection.addLocalHook("afterDeselect",()=>{l.closeEditor(),o.view.render(),re(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this.runHooks("afterDeselect")}),this.selection.addLocalHook("beforeHighlightSet",()=>this.runHooks("beforeSelectionHighlightSet")).addLocalHook("beforeSetRangeStart",(...g)=>this.runHooks("beforeSetRangeStart",...g)).addLocalHook("beforeSetRangeStartOnly",(...g)=>this.runHooks("beforeSetRangeStartOnly",...g)).addLocalHook("beforeSetRangeEnd",(...g)=>this.runHooks("beforeSetRangeEnd",...g)).addLocalHook("beforeSelectColumns",(...g)=>this.runHooks("beforeSelectColumns",...g)).addLocalHook("afterSelectColumns",(...g)=>this.runHooks("afterSelectColumns",...g)).addLocalHook("beforeSelectRows",(...g)=>this.runHooks("beforeSelectRows",...g)).addLocalHook("afterSelectRows",(...g)=>this.runHooks("afterSelectRows",...g)).addLocalHook("beforeSelectAll",(...g)=>this.runHooks("beforeSelectAll",...g)).addLocalHook("afterSelectAll",(...g)=>this.runHooks("afterSelectAll",...g)).addLocalHook("beforeModifyTransformStart",(...g)=>this.runHooks("modifyTransformStart",...g)).addLocalHook("afterModifyTransformStart",(...g)=>this.runHooks("afterModifyTransformStart",...g)).addLocalHook("beforeModifyTransformFocus",(...g)=>this.runHooks("modifyTransformFocus",...g)).addLocalHook("afterModifyTransformFocus",(...g)=>this.runHooks("afterModifyTransformFocus",...g)).addLocalHook("beforeModifyTransformEnd",(...g)=>this.runHooks("modifyTransformEnd",...g)).addLocalHook("afterModifyTransformEnd",(...g)=>this.runHooks("afterModifyTransformEnd",...g)).addLocalHook("beforeRowWrap",(...g)=>this.runHooks("beforeRowWrap",...g)).addLocalHook("beforeColumnWrap",(...g)=>this.runHooks("beforeColumnWrap",...g)).addLocalHook("insertRowRequire",g=>this.alter("insert_row_above",g,1,"auto")).addLocalHook("insertColRequire",g=>this.alter("insert_col_start",g,1,"auto")),a={alter(g,b,v=1,m,w){if(o.runHooks("beforeAlter",g,b,v,m,w)===!1)return;const R=x=>{if(x.length===0)return[];const M=[...x];return M.sort(([E],[A])=>E===A?0:E>A?1:-1),Fi(M,(E,[A,W])=>{const H=E[E.length-1],[q,ge]=H,se=q+ge;if(A<=se){const Me=Math.max(W-(se-A),0);H[1]+=Me}else E.push([A,W]);return E},[M[0]])};switch(g){case"insert_row_below":case"insert_row_above":const x=o.countSourceRows();if(_.maxRows===x)return;const M=g==="insert_row_below"?"below":"above";b=b??(M==="below"?x:0);const{delta:L,startPhysicalIndex:E}=s.createRow(b,v,{source:m,mode:M});U.shiftRows(o.toVisualRow(E),L);break;case"insert_col_start":case"insert_col_end":const A=g==="insert_col_end"?"end":"start";b=b??(A==="end"?o.countSourceCols():0);const{delta:W,startPhysicalIndex:H}=s.createCol(b,v,{source:m,mode:A});if(W){if(Array.isArray(_.colHeaders)){const se=[o.toVisualColumn(H),0];se.length+=W,Array.prototype.splice.apply(_.colHeaders,se)}U.shiftColumns(o.toVisualColumn(H),W)}break;case"remove_row":const q=se=>{let Me=0;O(se,([xe,Je])=>{const De=ht(xe)?o.countRows()-1:Math.max(xe-Me,0);if(Number.isInteger(xe)&&(xe=Math.max(xe-Me,0)),!s.removeRow(xe,Je,m))return;if(U.isSelected()){const{row:rn}=o.getSelectedRangeActive().highlight;rn>=xe&&rn<=xe+Je-1&&l.closeEditor(!0)}const Vt=o.countRows(),Hn=_.fixedRowsTop;Hn>=De+1&&(_.fixedRowsTop-=Math.min(Je,Hn-De));const co=_.fixedRowsBottom;if(co&&De>=Vt-co&&(_.fixedRowsBottom-=Math.min(Je,co)),Vt===0)U.deselect();else if(m==="ContextMenu.removeRow"){const rn=U.getSelectedRange(),Yt=rn.pop();rn.clear().set(Yt.from).current().setTo(Yt.to),U.refresh()}else U.shiftRows(xe,-Je);Me+=Je})};Array.isArray(b)?q(R(b)):q([[b,v]]);break;case"remove_col":const ge=se=>{let Me=0;O(se,([xe,Je])=>{const De=ht(xe)?o.countCols()-1:Math.max(xe-Me,0);let et=o.toPhysicalColumn(De);if(Number.isInteger(xe)&&(xe=Math.max(xe-Me,0)),!s.removeCol(xe,Je,m))return;if(U.isSelected()){const{col:rn}=o.getSelectedRangeActive().highlight;rn>=xe&&rn<=xe+Je-1&&l.closeEditor(!0)}if(o.countCols()===0)U.deselect();else if(m==="ContextMenu.removeColumn"){const rn=U.getSelectedRange(),Yt=rn.pop();rn.clear().set(Yt.from).current().setTo(Yt.to),U.refresh()}else U.shiftColumns(xe,-Je);const co=_.fixedColumnsStart;co>=De+1&&(_.fixedColumnsStart-=Math.min(Je,co-De)),Array.isArray(_.colHeaders)&&(typeof et>"u"&&(et=-1),_.colHeaders.splice(et,Je)),Me+=Je})};Array.isArray(b)?ge(R(b)):ge([[b,v]]);break;default:Y(`There is no such action "${g}"`)}w||a.adjustRowsAndCols(),o.view.adjustElementsSize(),o.view.render()},adjustRowsAndCols(){const g=_.minRows,b=_.minSpareRows,v=_.minCols,m=_.minSpareCols;if(g){const w=o.countRows();w<g&&s.createRow(w,g-w,{source:"auto"})}if(b){const w=o.countEmptyRows(!0);if(w<b){const S=b-w,R=Math.min(S,_.maxRows-o.countSourceRows());s.createRow(o.countRows(),R,{source:"auto"})}}{let w;(v||m)&&(w=o.countEmptyCols(!0));let S=o.countCols();if(v&&!_.columns&&S<v){const R=v-S;w+=R,s.createCol(S,R,{source:"auto"})}if(m&&!_.columns&&o.dataType==="array"&&w<m){S=o.countCols();const R=m-w,x=Math.min(R,_.maxCols-S);s.createCol(S,x,{source:"auto"})}}},populateFromArray(g,b,v,m,w){let S,R,x,M;const L=[],E={},A=[],W=g.row,H=g.col;if(R=b.length,R===0)return!1;let q=0,ge=0;switch(ie(v)&&(q=v.col-H+1,ge=v.row-W+1),w){case"shift_down":const se=$b(b),Me=se.length,xe=Math.max(Me,q),Je=o.getData().slice(W),De=$b(Je).slice(H,H+xe);for(x=0;x<xe;x+=1)if(x<Me){for(S=0,R=se[x].length;S<ge-R;S+=1)se[x].push(se[x][S%R]);x<De.length?A.push(se[x].concat(De[x])):A.push(se[x].concat(new Array(Je.length).fill(null)))}else A.push(se[x%Me].concat(De[x]));o.populateFromArray(W,H,$b(A));break;case"shift_right":const et=b.length,Vt=Math.max(et,ge),Hn=o.getData().slice(W).map(eo=>eo.slice(H));for(S=0;S<Vt;S+=1)if(S<et){for(x=0,M=b[S].length;x<q-M;x+=1)b[S].push(b[S][x%M]);if(S<Hn.length)for(let eo=0;eo<Hn[S].length;eo+=1)b[S].push(Hn[S][eo]);else b[S].push(...new Array(Hn[0].length).fill(null))}else b.push(b[S%R].slice(0,Vt).concat(Hn[S]));o.populateFromArray(W,H,b);break;default:E.row=g.row,E.col=g.col;let co=0,rn=0,Yt=!0,Wo;const uo=m==="Autofill.fill"||m==="autofill.fill",_n=function(wl,bl=null){const Sr=b[wl%b.length];return bl!==null?Sr[bl%Sr.length]:Sr},At=b.length,_r=v?v.row-g.row+1:0;for(v?R=_r:R=Math.max(At,_r),S=0;S<R&&!(v&&E.row>v.row&&_r>At||!_.allowInsertRow&&E.row>o.countRows()-1||E.row>=_.maxRows);S++){const eo=S-co,wl=uo?S:eo,bl=_n(wl).length,Sr=v?v.col-g.col+1:0;if(v?M=Sr:M=Math.max(bl,Sr),E.col=g.col,Wo=o.getCellMeta(E.row,E.col),(m==="CopyPaste.paste"||m==="Autofill.fill"||m==="autofill.fill")&&Wo.skipRowOnPaste){co+=1,E.row+=1,m==="CopyPaste.paste"&&(R+=1);continue}for(rn=0,x=0;x<M&&!(v&&E.col>v.col&&Sr>bl||!_.allowInsertColumn&&E.col>o.countCols()-1||E.col>=_.maxCols);x++){if(Wo=o.getCellMeta(E.row,E.col),(m==="CopyPaste.paste"||m==="Autofill.fill"||m==="autofill.fill")&&Wo.skipColumnOnPaste){rn+=1,E.col+=1,m==="CopyPaste.paste"&&(M+=1);continue}if(Wo.readOnly&&m!=="UndoRedo.undo"){E.col+=1;continue}const kf=x-rn,sw=uo?x:kf,Cl=!!Wo.valueSetter;let oi=_n(wl,sw),Sn=o.getSourceDataAtCell(E.row,E.col)??null;if(oi!==null&&typeof oi=="object"){if(Array.isArray(oi)&&Sn===null&&(Sn=[]),!Cl&&(typeof Sn!="object"||Sn===null))Yt=!1,Wo.parsePastedValue&&m==="CopyPaste.paste"&&(Yt=!0);else if(Sn!==null){const ua=Jp(Array.isArray(Sn)?Sn:Sn[0]||Sn),cd=Jp(Array.isArray(oi)?oi:oi[0]||oi);Cl||bh(ua,cd)||Array.isArray(ua)&&Array.isArray(cd)?oi=Jn(oi):Yt=!1}}else!Cl&&Sn!==null&&typeof Sn=="object"&&(Yt=!1);Yt&&L.push([E.row,E.col,oi]),Yt=!0,E.col+=1}E.row+=1}o.setDataAtCell(L,null,null,m||"populateFromArray");break}}};function te(g){const b=MB(g);Sx(b)?(o.runHooks("beforeLanguageChange",b),T.language=b,o.runHooks("afterLanguageChange",b)):IB(g)}function Q(g,b){const v=g==="className"?o.rootElement:o.table;if(d)V(v,b);else{let m=[],w=[];T[g]&&(m=Array.isArray(T[g])?T[g]:YI(T[g])),b&&(w=Array.isArray(b)?b:YI(b));const S=UI(m,w),R=UI(w,m);S.length&&re(v,S),R.length&&V(v,R)}T[g]=b}this.init=function(){r.setData(_.data),o.runHooks("beforeInit"),(Qr()||ok())&&V(o.rootElement,"mobile"),this.updateSettings(u,!0),this.view=new I7(this),l=TE.getInstance(o,_,U),c=f8(o),h.init(),Qs(this)&&(zq(o.rootPortalElement),zG(u.licenseKey,this.rootWrapperElement,"19/05/2026")),o.runHooks("init"),this.render(),d&&o.rootElement.offsetParent===null&&z4(o.rootElement,()=>{o.view._wt.wtOverlays.updateLastSpreaderSize(),o.view.adjustElementsSize(),o.render()}),typeof d=="object"&&(o.runHooks("afterChange",d[0],d[1]),d=!1),o.runHooks("afterInit")};function be(g){let b;typeof g>"u"?(n_("main")?b=YC("main"):b=Zb(RK),b=YC("main")):typeof g.getThemeConfig!="function"?b=Zb(g):b=g,o.themeManager=yK({hot:o,themeObject:b})}function Oe(){let g=!1;return{validatorsInQueue:0,valid:!0,addValidatorToQueue(){this.validatorsInQueue+=1,g=!1},removeValidatorFormQueue(){this.validatorsInQueue=this.validatorsInQueue-1<0?0:this.validatorsInQueue-1,this.checkIfQueueIsEmpty()},onQueueEmpty(){},checkIfQueueIsEmpty(){this.validatorsInQueue===0&&g===!1&&(g=!0,this.onQueueEmpty(this.valid))}}}function Ve(g,b){return b?.isOpened()?N7(g,b.row,b.prop):!1}function Ke(g,b,v){if(!g.length){v();return}const m=o.getActiveEditor(),w=new Oe;let S=!0;w.onQueueEmpty=()=>{m&&S&&m._closeAfterDataChange&&Ve(g,m)&&m.cancelChanges(),v()};for(let R=g.length-1;R>=0;R--){const[x,M,,L]=g[R],E=s.propToCol(M);let A;Number.isInteger(E)?A=o.getCellMeta(x,E):A={...Object.getPrototypeOf(_),..._},o.getCellValidator(A)&&(w.addValidatorToQueue(),o.validateCell(L,A,(function(W,H){return function(q){typeof q!="boolean"&&Y("Validation error: result is not boolean"),q===!1&&H.allowInvalid===!1&&(S=!1,g.splice(W,1),H.valid=!0),w.removeValidatorFormQueue()}})(R,A),b))}w.checkIfQueueIsEmpty()}function He(g,b){for(let R=g.length-1;R>=0;R--){let x=!1;if(g[R]===null){g.splice(R,1);continue}if(!((g[R][2]===null||g[R][2]===void 0)&&(g[R][3]===null||g[R][3]===void 0))){if(_.allowInsertRow)for(;g[R][0]>o.countRows()-1;){const{delta:M}=s.createRow(void 0,void 0,{source:"auto"});if(M===0){x=!0;break}}if(o.dataType==="array"&&(!_.columns||_.columns.length===0)&&_.allowInsertColumn)for(;s.propToCol(g[R][1])>o.countCols()-1;){const{delta:M}=s.createCol(void 0,void 0,{source:"auto"});if(M===0){x=!0;break}}x||s.set(g[R][0],g[R][1],g[R][3])}}const v=g.length>0,m=l.getActiveEditor(),w=m?._closeAfterDataChange,S=Ve(g,m);v?(a.adjustRowsAndCols(),o.runHooks("beforeChangeRender",g,b),m?.isOpened()&&w&&S&&l.closeEditor(),o.view.adjustElementsSize(),o.render(),(m?.isOpened()&&w&&S||!m?.isOpened())&&l.prepareEditor(),o.runHooks("afterChange",g,b||"edit"),m&&ee(m.refreshValue)&&(!m.isOpened()||S)&&m.refreshValue()):o.render()}this._createCellCoords=function(g,b){return o.view._wt.createCellCoords(g,b)},this._createCellRange=function(g,b,v){return o.view._wt.createCellRange(g,b,v)},this.validateCell=function(g,b,v,m){let w=o.getCellValidator(b);function S(R,x=!0){if(!x||b.hidden===!0){v(R);return}const M=b.visualCol,L=b.visualRow,E=o.getCell(L,M,!0);if(E&&E.nodeName!=="TH"){const A=o.rowIndexMapper.getRenderableFromVisualIndex(L),W=o.columnIndexMapper.getRenderableFromVisualIndex(M);o.view._wt.getSetting("cellRenderer",A,W,E)}v(R)}FG(w)&&(w=(function(R){return function(x,M){M(R.test(x))}})(w)),_e(w)?(g=o.runHooks("beforeValidate",g,b.visualRow,b.prop,m),o._registerMicrotask(()=>{w.call(b,g,R=>{o&&(R=o.runHooks("afterValidate",R,g,b.visualRow,b.prop,m),b.valid=R,S(R),o.runHooks("postAfterValidate",R,g,b.visualRow,b.prop,m))})})):o._registerMicrotask(()=>{b.valid=!0,S(b.valid,!1)})};function Ye(g,b,v){return Array.isArray(g)?g:[[g,b,v]]}function bt(g,b){const v=o.runHooks("beforeChange",g,b||"edit"),m=g.filter(w=>w!==null);if(v===!1||m.length===0)return o.getActiveEditor()?.cancelChanges(),[];for(let w=m.length-1;w>=0;w--){const[S,R,,x]=m[w],M=s.propToCol(R);let L;Number.isInteger(M)?L=o.getCellMeta(S,M):L={...Object.getPrototypeOf(_),..._},m[w][3]=OS(x,L)}return m}this.setDataAtCell=function(g,b,v,m){const w=Ye(g,b,v),S=[];let R=m,x,M,L;for(x=0,M=w.length;x<M;x++){const[A,W,H]=w[x];typeof w[x]!="object"&&Y("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter"),typeof w[x][1]!="number"&&Y("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`"),W>=this.countCols()?L=W:L=s.colToProp(W),S.push([A,L,r.getAtCell(this.toPhysicalRow(A),W),H])}!R&&typeof g=="object"&&(R=b);const E=bt(S,R);o.runHooks("afterSetDataAtCell",E,R),Ke(E,R,()=>{He(E,R)})},this.setDataAtRowProp=function(g,b,v,m){const w=Ye(g,b,v),S=[];let R=m,x,M;for(x=0,M=w.length;x<M;x++){const[E,A,W]=w[x];S.push([E,A,r.getAtCell(this.toPhysicalRow(E),A),W])}!R&&typeof g=="object"&&(R=b);const L=bt(S,R);o.runHooks("afterSetDataAtRowProp",L,R),Ke(L,R,()=>{He(L,R)})},this.listen=function(){o&&!o.isListening()&&(jS.forEach(g=>{o!==g&&g.unlisten()}),GS=o.guid,o.runHooks("afterListen"))},this.unlisten=function(){this.isListening()&&(GS=null,o.runHooks("afterUnlisten"))},this.isListening=function(){return GS===o.guid},this.destroyEditor=function(g=!1,b=!0){l.closeEditor(g),o.view.render(),b&&U.isSelected()&&l.prepareEditor()},this.populateFromArray=function(g,b,v,m,w,S,R){typeof v=="object"&&typeof v[0]=="object"||Y("populateFromArray parameter `input` must be an array of arrays");const x=typeof m=="number"?o._createCellCoords(m,w):null;return a.populateFromArray(o._createCellCoords(g,b),v,x,S,R)},this.spliceCol=function(g,b,v,...m){return s.spliceCol(g,b,v,...m)},this.spliceRow=function(g,b,v,...m){return s.spliceRow(g,b,v,...m)},this.getSelected=function(){if(U.isSelected())return Mt(U.getSelectedRange(),({from:g,to:b})=>[g.row,g.col,b.row,b.col])},this.getSelectedLast=function(){const g=this.getSelected();let b;return g&&g.length>0&&(b=g[g.length-1]),b},this.getSelectedActive=function(){const g=this.getSelectedRangeActive();if(!g)return;const{from:b,to:v}=g;return[b.row,b.col,v.row,v.col]},this.getSelectedRange=function(){if(U.isSelected())return Array.from(U.getSelectedRange())},this.getSelectedRangeLast=function(){const g=this.getSelectedRange();let b;return g&&g.length>0&&(b=g[g.length-1]),b},this.getSelectedRangeActive=function(){return U.getActiveSelectedRange()},this.getActiveSelectionLayerIndex=function(){return U.getActiveSelectionLayerIndex()},this.emptySelectedCells=function(g){if(!U.isSelected()||this.countRows()===0||this.countCols()===0)return;const b=[];O(U.getSelectedRange(),v=>{if(v.isSingleHeader())return;const m=v.getTopStartCorner(),w=v.getBottomEndCorner(),S=Math.max(m.row,0),R=Math.min(w.row,this.countRows()-1),x=Math.max(m.col,0),M=Math.min(w.col,this.countCols()-1);S>R||x>M||Re(S,R,L=>{Re(x,M,E=>{this.getCellMeta(L,E).readOnly||b.push([L,E,null])})})}),b.length>0&&this.setDataAtCell(b,g)},this.isRenderSuspended=function(){return this.renderSuspendedCounter>0},this.suspendRender=function(){this.renderSuspendedCounter+=1},this.resumeRender=function(){const g=this.renderSuspendedCounter-1;this.renderSuspendedCounter=Math.max(g,0),!this.isRenderSuspended()&&g===this.renderSuspendedCounter&&o.view.render()},this.render=function(){this.view&&(this.forceFullRender=!0,this.isRenderSuspended()||o.view.render())},this.batchRender=function(g){this.suspendRender();const b=g();return this.resumeRender(),b},this.isExecutionSuspended=function(){return this.executionSuspendedCounter>0},this.suspendExecution=function(){this.executionSuspendedCounter+=1,this.columnIndexMapper.suspendOperations(),this.rowIndexMapper.suspendOperations()},this.resumeExecution=function(g=!1){const b=this.executionSuspendedCounter-1;this.executionSuspendedCounter=Math.max(b,0),(!this.isExecutionSuspended()&&b===this.executionSuspendedCounter||g)&&(this.columnIndexMapper.resumeOperations(),this.rowIndexMapper.resumeOperations())},this.batchExecution=function(g,b=!1){this.suspendExecution();const v=g();return this.resumeExecution(b),v},this.batch=function(g){this.suspendRender(),this.suspendExecution();const b=g();return this.resumeExecution(),this.resumeRender(),b},this.refreshDimensions=function(){if(!o.view)return;const g=o.view,{width:b,height:v}=g.getLastSize(),{width:m,height:w}=o.rootElement.getBoundingClientRect(),S=m!==b||w!==v;o.runHooks("beforeRefreshDimensions",{width:b,height:v},{width:m,height:w},S)!==!1&&((S||g._wt.wtOverlays.scrollableElement===o.rootWindow)&&(g.setLastSize(m,w),g.adjustElementsSize(),o.render()),o.runHooks("afterRefreshDimensions",{width:b,height:v},{width:m,height:w},S))},this.updateData=function(g,b){sA(g,v=>{s=v},v=>{s=v,o.columnIndexMapper.fitToLength(this.getInitialColumnCount()),o.rowIndexMapper.fitToLength(this.countSourceRows()),a.adjustRowsAndCols(),U.markSource("updateData"),U.refresh(),U.markEndSource()},{hotInstance:o,dataMap:s,dataSource:r,internalSource:"updateData",source:b,metaManager:y,firstRun:d})},this.loadData=function(g,b){sA(g,v=>{s=v},()=>{y.clearCellsCache(),o.initIndexMappers(),a.adjustRowsAndCols(),U.markSource("loadData"),U.refresh(),U.markEndSource(),d&&(d=[null,"loadData"])},{hotInstance:o,dataMap:s,dataSource:r,internalSource:"loadData",source:b,metaManager:y,firstRun:d})},this.getInitialColumnCount=function(){const g=_.columns;let b=0;if(Array.isArray(g))b=g.length;else if(_e(g))if(o.dataType==="array"){const v=this.countSourceCols();for(let m=0;m<v;m+=1)g(m)&&(b+=1)}else(o.dataType==="object"||o.dataType==="function")&&(b=s.colToPropCache.length);else if(ee(_.dataSchema)){const v=s.getSchema();b=Array.isArray(v)?v.length:tk(v)}else b=this.countSourceCols();return b},this.initIndexMappers=function(){this.columnIndexMapper.initToLength(this.getInitialColumnCount()),this.rowIndexMapper.initToLength(this.countSourceRows())},this.getData=function(g,b,v,m){return en(g)?s.getAll():s.getRange(o._createCellCoords(g,b),o._createCellCoords(v,m),s.DESTINATION_RENDERER)},this.getCopyableText=function(g,b,v,m){return s.getCopyableText(o._createCellCoords(g,b),o._createCellCoords(v,m))},this.getCopyableData=function(g,b){return s.getCopyable(g,s.colToProp(b))},this.getCopyableSourceData=function(g,b){return r.getCopyable(g,s.colToProp(b))},this.getSchema=function(){return s.getSchema()},this.updateSettings=function(g,b=!1){const v=(d?o.loadData:o.updateData).bind(this);let m=!1,w,S;ee(g.rows)&&Y('The "rows" setting is no longer supported. Do you mean startRows, minRows or maxRows?'),ee(g.cols)&&Y('The "cols" setting is no longer supported. Do you mean startCols, minCols or maxCols?'),ee(g.ganttChart)&&Y('Since 8.0.0 the "ganttChart" setting is no longer supported.'),ee(g.rowHeights)&&ee(g.minRowHeights)&&Ie("Both `rowHeights` and `minRowHeights` are defined in your configuration. As one is the alias of the other, only one of them can be used at a time. `rowHeights` will be used as the row height configuration.");for(w in g)if(!(w==="data"||w==="language"))if(w==="className")Q("className",g.className);else if(w==="tableClassName"&&o.table)Q("tableClassName",g.tableClassName),o.view._wt.wtOverlays.syncOverlayTableClassNames();else if(de.getSingleton().isRegistered(w)||de.getSingleton().isDeprecated(w)){const H=g[w];_e(H)?(de.getSingleton().addAsFixed(w,H,o),_[w]=H):Array.isArray(H)&&(de.getSingleton().add(w,H,o),_[w]=H)}else!b&&tn(g,w)&&(T[w]=g[w]);const R=LS(o.rootContainer),x=tn(g,"themeName"),M=tn(g,"theme");if(x&&M&&Ie("Both `theme` and `themeName` are defined in your configuration. These options are aliases and cannot be used together. The `themeName` option will be ignored."),b){let H;M&&typeof g.theme=="string"?H=g.theme:x&&typeof g.themeName=="string"&&g.themeName&&!M?(H=g.themeName,_.theme=g.themeName,_.themeName=void 0):R?H=R:o.themeManager&&(H=o.themeManager.getClassName()),o.useTheme(H)}else{const H=o.getCurrentThemeName();if(M&&typeof g.theme=="string"&&H!==g.theme)o.useTheme(g.theme),o.themeManager?.unmount();else if(x&&!M&&H!==g.themeName)_.theme=g.themeName,_.themeName=void 0,o.useTheme(g.themeName),o.themeManager?.unmount();else if(Qs(o)&&!R&&ie(g.theme))if(o.themeManager===null)be(g.theme),o.useTheme(o.themeManager.getClassName());else{let q;typeof g.theme.getThemeConfig!="function"?q=Zb(g.theme):q=g.theme,o.themeManager.update(q),o.useTheme(o.themeManager.getClassName())}}o.runHooks("hasExternalDataSource")===!0?(g.data&&Ie('The "data" setting is ignored when "hasExternalDataSource" returns `true`.'),b||tn(g,"data")||tn(g,"dataProvider")?v([],"updateSettings"):g.columns!==void 0&&(s.createMap(),o.initIndexMappers())):g.data===void 0&&_.data===void 0?v(null,"updateSettings"):g.data!==void 0?v(g.data,"updateSettings"):g.columns!==void 0&&(s.createMap(),o.initIndexMappers()),!d&&g.language&&te(g.language);const L=o.countCols(),E=_.columns;if(E&&_e(E)&&(m=!0),(g.cell!==void 0||g.cells!==void 0||g.columns!==void 0)&&y.clearCache(),L>0)for(w=0,S=0;w<L;w++){if(E){const H=m?E(w):E[S];H&&y.updateColumnMeta(S,H)}S+=1}ee(g.cell)&&nt(g.cell,H=>{o.setCellMetaObject(H.row,H.col,H)}),o.runHooks("afterCellMetaReset"),d&&XB(o,"init");let A=o.rootElement.style.height;A!==""&&(A=parseInt(o.rootElement.style.height,10)),b&&o.rootElement.getAttribute("style")&&o.rootElement.setAttribute("data-initialstyle",o.rootElement.getAttribute("style"));let W=g.height;if(typeof g.height<"u")if(_e(W)&&(W=W()),W=o.runHooks("beforeHeightChange",W),W===null){const H=o.rootElement.getAttribute("data-initialstyle");H&&(H.indexOf("height")>-1||H.indexOf("overflow")>-1)?o.rootElement.setAttribute("style",H):(o.rootElement.style.height="",o.rootElement.style.overflow="")}else W!==void 0&&(o.rootElement.style.height=isNaN(W)?`${W}`:`${W}px`,o.rootElement.style.overflow="clip");if(typeof g.width<"u"){let H=g.width;_e(H)&&(H=H()),H=o.runHooks("beforeWidthChange",H),o.rootElement.style.width=isNaN(H)?`${H}`:`${H}px`}b||(o.view&&(o.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked(),o.view._wt.exportSettingsAsClassNames(),o.view.invalidateIndexSizesCache()),U.updateHighlightClassNames(),o.runHooks("afterUpdateSettings",g)),a.adjustRowsAndCols(),o.view&&!d&&(o.render(),o.view._wt.wtOverlays.adjustElementsSize()),!b&&o.view&&(A===""||W===""||W===void 0)&&A!==W&&o.view._wt.wtOverlays.updateMainScrollableElements()},this.getValue=function(){const g=o.getSelectedRangeActive();if(_.getValue){if(_e(_.getValue))return _.getValue.call(o);if(g)return o.getData()[g.highlight.row][_.getValue]}else if(g)return o.getDataAtCell(g.highlight.row,g.highlight.col);return null},this.getSettings=function(){return _},this.clear=function(){this.selectAll(),this.emptySelectedCells()},this.alter=function(g,b,v,m,w){a.alter(g,b,v,m,w)},this.getCell=function(g,b,v=!1){let m=b,w=g;if(b>=0){if(this.columnIndexMapper.isHidden(this.toPhysicalColumn(b)))return null;m=this.columnIndexMapper.getRenderableFromVisualIndex(b)}if(g>=0){if(this.rowIndexMapper.isHidden(this.toPhysicalRow(g)))return null;w=this.rowIndexMapper.getRenderableFromVisualIndex(g)}return w===null||m===null||w===void 0||m===void 0?null:o.view.getCellAtCoords(o._createCellCoords(w,m),v)},this.getCoords=function(g){const b=this.view._wt.wtTable.getCoords(g);if(b===null)return null;const{row:v,col:m}=b;let w=v,S=m;return v>=0&&(w=this.rowIndexMapper.getVisualFromRenderableIndex(v)),m>=0&&(S=this.columnIndexMapper.getVisualFromRenderableIndex(m)),o._createCellCoords(w,S)},this.colToProp=function(g){return s.colToProp(g)},this.propToCol=function(g){return s.propToCol(g)},this.toVisualRow=g=>this.rowIndexMapper.getVisualFromPhysicalIndex(g),this.toVisualColumn=g=>this.columnIndexMapper.getVisualFromPhysicalIndex(g),this.toPhysicalRow=g=>this.rowIndexMapper.getPhysicalFromVisualIndex(g),this.toPhysicalColumn=g=>this.columnIndexMapper.getPhysicalFromVisualIndex(g),this.getDataAtCell=function(g,b){return s.get(g,s.colToProp(b))},this.getDataAtRowProp=function(g,b){return s.get(g,b)},this.getDataAtCol=function(g){const b=[],v=s.getRange(o._createCellCoords(0,g),o._createCellCoords(_.data.length-1,g),s.DESTINATION_RENDERER);for(let m=0;m<v.length;m+=1)for(let w=0;w<v[m].length;w+=1)b.push(v[m][w]);return b},this.getDataAtProp=function(g){const b=[],v=s.getRange(o._createCellCoords(0,s.propToCol(g)),o._createCellCoords(_.data.length-1,s.propToCol(g)),s.DESTINATION_RENDERER);for(let m=0;m<v.length;m+=1)for(let w=0;w<v[m].length;w+=1)b.push(v[m][w]);return b},this.getSourceData=function(g,b,v,m){let w;return g===void 0?w=r.getData():w=r.getByRange(o._createCellCoords(g,b),o._createCellCoords(v,m)),w},this.getSourceDataArray=function(g,b,v,m){let w;return g===void 0?w=r.getData(!0):w=r.getByRange(o._createCellCoords(g,b),o._createCellCoords(v,m),!0),w},this.getSourceDataAtCol=function(g){return r.getAtColumn(g)},this.setSourceDataAtCell=function(g,b,v,m){const w=Ye(g,b,v),S=this.hasHook("afterSetSourceDataAtCell"),R=[],x=(L,E)=>{const A=this.toVisualRow(L),W=this.toVisualColumn(E);return Number.isInteger(W)?this.getCellMeta(A,W):{...Object.getPrototypeOf(_),..._}};S&&O(w,([L,E,A])=>{const W=OS(A,x(L,E));R.push([L,E,r.getAtCell(L,E),W])}),O(w,([L,E,A])=>{const W=x(L,E),H=OS(A,W);qj(H,W,m??"setSourceDataAtCell")&&r.setAtCell(L,E,H)}),S&&this.runHooks("afterSetSourceDataAtCell",R,m),this.render();const M=o.getActiveEditor();M&&ee(M.refreshValue)&&M.refreshValue()},this.getSourceDataAtRow=function(g){return r.getAtRow(g)},this.getSourceDataAtCell=function(g,b){return r.getAtCell(g,b)},this.getDataAtRow=function(g){return s.getRange(o._createCellCoords(g,0),o._createCellCoords(g,this.countCols()-1),s.DESTINATION_RENDERER)[0]||[]},this.getDataType=function(g,b,v,m){const w=g===void 0?[0,0,this.countRows(),this.countCols()]:[g,b,v,m],[S,R]=w;let[,,x,M]=w,L=null,E=null;x===void 0&&(x=S),M===void 0&&(M=R);let A="mixed";return Re(Math.max(Math.min(S,x),0),Math.max(S,x),W=>{let H=!0;return Re(Math.max(Math.min(R,M),0),Math.max(R,M),q=>(E=this.getCellMeta(W,q).type,L?H=L===E:L=E,H)),A=H?E:"mixed",H}),A},this.removeCellMeta=function(g,b,v){const[m,w]=[this.toPhysicalRow(g),this.toPhysicalColumn(b)];let S=y.getCellMetaKeyValue(m,w,v);o.runHooks("beforeRemoveCellMeta",g,b,v,S)!==!1&&(y.removeCellMeta(m,w,v),o.runHooks("afterRemoveCellMeta",g,b,v,S)),S=null},this.spliceCellsMeta=function(g,b=0,...v){v.length>0&&!Array.isArray(v[0])&&Y("The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array."),b>0&&y.removeRow(this.toPhysicalRow(g),b),v.length>0&&O(v.reverse(),m=>{y.createRow(this.toPhysicalRow(g)),O(m,(w,S)=>this.setCellMetaObject(g,S,w))}),o.render()},this.setCellMetaObject=function(g,b,v){typeof v=="object"&&nt(v,(m,w)=>{this.setCellMeta(g,b,w,m)})},this.setCellMeta=function(g,b,v,m){if(o.runHooks("beforeSetCellMeta",g,b,v,m)===!1)return;let S=g,R=b;g<this.countRows()&&(S=this.toPhysicalRow(g)),b<this.countCols()&&(R=this.toPhysicalColumn(b)),y.setCellMeta(S,R,v,m),o.runHooks("afterSetCellMeta",g,b,v,m)},this.getCellsMeta=function(){return y.getCellsMeta()},this.getCellMeta=function(g,b,v={skipMetaExtension:!1}){let m=this.toPhysicalRow(g),w=this.toPhysicalColumn(b);return m===null&&(m=g),w===null&&(w=b),y.getCellMeta(m,w,{visualRow:g,visualColumn:b,...v})},this.getColumnMeta=function(g){return y.getColumnMeta(this.toPhysicalColumn(g))},this.getCellMetaAtRow=function(g){return y.getCellsMetaAtRow(g)},this.isColumnModificationAllowed=function(){return!(o.dataType==="object"||_.columns)},this.getCellRenderer=function(g,b){const v=typeof g=="number"?o.getCellMeta(g,b).renderer:g.renderer;return typeof v=="string"?IE(v):en(v)?IE("text"):v},this.getCellEditor=function(g,b){const v=typeof g=="number"?o.getCellMeta(g,b).editor:g.editor;return typeof v=="string"?kE(v):en(v)?kE("text"):v},this.getCellValidator=function(g,b){const v=typeof g=="number"?o.getCellMeta(g,b).validator:g.validator;return typeof v=="string"?O5(v):v},this.validateCells=function(g){this._validateCells(g)},this.validateRows=function(g,b){Array.isArray(g)||Y("validateRows parameter `rows` must be an array"),this._validateCells(b,g)},this.validateColumns=function(g,b){Array.isArray(g)||Y("validateColumns parameter `columns` must be an array"),this._validateCells(b,void 0,g)},this._validateCells=function(g,b,v){const m=new Oe;g&&(m.onQueueEmpty=g);let w=o.countRows()-1;for(;w>=0;){if(b!==void 0&&b.indexOf(w)===-1){w-=1;continue}let S=o.countCols()-1;for(;S>=0;){if(v!==void 0&&v.indexOf(S)===-1){S-=1;continue}m.addValidatorToQueue(),o.validateCell(o.getDataAtCell(w,S),o.getCellMeta(w,S),R=>{typeof R!="boolean"&&Y("Validation error: result is not boolean"),R===!1&&(m.valid=!1),m.removeValidatorFormQueue()},"validateCells"),S-=1}w-=1}m.checkIfQueueIsEmpty()},this.getRowHeader=function(g){let b=_.rowHeaders,v=g;return v!==void 0&&(v=o.runHooks("modifyRowHeader",v)),v===void 0?(b=[],Re(o.countRows()-1,m=>{b.push(o.getRowHeader(m))})):Array.isArray(b)&&b[v]!==void 0?b=b[v]:_e(b)?b=b(v):b&&typeof b!="string"&&typeof b!="number"&&(b=v+1),b},this.hasRowHeaders=function(){return!!_.rowHeaders},this.hasColHeaders=function(){if(_.colHeaders!==void 0&&_.colHeaders!==null)return!!_.colHeaders;for(let g=0,b=o.countCols();g<b;g++)if(o.getColHeader(g))return!0;return!1},this.getColHeader=function(g,b=-1){const v=o.runHooks("modifyColHeader",g);if(v===void 0){const x=[],M=o.countCols();for(let L=0;L<M;L++)x.push(o.getColHeader(L));return x}let m=_.colHeaders;const w=function(x){const M=[],L=o.countCols();let E=0;for(;E<L;E++)_e(_.columns)&&_.columns(E)&&M.push(E);return M[x]},S=o.toPhysicalColumn(v),R=w(S);return _.colHeaders===!1?m=null:_.columns&&_e(_.columns)&&_.columns(R)&&_.columns(R).title?m=_.columns(R).title:_.columns&&_.columns[S]&&_.columns[S].title?m=_.columns[S].title:Array.isArray(_.colHeaders)&&_.colHeaders[S]!==void 0?m=_.colHeaders[S]:_e(_.colHeaders)?m=_.colHeaders(S):_.colHeaders&&typeof _.colHeaders!="string"&&typeof _.colHeaders!="number"&&(m=D7(v)),m=o.runHooks("modifyColumnHeaderValue",m,g,b),m},this._getColWidthFromSettings=function(g){let b;if(g>=0&&(b=o.getCellMeta(0,g).width),(b===void 0||b===_.width)&&(b=_.colWidths),b!=null){switch(typeof b){case"object":b=b[g];break;case"function":b=b(g);break}typeof b=="string"&&(b=Number.parseInt(b,10))}return b},this.getColWidth=function(g,b){let v=o._getColWidthFromSettings(g);return v=o.runHooks("modifyColWidth",v,g,b),v===void 0&&(v=nf),v},this._getRowHeightFromSettings=function(g){const b=o.stylesHandler.getDefaultRowHeight(g);let v=_.rowHeights??_.minRowHeights;if(v!=null){switch(typeof v){case"object":v=v[g];break;case"function":v=v(g);break}typeof v=="string"&&(v=Number.parseInt(v,10))}return v!=null&&v<b?b:v},this.getRowHeight=function(g,b){let v=o._getRowHeightFromSettings(g);return v=o.runHooks("modifyRowHeight",v,g,b),v},this.countSourceRows=function(){return r.countRows()},this.countSourceCols=function(){return r.countFirstRowKeys()},this.countRows=function(){return s.getLength()},this.countCols=function(){const g=_.maxCols,b=this.columnIndexMapper.getNotTrimmedIndexesLength();return Math.min(g,b)},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(g=!1){let b=0;return dH(o.countRows()-1,v=>{if(o.isEmptyRow(v))b+=1;else if(g===!0)return!1}),b},this.countEmptyCols=function(g=!1){let b=0;return dH(o.countCols()-1,v=>{if(o.isEmptyCol(v))b+=1;else if(g===!0)return!1}),b},this.isEmptyRow=function(g){return _.isEmptyRow.call(o,g)},this.isEmptyCol=function(g){return _.isEmptyCol.call(o,g)},this.selectCell=function(g,b,v,m,w=!0,S=!0){return en(g)||en(b)?!1:this.selectCells([[g,b,v,m]],w,S)},this.selectCells=function(g=[[]],b=!0,v=!0){b===!1&&c.suspend();const m=U.selectCells(g);return m&&v&&o.listen(),c.resume(),m},this.selectColumns=function(g,b=g,v){return U.selectColumns(g,b,v)},this.selectRows=function(g,b=g,v){return U.selectRows(g,b,v)},this.deselectCell=function(){U.deselect()},this.selectAll=function(g=!0,b=g,v){c.skipNextScrollCycle(),U.selectAll(g,b,v)};const sn=(g,b)=>g.getNearestNotHiddenIndex(b,1,!0);this.scrollViewportTo=function(g,b){typeof g=="number"&&(g={row:arguments[0],col:arguments[1],verticalSnap:arguments[2]?"bottom":"top",horizontalSnap:arguments[3]?"end":"start",considerHiddenIndexes:arguments[4]??!0});const{row:v,col:m,considerHiddenIndexes:w}=g??{};let S=v,R=m;if(_e(b)&&this.addHookOnce("afterScroll",b),w===void 0||w){const E=Number.isInteger(v)&&v>=0,A=Number.isInteger(m)&&m>=0,W=E?sn(this.rowIndexMapper,v):void 0,H=A?sn(this.columnIndexMapper,m):void 0;if(W===null||H===null)return!1;S=E?o.rowIndexMapper.getRenderableFromVisualIndex(W):v,R=A?o.columnIndexMapper.getRenderableFromVisualIndex(H):m}const x=Number.isInteger(S),M=Number.isInteger(R);let L=!1;return x&&S>=0&&M&&R>=0?L=o.view.scrollViewport(o._createCellCoords(S,R),g.horizontalSnap,g.verticalSnap):x&&S>=0&&(M&&R<0||!M)?L=o.view.scrollViewportVertically(S,g.verticalSnap):M&&R>=0&&(x&&S<0||!x)&&(L=o.view.scrollViewportHorizontally(R,g.horizontalSnap)),_e(b)&&(L?this.view.render():(this.removeHook("afterScroll",b),this._registerMicrotask(()=>b()))),L},this.scrollToFocusedCell=function(g){if(!this.selection.isSelected())return!1;_e(g)&&this.addHookOnce("afterScroll",g);const{highlight:b}=this.getSelectedRangeActive(),v=this.scrollViewportTo(b.toObject());return v?this.view.render():_e(g)&&(this.removeHook("afterScroll",g),this._registerMicrotask(()=>g())),v},this.destroy=function(){o._clearTimeouts(),o._clearMicrotasks(),o.view&&o.view.destroy(),r&&r.destroy(),r=null,Qs(this)&&(Uq(),this.getFocusScopeManager().destroy(),o.themeManager?.destroy()),this.getShortcutManager().destroy(),$.clear(),y.clearCache(),jS.delete(this.guid),i.destroy(),l&&l.destroy(),o.rootContainer&&sl(o.rootContainer),o.rootPortalElement&&o.rootPortalElement.remove(),o.batchExecution(()=>{o.rowIndexMapper.destroy(),o.columnIndexMapper.destroy(),P.getItems().forEach(([,g])=>{g.destroy()}),P.clear(),o.runHooks("afterDestroy")},!0),de.getSingleton().destroy(o),nt(o,(g,b,v)=>{_e(g)?v[b]=D(b):b!=="guid"&&(v[b]=null)}),o.isDestroyed=!0,s&&s.destroy(),s=null,a=null,U=null,l=null,o=null};function D(g){return()=>{Y(`The "${g}" method cannot be called because this Handsontable instance has been destroyed`)}}this.getActiveEditor=function(){return l.getActiveEditor()},this.getFirstRenderedVisibleRow=function(){return o.view.getFirstRenderedVisibleRow()},this.getLastRenderedVisibleRow=function(){return o.view.getLastRenderedVisibleRow()},this.getFirstRenderedVisibleColumn=function(){return o.view.getFirstRenderedVisibleColumn()},this.getLastRenderedVisibleColumn=function(){return o.view.getLastRenderedVisibleColumn()},this.getFirstFullyVisibleRow=function(){return o.view.getFirstFullyVisibleRow()},this.getLastFullyVisibleRow=function(){return o.view.getLastFullyVisibleRow()},this.getFirstFullyVisibleColumn=function(){return o.view.getFirstFullyVisibleColumn()},this.getLastFullyVisibleColumn=function(){return o.view.getLastFullyVisibleColumn()},this.getFirstPartiallyVisibleRow=function(){return o.view.getFirstPartiallyVisibleRow()},this.getLastPartiallyVisibleRow=function(){return o.view.getLastPartiallyVisibleRow()},this.getFirstPartiallyVisibleColumn=function(){return o.view.getFirstPartiallyVisibleColumn()},this.getLastPartiallyVisibleColumn=function(){return o.view.getLastPartiallyVisibleColumn()},this.getPlugin=function(g){return P.getItem(mr(g))},this.getPluginName=function(g){return P.getId(g)},this.getInstance=function(){return o},this.addHook=function(g,b,v){de.getSingleton().add(g,b,o,v)},this.hasHook=function(g){return de.getSingleton().has(g,o)||de.getSingleton().has(g)},this.addHookOnce=function(g,b,v){de.getSingleton().once(g,b,o,v)},this.removeHook=function(g,b){de.getSingleton().remove(g,b,o)},this.runHooks=function(g,b,v,m,w,S,R){return de.getSingleton().run(o,g,b,v,m,w,S,R)},this.getTranslatedPhrase=function(g,b){return BB(_.language,g,b)},this.toHTML=()=>lH(this),this.toTableElement=()=>{const g=this.rootDocument.createElement("div");return g.insertAdjacentHTML("afterbegin",lH(this)),g.firstElementChild},this.timeouts=[],this.useTheme=g=>{const b=!!d;this.stylesHandler.useTheme(g);const v=this.stylesHandler.getThemeName();!b&&v&&(LS(this.rootContainer)&&(re(this.rootContainer,/ht-theme-.*/g),V(this.rootContainer,v)),o.render(),o.scrollViewportTo(0,0)),this.runHooks("afterSetTheme",v,b)},this.getCurrentThemeName=()=>this.stylesHandler.getThemeName(),this.getTableHeight=()=>this.rootElement.offsetHeight,this.getTableWidth=()=>this.rootElement.offsetWidth,this._registerTimeout=function(g,b=0){let v=g;return typeof v=="function"&&(v=setTimeout(v,b)),this.timeouts.push(v),v},this._clearTimeouts=function(){O(this.timeouts,g=>{clearTimeout(g)})},this.microtasks=[],this._registerMicrotask=function(g){const b={cancelled:!1};this.microtasks.push(b),this.rootWindow.queueMicrotask(()=>{b.cancelled||g()})},this._clearMicrotasks=function(){O(this.microtasks,g=>{g.cancelled=!0}),this.microtasks.length=0},this._getEditorManager=function(){return l},this._getDataSource=function(){return r},this._getMetaManager=function(){return y};const K=Dq({handleEvent(g,b){return b==="global"?!0:o.isListening()},beforeKeyDown:g=>this.runHooks("beforeKeyDown",g),afterKeyDown:g=>{this.isDestroyed||o.runHooks("afterDocumentKeyDown",g)},ownerWindow:this.rootWindow});this.addHook("beforeOnCellMouseDown",g=>{g.ctrlKey===!1&&g.metaKey===!1&&K.releasePressedKeys()}),this.getShortcutManager=function(){return K},h=new S8(o);const ye=Qs(this)?C8(o):null;this.getFocusManager=function(){return h},this.getFocusScopeManager=function(){return Qs(o)||Y("The FocusScopeManager is only available for the main Handsontable instance."),ye};const z=u.theme,Ee=u.themeName,Ge=LS(o.rootContainer);Qs(o)&&!Ge&&(ie(z)||!z&&!Ee)&&be(z),WF().forEach(g=>{const b=hk(g);P.addItem(g,new b(this))}),Eq(o),Qs(this)&&Tq(o),K.setActiveContextName("grid"),de.getSingleton().run(o,"construct")}const OK="base",DK="htTextEllipsis";function o_(n,e,t,o,i,s,r){const a=r.ariaTags,l=[],h=[],c=[],d=[];r._isBaseRendererCalled=!0,r.className&&V(e,r.className),r.readOnly?(l.push(r.readOnlyCellClassName),a&&d.push(XI())):a&&c.push(XI()[0]),r.valid===!1&&r.invalidCellClassName?(l.push(r.invalidCellClassName),a&&d.push(ZI())):(h.push(r.invalidCellClassName),a&&c.push(ZI()[0])),r.wordWrap===!1&&r.noWordWrapClassName&&l.push(r.noWordWrapClassName),!s&&r.placeholder&&l.push(r.placeholderCellClassName),r.textEllipsis&&l.push(DK),re(e,h),V(e,l),ta(e,c),fe(e,d)}o_.RENDERER_TYPE=OK;function DA(n,e,t){n.addEventListener(e,t,!1)}function NA(n,e,t){n.removeEventListener(e,t,!1)}function Aw(n){return n.ownerDocument.defaultView.getComputedStyle(n)}function yV(n,e={}){const t={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300,textContent:d=>d.value,...e},o=n.body,i=n.createTextNode(""),s=n.createElement("span");let r;function a(){i.textContent=t.textContent(r),s.style.position="absolute",s.style.fontSize=Aw(r).fontSize,s.style.fontFamily=Aw(r).fontFamily,s.style.whiteSpace="pre",o.appendChild(s);const d=parseInt(Aw(r)?.paddingInlineStart||0,10),u=parseInt(Aw(r)?.paddingInlineEnd||0,10),f=s.clientWidth+d+u+1;o.removeChild(s);const p=r.style;p.height=`${t.minHeight}px`,t.minWidth>f?p.width=`${t.minWidth}px`:f>t.maxWidth?p.width=`${t.maxWidth}px`:p.width=`${f}px`;const C=r.scrollHeight?r.scrollHeight-1:0;t.minHeight>C?p.height=`${t.minHeight}px`:t.maxHeight<C?(p.height=`${t.maxHeight}px`,p.overflowY="visible"):p.height=`${C}px`}function l(){n.defaultView.setTimeout(a,0)}function h(d){if(d&&d.minHeight)if(d.minHeight==="inherit")t.minHeight=r.clientHeight;else{const u=parseInt(d.minHeight,10);isNaN(u)||(t.minHeight=u)}if(d&&d.maxHeight)if(d.maxHeight==="inherit")t.maxHeight=r.clientHeight;else{const u=parseInt(d.maxHeight,10);isNaN(u)||(t.maxHeight=u)}if(d&&d.minWidth)if(d.minWidth==="inherit")t.minWidth=r.clientWidth;else{const u=parseInt(d.minWidth,10);isNaN(u)||(t.minWidth=u)}if(d&&d.maxWidth)if(d.maxWidth==="inherit")t.maxWidth=r.clientWidth;else{const u=parseInt(d.maxWidth,10);isNaN(u)||(t.maxWidth=u)}s.firstChild||(s.className="autoResize",s.style.display="inline-block",s.appendChild(i))}function c(d,u,f=!1){r=d,h(u),r.nodeName==="TEXTAREA"&&(r.style.resize="none",r.style.height=`${t.minHeight}px`,r.style.minWidth=`${t.minWidth}px`,r.style.maxWidth=`${t.maxWidth}px`,r.style.overflowY="hidden"),f&&(DA(r,"input",a),DA(r,"keydown",l)),a()}return{init:c,resize:a,unObserve(){NA(r,"input",a),NA(r,"keydown",l)}}}function PA(n,e){const t=wF(e),o=e.value.split(`
208
- `);let i=t,s=0;for(let r=0;r<o.length;r++){const a=o[r];r!==0&&(s+=o[r-1].length+1);const l=s+a.length;if(n==="home"?i=s:n==="end"&&(i=l),t<=l)break}Fy(e,i)}const NK="ht_editor_visible",Ow="ht_editor_hidden",LA="textEditor",PK="text";class gl extends ad{static get EDITOR_TYPE(){return PK}getValue(){return this.TEXTAREA.value}setValue(e){this.TEXTAREA.value=e}open(){this._opened=!0,this.refreshDimensions(),this.showEditableElement(),this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this._opened=!1,this.autoResize.unObserve(),Bb(this.hot.rootDocument.activeElement,this.hot.rootElement)&&this.hot.listen(),this.hideEditableElement(),this.unregisterShortcuts()}prepare(e,t,o,i,s,r){const a=this.state;if(super.prepare(e,t,o,i,s,r),!r.readOnly){this.refreshDimensions(!0);const{allowInvalid:l}=r;l&&!this.isOpened()&&(this.TEXTAREA.value=""),a!==Tn.FINISHED&&!this.isOpened()&&this.hideEditableElement()}}beginEditing(e,t){this.state===Tn.VIRGIN&&(this.TEXTAREA.value="",super.beginEditing(e,t))}focus(){this.TEXTAREA.select(),Fy(this.TEXTAREA,this.TEXTAREA.value.length)}createElements(e="textarea"){const{rootDocument:t}=this.hot;this.TEXTAREA=t.createElement(e),fe(this.TEXTAREA,[["data-hot-input",""],wr(-1)]),V(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.textareaStyle.overflowY="visible",this.TEXTAREA_PARENT=t.createElement("DIV"),V(this.TEXTAREA_PARENT,"handsontableInputHolder"),Se(this.TEXTAREA_PARENT,this.layerClass)&&re(this.TEXTAREA_PARENT,this.layerClass),V(this.TEXTAREA_PARENT,Ow),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.hot.rootElement.appendChild(this.TEXTAREA_PARENT)}hideEditableElement(){M4()&&(this.textareaStyle.textIndent="-99999px"),this.textareaStyle.overflowY="visible",this.textareaParentStyle.opacity="0",this.textareaParentStyle.height="1px",re(this.TEXTAREA_PARENT,this.layerClass),V(this.TEXTAREA_PARENT,Ow)}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 t=!1;Re(e.length-1,o=>{const i=e[o];if(Se(i,"handsontableEditor"))return t=!0,!1}),Se(this.TEXTAREA_PARENT,Ow)&&re(this.TEXTAREA_PARENT,Ow),t?(this.layerClass=NK,V(this.TEXTAREA_PARENT,this.layerClass)):(this.layerClass=this.getEditedCellsLayerClass(),V(this.TEXTAREA_PARENT,this.layerClass))}refreshValue(){const e=this.hot.toPhysicalRow(this.row),t=this.hot.getSourceDataAtCell(e,this.col);this.originalValue=t,this.setValue(t),this.refreshDimensions()}refreshDimensions(e=!1){if(this.state!==Tn.EDITING&&!e)return;if(this.TD=this.getEditedCell(),!this.TD){e||this.close();return}const{top:t,start:o,width:i,maxWidth:s,height:r,maxHeight:a}=this.getEditedCellRect();this.textareaParentStyle.top=`${t}px`,this.textareaParentStyle[this.hot.isRtl()?"right":"left"]=`${o}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,s),minHeight:Math.min(r,a),maxWidth:s,maxHeight:a},!0)}bindEvents(){cF()&&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===Tn.EDITING&&this.focus()}),this.addHook("afterRowResize",()=>{this.refreshDimensions(),this.state===Tn.EDITING&&this.focus()})}destroy(){this.eventManager.destroy(),this.clearHooks()}registerShortcuts(){const t=this.hot.getShortcutManager().getContext("editor"),o={runOnlyIf:()=>ee(this.hot.getSelected()),group:LA},i=()=>{this.hot.rootDocument.execCommand("insertText",!1,`
209
- `)};t.addShortcuts([{keys:[["Control","Enter"]],callback:()=>(i(),!1),runOnlyIf:s=>!this.hot.selection.isMultiple()&&!s.altKey},{keys:[["Meta","Enter"]],callback:()=>(i(),!1),runOnlyIf:()=>!this.hot.selection.isMultiple()},{keys:[["Alt","Enter"]],callback:()=>(i(),!1)},{keys:[["Home"]],callback:(s,[r])=>{PA(r,this.TEXTAREA)}},{keys:[["End"]],callback:(s,[r])=>{PA(r,this.TEXTAREA)}}],o)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(LA)}constructor(e){super(e),this.eventManager=new $i(this),this.autoResize=yV(this.hot.rootDocument),this.eventManager=new $i(this),this.createElements(),this.bindEvents(),this.hot.addHookOnce("afterDestroy",()=>this.destroy())}}const LK="text";function la(n,e,t,o,i,s,r){let a=s;!a&&r.placeholder&&(a=r.placeholder),a=yt(a),r.trimWhitespace&&(a=a.trim()),_h(e,a)}la.RENDERER_TYPE=LK;const WK="text",_V={CELL_TYPE:WK,editor:gl,renderer:la};ki(_V);ui(o_);bi.editors={BaseEditor:ad};function bi(n,e){const t=new CV(n,e||{},Rk);return t.init(),t}bi.Core=function(n,e={}){return new CV(n,e,Rk)};bi.DefaultSettings=qB();bi.hooks=de.getSingleton();bi.CellCoords=Zc;bi.CellRange=ff;bi.packageName="handsontable";bi.buildDate="19/05/2026 14:51:41";bi.version="17.1.0";bi.languages={dictionaryKeys:sj,getLanguageDictionary:FB,getLanguagesDictionaries:cj,registerLanguageDictionary:$B,getTranslatedPhrase:BB};bi.themes={hasTheme:n_,getTheme:YC,getThemeNames:IK,getThemes:HK,registerTheme:Zb};function GE(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,o=Array(e);t<e;t++)o[t]=n[t];return o}function $K(n){if(Array.isArray(n))return n}function FK(n){if(Array.isArray(n))return GE(n)}function BK(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function VK(n,e,t){return e=jC(e),XK(n,RV()?Reflect.construct(e,t||[],jC(n).constructor):e.apply(n,t))}function SV(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function WA(n,e){for(var t=0;t<e.length;t++){var o=e[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(n,eX(o.key),o)}}function vV(n,e,t){return e&&WA(n.prototype,e),t&&WA(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function GC(){return GC=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var o in t)({}).hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n},GC.apply(null,arguments)}function jC(n){return jC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},jC(n)}function zK(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&jE(n,e)}function RV(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(RV=function(){return!!n})()}function UK(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function YK(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var o,i,s,r,a=[],l=!0,h=!1;try{if(s=(t=t.call(n)).next,e!==0)for(;!(l=(o=s.call(t)).done)&&(a.push(o.value),a.length!==e);l=!0);}catch(c){h=!0,i=c}finally{try{if(!l&&t.return!=null&&(r=t.return(),Object(r)!==r))return}finally{if(h)throw i}}return a}}function GK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
210
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jK(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
211
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qK(n,e){if(n==null)return{};var t,o,i=KK(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(o=0;o<s.length;o++)t=s[o],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function KK(n,e){if(n==null)return{};var t={};for(var o in n)if({}.hasOwnProperty.call(n,o)){if(e.indexOf(o)!==-1)continue;t[o]=n[o]}return t}function XK(n,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 BK(n)}function jE(n,e){return jE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},jE(n,e)}function ZK(n,e){return $K(n)||YK(n,e)||EV(n,e)||GK()}function QK(n){return FK(n)||UK(n)||EV(n)||jK()}function JK(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}function eX(n){var e=JK(n,"string");return typeof e=="symbol"?e:e+""}function qE(n){"@babel/helpers - typeof";return qE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qE(n)}function EV(n,e){if(n){if(typeof n=="string")return GE(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?GE(n,e):void 0}}var qS=null,tX="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.",nX="Providing a component-based renderer using `hot-renderer`-annotated component is no longer supported. Pass your component using `renderer` prop of the `HotTable` or `HotColumn` component instead.",oX="Providing a component-based editor using `hot-editor`-annotated component is no longer supported. Pass your component using `editor` prop of the `HotTable` or `HotColumn` component instead.",iX="Unexpected children nodes found in HotTable component. Only HotColumn components are allowed.",sX="Unexpected children nodes found in HotColumn component. HotColumn components do not support any children.",rX="The Handsontable instance bound to this component was destroyed and cannot be used properly.",aX="hot-wrapper-editor-container";function hm(){if(typeof console<"u"){var n;(n=console).warn.apply(n,arguments)}}function KE(n){return $A(n,"hot-renderer")?(hm(nX),!0):$A(n,"hot-editor")?(hm(oX),!0):!1}function lX(n,e){var t=Zn.Children.toArray(n);return t.some(function(o){return o.type!==e})?(hm(iX),!0):!1}function hX(n){var e=Zn.Children.toArray(n);return e.length?(hm(sX),!0):!1}function $A(n,e){var t=Zn.Children.toArray(n);return t.some(function(o){return o.props[e]!==void 0})}function kV(n,e){if(!n||!e||typeof e=="boolean")return null;var t=Zn.createElement(e,null),o=TV({},!1);return o.className="".concat(aX," ").concat(o.className),X$.createPortal(Zn.createElement("div",o,t),n.body)}function cX(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document,t=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;e||(e=document),qS||(qS=e.createDocumentFragment());var i=o??e.createElement("DIV");return qS.appendChild(i),{portal:X$.createPortal(n,i,t),portalContainer:i}}function TV(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return{id:n.id||(e?"hot-"+Math.random().toString(36).substring(5):void 0),className:n.className||"",style:n.style||{}}}function dX(){return typeof window<"u"}function XE(n){return qE(n)==="object"&&n!==null}function FA(n){if(!XE(n))return!1;var e=Object.getPrototypeOf(n);return e===Object.prototype||e===null}function Dw(n){return Array.isArray(n)}function ZE(n,e){if(n===e)return!0;if(n instanceof RegExp||e instanceof RegExp)return!(n instanceof RegExp)||!(e instanceof RegExp)?!1:n.source===e.source&&n.flags===e.flags;if(Dw(n)&&Dw(e)){if(n.length!==e.length)return!1;for(var t=0;t<n.length;t++)if(!ZE(n[t],e[t]))return!1;return!0}if(Dw(n)||Dw(e)||!XE(n)||!XE(e)||!FA(n)||!FA(e))return!1;var o=Object.keys(n),i=Object.keys(e);if(o.length!==i.length)return!1;for(var s=0,r=o;s<r.length;s++){var a=r[s];if(!Object.prototype.hasOwnProperty.call(e,a)||!ZE(n[a],e[a]))return!1}return!0}function uX(n,e){var t=Zn.useRef(!1);Be.useEffect(function(){if(t.current)return n();t.current=!0},e)}var fX=["dataSchema","columns"],xV=(function(){function n(){SV(this,n)}return vV(n,null,[{key:"getSettings",value:(function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=o.prevProps,s=i===void 0?{}:i,r=o.isInit,a=r===void 0?!1:r,l=o.initOnlySettingKeys,h=l===void 0?[]:l,c=function(p){return!a&&fX.includes(p)?ZE(s[p],t[p]):!!(!a&&h.includes(p))},d={};for(var u in t)u!=="children"&&!c(u)&&t.hasOwnProperty(u)&&(d[u]=t[u]);return d})}])})(),MV=Be.createContext(void 0),gX=function(e){var t=e.children,o=Be.useRef([]),i=Be.useCallback(function(y,_){o.current[_]=y},[]),s=Be.useRef(new Map),r=Be.useRef(new Map),a=Be.useCallback(function(){return r.current.clear()},[]),l=Be.useRef(new Map),h=Be.useCallback(function(){return l.current.clear()},[]),c=Be.useRef(new Map),d=Be.useCallback(function(y){return function(T,P,$,F,N,I,j){var U="".concat($,"-").concat(F),G=T.guid,te="".concat(G,"-").concat(U),Q="".concat(U,"-").concat(G);if(r.current.has(U)&&(P.innerHTML=r.current.get(U).innerHTML),P&&!P.getAttribute("ghost-table")){for(var be=l.current.get(Q),Oe=c.current.get(te);P.firstChild;)P.removeChild(P.firstChild);if(be&&Oe)P.appendChild(Oe);else{var Ve=Zn.createElement(y,{instance:T,TD:P,row:$,col:F,prop:N,value:I,cellProperties:j}),Ke=cX(Ve,P.ownerDocument,Q,Oe),He=Ke.portal,Ye=Ke.portalContainer;c.current.set(te,Ye),P.appendChild(Ye),l.current.set(Q,He)}}return r.current.set("".concat($,"-").concat(F),P),P}},[]),u=Be.useRef(function(){}),f=Be.useCallback(function(y){u.current=y},[]),p=Be.useCallback(function(){u.current(QK(l.current.values()))},[]),C=Be.useMemo(function(){return{componentRendererColumns:s.current,columnsSettings:o.current,emitColumnSettings:i,getRendererWrapper:d,clearPortalCache:h,clearRenderedCellCache:a,setRenderersPortalManagerRef:f,pushCellPortalsIntoPortalManager:p}},[i,d,a,f,p]);return Zn.createElement(MV.Provider,{value:C},t)};function IV(){return Be.useContext(MV)}var HV=Be.createContext(void 0),pX=function(e){var t=e.columnIndex,o=e.getOwnerDocument,i=e.children,s=Be.useMemo(function(){return{columnIndex:t,getOwnerDocument:o}},[t,o]);return Zn.createElement(HV.Provider,{value:s},i)},mX=function(){return Be.useContext(HV)},wX=["close","focus","open"],bX=["getValue","setValue"],KS={open:"onOpen",close:"onClose",prepare:"onPrepare",focus:"onFocus"};function AV(n,e){return(function(t){function o(i){var s;return SV(this,o),s=VK(this,o,[i]),e.current=s,Object.getOwnPropertyNames(bi.editors.BaseEditor.prototype).forEach(function(r){if(!(r==="constructor"||bX.includes(r))){var a=bi.editors.BaseEditor.prototype[r];o.prototype[r]=(function(){for(var l,h,c=arguments.length,d=new Array(c),u=0;u<c;u++)d[u]=arguments[u];if(wX.includes(r)||(h=a.call.apply(a,[this].concat(d))),KS[r]&&(l=n.current)!==null&&l!==void 0&&l[KS[r]]){var f;h=(f=n.current[KS[r]]).call.apply(f,[this].concat(d))}return h}).bind(s)}}),s}return zK(o,t),vV(o,[{key:"focus",value:function(){}},{key:"getValue",value:function(){return this.value}},{key:"setValue",value:function(s){this.value=s}},{key:"open",value:function(){}},{key:"close",value:function(){}}])})(bi.editors.BaseEditor)}var CX=Be.createContext(void 0),OV=function(e){var t=e.hooksRef,o=e.hotCustomEditorInstanceRef,i=e.children;return Zn.createElement(CX.Provider,{value:{hooksRef:t,hotCustomEditorInstanceRef:o}},i)},yX=function(e){return e.type===DV},_X=["_columnIndex","_getOwnerDocument","children"],DV=function(e){var t=IV(),o=t.componentRendererColumns,i=t.emitColumnSettings,s=t.getRendererWrapper,r=mX(),a=r.columnIndex,l=r.getOwnerDocument,h=Be.useRef(null),c=Be.useRef(null);Be.useEffect(function(){var u=function(){return Object.keys(e).filter(function(y){return!_X.includes(y)}).reduce(function(y,_){return y[_]=e[_],y},{})},f=function(){var y=xV.getSettings(u());return e.renderer?(y.renderer=s(e.renderer),o.set(a,!0)):e.hotRenderer&&(y.renderer=e.hotRenderer),e.editor?y.editor=AV(h,c):e.hotEditor&&(y.editor=e.hotEditor),y},p=f();i(p,a),KE(e.children)||hX(e.children)});var d=kV(l(),e.editor);return Zn.createElement(OV,{hooksRef:h,hotCustomEditorInstanceRef:c},d)},SX="17.1.0",vX=Be.forwardRef(function(n,e){var t=Be.useState([]),o=ZK(t,2),i=o[0],s=o[1];return Be.useImperativeHandle(e,function(){return s}),Zn.createElement(Be.Fragment,null,i)});function RX(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var NV={exports:{}},XS,BA;function EX(){if(BA)return XS;BA=1;var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return XS=n,XS}var ZS,VA;function kX(){if(VA)return ZS;VA=1;var n=EX();function e(){}function t(){}return t.resetWarningCache=e,ZS=function(){function i(a,l,h,c,d,u){if(u!==n){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 s(){return i}var r={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:s,element:i,elementType:i,instanceOf:s,node:i,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:e};return r.PropTypes=r,r},ZS}NV.exports=kX()();var TX=NV.exports,QS=RX(TX),PV=Be.forwardRef(function(n,e){var t=Be.useRef(null),o=Be.useRef(null),i=Be.useRef(null),s=Be.useRef(null),r=Be.useRef(),a=IV(),l=Be.useCallback(function(){return!t.current||!t.current.isDestroyed?t.current:(console.warn(rX),null)},[t]),h=Be.useCallback(function(){return!t.current||t.current.isDestroyed},[t]),c=Be.useCallback(function(){a.clearRenderedCellCache(),a.componentRendererColumns.clear()},[a]),d=Be.useCallback(function(){return dX()?o.current?o.current.ownerDocument:document:null},[o]),u=function(){var T,P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},F=h()?[]:((T=l())===null||T===void 0||(T=T.getSettings())===null||T===void 0?void 0:T._initOnlySettings)||[],N=xV.getSettings(n,{prevProps:$,isInit:P,initOnlySettingKeys:F});return a.columnsSettings.length&&(N.columns=a.columnsSettings),n.renderer?(N.renderer=a.getRendererWrapper(n.renderer),a.componentRendererColumns.set("global",!0)):N.renderer=n.hotRenderer||IE("text"),n.editor?N.editor=AV(i,s):N.editor=n.hotEditor||kE("text"),N},f=function(T){var P,$;T&&((P=T.getPlugin("autoRowSize"))!==null&&P!==void 0&&P.enabled||($=T.getPlugin("autoColumnSize"))!==null&&$!==void 0&&$.enabled)&&a.componentRendererColumns.size>0&&hm(tX)};Be.useEffect(function(){var _=u(!0);return r.current=n,t.current=new bi.Core(o.current,_),t.current.addHook("beforeViewRender",function(){a.clearPortalCache(),a.clearRenderedCellCache()}),t.current.addHook("afterViewRender",function(){a.pushCellPortalsIntoPortalManager()}),t.current.init(),f(t.current),KE(n.children)||lX(n.children,DV),function(){var T;c(),(T=l())===null||T===void 0||T.destroy()}},[]),uX(function(){c();var _=l(),T=u(!1,r.current);r.current=n,_?.updateSettings(T,!1),f(_),KE(n.children)}),Be.useImperativeHandle(e,function(){return{get hotElementRef(){return o.current},get hotInstance(){return l()}}});var p=Be.Children.toArray(n.children).filter(yX).map(function(_,T){return Zn.createElement(pX,{columnIndex:T,getOwnerDocument:d,key:T},_)}),C=TV(n),y=kV(d(),n.editor);return Zn.createElement(Be.Fragment,null,Zn.createElement("div",GC({ref:o},C),p),Zn.createElement(vX,{ref:a.setRenderersPortalManagerRef}),Zn.createElement(OV,{hooksRef:i,hotCustomEditorInstanceRef:s},y))});PV.propTypes={style:QS.object,id:QS.string,className:QS.string};var xX=["children"],MX=Be.forwardRef(function(n,e){var t,o=n.children,i=qK(n,xX),s=(t=i.id)!==null&&t!==void 0?t:Be.useId();return Zn.createElement(gX,null,Zn.createElement(PV,GC({id:s},i,{ref:e}),o))});MX.version=SX;const zA="handsontableEditor",IX="handsontable";class xx extends gl{static get EDITOR_TYPE(){return IX}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(),Fy(this.TEXTAREA,0,this.TEXTAREA.value.length),this.htEditor.updateSettings({width:this.getTargetDropdownWidth(),height:this.getTargetDropdownHeight()}),this.refreshDimensions(),this.flipDropdownVerticallyIfNeeded(),this.flipDropdownHorizontallyIfNeeded()}close(){this.htEditor&&(this.htEditor.rootElement.style.display="none"),this.removeHooksByKey("beforeKeyDown"),super.close()}prepare(e,t,o,i,s,r){super.prepare(e,t,o,i,s,r);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(h,c){const d=this.getSourceData(c.row,c.col);d!==void 0&&a.setValue(d),a.hot.destroyEditor()},preventWheel:!0,layoutDirection:this.hot.isRtl()?"rtl":"ltr"};this.cellProperties.handsontable&&Fn(l,r.handsontable),this.htOptions=l}beginEditing(e,t){const o=this.hot.getSettings().onBeginEditing;o&&o()===!1||super.beginEditing(e,t)}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,t,o){if(this.htEditor&&this.htEditor.isListening()&&this.hot.listen(),this.htEditor&&this.htEditor.getSelectedActive()){const i=this.htEditor.getValue();i!==void 0&&this.setValue(i)}super.finishEditing(e,t,o)}flipDropdownVerticallyIfNeeded(){const{view:e}=this.hot,t=this.getEditedCellRect();let o=t.top;if(e.isVerticallyScrollableByWindow()){const a=e.getTableOffset().top-this.hot.rootWindow.scrollY;o=Math.max(o+a,0)}const i=this.getDropdownHeight(),s=e.getWorkspaceHeight()-o-t.height,r=i>s&&o>s+t.height;return r?this.flipDropdownVertically():this.unflipDropdownVertically(),{isFlipped:r,spaceAbove:o,spaceBelow:s}}flipDropdownVertically(){const e=this.htEditor.rootElement.style;e.position="absolute",e.top=`${-this.getDropdownHeight()}px`,this.isFlippedVertically=!0}unflipDropdownVertically(){const e=this.htEditor.rootElement.style;e.position="absolute",e.top="",this.isFlippedVertically=!1}flipDropdownHorizontallyIfNeeded(){const{view:e}=this.hot,t=this.getEditedCellRect();let o=t.start+t.width;if(e.isHorizontallyScrollableByWindow()){const a=e.getTableOffset().left-this.hot.rootWindow.scrollX;o=Math.max(o+a,0)}const i=this.getDropdownWidth(),s=e.getWorkspaceWidth()-o+t.width,r=i>s&&o>s;return r?this.flipDropdownHorizontally():this.unflipDropdownHorizontally(),{isFlipped:r,spaceInlineStart:o,spaceInlineEnd:s}}flipDropdownHorizontally(){const e=this.htEditor.rootElement.style,{width:t}=this.getEditedCellRect();e.position="absolute",e[this.hot.isRtl()?"right":"left"]=`${-(this.getDropdownWidth()-t)}px`,this.isFlippedHorizontally=!0}unflipDropdownHorizontally(){const e=this.htEditor.rootElement.style;e.position="absolute",e[this.hot.isRtl()?"right":"left"]="",this.isFlippedHorizontally=!1}getDropdownHeight(){return this.htEditor.getTableHeight()}getDropdownWidth(){return this.htEditor.getTableWidth()}getTargetDropdownWidth(){return this.htEditor.view.getTableWidth()}getTargetDropdownHeight(){return this.htEditor.view.getTableHeight()+1}assignHooks(){this.hot.addHook("afterDestroy",()=>{this.htEditor?.destroy()}),this.hot.addHook("afterSetTheme",(e,t)=>{t||this.close()})}registerShortcuts(){const t=this.hot.getShortcutManager().getContext("editor");super.registerShortcuts();const o={group:zA,relativeToGroup:fl,position:"before"},i=(s,r)=>{const a=this.htEditor;if(s!==void 0&&(s<0||this.isFlippedVertically&&s>a.countRows()-1?a.deselectCell():a.selectCell(s,0),a.getData().length))return r.preventDefault(),es(r),this.hot.listen(),this.TEXTAREA.focus(),!1};t.addShortcuts([{keys:[["ArrowUp"]],callback:s=>{const r=this.htEditor;let a,l;return!r.getSelectedActive()&&this.isFlippedVertically?a=r.countRows()-1:r.getSelectedActive()&&(this.isFlippedVertically?(l=r.getSelectedActive()[0],a=Math.max(0,l-1)):(l=r.getSelectedActive()[0],a=l-1)),i(a,s)},preventDefault:!1},{keys:[["ArrowDown"]],callback:s=>{const r=this.htEditor;let a,l;if(!r.getSelectedActive()&&!this.isFlippedVertically)a=0;else if(r.getSelectedActive()){if(this.isFlippedVertically)a=r.getSelectedActive()[0]+1;else if(!this.isFlippedVertically){const h=r.countRows()-1;l=r.getSelectedActive()[0],a=Math.min(h,l+1)}}return i(a,s)},preventDefault:!1}],o)}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(zA)}constructor(...e){super(...e),this.isFlippedVertically=!1,this.isFlippedHorizontally=!1}}function LV(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function HX(n,e){return e.get?e.get.call(n):e.value}function AX(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function WV(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function JS(n,e){var t=WV(n,e,"get");return HX(n,t)}function UA(n,e,t){LV(n,e),e.set(n,t)}function YA(n,e,t){var o=WV(n,e,"set");return AX(n,o,t),t}function GA(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function OX(n,e){LV(n,e),e.add(n)}const DX="autocomplete";var Nw=new WeakMap,ev=new WeakMap,tv=new WeakSet;class Mx extends xx{static get EDITOR_TYPE(){return DX}getValue(){const e=this.rawChoices.find(t=>{const o=this.stripValueIfNeeded(t);return($n(o)?o.value:o)===this.TEXTAREA.value});return ee(e)?e:this.TEXTAREA.value}createElements(){super.createElements(),V(this.htContainer,"autocompleteEditor"),V(this.htContainer,this.hot.rootWindow.navigator.platform.indexOf("Mac")===-1?"":"htMacScroll"),this.hot.getSettings().ariaTags&&fe(this.TEXTAREA,[a4(),JG(),sF("listbox"),u4()])}prepare(e,t,o,i,s,r){super.prepare(e,t,o,i,s,r),this.hot.getSettings().ariaTags&&fe(this.TEXTAREA,[ks("false"),f4(`${JS(this,Nw)}-listbox-${e}-${t}`)]),this.htOptions={...this.htOptions,valueGetter:a=>$n(a)?a.value:a}}open(){super.open();const e=this.cellProperties.trimDropdown===void 0?!0:this.cellProperties.trimDropdown,t=this.hot.getSettings().ariaTags,o=Array.isArray(this.cellProperties.source)?this.cellProperties.source:null,i=o?.length,{row:s,col:r}=this;this.showEditableElement(),this.focus(),this.addHook("beforeKeyDown",a=>this.onBeforeKeyDown(a)),this.htEditor.addHook("afterScroll",JS(this,ev)),this.htEditor.updateSettings({colWidths:e?[Cn(this.TEXTAREA)-2]:void 0,autoColumnSize:!0,renderer:(a,l,h,c,d,u,f)=>{la(a,l,h,c,d,u,f);const{filteringCaseSensitive:p,allowHtml:C,locale:y}=this.cellProperties,_=this.query;let T=yt(u),P,$;T&&!C&&(P=p===!0?T.indexOf(_):T.toLocaleLowerCase(y).indexOf(_.toLocaleLowerCase(y)),P!==-1&&($=T.substr(P,_.length),T=T.replace($,`<strong>${$}</strong>`))),t&&fe(l,[e4(),...o?[w4(i)]:[],...o?[b4(o.indexOf(u)+1)]:[],["id",`${this.htEditor.rootElement.id}_${h}-${c}`]]),l.innerHTML=T},afterSelectionEnd:(a,l)=>{if(t){const h=d=>{fe(d,[ek()]),fe(this.TEXTAREA,...g4(d.id))},c=this.htEditor.getCell(a,l,!0);c!==null?h(c):this.htEditor.addHookOnce("afterScrollVertically",()=>{const d=this.htEditor.getCell(a,l,!0);h(d)})}}}),t&&(fe(this.htEditor.view._wt.wtOverlays.wtTable.TABLE,...qa()),fe(this.htEditor.rootElement,[iF(),p4("polite"),m4("text"),["id",`${JS(this,Nw)}-listbox-${s}-${r}`]]),fe(this.TEXTAREA,...ks("true"))),this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)})}close(){this.removeHooksByKey("beforeKeyDown"),super.close(),this.hot.getSettings().ariaTags&&fe(this.TEXTAREA,[ks("false")])}discardEditor(e){super.discardEditor(e),this.hot.view.render()}queryChoices(e){const t=this.cellProperties.source;this.query=e,typeof t=="function"?t.call(this.cellProperties,e,o=>{this.rawChoices=o,this.updateChoicesList(this.stripValuesIfNeeded(o))}):Array.isArray(t)?(this.rawChoices=t,this.updateChoicesList(this.stripValuesIfNeeded(t))):this.updateChoicesList([])}updateChoicesList(e){const t=wF(this.TEXTAREA),o=F4(this.TEXTAREA),i=this.cellProperties.sortByRelevance,s=this.cellProperties.filter,r=this.stripValueIfNeeded(this.getValue()),a=$n(r)?r.value:r;let l=null,h=e;i||(h=h.toSorted());const c=[],d=this.cellProperties.locale,u=this.cellProperties.filteringCaseSensitive,f=u?a:a.toLocaleLowerCase(d);for(let p=0;p<h.length;p++){const C=$n(h[p])?gr(yt(h[p].value)):gr(yt(h[p]));if((u?C:C.toLocaleLowerCase(d)).indexOf(f)!==-1&&(c.push(p),s===!1))break}s===!1?r.length>0&&(l=c[0]):(h=c.map(p=>h[p]),l=h.indexOf(f)>-1?h.indexOf(f):0),this.strippedChoices=h,h.length===0?this.htEditor.rootElement.style.display="none":this.htEditor.rootElement.style.display="",this.htEditor.loadData($b([h])),h.length>0&&(this.updateDropdownDimensions(),this.flipDropdownVerticallyIfNeeded(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(l)),this.hot.listen(),Fy(this.TEXTAREA,t,t===o?void 0:o)}flipDropdownVerticallyIfNeeded(){const e=super.flipDropdownVerticallyIfNeeded(),{isFlipped:t,spaceAbove:o,spaceBelow:i}=e;return this.limitDropdownIfNeeded(t?o:i),e}limitDropdownIfNeeded(e){const t=this.getDropdownHeight();if(t>e){let o=0,i=0,s=null;do i=this.htEditor.stylesHandler.getDefaultRowHeight(),o+=i;while(o<e);s=o-i,this.isFlippedVertically&&(this.htEditor.rootElement.style.top=`${parseInt(this.htEditor.rootElement.style.top,10)+t-s}px`),this.setDropdownHeight(o-i)}}updateDropdownDimensions(){const e=B4(),t=this.getTargetEditorWidth()+e,o=this.getTargetEditorHeight()+e;this.htEditor.updateSettings({width:t,height:o}),GA(this,tv,jA).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}setDropdownHeight(e){this.htEditor.updateSettings({height:e}),GA(this,tv,jA).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()}getTargetEditorHeight(){let e=0;if(!this.hot.getCurrentThemeName()){const i=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore"));e=parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)}const t=Math.min(this.cellProperties.visibleRows,this.strippedChoices.length);return Array.from({length:t},(i,s)=>s).reduce((i,s)=>{const r=this.hot.stylesHandler.getDefaultRowHeight()+(s===0?1:0);return i+r},0)+e}getTargetEditorWidth(){let e=0;if(!this.hot.getCurrentThemeName()){const t=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore"));e=parseInt(t.borderInlineStartWidth,10)+parseInt(t.borderInlineEndWidth,10)}return this.htEditor.getColWidth(0)+e}stripValueIfNeeded(e){return this.stripValuesIfNeeded([e])[0]}stripValuesIfNeeded(e){const{allowHtml:t}=this.cellProperties,o=i=>yt(t?i:gr(i));return e.every(i=>$n(i))?e.map(i=>({key:o(i.key),value:o(i.value)})):e.map(i=>o(i))}onBeforeKeyDown(e){if(EF(e.keyCode)||e.keyCode===ke.BACKSPACE||e.keyCode===ke.DELETE||e.keyCode===ke.INSERT){let t=10;if(e.keyCode===ke.C&&(e.ctrlKey||e.metaKey))return;this.isOpened()||(t+=10),this.htEditor&&this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)},t)}}constructor(...e){super(...e),OX(this,tv),UA(this,Nw,{writable:!0,value:void 0}),UA(this,ev,{writable:!0,value:void 0}),this.query=null,this.strippedChoices=[],this.rawChoices=[],YA(this,Nw,this.hot.guid.slice(0,9)),YA(this,ev,Lm(()=>{this.focus()},100))}}function jA(){this.htEditor.view.hasVerticalScroll()&&this.htEditor.updateSettings({width:this.getTargetEditorWidth()+Mn(this.hot.rootDocument)})}const NX="checkbox";class $V extends ad{static get EDITOR_TYPE(){return NX}beginEditing(e,t){if(t&&t.type==="mouseup"&&t.target.nodeName==="TD"){const o=this.TD.querySelector('input[type="checkbox"]');Se(o,"htBadValue")||o.click()}}finishEditing(){}init(){}open(){}close(){}getValue(){}setValue(){}focus(){}}var FV;function Z(){return FV.apply(null,arguments)}function PX(n){FV=n}function br(n){return n instanceof Array||Object.prototype.toString.call(n)==="[object Array]"}function $c(n){return n!=null&&Object.prototype.toString.call(n)==="[object Object]"}function vt(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Ix(n){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(n).length===0;var e;for(e in n)if(vt(n,e))return!1;return!0}function xi(n){return n===void 0}function rl(n){return typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]"}function Ym(n){return n instanceof Date||Object.prototype.toString.call(n)==="[object Date]"}function BV(n,e){var t=[],o,i=n.length;for(o=0;o<i;++o)t.push(e(n[o],o));return t}function sh(n,e){for(var t in e)vt(e,t)&&(n[t]=e[t]);return vt(e,"toString")&&(n.toString=e.toString),vt(e,"valueOf")&&(n.valueOf=e.valueOf),n}function ha(n,e,t,o){return cz(n,e,t,o,!0).utc()}function LX(){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 Qe(n){return n._pf==null&&(n._pf=LX()),n._pf}var QE;Array.prototype.some?QE=Array.prototype.some:QE=function(n){var e=Object(this),t=e.length>>>0,o;for(o=0;o<t;o++)if(o in e&&n.call(this,e[o],o,e))return!0;return!1};function Hx(n){var e=null,t=!1,o=n._d&&!isNaN(n._d.getTime());if(o&&(e=Qe(n),t=QE.call(e.parsedDateParts,function(i){return i!=null}),o=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&t),n._strict&&(o=o&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(n))n._isValid=o;else return o;return n._isValid}function i_(n){var e=ha(NaN);return n!=null?sh(Qe(e),n):Qe(e).userInvalidated=!0,e}var qA=Z.momentProperties=[],nv=!1;function Ax(n,e){var t,o,i,s=qA.length;if(xi(e._isAMomentObject)||(n._isAMomentObject=e._isAMomentObject),xi(e._i)||(n._i=e._i),xi(e._f)||(n._f=e._f),xi(e._l)||(n._l=e._l),xi(e._strict)||(n._strict=e._strict),xi(e._tzm)||(n._tzm=e._tzm),xi(e._isUTC)||(n._isUTC=e._isUTC),xi(e._offset)||(n._offset=e._offset),xi(e._pf)||(n._pf=Qe(e)),xi(e._locale)||(n._locale=e._locale),s>0)for(t=0;t<s;t++)o=qA[t],i=e[o],xi(i)||(n[o]=i);return n}function Gm(n){Ax(this,n),this._d=new Date(n._d!=null?n._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),nv===!1&&(nv=!0,Z.updateOffset(this),nv=!1)}function Cr(n){return n instanceof Gm||n!=null&&n._isAMomentObject!=null}function VV(n){Z.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+n)}function xs(n,e){var t=!0;return sh(function(){if(Z.deprecationHandler!=null&&Z.deprecationHandler(null,n),t){var o=[],i,s,r,a=arguments.length;for(s=0;s<a;s++){if(i="",typeof arguments[s]=="object"){i+=`
212
- [`+s+"] ";for(r in arguments[0])vt(arguments[0],r)&&(i+=r+": "+arguments[0][r]+", ");i=i.slice(0,-2)}else i=arguments[s];o.push(i)}VV(n+`
213
- Arguments: `+Array.prototype.slice.call(o).join("")+`
214
- `+new Error().stack),t=!1}return e.apply(this,arguments)},e)}var KA={};function zV(n,e){Z.deprecationHandler!=null&&Z.deprecationHandler(n,e),KA[n]||(VV(e),KA[n]=!0)}Z.suppressDeprecationWarnings=!1;Z.deprecationHandler=null;function ca(n){return typeof Function<"u"&&n instanceof Function||Object.prototype.toString.call(n)==="[object Function]"}function WX(n){var e,t;for(t in n)vt(n,t)&&(e=n[t],ca(e)?this[t]=e:this["_"+t]=e);this._config=n,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function JE(n,e){var t=sh({},n),o;for(o in e)vt(e,o)&&($c(n[o])&&$c(e[o])?(t[o]={},sh(t[o],n[o]),sh(t[o],e[o])):e[o]!=null?t[o]=e[o]:delete t[o]);for(o in n)vt(n,o)&&!vt(e,o)&&$c(n[o])&&(t[o]=sh({},t[o]));return t}function Ox(n){n!=null&&this.set(n)}var e0;Object.keys?e0=Object.keys:e0=function(n){var e,t=[];for(e in n)vt(n,e)&&t.push(e);return t};var $X={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function FX(n,e,t){var o=this._calendar[n]||this._calendar.sameElse;return ca(o)?o.call(e,t):o}function ia(n,e,t){var o=""+Math.abs(n),i=e-o.length,s=n>=0;return(s?t?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+o}var Dx=/(\[[^\[]*\])|(\\)?([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,Pw=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ov={},Yu={};function Te(n,e,t,o){var i=o;typeof o=="string"&&(i=function(){return this[o]()}),n&&(Yu[n]=i),e&&(Yu[e[0]]=function(){return ia(i.apply(this,arguments),e[1],e[2])}),t&&(Yu[t]=function(){return this.localeData().ordinal(i.apply(this,arguments),n)})}function BX(n){return n.match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"")}function VX(n){var e=n.match(Dx),t,o;for(t=0,o=e.length;t<o;t++)Yu[e[t]]?e[t]=Yu[e[t]]:e[t]=BX(e[t]);return function(i){var s="",r;for(r=0;r<o;r++)s+=ca(e[r])?e[r].call(i,n):e[r];return s}}function Qb(n,e){return n.isValid()?(e=UV(e,n.localeData()),ov[e]=ov[e]||VX(e),ov[e](n)):n.localeData().invalidDate()}function UV(n,e){var t=5;function o(i){return e.longDateFormat(i)||i}for(Pw.lastIndex=0;t>=0&&Pw.test(n);)n=n.replace(Pw,o),Pw.lastIndex=0,t-=1;return n}var zX={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 UX(n){var e=this._longDateFormat[n],t=this._longDateFormat[n.toUpperCase()];return e||!t?e:(this._longDateFormat[n]=t.match(Dx).map(function(o){return o==="MMMM"||o==="MM"||o==="DD"||o==="dddd"?o.slice(1):o}).join(""),this._longDateFormat[n])}var YX="Invalid date";function GX(){return this._invalidDate}var jX="%d",qX=/\d{1,2}/;function KX(n){return this._ordinal.replace("%d",n)}var XX={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 ZX(n,e,t,o){var i=this._relativeTime[t];return ca(i)?i(n,e,t,o):i.replace(/%d/i,n)}function QX(n,e){var t=this._relativeTime[n>0?"future":"past"];return ca(t)?t(e):t.replace(/%s/i,e)}var XA={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 Ms(n){return typeof n=="string"?XA[n]||XA[n.toLowerCase()]:void 0}function Nx(n){var e={},t,o;for(o in n)vt(n,o)&&(t=Ms(o),t&&(e[t]=n[o]));return e}var JX={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 eZ(n){var e=[],t;for(t in n)vt(n,t)&&e.push({unit:t,priority:JX[t]});return e.sort(function(o,i){return o.priority-i.priority}),e}var YV=/\d/,ns=/\d\d/,GV=/\d{3}/,Px=/\d{4}/,s_=/[+-]?\d{6}/,on=/\d\d?/,jV=/\d\d\d\d?/,qV=/\d\d\d\d\d\d?/,r_=/\d{1,3}/,Lx=/\d{1,4}/,a_=/[+-]?\d{1,6}/,wf=/\d+/,l_=/[+-]?\d+/,tZ=/Z|[+-]\d\d:?\d\d/gi,h_=/Z|[+-]\d\d(?::?\d\d)?/gi,nZ=/[+-]?\d+(\.\d{1,3})?/,jm=/[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,bf=/^[1-9]\d?/,Wx=/^([1-9]\d|\d)/,qC;qC={};function pe(n,e,t){qC[n]=ca(e)?e:function(o,i){return o&&t?t:e}}function oZ(n,e){return vt(qC,n)?qC[n](e._strict,e._locale):new RegExp(iZ(n))}function iZ(n){return nl(n.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,o,i,s){return t||o||i||s}))}function nl(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Rs(n){return n<0?Math.ceil(n)||0:Math.floor(n)}function dt(n){var e=+n,t=0;return e!==0&&isFinite(e)&&(t=Rs(e)),t}var t0={};function Bt(n,e){var t,o=e,i;for(typeof n=="string"&&(n=[n]),rl(e)&&(o=function(s,r){r[e]=dt(s)}),i=n.length,t=0;t<i;t++)t0[n[t]]=o}function qm(n,e){Bt(n,function(t,o,i,s){i._w=i._w||{},e(t,i._w,i,s)})}function sZ(n,e,t){e!=null&&vt(t0,n)&&t0[n](e,t._a,t,n)}function c_(n){return n%4===0&&n%100!==0||n%400===0}var ei=0,Ka=1,Xr=2,ho=3,dr=4,Xa=5,Tc=6,rZ=7,aZ=8;Te("Y",0,0,function(){var n=this.year();return n<=9999?ia(n,4):"+"+n});Te(0,["YY",2],0,function(){return this.year()%100});Te(0,["YYYY",4],0,"year");Te(0,["YYYYY",5],0,"year");Te(0,["YYYYYY",6,!0],0,"year");pe("Y",l_);pe("YY",on,ns);pe("YYYY",Lx,Px);pe("YYYYY",a_,s_);pe("YYYYYY",a_,s_);Bt(["YYYYY","YYYYYY"],ei);Bt("YYYY",function(n,e){e[ei]=n.length===2?Z.parseTwoDigitYear(n):dt(n)});Bt("YY",function(n,e){e[ei]=Z.parseTwoDigitYear(n)});Bt("Y",function(n,e){e[ei]=parseInt(n,10)});function Ep(n){return c_(n)?366:365}Z.parseTwoDigitYear=function(n){return dt(n)+(dt(n)>68?1900:2e3)};var KV=Cf("FullYear",!0);function lZ(){return c_(this.year())}function Cf(n,e){return function(t){return t!=null?(XV(this,n,t),Z.updateOffset(this,e),this):cm(this,n)}}function cm(n,e){if(!n.isValid())return NaN;var t=n._d,o=n._isUTC;switch(e){case"Milliseconds":return o?t.getUTCMilliseconds():t.getMilliseconds();case"Seconds":return o?t.getUTCSeconds():t.getSeconds();case"Minutes":return o?t.getUTCMinutes():t.getMinutes();case"Hours":return o?t.getUTCHours():t.getHours();case"Date":return o?t.getUTCDate():t.getDate();case"Day":return o?t.getUTCDay():t.getDay();case"Month":return o?t.getUTCMonth():t.getMonth();case"FullYear":return o?t.getUTCFullYear():t.getFullYear();default:return NaN}}function XV(n,e,t){var o,i,s,r,a;if(!(!n.isValid()||isNaN(t))){switch(o=n._d,i=n._isUTC,e){case"Milliseconds":return void(i?o.setUTCMilliseconds(t):o.setMilliseconds(t));case"Seconds":return void(i?o.setUTCSeconds(t):o.setSeconds(t));case"Minutes":return void(i?o.setUTCMinutes(t):o.setMinutes(t));case"Hours":return void(i?o.setUTCHours(t):o.setHours(t));case"Date":return void(i?o.setUTCDate(t):o.setDate(t));case"FullYear":break;default:return}s=t,r=n.month(),a=n.date(),a=a===29&&r===1&&!c_(s)?28:a,i?o.setUTCFullYear(s,r,a):o.setFullYear(s,r,a)}}function hZ(n){return n=Ms(n),ca(this[n])?this[n]():this}function cZ(n,e){if(typeof n=="object"){n=Nx(n);var t=eZ(n),o,i=t.length;for(o=0;o<i;o++)this[t[o].unit](n[t[o].unit])}else if(n=Ms(n),ca(this[n]))return this[n](e);return this}function dZ(n,e){return(n%e+e)%e}var Dn;Array.prototype.indexOf?Dn=Array.prototype.indexOf:Dn=function(n){var e;for(e=0;e<this.length;++e)if(this[e]===n)return e;return-1};function $x(n,e){if(isNaN(n)||isNaN(e))return NaN;var t=dZ(e,12);return n+=(e-t)/12,t===1?c_(n)?29:28:31-t%7%2}Te("M",["MM",2],"Mo",function(){return this.month()+1});Te("MMM",0,0,function(n){return this.localeData().monthsShort(this,n)});Te("MMMM",0,0,function(n){return this.localeData().months(this,n)});pe("M",on,bf);pe("MM",on,ns);pe("MMM",function(n,e){return e.monthsShortRegex(n)});pe("MMMM",function(n,e){return e.monthsRegex(n)});Bt(["M","MM"],function(n,e){e[Ka]=dt(n)-1});Bt(["MMM","MMMM"],function(n,e,t,o){var i=t._locale.monthsParse(n,o,t._strict);i!=null?e[Ka]=i:Qe(t).invalidMonth=n});var uZ="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ZV="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),QV=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,fZ=jm,gZ=jm;function pZ(n,e){return n?br(this._months)?this._months[n.month()]:this._months[(this._months.isFormat||QV).test(e)?"format":"standalone"][n.month()]:br(this._months)?this._months:this._months.standalone}function mZ(n,e){return n?br(this._monthsShort)?this._monthsShort[n.month()]:this._monthsShort[QV.test(e)?"format":"standalone"][n.month()]:br(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function wZ(n,e,t){var o,i,s,r=n.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],o=0;o<12;++o)s=ha([2e3,o]),this._shortMonthsParse[o]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[o]=this.months(s,"").toLocaleLowerCase();return t?e==="MMM"?(i=Dn.call(this._shortMonthsParse,r),i!==-1?i:null):(i=Dn.call(this._longMonthsParse,r),i!==-1?i:null):e==="MMM"?(i=Dn.call(this._shortMonthsParse,r),i!==-1?i:(i=Dn.call(this._longMonthsParse,r),i!==-1?i:null)):(i=Dn.call(this._longMonthsParse,r),i!==-1?i:(i=Dn.call(this._shortMonthsParse,r),i!==-1?i:null))}function bZ(n,e,t){var o,i,s;if(this._monthsParseExact)return wZ.call(this,n,e,t);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),o=0;o<12;o++){if(i=ha([2e3,o]),t&&!this._longMonthsParse[o]&&(this._longMonthsParse[o]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[o]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!t&&!this._monthsParse[o]&&(s="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[o]=new RegExp(s.replace(".",""),"i")),t&&e==="MMMM"&&this._longMonthsParse[o].test(n))return o;if(t&&e==="MMM"&&this._shortMonthsParse[o].test(n))return o;if(!t&&this._monthsParse[o].test(n))return o}}function JV(n,e){if(!n.isValid())return n;if(typeof e=="string"){if(/^\d+$/.test(e))e=dt(e);else if(e=n.localeData().monthsParse(e),!rl(e))return n}var t=e,o=n.date();return o=o<29?o:Math.min(o,$x(n.year(),t)),n._isUTC?n._d.setUTCMonth(t,o):n._d.setMonth(t,o),n}function ez(n){return n!=null?(JV(this,n),Z.updateOffset(this,!0),this):cm(this,"Month")}function CZ(){return $x(this.year(),this.month())}function yZ(n){return this._monthsParseExact?(vt(this,"_monthsRegex")||tz.call(this),n?this._monthsShortStrictRegex:this._monthsShortRegex):(vt(this,"_monthsShortRegex")||(this._monthsShortRegex=fZ),this._monthsShortStrictRegex&&n?this._monthsShortStrictRegex:this._monthsShortRegex)}function _Z(n){return this._monthsParseExact?(vt(this,"_monthsRegex")||tz.call(this),n?this._monthsStrictRegex:this._monthsRegex):(vt(this,"_monthsRegex")||(this._monthsRegex=gZ),this._monthsStrictRegex&&n?this._monthsStrictRegex:this._monthsRegex)}function tz(){function n(l,h){return h.length-l.length}var e=[],t=[],o=[],i,s,r,a;for(i=0;i<12;i++)s=ha([2e3,i]),r=nl(this.monthsShort(s,"")),a=nl(this.months(s,"")),e.push(r),t.push(a),o.push(a),o.push(r);e.sort(n),t.sort(n),o.sort(n),this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+t.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function SZ(n,e,t,o,i,s,r){var a;return n<100&&n>=0?(a=new Date(n+400,e,t,o,i,s,r),isFinite(a.getFullYear())&&a.setFullYear(n)):a=new Date(n,e,t,o,i,s,r),a}function dm(n){var e,t;return n<100&&n>=0?(t=Array.prototype.slice.call(arguments),t[0]=n+400,e=new Date(Date.UTC.apply(null,t)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(n)):e=new Date(Date.UTC.apply(null,arguments)),e}function KC(n,e,t){var o=7+e-t,i=(7+dm(n,0,o).getUTCDay()-e)%7;return-i+o-1}function nz(n,e,t,o,i){var s=(7+t-o)%7,r=KC(n,o,i),a=1+7*(e-1)+s+r,l,h;return a<=0?(l=n-1,h=Ep(l)+a):a>Ep(n)?(l=n+1,h=a-Ep(n)):(l=n,h=a),{year:l,dayOfYear:h}}function um(n,e,t){var o=KC(n.year(),e,t),i=Math.floor((n.dayOfYear()-o-1)/7)+1,s,r;return i<1?(r=n.year()-1,s=i+ol(r,e,t)):i>ol(n.year(),e,t)?(s=i-ol(n.year(),e,t),r=n.year()+1):(r=n.year(),s=i),{week:s,year:r}}function ol(n,e,t){var o=KC(n,e,t),i=KC(n+1,e,t);return(Ep(n)-o+i)/7}Te("w",["ww",2],"wo","week");Te("W",["WW",2],"Wo","isoWeek");pe("w",on,bf);pe("ww",on,ns);pe("W",on,bf);pe("WW",on,ns);qm(["w","ww","W","WW"],function(n,e,t,o){e[o.substr(0,1)]=dt(n)});function vZ(n){return um(n,this._week.dow,this._week.doy).week}var RZ={dow:0,doy:6};function EZ(){return this._week.dow}function kZ(){return this._week.doy}function TZ(n){var e=this.localeData().week(this);return n==null?e:this.add((n-e)*7,"d")}function xZ(n){var e=um(this,1,4).week;return n==null?e:this.add((n-e)*7,"d")}Te("d",0,"do","day");Te("dd",0,0,function(n){return this.localeData().weekdaysMin(this,n)});Te("ddd",0,0,function(n){return this.localeData().weekdaysShort(this,n)});Te("dddd",0,0,function(n){return this.localeData().weekdays(this,n)});Te("e",0,0,"weekday");Te("E",0,0,"isoWeekday");pe("d",on);pe("e",on);pe("E",on);pe("dd",function(n,e){return e.weekdaysMinRegex(n)});pe("ddd",function(n,e){return e.weekdaysShortRegex(n)});pe("dddd",function(n,e){return e.weekdaysRegex(n)});qm(["dd","ddd","dddd"],function(n,e,t,o){var i=t._locale.weekdaysParse(n,o,t._strict);i!=null?e.d=i:Qe(t).invalidWeekday=n});qm(["d","e","E"],function(n,e,t,o){e[o]=dt(n)});function MZ(n,e){return typeof n!="string"?n:isNaN(n)?(n=e.weekdaysParse(n),typeof n=="number"?n:null):parseInt(n,10)}function IZ(n,e){return typeof n=="string"?e.weekdaysParse(n)%7||7:isNaN(n)?null:n}function Fx(n,e){return n.slice(e,7).concat(n.slice(0,e))}var HZ="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),oz="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),AZ="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),OZ=jm,DZ=jm,NZ=jm;function PZ(n,e){var t=br(this._weekdays)?this._weekdays:this._weekdays[n&&n!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return n===!0?Fx(t,this._week.dow):n?t[n.day()]:t}function LZ(n){return n===!0?Fx(this._weekdaysShort,this._week.dow):n?this._weekdaysShort[n.day()]:this._weekdaysShort}function WZ(n){return n===!0?Fx(this._weekdaysMin,this._week.dow):n?this._weekdaysMin[n.day()]:this._weekdaysMin}function $Z(n,e,t){var o,i,s,r=n.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],o=0;o<7;++o)s=ha([2e3,1]).day(o),this._minWeekdaysParse[o]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[o]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[o]=this.weekdays(s,"").toLocaleLowerCase();return t?e==="dddd"?(i=Dn.call(this._weekdaysParse,r),i!==-1?i:null):e==="ddd"?(i=Dn.call(this._shortWeekdaysParse,r),i!==-1?i:null):(i=Dn.call(this._minWeekdaysParse,r),i!==-1?i:null):e==="dddd"?(i=Dn.call(this._weekdaysParse,r),i!==-1||(i=Dn.call(this._shortWeekdaysParse,r),i!==-1)?i:(i=Dn.call(this._minWeekdaysParse,r),i!==-1?i:null)):e==="ddd"?(i=Dn.call(this._shortWeekdaysParse,r),i!==-1||(i=Dn.call(this._weekdaysParse,r),i!==-1)?i:(i=Dn.call(this._minWeekdaysParse,r),i!==-1?i:null)):(i=Dn.call(this._minWeekdaysParse,r),i!==-1||(i=Dn.call(this._weekdaysParse,r),i!==-1)?i:(i=Dn.call(this._shortWeekdaysParse,r),i!==-1?i:null))}function FZ(n,e,t){var o,i,s;if(this._weekdaysParseExact)return $Z.call(this,n,e,t);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;o<7;o++){if(i=ha([2e3,1]).day(o),t&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[o]||(s="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[o]=new RegExp(s.replace(".",""),"i")),t&&e==="dddd"&&this._fullWeekdaysParse[o].test(n))return o;if(t&&e==="ddd"&&this._shortWeekdaysParse[o].test(n))return o;if(t&&e==="dd"&&this._minWeekdaysParse[o].test(n))return o;if(!t&&this._weekdaysParse[o].test(n))return o}}function BZ(n){if(!this.isValid())return n!=null?this:NaN;var e=cm(this,"Day");return n!=null?(n=MZ(n,this.localeData()),this.add(n-e,"d")):e}function VZ(n){if(!this.isValid())return n!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return n==null?e:this.add(n-e,"d")}function zZ(n){if(!this.isValid())return n!=null?this:NaN;if(n!=null){var e=IZ(n,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function UZ(n){return this._weekdaysParseExact?(vt(this,"_weekdaysRegex")||Bx.call(this),n?this._weekdaysStrictRegex:this._weekdaysRegex):(vt(this,"_weekdaysRegex")||(this._weekdaysRegex=OZ),this._weekdaysStrictRegex&&n?this._weekdaysStrictRegex:this._weekdaysRegex)}function YZ(n){return this._weekdaysParseExact?(vt(this,"_weekdaysRegex")||Bx.call(this),n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(vt(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=DZ),this._weekdaysShortStrictRegex&&n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function GZ(n){return this._weekdaysParseExact?(vt(this,"_weekdaysRegex")||Bx.call(this),n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(vt(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=NZ),this._weekdaysMinStrictRegex&&n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Bx(){function n(c,d){return d.length-c.length}var e=[],t=[],o=[],i=[],s,r,a,l,h;for(s=0;s<7;s++)r=ha([2e3,1]).day(s),a=nl(this.weekdaysMin(r,"")),l=nl(this.weekdaysShort(r,"")),h=nl(this.weekdays(r,"")),e.push(a),t.push(l),o.push(h),i.push(a),i.push(l),i.push(h);e.sort(n),t.sort(n),o.sort(n),i.sort(n),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+t.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function Vx(){return this.hours()%12||12}function jZ(){return this.hours()||24}Te("H",["HH",2],0,"hour");Te("h",["hh",2],0,Vx);Te("k",["kk",2],0,jZ);Te("hmm",0,0,function(){return""+Vx.apply(this)+ia(this.minutes(),2)});Te("hmmss",0,0,function(){return""+Vx.apply(this)+ia(this.minutes(),2)+ia(this.seconds(),2)});Te("Hmm",0,0,function(){return""+this.hours()+ia(this.minutes(),2)});Te("Hmmss",0,0,function(){return""+this.hours()+ia(this.minutes(),2)+ia(this.seconds(),2)});function iz(n,e){Te(n,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}iz("a",!0);iz("A",!1);function sz(n,e){return e._meridiemParse}pe("a",sz);pe("A",sz);pe("H",on,Wx);pe("h",on,bf);pe("k",on,bf);pe("HH",on,ns);pe("hh",on,ns);pe("kk",on,ns);pe("hmm",jV);pe("hmmss",qV);pe("Hmm",jV);pe("Hmmss",qV);Bt(["H","HH"],ho);Bt(["k","kk"],function(n,e,t){var o=dt(n);e[ho]=o===24?0:o});Bt(["a","A"],function(n,e,t){t._isPm=t._locale.isPM(n),t._meridiem=n});Bt(["h","hh"],function(n,e,t){e[ho]=dt(n),Qe(t).bigHour=!0});Bt("hmm",function(n,e,t){var o=n.length-2;e[ho]=dt(n.substr(0,o)),e[dr]=dt(n.substr(o)),Qe(t).bigHour=!0});Bt("hmmss",function(n,e,t){var o=n.length-4,i=n.length-2;e[ho]=dt(n.substr(0,o)),e[dr]=dt(n.substr(o,2)),e[Xa]=dt(n.substr(i)),Qe(t).bigHour=!0});Bt("Hmm",function(n,e,t){var o=n.length-2;e[ho]=dt(n.substr(0,o)),e[dr]=dt(n.substr(o))});Bt("Hmmss",function(n,e,t){var o=n.length-4,i=n.length-2;e[ho]=dt(n.substr(0,o)),e[dr]=dt(n.substr(o,2)),e[Xa]=dt(n.substr(i))});function qZ(n){return(n+"").toLowerCase().charAt(0)==="p"}var KZ=/[ap]\.?m?\.?/i,XZ=Cf("Hours",!0);function ZZ(n,e,t){return n>11?t?"pm":"PM":t?"am":"AM"}var rz={calendar:$X,longDateFormat:zX,invalidDate:YX,ordinal:jX,dayOfMonthOrdinalParse:qX,relativeTime:XX,months:uZ,monthsShort:ZV,week:RZ,weekdays:HZ,weekdaysMin:AZ,weekdaysShort:oz,meridiemParse:KZ},dn={},og={},fm;function QZ(n,e){var t,o=Math.min(n.length,e.length);for(t=0;t<o;t+=1)if(n[t]!==e[t])return t;return o}function ZA(n){return n&&n.toLowerCase().replace("_","-")}function JZ(n){for(var e=0,t,o,i,s;e<n.length;){for(s=ZA(n[e]).split("-"),t=s.length,o=ZA(n[e+1]),o=o?o.split("-"):null;t>0;){if(i=d_(s.slice(0,t).join("-")),i)return i;if(o&&o.length>=t&&QZ(s,o)>=t-1)break;t--}e++}return fm}function eQ(n){return!!(n&&n.match("^[^/\\\\]*$"))}function d_(n){var e=null,t;if(dn[n]===void 0&&typeof module<"u"&&module&&module.exports&&eQ(n))try{e=fm._abbr,t=require,t("./locale/"+n),gh(e)}catch{dn[n]=null}return dn[n]}function gh(n,e){var t;return n&&(xi(e)?t=pl(n):t=zx(n,e),t?fm=t:typeof console<"u"&&console.warn&&console.warn("Locale "+n+" not found. Did you forget to load it?")),fm._abbr}function zx(n,e){if(e!==null){var t,o=rz;if(e.abbr=n,dn[n]!=null)zV("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."),o=dn[n]._config;else if(e.parentLocale!=null)if(dn[e.parentLocale]!=null)o=dn[e.parentLocale]._config;else if(t=d_(e.parentLocale),t!=null)o=t._config;else return og[e.parentLocale]||(og[e.parentLocale]=[]),og[e.parentLocale].push({name:n,config:e}),null;return dn[n]=new Ox(JE(o,e)),og[n]&&og[n].forEach(function(i){zx(i.name,i.config)}),gh(n),dn[n]}else return delete dn[n],null}function tQ(n,e){if(e!=null){var t,o,i=rz;dn[n]!=null&&dn[n].parentLocale!=null?dn[n].set(JE(dn[n]._config,e)):(o=d_(n),o!=null&&(i=o._config),e=JE(i,e),o==null&&(e.abbr=n),t=new Ox(e),t.parentLocale=dn[n],dn[n]=t),gh(n)}else dn[n]!=null&&(dn[n].parentLocale!=null?(dn[n]=dn[n].parentLocale,n===gh()&&gh(n)):dn[n]!=null&&delete dn[n]);return dn[n]}function pl(n){var e;if(n&&n._locale&&n._locale._abbr&&(n=n._locale._abbr),!n)return fm;if(!br(n)){if(e=d_(n),e)return e;n=[n]}return JZ(n)}function nQ(){return e0(dn)}function Ux(n){var e,t=n._a;return t&&Qe(n).overflow===-2&&(e=t[Ka]<0||t[Ka]>11?Ka:t[Xr]<1||t[Xr]>$x(t[ei],t[Ka])?Xr:t[ho]<0||t[ho]>24||t[ho]===24&&(t[dr]!==0||t[Xa]!==0||t[Tc]!==0)?ho:t[dr]<0||t[dr]>59?dr:t[Xa]<0||t[Xa]>59?Xa:t[Tc]<0||t[Tc]>999?Tc:-1,Qe(n)._overflowDayOfYear&&(e<ei||e>Xr)&&(e=Xr),Qe(n)._overflowWeeks&&e===-1&&(e=rZ),Qe(n)._overflowWeekday&&e===-1&&(e=aZ),Qe(n).overflow=e),n}var oQ=/^\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)?)?$/,iQ=/^\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)?)?$/,sQ=/Z|[+-]\d\d(?::?\d\d)?/,Lw=[["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]],iv=[["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/]],rQ=/^\/?Date\((-?\d+)/i,aQ=/^(?:(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}))$/,lQ={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function az(n){var e,t,o=n._i,i=oQ.exec(o)||iQ.exec(o),s,r,a,l,h=Lw.length,c=iv.length;if(i){for(Qe(n).iso=!0,e=0,t=h;e<t;e++)if(Lw[e][1].exec(i[1])){r=Lw[e][0],s=Lw[e][2]!==!1;break}if(r==null){n._isValid=!1;return}if(i[3]){for(e=0,t=c;e<t;e++)if(iv[e][1].exec(i[3])){a=(i[2]||" ")+iv[e][0];break}if(a==null){n._isValid=!1;return}}if(!s&&a!=null){n._isValid=!1;return}if(i[4])if(sQ.exec(i[4]))l="Z";else{n._isValid=!1;return}n._f=r+(a||"")+(l||""),Gx(n)}else n._isValid=!1}function hQ(n,e,t,o,i,s){var r=[cQ(n),ZV.indexOf(e),parseInt(t,10),parseInt(o,10),parseInt(i,10)];return s&&r.push(parseInt(s,10)),r}function cQ(n){var e=parseInt(n,10);return e<=49?2e3+e:e<=999?1900+e:e}function dQ(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function uQ(n,e,t){if(n){var o=oz.indexOf(n),i=new Date(e[0],e[1],e[2]).getDay();if(o!==i)return Qe(t).weekdayMismatch=!0,t._isValid=!1,!1}return!0}function fQ(n,e,t){if(n)return lQ[n];if(e)return 0;var o=parseInt(t,10),i=o%100,s=(o-i)/100;return s*60+i}function lz(n){var e=aQ.exec(dQ(n._i)),t;if(e){if(t=hQ(e[4],e[3],e[2],e[5],e[6],e[7]),!uQ(e[1],t,n))return;n._a=t,n._tzm=fQ(e[8],e[9],e[10]),n._d=dm.apply(null,n._a),n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),Qe(n).rfc2822=!0}else n._isValid=!1}function gQ(n){var e=rQ.exec(n._i);if(e!==null){n._d=new Date(+e[1]);return}if(az(n),n._isValid===!1)delete n._isValid;else return;if(lz(n),n._isValid===!1)delete n._isValid;else return;n._strict?n._isValid=!1:Z.createFromInputFallback(n)}Z.createFromInputFallback=xs("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(n){n._d=new Date(n._i+(n._useUTC?" UTC":""))});function yu(n,e,t){return n??e??t}function pQ(n){var e=new Date(Z.now());return n._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function Yx(n){var e,t,o=[],i,s,r;if(!n._d){for(i=pQ(n),n._w&&n._a[Xr]==null&&n._a[Ka]==null&&mQ(n),n._dayOfYear!=null&&(r=yu(n._a[ei],i[ei]),(n._dayOfYear>Ep(r)||n._dayOfYear===0)&&(Qe(n)._overflowDayOfYear=!0),t=dm(r,0,n._dayOfYear),n._a[Ka]=t.getUTCMonth(),n._a[Xr]=t.getUTCDate()),e=0;e<3&&n._a[e]==null;++e)n._a[e]=o[e]=i[e];for(;e<7;e++)n._a[e]=o[e]=n._a[e]==null?e===2?1:0:n._a[e];n._a[ho]===24&&n._a[dr]===0&&n._a[Xa]===0&&n._a[Tc]===0&&(n._nextDay=!0,n._a[ho]=0),n._d=(n._useUTC?dm:SZ).apply(null,o),s=n._useUTC?n._d.getUTCDay():n._d.getDay(),n._tzm!=null&&n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),n._nextDay&&(n._a[ho]=24),n._w&&typeof n._w.d<"u"&&n._w.d!==s&&(Qe(n).weekdayMismatch=!0)}}function mQ(n){var e,t,o,i,s,r,a,l,h;e=n._w,e.GG!=null||e.W!=null||e.E!=null?(s=1,r=4,t=yu(e.GG,n._a[ei],um(nn(),1,4).year),o=yu(e.W,1),i=yu(e.E,1),(i<1||i>7)&&(l=!0)):(s=n._locale._week.dow,r=n._locale._week.doy,h=um(nn(),s,r),t=yu(e.gg,n._a[ei],h.year),o=yu(e.w,h.week),e.d!=null?(i=e.d,(i<0||i>6)&&(l=!0)):e.e!=null?(i=e.e+s,(e.e<0||e.e>6)&&(l=!0)):i=s),o<1||o>ol(t,s,r)?Qe(n)._overflowWeeks=!0:l!=null?Qe(n)._overflowWeekday=!0:(a=nz(t,o,i,s,r),n._a[ei]=a.year,n._dayOfYear=a.dayOfYear)}Z.ISO_8601=function(){};Z.RFC_2822=function(){};function Gx(n){if(n._f===Z.ISO_8601){az(n);return}if(n._f===Z.RFC_2822){lz(n);return}n._a=[],Qe(n).empty=!0;var e=""+n._i,t,o,i,s,r,a=e.length,l=0,h,c;for(i=UV(n._f,n._locale).match(Dx)||[],c=i.length,t=0;t<c;t++)s=i[t],o=(e.match(oZ(s,n))||[])[0],o&&(r=e.substr(0,e.indexOf(o)),r.length>0&&Qe(n).unusedInput.push(r),e=e.slice(e.indexOf(o)+o.length),l+=o.length),Yu[s]?(o?Qe(n).empty=!1:Qe(n).unusedTokens.push(s),sZ(s,o,n)):n._strict&&!o&&Qe(n).unusedTokens.push(s);Qe(n).charsLeftOver=a-l,e.length>0&&Qe(n).unusedInput.push(e),n._a[ho]<=12&&Qe(n).bigHour===!0&&n._a[ho]>0&&(Qe(n).bigHour=void 0),Qe(n).parsedDateParts=n._a.slice(0),Qe(n).meridiem=n._meridiem,n._a[ho]=wQ(n._locale,n._a[ho],n._meridiem),h=Qe(n).era,h!==null&&(n._a[ei]=n._locale.erasConvertYear(h,n._a[ei])),Yx(n),Ux(n)}function wQ(n,e,t){var o;return t==null?e:n.meridiemHour!=null?n.meridiemHour(e,t):(n.isPM!=null&&(o=n.isPM(t),o&&e<12&&(e+=12),!o&&e===12&&(e=0)),e)}function bQ(n){var e,t,o,i,s,r,a=!1,l=n._f.length;if(l===0){Qe(n).invalidFormat=!0,n._d=new Date(NaN);return}for(i=0;i<l;i++)s=0,r=!1,e=Ax({},n),n._useUTC!=null&&(e._useUTC=n._useUTC),e._f=n._f[i],Gx(e),Hx(e)&&(r=!0),s+=Qe(e).charsLeftOver,s+=Qe(e).unusedTokens.length*10,Qe(e).score=s,a?s<o&&(o=s,t=e):(o==null||s<o||r)&&(o=s,t=e,r&&(a=!0));sh(n,t||e)}function CQ(n){if(!n._d){var e=Nx(n._i),t=e.day===void 0?e.date:e.day;n._a=BV([e.year,e.month,t,e.hour,e.minute,e.second,e.millisecond],function(o){return o&&parseInt(o,10)}),Yx(n)}}function yQ(n){var e=new Gm(Ux(hz(n)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function hz(n){var e=n._i,t=n._f;return n._locale=n._locale||pl(n._l),e===null||t===void 0&&e===""?i_({nullInput:!0}):(typeof e=="string"&&(n._i=e=n._locale.preparse(e)),Cr(e)?new Gm(Ux(e)):(Ym(e)?n._d=e:br(t)?bQ(n):t?Gx(n):_Q(n),Hx(n)||(n._d=null),n))}function _Q(n){var e=n._i;xi(e)?n._d=new Date(Z.now()):Ym(e)?n._d=new Date(e.valueOf()):typeof e=="string"?gQ(n):br(e)?(n._a=BV(e.slice(0),function(t){return parseInt(t,10)}),Yx(n)):$c(e)?CQ(n):rl(e)?n._d=new Date(e):Z.createFromInputFallback(n)}function cz(n,e,t,o,i){var s={};return(e===!0||e===!1)&&(o=e,e=void 0),(t===!0||t===!1)&&(o=t,t=void 0),($c(n)&&Ix(n)||br(n)&&n.length===0)&&(n=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=i,s._l=t,s._i=n,s._f=e,s._strict=o,yQ(s)}function nn(n,e,t,o){return cz(n,e,t,o,!1)}var SQ=xs("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=nn.apply(null,arguments);return this.isValid()&&n.isValid()?n<this?this:n:i_()}),vQ=xs("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=nn.apply(null,arguments);return this.isValid()&&n.isValid()?n>this?this:n:i_()});function dz(n,e){var t,o;if(e.length===1&&br(e[0])&&(e=e[0]),!e.length)return nn();for(t=e[0],o=1;o<e.length;++o)(!e[o].isValid()||e[o][n](t))&&(t=e[o]);return t}function RQ(){var n=[].slice.call(arguments,0);return dz("isBefore",n)}function EQ(){var n=[].slice.call(arguments,0);return dz("isAfter",n)}var kQ=function(){return Date.now?Date.now():+new Date},ig=["year","quarter","month","week","day","hour","minute","second","millisecond"];function TQ(n){var e,t=!1,o,i=ig.length;for(e in n)if(vt(n,e)&&!(Dn.call(ig,e)!==-1&&(n[e]==null||!isNaN(n[e]))))return!1;for(o=0;o<i;++o)if(n[ig[o]]){if(t)return!1;parseFloat(n[ig[o]])!==dt(n[ig[o]])&&(t=!0)}return!0}function xQ(){return this._isValid}function MQ(){return yr(NaN)}function u_(n){var e=Nx(n),t=e.year||0,o=e.quarter||0,i=e.month||0,s=e.week||e.isoWeek||0,r=e.day||0,a=e.hour||0,l=e.minute||0,h=e.second||0,c=e.millisecond||0;this._isValid=TQ(e),this._milliseconds=+c+h*1e3+l*6e4+a*1e3*60*60,this._days=+r+s*7,this._months=+i+o*3+t*12,this._data={},this._locale=pl(),this._bubble()}function Jb(n){return n instanceof u_}function n0(n){return n<0?Math.round(-1*n)*-1:Math.round(n)}function IQ(n,e,t){var o=Math.min(n.length,e.length),i=Math.abs(n.length-e.length),s=0,r;for(r=0;r<o;r++)dt(n[r])!==dt(e[r])&&s++;return s+i}function uz(n,e){Te(n,0,0,function(){var t=this.utcOffset(),o="+";return t<0&&(t=-t,o="-"),o+ia(~~(t/60),2)+e+ia(~~t%60,2)})}uz("Z",":");uz("ZZ","");pe("Z",h_);pe("ZZ",h_);Bt(["Z","ZZ"],function(n,e,t){t._useUTC=!0,t._tzm=jx(h_,n)});var HQ=/([\+\-]|\d\d)/gi;function jx(n,e){var t=(e||"").match(n),o,i,s;return t===null?null:(o=t[t.length-1]||[],i=(o+"").match(HQ)||["-",0,0],s=+(i[1]*60)+dt(i[2]),s===0?0:i[0]==="+"?s:-s)}function qx(n,e){var t,o;return e._isUTC?(t=e.clone(),o=(Cr(n)||Ym(n)?n.valueOf():nn(n).valueOf())-t.valueOf(),t._d.setTime(t._d.valueOf()+o),Z.updateOffset(t,!1),t):nn(n).local()}function o0(n){return-Math.round(n._d.getTimezoneOffset())}Z.updateOffset=function(){};function AQ(n,e,t){var o=this._offset||0,i;if(!this.isValid())return n!=null?this:NaN;if(n!=null){if(typeof n=="string"){if(n=jx(h_,n),n===null)return this}else Math.abs(n)<16&&!t&&(n=n*60);return!this._isUTC&&e&&(i=o0(this)),this._offset=n,this._isUTC=!0,i!=null&&this.add(i,"m"),o!==n&&(!e||this._changeInProgress?pz(this,yr(n-o,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,Z.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?o:o0(this)}function OQ(n,e){return n!=null?(typeof n!="string"&&(n=-n),this.utcOffset(n,e),this):-this.utcOffset()}function DQ(n){return this.utcOffset(0,n)}function NQ(n){return this._isUTC&&(this.utcOffset(0,n),this._isUTC=!1,n&&this.subtract(o0(this),"m")),this}function PQ(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var n=jx(tZ,this._i);n!=null?this.utcOffset(n):this.utcOffset(0,!0)}return this}function LQ(n){return this.isValid()?(n=n?nn(n).utcOffset():0,(this.utcOffset()-n)%60===0):!1}function WQ(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function $Q(){if(!xi(this._isDSTShifted))return this._isDSTShifted;var n={},e;return Ax(n,this),n=hz(n),n._a?(e=n._isUTC?ha(n._a):nn(n._a),this._isDSTShifted=this.isValid()&&IQ(n._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function FQ(){return this.isValid()?!this._isUTC:!1}function BQ(){return this.isValid()?this._isUTC:!1}function fz(){return this.isValid()?this._isUTC&&this._offset===0:!1}var VQ=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,zQ=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function yr(n,e){var t=n,o=null,i,s,r;return Jb(n)?t={ms:n._milliseconds,d:n._days,M:n._months}:rl(n)||!isNaN(+n)?(t={},e?t[e]=+n:t.milliseconds=+n):(o=VQ.exec(n))?(i=o[1]==="-"?-1:1,t={y:0,d:dt(o[Xr])*i,h:dt(o[ho])*i,m:dt(o[dr])*i,s:dt(o[Xa])*i,ms:dt(n0(o[Tc]*1e3))*i}):(o=zQ.exec(n))?(i=o[1]==="-"?-1:1,t={y:$h(o[2],i),M:$h(o[3],i),w:$h(o[4],i),d:$h(o[5],i),h:$h(o[6],i),m:$h(o[7],i),s:$h(o[8],i)}):t==null?t={}:typeof t=="object"&&("from"in t||"to"in t)&&(r=UQ(nn(t.from),nn(t.to)),t={},t.ms=r.milliseconds,t.M=r.months),s=new u_(t),Jb(n)&&vt(n,"_locale")&&(s._locale=n._locale),Jb(n)&&vt(n,"_isValid")&&(s._isValid=n._isValid),s}yr.fn=u_.prototype;yr.invalid=MQ;function $h(n,e){var t=n&&parseFloat(n.replace(",","."));return(isNaN(t)?0:t)*e}function QA(n,e){var t={};return t.months=e.month()-n.month()+(e.year()-n.year())*12,n.clone().add(t.months,"M").isAfter(e)&&--t.months,t.milliseconds=+e-+n.clone().add(t.months,"M"),t}function UQ(n,e){var t;return n.isValid()&&e.isValid()?(e=qx(e,n),n.isBefore(e)?t=QA(n,e):(t=QA(e,n),t.milliseconds=-t.milliseconds,t.months=-t.months),t):{milliseconds:0,months:0}}function gz(n,e){return function(t,o){var i,s;return o!==null&&!isNaN(+o)&&(zV(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."),s=t,t=o,o=s),i=yr(t,o),pz(this,i,n),this}}function pz(n,e,t,o){var i=e._milliseconds,s=n0(e._days),r=n0(e._months);n.isValid()&&(o=o??!0,r&&JV(n,cm(n,"Month")+r*t),s&&XV(n,"Date",cm(n,"Date")+s*t),i&&n._d.setTime(n._d.valueOf()+i*t),o&&Z.updateOffset(n,s||r))}var YQ=gz(1,"add"),GQ=gz(-1,"subtract");function mz(n){return typeof n=="string"||n instanceof String}function jQ(n){return Cr(n)||Ym(n)||mz(n)||rl(n)||KQ(n)||qQ(n)||n===null||n===void 0}function qQ(n){var e=$c(n)&&!Ix(n),t=!1,o=["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,s,r=o.length;for(i=0;i<r;i+=1)s=o[i],t=t||vt(n,s);return e&&t}function KQ(n){var e=br(n),t=!1;return e&&(t=n.filter(function(o){return!rl(o)&&mz(n)}).length===0),e&&t}function XQ(n){var e=$c(n)&&!Ix(n),t=!1,o=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,s;for(i=0;i<o.length;i+=1)s=o[i],t=t||vt(n,s);return e&&t}function ZQ(n,e){var t=n.diff(e,"days",!0);return t<-6?"sameElse":t<-1?"lastWeek":t<0?"lastDay":t<1?"sameDay":t<2?"nextDay":t<7?"nextWeek":"sameElse"}function QQ(n,e){arguments.length===1&&(arguments[0]?jQ(arguments[0])?(n=arguments[0],e=void 0):XQ(arguments[0])&&(e=arguments[0],n=void 0):(n=void 0,e=void 0));var t=n||nn(),o=qx(t,this).startOf("day"),i=Z.calendarFormat(this,o)||"sameElse",s=e&&(ca(e[i])?e[i].call(this,t):e[i]);return this.format(s||this.localeData().calendar(i,this,nn(t)))}function JQ(){return new Gm(this)}function eJ(n,e){var t=Cr(n)?n:nn(n);return this.isValid()&&t.isValid()?(e=Ms(e)||"millisecond",e==="millisecond"?this.valueOf()>t.valueOf():t.valueOf()<this.clone().startOf(e).valueOf()):!1}function tJ(n,e){var t=Cr(n)?n:nn(n);return this.isValid()&&t.isValid()?(e=Ms(e)||"millisecond",e==="millisecond"?this.valueOf()<t.valueOf():this.clone().endOf(e).valueOf()<t.valueOf()):!1}function nJ(n,e,t,o){var i=Cr(n)?n:nn(n),s=Cr(e)?e:nn(e);return this.isValid()&&i.isValid()&&s.isValid()?(o=o||"()",(o[0]==="("?this.isAfter(i,t):!this.isBefore(i,t))&&(o[1]===")"?this.isBefore(s,t):!this.isAfter(s,t))):!1}function oJ(n,e){var t=Cr(n)?n:nn(n),o;return this.isValid()&&t.isValid()?(e=Ms(e)||"millisecond",e==="millisecond"?this.valueOf()===t.valueOf():(o=t.valueOf(),this.clone().startOf(e).valueOf()<=o&&o<=this.clone().endOf(e).valueOf())):!1}function iJ(n,e){return this.isSame(n,e)||this.isAfter(n,e)}function sJ(n,e){return this.isSame(n,e)||this.isBefore(n,e)}function rJ(n,e,t){var o,i,s;if(!this.isValid())return NaN;if(o=qx(n,this),!o.isValid())return NaN;switch(i=(o.utcOffset()-this.utcOffset())*6e4,e=Ms(e),e){case"year":s=eC(this,o)/12;break;case"month":s=eC(this,o);break;case"quarter":s=eC(this,o)/3;break;case"second":s=(this-o)/1e3;break;case"minute":s=(this-o)/6e4;break;case"hour":s=(this-o)/36e5;break;case"day":s=(this-o-i)/864e5;break;case"week":s=(this-o-i)/6048e5;break;default:s=this-o}return t?s:Rs(s)}function eC(n,e){if(n.date()<e.date())return-eC(e,n);var t=(e.year()-n.year())*12+(e.month()-n.month()),o=n.clone().add(t,"months"),i,s;return e-o<0?(i=n.clone().add(t-1,"months"),s=(e-o)/(o-i)):(i=n.clone().add(t+1,"months"),s=(e-o)/(i-o)),-(t+s)||0}Z.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";Z.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function aJ(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function lJ(n){if(!this.isValid())return null;var e=n!==!0,t=e?this.clone().utc():this;return t.year()<0||t.year()>9999?Qb(t,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):ca(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Qb(t,"Z")):Qb(t,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function hJ(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var n="moment",e="",t,o,i,s;return this.isLocal()||(n=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),t="["+n+'("]',o=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",s=e+'[")]',this.format(t+o+i+s)}function cJ(n){n||(n=this.isUtc()?Z.defaultFormatUtc:Z.defaultFormat);var e=Qb(this,n);return this.localeData().postformat(e)}function dJ(n,e){return this.isValid()&&(Cr(n)&&n.isValid()||nn(n).isValid())?yr({to:this,from:n}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function uJ(n){return this.from(nn(),n)}function fJ(n,e){return this.isValid()&&(Cr(n)&&n.isValid()||nn(n).isValid())?yr({from:this,to:n}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function gJ(n){return this.to(nn(),n)}function wz(n){var e;return n===void 0?this._locale._abbr:(e=pl(n),e!=null&&(this._locale=e),this)}var bz=xs("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(n){return n===void 0?this.localeData():this.locale(n)});function Cz(){return this._locale}var XC=1e3,Gu=60*XC,ZC=60*Gu,yz=(365*400+97)*24*ZC;function ju(n,e){return(n%e+e)%e}function _z(n,e,t){return n<100&&n>=0?new Date(n+400,e,t)-yz:new Date(n,e,t).valueOf()}function Sz(n,e,t){return n<100&&n>=0?Date.UTC(n+400,e,t)-yz:Date.UTC(n,e,t)}function pJ(n){var e,t;if(n=Ms(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?Sz:_z,n){case"year":e=t(this.year(),0,1);break;case"quarter":e=t(this.year(),this.month()-this.month()%3,1);break;case"month":e=t(this.year(),this.month(),1);break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=t(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=ju(e+(this._isUTC?0:this.utcOffset()*Gu),ZC);break;case"minute":e=this._d.valueOf(),e-=ju(e,Gu);break;case"second":e=this._d.valueOf(),e-=ju(e,XC);break}return this._d.setTime(e),Z.updateOffset(this,!0),this}function mJ(n){var e,t;if(n=Ms(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?Sz:_z,n){case"year":e=t(this.year()+1,0,1)-1;break;case"quarter":e=t(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=t(this.year(),this.month()+1,1)-1;break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=t(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=ZC-ju(e+(this._isUTC?0:this.utcOffset()*Gu),ZC)-1;break;case"minute":e=this._d.valueOf(),e+=Gu-ju(e,Gu)-1;break;case"second":e=this._d.valueOf(),e+=XC-ju(e,XC)-1;break}return this._d.setTime(e),Z.updateOffset(this,!0),this}function wJ(){return this._d.valueOf()-(this._offset||0)*6e4}function bJ(){return Math.floor(this.valueOf()/1e3)}function CJ(){return new Date(this.valueOf())}function yJ(){var n=this;return[n.year(),n.month(),n.date(),n.hour(),n.minute(),n.second(),n.millisecond()]}function _J(){var n=this;return{years:n.year(),months:n.month(),date:n.date(),hours:n.hours(),minutes:n.minutes(),seconds:n.seconds(),milliseconds:n.milliseconds()}}function SJ(){return this.isValid()?this.toISOString():null}function vJ(){return Hx(this)}function RJ(){return sh({},Qe(this))}function EJ(){return Qe(this).overflow}function kJ(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Te("N",0,0,"eraAbbr");Te("NN",0,0,"eraAbbr");Te("NNN",0,0,"eraAbbr");Te("NNNN",0,0,"eraName");Te("NNNNN",0,0,"eraNarrow");Te("y",["y",1],"yo","eraYear");Te("y",["yy",2],0,"eraYear");Te("y",["yyy",3],0,"eraYear");Te("y",["yyyy",4],0,"eraYear");pe("N",Kx);pe("NN",Kx);pe("NNN",Kx);pe("NNNN",LJ);pe("NNNNN",WJ);Bt(["N","NN","NNN","NNNN","NNNNN"],function(n,e,t,o){var i=t._locale.erasParse(n,o,t._strict);i?Qe(t).era=i:Qe(t).invalidEra=n});pe("y",wf);pe("yy",wf);pe("yyy",wf);pe("yyyy",wf);pe("yo",$J);Bt(["y","yy","yyy","yyyy"],ei);Bt(["yo"],function(n,e,t,o){var i;t._locale._eraYearOrdinalRegex&&(i=n.match(t._locale._eraYearOrdinalRegex)),t._locale.eraYearOrdinalParse?e[ei]=t._locale.eraYearOrdinalParse(n,i):e[ei]=parseInt(n,10)});function TJ(n,e){var t,o,i,s=this._eras||pl("en")._eras;for(t=0,o=s.length;t<o;++t)switch(typeof s[t].since==="string"&&(i=Z(s[t].since).startOf("day"),s[t].since=i.valueOf()),typeof s[t].until){case"undefined":s[t].until=1/0;break;case"string":i=Z(s[t].until).startOf("day").valueOf(),s[t].until=i.valueOf();break}return s}function xJ(n,e,t){var o,i,s=this.eras(),r,a,l;for(n=n.toUpperCase(),o=0,i=s.length;o<i;++o)if(r=s[o].name.toUpperCase(),a=s[o].abbr.toUpperCase(),l=s[o].narrow.toUpperCase(),t)switch(e){case"N":case"NN":case"NNN":if(a===n)return s[o];break;case"NNNN":if(r===n)return s[o];break;case"NNNNN":if(l===n)return s[o];break}else if([r,a,l].indexOf(n)>=0)return s[o]}function MJ(n,e){var t=n.since<=n.until?1:-1;return e===void 0?Z(n.since).year():Z(n.since).year()+(e-n.offset)*t}function IJ(){var n,e,t,o=this.localeData().eras();for(n=0,e=o.length;n<e;++n)if(t=this.clone().startOf("day").valueOf(),o[n].since<=t&&t<=o[n].until||o[n].until<=t&&t<=o[n].since)return o[n].name;return""}function HJ(){var n,e,t,o=this.localeData().eras();for(n=0,e=o.length;n<e;++n)if(t=this.clone().startOf("day").valueOf(),o[n].since<=t&&t<=o[n].until||o[n].until<=t&&t<=o[n].since)return o[n].narrow;return""}function AJ(){var n,e,t,o=this.localeData().eras();for(n=0,e=o.length;n<e;++n)if(t=this.clone().startOf("day").valueOf(),o[n].since<=t&&t<=o[n].until||o[n].until<=t&&t<=o[n].since)return o[n].abbr;return""}function OJ(){var n,e,t,o,i=this.localeData().eras();for(n=0,e=i.length;n<e;++n)if(t=i[n].since<=i[n].until?1:-1,o=this.clone().startOf("day").valueOf(),i[n].since<=o&&o<=i[n].until||i[n].until<=o&&o<=i[n].since)return(this.year()-Z(i[n].since).year())*t+i[n].offset;return this.year()}function DJ(n){return vt(this,"_erasNameRegex")||Xx.call(this),n?this._erasNameRegex:this._erasRegex}function NJ(n){return vt(this,"_erasAbbrRegex")||Xx.call(this),n?this._erasAbbrRegex:this._erasRegex}function PJ(n){return vt(this,"_erasNarrowRegex")||Xx.call(this),n?this._erasNarrowRegex:this._erasRegex}function Kx(n,e){return e.erasAbbrRegex(n)}function LJ(n,e){return e.erasNameRegex(n)}function WJ(n,e){return e.erasNarrowRegex(n)}function $J(n,e){return e._eraYearOrdinalRegex||wf}function Xx(){var n=[],e=[],t=[],o=[],i,s,r,a,l,h=this.eras();for(i=0,s=h.length;i<s;++i)r=nl(h[i].name),a=nl(h[i].abbr),l=nl(h[i].narrow),e.push(r),n.push(a),t.push(l),o.push(r),o.push(a),o.push(l);this._erasRegex=new RegExp("^("+o.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+t.join("|")+")","i")}Te(0,["gg",2],0,function(){return this.weekYear()%100});Te(0,["GG",2],0,function(){return this.isoWeekYear()%100});function f_(n,e){Te(0,[n,n.length],0,e)}f_("gggg","weekYear");f_("ggggg","weekYear");f_("GGGG","isoWeekYear");f_("GGGGG","isoWeekYear");pe("G",l_);pe("g",l_);pe("GG",on,ns);pe("gg",on,ns);pe("GGGG",Lx,Px);pe("gggg",Lx,Px);pe("GGGGG",a_,s_);pe("ggggg",a_,s_);qm(["gggg","ggggg","GGGG","GGGGG"],function(n,e,t,o){e[o.substr(0,2)]=dt(n)});qm(["gg","GG"],function(n,e,t,o){e[o]=Z.parseTwoDigitYear(n)});function FJ(n){return vz.call(this,n,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function BJ(n){return vz.call(this,n,this.isoWeek(),this.isoWeekday(),1,4)}function VJ(){return ol(this.year(),1,4)}function zJ(){return ol(this.isoWeekYear(),1,4)}function UJ(){var n=this.localeData()._week;return ol(this.year(),n.dow,n.doy)}function YJ(){var n=this.localeData()._week;return ol(this.weekYear(),n.dow,n.doy)}function vz(n,e,t,o,i){var s;return n==null?um(this,o,i).year:(s=ol(n,o,i),e>s&&(e=s),GJ.call(this,n,e,t,o,i))}function GJ(n,e,t,o,i){var s=nz(n,e,t,o,i),r=dm(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}Te("Q",0,"Qo","quarter");pe("Q",YV);Bt("Q",function(n,e){e[Ka]=(dt(n)-1)*3});function jJ(n){return n==null?Math.ceil((this.month()+1)/3):this.month((n-1)*3+this.month()%3)}Te("D",["DD",2],"Do","date");pe("D",on,bf);pe("DD",on,ns);pe("Do",function(n,e){return n?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient});Bt(["D","DD"],Xr);Bt("Do",function(n,e){e[Xr]=dt(n.match(on)[0])});var Rz=Cf("Date",!0);Te("DDD",["DDDD",3],"DDDo","dayOfYear");pe("DDD",r_);pe("DDDD",GV);Bt(["DDD","DDDD"],function(n,e,t){t._dayOfYear=dt(n)});function qJ(n){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return n==null?e:this.add(n-e,"d")}Te("m",["mm",2],0,"minute");pe("m",on,Wx);pe("mm",on,ns);Bt(["m","mm"],dr);var KJ=Cf("Minutes",!1);Te("s",["ss",2],0,"second");pe("s",on,Wx);pe("ss",on,ns);Bt(["s","ss"],Xa);var XJ=Cf("Seconds",!1);Te("S",0,0,function(){return~~(this.millisecond()/100)});Te(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Te(0,["SSS",3],0,"millisecond");Te(0,["SSSS",4],0,function(){return this.millisecond()*10});Te(0,["SSSSS",5],0,function(){return this.millisecond()*100});Te(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Te(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Te(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Te(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});pe("S",r_,YV);pe("SS",r_,ns);pe("SSS",r_,GV);var rh,Ez;for(rh="SSSS";rh.length<=9;rh+="S")pe(rh,wf);function ZJ(n,e){e[Tc]=dt(("0."+n)*1e3)}for(rh="S";rh.length<=9;rh+="S")Bt(rh,ZJ);Ez=Cf("Milliseconds",!1);Te("z",0,0,"zoneAbbr");Te("zz",0,0,"zoneName");function QJ(){return this._isUTC?"UTC":""}function JJ(){return this._isUTC?"Coordinated Universal Time":""}var J=Gm.prototype;J.add=YQ;J.calendar=QQ;J.clone=JQ;J.diff=rJ;J.endOf=mJ;J.format=cJ;J.from=dJ;J.fromNow=uJ;J.to=fJ;J.toNow=gJ;J.get=hZ;J.invalidAt=EJ;J.isAfter=eJ;J.isBefore=tJ;J.isBetween=nJ;J.isSame=oJ;J.isSameOrAfter=iJ;J.isSameOrBefore=sJ;J.isValid=vJ;J.lang=bz;J.locale=wz;J.localeData=Cz;J.max=vQ;J.min=SQ;J.parsingFlags=RJ;J.set=cZ;J.startOf=pJ;J.subtract=GQ;J.toArray=yJ;J.toObject=_J;J.toDate=CJ;J.toISOString=lJ;J.inspect=hJ;typeof Symbol<"u"&&Symbol.for!=null&&(J[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});J.toJSON=SJ;J.toString=aJ;J.unix=bJ;J.valueOf=wJ;J.creationData=kJ;J.eraName=IJ;J.eraNarrow=HJ;J.eraAbbr=AJ;J.eraYear=OJ;J.year=KV;J.isLeapYear=lZ;J.weekYear=FJ;J.isoWeekYear=BJ;J.quarter=J.quarters=jJ;J.month=ez;J.daysInMonth=CZ;J.week=J.weeks=TZ;J.isoWeek=J.isoWeeks=xZ;J.weeksInYear=UJ;J.weeksInWeekYear=YJ;J.isoWeeksInYear=VJ;J.isoWeeksInISOWeekYear=zJ;J.date=Rz;J.day=J.days=BZ;J.weekday=VZ;J.isoWeekday=zZ;J.dayOfYear=qJ;J.hour=J.hours=XZ;J.minute=J.minutes=KJ;J.second=J.seconds=XJ;J.millisecond=J.milliseconds=Ez;J.utcOffset=AQ;J.utc=DQ;J.local=NQ;J.parseZone=PQ;J.hasAlignedHourOffset=LQ;J.isDST=WQ;J.isLocal=FQ;J.isUtcOffset=BQ;J.isUtc=fz;J.isUTC=fz;J.zoneAbbr=QJ;J.zoneName=JJ;J.dates=xs("dates accessor is deprecated. Use date instead.",Rz);J.months=xs("months accessor is deprecated. Use month instead",ez);J.years=xs("years accessor is deprecated. Use year instead",KV);J.zone=xs("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",OQ);J.isDSTShifted=xs("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",$Q);function eee(n){return nn(n*1e3)}function tee(){return nn.apply(null,arguments).parseZone()}function kz(n){return n}var Rt=Ox.prototype;Rt.calendar=FX;Rt.longDateFormat=UX;Rt.invalidDate=GX;Rt.ordinal=KX;Rt.preparse=kz;Rt.postformat=kz;Rt.relativeTime=ZX;Rt.pastFuture=QX;Rt.set=WX;Rt.eras=TJ;Rt.erasParse=xJ;Rt.erasConvertYear=MJ;Rt.erasAbbrRegex=NJ;Rt.erasNameRegex=DJ;Rt.erasNarrowRegex=PJ;Rt.months=pZ;Rt.monthsShort=mZ;Rt.monthsParse=bZ;Rt.monthsRegex=_Z;Rt.monthsShortRegex=yZ;Rt.week=vZ;Rt.firstDayOfYear=kZ;Rt.firstDayOfWeek=EZ;Rt.weekdays=PZ;Rt.weekdaysMin=WZ;Rt.weekdaysShort=LZ;Rt.weekdaysParse=FZ;Rt.weekdaysRegex=UZ;Rt.weekdaysShortRegex=YZ;Rt.weekdaysMinRegex=GZ;Rt.isPM=qZ;Rt.meridiem=ZZ;function QC(n,e,t,o){var i=pl(),s=ha().set(o,e);return i[t](s,n)}function Tz(n,e,t){if(rl(n)&&(e=n,n=void 0),n=n||"",e!=null)return QC(n,e,t,"month");var o,i=[];for(o=0;o<12;o++)i[o]=QC(n,o,t,"month");return i}function Zx(n,e,t,o){typeof n=="boolean"?(rl(e)&&(t=e,e=void 0),e=e||""):(e=n,t=e,n=!1,rl(e)&&(t=e,e=void 0),e=e||"");var i=pl(),s=n?i._week.dow:0,r,a=[];if(t!=null)return QC(e,(t+s)%7,o,"day");for(r=0;r<7;r++)a[r]=QC(e,(r+s)%7,o,"day");return a}function nee(n,e){return Tz(n,e,"months")}function oee(n,e){return Tz(n,e,"monthsShort")}function iee(n,e,t){return Zx(n,e,t,"weekdays")}function see(n,e,t){return Zx(n,e,t,"weekdaysShort")}function ree(n,e,t){return Zx(n,e,t,"weekdaysMin")}gh("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(n){var e=n%10,t=dt(n%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return n+t}});Z.lang=xs("moment.lang is deprecated. Use moment.locale instead.",gh);Z.langData=xs("moment.langData is deprecated. Use moment.localeData instead.",pl);var Sa=Math.abs;function aee(){var n=this._data;return this._milliseconds=Sa(this._milliseconds),this._days=Sa(this._days),this._months=Sa(this._months),n.milliseconds=Sa(n.milliseconds),n.seconds=Sa(n.seconds),n.minutes=Sa(n.minutes),n.hours=Sa(n.hours),n.months=Sa(n.months),n.years=Sa(n.years),this}function xz(n,e,t,o){var i=yr(e,t);return n._milliseconds+=o*i._milliseconds,n._days+=o*i._days,n._months+=o*i._months,n._bubble()}function lee(n,e){return xz(this,n,e,1)}function hee(n,e){return xz(this,n,e,-1)}function JA(n){return n<0?Math.floor(n):Math.ceil(n)}function cee(){var n=this._milliseconds,e=this._days,t=this._months,o=this._data,i,s,r,a,l;return n>=0&&e>=0&&t>=0||n<=0&&e<=0&&t<=0||(n+=JA(i0(t)+e)*864e5,e=0,t=0),o.milliseconds=n%1e3,i=Rs(n/1e3),o.seconds=i%60,s=Rs(i/60),o.minutes=s%60,r=Rs(s/60),o.hours=r%24,e+=Rs(r/24),l=Rs(Mz(e)),t+=l,e-=JA(i0(l)),a=Rs(t/12),t%=12,o.days=e,o.months=t,o.years=a,this}function Mz(n){return n*4800/146097}function i0(n){return n*146097/4800}function dee(n){if(!this.isValid())return NaN;var e,t,o=this._milliseconds;if(n=Ms(n),n==="month"||n==="quarter"||n==="year")switch(e=this._days+o/864e5,t=this._months+Mz(e),n){case"month":return t;case"quarter":return t/3;case"year":return t/12}else switch(e=this._days+Math.round(i0(this._months)),n){case"week":return e/7+o/6048e5;case"day":return e+o/864e5;case"hour":return e*24+o/36e5;case"minute":return e*1440+o/6e4;case"second":return e*86400+o/1e3;case"millisecond":return Math.floor(e*864e5)+o;default:throw new Error("Unknown unit "+n)}}function ml(n){return function(){return this.as(n)}}var Iz=ml("ms"),uee=ml("s"),fee=ml("m"),gee=ml("h"),pee=ml("d"),mee=ml("w"),wee=ml("M"),bee=ml("Q"),Cee=ml("y"),yee=Iz;function _ee(){return yr(this)}function See(n){return n=Ms(n),this.isValid()?this[n+"s"]():NaN}function ld(n){return function(){return this.isValid()?this._data[n]:NaN}}var vee=ld("milliseconds"),Ree=ld("seconds"),Eee=ld("minutes"),kee=ld("hours"),Tee=ld("days"),xee=ld("months"),Mee=ld("years");function Iee(){return Rs(this.days()/7)}var Wa=Math.round,Pu={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Hee(n,e,t,o,i){return i.relativeTime(e||1,!!t,n,o)}function Aee(n,e,t,o){var i=yr(n).abs(),s=Wa(i.as("s")),r=Wa(i.as("m")),a=Wa(i.as("h")),l=Wa(i.as("d")),h=Wa(i.as("M")),c=Wa(i.as("w")),d=Wa(i.as("y")),u=s<=t.ss&&["s",s]||s<t.s&&["ss",s]||r<=1&&["m"]||r<t.m&&["mm",r]||a<=1&&["h"]||a<t.h&&["hh",a]||l<=1&&["d"]||l<t.d&&["dd",l];return t.w!=null&&(u=u||c<=1&&["w"]||c<t.w&&["ww",c]),u=u||h<=1&&["M"]||h<t.M&&["MM",h]||d<=1&&["y"]||["yy",d],u[2]=e,u[3]=+n>0,u[4]=o,Hee.apply(null,u)}function Oee(n){return n===void 0?Wa:typeof n=="function"?(Wa=n,!0):!1}function Dee(n,e){return Pu[n]===void 0?!1:e===void 0?Pu[n]:(Pu[n]=e,n==="s"&&(Pu.ss=e-1),!0)}function Nee(n,e){if(!this.isValid())return this.localeData().invalidDate();var t=!1,o=Pu,i,s;return typeof n=="object"&&(e=n,n=!1),typeof n=="boolean"&&(t=n),typeof e=="object"&&(o=Object.assign({},Pu,e),e.s!=null&&e.ss==null&&(o.ss=e.s-1)),i=this.localeData(),s=Aee(this,!t,o,i),t&&(s=i.pastFuture(+this,s)),i.postformat(s)}var sv=Math.abs;function Td(n){return(n>0)-(n<0)||+n}function g_(){if(!this.isValid())return this.localeData().invalidDate();var n=sv(this._milliseconds)/1e3,e=sv(this._days),t=sv(this._months),o,i,s,r,a=this.asSeconds(),l,h,c,d;return a?(o=Rs(n/60),i=Rs(o/60),n%=60,o%=60,s=Rs(t/12),t%=12,r=n?n.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",h=Td(this._months)!==Td(a)?"-":"",c=Td(this._days)!==Td(a)?"-":"",d=Td(this._milliseconds)!==Td(a)?"-":"",l+"P"+(s?h+s+"Y":"")+(t?h+t+"M":"")+(e?c+e+"D":"")+(i||o||n?"T":"")+(i?d+i+"H":"")+(o?d+o+"M":"")+(n?d+r+"S":"")):"P0D"}var wt=u_.prototype;wt.isValid=xQ;wt.abs=aee;wt.add=lee;wt.subtract=hee;wt.as=dee;wt.asMilliseconds=Iz;wt.asSeconds=uee;wt.asMinutes=fee;wt.asHours=gee;wt.asDays=pee;wt.asWeeks=mee;wt.asMonths=wee;wt.asQuarters=bee;wt.asYears=Cee;wt.valueOf=yee;wt._bubble=cee;wt.clone=_ee;wt.get=See;wt.milliseconds=vee;wt.seconds=Ree;wt.minutes=Eee;wt.hours=kee;wt.days=Tee;wt.weeks=Iee;wt.months=xee;wt.years=Mee;wt.humanize=Nee;wt.toISOString=g_;wt.toString=g_;wt.toJSON=g_;wt.locale=wz;wt.localeData=Cz;wt.toIsoString=xs("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",g_);wt.lang=bz;Te("X",0,0,"unix");Te("x",0,0,"valueOf");pe("x",l_);pe("X",nZ);Bt("X",function(n,e,t){t._d=new Date(parseFloat(n)*1e3)});Bt("x",function(n,e,t){t._d=new Date(dt(n))});Z.version="2.30.1";PX(nn);Z.fn=J;Z.min=RQ;Z.max=EQ;Z.now=kQ;Z.utc=ha;Z.unix=eee;Z.months=nee;Z.isDate=Ym;Z.locale=gh;Z.invalid=i_;Z.duration=yr;Z.isMoment=Cr;Z.weekdays=iee;Z.parseZone=tee;Z.localeData=pl;Z.isDuration=Jb;Z.monthsShort=oee;Z.weekdaysMin=ree;Z.defineLocale=zx;Z.updateLocale=tQ;Z.locales=nQ;Z.weekdaysShort=see;Z.normalizeUnits=Ms;Z.relativeTimeRounding=Oee;Z.relativeTimeThreshold=Dee;Z.calendarFormat=ZQ;Z.prototype=J;Z.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const ah=()=>window,Ss=()=>window.document,s0=(n,e)=>window.setTimeout(n,e),Pr=function(n,e,t,o){n.addEventListener(e,t,!!o)},va=function(n,e,t,o){n.removeEventListener(e,t,!!o)},Pee=function(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")},Ui=function(n,e){return(" "+n.className+" ").indexOf(" "+e+" ")!==-1},rv=function(n,e){Ui(n,e)||(n.className=n.className===""?e:n.className+" "+e)},av=function(n,e){n.className=Pee((" "+n.className+" ").replace(" "+e+" "," "))},Qx=function(n){return/Array/.test(Object.prototype.toString.call(n))},qi=function(n){return/Date/.test(Object.prototype.toString.call(n))&&!isNaN(n.getTime())},Lee=function(n){let e=n.getDay();return e===0||e===6},Wee=function(n){return n%4===0&&n%100!==0||n%400===0},e1=function(n,e){return[31,Wee(n)?29:28,31,30,31,30,31,31,30,31,30,31][e]},Ww=function(n){qi(n)&&n.setHours(0,0,0,0)},$w=function(n,e){return n.getTime()===e.getTime()},JC=function(n,e,t){let o,i;for(o in e)i=n[o]!==void 0,i&&typeof e[o]=="object"&&e[o]!==null&&e[o].nodeName===void 0?qi(e[o])?t&&(n[o]=new Date(e[o].getTime())):Qx(e[o])?t&&(n[o]=e[o].slice(0)):n[o]=JC({},e[o],t):(t||!i)&&(n[o]=e[o]);return n},t1=function(n,e,t){let o=Ss().createEvent("HTMLEvents");o.initEvent(e,!0,!1),o=JC(o,t),n.dispatchEvent(o)},n1=function(n){return n.month<0&&(n.year-=Math.ceil(Math.abs(n.month)/12),n.month+=12),n.month>11&&(n.year+=Math.floor(Math.abs(n.month)/12),n.month-=12),n},Tr={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},o1=function(n,e,t){for(e+=n.firstDay;e>=7;)e-=7;return t?n.i18n.weekdaysShort[e]:n.i18n.weekdays[e]},$ee=function(n){let e=[],t="false";if(n.isEmpty)if(n.showDaysInNextAndPreviousMonths)e.push("is-outside-current-month"),n.enableSelectionDaysInNextAndPreviousMonths||e.push("is-selection-disabled");else return'<td class="is-empty"></td>';return n.isDisabled&&e.push("is-disabled"),n.isToday&&e.push("is-today"),n.isSelected&&(e.push("is-selected"),t="true"),n.hasEvent&&e.push("has-event"),n.isInRange&&e.push("is-inrange"),n.isStartRange&&e.push("is-startrange"),n.isEndRange&&e.push("is-endrange"),'<td data-day="'+n.day+'" class="'+e.join(" ")+'" aria-selected="'+t+'"><button class="pika-button pika-day" type="button" data-pika-year="'+n.year+'" data-pika-month="'+n.month+'" data-pika-day="'+n.day+'">'+n.day+"</button></td>"},Fee=function(n,e){n.setHours(0,0,0,0);let t=n.getDate(),o=n.getDay(),i=e,s=i-1,r=7,a=function(u){return(u+r-1)%r};n.setDate(t+s-a(o));let l=new Date(n.getFullYear(),0,i),h=1440*60*1e3,c=(n.getTime()-l.getTime())/h;return 1+Math.round((c-s+a(l.getDay()))/r)},Bee=function(n,e,t,o,i){let s=new Date(o,t,e);return'<td class="pika-week">'+(n.hasMoment?n.moment(s).isoWeek():Fee(s,i))+"</td>"},Vee=function(n,e,t,o){return'<tr class="pika-row'+(t?" pick-whole-week":"")+(o?" is-selected":"")+'">'+(e?n.reverse():n).join("")+"</tr>"},zee=function(n){return"<tbody>"+n.join("")+"</tbody>"},Uee=function(n){let e,t=[];for(n.showWeekNumber&&t.push("<th></th>"),e=0;e<7;e++)t.push('<th scope="col"><abbr title="'+o1(n,e)+'">'+o1(n,e,!0)+"</abbr></th>");return"<thead><tr>"+(n.isRTL?t.reverse():t).join("")+"</tr></thead>"},Yee=function(n,e,t,o,i,s){let r,a,l,h=n._o,c=t===h.minYear,d=t===h.maxYear,u='<div id="'+s+'" class="pika-title" role="heading" aria-live="polite">',f,p,C=!0,y=!0;for(l=[],r=0;r<12;r++)l.push('<option value="'+(t===i?r-e:12+r-e)+'"'+(r===o?' selected="selected"':"")+(c&&r<h.minMonth||d&&r>h.maxMonth?' disabled="disabled"':"")+">"+h.i18n.months[r]+"</option>");for(f='<div class="pika-label">'+h.i18n.months[o]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",Qx(h.yearRange)?(r=h.yearRange[0],a=h.yearRange[1]+1):(r=t-h.yearRange,a=1+t+h.yearRange),l=[];r<a&&r<=h.maxYear;r++)r>=h.minYear&&l.push('<option value="'+r+'"'+(r===t?' selected="selected"':"")+">"+r+"</option>");return p='<div class="pika-label">'+t+h.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",h.showMonthAfterYear?u+=p+f:u+=f+p,c&&(o===0||h.minMonth>=o)&&(C=!1),d&&(o===11||h.maxMonth<=o)&&(y=!1),e===0&&(u+='<button class="pika-prev'+(C?"":" is-disabled")+'" type="button">'+h.i18n.previousMonth+"</button>"),e===n._o.numberOfMonths-1&&(u+='<button class="pika-next'+(y?"":" is-disabled")+'" type="button">'+h.i18n.nextMonth+"</button>"),u+="</div>"},Gee=function(n,e,t){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+t+'">'+Uee(n)+zee(e)+"</table>"};function r0(n){let e=this,t=e.config(n);e._onMouseDown=function(i){if(!e._v)return;i=i||ah().event;let s=i.target||i.srcElement;if(s)if(Ui(s,"is-disabled")||(Ui(s,"pika-button")&&!Ui(s,"is-empty")&&!Ui(s.parentNode,"is-disabled")?(e.setDate(new Date(s.getAttribute("data-pika-year"),s.getAttribute("data-pika-month"),s.getAttribute("data-pika-day"))),t.bound&&s0(function(){e.hide(),t.blurFieldOnSelect&&t.field&&t.field.blur()},100)):Ui(s,"pika-prev")?e.prevMonth():Ui(s,"pika-next")&&e.nextMonth()),Ui(s,"pika-select"))e._c=!0;else if(i.preventDefault)i.preventDefault();else return i.returnValue=!1,!1},e._onChange=function(i){i=i||ah().event;let s=i.target||i.srcElement;s&&(Ui(s,"pika-select-month")?e.gotoMonth(s.value):Ui(s,"pika-select-year")&&e.gotoYear(s.value))},e._onKeyChange=function(i){if(i=i||ah().event,e.isVisible())switch(i.keyCode){case 13:case 27:t.field&&t.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(t.parse)return t.parse(t.field.value,t.format);if(this.hasMoment){let i=this.moment(t.field.value,t.format,t.formatStrict);return i&&i.isValid()?i.toDate():null}else return new Date(Date.parse(t.field.value))},e._onInputChange=function(i){let s;i.firedBy!==e&&(s=e._parseFieldValue(),qi(s)&&e.setDate(s),e._v||e.show())},e._onInputFocus=function(){e.show()},e._onInputClick=function(){e.show()},e._onInputBlur=function(){let i=Ss().activeElement;do if(Ui(i,"pika-single"))return;while(i=i.parentNode);e._c||(e._b=s0(function(){e.hide()},50)),e._c=!1},e._onClick=function(i){i=i||ah().event;let s=i.target||i.srcElement,r=s;if(s){!hasEventListeners&&Ui(s,"pika-select")&&(s.onchange||(s.setAttribute("onchange","return;"),Pr(s,"change",e._onChange)));do if(Ui(r,"pika-single")||r===t.trigger)return;while(r=r.parentNode);e._v&&s!==t.trigger&&r!==t.trigger&&e.hide()}},e.el=Ss().createElement("div"),e.el.className="pika-single"+(t.isRTL?" is-rtl":"")+(t.theme?" "+t.theme:""),Pr(e.el,"mousedown",e._onMouseDown,!0),Pr(e.el,"touchend",e._onMouseDown,!0),Pr(e.el,"change",e._onChange),t.keyboardInput&&Pr(Ss(),"keydown",e._onKeyChange),t.field&&(t.container?t.container.appendChild(e.el):t.bound?Ss().body.appendChild(e.el):t.field.parentNode.insertBefore(e.el,t.field.nextSibling),Pr(t.field,"change",e._onInputChange),t.defaultDate||(t.defaultDate=e._parseFieldValue(),t.setDefaultDate=!0));let o=t.defaultDate;qi(o)?t.setDefaultDate?e.setDate(o,!0):e.gotoDate(o):e.gotoDate(new Date),t.bound?(this.hide(),e.el.className+=" is-bound",Pr(t.trigger,"click",e._onInputClick),Pr(t.trigger,"focus",e._onInputFocus),Pr(t.trigger,"blur",e._onInputBlur)):this.show()}r0.prototype={config:function(n){this._o||(this._o=JC({},Tr,!0));let e=JC(this._o,n,!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 t=parseInt(e.numberOfMonths,10)||1;if(e.numberOfMonths=t>4?4:t,qi(e.minDate)||(e.minDate=!1),qi(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),Qx(e.yearRange)){let o=new Date().getFullYear()-10;e.yearRange[0]=parseInt(e.yearRange[0],10)||o,e.yearRange[1]=parseInt(e.yearRange[1],10)||o}else e.yearRange=Math.abs(parseInt(e.yearRange,10))||Tr.yearRange,e.yearRange>100&&(e.yearRange=100);return e},toString:function(n){return n=n||this._o.format,qi(this._d)?this._o.toString?this._o.toString(this._d,n):this.hasMoment?this.moment(this._d).format(n):this._d.toDateString():""},getMoment:function(){return this.hasMoment?this.moment(this._d):null},setMoment:function(n,e){this.hasMoment&&this.moment.isMoment(n)&&this.setDate(n.toDate(),e)},useMoment:function(n){this.hasMoment=!0,this.moment=n},getDate:function(){return qi(this._d)?new Date(this._d.getTime()):null},setDate:function(n,e){if(!n)return this._d=null,this._o.field&&(this._o.field.value="",t1(this._o.field,"change",{firedBy:this})),this.draw();if(typeof n=="string"&&(n=new Date(Date.parse(n))),!qi(n))return;let t=this._o.minDate,o=this._o.maxDate;qi(t)&&n<t?n=t:qi(o)&&n>o&&(n=o),this._d=new Date(n.getTime()),Ww(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),t1(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(n){let e=!0;if(qi(n)){if(this.calendars){let t=new Date(this.calendars[0].year,this.calendars[0].month,1),o=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),i=n.getTime();o.setMonth(o.getMonth()+1),o.setDate(o.getDate()-1),e=i<t.getTime()||o.getTime()<i}e&&(this.calendars=[{month:n.getMonth(),year:n.getFullYear()}],this._o.mainCalendar==="right"&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(n,e){let t=this.getDate()||new Date,o=parseInt(e)*24*60*60*1e3,i;n==="add"?i=new Date(t.valueOf()+o):n==="subtract"&&(i=new Date(t.valueOf()-o)),this.setDate(i)},adjustCalendars:function(){this.calendars[0]=n1(this.calendars[0]);for(let n=1;n<this._o.numberOfMonths;n++)this.calendars[n]=n1({month:this.calendars[0].month+n,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(n){isNaN(n)||(this.calendars[0].month=parseInt(n,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(n){isNaN(n)||(this.calendars[0].year=parseInt(n,10),this.adjustCalendars())},setMinDate:function(n){n instanceof Date?(Ww(n),this._o.minDate=n,this._o.minYear=n.getFullYear(),this._o.minMonth=n.getMonth()):(this._o.minDate=Tr.minDate,this._o.minYear=Tr.minYear,this._o.minMonth=Tr.minMonth,this._o.startRange=Tr.startRange),this.draw()},setMaxDate:function(n){n instanceof Date?(Ww(n),this._o.maxDate=n,this._o.maxYear=n.getFullYear(),this._o.maxMonth=n.getMonth()):(this._o.maxDate=Tr.maxDate,this._o.maxYear=Tr.maxYear,this._o.maxMonth=Tr.maxMonth,this._o.endRange=Tr.endRange),this.draw()},setStartRange:function(n){this._o.startRange=n},setEndRange:function(n){this._o.endRange=n},draw:function(n){if(!this._v&&!n)return;let e=this._o,t=e.minYear,o=e.maxYear,i=e.minMonth,s=e.maxMonth,r="",a;this._y<=t&&(this._y=t,!isNaN(i)&&this._m<i&&(this._m=i)),this._y>=o&&(this._y=o,!isNaN(s)&&this._m>s&&(this._m=s));for(let l=0;l<e.numberOfMonths;l++)a="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2),r+='<div class="pika-lendar">'+Yee(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=r,e.bound&&e.field.type!=="hidden"&&s0(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 n,e,t,o,i,s,r,a,l,h,c;this._o.container||(this.el.style.position="absolute",n=this._o.trigger,e=this.el.offsetWidth,t=this.el.offsetHeight,o=ah().innerWidth||Ss().documentElement.clientWidth,i=ah().innerHeight||Ss().documentElement.clientHeight,s=Ss().body.scrollTop||Ss().documentElement.scrollTop,h=!0,c=!0,l=n.getBoundingClientRect(),r=l.left+ah().pageXOffset,a=l.bottom+ah().pageYOffset,(this._o.reposition&&r+e>o||this._o.position.indexOf("right")>-1&&r-e+n.offsetWidth>0)&&(r=r-e+n.offsetWidth,h=!1),(this._o.reposition&&a+t>i+s||this._o.position.indexOf("top")>-1&&a-t-n.offsetHeight>0)&&(a=a-t-n.offsetHeight,c=!1),r<0&&(r=0),a<0&&(a=0),this.el.style.left=r+"px",this.el.style.top=a+"px",rv(this.el,h?"left-aligned":"right-aligned"),rv(this.el,c?"bottom-aligned":"top-aligned"),av(this.el,h?"right-aligned":"left-aligned"),av(this.el,c?"top-aligned":"bottom-aligned"))},render:function(n,e,t){let o=this._o,i=new Date,s=e1(n,e),r=new Date(n,e,1).getDay(),a=[],l=[];Ww(i),o.firstDay>0&&(r-=o.firstDay,r<0&&(r+=7));let h=e===0?11:e-1,c=e===11?0:e+1,d=e===0?n-1:n,u=e===11?n+1:n,f=e1(d,h),p=s+r,C=p;for(;C>7;)C-=7;p+=7-C;let y=!1;for(let _=0,T=0;_<p;_++){let P=new Date(n,e,1+(_-r)),$=qi(this._d)?$w(P,this._d):!1,F=$w(P,i),N=o.events.indexOf(P.toDateString())!==-1,I=_<r||_>=s+r,j=1+(_-r),U=e,G=n,te=o.startRange&&$w(o.startRange,P),Q=o.endRange&&$w(o.endRange,P),be=o.startRange&&o.endRange&&o.startRange<P&&P<o.endRange,Oe=o.minDate&&P<o.minDate||o.maxDate&&P>o.maxDate||o.disableWeekends&&Lee(P)||o.disableDayFn&&o.disableDayFn(P);I&&(_<r?(j=f+j,U=h,G=d):(j=j-s,U=c,G=u));let Ve={day:j,month:U,year:G,hasEvent:N,isSelected:$,isToday:F,isDisabled:Oe,isEmpty:I,isStartRange:te,isEndRange:Q,isInRange:be,showDaysInNextAndPreviousMonths:o.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:o.enableSelectionDaysInNextAndPreviousMonths};o.pickWholeWeek&&$&&(y=!0),l.push($ee(Ve)),++T===7&&(o.showWeekNumber&&l.unshift(Bee(this,_-r,e,n,o.firstWeekOfYearMinDays)),a.push(Vee(l,o.isRTL,o.pickWholeWeek,y)),l=[],T=0,y=!1)}return Gee(o,a,t)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),av(this.el,"is-hidden"),this._o.bound&&(Pr(Ss(),"click",this._onClick),this.adjustPosition()),typeof this._o.onOpen=="function"&&this._o.onOpen.call(this))},hide:function(){let n=this._v;n!==!1&&(this._o.bound&&va(Ss(),"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),rv(this.el,"is-hidden"),this._v=!1,n!==void 0&&typeof this._o.onClose=="function"&&this._o.onClose.call(this))},destroy:function(){let n=this._o;this.hide(),va(this.el,"mousedown",this._onMouseDown,!0),va(this.el,"touchend",this._onMouseDown,!0),va(this.el,"change",this._onChange),n.keyboardInput&&va(Ss(),"keydown",this._onKeyChange),n.field&&(va(n.field,"change",this._onInputChange),n.bound&&(va(n.trigger,"click",this._onInputClick),va(n.trigger,"focus",this._onInputFocus),va(n.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}};function jee(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lv(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function qee(n,e){jee(n,e),e.add(n)}const Hz="date",i1="dateEditor",Kee="DD/MM/YYYY",s1=new WeakSet;var Fw=new WeakSet;class Az extends gl{static get EDITOR_TYPE(){return Hz}init(){typeof Z!="function"&&Y("You need to include moment.js to your project."),typeof r0!="function"&&Y("You need to include Pikaday to your project."),super.init(),this.hot.addHook("afterDestroy",()=>{this.parentDestroyed=!0,this.destroyElements()}),this.hot.addHook("afterSetTheme",(e,t)=>{t||this.close()})}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"),V(this.datePicker,"htDatepickerHolder"),this.hot.rootPortalElement.appendChild(this.datePicker),this.eventManager.addEventListener(this.datePicker,"mousedown",e=>{Se(e.target,"pika-day")&&this.hideDatepicker(),e.stopPropagation()})}destroyElements(){const e=this.datePicker.parentNode;this.$datePicker&&this.$datePicker.destroy(),e&&e.removeChild(this.datePicker)}prepare(e,t,o,i,s,r){super.prepare(e,t,o,i,s,r)}open(e=null){s1.has(this.cellProperties.instance)||(s1.add(this.cellProperties.instance),Ch("The Pikaday-based `date` editor is deprecated and will be removed in the next major release, replaced by the native HTML date input.\n\nMigration guide: https://handsontable.com/docs/migration-from-16.2-to-17.0/\n`date` cell type documentation: https://handsontable.com/docs/date-cell-type/"));const o=this.hot.getShortcutManager().getContext("editor");this.showDatepicker(e),super.open(),o.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:i1})}close(){this.$datePicker?.destroy&&this.$datePicker.destroy(),this.hot._registerTimeout(()=>{const o=this.hot._getEditorManager();o.closeEditor(),this.hot.view.render(),o.prepareEditor()}),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(i1),super.close()}finishEditing(e=!1,t=!1){super.finishEditing(e,t)}showDatepicker(e){const t=lv(this,Fw,hv).call(this),o=this.hot.view.isMouseDown(),i=e?kF(e.keyCode):!1;let s;this.datePicker.style.display="block",this.$datePicker=new r0(this.getDatePickerConfig()),typeof this.$datePicker.useMoment=="function"&&this.$datePicker.useMoment(Z),this.$datePicker._onInputFocus=function(){},this.originalValue?(s=this.originalValue,Z(s,t,!0).isValid()&&this.$datePicker.setMoment(Z(s,t),!0),this.getValue()!==this.originalValue&&this.setValue(this.originalValue),!i&&!o&&this.setValue("")):this.cellProperties.defaultDate?(s=this.cellProperties.defaultDate,Z(s,t,!0).isValid()&&this.$datePicker.setMoment(Z(s,t),!0),!i&&!o&&this.setValue("")):this.$datePicker.gotoToday()}hideDatepicker(){this.datePickerStyle.display="none",this.$datePicker.hide()}getDatePickerConfig(){const e=this.TEXTAREA,t={};this.cellProperties&&this.cellProperties.datePickerConfig&&Wy(t,this.cellProperties.datePickerConfig);const o=t.onSelect,i=t.onClose;return t.field=e,t.trigger=e,t.container=this.datePicker,t.bound=!1,t.keyboardInput=!1,t.format=t.format??lv(this,Fw,hv).call(this),t.reposition=t.reposition||!1,t.isRTL=!1,t.onSelect=s=>{let r=s;isNaN(r.getTime())||(r=Z(r).format(lv(this,Fw,hv).call(this))),this.setValue(r),o&&o(),Qr()&&this.hideDatepicker()},t.onClose=()=>{this.parentDestroyed||this.finishEditing(!1),i&&i()},t}refreshDimensions(e){if(super.refreshDimensions(e),this.state!==Tn.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.hideDatepicker();return}const{rowIndexMapper:t,columnIndexMapper:o}=this.hot,{wtOverlays:i}=this.hot.view._wt,{wtTable:s}=i.getParentOverlay(this.TD)??this.hot.view._wt,r=t.getVisualFromRenderableIndex(s.getFirstPartiallyVisibleRow()),a=t.getVisualFromRenderableIndex(s.getLastPartiallyVisibleRow()),l=o.getVisualFromRenderableIndex(s.getFirstPartiallyVisibleColumn()),h=o.getVisualFromRenderableIndex(s.getLastPartiallyVisibleColumn());if(this.row>=r&&this.row<=a&&this.col>=l&&this.col<=h){const c=this.TD.getBoundingClientRect(),d=Cn(this.datePicker),u=xn(this.datePicker),f=xn(this.TD),p=this.hot.rootWindow,C=this.hot.rootDocument.documentElement,y=p.pageYOffset,_=p.pageYOffset+C.clientHeight,T=p.pageXOffset,P=p.pageXOffset+C.clientWidth;let $=y+c.top+f;if($+u>_){const j=y+c.top-u;$=j>=y?Math.max(y,j-1):_-u}this.datePickerStyle.top=`${$}px`;const F=T+c.left,N=T+c.right;let I;this.hot.isRtl()?(I=N-d,I<T&&(I=Math.min(F,P-d))):(I=F,I+d>P&&(I=Math.max(N-d,T))),I=tt(I,T,P-d),this.datePickerStyle.left=`${I}px`}else this.hideDatepicker()}constructor(...e){super(...e),qee(this,Fw),this.parentDestroyed=!1,this.$datePicker=null}}function hv(){return this.cellProperties.dateFormat??Kee}const Xee="dropdown";class Oz extends Mx{static get EDITOR_TYPE(){return Xee}prepare(e,t,o,i,s,r){r.filter=!1,r.strict=!0,super.prepare(e,t,o,i,s,r)}finishEditing(e,t,o){if(this.isOpened()){const i=this.hot.getSelectedRangeActive();(en(i)||ee(i)&&!i.includes(this.hot._createCellCoords(this.row,this.col)))&&(e=!0)}super.finishEditing(e,t,o)}}const Dz=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/;function Zee(n){const e=new Date(n);return isNaN(new Date(`${n}T00:00`).getDate())?e:new Date(e.getTime()+e.getTimezoneOffset()*6e4)}function sa(n){if(ht(n))return null;if(typeof n=="string"&&Dz.test(n)){const[e,t,o]=n.split("-").map(Number);return new Date(e,t-1,o)}return null}function Jx(n){if(typeof n!="string"||!Dz.test(n))return!1;const e=new Date(n);return!Number.isNaN(e.getTime())&&n===e.toISOString().slice(0,10)}const Nz=/^([01]\d|2[0-3]):([0-5]\d)(?::([0-5]\d)(?:\.(\d{1,3}))?)?$/;function td(n){if(ht(n)||typeof n!="string")return null;const e=Nz.exec(n);if(!e)return null;const t=Number(e[1]),o=Number(e[2]),i=e[3]!==void 0?Number(e[3]):0,s=e[4],r=s!==void 0?Number(s.padEnd(3,"0").slice(0,3)):0;return new Date(1970,0,1,t,o,i,r)}function eM(n){return typeof n=="string"&&Nz.test(n)}const Qee="intl-date";class Pz extends gl{static get EDITOR_TYPE(){return Qee}init(){super.init(),this.hot.addHook("afterSetTheme",(e,t)=>{t||this.close()})}createElements(){super.createElements("input"),this.TEXTAREA.setAttribute("type","date")}setValue(e){if(ht(e)&&(e=this.cellProperties.defaultDate),!Jx(e)){Ie(pt`IntlDateEditor: value must be in ISO date format ("YYYY-MM-DD")\x20
215
- required by the native date input. Received:`,e);return}super.setValue(e)}focus(){this.TEXTAREA.select()}open(){super.open();try{this.TEXTAREA.showPicker()}catch{}}}const Jee="intl-time";class Lz extends gl{static get EDITOR_TYPE(){return Jee}init(){super.init(),this.hot.addHook("afterSetTheme",(e,t)=>{t||this.close()})}createElements(){super.createElements("input"),this.TEXTAREA.setAttribute("type","time")}setValue(e){if(!eM(e)){Ie(pt`IntlTimeEditor: value must be in 24-hour time format ("HH:mm", "HH:mm:ss" or "HH:mm:ss.SSS")\x20
216
- required by the native time input. Received:`,e);return}super.setValue(e)}focus(){this.TEXTAREA.select()}open(){super.open();try{this.TEXTAREA.showPicker()}catch{}}}const ete="numeric";class Wz extends gl{static get EDITOR_TYPE(){return ete}}const tte="password";class $z extends gl{static get EDITOR_TYPE(){return tte}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,sl(this.TEXTAREA_PARENT),this.TEXTAREA.setAttribute(...wr(-1)),this.TEXTAREA_PARENT.appendChild(this.TEXTAREA)}constructor(...e){super(...e),this.autoResize=yV(this.hot.rootDocument,{textContent:t=>"•".repeat(t.value.length)})}}const cv="ht_editor_visible",r1="selectEditor",nte="select";class Fz extends ad{static get EDITOR_TYPE(){return nte}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"),t=this.hot.getSettings().ariaTags;e.className="htAutocompleteArrow",t&&e.setAttribute(...hl()),e.appendChild(this.hot.rootDocument.createTextNode("▼")),V(this.selectWrapper,"htSelectEditor"),this.selectWrapper.appendChild(this.select),this.selectWrapper.insertBefore(e,this.selectWrapper.firstChild),this.hot.rootElement.appendChild(this.selectWrapper),this.registerHooks()}getValue(){return this.select.value}setValue(e){this.select.value=e}open(){this._opened=!0,this.refreshDimensions(),this.selectWrapper.style.display="",this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this._opened=!1,this.selectWrapper.style.display="none",Se(this.selectWrapper,cv)&&re(this.selectWrapper,cv),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,t,o,i,s,r){super.prepare(e,t,o,i,s,r);const a=this.cellProperties.selectOptions;let l;typeof a=="function"?l=this.prepareOptions(a(this.row,this.col,this.prop)):l=this.prepareOptions(a),sl(this.select),nt(l,(h,c)=>{const d=this.hot.rootDocument.createElement("OPTION");d.value=c,id(d,h,this.hot.getSettings().sanitizer),this.select.appendChild(d)})}prepareOptions(e){let t={};if(Array.isArray(e))for(let o=0,i=e.length;o<i;o++)t[e[o]]=e[o];else typeof e=="object"&&(t=e);return t}refreshValue(){const e=this.hot.getSourceDataAtCell(this.row,this.prop);this.originalValue=e,this.setValue(e),this.refreshDimensions()}refreshDimensions(){if(this.state!==Tn.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.close();return}const{top:e,start:t,width:o,height:i}=this.getEditedCellRect(),s=this.selectWrapper.style;s.height=`${i}px`,s.width=`${o}px`,s.top=`${e}px`,s[this.hot.isRtl()?"right":"left"]=`${t}px`,s.margin="0px",V(this.selectWrapper,cv)}registerShortcuts(){const t=this.hot.getShortcutManager().getContext("editor"),o={group:r1};this.isInFullEditMode()&&t.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)}}],o)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(r1)}}const ote="time";class Bz extends gl{static get EDITOR_TYPE(){return ote}prepare(e,t,o,i,s,r){super.prepare(e,t,o,i,s,r),this.TEXTAREA.dir="ltr"}}function yf(n){return n.querySelector('input[type="checkbox"]')}function ite(n){return eF(n)?JSON.parse(n):n}function ste(n,e){return WG(n,e,(t,o)=>JSON.stringify(t)===JSON.stringify(o))}function Vz(n,e){return $n(e)?Array.isArray(n)&&n.some(t=>$n(t)?bh(t,e):t===e):n.includes(e)}function rte(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ate(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function lte(n,e){rte(n,e),e.add(n)}var a1=new WeakSet;class zz{getInputElement(){return this.input}setValue(e){this.input.value=e}toggle(e){this.enabled=e,this.input&&(e?this.listen():this.unlisten())}listen(){this.eventManager.addEventListener(this.input,"input",this.onInput)}unlisten(){this.eventManager.removeEventListener(this.input,"input",this.onInput)}onInput(){ate(this,a1,hte).call(this,this.input.value)}constructor({input:e,eventManager:t}){lte(this,a1),this.input=e,this.eventManager=t,this.enabled=!0,this.onInput=this.onInput.bind(this)}}function hte(n){this.runLocalHooks("triggerFilter",n)}_t(zz,Bn);const _f="ht-multi-select-editor",cte=`${_f}-search-input-wrapper`,dte=`${_f}-search-icon`,l1=`${_f}-search-input`,ute=`${_f}-separator`,fte="Search...",gte="Search options",pte=`${_f}-item-`,tM=`${_f}-item-selected`;function Uz(n){const e=yf(n);V(n,tM),e.checked||(e.checked=!0)}function Yz(n){const e=yf(n);re(n,tM),e.checked&&(e.checked=!1)}function mte({root:n}){const e=n.createElement("div");return e.className=cte,e}function wte({root:n}){const e=n.createElement("div");return V(e,dte),fe(e,[hl()]),e}function bte({root:n}){const e=n.createElement("input");return fe(e,[Pi(gte),["type","text"],["size",3],["placeholder",fte],["id",l1]]),V(e,l1),e}function Cte({root:n}){const e=n.createElement("div");return e.className=ute,e}function yte({root:n}){return n.createElement("ul")}function _te({dropdownListElement:n}){return n.offsetWidth}function Ste({dropdownListElement:n}){n.querySelectorAll(`.${tM}`).forEach(e=>Yz(e))}function h1({dropdownListElement:n,index:e}){const t=n.children[e];if(t){const o=yf(t);o&&o.blur()}}function vte({dropdownListElement:n,index:e}){const t=n.children[e];if(t){const o=yf(t);o&&o.focus()}}function Rte({dropdownListElement:n}){n.querySelectorAll('input[type="checkbox"]:not(:checked)').forEach(e=>{e.dataset.disabled=!0})}function Ete({dropdownListElement:n}){n.querySelectorAll('input[type="checkbox"]').forEach(e=>{e.dataset.disabled=!1})}function kte({rootDocument:n,instanceId:e,itemKey:t,itemValue:o,indexWithinList:i,checked:s=!1,disabled:r=!1}){const a=n.createElement("li"),l=n.createElement("div"),h=n.createElement("input"),c=n.createElement("label");return h.id=`${e}-${pte}${i}`,h.type="checkbox",h.dataset.value=o,h.dataset.index=i,h.dataset.disabled=s?!1:r,t&&(h.dataset.key=t),c.htmlFor=h.id,c.textContent=o,l.appendChild(h),l.appendChild(c),a.appendChild(l),a}function Gz(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Tte(n,e){return e.get?e.get.call(n):e.value}function xte(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function jz(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function X(n,e){var t=jz(n,e,"get");return Tte(n,t)}function xr(n,e,t){Gz(n,e),e.set(n,t)}function po(n,e,t){var o=jz(n,e,"set");return xte(n,o,t),t}function fi(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Mr(n,e){Gz(n,e),e.add(n)}var tC=new WeakMap,On=new WeakMap,Ti=new WeakMap,Ra=new WeakMap,_u=new WeakMap,Gl=new WeakMap,Su=new WeakMap,gs=new WeakMap,Fc=new WeakMap,$e=new WeakMap,sg=new WeakSet,c1=new WeakSet,d1=new WeakSet,a0=new WeakSet,u1=new WeakSet,dv=new WeakSet,f1=new WeakSet,qz=new WeakSet,g1=new WeakSet,p1=new WeakSet;class Kz{init(){po(this,Ti,yte({root:X(this,gs)})),po(this,Ra,bte({root:X(this,gs)}));const e=wte({root:X(this,gs)});po(this,Gl,mte({root:X(this,gs)})),po(this,_u,Cte({root:X(this,gs)})),X(this,Gl).appendChild(e),X(this,Gl).appendChild(X(this,Ra)),X(this,On).appendChild(X(this,Gl)),X(this,On).appendChild(X(this,_u)),X(this,On).appendChild(X(this,Ti)),po(this,Su,new zz({input:X(this,Ra),eventManager:X(this,Fc)}))}setVisibleRowsNumberSetting(e){X(this,$e).visibleRowsNumberSetting=e}setSourceSortFunction(e){X(this,$e).sourceSortFunction=e??null}setSearchInputVisibility(e=!0){X(this,Gl).style.display=e?"":"none",X(this,_u).style.display=e?"":"none",X(this,Su).toggle(e)}fillDropdown(e,t=[]){this.removeAllDropdownItems(),X(this,$e).currentlySelectedItemIndex=0,Array.isArray(t)||(t=[]),X(this,$e).sourceSortFunction&&(e=X(this,$e).sourceSortFunction(e)),e.forEach((o,i)=>{fi(this,f1,Ate).call(this,{rootDocument:X(this,gs),itemKey:o?.key,itemValue:o?.value??o,indexWithinList:i,checked:Vz(t,o),disabled:X(this,$e).areCheckboxesDisabled})}),X(this,$e).entriesCount=e.length,this.runLocalHooks("afterDropdownFill")}updateDimensions(e,t=!1){const o=fi(this,a0,Xz).call(this),i=fi(this,c1,Mte).call(this,e),s=i?e.spaceAbove:e.spaceBelow;if(!t&&i&&(X(this,$e).flippedVertically=!0),X(this,$e).entriesCount>0&&s<this.getHeight(!0)){const r=Math.max(Math.floor((s-fi(this,dv,m1).call(this))/o)-1,1);X(this,$e).actualRenderedItemsCount=X(this,$e).visibleRowsNumberSetting?Math.min(r,X(this,$e).visibleRowsNumberSetting):r}else X(this,$e).actualRenderedItemsCount=Math.min(X(this,$e).entriesCount,X(this,$e).visibleRowsNumberSetting);X(this,$e).actualRenderedItemsCount&&X(this,$e).entriesCount>X(this,$e).actualRenderedItemsCount?X(this,On).style.height=`${this.getHeight()}px`:X(this,On).style.height="",fi(this,d1,Ite).call(this,e),X(this,On).scrollTop=0}getDropdownWidth(){return _te({dropdownListElement:X(this,Ti)})}deselectAllItems(){Ste({dropdownListElement:X(this,Ti)})}focusFirstItem(){X(this,$e).entriesCount>0&&fi(this,sg,Bw).call(this,0)}focusItem(e){fi(this,sg,Bw).call(this,e)}focusPreviousItem(){if(X(this,$e).currentlySelectedItemIndex===0){this.focusSearchInput();return}h1({dropdownListElement:X(this,Ti),index:X(this,$e).currentlySelectedItemIndex}),fi(this,sg,Bw).call(this,X(this,$e).currentlySelectedItemIndex-1)}focusNextItem(){X(this,$e).currentlySelectedItemIndex!==X(this,$e).entriesCount-1&&(h1({dropdownListElement:X(this,Ti),index:X(this,$e).currentlySelectedItemIndex}),fi(this,sg,Bw).call(this,X(this,$e).currentlySelectedItemIndex+1))}focusSearchInput(){X(this,Ra)&&X(this,Ra).focus()}reset(){this.removeAllDropdownItems(),fi(this,p1,Nte).call(this),X(this,Ra)&&(X(this,Ra).value=""),X(this,On).style.position="",X(this,On).style.top="",X(this,On).style.height="",X(this,On).scrollTop=0}isFlippedVertically(){return X(this,$e).flippedVertically}getHeight(e=!1,t=!1){const o=X(this,gs).defaultView.getComputedStyle(X(this,On));return fi(this,u1,Hte).call(this,e)+fi(this,dv,m1).call(this)+(t===!0?2*parseInt(o.getPropertyValue("--ht-menu-vertical-padding"),10):0)}getInputController(){return X(this,Su)}removeAllDropdownItems(){Array.from(X(this,Ti).children).forEach(e=>fi(this,g1,Dte).call(this,e)),X(this,$e).checkboxChangeListeners.clear(),X(this,Ti).innerHTML=""}disableCheckboxes(){X(this,$e).areCheckboxesDisabled=!0,Rte({dropdownListElement:X(this,Ti)})}enableCheckboxes(){X(this,$e).areCheckboxesDisabled=!1,Ete({dropdownListElement:X(this,Ti)})}constructor(e,t){Mr(this,sg),Mr(this,c1),Mr(this,d1),Mr(this,a0),Mr(this,u1),Mr(this,dv),Mr(this,f1),Mr(this,qz),Mr(this,g1),Mr(this,p1),xr(this,tC,{writable:!0,value:void 0}),xr(this,On,{writable:!0,value:void 0}),xr(this,Ti,{writable:!0,value:void 0}),xr(this,Ra,{writable:!0,value:void 0}),xr(this,_u,{writable:!0,value:void 0}),xr(this,Gl,{writable:!0,value:void 0}),xr(this,Su,{writable:!0,value:void 0}),xr(this,gs,{writable:!0,value:void 0}),xr(this,Fc,{writable:!0,value:void 0}),xr(this,$e,{writable:!0,value:void 0}),po(this,tC,null),po(this,On,null),po(this,Ti,null),po(this,Ra,null),po(this,_u,null),po(this,Gl,null),po(this,Su,null),po(this,gs,null),po(this,Fc,new $i(this)),po(this,$e,{visibleRowsNumber:null,entriesCount:0,flippedVertically:!1,currentlySelectedItemIndex:0,checkboxChangeListeners:new Map,areCheckboxesDisabled:!1,sourceSortFunction:null}),po(this,On,e),po(this,gs,X(this,On).ownerDocument),po(this,tC,t),this.init()}}function Bw(n){X(this,$e).currentlySelectedItemIndex=n,vte({dropdownListElement:X(this,Ti),index:n})}function Mte(n){const{spaceAbove:e,spaceBelow:t,cellHeight:o}=n;return this.getHeight(!0)>t&&e>t+o}function Ite(n){const{cellHeight:e}=n;X(this,$e).flippedVertically?(X(this,On).style.position="absolute",X(this,On).style.top=`${-this.getHeight(!1,!0)-e-2}px`):(X(this,On).style.position="",X(this,On).style.top="")}function Xz(){const n=X(this,gs).defaultView.getComputedStyle(X(this,On));return 2*parseInt(n.getPropertyValue("--ht-menu-item-vertical-padding"),10)+parseInt(n.getPropertyValue("--ht-line-height"),10)}function Hte(n=!1){const e=X(this,$e).entriesCount,t=n?e:X(this,$e).actualRenderedItemsCount??e,o=fi(this,a0,Xz).call(this);return t*o}function m1(){if(!X(this,Su).enabled)return 0;const n=X(this,gs).defaultView.getComputedStyle(X(this,On)),e=X(this,Gl).offsetHeight,t=X(this,_u).offsetHeight+2*parseInt(n.getPropertyValue("--ht-menu-vertical-padding"),10);return e+t}function Ate({rootDocument:n,itemKey:e,itemValue:t,indexWithinList:o,checked:i=!1,disabled:s=!1}){const r=kte({rootDocument:n,instanceId:X(this,tC),itemKey:e,itemValue:t,indexWithinList:o,checked:i,disabled:s});i&&Uz(r),fi(this,qz,Ote).call(this,r),X(this,Ti).appendChild(r)}function Ote(n){const e=yf(n),t=()=>{if(e.dataset.disabled==="true"&&e.checked){e.checked=!1;return}e.checked?(Uz(n),this.runLocalHooks("afterDropdownItemChecked",e.dataset.key,e.dataset.value)):(Yz(n),this.runLocalHooks("afterDropdownItemUnchecked",e.dataset.key,e.dataset.value))},o=i=>{i.target===e||e.dataset.disabled==="true"||i.target.tagName==="LABEL"||(e.checked=!e.checked,e.dispatchEvent(new Event("change")))};X(this,$e).checkboxChangeListeners.set(e,{change:t,click:o}),X(this,Fc).addEventListener(e,"change",t),X(this,Fc).addEventListener(n,"click",o)}function Dte(n){const e=yf(n),t=X(this,$e).checkboxChangeListeners.get(e);X(this,Fc).removeEventListener(e,"change",t.change),X(this,Fc).removeEventListener(n,"click",t.click),X(this,$e).checkboxChangeListeners.delete(e)}function Nte(){X(this,$e).visibleRowsNumberSetting=null,X(this,$e).entriesCount=0,X(this,$e).flippedVertically=!1,X(this,$e).currentlySelectedItemIndex=0,X(this,$e).checkboxChangeListeners.clear(),X(this,$e).areCheckboxesDisabled=!1,X(this,$e).sourceSortFunction=null}_t(Kz,Bn);class l0{setMaxSelectionCount(e){this.maxSelectionsCount=e}add(e){this.selectedItems.size>=this.maxSelectionsCount||(Array.isArray(e)?e.forEach(t=>this.selectedItems.add(t)):this.selectedItems.add(e))}remove(e){if($n(e)){const o=Array.from(this.selectedItems).find(i=>bh(i,e));if(o!==void 0)return this.selectedItems.delete(o),!0}else return this.selectedItems.delete(e);return!1}has(e){return Vz(this.getItemsArray(),e)}clear(){this.selectedItems.clear()}getSize(){return this.selectedItems.size}getItemsArray(){return Array.from(this.selectedItems)}constructor(e){this.selectedItems=this.selectedItems??new Set,this.maxSelectionsCount=1/0,Array.isArray(e)?this.selectedItems=new Set(e):this.selectedItems=new Set}}function Zz(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Pte(n,e){return e.get?e.get.call(n):e.value}function Lte(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function Qz(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Nn(n,e){var t=Qz(n,e,"get");return Pte(n,t)}function w1(n,e,t){Zz(n,e),e.set(n,t)}function kp(n,e,t){var o=Qz(n,e,"set");return Lte(n,o,t),t}function xt(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function ri(n,e){Zz(n,e),e.add(n)}const Jz="multiselect",Wte="ht-multi-select-editor",$te="Select options",h0="multiselectEditor",Fte="ht_editor_visible";var No=new WeakMap,nr=new WeakMap,Tp=new WeakSet,b1=new WeakSet,C1=new WeakSet,y1=new WeakSet,_1=new WeakSet,nC=new WeakSet,c0=new WeakSet,uv=new WeakSet,d0=new WeakSet,nM=new WeakSet,S1=new WeakSet,v1=new WeakSet,u0=new WeakSet,ih=new WeakSet,R1=new WeakSet;class e2 extends ad{static get EDITOR_TYPE(){return Jz}createElements(){const{rootDocument:e}=this.hot;kp(this,nr,e.createElement("div")),Nn(this,nr).style.display="none",V(Nn(this,nr),"handsontableEditor"),this.dropdownContainerElement=this.hot.rootDocument.createElement("div"),V(this.dropdownContainerElement,`${Wte} handsontableEditor`),fe(this.dropdownContainerElement,[Pi($te),i4()]),Nn(this,nr).appendChild(this.dropdownContainerElement),this.hot.rootElement.appendChild(Nn(this,nr)),this.dropdownController=new Kz(this.dropdownContainerElement,this.hot.guid)}prepare(e,t,o,i,s,r){super.prepare(e,t,o,i,s,r);const a=ite(s),l=Array.isArray(a)?a:[a],h=ste(l,xt(this,Tp,ey).call(this));this.dropdownController.reset(),h.length>=xt(this,ih,xc).call(this,"maxSelections")&&xt(this,nC,f0).call(this),xt(this,u0,i2).call(this,h),this.dropdownController.setSourceSortFunction(this.cellProperties.sourceSortFunction),this.dropdownController.fillDropdown(xt(this,Tp,ey).call(this),h),this.dropdownController.setVisibleRowsNumberSetting(xt(this,ih,xc).call(this,"visibleRows")),this.dropdownController.setSearchInputVisibility(xt(this,ih,xc).call(this,"searchInput")),r.maxSelections!==void 0&&Nn(this,No).setMaxSelectionCount(r.maxSelections)}finishEditing(e,t,o){super.finishEditing(e,t,o)}bindEvents(){this.dropdownController.addLocalHook("afterDropdownItemChecked",(e,t)=>{xt(this,S1,Yte).call(this,e,t),Nn(this,No).getSize()>=this.cellProperties.maxSelections&&xt(this,nC,f0).call(this)}),this.dropdownController.addLocalHook("afterDropdownItemUnchecked",(e,t)=>{xt(this,v1,Gte).call(this,e,t),Nn(this,No).getSize()<this.cellProperties.maxSelections&&xt(this,c0,t2).call(this)}),this.addHook("afterDestroy",()=>this.destroy()),this.addHook("afterSetSourceDataAtCell",(...e)=>xt(this,R1,jte).call(this,...e)),this.addHook("afterScrollHorizontally",()=>this.refreshDimensions()),this.addHook("afterScrollVertically",()=>this.refreshDimensions()),this.dropdownController.getInputController().addLocalHook("triggerFilter",e=>xt(this,uv,E1).call(this,e))}open(e){if(EF(e?.keyCode)){const t=e.key.length===1?e.key:String.fromCharCode(e.keyCode);this.dropdownController.getInputController().enabled&&(this.dropdownController.getInputController().setValue(t),xt(this,uv,E1).call(this,t)),e.preventDefault(),this.enableFullEditMode()}xt(this,y1,zte).call(this),this.refreshDimensions(),this.hot.getShortcutManager().setActiveContextName("editor"),xt(this,b1,Bte).call(this),this.dropdownController.getInputController().listen(),this.dropdownController.updateDimensions(xt(this,d0,n2).call(this))}close(){xt(this,_1,Ute).call(this),xt(this,C1,Vte).call(this),this.dropdownController.getInputController().unlisten()}getValue(){return Nn(this,No).getItemsArray()}setValue(){}refreshDimensions(){if(!this.getEditedCell()){this.close();return}const{top:e,start:t,height:o}=this.getEditedCellRect(),i=Nn(this,nr).style;i.top=`${e+o}px`,i[this.hot.isRtl()?"right":"left"]=`${t}px`,V(Nn(this,nr),Fte)}focus(){xt(this,ih,xc).call(this,"searchInput")===!1?this.dropdownController.focusFirstItem():this.dropdownController.focusSearchInput()}getInputElement(){return this.dropdownController.getInputController().getInputElement()}destroy(){this.close(),this.dropdownController.reset()}constructor(e){super(e),ri(this,Tp),ri(this,b1),ri(this,C1),ri(this,y1),ri(this,_1),ri(this,nC),ri(this,c0),ri(this,uv),ri(this,d0),ri(this,nM),ri(this,S1),ri(this,v1),ri(this,u0),ri(this,ih),ri(this,R1),w1(this,No,{writable:!0,value:void 0}),w1(this,nr,{writable:!0,value:void 0}),this._closeAfterDataChange=!1,kp(this,No,new l0),kp(this,nr,null),this.dropdownContainerElement=null,this.dropdownController=this.dropdownController??null,this.eventManager=new $i(this),this.createElements(),this.bindEvents()}}function ey(){return this.cellProperties.source??[]}function Bte(){const e=this.hot.getShortcutManager().getContext("editor");e.addShortcuts([{keys:[["ArrowUp"]],callback:()=>{this.dropdownController.focusPreviousItem()}},{keys:[["ArrowDown"]],callback:()=>{this.hot.rootDocument.activeElement===this.getInputElement()?this.dropdownController.focusFirstItem():this.dropdownController.focusNextItem()}}],{group:h0}),e.addShortcuts([{keys:[["enter"],["shift","enter"],["control/meta","enter"],["control/meta","shift","enter"]],runOnlyIf:()=>!xt(this,ih,xc).call(this,"enterCommits"),callback:t=>{const o=this.hot.rootDocument.activeElement;return o.tagName==="INPUT"&&o.type==="checkbox"&&(o.checked=!o.checked,o.dispatchEvent(new Event("change"))),t.preventDefault(),!1}},{keys:[["space"]],runOnlyIf:()=>!xt(this,ih,xc).call(this,"enterCommits"),callback:t=>{t.preventDefault()}}],{group:h0,relativeToGroup:fl,position:"before"})}function Vte(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(h0)}function zte(){Nn(this,nr).style.display=""}function Ute(){Nn(this,nr).style.display="none"}function f0(){this.dropdownController.disableCheckboxes()}function t2(){this.dropdownController.enableCheckboxes()}function E1(n,e=xt(this,ih,xc).call(this,"filterSelectedItems")??!0){const t=xt(this,Tp,ey).call(this).filter(o=>{const i=o?.value??o;return!e&&Nn(this,No).has(o)?!0:this.cellProperties.filteringCaseSensitive?i.includes(n):i.toLowerCase().includes(n.toLowerCase())});this.dropdownController.fillDropdown(t,Nn(this,No).getItemsArray()),this.dropdownController.updateDimensions(xt(this,d0,n2).call(this),!0)}function n2(){const n=this.getEditedCellRect(),e=this.hot.view.isVerticallyScrollableByWindow(),t=this.hot.view.getWorkspaceHeight();let o=n.top;if(e){const s=this.hot.view.getTableOffset().top-this.hot.rootWindow.scrollY;o=Math.max(o+s,0)}const i=t-o-n.height;return{spaceAbove:o,spaceBelow:i,cellHeight:n.height}}function o2(){const n=Nn(this,No).getItemsArray();this.saveValue([[n]])}function Yte(n,e){n?Nn(this,No).add({key:n,value:e}):Nn(this,No).add(e),xt(this,nM,o2).call(this),this.refreshDimensions()}function Gte(n,e){n?Nn(this,No).remove({key:n,value:e}):Nn(this,No).remove(e),xt(this,nM,o2).call(this),this.refreshDimensions()}function i2(n){n.length>0?kp(this,No,new l0(n)):kp(this,No,new l0)}function xc(n){return this.cellProperties[n]}function jte(n,e){this.isOpened()&&e===`${Jz}-renderer`&&parseInt(n[0][0],10)===this.cellProperties.visualRow&&parseInt(n[0][1],10)===this.cellProperties.visualCol&&(xt(this,u0,i2).call(this,n[0][3]),this.dropdownController.fillDropdown(xt(this,Tp,ey).call(this),Nn(this,No).getItemsArray()),this.dropdownController.focusItem(0),Nn(this,No).getSize()>=this.cellProperties.maxSelections?xt(this,nC,f0).call(this):xt(this,c0,t2).call(this))}function qte(){Yo(ad),Yo(Mx),Yo($V),Yo(Az),Yo(Oz),Yo(xx),Yo(Pz),Yo(Lz),Yo(Wz),Yo($z),Yo(Fz),Yo(gl),Yo(Bz),Yo(e2)}const Kte="html";function oM(n,e,t,o,i,s){id(e,s??"",!1)}oM.RENDERER_TYPE=Kte;const Xte="autocomplete";function Sf(n,e,t,o,i,s,r){const{rootDocument:a}=n,l=r.allowHtml?oM:la,h=a.createElement("DIV"),c=n.getSettings().ariaTags;if(h.className="htAutocompleteArrow",c&&h.setAttribute(...hl()),h.appendChild(a.createTextNode("▼")),l.apply(this,[n,e,t,o,i,s,r]),e.firstChild||e.appendChild(a.createTextNode(" ")),e.insertBefore(h,e.firstChild),V(e,"htAutocomplete"),!n.acArrowListener){const d=new $i(n);n.acArrowListener=function(u){Se(u.target,"htAutocompleteArrow")&&n.view._wt.getSetting("onCellDblClick",null,n._createCellCoords(t,o),e)},d.addEventListener(n.rootElement,"mousedown",n.acArrowListener),n.addHookOnce("afterDestroy",()=>{d.destroy()})}}Sf.RENDERER_TYPE=Xte;const Zte="dropdown";function iM(n,e,t,o,i,s,r){Sf.apply(this,[n,e,t,o,i,s,r])}iM.RENDERER_TYPE=Zte;const gm="#bad-value#",Qi="ht-loading",k1=new WeakMap,T1=new WeakMap,Qte="htBadValue",rf="data-row",af="data-col",Jte="checkboxRenderer",s2="checkbox";de.getSingleton().add("modifyAutoColumnSizeSeed",function(n,e,t){const{label:o,type:i,row:s,column:r,prop:a}=e;if(i!==s2||!o)return;const{value:l,property:h}=o;let c=t;if(l)c=typeof l=="function"?l(s,r,a,t):l;else if(h){const d=this.getDataAtRowProp(s,h);c=d!==null?d:t}return`${yt(c).length}`});function sM(n,e,t,o,i,s,r){const{rootDocument:a}=n,l=n.getSettings().ariaTags;ene(n);let h=tne(a);const c=r.label;let d=!1;if(typeof r.checkedTemplate>"u"&&(r.checkedTemplate=!0),typeof r.uncheckedTemplate>"u"&&(r.uncheckedTemplate=!1),sl(e),s===r.checkedTemplate||yt(s).toLocaleLowerCase(r.locale)===yt(r.checkedTemplate).toLocaleLowerCase(r.locale)?h.checked=!0:s===r.uncheckedTemplate||yt(s).toLocaleLowerCase(r.locale)===yt(r.uncheckedTemplate).toLocaleLowerCase(r.locale)?h.checked=!1:ht(s)?V(h,"noValue"):(h.style.display="none",V(h,Qte),d=!0),fe(h,[[rf,t],[af,o]]),l&&fe(h,[Pi(h.checked?n.getTranslatedPhrase(ix):n.getTranslatedPhrase(sx)),lF(h.checked),t4()]),!d&&c){let C="";if(c.value)C=typeof c.value=="function"?c.value.call(this,t,o,i,s):c.value;else if(c.property){const _=n.getDataAtRowProp(t,c.property);C=_!==null?_:""}const y=nne(a,C,c.separated!==!0);c.position==="before"?c.separated?(e.appendChild(y),e.appendChild(h)):(y.appendChild(h),h=y):(!c.position||c.position==="after")&&(c.separated?(e.appendChild(h),e.appendChild(y)):(y.insertBefore(h,y.firstChild),h=y))}(!c||c&&!c.separated)&&e.appendChild(h),d&&e.appendChild(a.createTextNode(gm)),k1.has(n)||(k1.set(n,!0),u());function u(){const y=n.getShortcutManager().getContext("grid"),_={group:Jte,relativeToGroup:fl,position:"before"};y.addShortcuts([{keys:[["space"]],callback:()=>(f(),!p()),runOnlyIf:()=>n.getSelectedRangeActive()?.highlight.isCell()},{keys:[["enter"]],callback:()=>(f(),!p()),runOnlyIf:()=>{const T=n.getSelectedRangeActive();return n.getSettings().enterBeginsEditing&&T?.highlight.isCell()&&!n.selection.isMultiple()}},{keys:[["delete"],["backspace"]],callback:()=>(f(!0),!p()),runOnlyIf:()=>n.getSelectedRangeActive()?.highlight.isCell()}],_)}function f(C=!1){const y=n.getSelectedRange(),_=[],T=new Map;let P=[],$=0;if(y){for(let F=0;F<y.length;F++){const{row:N,col:I}=y[F].getTopStartCorner(),{row:j,col:U}=y[F].getBottomEndCorner();for(let G=N;G<=j;G+=1)for(let te=I;te<=U;te+=1){const Q=n.getCellMeta(G,te);if(Q.hidden)continue;const be={checkedTemplate:Q.checkedTemplate,uncheckedTemplate:Q.uncheckedTemplate};if(Q.type!=="checkbox"){C===!0&&!Q.readOnly&&(T.has(_.length)?T.set(_.length,[...T.get(_.length),[G,te,null]]):T.set(_.length,[[G,te,null]]));continue}if(Q.readOnly===!0)continue;typeof Q.checkedTemplate>"u"&&(Q.checkedTemplate=!0),typeof Q.uncheckedTemplate>"u"&&(Q.uncheckedTemplate=!1);const Oe=n.getDataAtCell(G,te);C===!1?[Q.checkedTemplate,Q.checkedTemplate.toString()].includes(Oe)?P.push([G,te,Q.uncheckedTemplate,be]):[Q.uncheckedTemplate,Q.uncheckedTemplate.toString(),null,void 0].includes(Oe)&&P.push([G,te,Q.checkedTemplate,be]):P.push([G,te,Q.uncheckedTemplate,be]),$+=1}_.push($),$=0}if(P.every(([,,F])=>F===P[0][2])?P=P.map(([F,N,I])=>[F,N,I]):P=P.map(([F,N,,I])=>[F,N,I.checkedTemplate]),P.length>0){const F=[];if(_.forEach((N,I)=>{let j=P.splice(0,N);T.size&&T.has(I)&&(j=[...j,...T.get(I)]),F.push(j)}),C){const N=[];F.forEach(I=>{I.forEach(j=>{N.push(j)})}),N.length>0&&n.setDataAtCell(N)}else F.forEach(N=>{N.length>0&&n.setDataAtCell(N)})}}}function p(){const C=n.getSelectedRange();if(C){for(let y=0;y<C.length;y++){const _=C[y].getTopStartCorner(),T=C[y].getBottomEndCorner();for(let P=_.row;P<=T.row;P++)for(let $=_.col;$<=T.col;$++){if(n.getCellMeta(P,$).readOnly)continue;const N=n.getCell(P,$);if(na(N)&&N.querySelectorAll("input[type=checkbox]").length>0)return!0}}return!1}}}sM.RENDERER_TYPE=s2;function ene(n){let e=T1.get(n);if(!e){const{rootElement:t}=n;e=new $i(n),e.addEventListener(t,"click",o=>ine(o,n)),e.addEventListener(t,"mouseup",o=>one(o,n)),e.addEventListener(t,"change",o=>sne(o,n)),T1.set(n,e)}return e}function tne(n){const e=n.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("tabindex","-1"),e.cloneNode(!1)}function nne(n,e,t){const o=n.createElement("label");o.className=`htCheckboxRendererLabel ${t?"fullWidth":""}`;const i=n.createTextNode(e);if(t){const s=n.createElement("span");s.appendChild(i),o.appendChild(s)}else o.appendChild(i);return o.cloneNode(!0)}function one(n,e){const{target:t}=n;rM(t)&&(!t.hasAttribute(rf)||!t.hasAttribute(af)||setTimeout(e.listen,10))}function ine(n,e){const{target:t}=n;if(!rM(t)||!t.hasAttribute(rf)||!t.hasAttribute(af))return;const o=parseInt(t.getAttribute(rf),10),i=parseInt(t.getAttribute(af),10);e.getCellMeta(o,i).readOnly&&n.preventDefault()}function sne(n,e){const{target:t}=n;if(!rM(t)||!t.hasAttribute(rf)||!t.hasAttribute(af))return;const o=parseInt(t.getAttribute(rf),10),i=parseInt(t.getAttribute(af),10),s=e.getCellMeta(o,i);if(!s.readOnly){let r=null;n.target.checked?r=s.uncheckedTemplate===void 0?!0:s.checkedTemplate:r=s.uncheckedTemplate===void 0?!1:s.uncheckedTemplate,e.setDataAtCell(o,i,r)}}function rM(n){return n.tagName==="INPUT"&&n.getAttribute("type")==="checkbox"}const rne="handsontable";function aM(n,e,t,o,i,s,r){Sf.apply(this,[n,e,t,o,i,s,r])}aM.RENDERER_TYPE=rne;const ane="intl-date",lne={year:"numeric",month:"2-digit",day:"2-digit"};function r2(n,e){const{dateFormat:t,locale:o,allowEmpty:i}=e;if(ht(n))return i?n:gm;const s=sa(n);if(s===null)return gm;const r=ie(t)?t:lne;return new Intl.DateTimeFormat(o,r).format(s)}function p_(n,e,t,o,i,s,r){la.apply(this,[n,e,t,o,i,s,r])}p_.valueFormatter=r2;p_.RENDERER_TYPE=ane;const hne="intl-time",cne={hour:"numeric",minute:"2-digit"};function dne(n,e){const{timeFormat:t,locale:o,allowEmpty:i}=e;if(ht(n))return i?n:gm;const s=td(n);if(s===null)return gm;const r=ie(t)?t:cne;return new Intl.DateTimeFormat(o,r).format(s)}function lM(n,e,t,o,i,s,r){la.apply(this,[n,e,t,o,i,s,r]),e.dir="ltr"}lM.RENDERER_TYPE=hne;var une=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fne(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var fv,x1;function gne(){return x1||(x1=1,fv={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(n){let e=n%10;return~~(n%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}}}),fv}var gv,M1;function a2(){if(M1)return gv;M1=1;const n=[{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 t(l,h,c,d,u,f,p){if(!isNaN(+l))return+l;let C="",y=l.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(y!==l)return-1*t(y,h,c,d,u,f);for(let N=0;N<n.length;N++){let I=n[N];if(C=l.replace(RegExp(`([0-9 ])(${I.key})$`),"$1"),C!==l)return t(C,h,c,d,u,f)*I.factor}if(C=l.replace("%",""),C!==l)return t(C,h,c,d,u,f)/100;let _=parseFloat(l);if(isNaN(_))return;let T=d(_);if(T&&T!=="."&&(C=l.replace(new RegExp(`${e(T)}$`),""),C!==l))return t(C,h,c,d,u,f);let P={};Object.keys(f).forEach(N=>{P[f[N]]=N});let $=Object.keys(P).sort().reverse(),F=$.length;for(let N=0;N<F;N++){let I=$[N],j=P[I];if(C=l.replace(I,""),C!==l){let U;switch(j){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 t(C,h,c,d,u,f)*U}}}function o(l,h,c){let d=l.replace(c,"");return d=d.replace(new RegExp(`([0-9])${e(h.thousands)}([0-9])`,"g"),"$1$2"),d=d.replace(h.decimal,"."),d}function i(l,h,c="",d,u,f,p){if(l==="")return;if(l===u)return 0;let C=o(l,h,c);return t(C,h,c,d,u,f)}function s(l,h){if(!(l.indexOf(":")&&h.thousands!==":"))return!1;let d=l.split(":");if(d.length!==3)return!1;let u=+d[0],f=+d[1],p=+d[2];return!isNaN(u)&&!isNaN(f)&&!isNaN(p)}function r(l){let h=l.split(":"),c=+h[0],d=+h[1];return+h[2]+60*d+3600*c}function a(l,h){const c=dM();let d=c.currentDelimiters(),u=c.currentCurrency().symbol,f=c.currentOrdinal(),p=c.getZeroFormat(),C=c.currentAbbreviations(),y;if(typeof l=="string")s(l,d)?y=r(l):y=i(l,d,u,f,p,C);else if(typeof l=="number")y=l;else return;if(y!==void 0)return y}return gv={unformat:a},gv}var pv,I1;function hM(){if(I1)return pv;I1=1;let n=a2();const e=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,t=["currency","percent","byte","time","ordinal","number"],o=["trillion","billion","million","thousand"],i=["prefix","infix","postfix"],s=["sign","parenthesis"],r={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},h={output:{type:"string",validValues:t},base:{type:"string",validValues:["decimal","binary","general"],restriction:(y,_)=>_.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:o},average:"boolean",lowPrecision:{type:"boolean",restriction:(y,_)=>_.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,_)=>!_.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:s},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:(y,_)=>_.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:r,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 d(y,_){let T=u(y),P=p(_);return T&&P}function u(y){return n.unformat(y)!==void 0}function f(y,_,T,P=!1){let $=Object.keys(y).map(F=>{if(!_[F])return console.error(`${T} Invalid key: ${F}`),!1;let N=y[F],I=_[F];if(typeof I=="string"&&(I={type:I}),I.type==="format"){if(!f(N,h,`[Validate ${F}]`,!0))return!1}else if(typeof N!==I.type)return console.error(`${T} ${F} type mismatched: "${I.type}" expected, "${typeof N}" provided`),!1;if(I.restrictions&&I.restrictions.length){let j=I.restrictions.length;for(let U=0;U<j;U++){let{restriction:G,message:te}=I.restrictions[U];if(!G(N,y))return console.error(`${T} ${F} invalid value: ${te}`),!1}}return I.restriction&&!I.restriction(N,y)?(console.error(`${T} ${F} invalid value: ${I.message}`),!1):I.validValues&&I.validValues.indexOf(N)===-1?(console.error(`${T} ${F} invalid value: must be among ${JSON.stringify(I.validValues)}, "${N}" provided`),!1):!(I.children&&!f(N,I.children,`[Validate ${F}]`))});return P||$.push(...Object.keys(_).map(F=>{let N=_[F];if(typeof N=="string"&&(N={type:N}),N.mandatory){let I=N.mandatory;if(typeof I=="function"&&(I=I(y)),I&&y[F]===void 0)return console.error(`${T} Missing mandatory key "${F}"`),!1}return!0})),$.reduce((F,N)=>F&&N,!0)}function p(y){return f(y,h,"[Validate format]")}function C(y){return f(y,c,"[Validate language]")}return pv={validate:d,validateFormat:p,validateInput:u,validateLanguage:C},pv}function pne(n,e){let t=n.match(/^{([^}]*)}/);return t?(e.prefix=t[1],n.slice(t[0].length)):n}function mne(n,e){let t=n.match(/{([^}]*)}$/);return t?(e.postfix=t[1],n.slice(0,-t[0].length)):n}function wne(n,e){if(n.indexOf("$")!==-1){e.output="currency";return}if(n.indexOf("%")!==-1){e.output="percent";return}if(n.indexOf("bd")!==-1){e.output="byte",e.base="general";return}if(n.indexOf("b")!==-1){e.output="byte",e.base="binary";return}if(n.indexOf("d")!==-1){e.output="byte",e.base="decimal";return}if(n.indexOf(":")!==-1){e.output="time";return}n.indexOf("o")!==-1&&(e.output="ordinal")}function bne(n,e){n.indexOf(",")!==-1&&(e.thousandSeparated=!0)}function Cne(n,e){n.indexOf(" ")!==-1&&(e.spaceSeparated=!0,e.spaceSeparatedCurrency=!0,(e.average||e.forceAverage)&&(e.spaceSeparatedAbbreviation=!0))}function yne(n,e){let t=n.match(/[1-9]+[0-9]*/);t&&(e.totalLength=+t[0])}function _ne(n,e){let o=n.split(".")[0].match(/0+/);o&&(e.characteristic=o[0].length)}function Sne(n,e){let t=n.split(".")[1];if(t){let o=t.match(/0+/);o&&(e.mantissa=o[0].length)}}function vne(n,e){const t=n.split(".")[1];t&&(e.trimMantissa=t.indexOf("[")!==-1)}function Rne(n,e){n.indexOf("a")!==-1&&(e.average=!0)}function Ene(n,e){n.indexOf("K")!==-1?e.forceAverage="thousand":n.indexOf("M")!==-1?e.forceAverage="million":n.indexOf("B")!==-1?e.forceAverage="billion":n.indexOf("T")!==-1&&(e.forceAverage="trillion")}function kne(n,e){n.match(/\[\.]/)?e.optionalMantissa=!0:n.match(/\./)&&(e.optionalMantissa=!1)}function Tne(n,e){if(n.indexOf(".")!==-1){let t=n.split(".")[0];e.optionalCharacteristic=t.indexOf("0")===-1}}function xne(n,e){n.match(/^\+?\([^)]*\)$/)&&(e.negative="parenthesis"),n.match(/^\+?-/)&&(e.negative="sign")}function Mne(n,e){n.match(/^\+/)&&(e.forceSign=!0)}function Ine(n,e={}){return typeof n!="string"?n:(n=pne(n,e),n=mne(n,e),wne(n,e),yne(n,e),_ne(n,e),Tne(n,e),Rne(n,e),Ene(n,e),Sne(n,e),kne(n,e),vne(n,e),bne(n,e),Cne(n,e),xne(n,e),Mne(n,e),e)}var cM={parseFormat:Ine};var mv,H1;function dM(){if(H1)return mv;H1=1;const n=gne(),e=hM(),t=cM;let o={},i,s={},r=null,a={};function l(c){i=c}function h(){return s[i]}return o.languages=()=>Object.assign({},s),o.currentLanguage=()=>i,o.currentBytes=()=>h().bytes||{},o.currentCurrency=()=>h().currency,o.currentAbbreviations=()=>h().abbreviations,o.currentDelimiters=()=>h().delimiters,o.currentOrdinal=()=>h().ordinal,o.currentDefaults=()=>Object.assign({},h().defaults,a),o.currentOrdinalDefaultFormat=()=>Object.assign({},o.currentDefaults(),h().ordinalFormat),o.currentByteDefaultFormat=()=>Object.assign({},o.currentDefaults(),h().byteFormat),o.currentPercentageDefaultFormat=()=>Object.assign({},o.currentDefaults(),h().percentageFormat),o.currentCurrencyDefaultFormat=()=>Object.assign({},o.currentDefaults(),h().currencyFormat),o.currentTimeDefaultFormat=()=>Object.assign({},o.currentDefaults(),h().timeFormat),o.setDefaults=c=>{c=t.parseFormat(c),e.validateFormat(c)&&(a=c)},o.getZeroFormat=()=>r,o.setZeroFormat=c=>r=typeof c=="string"?c:null,o.hasZeroFormat=()=>r!==null,o.languageData=c=>{if(c){if(s[c])return s[c];throw new Error(`Unknown tag "${c}"`)}return h()},o.registerLanguage=(c,d=!1)=>{if(!e.validateLanguage(c))throw new Error("Invalid language data");s[c.languageTag]=c,d&&l(c.languageTag)},o.setLanguage=(c,d=n.languageTag)=>{if(!s[c]){let u=c.split("-")[0],f=Object.keys(s).find(p=>p.split("-")[0]===u);if(!s[f]){l(d);return}l(f);return}l(c)},o.registerLanguage(n),i=n.languageTag,mv=o,mv}function Hne(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}function Ane(n,e){n.forEach(t=>{let o;try{o=Hne(`../languages/${t}`)}catch{console.error(`Unable to load "${t}". No matching language file found.`)}o&&e.registerLanguage(o)})}var One=n=>({loadLanguagesInNode:e=>Ane(e,n)}),l2={exports:{}};(function(n){(function(e){var t,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,s=Math.floor,r="[BigNumber Error] ",a=r+"Number primitive has more than 15 significant digits: ",l=1e14,h=14,c=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],u=1e7,f=1e9;function p(N){var I,j,U,G=z.prototype={constructor:z,toString:null,valueOf:null},te=new z(1),Q=20,be=4,Oe=-7,Ve=21,Ke=-1e7,He=1e7,Ye=!1,bt=1,sn=0,D={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},K="0123456789abcdefghijklmnopqrstuvwxyz",ye=!0;function z(m,w){var S,R,x,M,L,E,A,W,H=this;if(!(H instanceof z))return new z(m,w);if(w==null){if(m&&m._isBigNumber===!0){H.s=m.s,!m.c||m.e>He?H.c=H.e=null:m.e<Ke?H.c=[H.e=0]:(H.e=m.e,H.c=m.c.slice());return}if((E=typeof m=="number")&&m*0==0){if(H.s=1/m<0?(m=-m,-1):1,m===~~m){for(M=0,L=m;L>=10;L/=10,M++);M>He?H.c=H.e=null:(H.e=M,H.c=[m]);return}W=String(m)}else{if(!o.test(W=String(m)))return U(H,W,E);H.s=W.charCodeAt(0)==45?(W=W.slice(1),-1):1}(M=W.indexOf("."))>-1&&(W=W.replace(".","")),(L=W.search(/e/i))>0?(M<0&&(M=L),M+=+W.slice(L+1),W=W.substring(0,L)):M<0&&(M=W.length)}else{if(T(w,2,K.length,"Base"),w==10&&ye)return H=new z(m),b(H,Q+H.e+1,be);if(W=String(m),E=typeof m=="number"){if(m*0!=0)return U(H,W,E,w);if(H.s=1/m<0?(W=W.slice(1),-1):1,z.DEBUG&&W.replace(/^0\.0*|\./,"").length>15)throw Error(a+m)}else H.s=W.charCodeAt(0)===45?(W=W.slice(1),-1):1;for(S=K.slice(0,w),M=L=0,A=W.length;L<A;L++)if(S.indexOf(R=W.charAt(L))<0){if(R=="."){if(L>M){M=A;continue}}else if(!x&&(W==W.toUpperCase()&&(W=W.toLowerCase())||W==W.toLowerCase()&&(W=W.toUpperCase()))){x=!0,L=-1,M=0;continue}return U(H,String(m),E,w)}E=!1,W=j(W,w,10,H.s),(M=W.indexOf("."))>-1?W=W.replace(".",""):M=W.length}for(L=0;W.charCodeAt(L)===48;L++);for(A=W.length;W.charCodeAt(--A)===48;);if(W=W.slice(L,++A)){if(A-=L,E&&z.DEBUG&&A>15&&(m>c||m!==s(m)))throw Error(a+H.s*m);if((M=M-L-1)>He)H.c=H.e=null;else if(M<Ke)H.c=[H.e=0];else{if(H.e=M,H.c=[],L=(M+1)%h,M<0&&(L+=h),L<A){for(L&&H.c.push(+W.slice(0,L)),A-=h;L<A;)H.c.push(+W.slice(L,L+=h));L=h-(W=W.slice(L)).length}else L-=A;for(;L--;W+="0");H.c.push(+W)}}else H.c=[H.e=0]}z.clone=p,z.ROUND_UP=0,z.ROUND_DOWN=1,z.ROUND_CEIL=2,z.ROUND_FLOOR=3,z.ROUND_HALF_UP=4,z.ROUND_HALF_DOWN=5,z.ROUND_HALF_EVEN=6,z.ROUND_HALF_CEIL=7,z.ROUND_HALF_FLOOR=8,z.EUCLID=9,z.config=z.set=function(m){var w,S;if(m!=null)if(typeof m=="object"){if(m.hasOwnProperty(w="DECIMAL_PLACES")&&(S=m[w],T(S,0,f,w),Q=S),m.hasOwnProperty(w="ROUNDING_MODE")&&(S=m[w],T(S,0,8,w),be=S),m.hasOwnProperty(w="EXPONENTIAL_AT")&&(S=m[w],S&&S.pop?(T(S[0],-f,0,w),T(S[1],0,f,w),Oe=S[0],Ve=S[1]):(T(S,-f,f,w),Oe=-(Ve=S<0?-S:S))),m.hasOwnProperty(w="RANGE"))if(S=m[w],S&&S.pop)T(S[0],-f,-1,w),T(S[1],1,f,w),Ke=S[0],He=S[1];else if(T(S,-f,f,w),S)Ke=-(He=S<0?-S:S);else throw Error(r+w+" cannot be zero: "+S);if(m.hasOwnProperty(w="CRYPTO"))if(S=m[w],S===!!S)if(S)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))Ye=S;else throw Ye=!S,Error(r+"crypto unavailable");else Ye=S;else throw Error(r+w+" not true or false: "+S);if(m.hasOwnProperty(w="MODULO_MODE")&&(S=m[w],T(S,0,9,w),bt=S),m.hasOwnProperty(w="POW_PRECISION")&&(S=m[w],T(S,0,f,w),sn=S),m.hasOwnProperty(w="FORMAT"))if(S=m[w],typeof S=="object")D=S;else throw Error(r+w+" not an object: "+S);if(m.hasOwnProperty(w="ALPHABET"))if(S=m[w],typeof S=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(S))ye=S.slice(0,10)=="0123456789",K=S;else throw Error(r+w+" invalid: "+S)}else throw Error(r+"Object expected: "+m);return{DECIMAL_PLACES:Q,ROUNDING_MODE:be,EXPONENTIAL_AT:[Oe,Ve],RANGE:[Ke,He],CRYPTO:Ye,MODULO_MODE:bt,POW_PRECISION:sn,FORMAT:D,ALPHABET:K}},z.isBigNumber=function(m){if(!m||m._isBigNumber!==!0)return!1;if(!z.DEBUG)return!0;var w,S,R=m.c,x=m.e,M=m.s;e:if({}.toString.call(R)=="[object Array]"){if((M===1||M===-1)&&x>=-f&&x<=f&&x===s(x)){if(R[0]===0){if(x===0&&R.length===1)return!0;break e}if(w=(x+1)%h,w<1&&(w+=h),String(R[0]).length==w){for(w=0;w<R.length;w++)if(S=R[w],S<0||S>=l||S!==s(S))break e;if(S!==0)return!0}}}else if(R===null&&x===null&&(M===null||M===1||M===-1))return!0;throw Error(r+"Invalid BigNumber: "+m)},z.maximum=z.max=function(){return Ge(arguments,-1)},z.minimum=z.min=function(){return Ge(arguments,1)},z.random=(function(){var m=9007199254740992,w=Math.random()*m&2097151?function(){return s(Math.random()*m)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(S){var R,x,M,L,E,A=0,W=[],H=new z(te);if(S==null?S=Q:T(S,0,f),L=i(S/h),Ye)if(crypto.getRandomValues){for(R=crypto.getRandomValues(new Uint32Array(L*=2));A<L;)E=R[A]*131072+(R[A+1]>>>11),E>=9e15?(x=crypto.getRandomValues(new Uint32Array(2)),R[A]=x[0],R[A+1]=x[1]):(W.push(E%1e14),A+=2);A=L/2}else if(crypto.randomBytes){for(R=crypto.randomBytes(L*=7);A<L;)E=(R[A]&31)*281474976710656+R[A+1]*1099511627776+R[A+2]*4294967296+R[A+3]*16777216+(R[A+4]<<16)+(R[A+5]<<8)+R[A+6],E>=9e15?crypto.randomBytes(7).copy(R,A):(W.push(E%1e14),A+=7);A=L/7}else throw Ye=!1,Error(r+"crypto unavailable");if(!Ye)for(;A<L;)E=w(),E<9e15&&(W[A++]=E%1e14);for(L=W[--A],S%=h,L&&S&&(E=d[h-S],W[A]=s(L/E)*E);W[A]===0;W.pop(),A--);if(A<0)W=[M=0];else{for(M=-1;W[0]===0;W.splice(0,1),M-=h);for(A=1,E=W[0];E>=10;E/=10,A++);A<h&&(M-=h-A)}return H.e=M,H.c=W,H}})(),z.sum=function(){for(var m=1,w=arguments,S=new z(w[0]);m<w.length;)S=S.plus(w[m++]);return S},j=(function(){var m="0123456789";function w(S,R,x,M){for(var L,E=[0],A,W=0,H=S.length;W<H;){for(A=E.length;A--;E[A]*=R);for(E[0]+=M.indexOf(S.charAt(W++)),L=0;L<E.length;L++)E[L]>x-1&&(E[L+1]==null&&(E[L+1]=0),E[L+1]+=E[L]/x|0,E[L]%=x)}return E.reverse()}return function(S,R,x,M,L){var E,A,W,H,q,ge,se,Me,xe=S.indexOf("."),Je=Q,De=be;for(xe>=0&&(H=sn,sn=0,S=S.replace(".",""),Me=new z(R),ge=Me.pow(S.length-xe),sn=H,Me.c=w(F(y(ge.c),ge.e,"0"),10,x,m),Me.e=Me.c.length),se=w(S,R,x,L?(E=K,m):(E=m,K)),W=H=se.length;se[--H]==0;se.pop());if(!se[0])return E.charAt(0);if(xe<0?--W:(ge.c=se,ge.e=W,ge.s=M,ge=I(ge,Me,Je,De,x),se=ge.c,q=ge.r,W=ge.e),A=W+Je+1,xe=se[A],H=x/2,q=q||A<0||se[A+1]!=null,q=De<4?(xe!=null||q)&&(De==0||De==(ge.s<0?3:2)):xe>H||xe==H&&(De==4||q||De==6&&se[A-1]&1||De==(ge.s<0?8:7)),A<1||!se[0])S=q?F(E.charAt(1),-Je,E.charAt(0)):E.charAt(0);else{if(se.length=A,q)for(--x;++se[--A]>x;)se[A]=0,A||(++W,se=[1].concat(se));for(H=se.length;!se[--H];);for(xe=0,S="";xe<=H;S+=E.charAt(se[xe++]));S=F(S,W,E.charAt(0))}return S}})(),I=(function(){function m(R,x,M){var L,E,A,W,H=0,q=R.length,ge=x%u,se=x/u|0;for(R=R.slice();q--;)A=R[q]%u,W=R[q]/u|0,L=se*A+W*ge,E=ge*A+L%u*u+H,H=(E/M|0)+(L/u|0)+se*W,R[q]=E%M;return H&&(R=[H].concat(R)),R}function w(R,x,M,L){var E,A;if(M!=L)A=M>L?1:-1;else for(E=A=0;E<M;E++)if(R[E]!=x[E]){A=R[E]>x[E]?1:-1;break}return A}function S(R,x,M,L){for(var E=0;M--;)R[M]-=E,E=R[M]<x[M]?1:0,R[M]=E*L+R[M]-x[M];for(;!R[0]&&R.length>1;R.splice(0,1));}return function(R,x,M,L,E){var A,W,H,q,ge,se,Me,xe,Je,De,et,Vt,Hn,co,rn,Yt,Wo,uo=R.s==x.s?1:-1,_n=R.c,At=x.c;if(!_n||!_n[0]||!At||!At[0])return new z(!R.s||!x.s||(_n?At&&_n[0]==At[0]:!At)?NaN:_n&&_n[0]==0||!At?uo*0:uo/0);for(xe=new z(uo),Je=xe.c=[],W=R.e-x.e,uo=M+W+1,E||(E=l,W=C(R.e/h)-C(x.e/h),uo=uo/h|0),H=0;At[H]==(_n[H]||0);H++);if(At[H]>(_n[H]||0)&&W--,uo<0)Je.push(1),q=!0;else{for(co=_n.length,Yt=At.length,H=0,uo+=2,ge=s(E/(At[0]+1)),ge>1&&(At=m(At,ge,E),_n=m(_n,ge,E),Yt=At.length,co=_n.length),Hn=Yt,De=_n.slice(0,Yt),et=De.length;et<Yt;De[et++]=0);Wo=At.slice(),Wo=[0].concat(Wo),rn=At[0],At[1]>=E/2&&rn++;do{if(ge=0,A=w(At,De,Yt,et),A<0){if(Vt=De[0],Yt!=et&&(Vt=Vt*E+(De[1]||0)),ge=s(Vt/rn),ge>1)for(ge>=E&&(ge=E-1),se=m(At,ge,E),Me=se.length,et=De.length;w(se,De,Me,et)==1;)ge--,S(se,Yt<Me?Wo:At,Me,E),Me=se.length,A=1;else ge==0&&(A=ge=1),se=At.slice(),Me=se.length;if(Me<et&&(se=[0].concat(se)),S(De,se,et,E),et=De.length,A==-1)for(;w(At,De,Yt,et)<1;)ge++,S(De,Yt<et?Wo:At,et,E),et=De.length}else A===0&&(ge++,De=[0]);Je[H++]=ge,De[0]?De[et++]=_n[Hn]||0:(De=[_n[Hn]],et=1)}while((Hn++<co||De[0]!=null)&&uo--);q=De[0]!=null,Je[0]||Je.splice(0,1)}if(E==l){for(H=1,uo=Je[0];uo>=10;uo/=10,H++);b(xe,M+(xe.e=H+W*h-1)+1,L,q)}else xe.e=W,xe.r=+q;return xe}})();function Ee(m,w,S,R){var x,M,L,E,A;if(S==null?S=be:T(S,0,8),!m.c)return m.toString();if(x=m.c[0],L=m.e,w==null)A=y(m.c),A=R==1||R==2&&(L<=Oe||L>=Ve)?$(A,L):F(A,L,"0");else if(m=b(new z(m),w,S),M=m.e,A=y(m.c),E=A.length,R==1||R==2&&(w<=M||M<=Oe)){for(;E<w;A+="0",E++);A=$(A,M)}else if(w-=L,A=F(A,M,"0"),M+1>E){if(--w>0)for(A+=".";w--;A+="0");}else if(w+=M-E,w>0)for(M+1==E&&(A+=".");w--;A+="0");return m.s<0&&x?"-"+A:A}function Ge(m,w){for(var S,R,x=1,M=new z(m[0]);x<m.length;x++)R=new z(m[x]),(!R.s||(S=_(M,R))===w||S===0&&M.s===w)&&(M=R);return M}function g(m,w,S){for(var R=1,x=w.length;!w[--x];w.pop());for(x=w[0];x>=10;x/=10,R++);return(S=R+S*h-1)>He?m.c=m.e=null:S<Ke?m.c=[m.e=0]:(m.e=S,m.c=w),m}U=(function(){var m=/^(-?)0([xbo])(?=\w[\w.]*$)/i,w=/^([^.]+)\.$/,S=/^\.([^.]+)$/,R=/^-?(Infinity|NaN)$/,x=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(M,L,E,A){var W,H=E?L:L.replace(x,"");if(R.test(H))M.s=isNaN(H)?null:H<0?-1:1;else{if(!E&&(H=H.replace(m,function(q,ge,se){return W=(se=se.toLowerCase())=="x"?16:se=="b"?2:8,!A||A==W?ge:q}),A&&(W=A,H=H.replace(w,"$1").replace(S,"0.$1")),L!=H))return new z(H,W);if(z.DEBUG)throw Error(r+"Not a"+(A?" base "+A:"")+" number: "+L);M.s=null}M.c=M.e=null}})();function b(m,w,S,R){var x,M,L,E,A,W,H,q=m.c,ge=d;if(q){e:{for(x=1,E=q[0];E>=10;E/=10,x++);if(M=w-x,M<0)M+=h,L=w,A=q[W=0],H=s(A/ge[x-L-1]%10);else if(W=i((M+1)/h),W>=q.length)if(R){for(;q.length<=W;q.push(0));A=H=0,x=1,M%=h,L=M-h+1}else break e;else{for(A=E=q[W],x=1;E>=10;E/=10,x++);M%=h,L=M-h+x,H=L<0?0:s(A/ge[x-L-1]%10)}if(R=R||w<0||q[W+1]!=null||(L<0?A:A%ge[x-L-1]),R=S<4?(H||R)&&(S==0||S==(m.s<0?3:2)):H>5||H==5&&(S==4||R||S==6&&(M>0?L>0?A/ge[x-L]:0:q[W-1])%10&1||S==(m.s<0?8:7)),w<1||!q[0])return q.length=0,R?(w-=m.e+1,q[0]=ge[(h-w%h)%h],m.e=-w||0):q[0]=m.e=0,m;if(M==0?(q.length=W,E=1,W--):(q.length=W+1,E=ge[h-M],q[W]=L>0?s(A/ge[x-L]%ge[L])*E:0),R)for(;;)if(W==0){for(M=1,L=q[0];L>=10;L/=10,M++);for(L=q[0]+=E,E=1;L>=10;L/=10,E++);M!=E&&(m.e++,q[0]==l&&(q[0]=1));break}else{if(q[W]+=E,q[W]!=l)break;q[W--]=0,E=1}for(M=q.length;q[--M]===0;q.pop());}m.e>He?m.c=m.e=null:m.e<Ke&&(m.c=[m.e=0])}return m}function v(m){var w,S=m.e;return S===null?m.toString():(w=y(m.c),w=S<=Oe||S>=Ve?$(w,S):F(w,S,"0"),m.s<0?"-"+w:w)}return G.absoluteValue=G.abs=function(){var m=new z(this);return m.s<0&&(m.s=1),m},G.comparedTo=function(m,w){return _(this,new z(m,w))},G.decimalPlaces=G.dp=function(m,w){var S,R,x,M=this;if(m!=null)return T(m,0,f),w==null?w=be:T(w,0,8),b(new z(M),m+M.e+1,w);if(!(S=M.c))return null;if(R=((x=S.length-1)-C(this.e/h))*h,x=S[x])for(;x%10==0;x/=10,R--);return R<0&&(R=0),R},G.dividedBy=G.div=function(m,w){return I(this,new z(m,w),Q,be)},G.dividedToIntegerBy=G.idiv=function(m,w){return I(this,new z(m,w),0,1)},G.exponentiatedBy=G.pow=function(m,w){var S,R,x,M,L,E,A,W,H,q=this;if(m=new z(m),m.c&&!m.isInteger())throw Error(r+"Exponent not an integer: "+v(m));if(w!=null&&(w=new z(w)),E=m.e>14,!q.c||!q.c[0]||q.c[0]==1&&!q.e&&q.c.length==1||!m.c||!m.c[0])return H=new z(Math.pow(+v(q),E?m.s*(2-P(m)):+v(m))),w?H.mod(w):H;if(A=m.s<0,w){if(w.c?!w.c[0]:!w.s)return new z(NaN);R=!A&&q.isInteger()&&w.isInteger(),R&&(q=q.mod(w))}else{if(m.e>9&&(q.e>0||q.e<-1||(q.e==0?q.c[0]>1||E&&q.c[1]>=24e7:q.c[0]<8e13||E&&q.c[0]<=9999975e7)))return M=q.s<0&&P(m)?-0:0,q.e>-1&&(M=1/M),new z(A?1/M:M);sn&&(M=i(sn/h+2))}for(E?(S=new z(.5),A&&(m.s=1),W=P(m)):(x=Math.abs(+v(m)),W=x%2),H=new z(te);;){if(W){if(H=H.times(q),!H.c)break;M?H.c.length>M&&(H.c.length=M):R&&(H=H.mod(w))}if(x){if(x=s(x/2),x===0)break;W=x%2}else if(m=m.times(S),b(m,m.e+1,1),m.e>14)W=P(m);else{if(x=+v(m),x===0)break;W=x%2}q=q.times(q),M?q.c&&q.c.length>M&&(q.c.length=M):R&&(q=q.mod(w))}return R?H:(A&&(H=te.div(H)),w?H.mod(w):M?b(H,sn,be,L):H)},G.integerValue=function(m){var w=new z(this);return m==null?m=be:T(m,0,8),b(w,w.e+1,m)},G.isEqualTo=G.eq=function(m,w){return _(this,new z(m,w))===0},G.isFinite=function(){return!!this.c},G.isGreaterThan=G.gt=function(m,w){return _(this,new z(m,w))>0},G.isGreaterThanOrEqualTo=G.gte=function(m,w){return(w=_(this,new z(m,w)))===1||w===0},G.isInteger=function(){return!!this.c&&C(this.e/h)>this.c.length-2},G.isLessThan=G.lt=function(m,w){return _(this,new z(m,w))<0},G.isLessThanOrEqualTo=G.lte=function(m,w){return(w=_(this,new z(m,w)))===-1||w===0},G.isNaN=function(){return!this.s},G.isNegative=function(){return this.s<0},G.isPositive=function(){return this.s>0},G.isZero=function(){return!!this.c&&this.c[0]==0},G.minus=function(m,w){var S,R,x,M,L=this,E=L.s;if(m=new z(m,w),w=m.s,!E||!w)return new z(NaN);if(E!=w)return m.s=-w,L.plus(m);var A=L.e/h,W=m.e/h,H=L.c,q=m.c;if(!A||!W){if(!H||!q)return H?(m.s=-w,m):new z(q?L:NaN);if(!H[0]||!q[0])return q[0]?(m.s=-w,m):new z(H[0]?L:be==3?-0:0)}if(A=C(A),W=C(W),H=H.slice(),E=A-W){for((M=E<0)?(E=-E,x=H):(W=A,x=q),x.reverse(),w=E;w--;x.push(0));x.reverse()}else for(R=(M=(E=H.length)<(w=q.length))?E:w,E=w=0;w<R;w++)if(H[w]!=q[w]){M=H[w]<q[w];break}if(M&&(x=H,H=q,q=x,m.s=-m.s),w=(R=q.length)-(S=H.length),w>0)for(;w--;H[S++]=0);for(w=l-1;R>E;){if(H[--R]<q[R]){for(S=R;S&&!H[--S];H[S]=w);--H[S],H[R]+=l}H[R]-=q[R]}for(;H[0]==0;H.splice(0,1),--W);return H[0]?g(m,H,W):(m.s=be==3?-1:1,m.c=[m.e=0],m)},G.modulo=G.mod=function(m,w){var S,R,x=this;return m=new z(m,w),!x.c||!m.s||m.c&&!m.c[0]?new z(NaN):!m.c||x.c&&!x.c[0]?new z(x):(bt==9?(R=m.s,m.s=1,S=I(x,m,0,3),m.s=R,S.s*=R):S=I(x,m,0,bt),m=x.minus(S.times(m)),!m.c[0]&&bt==1&&(m.s=x.s),m)},G.multipliedBy=G.times=function(m,w){var S,R,x,M,L,E,A,W,H,q,ge,se,Me,xe,Je,De=this,et=De.c,Vt=(m=new z(m,w)).c;if(!et||!Vt||!et[0]||!Vt[0])return!De.s||!m.s||et&&!et[0]&&!Vt||Vt&&!Vt[0]&&!et?m.c=m.e=m.s=null:(m.s*=De.s,!et||!Vt?m.c=m.e=null:(m.c=[0],m.e=0)),m;for(R=C(De.e/h)+C(m.e/h),m.s*=De.s,A=et.length,q=Vt.length,A<q&&(Me=et,et=Vt,Vt=Me,x=A,A=q,q=x),x=A+q,Me=[];x--;Me.push(0));for(xe=l,Je=u,x=q;--x>=0;){for(S=0,ge=Vt[x]%Je,se=Vt[x]/Je|0,L=A,M=x+L;M>x;)W=et[--L]%Je,H=et[L]/Je|0,E=se*W+H*ge,W=ge*W+E%Je*Je+Me[M]+S,S=(W/xe|0)+(E/Je|0)+se*H,Me[M--]=W%xe;Me[M]=S}return S?++R:Me.splice(0,1),g(m,Me,R)},G.negated=function(){var m=new z(this);return m.s=-m.s||null,m},G.plus=function(m,w){var S,R=this,x=R.s;if(m=new z(m,w),w=m.s,!x||!w)return new z(NaN);if(x!=w)return m.s=-w,R.minus(m);var M=R.e/h,L=m.e/h,E=R.c,A=m.c;if(!M||!L){if(!E||!A)return new z(x/0);if(!E[0]||!A[0])return A[0]?m:new z(E[0]?R:x*0)}if(M=C(M),L=C(L),E=E.slice(),x=M-L){for(x>0?(L=M,S=A):(x=-x,S=E),S.reverse();x--;S.push(0));S.reverse()}for(x=E.length,w=A.length,x-w<0&&(S=A,A=E,E=S,w=x),x=0;w;)x=(E[--w]=E[w]+A[w]+x)/l|0,E[w]=l===E[w]?0:E[w]%l;return x&&(E=[x].concat(E),++L),g(m,E,L)},G.precision=G.sd=function(m,w){var S,R,x,M=this;if(m!=null&&m!==!!m)return T(m,1,f),w==null?w=be:T(w,0,8),b(new z(M),m,w);if(!(S=M.c))return null;if(x=S.length-1,R=x*h+1,x=S[x]){for(;x%10==0;x/=10,R--);for(x=S[0];x>=10;x/=10,R++);}return m&&M.e+1>R&&(R=M.e+1),R},G.shiftedBy=function(m){return T(m,-c,c),this.times("1e"+m)},G.squareRoot=G.sqrt=function(){var m,w,S,R,x,M=this,L=M.c,E=M.s,A=M.e,W=Q+4,H=new z("0.5");if(E!==1||!L||!L[0])return new z(!E||E<0&&(!L||L[0])?NaN:L?M:1/0);if(E=Math.sqrt(+v(M)),E==0||E==1/0?(w=y(L),(w.length+A)%2==0&&(w+="0"),E=Math.sqrt(+w),A=C((A+1)/2)-(A<0||A%2),E==1/0?w="5e"+A:(w=E.toExponential(),w=w.slice(0,w.indexOf("e")+1)+A),S=new z(w)):S=new z(E+""),S.c[0]){for(A=S.e,E=A+W,E<3&&(E=0);;)if(x=S,S=H.times(x.plus(I(M,x,W,1))),y(x.c).slice(0,E)===(w=y(S.c)).slice(0,E))if(S.e<A&&--E,w=w.slice(E-3,E+1),w=="9999"||!R&&w=="4999"){if(!R&&(b(x,x.e+Q+2,0),x.times(x).eq(M))){S=x;break}W+=4,E+=4,R=1}else{(!+w||!+w.slice(1)&&w.charAt(0)=="5")&&(b(S,S.e+Q+2,1),m=!S.times(S).eq(M));break}}return b(S,S.e+Q+1,be,m)},G.toExponential=function(m,w){return m!=null&&(T(m,0,f),m++),Ee(this,m,w,1)},G.toFixed=function(m,w){return m!=null&&(T(m,0,f),m=m+this.e+1),Ee(this,m,w)},G.toFormat=function(m,w,S){var R,x=this;if(S==null)m!=null&&w&&typeof w=="object"?(S=w,w=null):m&&typeof m=="object"?(S=m,m=w=null):S=D;else if(typeof S!="object")throw Error(r+"Argument not an object: "+S);if(R=x.toFixed(m,w),x.c){var M,L=R.split("."),E=+S.groupSize,A=+S.secondaryGroupSize,W=S.groupSeparator||"",H=L[0],q=L[1],ge=x.s<0,se=ge?H.slice(1):H,Me=se.length;if(A&&(M=E,E=A,A=M,Me-=M),E>0&&Me>0){for(M=Me%E||E,H=se.substr(0,M);M<Me;M+=E)H+=W+se.substr(M,E);A>0&&(H+=W+se.slice(M)),ge&&(H="-"+H)}R=q?H+(S.decimalSeparator||"")+((A=+S.fractionGroupSize)?q.replace(new RegExp("\\d{"+A+"}\\B","g"),"$&"+(S.fractionGroupSeparator||"")):q):H}return(S.prefix||"")+R+(S.suffix||"")},G.toFraction=function(m){var w,S,R,x,M,L,E,A,W,H,q,ge,se=this,Me=se.c;if(m!=null&&(E=new z(m),!E.isInteger()&&(E.c||E.s!==1)||E.lt(te)))throw Error(r+"Argument "+(E.isInteger()?"out of range: ":"not an integer: ")+v(E));if(!Me)return new z(se);for(w=new z(te),W=S=new z(te),R=A=new z(te),ge=y(Me),M=w.e=ge.length-se.e-1,w.c[0]=d[(L=M%h)<0?h+L:L],m=!m||E.comparedTo(w)>0?M>0?w:W:E,L=He,He=1/0,E=new z(ge),A.c[0]=0;H=I(E,w,0,1),x=S.plus(H.times(R)),x.comparedTo(m)!=1;)S=R,R=x,W=A.plus(H.times(x=W)),A=x,w=E.minus(H.times(x=w)),E=x;return x=I(m.minus(S),R,0,1),A=A.plus(x.times(W)),S=S.plus(x.times(R)),A.s=W.s=se.s,M=M*2,q=I(W,R,M,be).minus(se).abs().comparedTo(I(A,S,M,be).minus(se).abs())<1?[W,R]:[A,S],He=L,q},G.toNumber=function(){return+v(this)},G.toPrecision=function(m,w){return m!=null&&T(m,1,f),Ee(this,m,w,2)},G.toString=function(m){var w,S=this,R=S.s,x=S.e;return x===null?R?(w="Infinity",R<0&&(w="-"+w)):w="NaN":(m==null?w=x<=Oe||x>=Ve?$(y(S.c),x):F(y(S.c),x,"0"):m===10&&ye?(S=b(new z(S),Q+x+1,be),w=F(y(S.c),S.e,"0")):(T(m,2,K.length,"Base"),w=j(F(y(S.c),x,"0"),10,m,R,!0)),R<0&&S.c[0]&&(w="-"+w)),w},G.valueOf=G.toJSON=function(){return v(this)},G._isBigNumber=!0,N!=null&&z.set(N),z}function C(N){var I=N|0;return N>0||N===I?I:I-1}function y(N){for(var I,j,U=1,G=N.length,te=N[0]+"";U<G;){for(I=N[U++]+"",j=h-I.length;j--;I="0"+I);te+=I}for(G=te.length;te.charCodeAt(--G)===48;);return te.slice(0,G+1||1)}function _(N,I){var j,U,G=N.c,te=I.c,Q=N.s,be=I.s,Oe=N.e,Ve=I.e;if(!Q||!be)return null;if(j=G&&!G[0],U=te&&!te[0],j||U)return j?U?0:-be:Q;if(Q!=be)return Q;if(j=Q<0,U=Oe==Ve,!G||!te)return U?0:!G^j?1:-1;if(!U)return Oe>Ve^j?1:-1;for(be=(Oe=G.length)<(Ve=te.length)?Oe:Ve,Q=0;Q<be;Q++)if(G[Q]!=te[Q])return G[Q]>te[Q]^j?1:-1;return Oe==Ve?0:Oe>Ve^j?1:-1}function T(N,I,j,U){if(N<I||N>j||N!==s(N))throw Error(r+(U||"Argument")+(typeof N=="number"?N<I||N>j?" out of range: ":" not an integer: ":" not a primitive number: ")+String(N))}function P(N){var I=N.c.length-1;return C(N.e/h)==I&&N.c[I]%2!=0}function $(N,I){return(N.length>1?N.charAt(0)+"."+N.slice(1):N)+(I<0?"e":"e+")+I}function F(N,I,j){var U,G;if(I<0){for(G=j+".";++I;G+=j);N=G+N}else if(U=N.length,++I>U){for(G=j,I-=U;--I;G+=j);N+=G}else I<U&&(N=N.slice(0,I)+"."+N.slice(I));return N}t=p(),t.default=t.BigNumber=t,n.exports?n.exports=t:(e||(e=typeof self<"u"&&self?self:window),e.BigNumber=t)})(une)})(l2);var h2=l2.exports;const or=dM(),Dne=hM(),Nne=cM,Pne=h2,xo={trillion:Math.pow(10,12),billion:Math.pow(10,9),million:Math.pow(10,6),thousand:Math.pow(10,3)},Km={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:c2,decimalSuffixes:ty}=or.currentBytes(),uM={general:{scale:1024,suffixes:ty},binary:{scale:1024,suffixes:c2},decimal:{scale:1e3,suffixes:ty}};function Lne(n,e={},t){if(typeof e=="string"&&(e=Nne.parseFormat(e)),!Dne.validateFormat(e))return"ERROR: invalid format";let i=e.prefix||"",s=e.postfix||"",r=Wne(n,e,t);return r=ooe(r,i),r=ioe(r,s),r}function Wne(n,e,t){switch(e.output){case"currency":return e=vu(e,or.currentCurrencyDefaultFormat()),Gne(n,e,or);case"percent":return e=vu(e,or.currentPercentageDefaultFormat()),Yne(n,e,or,t);case"byte":return e=vu(e,or.currentByteDefaultFormat()),Vne(n,e,or,t);case"time":return e=vu(e,or.currentTimeDefaultFormat()),Une(n);case"ordinal":return e=vu(e,or.currentOrdinalDefaultFormat()),zne(n,e,or);default:return Xm({instance:n,providedFormat:e})}}function $ne(n){let e=uM.decimal;return m_(n._value,e.suffixes,e.scale).suffix}function Fne(n){let e=uM.binary;return m_(n._value,e.suffixes,e.scale).suffix}function Bne(n){let e=uM.general;return m_(n._value,e.suffixes,e.scale).suffix}function m_(n,e,t){let o=e[0],i=Math.abs(n);if(i>=t){for(let s=1;s<e.length;++s){let r=Math.pow(t,s),a=Math.pow(t,s+1);if(i>=r&&i<a){o=e[s],n=n/r;break}}o===e[0]&&(n=n/Math.pow(t,e.length-1),o=e[e.length-1])}return{value:n,suffix:o}}function Vne(n,e,t,o){let i=e.base||"binary",s=Object.assign({},Km,e);const{binarySuffixes:r,decimalSuffixes:a}=t.currentBytes();let h={general:{scale:1024,suffixes:a||ty,marker:"bd"},binary:{scale:1024,suffixes:r||c2,marker:"b"},decimal:{scale:1e3,suffixes:a||ty,marker:"d"}}[i],{value:c,suffix:d}=m_(n._value,h.suffixes,h.scale);return`${Xm({instance:o(c),providedFormat:e,state:t,defaults:t.currentByteDefaultFormat()})}${s.spaceSeparated?" ":""}${d}`}function zne(n,e,t){let o=t.currentOrdinal(),i=Object.assign({},Km,e),s=Xm({instance:n,providedFormat:e,state:t}),r=o(n._value);return`${s}${i.spaceSeparated?" ":""}${r}`}function Une(n){let e=Math.floor(n._value/60/60),t=Math.floor((n._value-e*60*60)/60),o=Math.round(n._value-e*60*60-t*60);return`${e}:${t<10?"0":""}${t}:${o<10?"0":""}${o}`}function Yne(n,e,t,o){let i=e.prefixSymbol,s=Xm({instance:o(n._value*100),providedFormat:e,state:t}),r=Object.assign({},Km,e);return i?`%${r.spaceSeparated?" ":""}${s}`:`${s}${r.spaceSeparated?" ":""}%`}function Gne(n,e,t){const o=t.currentCurrency();let i=Object.assign({},e),s=Object.assign({},Km,i),r,a="",l=!!s.totalLength||!!s.forceAverage||s.average,h=i.currencyPosition||o.position,c=i.currencySymbol||o.symbol;const d=s.spaceSeparatedCurrency!==void 0?s.spaceSeparatedCurrency:s.spaceSeparated;i.lowPrecision===void 0&&(i.lowPrecision=!1),d&&(a=" "),h==="infix"&&(r=a+c+a);let u=Xm({instance:n,providedFormat:i,state:t,decimalSeparator:r});return h==="prefix"&&(n._value<0&&s.negative==="sign"?u=`-${a}${c}${u.slice(1)}`:n._value>0&&s.forceSign?u=`+${a}${c}${u.slice(1)}`:u=c+a+u),(!h||h==="postfix")&&(a=!s.spaceSeparatedAbbreviation&&l?"":a,u=u+a+c),u}function jne({value:n,forceAverage:e,lowPrecision:t=!0,abbreviations:o,spaceSeparated:i=!1,totalLength:s=0,roundingFunction:r=Math.round}){let a="",l=Math.abs(n),h=-1;if(e&&o[e]&&xo[e]?(a=o[e],n=n/xo[e]):l>=xo.trillion||t&&r(l/xo.trillion)===1?(a=o.trillion,n=n/xo.trillion):l<xo.trillion&&l>=xo.billion||t&&r(l/xo.billion)===1?(a=o.billion,n=n/xo.billion):l<xo.billion&&l>=xo.million||t&&r(l/xo.million)===1?(a=o.million,n=n/xo.million):(l<xo.million&&l>=xo.thousand||t&&r(l/xo.thousand)===1)&&(a=o.thousand,n=n/xo.thousand),a&&(a=(i?" ":"")+a),s){let d=n<0,u=n.toString().split(".")[0],f=d?u.length-1:u.length;h=Math.max(s-f,0)}return{value:n,abbreviation:a,mantissaPrecision:h}}function qne({value:n,characteristicPrecision:e}){let[t,o]=n.toExponential().split("e"),i=+t;if(!e)return{value:i,abbreviation:`e${o}`};let s=1;return s<e&&(i=i*Math.pow(10,e-s),o=+o-(e-s),o=o>=0?`+${o}`:o),{value:i,abbreviation:`e${o}`}}function Vw(n){let e="";for(let t=0;t<n;t++)e+="0";return e}function Kne(n,e){let t=n.toString(),[o,i]=t.split("e"),[s,r=""]=o.split(".");if(+i>0)t=s+r+Vw(i-r.length);else{let a=".";+s<0?a=`-0${a}`:a=`0${a}`;let l=(Vw(-i-1)+Math.abs(s)+r).substr(0,e);l.length<e&&(l+=Vw(e-l.length)),t=a+l}return+i>0&&e>0&&(t+=`.${Vw(e)}`),t}function Xne(n,e,t=Math.round){return n.toString().indexOf("e")!==-1?Kne(n,e):new Pne(t(+`${n}e+${e}`)/Math.pow(10,e)).toFixed(e)}function Zne(n,e,t,o,i,s){if(o===-1)return n;let r=Xne(e,o,s),[a,l=""]=r.toString().split(".");if(l.match(/^0+$/)&&(t||i))return a;let h=l.match(/0+$/);return i&&h?`${a}.${l.toString().slice(0,h.index)}`:r.toString()}function Qne(n,e,t,o){let i=n,[s,r]=i.toString().split(".");if(s.match(/^-?0$/)&&t)return r?`${s.replace("0","")}.${r}`:s.replace("0","");const a=e<0&&s.indexOf("-")===0;if(a&&(s=s.slice(1),i=i.slice(1)),s.length<o){let l=o-s.length;for(let h=0;h<l;h++)i=`0${i}`}return a&&(i=`-${i}`),i.toString()}function Jne(n,e){let t=[],o=0;for(let i=n;i>0;i--)o===e&&(t.unshift(i),o=0),o++;return t}function eoe(n,e,t,o,i){let s=o.currentDelimiters(),r=s.thousands;i=i||s.decimal;let a=s.thousandsSize||3,l=n.toString(),h=l.split(".")[0],c=l.split(".")[1];const d=e<0&&h.indexOf("-")===0;return t&&(d&&(h=h.slice(1)),Jne(h.length,a).forEach((f,p)=>{h=h.slice(0,f+p)+r+h.slice(f+p)}),d&&(h=`-${h}`)),c?l=h+i+c:l=h,l}function toe(n,e){return n+e}function noe(n,e,t){return e===0?n:+n==0?n.replace("-",""):e>0?`+${n}`:t==="sign"?n:`(${n.replace("-","")})`}function ooe(n,e){return e+n}function ioe(n,e){return n+e}function Xm({instance:n,providedFormat:e,state:t=or,decimalSeparator:o,defaults:i=t.currentDefaults()}){let s=n._value;if(s===0&&t.hasZeroFormat())return t.getZeroFormat();if(!isFinite(s))return s.toString();let r=Object.assign({},Km,i,e),a=r.totalLength,l=a?0:r.characteristic,h=r.optionalCharacteristic,c=r.forceAverage,d=r.lowPrecision,u=!!a||!!c||r.average,f=a?-1:u&&e.mantissa===void 0?0:r.mantissa,p=a?!1:e.optionalMantissa===void 0?f===-1:r.optionalMantissa,C=r.trimMantissa,y=r.thousandSeparated,_=r.spaceSeparated,T=r.negative,P=r.forceSign,$=r.exponential,F=r.roundingFunction,N="";if(u){let j=jne({value:s,forceAverage:c,lowPrecision:d,abbreviations:t.currentAbbreviations(),spaceSeparated:_,roundingFunction:F,totalLength:a});s=j.value,N+=j.abbreviation,a&&(f=j.mantissaPrecision)}if($){let j=qne({value:s,characteristicPrecision:l});s=j.value,N=j.abbreviation+N}let I=Zne(s.toString(),s,p,f,C,F);return I=Qne(I,s,h,l),I=eoe(I,s,y,t,o),(u||$)&&(I=toe(I,N)),(P||s<0)&&(I=noe(I,s,T)),I}function vu(n,e){if(!n)return e;let t=Object.keys(n);return t.length===1&&t[0]==="output"?e:n}var soe=n=>({format:(...e)=>Lne(...e,n),getByteUnit:(...e)=>Bne(...e,n),getBinaryByteUnit:(...e)=>Fne(...e,n),getDecimalByteUnit:(...e)=>$ne(...e,n),formatOrDefault:vu});const al=h2;function roe(n,e,t){let o=new al(n._value),i=e;return t.isNumbro(e)&&(i=e._value),i=new al(i),n._value=o.plus(i).toNumber(),n}function d2(n,e,t){let o=new al(n._value),i=e;return t.isNumbro(e)&&(i=e._value),i=new al(i),n._value=o.minus(i).toNumber(),n}function aoe(n,e,t){let o=new al(n._value),i=e;return t.isNumbro(e)&&(i=e._value),i=new al(i),n._value=o.times(i).toNumber(),n}function loe(n,e,t){let o=new al(n._value),i=e;return t.isNumbro(e)&&(i=e._value),i=new al(i),n._value=o.dividedBy(i).toNumber(),n}function hoe(n,e,t){let o=e;return t.isNumbro(e)&&(o=e._value),n._value=o,n}function coe(n,e,t){let o=t(n._value);return d2(o,e,t),Math.abs(o._value)}var doe=n=>({add:(e,t)=>roe(e,t,n),subtract:(e,t)=>d2(e,t,n),multiply:(e,t)=>aoe(e,t,n),divide:(e,t)=>loe(e,t,n),set:(e,t)=>hoe(e,t,n),difference:(e,t)=>coe(e,t,n),BigNumber:al});const uoe="2.5.0",da=dM(),foe=hM(),goe=One(In),poe=a2();let Fh=soe(In),fc=doe(In);const moe=cM;class u2{constructor(e){this._value=e}clone(){return In(this._value)}format(e={}){return Fh.format(this,e)}formatCurrency(e){return typeof e=="string"&&(e=moe.parseFormat(e)),e=Fh.formatOrDefault(e,da.currentCurrencyDefaultFormat()),e.output="currency",Fh.format(this,e)}formatTime(e={}){return e.output="time",Fh.format(this,e)}binaryByteUnits(){return Fh.getBinaryByteUnit(this)}decimalByteUnits(){return Fh.getDecimalByteUnit(this)}byteUnits(){return Fh.getByteUnit(this)}difference(e){return fc.difference(this,e)}add(e){return fc.add(this,e)}subtract(e){return fc.subtract(this,e)}multiply(e){return fc.multiply(this,e)}divide(e){return fc.divide(this,e)}set(e){return fc.set(this,f2(e))}value(){return this._value}valueOf(){return this._value}}function f2(n){let e=n;return In.isNumbro(n)?e=n._value:typeof n=="string"?e=In.unformat(n):isNaN(n)&&(e=NaN),e}function In(n){return new u2(f2(n))}In.version=uoe;In.isNumbro=function(n){return n instanceof u2};In.language=da.currentLanguage;In.registerLanguage=da.registerLanguage;In.setLanguage=da.setLanguage;In.languages=da.languages;In.languageData=da.languageData;In.zeroFormat=da.setZeroFormat;In.defaultFormat=da.currentDefaults;In.setDefaults=da.setDefaults;In.defaultCurrencyFormat=da.currentCurrencyDefaultFormat;In.validate=foe.validate;In.loadLanguagesInNode=goe.loadLanguagesInNode;In.unformat=poe.unformat;In.BigNumber=fc.BigNumber;var woe=In,Bh=fne(woe);const boe={useGrouping:!1,maximumFractionDigits:20};function Coe(n,e){const{numericFormat:t}=e,o=t&&t.culture||"-",i=t&&t.pattern;if(typeof o<"u"&&!Bh.languages()[o]){const s=o.replace("-",""),r=Bh.allLanguages?Bh.allLanguages[o]:Bh[s];r&&Bh.registerLanguage(r)}return Bh.setLanguage(o),Bh(n).format(i||"0")}function yoe(n,e){const{numericFormat:t,locale:o}=e;return new Intl.NumberFormat(o,t??boe).format(n)}function g2(n){const{numericFormat:e}=n;return e?.pattern!==void 0||e?.culture!==void 0}const _oe="numeric",A1=new WeakSet;function p2(n,e){return mi(n)&&(g2(e)?n=Coe(n,e):n=yoe(n,e)),n}function w_(n,e,t,o,i,s,r){if(g2(r)&&!A1.has(r.instance)&&(A1.add(r.instance),Ch("The `numericFormat.pattern` and `numericFormat.culture` options are deprecated and will be removed in the next major release. Pass `Intl.NumberFormat` options directly to `numericFormat` and use the `locale` cell property instead of `culture`.\n\nMigration guide: https://handsontable.com/docs/migration-from-16.2-to-17.0/\n`numericFormat` documentation: https://handsontable.com/docs/api/options/#numericformat\n`locale` documentation: https://handsontable.com/docs/api/options/#locale")),mi(n.getDataAtCell(t,o))){let l=[];if(Array.isArray(r.className))l=r.className;else{const h=r.className??"";h.length&&(l=h.split(" "))}l.indexOf("htLeft")<0&&l.indexOf("htCenter")<0&&l.indexOf("htRight")<0&&l.indexOf("htJustify")<0&&l.push("htRight"),l.indexOf("htNumeric")<0&&l.push("htNumeric"),r.className=l.join(" "),e.dir="ltr"}la.apply(this,[n,e,t,o,i,s,r])}w_.valueFormatter=p2;w_.RENDERER_TYPE=_oe;const Soe="password";function voe(n,e){const t=e.hashLength||yt(n).length,o=e.hashSymbol||"*";let i="";for(let s=0;s<t;s++)i+=o;return i}function b_(n,e,t,o,i,s){id(e,s,n.getSettings().sanitizer)}b_.valueFormatter=voe;b_.RENDERER_TYPE=Soe;const Roe="select";function fM(n,e,t,o,i,s,r){la.apply(this,[n,e,t,o,i,s,r])}fM.RENDERER_TYPE=Roe;const Eoe="time",O1=new WeakSet;function gM(n,e,t,o,i,s,r){!O1.has(r.instance)&&typeof r.timeFormat=="string"&&(O1.add(r.instance),Ch("The `time` cell type with string-based `timeFormat` (moment.js) is deprecated. In the next major release, `time` will accept only Intl.DateTimeFormat options (object). To start migrating, use the `intl-time` cell type now; it will become the `time` cell type after the next major release (the `intl-time` will become an alias for `time`).\n\nMigration guide: https://handsontable.com/docs/migration-from-16.2-to-17.0/\n`time` cell type: https://handsontable.com/docs/time-cell-type/")),la.apply(this,[n,e,t,o,i,s,r]),e.dir="ltr"}gM.RENDERER_TYPE=Eoe;function koe(){ui(Sf),ui(o_),ui(sM),ui(iM),ui(aM),ui(oM),ui(p_),ui(lM),ui(w_),ui(b_),ui(fM),ui(la),ui(gM)}const Toe="autocomplete";function C_(n,e){const t=s=>ie(s)&&ee(s.key)&&ee(s.value),o=s=>t(s)?o(s.key)&&o(s.value):s==null;let i=n;if(o(i)&&(i=""),this.allowEmpty&&i===""){e(!0);return}this.strict&&this.source?typeof this.source=="function"?this.source(i,D1(i,e)):D1(i,e)(this.source):e(!0)}C_.VALIDATOR_TYPE=Toe;function D1(n,e){const t=n;return function(o){let i=!1;for(let s=0,r=o.length;s<r;s++)if(bh(t,o[s])){i=!0;break}e(i)}}const xoe="date";function pM(n,e){const t=HF(Hz,this.instance);let o=n,i=!0;o==null&&(o="");let s=Z(o,this.dateFormat||t.defaultDateFormat,!0).isValid(),r=Z(new Date(o)).isValid()||s;if(this.allowEmpty&&o===""&&(r=!0,s=!0),r||(i=!1),!r&&s&&(i=!0),r&&!s)if(this.correctFormat===!0){const a=Moe(o,this.dateFormat);this.instance.setDataAtCell(this.visualRow,this.visualCol,a,"dateValidator"),i=!0}else i=!1;e(i)}pM.VALIDATOR_TYPE=xoe;function Moe(n,e){const t=Z(Zee(n)),o=Z(n,e),i=n.search(/[A-Za-z]/g)>-1;let s;return t.isValid()&&t.format("x")===o.format("x")||!o.isValid()||i?s=t:s=o,s.format(e)}const Ioe="dropdown";function mM(n,e){C_.apply(this,[n,e])}mM.VALIDATOR_TYPE=Ioe;const Hoe="intl-date",Aoe=`Source data warning ([itemsCount]). Invalid value for "intl-date" cell type.
217
-
218
- [affectedCells]
219
-
220
- Expected a value compatible with the ISO 8601 date format ("YYYY-MM-DD").`;function Ooe(n,e){return e.allowEmpty&&ht(n)?!0:Jx(n)}function wM(n,e){if(this.allowEmpty&&ht(n)){e(!0);return}e(Jx(n))}wM.VALIDATOR_TYPE=Hoe;const Doe="intl-time",Noe=`Source data warning ([itemsCount]). Invalid value for "intl-time" cell type.
221
-
222
- [affectedCells]
223
-
224
- Expected a value compatible with the 24-hour time format ("HH:mm", "HH:mm:ss" or "HH:mm:ss.SSS").`;function Poe(n,e){return e.allowEmpty&&ht(n)?!0:eM(n)}function bM(n,e){if(this.allowEmpty&&ht(n)){e(!0);return}e(eM(n))}bM.VALIDATOR_TYPE=Doe;const Loe="multiselect";function CM(n,e){let t=n;if(t==null&&(t=""),this.allowEmpty&&t===""){e(!0);return}else if(!this.allowEmpty&&t===""){e(!1);return}if(!Array.isArray(t)){e(!1);return}if(Array.isArray(t)&&t.length===0){e(!0);return}this.source?typeof this.source=="function"?this.source(t,N1(t,e)):N1(t,e)(this.source):e(!0)}CM.VALIDATOR_TYPE=Loe;function N1(n,e){const t=n;return function(o){let i=!0;for(let s=0,r=t.length;s<r;s++){let a=!1;for(let l=0,h=o.length;l<h;l++)if($n(t[s])&&!$n(o[l])||!$n(t[s])&&$n(o[l])){a=!1;break}else($n(t[s])&&$n(o[l])&&bh(t[s],o[l])||typeof t[s]=="string"&&typeof o[l]=="string"&&t[s]===o[l])&&(a=!0);if(!a){i=!1;break}}e(i)}}const Woe="numeric";function yM(n,e){let t=n;t==null&&(t=""),this.allowEmpty&&t===""?e(!0):e(t===""?!1:mi(n))}yM.VALIDATOR_TYPE=Woe;const $oe=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"],Foe="time";function _M(n,e){const t=this.timeFormat||"h:mm:ss a";let o=!0,i=n;i===null&&(i=""),i=/^\d{3,}$/.test(i)?parseInt(i,10):i;const s=/^\d{1,2}$/.test(i);s&&(i+=":00");const r=Z(i,$oe,!0).isValid()?Z(i):Z(i,t);let a=r.isValid(),l=Z(i,t,!0).isValid()&&!s;if(this.allowEmpty&&i===""&&(a=!0,l=!0),a||(o=!1),!a&&l&&(o=!0),a&&!l)if(this.correctFormat===!0){const h=r.format(t);this.instance.setDataAtCell(this.visualRow,this.visualCol,h,"timeValidator"),o=!0}else o=!1;e(o)}_M.VALIDATOR_TYPE=Foe;function Boe(){Da(C_),Da(mM),Da(pM),Da(wM),Da(bM),Da(CM),Da(yM),Da(_M)}function m2(n){return ie(n)&&n.value!==void 0?n.value:n}function w2(n,e,t){const o=this.getSourceDataAtCell(this.toPhysicalRow(e),this.toPhysicalColumn(t));return $n(o)?$n(n)?n:{key:n,value:n}:n}const Voe="autocomplete",zoe={CELL_TYPE:Voe,editor:Mx,renderer:Sf,validator:C_,valueGetter:m2,valueSetter:w2,parsePastedValue:!0};function Uoe(n,e,t){const{checkedTemplate:o,uncheckedTemplate:i}=this.getCellMeta(e,t),s=yt(n),r=s===yt(o),a=s===yt(i);return r||a?r?o:i:n}const Yoe="checkbox",Goe={CELL_TYPE:Yoe,editor:$V,renderer:sM,valueSetter:Uoe},joe="date",P1=new WeakSet;function b2(n,e,t,o,i,s,r){!P1.has(r.instance)&&typeof r.dateFormat=="string"&&(P1.add(r.instance),Ch("The `date` cell type with string-based `dateFormat` (moment.js) is deprecated. In the next major release, `date` will accept only Intl.DateTimeFormat options (object). To start migrating, use the `intl-date` cell type now; it will become the `date` cell type after the next major release (the `intl-date` will become an alias for `date`).\n\nMigration guide: https://handsontable.com/docs/migration-from-16.2-to-17.0/\n`date` cell type: https://handsontable.com/docs/date-cell-type/")),Sf.apply(this,[n,e,t,o,i,s,r])}b2.RENDERER_TYPE=joe;const qoe="date",Koe={CELL_TYPE:qoe,editor:Az,renderer:b2,validator:pM};function Xoe(n){return m2.call(this,n)}function Zoe(n,e,t,o){return w2.call(this,n,e,t,o)}const Qoe="dropdown",Joe={CELL_TYPE:Qoe,editor:Oz,renderer:iM,validator:mM,filter:!1,strict:!0,valueGetter:Xoe,valueSetter:Zoe,parsePastedValue:!0},eie="handsontable",tie={CELL_TYPE:eie,editor:xx,renderer:aM},nie="intl-date",oie={CELL_TYPE:nie,editor:Pz,renderer:p_,validator:wM,sourceDataValidator:Ooe,sourceDataWarningMessage:Aoe,valueFormatter:r2},iie="intl-time",sie={CELL_TYPE:iie,editor:Lz,renderer:lM,validator:bM,sourceDataValidator:Poe,sourceDataWarningMessage:Noe,valueFormatter:dne},y_="ht-multi-select",SM=`${y_}-chip`,g0=`${y_}-chip-remove`,rie=`${y_}-chip-label`,C2=`${y_}-overflow`,L1=new WeakSet,Ea=new WeakMap,wv=new WeakMap;function p0(n,e){return $n(n)?n[e]:n}function y2(n){if(n==null||n==="")return[];if(Array.isArray(n))return n;if(typeof n=="string")try{const e=JSON.parse(n);return Array.isArray(e)?e:[e]}catch{return n.trim()?[n]:[]}return[n]}function aie(n,e,t,o,i){const s=n.createElement("span"),r=p0(e,"value");V(s,SM),s.dataset.row=o,s.dataset.prop=i,s.title=r;const a=n.createElement("span");V(a,rie),a.textContent=r,s.appendChild(a);const l=n.createElement("span");return V(l,g0),t&&l.setAttribute(...hl()),s.dataset.key=p0(e,"key"),s.appendChild(l),s}function lie(n,e){const t=n.createElement("span");return V(t,C2),t.textContent=`+${e}`,t}function hie(n,e){if(wv.has(n))return;wv.set(n,new $i(n)),wv.get(n).addEventListener(n.rootElement,"click",o=>{if(!Se(o.target,g0))return;o.preventDefault(),o.stopPropagation();const i=o.target.closest(`.${SM}`);if(!i)return;const s=i.dataset.row,r=i.dataset.prop,a=n.toPhysicalRow(s),l=typeof r=="string"?r:n.toPhysicalColumn(r),h=n.propToCol(r),c=n.getSourceDataAtCell(a,h),d=i.dataset.key,u=fie(y2(c),d);n.setSourceDataAtCell(a,l,u,`${e}-renderer`),n.render()}),n.addHook("beforeOnCellMouseDown",o=>{Se(o.target,g0)&&es(o)})}function cie(n,e){const t=n.getColWidth(e);return Ea.has(n)?Ea.get(n)?.[e]?.width!==t&&Ea.set(n,{...Ea.get(n),[e]:{width:t}}):Ea.set(n,{[e]:{width:t}}),L1.has(n)||(n.addHook("beforeColumnResize",(o,i)=>{Ea.get(n)?.[i]?.width!==o&&Ea.set(n,{...Ea.get(n),[i]:{width:o}})}),L1.add(n)),Ea.get(n)?.[e]?.width??t}function die(n,e,t){const o=n,i=e.querySelectorAll(`.${SM}`);for(let u=0;u<i.length;u++)i[u].style.display="";if(o===null||i.length===0)return;let s=e.querySelector(`.${C2}`);s?(s.style.display="",s.style.visibility="hidden"):(s=lie(t,i.length),s.style.visibility="hidden",e.appendChild(s));const r=t.defaultView.getComputedStyle(e),a=parseFloat(r.gap)||0,l=s.offsetWidth;let h=0,c=0;for(let u=0;u<i.length;u++){const f=i[u].offsetWidth,p=u<i.length-1?a:0,C=h+f+p,y=u<i.length-1,_=o-(y?l+a:0);if(C<=_)h=C,c+=1;else break}const d=i.length-c;if(d>0){for(let u=c;u<i.length;u++)i[u].style.display="none";s.textContent=`+${d}`,s.style.visibility="visible"}else s.style.display="none"}function uie(n,e,t){die(n,e,t)}function fie(n,e){return n.filter(t=>p0(t,"key")!==e)}const _2="multiselect",gie="ht-multi-select-renderer",pie="ht-multi-select-chips-container";function S2(n,e,t,o,i,s,r){o_.apply(this,[n,e,t,o,i,s,r]);let a=s;if(!a&&r.placeholder){a=r.placeholder,a=yt(a),_h(e,a);return}const{rootDocument:l}=n,h=n.getSettings().ariaTags,c=n.toPhysicalRow(t),d=typeof o=="string"?o:n.toPhysicalColumn(o),u=n.getSourceDataAtCell(c,d),f=y2(u);if(sl(e),V(e,gie),f.length===0){e.appendChild(l.createTextNode(""));return}const p=l.createElement("div");p.className=pie,f.forEach(y=>{const _=aie(l,y,h,t,i);p.appendChild(_)}),e.appendChild(p),hie(n,_2);const C=cie(n,o);uie(C,p,l)}S2.RENDERER_TYPE=_2;function v2(n){return Array.isArray(n)?$G(n.map(e=>$n(e)?e.value:e),", "):n}function mie(n,e,t){if(Array.isArray(n)){const o=this.getSourceDataAtCell(this.toPhysicalRow(e),t);if(Array.isArray(o)&&o.length>0&&$n(o[0]))return n.map(i=>$n(i)?i:{key:i,value:i})}return n}const wie="multiselect",bie={CELL_TYPE:wie,_complexDataFormat:!0,editor:e2,renderer:S2,validator:CM,valueGetter:v2,valueSetter:mie,parsePastedValue:!0};function Cie(n){const e=n?.numericFormat?.culture??n?.locale;if(typeof e=="string"&&e.length>0)try{const o=new Intl.NumberFormat(e).formatToParts(1.1).find(({type:i})=>i==="decimal");if(o?.value==="."||o?.value===",")return o.value}catch{}const t=n?.numericFormat?.pattern;if(typeof t=="string"){const o=t.lastIndexOf("."),i=t.lastIndexOf(",");if(o>-1&&i>-1)return o>i?".":",";if(i>-1&&o===-1||o>-1&&i===-1)return"."}}function yie(n,e,t,o){if(typeof n!="string")return n;const i=Cie(o);if(p5(n)||DF(n,i)){const s=m5(n,{decimalSeparator:i});return op(s)?n:s}return n}const _ie="numeric",Sie={CELL_TYPE:_ie,editor:Wz,renderer:w_,validator:yM,dataType:"number",valueSetter:yie,valueFormatter:p2},vie="password",Rie={CELL_TYPE:vie,editor:$z,renderer:b_,copyable:!1},Eie="select",kie={CELL_TYPE:Eie,editor:Fz,renderer:fM},Tie="time",xie={CELL_TYPE:Tie,editor:Bz,renderer:gM,validator:_M};function Mie(){ki(zoe),ki(Goe),ki(Koe),ki(Joe),ki(tie),ki(oie),ki(sie),ki(bie),ki(Sie),ki(Rie),ki(kie),ki(_V),ki(xie)}const xp=[];function Iie(n,e){return!!n[e]}function R2(n,e){if(Array.isArray(n)){typeof e!="string"&&Y("registerConflict(blockedTargetKeys[], incompatibleSettingKeys) expects incompatibleSettingKeys to be a string.");for(let o=0;o<n.length;o+=1)xp.push({blockedKey:n[o],incompatibleSettingKey:e});return}typeof n!="string"&&Y("registerConflict expects a string blocked target key when the first argument is not an array.");const t=n;if(Array.isArray(e)){for(let o=0;o<e.length;o+=1){const i=e[o];typeof i!="string"&&Y("registerConflict(blockedTargetKey, incompatibleSettingKeys) expects incompatibleSettingKeys to be a string array."),xp.push({blockedKey:t,incompatibleSettingKey:i})}return}if(typeof e=="string"){xp.push({blockedKey:t,incompatibleSettingKey:e});return}Y("Invalid registerConflict arguments.")}function Hie(n,e){for(let t=0;t<xp.length;t+=1){const o=xp[t];if(o.blockedKey===e&&Iie(n,o.incompatibleSettingKey))return o}return null}function E2(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Aie(n,e){return e.get?e.get.call(n):e.value}function Oie(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function k2(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Rn(n,e){var t=k2(n,e,"get");return Aie(n,t)}function W1(n,e,t){E2(n,e),e.set(n,t)}function xd(n,e,t){var o=k2(n,e,"set");return Oie(n,o,t),t}function Die(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Nie(n,e){E2(n,e),e.add(n)}const $1=new Map([["plugin",k5],["cell-type",jB],["editor",IF],["renderer",$F],["validator",FF]]),T2=Symbol("mainSetting"),Pie="base",zw=[];let Vh=null;var En=new WeakMap,El=new WeakMap,F1=new WeakSet;class at{static get PLUGIN_KEY(){return Pie}static get SETTING_KEYS(){return[this.PLUGIN_KEY]}static get DEFAULT_SETTINGS(){return{}}static get SETTINGS_VALIDATORS(){return null}init(){this.pluginName=this.hot.getPluginName(this),this.updatePluginSettings(this.hot.getSettings()[this.constructor.PLUGIN_KEY]);const e=this.constructor.PLUGIN_DEPS,t=Array.isArray(e)?e:[];if(t.length>0){const i=[];if(t.forEach(s=>{const[r,a]=s.split(":");$1.has(r)||Y(`Unknown plugin dependency type "${r}" was found.`),$1.get(r)(a)||i.push(` - ${a} (${r})`)}),i.length>0){const s=[`The ${this.pluginName} plugin requires the following modules:
225
- `,`${i.join(`
226
- `)}
227
- `].join("");zw.push(s)}}if(Vh||(Vh=WF()),Vh.indexOf(this.pluginName)>=0&&Vh.splice(Vh.indexOf(this.pluginName),1),this.hot.addHookOnce("afterPluginsInitialized",()=>{if(this.isEnabled&&this.isEnabled()){if(this.isHardConflictBlocked()){this.hot.getSettings()[this.constructor.PLUGIN_KEY]=!1;return}this.enablePlugin()}}),Vh.length===0){if(zw.length>0){const i=[`${zw.join(`
228
- `)}
229
- `,"You have to import and register them manually."].join("");zw.length=0,Y(i)}this.hot.runHooks("afterPluginsInitialized")}this.initialized=!0}isHardConflictBlocked(){const e=this.constructor.PLUGIN_KEY,t=Hie(this.hot.getSettings(),e);if(t){const{incompatibleSettingKey:o}=t;return Ie(pt`The \`${e}\` plugin cannot be used with the \`${o}\` option.\x20
230
- This combination is not supported. The plugin will remain disabled.`),!0}return!1}enablePlugin(){this.enabled=!0}disablePlugin(){this.eventManager?.clear(),this.clearHooks(),this.enabled=!1}getSetting(e){const t=this.constructor.DEFAULT_SETTINGS,o=this.constructor.SETTINGS_VALIDATORS;if(e===void 0)return ie(Rn(this,En))?Fb(Rn(this,En),t):Rn(this,En);let i;if((Array.isArray(Rn(this,En))||ie(Rn(this,En)))&&t[T2]===e)Array.isArray(Rn(this,En))?i=Rn(this,En):i=Rn(this,En)[e]??t[e];else if(e.includes(".")){const s=kC(Rn(this,En),e),r=kC(t,e);ie(s)?i=Fb(s,r):i=s!==void 0?s:r}else ie(Rn(this,En))?i=Fb(Rn(this,En),t)[e]:i=t[e];if(typeof i=="function"&&o&&typeof o=="object"){const s=o[e];if(s&&typeof s=="function")return(...r)=>{const a=i(...r);if(s(a)===!1){const h=r.map(d=>typeof d=="string"?`"${d}"`:"").join(", "),c=r.length>0?h:"";Ie(`${this.pluginName} Plugin: "${e}" function (${c}) result is not valid and will be ignored.`);return}return a}}return i}updatePluginSettings(e){const t=this.constructor.SETTINGS_VALIDATORS;if(t&&typeof t=="function"&&typeof e!="object"){if(t(e)===!1){Ie(`${this.pluginName} Plugin: option is not valid and it will be ignored.`);return}return xd(this,En,e),Rn(this,En)}return t&&typeof t=="object"&&typeof e=="object"?((Rn(this,En)===null||typeof Rn(this,En)!="object")&&xd(this,En,{...this.constructor.DEFAULT_SETTINGS}),Object.keys(t).forEach(o=>{if(!(o in e))return;const i=t[o];if((i?i(e[o]):!0)===!1){Ie(`${this.pluginName} Plugin: "${o}" option is not valid and it will be ignored.`);return}Rn(this,En)[o]=e[o]}),Rn(this,En)):(xd(this,En,e),e)}addHook(e,t,o){Rn(this,El)[e]=Rn(this,El)[e]||[];const i=Rn(this,El)[e];this.hot.addHook(e,t,o),i.push(t),Rn(this,El)[e]=i}removeHooks(e){O(Rn(this,El)[e]||[],t=>{this.hot.removeHook(e,t)})}clearHooks(){const e=Rn(this,El);nt(e,(t,o)=>this.removeHooks(o)),e.length=0}callOnPluginsReady(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)}onAfterPluginsInitialized(){O(this.pluginsInitializedCallbacks,e=>e()),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0}onUpdateSettings(e){if(!this.isEnabled)return;const t=Die(this,F1,Lie).call(this,e);if(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()){if(this.isHardConflictBlocked())return;this.enablePlugin()}if(this.enabled&&this.isEnabled()&&this.isHardConflictBlocked()){this.disablePlugin();return}this.enabled&&this.isEnabled()&&t&&(this.updatePluginSettings(e[this.constructor.PLUGIN_KEY]),this.updatePlugin(e))}updatePlugin(){}destroy(){xd(this,En,null),this.eventManager?.destroy(),this.clearHooks(),nt(this,(e,t)=>{t!=="hot"&&(this[t]=null)}),delete this.t,delete this.hot}constructor(e){Nie(this,F1),W1(this,En,{writable:!0,value:void 0}),W1(this,El,{writable:!0,value:void 0}),xd(this,En,null),this.eventManager=new $i(this),this.pluginName=null,this.pluginsInitializedCallbacks=[],this.isPluginsReady=!1,this.enabled=!1,this.initialized=!1,xd(this,El,{}),cl(this,"hot",e,{writable:!1}),Vh=null,this.hot.addHook("afterPluginsInitialized",()=>this.onAfterPluginsInitialized()),this.hot.addHook("afterUpdateSettings",t=>this.onUpdateSettings(t)),this.hot.addHook("beforeInit",()=>this.init())}}function Lie(n){if(!n)return!1;const e=this.constructor.SETTING_KEYS;if(typeof e=="boolean")return e;for(let t=0;t<e.length;t++)if(n[e[t]]!==void 0)return!0;return!1}let x2=class{addRow(e,t){this.columns.length&&Y("Doesn't support multi-dimensional table"),this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));const o={row:e};this.rows.push(o),this.samples=t,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol(e)),this.table.tr.appendChild(this.createRow(e)),this.container.container.appendChild(this.table.fragment),o.table=this.table.table}addColumnHeadersRow(e){const t=this.hot.getColHeader(0);if(t!=null){const o={row:-1};this.rows.push(o),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),o.table=this.table.table}}addColumn(e,t){this.rows.length&&Y("Doesn't support multi-dimensional table"),this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));const o={col:e};this.columns.push(o),this.samples=t,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),o.table=this.table.table}getHeights(e){this.injected||this.injectTable(),O(this.rows,t=>{const{height:o}=t.table.getBoundingClientRect();e(t.row,Math.ceil(o))})}getWidths(e){this.injected||this.injectTable(),O(this.columns,t=>{const{width:o}=t.table.getBoundingClientRect();e(t.col,Math.ceil(o))})}setSettings(e){this.settings=e}setSetting(e,t){this.settings||(this.settings={}),this.settings[e]=t}getSettings(){return this.settings}getSetting(e){return this.settings?this.settings[e]:null}createColGroupsCol(e){const t=this.hot.rootDocument.createDocumentFragment();return this.hot.hasRowHeaders()&&t.appendChild(this.createColElement(-1,-1)),this.samples.forEach(o=>{O(o.strings,i=>{t.appendChild(this.createColElement(i.col,e))})}),t}createRow(e){const{rootDocument:t}=this.hot,o=t.createDocumentFragment(),i=t.createElement("th");return this.hot.hasRowHeaders()&&(this.hot.view.appendRowHeader(e,i),o.appendChild(i)),this.samples.forEach(s=>{O(s.strings,r=>{const a=r.col,l=this.hot.getCellMeta(e,a),h=this.hot.getCellRenderer(l),c=t.createElement("td");c.setAttribute("ghost-table",1),h(this.hot,c,e,a,this.hot.colToProp(a),r.value,l),o.appendChild(c)})}),o}appendColumnHeadersRow(){const{rootDocument:e}=this.hot,t=e.createDocumentFragment(),o=[];if(this.hot.hasRowHeaders()){const i=e.createElement("th");o.push([-1,i]),t.appendChild(i)}this.samples.forEach(i=>{O(i.strings,s=>{const r=s.col,a=e.createElement("th");o.push([r,a]),t.appendChild(a)})}),this.table.tHead.appendChild(t),O(o,i=>{const[s,r]=i;this.hot.view.appendColHeader(s,r)})}createCol(e){const{rootDocument:t}=this.hot,o=t.createDocumentFragment();return this.samples.forEach(i=>{O(i.strings,s=>{const r=s.row,a=this.hot.getCellMeta(r,e),l=this.hot.getCellRenderer(a),h=t.createElement("td"),c=t.createElement("tr");h.setAttribute("ghost-table",1),l(this.hot,h,r,e,this.hot.colToProp(e),s.value,a),c.appendChild(h),o.appendChild(c)})}),o}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(e=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,t){const o=this.hot.rootDocument.createElement("col");let i=0;t>=0&&e>=0&&(i=this.hot.getCellMeta(t,e).colspan);let s=this.hot.getColWidth(e);if(i>1)for(let r=e+1;r<e+i;r++)s+=this.hot.getColWidth(r);return o.style.width=`${s}px`,o}createTable(e=""){const{rootDocument:t}=this.hot,o=t.createDocumentFragment(),i=t.createElement("table"),s=t.createElement("thead"),r=t.createElement("tbody"),a=t.createElement("colgroup"),l=t.createElement("tr"),h=t.createElement("th");return this.isVertical()&&i.appendChild(a),this.isHorizontal()&&(l.appendChild(h),s.appendChild(l),i.style.tableLayout="auto",i.style.width="auto"),i.appendChild(s),this.isVertical()&&r.appendChild(l),i.appendChild(r),V(i,e),o.appendChild(i),{fragment:o,table:i,tHead:s,tBody:r,colGroup:a,tr:l,th:h}}createContainer(e=""){const{rootDocument:t}=this.hot,o=t.createDocumentFragment(),i=t.createElement("div"),s=`htGhostTable htAutoSize ${e.trim()}`;return V(i,s),o.appendChild(i),{fragment:o,container:i}}isVertical(){return!!(this.rows.length&&!this.columns.length)}isHorizontal(){return!!(this.columns.length&&!this.rows.length)}constructor(e){this.hot=null,this.container=null,this.injected=!1,this.rows=[],this.columns=[],this.samples=null,this.settings={useHeaders:!0},this.hot=e}};class __{static get SAMPLE_COUNT(){return 3}getSampleCount(){return this.customSampleCount?this.customSampleCount:__.SAMPLE_COUNT}setSampleCount(e){this.customSampleCount=e}setAllowDuplicates(e){this.allowDuplicates=e}setIncludeHidden(e){this.includeHidden=e}generateRowSamples(e,t){return this.generateSamples("row",t,e)}generateColumnSamples(e,t){return this.generateSamples("col",t,e)}generateSamples(e,t,o){const i=new Map,{from:s,to:r}=typeof o=="number"?{from:o,to:o}:o;return Re(s,r,a=>{const l=this.generateSample(e,t,a);i.set(a,l)}),i}generateSample(e,t,o){e!=="row"&&e!=="col"&&Y("Unsupported sample type");const i=new Map,s=e==="row"?"col":"row",r=[];return Re(t.from,t.to,a=>{const l=e==="row"?this.dataFactory(o,a,this):this.dataFactory(a,o,this);if(l===!1)return;const{value:h,bundleSeed:c}=l,d=typeof c=="string"&&c.length>0;let u;d?u=c:ie(h)?u=`${Object.keys(h).length}`:Array.isArray(h)?u=`${h.length}`:u=`${yt(h).length}`,i.has(u)||i.set(u,{needed:this.getSampleCount(),strings:[]});const f=i.get(u);f.needed&&(!(r.indexOf(h)>-1)||this.allowDuplicates||d)&&(f.strings.push({value:h,[s]:a}),r.push(h),f.needed-=1)}),i}constructor(e){this.samples=null,this.dataFactory=null,this.customSampleCount=null,this.allowDuplicates=!1,this.includeHidden=!1,this.dataFactory=e}}function M2(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Wie(n,e){return e.get?e.get.call(n):e.value}function $ie(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function I2(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function qr(n,e){var t=I2(n,e,"get");return Wie(n,t)}function Uw(n,e,t){M2(n,e),e.set(n,t)}function Ur(n,e,t){var o=I2(n,e,"set");return $ie(n,o,t),t}function ms(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function ka(n,e){M2(n,e),e.add(n)}de.getSingleton().register("modifyAutoColumnSizeSeed");const bv="autoColumnSize",Fie=10,Bie="autoColumnSize";var ny=new WeakMap,gc=new WeakMap,Bc=new WeakMap,Md=new WeakMap,H2=new WeakSet,m0=new WeakSet,w0=new WeakSet,B1=new WeakSet,V1=new WeakSet,z1=new WeakSet,Cv=new WeakSet,U1=new WeakSet,Y1=new WeakSet;class Mp extends at{static get PLUGIN_KEY(){return bv}static get PLUGIN_PRIORITY(){return Fie}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}isEnabled(){return this.hot.getSettings()[bv]!==!1&&!this.hot.getSettings().colWidths}enablePlugin(){if(this.enabled)return;this.ghostTable.setSetting("useHeaders",this.getSetting("useHeaders")),this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));const e=this.getSetting("samplingRatio");e&&!isNaN(e)&&this.samplesGenerator.setSampleCount(parseInt(e,10)),this.addHook("afterLoadData",(...t)=>ms(this,V1,Uie).call(this,...t)),this.addHook("beforeChangeRender",(...t)=>ms(this,z1,Yie).call(this,...t)),this.addHook("afterFormulasValuesUpdate",(...t)=>ms(this,Y1,jie).call(this,...t)),this.addHook("beforeRender",()=>ms(this,B1,zie).call(this)),this.addHook("modifyColWidth",(t,o)=>this.getColumnWidth(o,t)),this.addHook("init",()=>ms(this,U1,Gie).call(this)),Ur(this,Md,this.hot.columnIndexMapper.observeMapChange(this.columnWidthsMap,()=>{this.hot.view?.invalidateColumnWidthCache()})),super.enablePlugin()}updatePlugin(){Ur(this,Bc,this.findColumnsWhereHeaderWasChanged()),super.updatePlugin()}disablePlugin(){qr(this,Md)&&(qr(this,Md).call(this),Ur(this,Md,null)),super.disablePlugin(),this.addHook("beforeColumnResize",(e,t,o)=>ms(this,Cv,G1).call(this,e,t,o))}calculateVisibleColumnsWidth(){if(!this.hot.countRows())return;const e=this.getFirstVisibleColumn(),t=this.getLastVisibleColumn();if(e===-1||t===-1)return;const o=this.hot.forceFullRender;this.calculateColumnsWidth({from:e,to:t},void 0,o)}calculateColumnsWidth(e={from:0,to:this.hot.countCols()-1},t={from:0,to:this.hot.countRows()-1},o=!1){const i=typeof e=="number"?{from:e,to:e}:e,s=typeof t=="number"?{from:t,to:t}:t;Re(i.from,i.to,r=>{let a=this.hot.toPhysicalColumn(r);a===null&&(a=r),(o||this.columnWidthsMap.getValueAtIndex(a)===null&&!this.hot._getColWidthFromSettings(a))&&ms(this,m0,A2).call(this,r,s)}),this.ghostTable.columns.length&&(ms(this,w0,O2).call(this),this.measuredColumns=i.to+1,this.ghostTable.clean())}calculateAllColumnsWidth(e={from:0,to:this.hot.countRows()-1},t=!1){let o=0;const i=this.hot.countCols()-1;let s=null;this.inProgress=!0;const r=()=>{if(!this.hot){xC(s),this.inProgress=!1;return}this.calculateColumnsWidth({from:o,to:Math.min(o+Mp.CALCULATION_STEP,i)},e,t),o=o+Mp.CALCULATION_STEP+1,o<i?s=TC(r):(xC(s),this.inProgress=!1,this.hot.view.adjustElementsSize())},a=this.getSyncCalculationLimit();a>=0&&(this.calculateColumnsWidth({from:0,to:a},e,t),o=a+1),o<i?r():this.inProgress=!1}recalculateAllColumnsWidth(){this.hot.view.isVisible()&&this.calculateAllColumnsWidth({from:0,to:this.hot.countRows()-1},!0)}getSyncCalculationLimit(){const e=this.hot.getSettings()[bv];let t=Mp.SYNC_CALCULATION_LIMIT;const o=this.hot.countCols()-1;return ie(e)&&(t=e.syncLimit,tF(t)?t=NF(o,t):t>>=0),Math.min(t,o)}getColumnWidth(e,t,o=!0){let i=t;return i===void 0&&(i=this.columnWidthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e)),o&&typeof i=="number"&&(i=Math.max(i,nf))),i}getFirstVisibleColumn(){return this.hot.getFirstRenderedVisibleColumn()??-1}getLastVisibleColumn(){return this.hot.getLastRenderedVisibleColumn()??-1}findColumnsWhereHeaderWasChanged(){return this.hot.getColHeader().reduce((o,i,s)=>{const r=qr(this,gc).length;return(r-1<s||qr(this,gc)[s]!==i)&&o.push(this.hot.toVisualColumn(s)),r-1<s?qr(this,gc).push(i):qr(this,gc)[s]=i,o},[])}clearCache(e){Array.isArray(e)?this.hot.batchExecution(()=>{e.forEach(t=>{this.columnWidthsMap.setValueAtIndex(t,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()}constructor(e){super(e),ka(this,H2),ka(this,m0),ka(this,w0),ka(this,B1),ka(this,V1),ka(this,z1),ka(this,Cv),ka(this,U1),ka(this,Y1),Uw(this,ny,{writable:!0,value:void 0}),Uw(this,gc,{writable:!0,value:void 0}),Uw(this,Bc,{writable:!0,value:void 0}),Uw(this,Md,{writable:!0,value:void 0}),this.ghostTable=new x2(this.hot),this.samplesGenerator=new __((t,o)=>{const i=this.hot.toPhysicalRow(t),s=this.hot.toPhysicalColumn(o);if(this.hot.rowIndexMapper.isHidden(i)||this.hot.columnIndexMapper.isHidden(s))return!1;const r=this.hot.getCellMeta(t,o);let a="";r.spanned||(a=this.hot.getDataAtCell(t,o),typeof r.valueFormatter=="function"&&(a=r.valueFormatter(a,r)));let l="";return this.hot.hasHook("modifyAutoColumnSizeSeed")&&(l=this.hot.runHooks("modifyAutoColumnSizeSeed",l,r,a)),{value:a,bundleSeed:l}}),this.inProgress=!1,this.measuredColumns=0,this.columnWidthsMap=new Eh,Ur(this,ny,!1),Ur(this,gc,[]),Ur(this,Bc,[]),Ur(this,Md,null),this.hot.columnIndexMapper.registerMap(Bie,this.columnWidthsMap),this.addHook("beforeColumnResize",(t,o,i)=>ms(this,Cv,G1).call(this,t,o,i))}}function Vie(n){const e={from:0,to:this.hot.countRows()-1};n.forEach(t=>{const o=this.hot.toPhysicalColumn(t);o!==null&&(this.hot._getColWidthFromSettings(o)||ms(this,m0,A2).call(this,t,e))}),this.ghostTable.columns.length&&(ms(this,w0,O2).call(this),this.ghostTable.clean())}function A2(n,e){this.samplesGenerator.generateColumnSamples(n,e).forEach((o,i)=>this.ghostTable.addColumn(i,o))}function O2(){this.hot.batchExecution(()=>{this.ghostTable.getWidths((n,e)=>{const t=this.hot.toPhysicalColumn(n);this.columnWidthsMap.setValueAtIndex(t,e)})},!0)}function zie(){this.calculateVisibleColumnsWidth(),this.inProgress||(ms(this,H2,Vie).call(this,qr(this,Bc)),Ur(this,Bc,[]))}function Uie(n,e){e||this.recalculateAllColumnsWidth()}function Yie(n){const e=n.reduce((t,[,o])=>{const i=this.hot.propToCol(o);return Number.isInteger(i)&&t.indexOf(i)===-1&&t.push(i),t},[]);qr(this,Bc).push(...e)}function G1(n,e,t){let o=n;return t&&(this.calculateColumnsWidth(e,void 0,!0),o=this.getColumnWidth(e,void 0,!1)),o}function Gie(){Ur(this,gc,this.hot.getColHeader()),this.recalculateAllColumnsWidth(),Ur(this,ny,!0)}function jie(n){if(!qr(this,ny))return;const t=this.hot.getPlugin("formulas")?.sheetId,o=n.reduce((i,s)=>{if(t!=null&&s.address?.sheet!==t)return i;const r=s.address?.col;if(Number.isInteger(r)){const a=this.hot.toVisualColumn(r);i.indexOf(a)===-1&&i.push(a)}return i},[]);qr(this,Bc).push(...o)}const Mc={horizontal:"horizontal",vertical:"vertical"};function qie(n,e,t){let o,i,s;return e[0]===n[0]&&e[1]<n[1]?(s="left",o=t(e[0],e[1]),i=t(e[2],n[1]-1)):e[2]===n[2]&&e[0]===n[0]&&e[3]>n[3]?(s="right",o=t(e[0],n[3]+1),i=t(e[2],e[3])):e[0]<n[0]&&e[1]===n[1]?(s="up",o=t(e[0],e[1]),i=t(n[0]-1,e[3])):e[2]>n[2]&&e[1]===n[1]&&(s="down",o=t(n[2]+1,e[1]),i=t(e[2],e[3])),o&&o.normalize(),i&&i.normalize(),{directionOfDrag:s,startOfDragCoords:o,endOfDragCoords:i}}function Kie(n){const e={};return n===!0?(e.directions=Object.keys(Mc),e.autoInsertRow=!0):ie(n)?(ee(n.autoInsertRow)?n.direction===Mc.horizontal?e.autoInsertRow=!1:e.autoInsertRow=n.autoInsertRow:e.autoInsertRow=!1,ee(n.direction)?e.directions=[n.direction]:e.directions=Object.keys(Mc)):typeof n=="string"?(e.directions=[n],e.autoInsertRow=!0):(e.directions=[],e.autoInsertRow=!1),e}function Xie(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Id(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Hd(n,e){Xie(n,e),e.add(n)}de.getSingleton().register("modifyAutofillRange");de.getSingleton().register("beforeAutofill");de.getSingleton().register("afterAutofill");const j1="autofill",Zie=20,Qie=["fillHandle"],Jie="insert_row_below",ese=200;var q1=new WeakSet,K1=new WeakSet,X1=new WeakSet,Z1=new WeakSet,Q1=new WeakSet,J1=new WeakSet;class tse extends at{static get PLUGIN_KEY(){return j1}static get PLUGIN_PRIORITY(){return Zie}static get SETTING_KEYS(){return[j1,...Qie]}isEnabled(){return this.hot.getSettings().fillHandle}enablePlugin(){this.enabled||(this.mapSettings(),this.registerEvents(),this.addHook("afterOnCellCornerMouseDown",e=>Id(this,X1,ise).call(this,e)),this.addHook("afterOnCellCornerDblClick",e=>Id(this,K1,ose).call(this,e)),this.addHook("beforeOnCellMouseOver",(e,t)=>Id(this,Z1,sse).call(this,t)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.clearMappedSettings(),super.disablePlugin()}getSelectionData(e=!1){const t=this.hot.getSelectedRangeLast(),{row:o,col:i}=t.getTopStartCorner(),{row:s,col:r}=t.getBottomEndCorner(),a=this.hot.runHooks("modifyCopyableRange",[{startRow:o,startCol:i,endRow:s,endCol:r}]),l=[],h=[],c=[];return O(a,d=>{for(let u=d.startRow;u<=d.endRow;u+=1)l.indexOf(u)===-1&&l.push(u);for(let u=d.startCol;u<=d.endCol;u+=1)h.indexOf(u)===-1&&h.push(u)}),O(l,d=>{const u=[];O(h,f=>{const p=e?this.hot.getSourceDataAtCell(d,f):null;e&&(ie(p)||Array.isArray(p))?u.push(this.hot.getCopyableSourceData(d,f)):u.push(this.hot.getCopyableData(d,f))}),c.push(u)}),c}fillIn(){if(this.hot.selection.highlight.getFill().isEmpty())return!1;const[e,t,o,i]=this.hot.selection.highlight.getFill().getVisualCorners(),s=this.hot.getSelectedRangeLast(),r=s.getTopStartCorner(),a=s.getBottomEndCorner();this.resetSelectionOfDraggedArea();const l=[r.row,r.col,a.row,a.col],h=this.hot.runHooks("modifyAutofillRange",[Math.min(r.row,e),Math.min(r.col,t),Math.max(a.row,o),Math.max(a.col,i)],l),{directionOfDrag:c,startOfDragCoords:d,endOfDragCoords:u}=qie(l,h,(f,p)=>this.hot._createCellCoords(f,p));if(d&&d.row>-1&&d.col>-1){const f=this.getSelectionData(),p=this.getSelectionData(!0),C=s.clone(),y=this.hot._createCellRange(d,d,u),_=this.hot.runHooks("beforeAutofill",f,C,y,c);if(_===!1)return this.hot.selection.highlight.getFill().clear(),this.hot.render(),!1;let T=_;const P=_;if(["up","left"].indexOf(c)>-1&&!(P.length===1&&P[0].length===0))if(T=[],c==="up"){const $=u.row-d.row+1,F=$%P.length;for(let N=0;N<$;N++)T.push(P[(N+(P.length-F))%P.length])}else{const $=u.col-d.col+1,F=$%P[0].length;for(let N=0;N<P.length;N++){T.push([]);for(let I=0;I<$;I++)T[N].push(P[N][(I+(P[N].length-F))%P[N].length])}}if(p.some($=>$.some(F=>ie(F)||Array.isArray(F)))){const $=Id(this,q1,nse).call(this,T,p,d,u,c);$.length&&(T=$)}this.hot.populateFromArray(d.row,d.col,T,u.row,u.col,`${this.pluginName}.fill`,null),this.setSelection(h),this.hot.runHooks("afterAutofill",T,C,y,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 t=this.hot.getSelectedRangeLast(),o=t.getBottomEndCorner();let i=e;if(this.directions.includes(Mc.vertical)&&this.directions.includes(Mc.horizontal)){const s=t.getTopStartCorner();(o.col<=e.col||s.col>=e.col)&&(i=this.hot._createCellCoords(o.row,e.col)),(o.row<e.row||s.row>e.row)&&(i=this.hot._createCellCoords(e.row,o.col))}else if(this.directions.includes(Mc.vertical))i=this.hot._createCellCoords(e.row,o.col);else if(this.directions.includes(Mc.horizontal))i=this.hot._createCellCoords(o.row,e.col);else return;return this.reduceSelectionAreaIfNeeded(i)}showBorder(e){const t=this.getCoordsOfDragAndDropBorders(e);t&&this.redrawBorders(t)}addRow(){this.hot._registerTimeout(()=>{this.hot.alter(Jie,void 0,1,`${this.pluginName}.fill`),this.addingStarted=!1},ese)}addNewRowIfNeeded(){if(!this.hot.selection.highlight.getFill().isEmpty()&&this.addingStarted===!1&&this.autoInsertRow){const e=this.hot.getSelectedLast(),t=this.hot.selection.highlight.getFill().getVisualCorners(),o=this.hot.countRows();e[2]<o-1&&t[2]===o-1&&(this.addingStarted=!0,this.addRow())}}getIndexOfLastAdjacentFilledInRow(e){const t=this.hot.getData(),o=this.hot.countRows();let i;for(let s=e[2]+1;s<o;s++){for(let l=e[1];l<=e[3];l++){const h=t[s][l];if(!ht(h))return-1}const r=t[s][e[1]-1],a=t[s][e[3]+1];(!ht(r)||!ht(a))&&(i=s)}return i}addSelectionFromStartAreaToSpecificRowIndex(e,t){this.hot.selection.highlight.getFill().clear().add(this.hot._createCellCoords(e[0],e[1])).add(this.hot._createCellCoords(t,e[3])).commit()}setSelection(e){this.hot.selectCell(...Mt(e,t=>Math.max(t,0)),!1,!1)}selectAdjacent(){const e=this.hot.getSelectedLast(),t=this.getIndexOfLastAdjacentFilledInRow(e);return t===-1||t===void 0?!1:(this.addSelectionFromStartAreaToSpecificRowIndex(e,t),!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:t}=this.hot.rootDocument,o=Jo(this.hot.table).top-(this.hot.rootWindow.pageYOffset||t.scrollTop)+xn(this.hot.table),i=Jo(this.hot.table).left-(this.hot.rootWindow.pageXOffset||t.scrollLeft)+Cn(this.hot.table);return e.clientY>o&&e.clientX<=i}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mouseup",()=>Id(this,Q1,rse).call(this)),this.eventManager.addEventListener(e,"mousemove",t=>Id(this,J1,ase).call(this,t))}clearMappedSettings(){this.directions.length=0,this.autoInsertRow=!1}mapSettings(){const e=Kie(this.hot.getSettings().fillHandle);this.directions=e.directions,this.autoInsertRow=e.autoInsertRow}destroy(){super.destroy()}constructor(...e){super(...e),Hd(this,q1),Hd(this,K1),Hd(this,X1),Hd(this,Z1),Hd(this,Q1),Hd(this,J1),this.addingStarted=!1,this.mouseDownOnCellCorner=!1,this.mouseDragOutside=!1,this.handleDraggedCells=0,this.directions=[],this.autoInsertRow=!1}}function nse(n,e,t,o){const i=[];for(let s=Math.min(t.row,o.row);s<=Math.max(t.row,o.row);s+=1){i.push([]);for(let r=Math.min(t.col,o.col);r<=Math.max(t.col,o.col);r+=1){const a=this.hot.getSourceDataAtCell(s,r),l=this.hot.getCellMeta(s,r).source,h=this.hot.getCellMeta(s,r)._complexDataFormat||ie(l?.[0])||Array.isArray(l?.[0]),c=s-Math.min(t.row,o.row),d=r-Math.min(t.col,o.col),u=c%e.length,f=d%e[0].length;ie(a)||Array.isArray(a)||h?i[c][d]=e[u][f]:i[c][d]=n[u][f]}}return i}function ose(){this.selectAdjacent()&&this.fillIn()}function ise(){this.handleDraggedCells=1,this.mouseDownOnCellCorner=!0}function sse(n){this.mouseDownOnCellCorner&&!this.hot.view.isMouseDown()&&this.handleDraggedCells&&(this.handleDraggedCells+=1,this.showBorder(n),this.addNewRowIfNeeded())}function rse(){this.handleDraggedCells&&(this.handleDraggedCells>1&&this.fillIn(),this.handleDraggedCells=0,this.mouseDownOnCellCorner=!1)}function ase(n){const e=this.getIfMouseWasDraggedOutside(n);this.addingStarted===!1&&this.handleDraggedCells>0&&e?(this.mouseDragOutside=!0,this.addingStarted=!0):this.mouseDragOutside=!1,this.mouseDragOutside&&this.autoInsertRow&&this.addRow()}function D2(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lse(n,e){return e.get?e.get.call(n):e.value}function hse(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function N2(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function lf(n,e){var t=N2(n,e,"get");return lse(n,t)}function yv(n,e,t){D2(n,e),e.set(n,t)}function _c(n,e,t){var o=N2(n,e,"set");return hse(n,o,t),t}function ir(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Ta(n,e){D2(n,e),e.add(n)}const _v="autoRowSize",cse=40,dse="autoRowSize",eO="htFirstDatasetColumnNotRendered",tO="htAutoRowSize";var hf=new WeakMap,Ad=new WeakMap,oy=new WeakMap,P2=new WeakSet,b0=new WeakSet,nO=new WeakSet,oO=new WeakSet,Sv=new WeakSet,iO=new WeakSet,sO=new WeakSet,rO=new WeakSet,aO=new WeakSet;class Ip extends at{static get PLUGIN_KEY(){return _v}static get PLUGIN_PRIORITY(){return cse}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}isEnabled(){const e=this.hot.getSettings()[_v];return e===!0||ie(e)}enablePlugin(){if(this.enabled)return;this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));const e=this.getSetting("samplingRatio");e&&!isNaN(e)&&this.samplesGenerator.setSampleCount(parseInt(e,10)),this.addHook("afterLoadData",(...t)=>ir(this,iO,pse).call(this,...t)),this.addHook("beforeChangeRender",(...t)=>ir(this,sO,mse).call(this,...t)),this.addHook("beforeColumnResize",()=>this.recalculateAllRowsHeight()),this.addHook("afterFormulasValuesUpdate",(...t)=>ir(this,aO,bse).call(this,...t)),this.addHook("beforeViewRender",()=>ir(this,nO,fse).call(this)),this.addHook("beforeRender",()=>ir(this,oO,gse).call(this)),this.addHook("modifyRowHeight",(t,o)=>this.getRowHeight(o,t)),this.addHook("init",()=>ir(this,rO,wse).call(this)),this.addHook("modifyColumnHeaderHeight",()=>this.getColumnHeaderHeight()),_c(this,Ad,this.hot.rowIndexMapper.observeMapChange(this.rowHeightsMap,()=>{this.hot.view?.invalidateRowHeightCache()})),V(this.hot.rootElement,tO),super.enablePlugin()}disablePlugin(){lf(this,Ad)&&(lf(this,Ad).call(this),_c(this,Ad,null)),this.headerHeight=null,re(this.hot.rootElement,tO),super.disablePlugin(),ir(this,b0,L2).call(this,!1),this.addHook("beforeRowResize",(e,t,o)=>ir(this,Sv,lO).call(this,e,t,o))}calculateVisibleRowsHeight(){if(!this.hot.countCols())return;const e=this.getFirstVisibleRow(),t=this.getLastVisibleRow();if(e===-1||t===-1)return;const o=this.hot.forceFullRender;this.calculateRowsHeight({from:e,to:t},void 0,o)}calculateRowsHeight(e={from:0,to:this.hot.countRows()-1},t={from:0,to:this.hot.countCols()-1},o=!1){const i=typeof e=="number"?{from:e,to:e}:e,s=typeof t=="number"?{from:t,to:t}:t;if(this.hot.getColHeader(0)!==null){const r=this.samplesGenerator.generateRowSamples(-1,s);this.ghostTable.addColumnHeadersRow(r.get(-1))}Re(i.from,i.to,r=>{let a=this.hot.toPhysicalRow(r);a===null&&(a=r),(o||this.rowHeightsMap.getValueAtIndex(a)===null)&&this.samplesGenerator.generateRowSamples(r,s).forEach((h,c)=>this.ghostTable.addRow(c,h))}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((r,a)=>{r<0?this.headerHeight=a:this.rowHeightsMap.setValueAtIndex(this.hot.toPhysicalRow(r),a)})},!0),this.measuredRows=i.to+1,this.ghostTable.clean())}calculateAllRowsHeight(e={from:0,to:this.hot.countCols()-1},t=!1){let o=0;const i=this.hot.countRows()-1;let s=null;this.inProgress=!0;const r=()=>{if(!this.hot){xC(s),this.inProgress=!1;return}this.calculateRowsHeight({from:o,to:Math.min(o+Ip.CALCULATION_STEP,i)},e,t),o=o+Ip.CALCULATION_STEP+1,o<i?s=TC(r):(xC(s),this.inProgress=!1,this.hot.view.adjustElementsSize())},a=this.getSyncCalculationLimit();a>=0&&(this.calculateRowsHeight({from:0,to:a},e,t),o=a+1),o<i?r():(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()[_v];let t=Ip.SYNC_CALCULATION_LIMIT;const o=this.hot.countRows()-1;return ie(e)&&(t=e.syncLimit,tF(t)?t=NF(o,t):t>>=0),Math.min(t,o)}getRowHeight(e,t=this.hot.stylesHandler.getDefaultRowHeight(e)){if(e<0)return this.headerHeight??t;const o=this.hot.toPhysicalRow(e);if(this.hot.rowIndexMapper.isHidden(o))return t;const i=this.rowHeightsMap.getValueAtIndex(o);let s=t;return i!==null&&i>t&&(s=i,e===this.hot.view.getFirstRenderedVisibleRow()&&(s+=1)),s}getColumnHeaderHeight(){return this.headerHeight}getFirstVisibleRow(){return this.hot.getFirstRenderedVisibleRow()??-1}getLastVisibleRow(){return this.hot.getLastRenderedVisibleRow()??-1}clearCache(e){this.headerHeight=null,Array.isArray(e)?this.hot.batchExecution(()=>{e.forEach(t=>{this.rowHeightsMap.setValueAtIndex(t,null)})},!0):this.rowHeightsMap.clear()}clearCacheByRange(e){const{from:t,to:o}=typeof e=="number"?{from:e,to:e}:e;this.hot.batchExecution(()=>{Re(Math.min(t,o),Math.max(t,o),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()}constructor(e){super(e),Ta(this,P2),Ta(this,b0),Ta(this,nO),Ta(this,oO),Ta(this,Sv),Ta(this,iO),Ta(this,sO),Ta(this,rO),Ta(this,aO),yv(this,hf,{writable:!0,value:void 0}),yv(this,Ad,{writable:!0,value:void 0}),yv(this,oy,{writable:!0,value:void 0}),this.headerHeight=null,this.ghostTable=new x2(this.hot),this.samplesGenerator=new __((t,o)=>{const i=this.hot.toPhysicalColumn(o);if(this.hot.columnIndexMapper.isHidden(i))return!1;let s;if(t>=0&&o>=0&&(s=this.hot.getCellMeta(t,o),s.hidden))return!1;let r;return t>=0?(r=this.hot.getDataAtCell(t,o),typeof s?.valueFormatter=="function"&&(r=s.valueFormatter(r,s))):t===-1&&(r=this.hot.getColHeader(o)),{value:r}}),this.inProgress=!1,this.measuredRows=0,this.rowHeightsMap=new Eh,_c(this,hf,[]),_c(this,Ad,null),_c(this,oy,!1),this.hot.rowIndexMapper.registerMap(dse,this.rowHeightsMap),this.addHook("beforeRowResize",(t,o,i)=>ir(this,Sv,lO).call(this,t,o,i))}}function use(n){const e={from:0,to:this.hot.countCols()-1};n.forEach(t=>{this.samplesGenerator.generateRowSamples(t,e).forEach((i,s)=>this.ghostTable.addRow(s,i))}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((t,o)=>{const i=this.hot.toPhysicalRow(t);this.rowHeightsMap.setValueAtIndex(i,o)})},!0),this.ghostTable.clean())}function L2(n){const e=this.hot.getFirstRenderedVisibleColumn(),t=this.hot.columnIndexMapper.getPhysicalFromVisualIndex(e);n===!1||t===this.hot.columnIndexMapper.getPhysicalFromRenderableIndex(0)?re(this.hot.rootElement,eO):V(this.hot.rootElement,eO)}function fse(){ir(this,b0,L2).call(this)}function gse(){this.calculateVisibleRowsHeight(),this.inProgress||(ir(this,P2,use).call(this,lf(this,hf)),_c(this,hf,[]))}function lO(n,e,t){let o=n;return t&&(this.calculateRowsHeight(e,void 0,!0),o=this.getRowHeight(e)),o}function pse(n,e){e||this.recalculateAllRowsHeight()}function mse(n){const e=n.reduce((t,[o])=>(t.indexOf(o)===-1&&t.push(o),t),[]);lf(this,hf).push(...e)}function wse(){this.recalculateAllRowsHeight(),_c(this,oy,!0)}function bse(n){if(!lf(this,oy))return;const t=this.hot.getPlugin("formulas")?.sheetId,o=n.reduce((i,s)=>{if(t!=null&&s.address?.sheet!==t)return i;const r=s.address?.row;if(Number.isInteger(r)){const a=this.hot.toVisualRow(r);i.indexOf(a)===-1&&i.push(a)}return i},[]);lf(this,hf).push(...o)}const{getListWithInsertedItems:Cse,getListWithRemovedItems:yse}=_B("physicallyIndexed");class _se extends sd{insert(e,t){const o=Mk(this.indexedValues,t);this.indexedValues=Cse(o,e,t,this.initValueOrFn),super.insert(e,t)}remove(e){const t=yse(this.indexedValues,e);this.indexedValues=xk(t,e),super.remove(e)}constructor(){super(e=>e)}}const{getListWithInsertedItems:Sse,getListWithRemovedItems:vse}=_B("physicallyIndexed");class Rse extends sd{insert(e,t){this.indexedValues=Sse(this.indexedValues,e,t,(o,i)=>this.getNextValue(i)),super.insert(e,t)}remove(e){this.indexedValues=vse(this.indexedValues,e),super.remove(e)}getNextValue(e){return Math.max(...this.getValues())+1+e}constructor(){super(e=>e)}}function Ese(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function kse(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Tse(n,e){Ese(n,e),e.add(n)}const hO="bindRowsWithHeaders",xse=210,Mse="loose",cO=new Map([["loose",_se],["strict",Rse]]);var dO=new WeakSet;class Ise extends at{static get PLUGIN_KEY(){return hO}static get PLUGIN_PRIORITY(){return xse}isEnabled(){return!!this.hot.getSettings()[hO]}enablePlugin(){if(this.enabled)return;const e=cO.get(this.getSetting())??cO.get(Mse);this.headerIndexes=this.hot.rowIndexMapper.registerMap("bindRowsWithHeaders",new e),this.addHook("modifyRowHeader",t=>kse(this,dO,Hse).call(this,t)),super.enablePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("bindRowsWithHeaders"),super.disablePlugin()}destroy(){super.destroy()}constructor(...e){super(...e),Tse(this,dO),this.headerIndexes=null}}function Hse(n){return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(n))}function W2(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ase(n,e){return e.get?e.get.call(n):e.value}function Ose(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function $2(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function uO(n,e){var t=$2(n,e,"get");return Ase(n,t)}function Dse(n,e,t){W2(n,e),e.set(n,t)}function Yw(n,e,t){var o=$2(n,e,"set");return Ose(n,o,t),t}function Gw(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function jw(n,e){W2(n,e),e.add(n)}const oC="collapsibleColumns",Nse=290,Pse=["nestedHeaders"],qu="collapsibleIndicator",fO=oC,gO=new Map([["collapse",{hideColumn:!0,beforeHook:"beforeColumnCollapse",afterHook:"afterColumnCollapse"}],["expand",{hideColumn:!1,beforeHook:"beforeColumnExpand",afterHook:"afterColumnExpand"}]]);var zh=new WeakMap,pO=new WeakSet,mO=new WeakSet,wO=new WeakSet,bO=new WeakSet;class Lse extends at{static get PLUGIN_KEY(){return oC}static get PLUGIN_PRIORITY(){return Nse}static get PLUGIN_DEPS(){return["plugin:NestedHeaders"]}static get SETTING_KEYS(){return[oC,...Pse]}isEnabled(){return!!this.hot.getSettings()[oC]}enablePlugin(){if(this.enabled)return;const{nestedHeaders:e}=this.hot.getSettings();e||Ie("You need to configure the Nested Headers plugin in order to use collapsible headers."),Yw(this,zh,this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding")),this.nestedHeadersPlugin=this.hot.getPlugin("nestedHeaders"),this.headerStateManager=this.nestedHeadersPlugin.getStateManager(),this.addHook("init",()=>Gw(this,wO,Fse).call(this)),this.addHook("afterLoadData",(...t)=>Gw(this,bO,Bse).call(this,...t)),this.addHook("afterGetColHeader",(...t)=>Gw(this,pO,Wse).call(this,...t)),this.addHook("beforeOnCellMouseDown",(t,o,i)=>Gw(this,mO,$se).call(this,t,o,i)),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(t=>({collapsible:t.origColspan>1})):Array.isArray(e)&&(this.headerStateManager.mapState(()=>({collapsible:!1})),this.headerStateManager.mergeStateWith(e))}super.updatePlugin()}}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),Yw(this,zh,null),this.nestedHeadersPlugin=null,this.unregisterShortcuts(),this.clearButtons(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{const{row:e,col:t}=this.hot.getSelectedRangeActive().highlight,{collapsible:o,isCollapsed:i,columnIndex:s}=this.headerStateManager.getHeaderTreeNodeData(e,t)??{};if(o)return i?this.expandSection({row:e,col:s}):this.collapseSection({row:e,col:s}),!1},runOnlyIf:()=>this.hot.getSelectedRangeActive()?.isSingle()&&this.hot.getSelectedRangeActive()?.highlight.isHeader(),group:fO,relativeToGroup:fl,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(fO)}clearButtons(){if(!this.hot.view)return;const e=this.hot.view._wt.getSetting("columnHeaders").length,t=this.hot.view._wt.wtTable.THEAD,o=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,s=function(r){r&&r.parentNode.removeChild(r)};Re(0,e-1,r=>{const a=t.childNodes[r],l=o.childNodes[r],h=i?i.childNodes[r]:null;Re(0,a.childNodes.length-1,c=>{let d=a.childNodes[c].querySelector(`.${qu}`);s(d),l&&l.childNodes[c]&&(d=l.childNodes[c].querySelector(`.${qu}`),s(d)),i&&h&&h.childNodes[c]&&(d=h.childNodes[c].querySelector(`.${qu}`),s(d))})})}expandSection(e){this.toggleCollapsibleSection([e],"expand")}collapseSection(e){this.toggleCollapsibleSection([e],"collapse")}toggleAllCollapsibleSections(e){const t=this.headerStateManager.mapNodes(o=>{const{collapsible:i,origColspan:s,headerLevel:r,columnIndex:a,isCollapsed:l}=o;if(i===!0&&s>1&&(l&&e==="expand"||!l&&e==="collapse"))return{row:this.headerStateManager.levelToRowCoords(r),col:a}});this.toggleCollapsibleSection(t,e)}collapseAll(){this.toggleAllCollapsibleSections("collapse")}expandAll(){this.toggleAllCollapsibleSections("expand")}toggleCollapsibleSection(e,t){if(gO.has(t)||Y(`Unsupported action is passed (${t}).`),!Array.isArray(e))return;const o=Gc(e,({row:f})=>f<0);let i=o.length>0;O(o,({row:f,col:p})=>{const{collapsible:C,isCollapsed:y}=this.headerStateManager.getHeaderSettings(f,p)??{};if(!C||y&&t==="collapse"||!y&&t==="expand")return i=!1,!1});const s=[],r=[];i&&O(o,({row:f,col:p})=>{const{colspanCompensation:C,affectedColumns:y,rollbackModification:_}=this.headerStateManager.triggerNodeModification(t,f,p);C>0&&(r.push(...y),s.push(_))});const a=this.getCollapsedColumns();let l=[];t==="collapse"?l=LG([...a,...r]):t==="expand"&&(l=Gc(a,f=>!r.includes(f)));const h=gO.get(t);if(this.hot.runHooks(h.beforeHook,a,l,i)===!1){O(s,f=>{f()});return}this.hot.batchExecution(()=>{O(r,f=>{uO(this,zh).setValueAtIndex(this.hot.toPhysicalColumn(f),h.hideColumn)})},!0);const d=this.getCollapsedColumns().length!==a.length,u=this.hot.getSelectedRangeActive();if(t==="collapse"&&d&&u){const{row:f,col:p}=u.highlight;if((this.hot.rowIndexMapper.isHidden(f)||this.hot.columnIndexMapper.isHidden(p))&&r.includes(p)){const y=f>=0?this.hot.rowIndexMapper.getNearestNotHiddenIndex(f,1,!0):f,_=p>=0?this.hot.columnIndexMapper.getNearestNotHiddenIndex(p,1,!0):p;y!==null&&_!==null&&this.hot.selectCell(y,_)}}this.hot.runHooks(h.afterHook,a,l,i,d),this.hot.view.adjustElementsSize(),this.hot.render()}getCollapsedColumns(){return uO(this,zh).getHiddenIndexes()}destroy(){Yw(this,zh,null),super.destroy()}constructor(...e){super(...e),jw(this,pO),jw(this,mO),jw(this,wO),jw(this,bO),Dse(this,zh,{writable:!0,value:void 0}),this.nestedHeadersPlugin=null,this.headerStateManager=null,Yw(this,zh,null)}}function Wse(n,e,t){const{collapsible:o,origColspan:i,isCollapsed:s}=this.headerStateManager.getHeaderSettings(t,n)??{},r=o&&i>1&&n>=this.hot.getSettings().fixedColumnsStart,a=this.hot.getSettings().ariaTags;let l=e.querySelector(`.${qu}`);ta(e,[ks("")[0]]),r?(l||(l=this.hot.rootDocument.createElement("div"),V(l,qu),e.querySelector("div:first-child").appendChild(l)),re(l,["collapsed","expanded"]),s?(V(l,"collapsed"),_h(l,"+"),a&&fe(e,...ks(!1))):(V(l,"expanded"),_h(l,"-"),a&&fe(e,...ks(!0))),a&&fe(l,...hl())):l?.remove()}function $se(n,e){Se(n.target,qu)&&(Se(n.target,"expanded")?(this.eventManager.fireEvent(n.target,"mouseup"),this.toggleCollapsibleSection([e],"collapse")):Se(n.target,"collapsed")&&(this.eventManager.fireEvent(n.target,"mouseup"),this.toggleCollapsibleSection([e],"expand")),es(n))}function Fse(){this.updatePlugin()}function Bse(n,e){e||this.updatePlugin()}const Vse=["sortEmptyCells","indicator","headerAction","compareFunctionFactory"],zse=!1,Use=!0,Yse=!0;class Gse{updateAllColumnsProperties(e){ie(e)&&nt(e,(t,o)=>{Vse.includes(o)&&(this[o]=t)})}getAllColumnsProperties(){const e={sortEmptyCells:this.sortEmptyCells,indicator:this.indicator,headerAction:this.headerAction};return typeof this.compareFunctionFactory=="function"&&(e.compareFunctionFactory=this.compareFunctionFactory),e}getSortOrderOfColumn(e){return this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e))?.sortOrder}getIndexOfColumnInSortQueue(e){return e=this.hot.toPhysicalColumn(e),this.sortingStates.getEntries().findIndex(([t])=>t===e)}getNumberOfSortedColumns(){return this.sortingStates.getLength()}isListOfSortedColumnsEmpty(){return this.getNumberOfSortedColumns()===0}isColumnSorted(e){return ie(this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))}getSortStates(){return this.sortingStates===null?[]:this.sortingStates.getEntries().map(([t,o])=>({column:this.hot.toVisualColumn(t),...o}))}getColumnSortState(e){const t=this.getSortOrderOfColumn(e);if(ee(t))return{column:e,sortOrder:t}}setSortStates(e){this.sortingStates.clear();for(let t=0;t<e.length;t+=1)this.sortingStates.setValueAtIndex(this.hot.toPhysicalColumn(e[t].column),{sortOrder:e[t].sortOrder})}destroy(){this.hot.columnIndexMapper.unregisterMap(this.mapName),this.sortingStates=null}constructor(e,t){this.sortingStates=new Yy,this.sortEmptyCells=zse,this.indicator=Use,this.headerAction=Yse,this.hot=e,this.mapName=t,this.hot.columnIndexMapper.registerMap(t,this.sortingStates)}}function F2(n,e,t){const o=e.locale;return function(i,s){const{sortEmptyCells:r}=t;return typeof i=="string"&&(i=i.toLocaleLowerCase(o)),typeof s=="string"&&(s=s.toLocaleLowerCase(o)),i===s?ti:ht(i)?ht(s)?ti:r&&n==="asc"?ft:gt:ht(s)?r&&n==="asc"?gt:ft:isNaN(i)&&!isNaN(s)?n==="asc"?gt:ft:!isNaN(i)&&isNaN(s)||(isNaN(i)||isNaN(s)||(i=parseFloat(i),s=parseFloat(s)),i<s)?n==="asc"?ft:gt:i>s?n==="asc"?gt:ft:ti}}const B2="default";function jse(n,e,t){return function(o,i){const s=parseFloat(o),r=parseFloat(i),{sortEmptyCells:a}=t;if(s===r||isNaN(s)&&isNaN(r))return ti;if(a){if(ht(o))return n==="asc"?ft:gt;if(ht(i))return n==="asc"?gt:ft}return isNaN(s)?gt:isNaN(r)?ft:s<r?n==="asc"?ft:gt:s>r?n==="asc"?gt:ft:ti}}const qse="numeric";function Kse(n,e,t){const o=e.checkedTemplate,i=e.uncheckedTemplate,{sortEmptyCells:s}=t;return function(r,a){const l=ht(r),h=ht(a),c=l?i:r,d=h?i:a,u=c===i||c===o,f=d===i||d===o;if(s===!1){if(l&&h===!1)return gt;if(l===!1&&h)return ft}return u===!1&&f?n==="asc"?ft:gt:u&&f===!1?n==="asc"?gt:ft:u===!1&&f===!1?F2(n,e,t)(r,a):c===i&&d===o?n==="asc"?ft:gt:c===o&&d===i?n==="asc"?gt:ft:ti}}const Xse="checkbox";function Zse(n,e,t){return j2(n,e.dateFormat,t)}const Qse="date";function Jse(n,e,t){return cre(n,e.dateFormat,t)}const ere="intl-date";function tre(n,e,t){return j2(n,e.timeFormat,t)}const nre="time";function ore(n,e,t){return dre(n,e.timeFormat,t)}const ire="intl-time",{register:hd,getItem:CO,hasItem:sre}=ts("sorting.compareFunctionFactory"),{register:V2,getItem:rre}=ts("sorting.mainSortComparator");function z2(n){return sre(n)?CO(n):CO(B2)}hd(Xse,Kse);hd(Qse,Zse);hd(ere,Jse);hd(B2,F2);hd(qse,jse);hd(nre,tre);hd(ire,ore);const ti=0,ft=-1,gt=1;function are(n,e,...t){const o=rre(e);n.sort(o(...t))}const iy="asc",sy="desc",U2="colHeader";function lre(n){if(ie(n)===!1)return!1;const{column:e,sortOrder:t}=n;return Number.isInteger(e)&&[iy,sy].includes(t)}function hre(n){if(n.some(t=>lre(t)===!1))return!1;const e=n.map(({column:t})=>t);return new Set(e).size===e.length}function yO(n){if(n!==sy)return n===iy?sy:iy}function Y2(n){return n.querySelector(`.${U2}`)}function G2(n,e){return n<0?!1:uf(e)}function vM(n,e,t){if(e<0||n>=0||Xc(t))return!1;if(n===-1)return!0;const o=typeof t.target.closest=="function"?t.target.closest("th"):null;return uf(o)}function j2(n,e,t){return function(o,i){const{sortEmptyCells:s}=t;if(o===i)return ti;if(ht(o))return ht(i)?ti:s&&n==="asc"?ft:gt;if(ht(i))return s&&n==="asc"?gt:ft;const r=Z(o,e),a=Z(i,e);return r.isValid()?a.isValid()?a.isAfter(r)?n==="asc"?ft:gt:a.isBefore(r)?n==="asc"?gt:ft:ti:ft:gt}}function cre(n,e,t){return function(o,i){const{sortEmptyCells:s}=t;if(o===i)return ti;if(ht(o))return ht(i)?ti:s&&n==="asc"?ft:gt;if(ht(i))return s&&n==="asc"?gt:ft;const r=sa(o),a=sa(i);return r===null?gt:a===null?ft:a>r?n==="asc"?ft:gt:a<r?n==="asc"?gt:ft:ti}}function dre(n,e,t){return function(o,i){const{sortEmptyCells:s}=t;if(o===i)return ti;if(ht(o))return ht(i)?ti:s&&n==="asc"?ft:gt;if(ht(i))return s&&n==="asc"?gt:ft;const r=td(o),a=td(i);return r===null?gt:a===null?ft:a>r?n==="asc"?ft:gt:a<r?n==="asc"?gt:ft:ti}}function ure(n,e){Ie(pt`Plugins \`columnSorting\` and \`multiColumnSorting\` should not be enabled simultaneously.\x20
231
- Only \`${n}\` will work. The \`${e}\` plugin will remain disabled.`)}const fre="ascending",gre="descending",q2="indicatorDisabled",K2="columnSorting",X2="sortAction",Z2=new Map([[iy,fre],[sy,gre]]);function pre(n,e,t,o){const i=[K2];if(o&&i.push(X2),t===!1)return i.push(q2),i;const s=n.getSortOrderOfColumn(e);return ee(s)&&i.push(Z2.get(s)),i}function mre(){return Array.from(Z2.values()).concat(X2,q2,K2)}function wre(n,e){return function(t,o){const[,...i]=t,[,...s]=o;return(function(a){const l=n[a],h=e[a],c=i[a],d=s[a],u=h.columnSorting;return(u.compareFunctionFactory?u.compareFunctionFactory:z2(h.type))(l,h,u)(c,d)})(0)}}function Q2(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bre(n,e){return e.get?e.get.call(n):e.value}function Cre(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function J2(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function yre(n,e){var t=J2(n,e,"get");return bre(n,t)}function _re(n,e,t){Q2(n,e),e.set(n,t)}function Sre(n,e,t){var o=J2(n,e,"set");return Cre(n,o,t),t}function Ru(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function qw(n,e){Q2(n,e),e.add(n)}const ry="columnSorting",vre=50,ay="append",Rre="replace",_O=ry;V2(ry,wre);de.getSingleton().register("beforeColumnSort");de.getSingleton().register("afterColumnSort");const rg=new WeakMap;var iC=new WeakSet,SO=new WeakSet,vO=new WeakSet,vv=new WeakMap,RO=new WeakSet;class eU extends at{static get PLUGIN_KEY(){return ry}static get PLUGIN_PRIORITY(){return vre}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){if(rg.has(this.hot)&&rg.get(this.hot)!==this.pluginKey){this.hot.updateSettings({[this.pluginKey]:!1}),ure(rg.get(this.hot),this.pluginKey);return}this.enabled||(rg.set(this.hot,this.pluginKey),this.columnStatesManager=new Gse(this.hot,`${this.pluginKey}.sortingStates`),this.columnMetaCache=new Eh(e=>{let t=this.hot.toVisualColumn(e);return t===null&&(t=e),this.getMergedPluginSettings(t)}),this.hot.columnIndexMapper.registerMap(`${this.pluginKey}.columnMeta`,this.columnMetaCache),this.addHook("afterGetColHeader",(e,t)=>Ru(this,SO,Ere).call(this,e,t)),this.addHook("beforeOnCellMouseDown",(...e)=>Ru(this,RO,Tre).call(this,...e)),this.addHook("afterOnCellMouseDown",(e,t)=>this.onAfterOnCellMouseDown(e,t)),this.addHook("afterInit",()=>Ru(this,iC,C0).call(this)),this.addHook("afterLoadData",(...e)=>Ru(this,vO,kre).call(this,...e)),this.addHook("afterDataProviderFetch",(...e)=>yre(this,vv).call(this,...e),-1),this.hot.view&&Ru(this,iC,C0).call(this),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){const e=(t,o)=>{const i=Y2(o);G2(t,o)===!1||i===null||this.updateHeaderClasses(i)};rg.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.getSelectedRangeActive();return this.sort(this.getColumnNextConfig(e.col)),!1},runOnlyIf:()=>{const e=this.hot.getSelectedRangeActive()?.highlight,t=e?this.hot.getCell(e.row,e.col,!0):null;return e&&this.hot.getSelectedRangeActive()?.isSingle()&&this.hot.selection.isCellVisible(e)&&e.row<0&&e.col>=0&&uf(t)},relativeToGroup:fl,position:"before",group:_O})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(_O)}sort(e){const t=this.getSortConfig(),o=this.getNormalizedSortConfigs(e),i=this.areValidSortConfigs(o);this.hot.runHooks("beforeColumnSort",t,o,i)!==!1&&(t.length===0&&this.indexesSequenceCache===null&&(this.indexesSequenceCache=this.hot.rowIndexMapper.registerMap(this.pluginKey,new SB),this.indexesSequenceCache.setValues(this.hot.rowIndexMapper.getIndexesSequence())),i&&(this.columnStatesManager.setSortStates(o),this.sortByPresetSortStates(o)),this.hot.runHooks("afterColumnSort",t,i?o:t,i),i&&this.hot.render())}clearSort(){this.sort([])}isSorted(){return this.enabled&&!this.columnStatesManager.isListOfSortedColumnsEmpty()}getSortConfig(e){return ee(e)?this.columnStatesManager.getColumnSortState(e):this.columnStatesManager.getSortStates()}setSortConfig(e){const t=this.getNormalizedSortConfigs(e);this.areValidSortConfigs(t)&&this.columnStatesManager.setSortStates(t)}getNormalizedSortConfigs(e=[]){return Array.isArray(e)?e.slice(0,1):[e]}areValidSortConfigs(e){const t=this.hot.countCols();return hre(e)&&e.every(({column:o})=>o<=t&&o>=0)}getColumnNextConfig(e){const t=this.columnStatesManager.getSortOrderOfColumn(e);if(ee(t)){const i=yO(t);return ee(i)?{column:e,sortOrder:i}:void 0}const o=this.hot.countCols();if(Number.isInteger(e)&&e>=0&&e<o)return{column:e,sortOrder:yO()}}getNextSortConfig(e,t=ay){const o=this.columnStatesManager.getIndexOfColumnInSortQueue(e),i=o!==-1,s=this.getSortConfig(),r=this.getColumnNextConfig(e);if(i){if(en(r))return[...s.slice(0,o),...s.slice(o+1)];if(t===ay)return[...s.slice(0,o),...s.slice(o+1),r];if(t===Rre)return[...s.slice(0,o),r,...s.slice(o+1)]}return ee(r)?s.concat(r):s}getPluginColumnConfig(e){if(ie(e)){const t=e[this.pluginKey];if(ie(t))return t}return{}}getMergedPluginSettings(e){const t=this.hot.getSettings()[this.pluginKey],o=this.columnStatesManager.getAllColumnsProperties(),i=this.hot.getCellMeta(0,e),s=Object.getPrototypeOf(i);return Array.isArray(s.columns)?Object.assign(o,t,this.getPluginColumnConfig(s.columns[e])):_e(s.columns)?Object.assign(o,t,this.getPluginColumnConfig(s.columns(e))):Object.assign(o,t)}getFirstCellSettings(e){const t=this.hot.getCellMeta(0,e),o=Object.create(t);return o[this.pluginKey]=this.columnMetaCache.getValueAtIndex(this.hot.toPhysicalColumn(e)),o}getNumberOfRowsToSort(e){const t=this.hot.getSettings();return t.maxRows<=e?t.maxRows:e-t.minSpareRows}sortByPresetSortStates(e){if(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),e.length===0)return;const t=[],o=this.hot.countRows(),i=h=>Mt(e,c=>this.hot.getDataAtCell(h,c.column));for(let h=0;h<this.getNumberOfRowsToSort(o);h+=1)t.push([this.hot.toPhysicalRow(h)].concat(i(h)));const s=Mt(t,h=>h[0]);are(t,this.pluginKey,Mt(e,h=>h.sortOrder),Mt(e,h=>this.getFirstCellSettings(h.column)));for(let h=t.length;h<o;h+=1)t.push([h].concat(i(h)));const r=Mt(t,h=>h[0]),a=new Map(Mt(s,(h,c)=>[h,r[c]])),l=Mt(this.hot.rowIndexMapper.getIndexesSequence(),h=>a.has(h)?a.get(h):h);this.hot.rowIndexMapper.setIndexesSequence(l)}sortBySettings(e){if(ie(e)){this.columnStatesManager.updateAllColumnsProperties(e);const t=e.initialConfig;(Array.isArray(t)||ie(t))&&this.sort(t)}else this.hot.render()}updateHeaderClasses(e,...t){re(e,mre()),this.enabled!==!1&&V(e,pre(...t))}onUpdateSettings(e){super.onUpdateSettings(e),this.columnMetaCache!==null&&this.columnMetaCache.init(this.hot.columnIndexMapper.getNumberOfIndexes()),ee(e[this.pluginKey])&&this.sortBySettings(e[this.pluginKey])}wasClickableHeaderClicked(e,t){return this.getFirstCellSettings(t)[this.pluginKey].headerAction&&Se(e.target,U2)}onAfterOnCellMouseDown(e,t){if(vM(t.row,t.col,e)!==!1&&this.wasClickableHeaderClicked(e,t.col)){this.hot.getShortcutManager().isCtrlPressed()&&(this.hot.deselectCell(),this.hot.selectColumns(t.col));const o=this.hot.getActiveEditor(),i=this.getColumnNextConfig(t.col);o?.isOpened()&&this.hot.getCellValidator(o.row,o.col)?this.hot.addHookOnce("postAfterValidate",()=>{this.sort(i)}):this.sort(i)}}destroy(){this.columnStatesManager?.destroy(),super.destroy()}constructor(...e){super(...e),qw(this,iC),qw(this,SO),qw(this,vO),qw(this,RO),_re(this,vv,{writable:!0,value:void 0}),this.columnStatesManager=null,this.columnMetaCache=null,this.pluginKey=ry,this.indexesSequenceCache=null,Sre(this,vv,t=>{this.setSortConfig(t?.columnSortConfig??[])})}}function C0(){const n=this.hot.getSettings()[this.pluginKey];this.sortBySettings(n)}function Ere(n,e){const t=Y2(e);if(G2(n,e)===!1||t===null)return;const o=this.getFirstCellSettings(n)[this.pluginKey],i=o.indicator,s=o.headerAction;if(this.updateHeaderClasses(t,this.columnStatesManager,n,i,s),this.hot.getSettings().ariaTags){const r=this.columnStatesManager.getSortOrderOfColumn(n);fe(e,...d4(r?`${r}ending`:"none"))}}function kre(n){n===!0&&this.hot.view&&Ru(this,iC,C0).call(this)}function Tre(n,e,t,o){vM(e.row,e.col,n)!==!1&&this.wasClickableHeaderClicked(n,e.col)&&this.hot.getShortcutManager().isCtrlPressed()&&(o.column=!0)}function Rv(n){return n==null||isNaN(n)}function xre(n,e){if(typeof n!="number")return n;const t=o=>o.toString();switch(typeof e){case"number":return t(n.toFixed(Math.min(Math.max(0,e),100)));case"boolean":return e?t(Math.round(n)):n;case"string":if(e==="auto"){const o=Math.round(n).toString().length;return t(n.toFixed(8-o))}return n;default:return n}}class Mre{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 t=[];let o=e;if(!o&&typeof this.settings=="function"){this.settingsType="function";return}return o||(o=this.settings),O(o,i=>{const s={};this.assignSetting(i,s,"ranges",[[0,this.hot.countRows()-1]]),this.assignSetting(i,s,"reversedRowCoords",!1),this.assignSetting(i,s,"destinationRow",new Error(`
232
- You must provide a destination row for the Column Summary plugin in order to work properly!
233
- `)),this.assignSetting(i,s,"destinationColumn",new Error(`
234
- You must provide a destination column for the Column Summary plugin in order to work properly!
235
- `)),this.assignSetting(i,s,"sourceColumn",i.destinationColumn),this.assignSetting(i,s,"type","sum"),this.assignSetting(i,s,"forceNumeric",!1),this.assignSetting(i,s,"suppressDataTypeErrors",!0),this.assignSetting(i,s,"customFunction",null),this.assignSetting(i,s,"readOnly",!0),this.assignSetting(i,s,"roundFloat",!1),t.push(s)}),t}assignSetting(e,t,o,i){if(o==="ranges"&&e[o]===void 0){t[o]=i;return}else if(o==="ranges"&&e[o].length===0)return;if(e[o]===void 0){if(i instanceof Error)throw i;t[o]=i}else o==="destinationRow"&&t.reversedRowCoords?t[o]=this.hot.countRows()-e[o]-1:t[o]=e[o]}resetSetupBeforeStructureAlteration(e,t,o){if(this.settingsType!=="function")return;const i=e.indexOf("row")>-1?"row":"col",s=this.getAllEndpoints();O(s,r=>{i==="row"&&r.destinationRow>=t&&(e==="insert_row"?r.alterRowOffset=o:e==="remove_row"&&(r.alterRowOffset=-1*o)),i==="col"&&r.destinationColumn>=t&&(e==="insert_col"?r.alterColumnOffset=o:e==="remove_col"&&(r.alterColumnOffset=-1*o))}),this.resetAllEndpoints(s,!1)}resetSetupAfterStructureAlteration(e,t,o,i,s,r=!0){if(s==="auto")return;if(this.settingsType==="function"){const u=()=>(this.hot.removeHook("beforeViewRender",u),this.refreshAllEndpoints());this.hot.addHookOnce("beforeViewRender",u);return}const a=e.indexOf("row")>-1?"row":"col",l=e.indexOf("remove")>-1?-1:1,h=this.getAllEndpoints(),c=e.indexOf("move_row")===0,d=t;O(h,u=>{a==="row"&&u.destinationRow>=d&&(u.alterRowOffset=l*o),a==="col"&&u.destinationColumn>=d&&(u.alterColumnOffset=l*o)}),this.resetAllEndpoints(h,!c),c?O(h,u=>{this.extendEndpointRanges(u,d,i[0],i.length),this.recreatePhysicalRanges(u),this.clearOffsetInformation(u)}):O(h,u=>{this.shiftEndpointCoordinates(u,d)}),r&&this.refreshAllEndpoints()}clearOffsetInformation(e){e.alterRowOffset=void 0,e.alterColumnOffset=void 0}extendEndpointRanges(e,t,o,i){O(e.ranges,s=>{s[1]&&(t>=s[0]&&t<=s[1]?o>s[1]?s[1]+=i:o<s[0]&&(s[0]-=i):o>=s[0]&&o<=s[1]&&(s[1]-=i,t<=s[0]&&(s[0]+=1,s[1]+=1)))})}recreatePhysicalRanges(e){const t=e.ranges,o=[],i=[];O(t,s=>{const r=[];if(s[1])for(let a=s[0];a<=s[1];a++)r.push(this.hot.toPhysicalRow(a));else r.push(this.hot.toPhysicalRow(s[0]));i.push(r)}),O(i,s=>{let r=[];O(s,(a,l)=>{l===0?r.push(a):s[l]!==s[l-1]+1&&(r.push(s[l-1]),o.push(r),r=[],r.push(a)),l===s.length-1&&(r.push(a),o.push(r))})}),e.ranges=o}shiftEndpointCoordinates(e,t){e.alterRowOffset&&e.alterRowOffset!==0?(e.destinationRow+=e.alterRowOffset||0,O(e.ranges,o=>{O(o,(i,s)=>{i>=t&&(o[s]+=e.alterRowOffset||0)})})):e.alterColumnOffset&&e.alterColumnOffset!==0&&(e.destinationColumn+=e.alterColumnOffset||0,e.sourceColumn+=e.alterColumnOffset||0)}resetAllEndpoints(e=this.getAllEndpoints(),t=!0){e.some(i=>{const s=i.alterRowOffset||0,r=i.alterColumnOffset||0;return i.destinationRow+s>=this.hot.countRows()||i.destinationColumn+r>=this.hot.countCols()})||(this.cellsToSetCache=[],O(e,i=>{this.resetEndpointValue(i,t)}),this.cellsToSetCache.length&&this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[])}refreshAllEndpoints(){this.cellsToSetCache=[],O(this.getAllEndpoints(),e=>{this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e,"init")}),this.currentEndpoint=null,this.cellsToSetCache.length&&this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshChangedEndpoints(e){const t=[];this.cellsToSetCache=[],O(e,(o,i,s)=>{`${o[2]||""}`!=`${o[3]}`&&O(this.getAllEndpoints(),(r,a)=>{this.hot.propToCol(s[i][1])===r.sourceColumn&&t.indexOf(a)===-1&&t.push(a)})}),O(t,o=>{this.refreshEndpoint(this.getEndpoint(o))}),this.cellsToSetCache.length&&this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshCellMetas(){this.endpoints.forEach(e=>{const t=this.hot.toVisualRow(e.destinationRow);if(t!==null){const o=this.hot.getCellMeta(t,e.destinationColumn);o.readOnly=e.readOnly,o.className="columnSummaryResult"}})}refreshEndpoint(e){this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e),this.currentEndpoint=null}resetEndpointValue(e,t=!0){const o=e.alterRowOffset||0,i=e.alterColumnOffset||0;this.cellsToSetCache.push([this.hot.toVisualRow(e.destinationRow+(t?o:0)),this.hot.toVisualColumn(e.destinationColumn+(t?i:0)),""])}setEndpointValue(e,t,o=!1){const i=this.hot.toVisualRow(e.destinationRow);if(e.destinationRow>=this.hot.countRows()||e.destinationColumn>=this.hot.countCols()){this.throwOutOfBoundsWarning();return}const s=this.hot.toVisualRow(e.destinationRow);if(s!==null){const r=this.hot.getCellMeta(s,e.destinationColumn);(t==="init"||r.readOnly!==e.readOnly)&&(r.readOnly=e.readOnly,r.className="columnSummaryResult")}e.result=xre(e.result,e.roundFloat),o?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(){Ie("One of the Column Summary plugins' destination points you provided is beyond the table boundaries!")}constructor(e,t){this.endpoints=[],this.settingsType="array",this.currentEndpoint=null,this.cellsToSetCache=[],this.plugin=e,this.hot=this.plugin.hot,this.settings=t}}function Ire(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Od(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Dd(n,e){Ire(n,e),e.add(n)}const Ev="columnSummary",Hre=220;var EO=new WeakSet,kO=new WeakSet,TO=new WeakSet,xO=new WeakSet,MO=new WeakSet,IO=new WeakSet;class Are extends at{static get PLUGIN_KEY(){return Ev}static get PLUGIN_PRIORITY(){return Hre}isEnabled(){return!!this.hot.getSettings()[Ev]}enablePlugin(){this.enabled||(this.settings=this.hot.getSettings()[Ev],this.endpoints=new Mre(this,this.settings),this.addHook("afterInit",(...e)=>Od(this,EO,Ore).call(this,...e)),this.addHook("afterChange",(...e)=>Od(this,TO,Nre).call(this,...e)),this.addHook("afterUpdateSettings",(...e)=>Od(this,kO,Dre).call(this,...e)),this.addHook("afterLoadData",(...e)=>Od(this,xO,Pre).call(this,...e)),this.addHook("afterUpdateData",(...e)=>Od(this,MO,Lre).call(this,...e)),this.addHook("beforeCreateRow",(e,t,o)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_row",e,t,null,o)),this.addHook("beforeCreateCol",(e,t,o)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_col",e,t,null,o)),this.addHook("beforeRemoveRow",(...e)=>this.endpoints.resetSetupBeforeStructureAlteration("remove_row",...e)),this.addHook("beforeRemoveCol",(...e)=>this.endpoints.resetSetupBeforeStructureAlteration("remove_col",...e)),this.addHook("afterCreateRow",(e,t,o)=>this.endpoints.resetSetupAfterStructureAlteration("insert_row",e,t,null,o)),this.addHook("afterCreateCol",(e,t,o)=>this.endpoints.resetSetupAfterStructureAlteration("insert_col",e,t,null,o)),this.addHook("afterRemoveRow",(...e)=>this.endpoints.resetSetupAfterStructureAlteration("remove_row",...e)),this.addHook("afterRemoveCol",(...e)=>this.endpoints.resetSetupAfterStructureAlteration("remove_col",...e)),this.addHook("afterRowMove",(...e)=>Od(this,IO,Wre).call(this,...e)),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 t=0;return nt(e.ranges,o=>{t+=this.getPartialSum(o,e.sourceColumn)}),t}getPartialSum(e,t){let o=0,i=e[1]||e[0],s=null,r=0;do{if(s=this.getCellValue(i,t),s=Rv(s)?null:s,s!==null){const a=(`${s}`.split(".")[1]||[]).length||1;a>r&&(r=a)}o+=s||0,i-=1}while(i>=e[0]);return Math.round(o*10**r)/10**r}calculateMinMax(e,t){let o=null;return nt(e.ranges,i=>{const s=this.getPartialMinMax(i,e.sourceColumn,t);if(o===null&&s!==null&&(o=s),s!==null)switch(t){case"min":o=Math.min(o,s);break;case"max":o=Math.max(o,s);break}}),o===null?"Not enough data":o}getPartialMinMax(e,t,o){let i=null,s=e[1]||e[0],r;do{if(r=this.getCellValue(s,t),r=Rv(r)?null:r,i===null)i=r;else if(r!==null)switch(o){case"min":i=Math.min(i,r);break;case"max":i=Math.max(i,r);break}s-=1}while(s>=e[0]);return i}countEmpty(e,t){let o,i=0,s=e[1]||e[0];do o=this.getCellValue(s,t),o=Rv(o)?null:o,o===null&&(i+=1),s-=1;while(s>=e[0]);return i}countEntries(e){let t=0;const o=e.ranges;return nt(o,i=>{const s=i[1]===void 0?1:i[1]-i[0]+1,r=this.countEmpty(i,e.sourceColumn);t+=s,t-=r}),t}calculateAverage(e){const t=this.calculateSum(e),o=this.countEntries(e);return t/o}getCellValue(e,t){const o=this.hot.toVisualRow(e),i=this.hot.toVisualColumn(t);let s=this.hot.getSourceDataAtCell(e,t),r="";return o!==null&&i!==null&&(r=this.hot.getCellMeta(o,i).className||""),r.indexOf("columnSummaryResult")>-1?null:(this.endpoints.currentEndpoint.forceNumeric&&(typeof s=="string"&&(s=s.replace(/,/,".")),s=parseFloat(s)),isNaN(s)&&(this.endpoints.currentEndpoint.suppressDataTypeErrors||Y(pt`ColumnSummary plugin: cell at (${e}, ${t}) is not in a\x20
236
- numeric format. Cannot do the calculation.`)),s)}constructor(...e){super(...e),Dd(this,EO),Dd(this,kO),Dd(this,TO),Dd(this,xO),Dd(this,MO),Dd(this,IO),this.endpoints=null}}function Ore(){this.endpoints.initEndpoints()}function Dre(n){n.columns!==void 0&&this.endpoints.refreshCellMetas()}function Nre(n,e){n&&e!=="ColumnSummary.reset"&&e!=="ColumnSummary.set"&&e!=="loadData"&&this.endpoints.refreshChangedEndpoints(n)}function Pre(n,e){e||this.endpoints.refreshAllEndpoints()}function Lre(n,e){e||this.endpoints.refreshAllEndpoints()}function Wre(n,e){this.endpoints.resetSetupBeforeStructureAlteration("move_row",n[0],n.length,n,this.pluginName),this.endpoints.resetSetupAfterStructureAlteration("move_row",e,n.length,n,this.pluginName)}function tU(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $re(n,e){return e.get?e.get.call(n):e.value}function Fre(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function nU(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Eu(n,e){var t=nU(n,e,"get");return $re(n,t)}function kv(n,e,t){tU(n,e),e.set(n,t)}function ku(n,e,t){var o=nU(n,e,"set");return Fre(n,o,t),t}function Bre(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Vre(n,e){tU(n,e),e.add(n)}var Hp=new WeakMap,ag=new WeakMap,lg=new WeakMap,HO=new WeakSet;class oU{setObservedElement(e){ku(this,ag,e)}unobserve(){Eu(this,lg).unobserve(Eu(this,ag))}observe(){ku(this,Hp,!0),Eu(this,lg).observe(Eu(this,ag))}destroy(){Eu(this,lg).disconnect()}constructor(){Vre(this,HO),kv(this,Hp,{writable:!0,value:void 0}),kv(this,ag,{writable:!0,value:void 0}),kv(this,lg,{writable:!0,value:void 0}),ku(this,Hp,!0),ku(this,ag,null),ku(this,lg,new ResizeObserver(e=>Bre(this,HO,zre).call(this,e)))}}function zre(n){if(Eu(this,Hp)||!Array.isArray(n)||!n.length){ku(this,Hp,!1);return}n.forEach(({borderBoxSize:e})=>{const{inlineSize:t,blockSize:o}=e[0];this.runLocalHooks("resize",t,o)})}_t(oU,Bn);function Ure(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Yre(n,e){return e.get?e.get.call(n):e.value}function Gre(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function iU(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Ot(n,e){var t=iU(n,e,"get");return Yre(n,t)}function kl(n,e,t){Ure(n,e),e.set(n,t)}function yi(n,e,t){var o=iU(n,e,"set");return Gre(n,o,t),t}var Nd=new WeakMap,Tv=new WeakMap,Kw=new WeakMap,Ir=new WeakMap,Tl=new WeakMap,xl=new WeakMap,hg=new WeakMap,Uh=new WeakMap;class Ic{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"}setPosition(e,t){Ot(this,xl).left=`${e}px`,Ot(this,xl).top=`${t}px`}setSize(e,t){if(e&&t){const o=this.getInputElement();o.style.width=`${e}px`,o.style.height=`${t}px`}}getSize(){return{width:Cn(this.getInputElement()),height:xn(this.getInputElement())}}observeSize(){Ot(this,Uh).observe()}resetSize(){const e=this.getInputElement();e.style.width="",e.style.height=""}setReadOnlyState(e){const t=this.getInputElement();t.readOnly=e}show(){Ot(this,xl).display="block",yi(this,hg,!1)}hide(){Ot(this,Uh).unobserve(),Ot(this,hg)||(Ot(this,xl).display="none"),yi(this,hg,!0)}isVisible(){return Ot(this,xl).display==="block"}setValue(e=""){const t=e||"";this.getInputElement().value=t}getValue(){return this.getInputElement().value}isFocused(){return Ot(this,Nd).activeElement===this.getInputElement()}focus(){this.getInputElement().focus()}createEditor(){const e=Ot(this,Nd).createElement("div"),t=Ot(this,Nd).createElement("textarea");return e.style.display="none",yi(this,Ir,Ot(this,Nd).createElement("div")),Ot(this,Ir).setAttribute("dir",Ot(this,Kw)?"rtl":"ltr"),V(Ot(this,Ir),Ic.CLASS_EDITOR_CONTAINER),Ot(this,Tv).appendChild(Ot(this,Ir)),V(e,Ic.CLASS_EDITOR),V(t,Ic.CLASS_INPUT),t.setAttribute("data-hot-input",!0),e.appendChild(t),Ot(this,Ir).appendChild(e),e}getInputElement(){return Ot(this,Tl).querySelector(`.${Ic.CLASS_INPUT}`)}getEditorElement(){return Ot(this,Tl)}destroy(){const e=Ot(this,Ir)?Ot(this,Ir).parentNode:null;Ot(this,Tl).parentNode.removeChild(Ot(this,Tl)),yi(this,Tl,null),yi(this,xl,null),Ot(this,Uh).destroy(),e&&e.removeChild(Ot(this,Ir))}constructor(e,t,o){kl(this,Nd,{writable:!0,value:void 0}),kl(this,Tv,{writable:!0,value:void 0}),kl(this,Kw,{writable:!0,value:void 0}),kl(this,Ir,{writable:!0,value:void 0}),kl(this,Tl,{writable:!0,value:void 0}),kl(this,xl,{writable:!0,value:void 0}),kl(this,hg,{writable:!0,value:void 0}),kl(this,Uh,{writable:!0,value:void 0}),yi(this,Kw,!1),yi(this,Ir,null),yi(this,hg,!0),yi(this,Uh,new oU),yi(this,Nd,e),yi(this,Tv,o),yi(this,Kw,t),yi(this,Tl,this.createEditor()),yi(this,xl,Ot(this,Tl).style),Ot(this,Uh).setObservedElement(this.getInputElement()),Ot(this,Uh).addLocalHook("resize",(...i)=>this.runLocalHooks("resize",...i)),this.hide()}}_t(Ic,Bn);const jre=250,qre=250;class sU{hide(){this.wasLastActionShow=!1,this.hidingTimer=setTimeout(()=>{this.wasLastActionShow===!1&&this.runLocalHooks("hide")},qre)}show(e){this.wasLastActionShow=!0,this.showDebounced(e)}cancelHiding(){this.wasLastActionShow=!0,clearTimeout(this.hidingTimer),this.hidingTimer=null}updateDelay(e=jre){this.showDebounced=Lm(t=>{this.wasLastActionShow&&this.runLocalHooks("show",t.from.row,t.from.col)},e)}destroy(){this.clearLocalHooks()}constructor(e){this.wasLastActionShow=!0,this.showDebounced=null,this.hidingTimer=null,this.updateDelay(e)}}_t(sU,Bn);function Kre(n,e,t){return n>1?Cn(e):t}function Xre(n,e){return n.indexOf(e)!==-1?n:`${n.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ","")} ${e}`}function Zre(n,e){return n.indexOf(e)!==-1?n:`${n.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ","")} ${e}`}function Yh(n,e){const t={};return O(n,o=>{o.forAll((i,s)=>{i>=0&&s>=0&&(t[i]||(t[i]=[]),t[i][s]=e(i,s))})}),t}function jl(n,e,t,o,i){O(n,s=>{s.forAll((r,a)=>{r>=0&&a>=0&&Qre(r,a,e,t,o,i)})})}function Qre(n,e,t,o,i,s){const r=i(n,e);let a=o;r.className&&(t==="vertical"?a=Xre(r.className,o):a=Zre(r.className,o)),s(n,e,"className",a)}function rU(n){return`<span class="selected">✓</span>${n}`}function sC(n,e){let t=!1;return Array.isArray(n)&&O(n,o=>(o.forAll((i,s)=>{if(i>=0&&s>=0&&e(i,s))return t=!0,!1}),t)),t}function S_(n,e){const t={top:0,left:0};if(e!==n.ownerDocument){const{frameElement:o}=e.defaultView,{top:i,left:s}=o.getBoundingClientRect();t.top=i,t.left=s}return t}const Ae="---------";function Jre(){return{name:Ae}}const ys="alignment";function eae(){return{key:ys,name(){return this.getTranslatedPhrase(rT)},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const n=this.getSelectedRangeActive();return!n||n.isSingleHeader()?!0:!(this.getSelectedRange()&&!this.selection.isSelectedByCorner())},submenu:{items:[{key:`${ys}:left`,name(){return this.getTranslatedPhrase(aT)},callback(){const n=this.getSelectedRange(),e=Yh(n,(i,s)=>this.getCellMeta(i,s).className),t="horizontal",o="htLeft";this.runHooks("beforeCellAlignment",e,n,t,o),jl(n,t,o,(i,s)=>this.getCellMeta(i,s),(i,s,r,a)=>this.setCellMeta(i,s,r,a)),this.render()},disabled:!1},{key:`${ys}:center`,name(){return this.getTranslatedPhrase(lT)},callback(){const n=this.getSelectedRange(),e=Yh(n,(i,s)=>this.getCellMeta(i,s).className),t="horizontal",o="htCenter";this.runHooks("beforeCellAlignment",e,n,t,o),jl(n,t,o,(i,s)=>this.getCellMeta(i,s),(i,s,r,a)=>this.setCellMeta(i,s,r,a)),this.render()},disabled:!1},{key:`${ys}:right`,name(){return this.getTranslatedPhrase(hT)},callback(){const n=this.getSelectedRange(),e=Yh(n,(i,s)=>this.getCellMeta(i,s).className),t="horizontal",o="htRight";this.runHooks("beforeCellAlignment",e,n,t,o),jl(n,t,o,(i,s)=>this.getCellMeta(i,s),(i,s,r,a)=>this.setCellMeta(i,s,r,a)),this.render()},disabled:!1},{key:`${ys}:justify`,name(){return this.getTranslatedPhrase(cT)},callback(){const n=this.getSelectedRange(),e=Yh(n,(i,s)=>this.getCellMeta(i,s).className),t="horizontal",o="htJustify";this.runHooks("beforeCellAlignment",e,n,t,o),jl(n,t,o,(i,s)=>this.getCellMeta(i,s),(i,s,r,a)=>this.setCellMeta(i,s,r,a)),this.render()},disabled:!1},{name:Ae},{key:`${ys}:top`,name(){return this.getTranslatedPhrase(dT)},callback(){const n=this.getSelectedRange(),e=Yh(n,(i,s)=>this.getCellMeta(i,s).className),t="vertical",o="htTop";this.runHooks("beforeCellAlignment",e,n,t,o),jl(n,t,o,(i,s)=>this.getCellMeta(i,s),(i,s,r,a)=>this.setCellMeta(i,s,r,a)),this.render()},disabled:!1},{key:`${ys}:middle`,name(){return this.getTranslatedPhrase(uT)},callback(){const n=this.getSelectedRange(),e=Yh(n,(i,s)=>this.getCellMeta(i,s).className),t="vertical",o="htMiddle";this.runHooks("beforeCellAlignment",e,n,t,o),jl(n,t,o,(i,s)=>this.getCellMeta(i,s),(i,s,r,a)=>this.setCellMeta(i,s,r,a)),this.render()},disabled:!1},{key:`${ys}:bottom`,name(){return this.getTranslatedPhrase(fT)},callback(){const n=this.getSelectedRange(),e=Yh(n,(i,s)=>this.getCellMeta(i,s).className),t="vertical",o="htBottom";this.runHooks("beforeCellAlignment",e,n,t,o),jl(n,t,o,(i,s)=>this.getCellMeta(i,s),(i,s,r,a)=>this.setCellMeta(i,s,r,a)),this.render()},disabled:!1}]}}}const v_="clear_column";function tae(){return{key:v_,name(){return this.getTranslatedPhrase(zk)},callback(n,e){const t=e[0].start.col,o=e[0].end.col;this.countRows()&&this.populateFromArray(0,t,[[null]],Math.max(e[0].start.row,e[0].end.row),o,"ContextMenu.clearColumn")},disabled(){const n=this.getSelectedRangeActive();if(!n||n.isSingleHeader()&&n.highlight.col<0||!this.selection.isSelectedByColumnHeader())return!0;let e=!1;return n.forAll((t,o)=>{if(t<0||o<0)return!0;const{readOnly:i}=this.getCellMeta(t,o);return i?!0:(e=!0,!1)}),!e}}}const Zm="col_left";function nae(){return{key:Zm,name(){return this.getTranslatedPhrase(Lk)},callback(){const n=this.getSelectedRangeActive().getTopLeftCorner(),e=this.isRtl()?"insert_col_end":"insert_col_start";this.alter(e,n.col,1,"ContextMenu.columnLeft")},disabled(){if(!this.isColumnModificationAllowed())return!0;const n=this.getSelectedRangeActive();return!n||this.selection.isSelectedByRowHeader()||n.isSingleHeader()&&n.highlight.col<0||this.countSourceCols()>=this.getSettings().maxCols?!0:this.selection.isSelectedByCorner()?this.countCols()===0:!1},hidden(){return!this.getSettings().allowInsertColumn}}}const Qm="col_right";function oae(){return{key:Qm,name(){return this.getTranslatedPhrase(Wk)},callback(){const n=this.getSelectedRangeActive().getTopRightCorner(),e=this.isRtl()?"insert_col_start":"insert_col_end";this.alter(e,n.col,1,"ContextMenu.columnRight")},disabled(){if(!this.isColumnModificationAllowed())return!0;const n=this.getSelectedRangeActive();return!!(!n||this.selection.isSelectedByRowHeader()||n.isSingleHeader()&&n.highlight.col<0||this.countSourceCols()>=this.getSettings().maxCols)},hidden(){return!this.getSettings().allowInsertColumn}}}const Jm="make_read_only";function iae(){return{key:Jm,checkable:!0,ariaChecked(){return sC(this.getSelectedRange(),(e,t)=>this.getCellMeta(e,t).readOnly)},ariaLabel(){return this.getTranslatedPhrase(PC)},name(){let n=this.getTranslatedPhrase(PC);return sC(this.getSelectedRange(),(t,o)=>this.getCellMeta(t,o).readOnly)&&(n=rU(n)),n},callback(){const n=this.getSelectedRange(),e=sC(n,(t,o)=>this.getCellMeta(t,o).readOnly);O(n,t=>{t.forAll((o,i)=>{o>=0&&i>=0&&this.setCellMeta(o,i,"readOnly",!e)})}),this.render()},disabled(){const n=this.getSelectedRangeActive();return!!(!n||n.isSingleHeader()||this.selection.isSelectedByCorner()||this.countRows()===0||this.countCols()===0||!this.getSelectedRange()||this.getSelectedRange().length===0)}}}const R_="redo";function sae(){return{key:R_,name(){return this.getTranslatedPhrase(Vk)},callback(){this.getPlugin("undoRedo").redo()},hidden(){const n=this.getPlugin("undoRedo");return!n||!n.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isRedoAvailable()}}}const ew="remove_col";function rae(){return{key:ew,name(){const n=this.getSelected();let e=0;if(n)if(n.length>1)e=1;else{const[,t,,o]=n[0];t-o!==0&&(e=1)}return this.getTranslatedPhrase(Fk,e)},callback(){this.alter("remove_col",Mj(this),null,"ContextMenu.removeColumn")},disabled(){if(!this.isColumnModificationAllowed())return!0;const n=this.getSelectedRangeActive();if(!n||n.isSingleHeader()&&n.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 E_="remove_row";function aae(){return{key:E_,name(){const n=this.getSelected();let e=0;if(n)if(n.length>1)e=1;else{const[t,,o]=n[0];t-o!==0&&(e=1)}return this.getTranslatedPhrase($k,e)},callback(){this.alter("remove_row",Ij(this),1,"ContextMenu.removeRow")},disabled(){const n=this.getSelectedRangeActive();if(!n||n.isSingleHeader()&&n.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 k_="row_above";function lae(){return{key:k_,name(){return this.getTranslatedPhrase(Nk)},callback(){const n=this.getSelectedRangeActive().getTopLeftCorner();this.alter("insert_row_above",n.row,1,"ContextMenu.rowAbove")},disabled(){const n=this.getSelectedRangeActive();return!n||this.selection.isSelectedByColumnHeader()||n.isSingleHeader()&&n.highlight.row<0||this.countSourceRows()>=this.getSettings().maxRows?!0:this.selection.isSelectedByCorner()?this.countRows()===0:!1},hidden(){return!this.getSettings().allowInsertRow}}}const T_="row_below";function hae(){return{key:T_,name(){return this.getTranslatedPhrase(Pk)},callback(){const n=this.getSelectedRangeActive().getBottomRightCorner();this.alter("insert_row_below",n.row,1,"ContextMenu.rowBelow")},disabled(){const n=this.getSelectedRangeActive();return!!(!n||this.selection.isSelectedByColumnHeader()||n.isSingleHeader()&&n.highlight.row<0||this.countSourceRows()>=this.getSettings().maxRows)},hidden(){return!this.getSettings().allowInsertRow}}}const pm="no_items";function cae(){return{key:pm,name(){return this.getTranslatedPhrase(Dk)},disabled:!0,isCommand:!1}}const x_="undo";function dae(){return{key:x_,name(){return this.getTranslatedPhrase(Bk)},callback(){this.getPlugin("undoRedo").undo()},hidden(){const n=this.getPlugin("undoRedo");return!n||!n.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isUndoAvailable()}}}const uae=[k_,T_,Zm,Qm,v_,E_,ew,x_,R_,Jm,ys,Ae,pm],fae={[Ae]:Jre,[pm]:cae,[k_]:lae,[T_]:hae,[Zm]:nae,[Qm]:oae,[v_]:tae,[E_]:aae,[ew]:rae,[x_]:dae,[R_]:sae,[Jm]:iae,[ys]:eae};function aU(){const n={};return nt(fae,(e,t)=>{n[t]=e()}),n}function gae(n){return{key:"commentsAddEdit",name(){const e=this.getSelectedRangeActive()?.highlight;return e?.isCell()&&n.getCommentAtCell(e.row,e.col)?this.getTranslatedPhrase(oT):this.getTranslatedPhrase(nT)},callback(){const e=this.getSelectedRangeActive();n.setRange(e),n.show(),n.focusEditor()},disabled(){const e=this.getSelectedRangeActive();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function pae(n){return{key:"commentsRemove",name(){return this.getTranslatedPhrase(iT)},callback(){this.getSelectedRangeActive().forAll((t,o)=>{t>=0&&o>=0&&n.removeCommentAtCell(t,o,!1)}),this.render()},disabled(){const e=this.getSelectedRangeActive();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function mae(n){return{key:"commentsReadOnly",name(){const e=this.getTranslatedPhrase(sT);return sC(this.getSelectedRange(),(o,i)=>n.getCommentMeta(o,i,rC))?rU(e):e},callback(){this.getSelectedRangeActive().forAll((t,o)=>{if(t>=0&&o>=0){const i=!!n.getCommentMeta(t,o,rC);n.updateCommentMeta(t,o,{[rC]:!i})}})},disabled(){const e=this.getSelectedRangeActive();return!!(!e||e.highlight.isHeader()||!n.getCommentAtCell(e.highlight.row,e.highlight.col)||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function lU(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wae(n,e){return e.get?e.get.call(n):e.value}function bae(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function hU(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function je(n,e){var t=hU(n,e,"get");return wae(n,t)}function Gh(n,e,t){lU(n,e),e.set(n,t)}function Do(n,e,t){var o=hU(n,e,"set");return bae(n,o,t),t}function yo(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function hs(n,e){lU(n,e),e.add(n)}const ly="comments",Cae=60,$a="comment",lp="value",cU="style",rC="readOnly",cg=ly,hy=`plugin:${ly}`;var kt=new WeakMap,sr=new WeakMap,mm=new WeakMap,hp=new WeakMap,Ap=new WeakMap,cy=new WeakMap,Op=new WeakMap,AO=new WeakSet,OO=new WeakSet,DO=new WeakSet,NO=new WeakSet,PO=new WeakSet,LO=new WeakSet,WO=new WeakSet,$O=new WeakSet,FO=new WeakSet,xv=new WeakSet,BO=new WeakSet,pc=new WeakSet;class yae extends at{static get PLUGIN_KEY(){return ly}static get PLUGIN_PRIORITY(){return Cae}static get DEFAULT_SETTINGS(){return{displayDelay:250}}isEnabled(){return!!this.hot.getSettings()[ly]}enablePlugin(){this.enabled||(je(this,kt)||(Do(this,kt,new Ic(this.hot.rootDocument,this.hot.isRtl(),this.hot.rootPortalElement)),je(this,kt).addLocalHook("resize",(...e)=>yo(this,FO,Mae).call(this,...e)),this.hot.addHook("afterSetTheme",(e,t)=>{t||this.hide()})),je(this,sr)||Do(this,sr,new sU(this.getSetting("displayDelay"))),this.addHook("afterContextMenuDefaultOptions",e=>this.addToContextMenu(e)),this.addHook("afterRenderer",(e,t,o,i,s,r)=>yo(this,PO,Eae).call(this,e,r)),this.addHook("afterScroll",()=>yo(this,BO,Iae).call(this)),this.addHook("afterBeginEditing",()=>this.hide()),this.addHook("afterDocumentKeyDown",e=>yo(this,xv,VO).call(this,e)),this.addHook("beforeCompositionStart",e=>yo(this,xv,VO).call(this,e)),je(this,sr).addLocalHook("hide",()=>this.hide()),je(this,sr).addLocalHook("show",(e,t)=>this.showAtCell(e,t)),this.registerShortcuts(),this.registerListeners(),super.enablePlugin())}updatePlugin(){je(this,sr).updateDelay(this.getSetting("displayDelay")),super.updatePlugin()}disablePlugin(){this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager(),t=e.getContext("grid"),o=e.addContext(hy);t.addShortcut({keys:[["Control","Alt","M"]],callback:()=>{const i=this.hot.getSelectedRangeActive();Do(this,hp,!0),this.hot.scrollToFocusedCell(()=>{this.setRange(i),this.show(),this.focusEditor(),e.setActiveContextName(hy),this.hot._registerTimeout(()=>{Do(this,hp,!1)})})},stopPropagation:!0,runOnlyIf:()=>this.hot.getSelectedRangeActive()?.highlight.isCell(),group:cg}),o.addShortcut({keys:[["Escape"]],callback:()=>{je(this,kt).setValue(je(this,Op)),this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>je(this,kt).isVisible()&&je(this,kt).isFocused(),group:cg}),o.addShortcut({keys:[["Control/Meta","Enter"]],callback:()=>{this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>je(this,kt).isVisible()&&je(this,kt).isFocused(),group:cg}),o.addShortcut({keys:[["Shift","Tab"],["Tab"]],forwardToContext:e.getContext("grid"),callback:()=>{Do(this,Ap,!0),je(this,kt).setValue(je(this,kt).getValue()),this.setComment(),this.hide(),e.setActiveContextName("grid")},group:cg})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(cg)}registerListeners(){const{rootDocument:e}=this.hot,t=this.getEditorInputElement();this.eventManager.addEventListener(e,"mouseover",o=>yo(this,DO,vae).call(this,o)),this.eventManager.addEventListener(e,"mousedown",o=>yo(this,AO,_ae).call(this,o)),this.eventManager.addEventListener(e,"mouseup",()=>yo(this,NO,Rae).call(this)),this.eventManager.addEventListener(t,"focus",()=>yo(this,WO,Tae).call(this)),this.eventManager.addEventListener(t,"blur",()=>yo(this,LO,kae).call(this)),this.eventManager.addEventListener(t,"keydown",o=>yo(this,$O,xae).call(this,o)),this.eventManager.addEventListener(this.getEditorInputElement(),"mousedown",o=>yo(this,OO,Sae).call(this,o))}setRange(e){this.range=e}clearRange(){this.range={}}targetIsCellWithComment(e){const t=qc(e.target,"TD","TBODY");return!!(t&&Se(t,"htCommentCell")&&qc(t,[this.hot.rootElement]))}targetIsCommentTextArea(e){return this.getEditorInputElement()===e.target}setComment(e){this.range.from||Y('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const t=je(this,kt).getValue();let o="";e!=null?o=e:t!=null&&(o=t);const{row:i,col:s}=yo(this,pc,Tu).call(this);this.updateCommentMeta(i,s,{[lp]:o}),this.hot.render()}setCommentAtCell(e,t,o){this.setRange({from:this.hot._createCellCoords(e,t)}),this.setComment(o)}removeComment(e=!0){this.range.from||Y('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const{row:t,col:o}=yo(this,pc,Tu).call(this);this.hot.setCellMeta(t,o,$a),e&&this.hot.render(),this.hide()}removeCommentAtCell(e,t,o=!0){this.setRange({from:this.hot._createCellCoords(e,t)}),this.removeComment(o)}getComment(){const{row:e,col:t}=yo(this,pc,Tu).call(this);return this.getCommentMeta(e,t,lp)}getCommentAtCell(e,t){return this.getCommentMeta(e,t,lp)}show(){this.range.from||Y('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const{row:e,col:t}=yo(this,pc,Tu).call(this);if(e<0||e>this.hot.countSourceRows()-1||t<0||t>this.hot.countSourceCols()-1)return!1;const o=this.hot.getCellMeta(e,t);return je(this,sr).cancelHiding(),je(this,kt).setValue((o[$a]?o[$a][lp]:null)??""),je(this,kt).show(),this.refreshEditor(!0),!0}showAtCell(e,t){return this.setRange({from:this.hot._createCellCoords(e,t)}),this.show()}hide(){je(this,kt).hide()}refreshEditor(e=!1){if(!e&&(!this.range.from||!je(this,kt).isVisible()))return;const{rowIndexMapper:t,columnIndexMapper:o}=this.hot,{row:i,col:s}=yo(this,pc,Tu).call(this);let r=t.getRenderableFromVisualIndex(i),a=o.getRenderableFromVisualIndex(s);const l=r===null;je(this,kt).setPosition(0,0),r===null&&(r=t.getRenderableFromVisualIndex(t.getNearestNotHiddenIndex(i,-1))),a===null&&(a=o.getRenderableFromVisualIndex(o.getNearestNotHiddenIndex(s,-1)));const h=r===null,c=a===null;r=r??0,a=a??0;const{rootWindow:d,view:{_wt:u}}=this.hot,{wtTable:f}=u,p=u.getCell({row:r,col:a},!0),y=this.hot.getCellMeta(i,s).colspan??1,_=this.getCommentMeta(i,s,cU);_?je(this,kt).setSize(_.width,_.height):je(this,kt).resetSize();const T=c?0:Kre(y,p,f.getColumnWidth(a)),P=l&&!h?xn(p):0,{left:$,top:F,width:N,height:I}=p.getBoundingClientRect(),{width:j,height:U}=je(this,kt).getSize(),{innerWidth:G,innerHeight:te}=this.hot.rootWindow,Q=this.hot.rootDocument.documentElement,be=Mn(this.hot.rootDocument),Oe=bF(this.hot.rootWindow)?be:0,Ve=CF(this.hot.rootWindow)?be:0,Ke=y>1?1:0;let He=$+d.scrollX+T-Ke,Ye=F+d.scrollY+P;this.hot.isRtl()&&(He-=j+T),this.hot.isLtr()&&$+N+j>G-Oe?He=$+d.scrollX-j-1:this.hot.isRtl()&&He<-(Q.scrollWidth-Q.clientWidth)&&(He=$+d.scrollX+T+1),F+U>te-Ve&&(Ye-=U-I+1),je(this,kt).setPosition(He,Ye),je(this,kt).setReadOnlyState(this.getCommentMeta(i,s,rC)),je(this,kt).observeSize()}focusEditor(){je(this,kt).focus()}updateCommentMeta(e,t,o){const i=this.hot.getCellMeta(e,t)[$a];let s;i?(s=Jn(i),Wy(s,o)):s=o,this.hot.setCellMeta(e,t,$a,s)}getCommentMeta(e,t,o){const i=this.hot.getCellMeta(e,t);if(i[$a])return i[$a][o]}addToContextMenu(e){e.items.push({name:Ae},gae(this),pae(this),mae(this))}getEditorInputElement(){return je(this,kt).getInputElement()}destroy(){je(this,kt)?.destroy(),je(this,sr)?.destroy(),super.destroy()}constructor(...e){super(...e),hs(this,AO),hs(this,OO),hs(this,DO),hs(this,NO),hs(this,PO),hs(this,LO),hs(this,WO),hs(this,$O),hs(this,FO),hs(this,xv),hs(this,BO),hs(this,pc),Gh(this,kt,{writable:!0,value:void 0}),Gh(this,sr,{writable:!0,value:void 0}),Gh(this,mm,{writable:!0,value:void 0}),Gh(this,hp,{writable:!0,value:void 0}),Gh(this,Ap,{writable:!0,value:void 0}),Gh(this,cy,{writable:!0,value:void 0}),Gh(this,Op,{writable:!0,value:void 0}),this.range={},Do(this,kt,null),Do(this,sr,null),Do(this,mm,!1),Do(this,hp,!1),Do(this,Ap,!1),Do(this,cy,null),Do(this,Op,"")}}function _ae(n){if(!(!this.hot.view||!this.hot.view._wt)&&!je(this,mm)&&!this.targetIsCommentTextArea(n)){const e=qc(n.target,"TD","TBODY");let t=null;e&&(t=this.hot.getCoords(e)),(!e||this.range.from&&t&&(this.range.from.row!==t.row||this.range.from.col!==t.col))&&this.hide()}}function Sae(n){n.stopPropagation()}function vae(n){const{rootDocument:e}=this.hot;if(!(je(this,mm)||je(this,kt).isFocused()||Se(n.target,"wtBorder")||je(this,cy)===n.target||!je(this,kt)))if(Do(this,cy,e.elementFromPoint(n.clientX,n.clientY)),this.targetIsCellWithComment(n)){const t=this.hot._createCellRange(this.hot.getCoords(n.target));je(this,sr).show(t)}else Lc(n.target,e)&&!this.targetIsCommentTextArea(n)&&je(this,sr).hide()}function Rae(){Do(this,mm,!1)}function Eae(n,e){e[$a]&&e[$a][lp]&&V(n,e.commentedCellClassName)}function kae(){if(je(this,Ap)){Do(this,Ap,!1);return}Do(this,Op,""),this.hot.getShortcutManager().setActiveContextName("grid"),this.setComment()}function Tae(){Do(this,Op,this.getComment()),this.hot.listen(),this.hot.getShortcutManager().setActiveContextName(hy)}function xae(n){je(this,kt).isVisible()&&(this.hot.getShortcutManager().hasEventShortcut(hy,n)||n.stopPropagation())}function Mae(n,e){const{row:t,col:o}=yo(this,pc,Tu).call(this);this.updateCommentMeta(t,o,{[cU]:{width:n,height:e}})}function VO(n){je(this,kt).isFocused()&&es(n)}function Iae(){je(this,hp)||this.hide()}function Tu(){return this.range instanceof ff?this.range.highlight:this.hot._createCellCoords(this.range.from.row,this.range.from.col)}class dU{registerCommand(e,t){this.commands[e]=t}setCommonCallback(e){this.commonCallback=e}execute(e,...t){const o=e.split(":"),i=o[0],s=o.length===2?o[1]:null;let r=this.commands[i];if(r||Y(`Menu command '${i}' not exists.`),s&&r.submenu&&(r=Hae(s,r.submenu.items)),r.disabled===!0||typeof r.disabled=="function"&&r.disabled.call(this.hot)===!0||tn(r,"submenu"))return;const a=[];typeof r.callback=="function"&&a.push(r.callback),typeof this.commonCallback=="function"&&a.push(this.commonCallback),t.unshift(o.join(":")),O(a,l=>l.apply(this.hot,t))}constructor(e){this.commands={},this.commonCallback=null,this.hot=e}}function Hae(n,e){let t;return O(e,o=>{const i=o.key?o.key.split(":"):null;if(Array.isArray(i)&&i[1]===n)return t=o,!1}),t}class uU{setPredefinedItems(e){const t={};this.defaultOrderPattern.length=0,nt(e,(o,i)=>{let s="";o.name===Ae?(t[Ae]=o,s=Ae):isNaN(parseInt(i,10))?(o.key=o.key===void 0?i:o.key,t[i]=o,s=o.key):(t[o.key]=o,s=o.key),this.defaultOrderPattern.push(s)}),this.predefinedItems=t}getItems(e=null){return Aae(e,this.defaultOrderPattern,this.predefinedItems)}constructor(e,t=null){this.predefinedItems=aU(),this.hot=e,this.defaultOrderPattern=t}}function Aae(n=null,e=[],t={}){const o=[];let i=n;return i&&i.items?i=i.items:Array.isArray(i)||(i=e),ie(i)?nt(i,(s,r)=>{let a=t[typeof s=="string"?s:r];a||(a=s),ie(s)?Fn(a,s):typeof a=="string"&&(a={name:a}),a.key===void 0&&(a.key=r),o.push(a)}):O(i,(s,r)=>{let a=t[s];!a&&uae.indexOf(s)>=0||(a||(a={name:s,key:`${r}`}),ie(s)&&Fn(a,s),a.key===void 0&&(a.key=r),o.push(a))}),o}class Oae{getSourceType(e){let t="literal";return e instanceof Event&&(t="event"),t}fitsAbove(e){return this.topRelative>=e.offsetHeight}fitsBelow(e,t=this.rootWindow.innerHeight){return this.topRelative+e.offsetHeight<=t}fitsOnRight(e,t=this.rootWindow.document.documentElement.clientWidth){return this.leftRelative+this.cellWidth+e.offsetWidth<=t}fitsOnLeft(e){return this.leftRelative>=e.offsetWidth}constructor(e,t){const o=t.scrollY,i=t.scrollX;let s,r,a,l,h,c;this.rootWindow=t,this.type=this.getSourceType(e),this.type==="literal"?(s=parseInt(e.top,10),a=parseInt(e.left,10),h=e.height||0,c=e.width||0,r=s,l=a,s+=o,a+=i):this.type==="event"&&(s=parseInt(e.pageY,10),a=parseInt(e.pageX,10),h=e.target.clientHeight,c=e.target.clientWidth,r=s-o,l=a-i),this.top=s,this.topRelative=r,this.left=a,this.leftRelative=l,this.scrollTop=o,this.scrollLeft=i,this.cellHeight=h,this.cellWidth=c}}function Dae(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Nae(n,e){return e.get?e.get.call(n):e.value}function Pae(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function fU(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Ue(n,e){var t=fU(n,e,"get");return Nae(n,t)}function dg(n,e,t){Dae(n,e),e.set(n,t)}function Pd(n,e,t){var o=fU(n,e,"set");return Pae(n,o,t),t}var ai=new WeakMap,_i=new WeakMap,Si=new WeakMap,Xw=new WeakMap,jh=new WeakMap;class Lae{setOffset(e,t=0){return Ue(this,jh)[e]=t,this}setElement(e){return Pd(this,ai,e),this}setParentElement(e){return Pd(this,_i,e),this}updatePosition(e){Pd(this,Si,new Oae(e,Ue(this,ai).ownerDocument.defaultView)),Ue(this,Xw)?(Ue(this,Si).fitsBelow(Ue(this,ai))?this.setPositionBelowCursor():Ue(this,Si).fitsAbove(Ue(this,ai))?this.setPositionAboveCursor():this.setPositionBelowCursor(),this.updateHorizontalPosition()):(this.setPositionBelowCursor(),this.setPositionOnRightOfCursor())}updateHorizontalPosition(){Ue(this,ai).dir==="rtl"?Ue(this,Si).fitsOnLeft(Ue(this,ai))?this.setPositionOnLeftOfCursor():this.setPositionOnRightOfCursor():Ue(this,Si).fitsOnRight(Ue(this,ai))?this.setPositionOnRightOfCursor():this.setPositionOnLeftOfCursor()}setPositionAboveCursor(){let e=Ue(this,jh).above+Ue(this,Si).top-Ue(this,ai).offsetHeight;if(Ue(this,_i)){const o=Ue(this,_i).ownerDocument.defaultView.getComputedStyle(Ue(this,_i).querySelector(".ht_master")),i=Number.parseInt(o.paddingTop,10),s=Number.parseInt(o.borderTop,10);e=Ue(this,Si).top+Ue(this,Si).cellHeight-Ue(this,ai).scrollHeight+i+s}Ue(this,ai).style.top=`${e}px`}setPositionBelowCursor(){let e=Ue(this,jh).below+Ue(this,Si).top+1;if(Ue(this,_i)){const o=Ue(this,_i).ownerDocument.defaultView.getComputedStyle(Ue(this,_i).querySelector(".ht_master")),i=Number.parseInt(o.paddingTop,10),s=Number.parseInt(o.borderTop,10);e=Ue(this,Si).top-i-s}Ue(this,ai).style.top=`${e}px`}setPositionOnRightOfCursor(){let e=Ue(this,Si).left;if(Ue(this,_i)){const t=Ue(this,_i).ownerDocument.defaultView,o=Number.parseInt(t.getComputedStyle(Ue(this,_i).querySelector(".htCore")).borderRightWidth,10);e+=Ue(this,Si).cellWidth+o}else e+=Ue(this,jh).right;Ue(this,ai).style.left=`${e}px`}setPositionOnLeftOfCursor(){let e=Ue(this,jh).left+Ue(this,Si).left-Ue(this,ai).offsetWidth;if(Ue(this,_i)){const t=Ue(this,_i).ownerDocument.defaultView,o=Number.parseInt(t.getComputedStyle(Ue(this,_i).querySelector(".htCore")).borderLeftWidth,10);e-=o}Ue(this,ai).style.left=`${e}px`}constructor(e){dg(this,ai,{writable:!0,value:void 0}),dg(this,_i,{writable:!0,value:void 0}),dg(this,Si,{writable:!0,value:void 0}),dg(this,Xw,{writable:!0,value:void 0}),dg(this,jh,{writable:!0,value:void 0}),Pd(this,Xw,!1),Pd(this,jh,{above:0,below:0,left:0,right:0}),Pd(this,Xw,e)}}function gU({initialPage:n=-1,size:e=()=>0,onItemSelect:t=()=>{},onClear:o=()=>{}}){const i=new Set;let s=tt(n,-1,p()-1);function r(y,_){const T=p()-1;return y<0&&(y=T),y>T&&(y=0),i.has(y)?-1:(i.add(y),t(y,!1)===!1&&(y=r(_===1?++y:--y,_)),y)}function a(y){y>-1&&y<p()&&t(y,!0)!==!1&&(s=y)}function l(y){y>-1&&y<p()&&(s=y)}function h(){return s}function c(){p()>0&&(i.clear(),s=r(0,1))}function d(){p()>0&&(i.clear(),s=r(p()-1,-1))}function u(){p()>0&&(i.clear(),s=r(++s,1))}function f(){p()>0&&(i.clear(),s=r(--s,-1))}function p(){return Math.max(e(),0)}function C(){i.clear(),s=n,o()}return{setCurrentPage:a,setPageCursorAt:l,getCurrentPage:h,toFirstItem:c,toLastItem:d,toNextItem:u,toPreviousItem:f,getSize:p,clear:C}}function Wae(n){return Mt(n,e=>({start:e.getTopStartCorner(),end:e.getBottomEndCorner()}))}function y0(n){return tn(n,"submenu")}function _0(n){return new RegExp(Ae,"i").test(n.name)}function aC(n,e){return n.disabled===!0||typeof n.disabled=="function"&&n.disabled.call(e)===!0}function zO(n){return tn(n,"disableSelection")}function $ae(n){return Se(n,"htSeparator")}function Fae(n){return Se(n,"htSubmenu")}function Bae(n){return Se(n,"htDisabled")}function Vae(n){return Se(n,"htSelectionDisabled")}function zae(n,e){return!n.hidden||!(typeof n.hidden=="function"&&n.hidden.call(e))}function pU(n,e){const t=n.slice(0);for(let o=0;o<t.length&&t[o].name===e;)t.shift();return t}function Uae(n,e){let t=n.slice(0);return t.reverse(),t=pU(t,e),t.reverse(),t}function Yae(n){const e=[];return O(n,(t,o)=>{o>0?e[e.length-1].name!==t.name&&e.push(t):e.push(t)}),e}function Gae(n,e=Ae){let t=n.slice(0);return t=pU(t,e),t=Uae(t,e),t=Yae(t),t}function jae(n){return n.checkable===!0}function qae(n){return gU({size:()=>n.countRows(),onItemSelect(e,t){const o=n.getCell(e,0);if(!o||$ae(o)||Bae(o)||Vae(o))return!1;n.selectCell(e,0,...t?[e,0,!1,!1]:[])},onClear(){n.deselectCell()}})}function Kae(n){const{hot:e,hotMenu:t}=n;return[{keys:[["Control/Meta","A"]],forwardToContext:e.getShortcutManager().getContext("grid"),callback:()=>n.close(!0)},{keys:[["Tab"],["Shift","Tab"]],callback:(o,i)=>{const s=e.getSettings(),r=typeof s.tabMoves=="function"?s.tabMoves(o):s.tabMoves;i.includes("shift")?e.selection.transformStart(-r.row,-r.col):e.selection.transformStart(r.row,r.col),n.close(!0)}},{keys:[["Escape"]],callback:()=>n.close()},{keys:[["ArrowDown"]],callback:()=>n.getNavigator().toNextItem()},{keys:[["ArrowUp"]],callback:()=>n.getNavigator().toPreviousItem()},{keys:[[e.isRtl()?"ArrowLeft":"ArrowRight"]],callback:()=>{const o=t.getSelectedActive();if(o){const i=n.openSubMenu(o[0]);i&&i.getNavigator().toFirstItem()}}},{keys:[[e.isRtl()?"ArrowRight":"ArrowLeft"]],callback:()=>{t.getSelectedActive()&&n.isSubMenu()&&(n.close(),n.isSubMenu()&&n.parentMenu.hotMenu.listen())}},{keys:[["Control/Meta","ArrowUp"],["Home"]],callback:()=>n.getNavigator().toFirstItem()},{keys:[["Control/Meta","ArrowDown"],["End"]],callback:()=>n.getNavigator().toLastItem()},{keys:[["Enter"],["Space"]],callback:o=>{const i=t.getSelectedActive();i&&(t.getSourceDataAtRow(i[0]).submenu?n.openSubMenu(i[0]).getNavigator().toFirstItem():(n.executeCommand(o),n.close(!0)))}},{keys:[["PageUp"]],callback:()=>{t.getSelectedActive()?t.selection.transformStart(-t.countVisibleRows(),0):n.getNavigator().toFirstItem()}},{keys:[["PageDown"]],callback:()=>{t.getSelectedActive()?t.selection.transformStart(t.countVisibleRows(),0):n.getNavigator().toLastItem()}}]}const mU="menu",UO=mU;function Xae(n,e=[]){const t=[];o(Kae(n)),e.forEach(({shortcuts:h,contextName:c})=>{i(h,c)});function o(h,c){a(c).addShortcuts(h,{group:mU})}function i(h,c){const d=a(c);h.forEach(({keys:u})=>{u.forEach(f=>d.removeShortcutsByKeys(f))}),t.push({shortcuts:h,contextName:c}),o(h,c)}function s(){return[...t]}function r(h){return h?`${UO}:${h}`:UO}function a(h){const c=n.hotMenu.getShortcutManager(),d=r(h);return c.getContext(d)??c.addContext(d)}function l(h){n.hotMenu.getShortcutManager().setActiveContextName(r(h))}return{addCustomShortcuts:i,getCustomShortcuts:s,getContext:a,listen:l}}function Zae(n){return(e,t,o,i,s,r,a)=>{const l=e.getSourceDataAtRow(o),h=n.rootDocument.createElement("div"),c=typeof r=="function"?r.call(n):r,d=typeof l.ariaLabel=="function"?l.ariaLabel.call(n):l.ariaLabel,u=typeof l.ariaChecked=="function"?l.ariaChecked.call(n):l.ariaChecked;if(a.readOnlyCellClassName="",sl(t),V(h,"htItemWrapper"),n.getSettings().ariaTags){const f=!aC(l,n)&&!zO(l)&&!_0(l);fe(t,[...jae(l)?[QG(),Pi(d),lF(u)]:[ZG(),Pi(c)],...f?[wr(-1)]:[],...aC(l,n)?[Kg()]:[],...y0(l)?[ks(!1)]:[]])}t.className="",t.appendChild(h),_0(l)?V(t,"htSeparator"):typeof l.renderer=="function"?(V(t,"htCustomMenuRenderer"),t.appendChild(l.renderer(e,h,o,i,s,c))):id(h,c,n.getSettings().sanitizer),aC(l,n)?V(t,"htDisabled"):zO(l)?V(t,"htSelectionDisabled"):y0(l)&&V(t,"htSubmenu")}}function Qae(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Jae(n,e){return e.get?e.get.call(n):e.value}function ele(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function wU(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function qh(n,e){var t=wU(n,e,"get");return Jae(n,t)}function Mv(n,e,t){Qae(n,e),e.set(n,t)}function Iv(n,e,t){var o=wU(n,e,"set");return ele(n,o,t),t}const YO=215;var ug=new WeakMap,Zw=new WeakMap,Qw=new WeakMap;class vf{get tableBorderWidth(){return qh(this,Qw)===void 0&&this.hotMenu&&Iv(this,Qw,parseInt(this.hotMenu.rootWindow.getComputedStyle(this.hotMenu.view._wt.wtTable.TABLE).borderWidth,10)),qh(this,Qw)}registerEvents(){let e=this.hot.rootWindow;for(;e;)this.eventManager.addEventListener(e.document,"mousedown",t=>this.onDocumentMouseDown(t)),this.eventManager.addEventListener(e.document,"touchstart",t=>this.onDocumentMouseDown(t)),this.eventManager.addEventListener(e.document,"contextmenu",t=>this.onDocumentContextMenu(t)),e=yh(e)}setMenuItems(e){this.menuItems=e}getNavigator(){return qh(this,ug)}getKeyboardShortcutsCtrl(){return qh(this,Zw)}getSelectedItem(){return this.hasSelectedItem()?this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelectedActive()[0]):null}hasSelectedItem(){return Array.isArray(this.hotMenu.getSelectedActive())}isSubMenu(){return this.parentMenu!==null}open(){this.runLocalHooks("beforeOpen"),this.container.removeAttribute("style"),this.container.style.display="block";const e=Lm(a=>this.openSubMenu(a),300),t=this.options.minWidth||YO;let o=!1,i=Gc(this.menuItems,a=>(a.key===pm&&(o=!0),zae(a,this.hot)));if(i.length<1&&!o)i.push(aU()[pm]);else if(i.length===0)return;i=Gae(i,Ae);let s=!1;const r={data:i,colHeaders:!1,autoColumnSize:!0,autoWrapRow:!1,modifyColWidth(a){return ee(a)&&a<t?t:a},autoRowSize:!1,readOnly:!0,editor:!1,copyPaste:!1,hiddenRows:!0,maxCols:1,columns:[{data:"name",renderer:Zae(this.hot)}],renderAllRows:!0,fragmentSelection:!1,outsideClickDeselects:!1,disableVisualSelection:"area",layoutDirection:this.hot.isRtl()?"rtl":"ltr",ariaTags:!1,themeName:this.hot.getCurrentThemeName(),modifyRowHeight:(a,l)=>{const h=this.hotMenu.getSourceDataAtRow(l);return h&&h.name===Ae?1:a},beforeRefreshDimensions:()=>!1,beforeOnCellMouseOver:(a,l)=>{qh(this,ug).setPageCursorAt(l.row)},afterOnCellMouseOver:(a,l)=>{this.isAllSubMenusClosed()?e(l.row):this.openSubMenu(l.row)},afterOnCellContextMenu:a=>{a.preventDefault(),vE()&&s&&this.hasSelectedItem()&&this.close(!0)},afterSelection:(a,l,h,c,d)=>{this.hotMenu.view.isMouseDown()&&(d.value=!0),this.runLocalHooks("afterSelectionChange",this.getSelectedItem())},beforeOnCellMouseUp:a=>{this.hasSelectedItem()&&(s=!this.isCommandPassive(this.getSelectedItem()),this.executeCommand(a))},afterOnCellMouseUp:a=>{(!vE()||!Xc(a))&&s&&this.hasSelectedItem()&&(Qr()||ok()?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,r),this.hotMenu.addHook("afterInit",()=>this.onAfterInit()),this.hotMenu.init(),Iv(this,ug,qae(this.hotMenu)),Iv(this,Zw,Xae(this)),qh(this,Zw).listen(),this.focus(),this.isSubMenu()&&this.addLocalHook("afterOpen",()=>this.parentMenu.runLocalHooks("afterSubmenuOpen",this)),this.runLocalHooks("afterOpen",this)}close(e=!1){if(this.isOpened()){if(e&&this.isSubMenu())this.parentMenu.close();else if(qh(this,ug).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 t=this.parentMenu.hotMenu.getSelectedActive();if(t){const o=this.parentMenu.hotMenu.getCell(t[0],0);fe(o,[ks(!1)])}}this.parentMenu.hotMenu.listen()}}}openSubMenu(e){if(!this.hotMenu)return!1;const t=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!t||!Fae(t))return!1;const o=this.hotMenu.getSourceDataAtRow(e),i=new vf(this.hot,{parent:this,name:o.name,className:this.options.className,keepInViewport:!0,container:this.options.container});return i.setMenuItems(o.submenu.items),i.open(),i.setPosition(t.getBoundingClientRect()),this.hotSubMenus[o.key]=i,this.hot.getSettings().ariaTags&&fe(t,[ks(!0)]),i}closeSubMenu(e){const t=this.hotMenu.getSourceDataAtRow(e),o=this.hotSubMenus[t.key];if(o){o.destroy(),delete this.hotSubMenus[t.key];const i=this.hotMenu.getCell(e,0);this.hot.getSettings().ariaTags&&fe(i,[ks(!1)])}}closeAllSubMenus(){O(this.hotMenu.getData(),(e,t)=>this.closeSubMenu(t))}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 t=this.getSelectedItem();if(this.runLocalHooks("select",t,e),this.isCommandPassive(t))return;const o=this.hot.getSelectedRange(),i=o?Wae(o):[];this.runLocalHooks("executeCommand",t.key,i,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",t.key,i,e)}isCommandPassive(e){return e.isCommand===!1||_0(e)||aC(e,this.hot)||y0(e)}setOffset(e,t=0){this.positioner.setOffset(e,t)}setPosition(e){this.isSubMenu()&&this.positioner.setParentElement(this.parentMenu.container),this.positioner.setElement(this.container).updatePosition(e)}updateMenuDimensions(){const{wtTable:e}=this.hotMenu.view._wt,t=this.hotMenu.getSettings().data,o=e.hider.style,i=e.holder.style,s=parseInt(o.width,10),r=Fi(t,(a,l,h)=>{const d=this.hotMenu.getCell(h,0)?xn(this.hotMenu.getCell(h,0)):0;return a+(l.name===Ae?1:d)},0);i.width=`${s}px`,i.height=`${r}px`,o.height=i.height}createContainer(e=null){const t=this.options.container.ownerDocument;let o=e,i;return o&&(_e(o)&&(o=o.call(this.hot),o===null||en(o)?o="":o=o.toString()),o=o.replace(/[^A-Za-z0-9]/g,"_"),o=`${this.options.className}Sub_${o}`,i=t.querySelector(`.${this.options.className}.${o}`)),i||(i=t.createElement("div"),V(i,`htMenu handsontable ${this.options.className}`),o&&V(i,o),this.options.container.appendChild(i)),i}onAfterInit(){this.updateMenuDimensions(),this.hot.getSettings().ariaTags&&fe(this.hotMenu.rootElement,[XG(),wr(-1)])}onDocumentMouseDown(e){this.isOpened()&&(this.options.standalone&&this.hotMenu&&!Lc(e.target,this.hotMenu.rootElement)?this.close(!0):(this.isAllSubMenusClosed()||this.isSubMenu())&&!Lc(e.target,".htMenu")&&this.close(!0))}onDocumentContextMenu(e){this.isOpened()&&Se(e.target,"htCore")&&Lc(e.target,this.hotMenu.rootElement)&&e.preventDefault()}constructor(e,t){Mv(this,ug,{writable:!0,value:void 0}),Mv(this,Zw,{writable:!0,value:void 0}),Mv(this,Qw,{writable:!0,value:void 0}),this.eventManager=new $i(this),this.hotMenu=null,this.hotSubMenus={},this.menuItems=null,this.origOutsideClickDeselects=null,this.hot=e,this.options=t||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1,minWidth:YO,container:this.hot.rootPortalElement},this.container=this.createContainer(this.options.name),this.positioner=new Lae(this.options.keepInViewport),this.parentMenu=this.options.parent||null,this.registerEvents(),this.isSubMenu()&&this.addLocalHook("afterSelectionChange",(...o)=>this.parentMenu.runLocalHooks("afterSelectionChange",...o)),this.hot.addHook("afterSetTheme",(o,i)=>{this.options.container!==this.hot.rootPortalElement&&(re(this.options.container,/ht-theme-.*/g),V(this.options.container,o)),i||this.close()})}}_t(vf,Bn);function tle(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Jw(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function eb(n,e){tle(n,e),e.add(n)}const cp="contextMenu",nle=70,GO=cp;de.getSingleton().register("afterContextMenuDefaultOptions");de.getSingleton().register("beforeContextMenuShow");de.getSingleton().register("afterContextMenuShow");de.getSingleton().register("afterContextMenuHide");de.getSingleton().register("afterContextMenuExecute");var jO=new WeakSet,qO=new WeakSet,KO=new WeakSet,XO=new WeakSet;class M_ extends at{static get PLUGIN_KEY(){return cp}static get PLUGIN_PRIORITY(){return nle}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[k_,T_,Ae,Zm,Qm,Ae,E_,ew,Ae,x_,R_,Ae,Jm,Ae,ys]}isEnabled(){return!!this.hot.getSettings()[cp]}enablePlugin(){if(this.enabled)return;const e=this.hot.getSettings()[cp];typeof e.callback=="function"&&this.commandExecutor.setCommonCallback(e.callback),this.menu=new vf(this.hot,{className:"htContextMenu",keepInViewport:!0,container:e.uiContainer||this.hot.rootPortalElement}),this.menu.addLocalHook("beforeOpen",()=>Jw(this,qO,ile).call(this)),this.menu.addLocalHook("afterOpen",()=>Jw(this,KO,sle).call(this)),this.menu.addLocalHook("afterClose",()=>Jw(this,XO,rle).call(this)),this.menu.addLocalHook("executeCommand",(...t)=>this.executeCommand.call(this,...t)),this.addHook("afterOnCellContextMenu",t=>Jw(this,jO,ole).call(this,t)),this.addHook("beforeDialogShow",()=>this.close()),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.getSelectedRangeActive();this.hot.scrollToFocusedCell();const t=this.hot.getCell(e.row,e.col,!0).getBoundingClientRect(),o=S_(this.menu.container,this.hot.rootDocument);this.open({left:t.left+o.left,top:t.top+o.top-1+t.height},{left:t.width,above:-t.height}),this.menu.getNavigator().toFirstItem()},runOnlyIf:()=>{const e=this.hot.getSelectedRangeActive()?.highlight;return e&&this.hot.selection.isCellVisible(e)&&!this.menu.isOpened()},group:GO})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(GO)}open(e,t={above:0,below:0,left:0,right:0}){this.menu?.isOpened()||(this.prepareMenuItems(),this.menu.open(),nt(t,(o,i)=>{this.menu.setOffset(i,o)}),this.menu.setPosition(e))}close(){this.menu?.close(),this.itemsFactory=null}executeCommand(e,...t){this.itemsFactory===null&&this.prepareMenuItems(),this.commandExecutor.execute(e,...t)}prepareMenuItems(){this.itemsFactory=new uU(this.hot,M_.DEFAULT_ITEMS);const e=this.hot.getSettings()[cp],t={items:this.itemsFactory.getItems(e)};this.hot.runHooks("afterContextMenuDefaultOptions",t),this.itemsFactory.setPredefinedItems(t.items);const o=this.itemsFactory.getItems(e);this.hot.runHooks("beforeContextMenuSetItems",o),this.menu.setMenuItems(o),O(o,i=>this.commandExecutor.registerCommand(i.key,i))}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}constructor(...e){super(...e),eb(this,jO),eb(this,qO),eb(this,KO),eb(this,XO),this.commandExecutor=new dU(this.hot),this.itemsFactory=null,this.menu=null}}function ole(n){const e=this.hot.getSettings(),t=e.rowHeaders,o=e.colHeaders;function i(a){return a.nodeName==="TD"||a.parentNode.nodeName==="TD"}const s=n.target;if(this.close(),Se(s,"handsontableInput")||(n.preventDefault(),n.stopPropagation(),!(t||o)&&!i(s)&&!(Se(s,"current")&&Se(s,"wtBorder"))))return;const r=S_(this.menu.container,this.hot.rootDocument);this.open({top:n.clientY+r.top,left:n.clientX+r.left})}function ile(){this.hot.runHooks("beforeContextMenuShow",this)}function sle(){this.hot.runHooks("afterContextMenuShow",this)}function rle(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)}M_.SEPARATOR={name:Ae};function ale(n){return{key:"copy",name(){return this.getTranslatedPhrase(Uk)},callback(){n.copyCellsOnly()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeActive();if(!e||e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1}}function lle(n){return{key:"copy_column_headers_only",name(){const e=this.getSelectedRangeActive(),t=e?tt(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(jk,t)},callback(){n.copyColumnHeadersOnly()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeActive();if(!e||e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1}}function hle(n){return{key:"copy_with_column_group_headers",name(){const e=this.getSelectedRangeActive(),t=e?tt(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Gk,t)},callback(){n.copyWithAllColumnHeaders()},disabled(){if(!this.hasColHeaders()||!this.getSettings().nestedHeaders)return!0;const e=this.getSelectedRangeActive();if(!e||e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1}}function cle(n){return{key:"copy_with_column_headers",name(){const e=this.getSelectedRangeActive(),t=e?tt(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Yk,t)},callback(){n.copyWithColumnHeaders()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeActive();if(!e||e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1}}function dle(n){return{key:"cut",name(){return this.getTranslatedPhrase(qk)},callback(){n.cut()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeActive();if(!e||e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1}}class ule{setData(e,t){this.data[e]=t}getData(e){return this.data[e]||void 0}constructor(){this.data={}}}class fle{preventDefault(){}composedPath(){return[]}constructor(){this.clipboardData=new ule}}function bU(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gle(n,e){return e.get?e.get.call(n):e.value}function ple(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function CU(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function gi(n,e){var t=CU(n,e,"get");return gle(n,t)}function Ld(n,e,t){bU(n,e),e.set(n,t)}function Wd(n,e,t){var o=CU(n,e,"set");return ple(n,o,t),t}function tb(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function ZO(n,e){bU(n,e),e.add(n)}var Ml=new WeakMap,Hv=new WeakMap,fg=new WeakMap,S0=new WeakMap,v0=new WeakMap,gg=new WeakMap,nb=new WeakSet,QO=new WeakSet;class mle{setSelectedRange(e){Wd(this,Ml,e)}getCellsRange(){if(gi(this,Hv).call(this)===0||gi(this,fg).call(this)===0)return null;const{row:e,col:t}=gi(this,Ml).getTopStartCorner(),{row:o,col:i}=gi(this,Ml).getBottomEndCorner(),s=tb(this,QO,wle).call(this,e,o),r=tb(this,nb,Av).call(this,t,i);return{isRangeTrimmed:o!==s||i!==r,startRow:e,startCol:t,endRow:s,endCol:r}}getMostBottomColumnHeadersRange(){if(gi(this,fg).call(this)===0||gi(this,gg).call(this)===0)return null;const{col:e}=gi(this,Ml).getTopStartCorner(),{col:t}=gi(this,Ml).getBottomEndCorner(),o=tb(this,nb,Av).call(this,e,t);return{isRangeTrimmed:t!==o,startRow:-1,startCol:e,endRow:-1,endCol:o}}getAllColumnHeadersRange(){if(gi(this,fg).call(this)===0||gi(this,gg).call(this)===0)return null;const{col:e}=gi(this,Ml).getTopStartCorner(),{col:t}=gi(this,Ml).getBottomEndCorner(),o=tb(this,nb,Av).call(this,e,t);return{isRangeTrimmed:t!==o,startRow:-gi(this,gg).call(this),startCol:e,endRow:-1,endCol:o}}constructor({countRows:e,countColumns:t,rowsLimit:o,columnsLimit:i,countColumnHeaders:s}){ZO(this,nb),ZO(this,QO),Ld(this,Ml,{writable:!0,value:void 0}),Ld(this,Hv,{writable:!0,value:void 0}),Ld(this,fg,{writable:!0,value:void 0}),Ld(this,S0,{writable:!0,value:void 0}),Ld(this,v0,{writable:!0,value:void 0}),Ld(this,gg,{writable:!0,value:void 0}),Wd(this,Hv,e),Wd(this,fg,t),Wd(this,S0,o),Wd(this,v0,i),Wd(this,gg,s)}}function Av(n,e){return Math.min(e,Math.max(n+gi(this,v0).call(this)-1,n))}function wle(n,e){return Math.min(e,Math.max(n+gi(this,S0).call(this)-1,n))}function yU(n){const e=[],t=[];return O(n,o=>{const i=Math.min(o.startRow,o.endRow),s=Math.max(o.startRow,o.endRow);Re(i,s,l=>{e.indexOf(l)===-1&&e.push(l)});const r=Math.min(o.startCol,o.endCol),a=Math.max(o.startCol,o.endCol);Re(r,a,l=>{t.indexOf(l)===-1&&t.push(l)})}),{rows:e,columns:t}}function _U(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ble(n,e){return e.get?e.get.call(n):e.value}function Cle(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function SU(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Hi(n,e){var t=SU(n,e,"get");return ble(n,t)}function Il(n,e,t){_U(n,e),e.set(n,t)}function io(n,e,t){var o=SU(n,e,"set");return Cle(n,o,t),t}function Mi(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Os(n,e){_U(n,e),e.add(n)}de.getSingleton().register("afterCopyLimit");de.getSingleton().register("modifyCopyableRange");de.getSingleton().register("beforeCut");de.getSingleton().register("afterCut");de.getSingleton().register("beforePaste");de.getSingleton().register("afterPaste");de.getSingleton().register("beforeCopy");de.getSingleton().register("afterCopy");const Ov="copyPaste",yle=80,_le=["fragmentSelection"],vU="application/ht-source-data-json-html",JO=['<meta name="generator" content="Handsontable"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join(""),eD=new WeakSet;var lC=new WeakMap,hC=new WeakMap,cC=new WeakMap,Kh=new WeakMap,pg=new WeakMap,mg=new WeakMap,Xh=new WeakMap,Dp=new WeakMap,Dv=new WeakSet,tD=new WeakSet,RU=new WeakSet,RM=new WeakSet,Nv=new WeakSet,nD=new WeakSet,oD=new WeakSet,iD=new WeakSet,sD=new WeakSet,rD=new WeakSet,aD=new WeakSet;class Sle extends at{static get PLUGIN_KEY(){return Ov}static get SETTING_KEYS(){return[Ov,..._le]}static get PLUGIN_PRIORITY(){return yle}static get DEFAULT_SETTINGS(){return{pasteMode:"overwrite",rowsLimit:1/0,columnsLimit:1/0,copyColumnHeaders:!1,copyColumnGroupHeaders:!1,copyColumnHeadersOnly:!1}}isEnabled(){return!!this.hot.getSettings()[Ov]}enablePlugin(){this.enabled||(this.pasteMode=this.getSetting("pasteMode")??this.pasteMode,this.rowsLimit=isNaN(this.getSetting("rowsLimit"))?this.rowsLimit:this.getSetting("rowsLimit"),this.columnsLimit=isNaN(this.getSetting("columnsLimit"))?this.columnsLimit:this.getSetting("columnsLimit"),io(this,lC,this.getSetting("copyColumnHeaders")),io(this,hC,this.getSetting("copyColumnGroupHeaders")),io(this,cC,this.getSetting("copyColumnHeadersOnly")),this.uiContainer=this.getSetting("uiContainer")??this.uiContainer,this.addHook("afterContextMenuDefaultOptions",e=>Mi(this,nD,Ele).call(this,e)),this.addHook("afterSelection",(...e)=>Mi(this,oD,kle).call(this,...e)),this.addHook("afterSelectionEnd",()=>Mi(this,iD,Tle).call(this)),this.eventManager.addEventListener(this.hot.rootDocument,"copy",(...e)=>this.onCopy(...e)),this.eventManager.addEventListener(this.hot.rootDocument,"cut",(...e)=>this.onCut(...e)),this.eventManager.addEventListener(this.hot.rootDocument,"paste",(...e)=>this.onPaste(...e)),$y()&&(this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseenter",(...e)=>Mi(this,sD,xle).call(this,...e)),this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseleave",(...e)=>Mi(this,rD,Mle).call(this,...e)),this.addHook("afterSelection",()=>Mi(this,aD,Ile).call(this))),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin()}copy(e="cells-only"){io(this,Kh,e),io(this,pg,!0),Mi(this,Dv,lD).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(){io(this,mg,!0),Mi(this,Dv,lD).call(this,"cut")}getRangedCopyableData(e){return $C(this.getRangedData(e))}getRangedData(e,t=!1){const o=[],{rows:i,columns:s}=yU(e);return O(i,r=>{const a=[];O(s,l=>{if(r<0)a.push(this.hot.getColHeader(l,r));else{let h=t?this.hot.getCopyableSourceData(r,l):this.hot.getCopyableData(r,l);t&&(ie(h)||Array.isArray(h))&&(h=JSON.stringify(h)),a.push(h)}}),o.push(a)}),o}paste(e="",t=e){if(!e&&!t)return;const o=new fle;e&&o.clipboardData.setData("text/plain",e),t&&o.clipboardData.setData("text/html",t),this.onPaste(o)}setCopyableText(){const e=this.hot.getSelectedRangeActive();if(!e)return;if(e.isSingleHeader()){this.copyableRanges=[];return}Hi(this,Xh).setSelectedRange(e);const t=new Map([["headers",null],["cells",null]]);Hi(this,Kh)==="column-headers-only"?t.set("headers",Hi(this,Xh).getMostBottomColumnHeadersRange()):(Hi(this,Kh)==="with-column-headers"?t.set("headers",Hi(this,Xh).getMostBottomColumnHeadersRange()):Hi(this,Kh)==="with-column-group-headers"&&t.set("headers",Hi(this,Xh).getAllColumnHeadersRange()),t.set("cells",Hi(this,Xh).getCellsRange())),this.copyableRanges=Array.from(t.values()).filter(i=>i!==null).map(({startRow:i,startCol:s,endRow:r,endCol:a})=>({startRow:i,startCol:s,endRow:r,endCol:a})),this.copyableRanges=this.hot.runHooks("modifyCopyableRange",this.copyableRanges);const o=t.get("cells");if(o!==null&&o.isRangeTrimmed){const{startRow:i,startCol:s,endRow:r,endCol:a}=o;this.hot.runHooks("afterCopyLimit",r-i+1,a-s+1,this.rowsLimit,this.columnsLimit)}}isEditorOpened(){return this.hot.getActiveEditor()?.isOpened()}populateValues({plainData:e,originalPlainData:t,sourceData:o}){if(!e.length)return[null,null,null,null];const i=this.hot.getSelectedRangeActive(),s=e.length,r=e[0].length,a=[],{row:l,col:h}=i.getTopStartCorner(),{row:c,col:d}=i.getBottomEndCorner();let u=l,f=h,p=l,C=h;for(;a.length<s||u<=c;){const{skipRowOnPaste:y,visualRow:_}=this.hot.getCellMeta(u,h);if(u=_+1,y===!0)continue;p=_,f=h;const T=[],P=a.length%s;for(;T.length<r||f<=d;){const{skipColumnOnPaste:$,visualCol:F,parsePastedValue:N}=this.hot.getCellMeta(_,f),I=T.length%r;if(f=F+1,$===!0)continue;C=F;const j=o?.[P]?.[I],U=t?.[P]?.[I];let G=e[P][I];N&&o&&eF(j)&&G===U&&(G=JSON.parse(j)),T.push(G)}a.push(T)}return io(this,Dp,!0),this.hot.populateFromArray(l,h,a,void 0,void 0,"CopyPaste.paste",this.pasteMode),[l,h,p,C]}onCopy(e){const t=e.composedPath()[0],o=this.hot.getFocusManager().getRefocusElement(),i=t?.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!Hi(this,pg)||this.isEditorOpened()||na(t)&&(i&&t!==o||!i&&t!==this.hot.rootDocument.body&&!Bb(t,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),io(this,pg,!1);const s=this.getRangedData(this.copyableRanges),r=this.getRangedData(this.copyableRanges,!0),a=Mi(this,tD,vle).call(this,this.copyableRanges);this.hot.runHooks("beforeCopy",s,this.copyableRanges,a)&&(Mi(this,Nv,hD).call(this,e,s,r),this.hot.runHooks("afterCopy",s,this.copyableRanges,a)),io(this,Kh,"cells-only")}onCut(e){const t=e.composedPath()[0],o=this.hot.getFocusManager().getRefocusElement(),i=t?.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!Hi(this,mg)||this.isEditorOpened()||na(t)&&(i&&t!==o||!i&&t!==this.hot.rootDocument.body&&!Bb(t,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),io(this,mg,!1);const s=this.getRangedData(this.copyableRanges),r=this.getRangedData(this.copyableRanges,!0);this.hot.runHooks("beforeCut",s,this.copyableRanges)&&(Mi(this,Nv,hD).call(this,e,s,r),this.hot.emptySelectedCells("CopyPaste.cut"),this.hot.runHooks("afterCut",s,this.copyableRanges))}onPaste(e){const t=e.composedPath()[0],o=this.hot.getFocusManager().getRefocusElement(),i=t?.hasAttribute("data-hot-input");if(!this.hot.isListening()||this.isEditorOpened()||!this.hot.getSelected()||na(t)&&(i&&t!==o||!i&&t!==this.hot.rootDocument.body&&!Bb(t,this.hot.rootElement)))return;e.preventDefault();let s,r;if(e&&typeof e.clipboardData<"u"){const u=e.clipboardData.getData(vU);u&&(r=cH(u,this.hot.rootDocument).data);const f=e.clipboardData.getData("text/html"),{sanitizer:p}=this.hot.getSettings();let C=f;typeof p=="function"?C=p(f,"CopyPaste.paste"):(eD.has(this.hot)||(eD.add(this.hot),Ch("The HTML sanitization using DOMPurify library is deprecated and will be removed in the next major release. Use the `sanitizer` option instead.\n\nMigration guide: https://handsontable.com/docs/migration-from-16.2-to-17.0/\n`sanitizer` documentation: https://handsontable.com/docs/api/options/#sanitizer")),C=EC(f,{ADD_TAGS:["meta"],ADD_ATTR:["content"],FORCE_BODY:!0})),C&&/(<table)|(<TABLE)/g.test(C)?s=cH(C,this.hot.rootDocument).data:s=e.clipboardData.getData("text/plain")}else typeof ClipboardEvent>"u"&&typeof this.hot.rootWindow.clipboardData<"u"&&(s=this.hot.rootWindow.clipboardData.getData("Text"));if(typeof s=="string"&&(s=Nj(s)),s===void 0||s&&s.length===0)return;const a=Jn(s);if(this.hot.runHooks("beforePaste",s,this.copyableRanges)===!1)return;const[l,h,c,d]=this.populateValues({plainData:s,sourceData:r,originalPlainData:a});l!==null&&h!==null&&this.hot.selectCell(l,h,Math.min(this.hot.countRows()-1,c),Math.min(this.hot.countCols()-1,d)),this.hot.runHooks("afterPaste",s,this.copyableRanges)}destroy(){super.destroy()}constructor(...e){super(...e),Os(this,Dv),Os(this,tD),Os(this,RU),Os(this,RM),Os(this,Nv),Os(this,nD),Os(this,oD),Os(this,iD),Os(this,sD),Os(this,rD),Os(this,aD),Il(this,lC,{writable:!0,value:void 0}),Il(this,hC,{writable:!0,value:void 0}),Il(this,cC,{writable:!0,value:void 0}),Il(this,Kh,{writable:!0,value:void 0}),Il(this,pg,{writable:!0,value:void 0}),Il(this,mg,{writable:!0,value:void 0}),Il(this,Xh,{writable:!0,value:void 0}),Il(this,Dp,{writable:!0,value:void 0}),this.columnsLimit=1/0,this.rowsLimit=1/0,this.pasteMode="overwrite",this.uiContainer=this.hot.rootDocument.body,io(this,lC,!1),io(this,hC,!1),io(this,cC,!1),io(this,Kh,"cells-only"),io(this,pg,!1),io(this,mg,!1),io(this,Xh,new mle({countRows:()=>this.hot.countRows(),countColumns:()=>this.hot.countCols(),rowsLimit:()=>this.rowsLimit,columnsLimit:()=>this.columnsLimit,countColumnHeaders:()=>this.hot.view.getColumnHeadersCount()})),io(this,Dp,!1),this.copyableRanges=[]}}function lD(n){if($y()){const e=this.hot.getSelectedRangeActive();if(e){const{row:t,col:o}=e.highlight,i=this.hot.getCell(t,o,!0);i&&U4(i,()=>{this.hot.rootDocument.execCommand(n)})}}else this.hot.rootDocument.execCommand(n)}function vle(n){const{rows:e}=yU(n);let t=0;for(let o=0;o<e.length&&!(e[o]>=0);o++)t+=1;return{columnHeadersCount:t}}function Rle(){if(this.hot.isListening()){const n=this.hot.getSelectedRangeActive();if(n){const{row:e,col:t}=n.highlight,o=this.hot.getCell(e,t,!0);o&&SF(o)}}}function EU(){if(this.hot.isListening()){const n=this.hot.getSelectedRangeActive();if(n){const{row:e,col:t}=n.highlight,o=this.hot.getCell(e,t,!0);o?.hasAttribute("contenteditable")&&vF(o)}}}function hD(n,e,t){const o=$C(e);if(n&&n.clipboardData){const i=hH(e),s=hH(t);n.clipboardData.setData("text/plain",o),n.clipboardData.setData("text/html",[JO,i].join("")),n.clipboardData.setData(vU,[JO,s].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",o)}function Ele(n){n.items.push({name:"---------"},ale(this)),Hi(this,lC)&&n.items.push(cle(this)),Hi(this,hC)&&n.items.push(hle(this)),Hi(this,cC)&&n.items.push(lle(this)),n.items.push(dle(this))}function kle(n,e,t,o,i){Hi(this,Dp)&&(i.value=!0),io(this,Dp,!1)}function Tle(){this.isEditorOpened()||this.hot.getSettings().fragmentSelection||this.setCopyableText()}function xle(){Mi(this,RM,EU).call(this)}function Mle(){Mi(this,RU,Rle).call(this)}function Ile(){Mi(this,RM,EU).call(this)}function kU(n,e){return`border_row${n}col${e}`}function dp(){return{width:1,color:"#000"}}function Za(){return{hide:!0}}function Hle(){return{width:1,color:"#000",cornerVisible:!1}}function Pv(n){return(ee(n.start)||ee(n.left))&&(n.start=n.start??n.left),(ee(n.end)||ee(n.right))&&(n.end=n.end??n.right),delete n.left,delete n.right,n}function wg(n){return ee(n.start)&&(n.left=n.start),ee(n.end)&&(n.right=n.end),n}function Lv(n,e){return{id:kU(n,e),border:Hle(),row:n,col:e,top:Za(),bottom:Za(),start:Za(),end:Za()}}function Ale(n,e){return tn(e,"border")&&e.border&&(n.border=e.border),tn(e,"top")&&ee(e.top)&&(e.top?(ie(e.top)||(e.top=dp()),n.top=e.top):(e.top=Za(),n.top=e.top)),tn(e,"bottom")&&ee(e.bottom)&&(e.bottom?(ie(e.bottom)||(e.bottom=dp()),n.bottom=e.bottom):(e.bottom=Za(),n.bottom=e.bottom)),tn(e,"start")&&ee(e.start)&&(e.start?(ie(e.start)||(e.start=dp()),n.start=e.start):(e.start=Za(),n.start=e.start)),tn(e,"end")&&ee(e.end)&&(e.end?(ie(e.end)||(e.end=dp()),n.end=e.end):(e.end=Za(),n.end=e.end)),n}function ll(n,e){let t=!1;return O(n.getSelectedRange(),o=>{o.forAll((i,s)=>{if(i<0||s<0)return;const r=n.getCellMeta(i,s).borders;if(r)if(e){if(!tn(r[e],"hide")||r[e].hide===!1)return t=!0,!1}else return t=!0,!1})}),t}function I_(n){return`<span class="selected">✓</span>${n}`}function Ole(n){return n.some(e=>ee(e.left)||ee(e.right))}function Dle(n){return n.some(e=>ee(e.start)||ee(e.end))}const Nle=new Map([["left","start"],["right","end"]]);function Ple(n){return Nle.get(n)??n}function Lle(n){return{key:"borders:bottom",name(){let e=this.getTranslatedPhrase(wT);return ll(this,"bottom")&&(e=I_(e)),e},callback(e,t){const o=ll(this,"bottom");n.prepareBorder(t,"bottom",o)}}}function Wle(n){const e=n.hot.isRtl()?"end":"start";return{key:"borders:left",name(){let t=this.getTranslatedPhrase(bT);return ll(this,e)&&(t=I_(t)),t},callback(t,o){const i=ll(this,e);n.prepareBorder(o,e,i)}}}function $le(n){return{key:"borders:no_borders",name(){return this.getTranslatedPhrase(CT)},callback(e,t){n.prepareBorder(t,"noBorders")},disabled(){return!ll(this)}}}function Fle(n){const e=n.hot.isRtl()?"start":"end";return{key:"borders:right",name(){let t=this.getTranslatedPhrase(mT);return ll(this,e)&&(t=I_(t)),t},callback(t,o){const i=ll(this,e);n.prepareBorder(o,e,i)}}}function Ble(n){return{key:"borders:top",name(){let e=this.getTranslatedPhrase(pT);return ll(this,"top")&&(e=I_(e)),e},callback(e,t){const o=ll(this,"top");n.prepareBorder(t,"top",o)}}}function Vle(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Wv(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function $v(n,e){Vle(n,e),e.add(n)}const dC="customBorders",zle=90,cD=["dashed","dotted","solid"];var dD=new WeakSet,uD=new WeakSet,fD=new WeakSet;class Ule extends at{static get PLUGIN_KEY(){return dC}static get PLUGIN_PRIORITY(){return zle}isEnabled(){return!!this.hot.getSettings()[dC]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>Wv(this,uD,Gle).call(this,e)),this.addHook("init",()=>Wv(this,fD,jle).call(this)),super.enablePlugin())}disablePlugin(){this.hideBorders(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.changeBorderSettings(),super.updatePlugin()}setBorders(e,t){let o=["top","bottom","start","end"],i=null;t&&(this.checkSettingsCohesion([t]),o=Object.keys(t),i=Pv(t));const s=sf(e),r=am(s,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)});O(e,a=>{r(a).forAll((l,h)=>{O(o,c=>{this.prepareBorderFromCustomAdded(l,h,i,Ple(c))})})}),this.hot.view.render()}getBorders(e){if(!Array.isArray(e))return this.savedBorders;const t=sf(e),o=am(t,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)}),i=[];return O(e,s=>{o(s).forAll((r,a)=>{O(this.savedBorders,l=>{l.row===r&&l.col===a&&i.push(wg(l))})})}),i}clearBorders(e){e?this.setBorders(e):(O(this.savedBorders,t=>{this.clearBordersFromSelectionSettings(t.id),this.clearNullCellRange(),this.hot.removeCellMeta(t.row,t.col,"borders")}),this.savedBorders.length=0)}insertBorderIntoSettings(e,t){this.checkSavedBorders(e)||this.savedBorders.push(e);const i=this.hot._createCellRange(this.hot._createCellCoords(e.row,e.col));this.checkCustomSelections(e,i,t)||this.hot.selection.highlight.addCustomSelection({border:e,visualCellRange:i})}prepareBorderFromCustomAdded(e,t,o,i){const s=this.hot.countRows(),r=this.hot.countCols();if(e>=s||t>=r)return;let a=Lv(e,t);o&&(a=Ale(a,o),O(this.hot.selection.highlight.customSelections,l=>{if(a.id===l.settings.id)return Object.assign(l.settings,o),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,t,"borders",wg(a)),this.insertBorderIntoSettings(a,i)}prepareBorderFromCustomAddedRange(e,t){const o=Math.min(e.to.row,this.hot.countRows()-1),i=Math.min(e.to.col,this.hot.countCols()-1);Re(e.from.row,o,s=>{Re(e.from.col,i,r=>{const a=Lv(s,r);let l=0;s===e.from.row&&tn(t,"top")&&(l+=1,a.top=t.top),s===e.to.row&&tn(t,"bottom")&&(l+=1,a.bottom=t.bottom),r===e.from.col&&tn(t,"start")&&(l+=1,a.start=t.start),r===e.to.col&&tn(t,"end")&&(l+=1,a.end=t.end),l>0&&(this.hot.setCellMeta(s,r,"borders",wg(a)),this.insertBorderIntoSettings(a))})})}removeAllBorders(e,t){const o=kU(e,t);this.spliceBorder(o),this.clearBordersFromSelectionSettings(o),this.clearNullCellRange(),this.hot.removeCellMeta(e,t,"borders")}setBorder(e,t,o,i){let s=this.hot.getCellMeta(e,t).borders;!s||s.border===void 0?s=Lv(e,t):s=Pv(s),i?(s[o]=Za(),this.countHide(s)===4?this.removeAllBorders(e,t):(this.checkCustomSelectionsFromContextMenu(s,o,i)||this.insertBorderIntoSettings(s),this.hot.setCellMeta(e,t,"borders",wg(s)))):(s[o]=dp(),this.checkCustomSelectionsFromContextMenu(s,o,i)||this.insertBorderIntoSettings(s),this.hot.setCellMeta(e,t,"borders",wg(s)))}prepareBorder(e,t,o){O(e,({start:i,end:s})=>{if(i.row===s.row&&i.col===s.col)t==="noBorders"?this.removeAllBorders(i.row,i.col):this.setBorder(i.row,i.col,t,o);else switch(t){case"noBorders":Re(i.col,s.col,r=>{Re(i.row,s.row,a=>{this.removeAllBorders(a,r)})});break;case"top":Re(i.col,s.col,r=>{this.setBorder(i.row,r,t,o)});break;case"bottom":Re(i.col,s.col,r=>{this.setBorder(s.row,r,t,o)});break;case"start":Re(i.row,s.row,r=>{this.setBorder(r,i.col,t,o)});break;case"end":Re(i.row,s.row,r=>{this.setBorder(r,s.col,t,o)});break}})}createCustomBorders(e){O(e,t=>{const o=Pv(t);t.range?this.prepareBorderFromCustomAddedRange(t.range,o):this.prepareBorderFromCustomAdded(t.row,t.col,o)})}countHide(e){const{top:t,bottom:o,start:i,end:s}=e;return Fi([t,o,i,s],(a,l)=>{let h=a;return l&&l.hide&&(h+=1),h},0)}clearBordersFromSelectionSettings(e){const t=Mt(this.hot.selection.highlight.customSelections,o=>o.settings.id).indexOf(e);t>-1&&this.hot.selection.highlight.customSelections[t].clear()}clearNullCellRange(){O(this.hot.selection.highlight.customSelections,(e,t)=>{if(e.cellRange===null)return this.hot.selection.highlight.customSelections[t].destroy(),this.hot.selection.highlight.customSelections.splice(t,1),!1})}hideBorders(){O(this.savedBorders,e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange()})}spliceBorder(e){const t=Mt(this.savedBorders,o=>o.id).indexOf(e);t>-1&&this.savedBorders.splice(t,1)}checkSavedBorders(e){let t=!1;return this.countHide(e)===4?(this.spliceBorder(e.id),t=!0):O(this.savedBorders,(i,s)=>{if(e.id===i.id)return this.savedBorders[s]=e,t=!0,!1}),t}checkCustomSelectionsFromContextMenu(e,t,o){let i=!1;return O(this.hot.selection.highlight.customSelections,s=>{if(e.id===s.settings.id){const r=this.hot.view._wt.selectionManager.getBorderInstances(s);return O(r,a=>{a.toggleHiddenClass(t,o)}),i=!0,!1}}),i}checkCustomSelections(e,t,o){const i=this.countHide(e);let s=!1;return i===4?(this.removeAllBorders(e.row,e.col),s=!0):O(this.hot.selection.highlight.customSelections,r=>{if(e.id===r.settings.id){if(r.visualCellRange=t,r.commit(),o){const a=this.hot.view._wt.selectionManager.getBorderInstances(r);O(a,l=>{l.changeBorderStyle(o,e)})}return s=!0,!1}}),s}changeBorderSettings(){const e=this.hot.getSettings()[dC];if(Array.isArray(e)){const t=Jn(e);this.checkSettingsCohesion(t),t.length||(this.savedBorders=t),this.createCustomBorders(t)}else e!==void 0&&this.createCustomBorders(this.savedBorders)}checkSettingsCohesion(e){const t=Ole(e),o=Dle(e);t&&o&&Y('The "left"/"right" and "start"/"end" options should not be used together. Please use only the option "start"/"end".'),this.hot.isRtl()&&t&&Y('The "left"/"right" properties are not supported for RTL. Please use option "start"/"end".'),Wv(this,dD,Yle).call(this,e)}destroy(){super.destroy()}constructor(...e){super(...e),$v(this,dD),$v(this,uD),$v(this,fD),this.savedBorders=[]}}function Yle(n){n.forEach(e=>{Object.keys(e).forEach(t=>{const o=e[t].style;ee(o)&&!cD.includes(o)?(Ie(`The "${o}" border style is not supported. Please use one of the following styles: ${cD.join(", ")}.
237
- The border style will be ignored.`),delete e[t].style):ee(o)&&o==="solid"&&delete e[t].style})})}function Gle(n){this.hot.getSettings()[dC]&&n.items.push({name:"---------"},{key:"borders",name(){return this.getTranslatedPhrase(gT)},disabled(){const e=this.getSelectedRangeActive();return!e||e.isSingleHeader()?!0:this.selection.isSelectedByCorner()},submenu:{items:[Ble(this),Fle(this),Lle(this),Wle(this),$le(this)]}})}function jle(){this.changeBorderSettings()}const up="dataProvider",qle=950,H_=10,Kle={rowId:void 0,fetchRows:void 0,onRowsCreate:void 0,onRowsUpdate:void 0,onRowsRemove:void 0},R0={rowId:n=>typeof n=="string"||_e(n),fetchRows:n=>_e(n),onRowsCreate:n=>_e(n),onRowsUpdate:n=>_e(n),onRowsRemove:n=>_e(n)},Xle="DataProvider fetch superseded by a newer request",gD=Object.freeze({page:1,pageSize:H_,sort:null,filters:null}),TU=new Set(["edit",void 0,"CopyPaste.paste","CopyPaste.cut","Autofill.fill","ContextMenu.clearColumn","DataProvider.revert"]),pD="DataProvider: cannot send row update because `rowId` resolves to null or undefined for that row.";function Zle(n){return`DataProvider: cannot remove row at visual index ${n} because \`rowId\` resolves to null or undefined.`}const Qle="DataProvider: `updateRows` requires every entry to include a non-null `id`.",Jle="DataProvider: `removeRows` requires every id to be non-null.";function EM(n,e,t){if(n.runHooks("beforeRowsMutation",e,t)===!1)return!1}function xU(n,e,t){n.runHooks("afterRowsMutation",e,t)}function cf(n,e,t,o){n.runHooks("afterRowsMutationError",e,t,o)}function ehe(n,e){const t=n.tail.then(e);return n.tail=t.catch(()=>{}),t}function the(n,e){if(e!=null){if(_e(e))return e(n);if(typeof e=="string")return kC(n,e)}}function A_(n,e,t){return the(n.getSourceDataAtRow(n.toPhysicalRow(t)),e)}function dy(n){return n==null}function MU(n,e,t){for(let o=0;o<n.countRows();o+=1)if(A_(n,e,o)===t)return o;return-1}function nhe(n,e,t,o){const i=[],s=()=>n.countRows(),r=(a,l)=>{for(let h=0;h<l;h+=1){const c=a+h;if(c>=0&&c<s()){const d=A_(n,e,c);dy(d)&&Y(Zle(c)),i.push(d)}}};if(Array.isArray(t))t.forEach(([a,l])=>{const h=a==null?Math.max(0,s()-(l??1)):Math.max(0,a);r(h,l??1)});else{const a=typeof o=="number"&&o>=1?o:1,l=t==null?Math.max(0,s()-a):Math.max(0,t);r(l,a)}return i}function ohe(n,e){const t=e[0][0],o=n.getSourceDataAtRow(n.toPhysicalRow(t)),i=o&&typeof o=="object"&&!Array.isArray(o),s={};e.forEach(([,a,,l])=>{const h=typeof a=="number"?a:n.propToCol(a),c=i?n.colToProp(h):h;s[c]=l});let r;return Array.isArray(o)?(r=[...o],e.forEach(([,a,,l])=>{const h=typeof a=="number"?a:n.propToCol(a);r[h]=l})):i?r={...o,...s}:r={...s},{changesObj:s,rowData:r}}function ihe(n,e){e?.length&&n.batch(()=>{e.forEach(([t,o,i])=>{n.setDataAtRowProp(t,o,i,"DataProvider.revert")})})}function IU(n,e,t){const o=Object.entries(t);return o.length===0?Promise.resolve(!0):new Promise(i=>{let s=o.length,r=!0;const a=()=>{s-=1,s===0&&i(r)};o.forEach(([l,h])=>{const c=n.propToCol(l);if(c===void 0||c<0){a();return}const d=n.getCellMeta(e,c);if(!n.getCellValidator(d)){a();return}n.validateCell(h,d,u=>{u===!1&&d.allowInvalid===!1&&(r=!1),a()},"DataProvider.updateRows")})})}function she(n,e,t){return!n||!e?.length||t==="DataProvider.revert"||!TU.has(t)}function rhe(n,e){const t=e.filter(o=>o[2]!==o[3]);return t.length===0?[]:t.filter(o=>{const i=n.propToCol(o[1]);return i===void 0||i<0?!1:n.getCellMeta(o[0],i).valid!==!1})}function ahe(n,e,t){return t.map(o=>{const i=MU(n,e,o.id);let s;return i>=0?s=n.getSourceDataAtRow(n.toPhysicalRow(i)):o.rowData!==void 0?s=o.rowData:s={},{id:o.id,changes:o.changes,rowData:s&&typeof s=="object"?s:{}}})}async function lhe(n,e,t,o={}){const i=e.getOnRowsUpdate();if(!_e(i))return;const s={rows:t},{revertOptimistic:r}=o,{onRequestFailed:a}=e;try{await i(t)}catch(l){cf(n,"update",l,s),e.logError("Row update failed:",l),_e(r)&&r(),n.render(),a?.("update",l);return}try{xU(n,"update",s),await e.fetchData()}catch(l){cf(n,"update",l,s),e.logError("Data reload failed:",l),_e(r)&&r(),n.render()}}async function hhe(n,e,t){const{getRowIdOption:o,commitRowsUpdate:i}=e,s={rows:t};if(EM(n,"update",s)===!1)return;const r=o();if((await Promise.all(t.map(async l=>{const h=MU(n,r,l.id);return h<0?!0:IU(n,h,l.changes)}))).some(l=>!l)){cf(n,"update",new Error("Row update validation failed"),s),il("Row update failed: validation failed for one or more cells");return}await i(t)}async function che(n,e,t){const{getRowIdOption:o,commitRowsUpdate:i}=e,s=new Map;t.forEach(u=>{const f=u[0];s.has(f)||s.set(f,[]),s.get(f).push(u)});const r=[...s.keys()].sort((u,f)=>u-f),a=o(),l=r.map(u=>{const{changesObj:f,rowData:p}=ohe(n,s.get(u));return{id:A_(n,a,u),changes:f,rowData:p}}),h={rows:l},c=()=>ihe(n,t);if(l.some(u=>dy(u.id))){c(),cf(n,"update",new Error(pD),h),il("Row update failed:",pD),n.render();return}if(EM(n,"update",h)===!1){c();return}if((await Promise.all(r.map((u,f)=>IU(n,u,l[f].changes)))).some(u=>!u)){c(),cf(n,"update",new Error("Row update validation failed"),h),il("Row update failed: validation failed for one or more cells"),n.render();return}await i(l,{revertOptimistic:c})}function dhe(n,e,t,o,i){const{enqueueMutation:s,runBeforeRowsMutation:r,runAfterRowsMutation:a,runAfterRowsMutationError:l,logError:h,onRequestFailed:c}=n;return s(async()=>{if(r(e,t)===!1)return;const d=e==="create"?"Row create":"Row remove";try{await o()}catch(u){l(e,u,t),h(`${d} failed:`,u),c?.(e,u);return}try{a(e,t),await i()}catch(u){l(e,u,t),h("Data reload failed:",u)}})}function uhe(n,e,t,o){const{hot:i,getOnRowsCreate:s,getRowId:r,createRows:a}=n;if(!_e(s()))return;const l=i.countSourceRows();if(i.getSettings().maxRows===l)return;const h=e==="insert_row_below"?"below":"above",c=t??(h==="below"?l:0);return a({position:h,referenceRowId:c>=0?r(c):void 0,rowsAmount:typeof o=="number"&&o>=1?o:1}),!1}function fhe(n,e,t){const{hot:o,getOnRowsRemove:i,getRowIdOption:s,removeRows:r}=n;if(!_e(i()))return;const a=nhe(o,s(),e,t);if(a.length!==0)return r(a),!1}function ghe(n,e,t,o){if(e==="insert_row_above"||e==="insert_row_below")return uhe(n,e,t,o);if(e==="remove_row")return fhe(n,t,o)}const phe="filters";function mhe(n){return n===null?null:n.map(e=>({prop:e.prop,operation:e.operation,conditions:(e.conditions||[]).map(t=>({name:t.name,args:Array.isArray(t.args)?[...t.args]:[]}))}))}function HU(n,e){if(!Array.isArray(e)||e.length===0)return null;const t=[];for(let o=0;o<e.length;o++){const i=e[o],s=n.toVisualColumn(i.column),r=n.colToProp(s);r!=null&&t.push({prop:String(r),operation:i.operation,conditions:i.conditions.map(a=>({name:a.name,args:Array.isArray(a.args)?[...a.args]:[]}))})}return t.length===0?null:t}function whe(n,e){if(e==null)return[];if(!Array.isArray(e)||e.length===0)return[];const t=[];for(let o=0;o<e.length;o++){const i=e[o],s=n.propToCol(i.prop);if(s==null||s<0)continue;const r=n.toPhysicalColumn(s);t.push({column:r,operation:i.operation,conditions:(i.conditions||[]).map(a=>({name:a.name,args:Array.isArray(a.args)?[...a.args]:[]}))})}return t}function bhe(n,e,t){if(!_e(t()))return;const o=n.getPlugin(phe);if(!o||!o.enabled)return;const i=HU(n,o.exportConditions());e.filters=i??null}function Che(n,e){const{hot:t,hasFetchFn:o,applyFiltersAndRefetch:i}=n;if(!o())return;const s=HU(t,e);return i(s),!1}const wm="pagination";function yhe(n,e){if(!n?.enabled)return;const t=typeof n.getCurrentPageSize=="function"?n.getCurrentPageSize():void 0,o=n.getSetting("pageSize"),i=n.getSetting("initialPage"),s=typeof n.getCurrentPage=="function"?n.getCurrentPage():void 0;typeof t=="number"?e.pageSize=t:typeof o=="number"&&(e.pageSize=o),typeof s=="number"&&s>=1?e.page=s:typeof i=="number"&&i>=1&&(e.page=i)}function _he(n,e){return n==="auto"||typeof n!="number"||!Number.isFinite(n)||n<1?e:n}function She(n,e){yhe(n.getPlugin(wm),e)}function vhe(n,e,t=H_){const{page:o,pageSize:i}=n,s=typeof i=="number"&&i>=1?i:t;return(o-1)*s+e}function Rhe(n,e,t){const{hot:o,getQueryPage:i,goToPage:s}=n;o.getPlugin(wm)?.enabled&&t!==i()&&s(t).catch(()=>{const a=o.getPlugin(wm);a?.enabled&&a.revertPageTo(e)})}function Ehe(n,e,t){const{hot:o,getQueryPage:i,getQueryPageSize:s,setPageSize:r}=n;if(!o.getPlugin(wm)?.enabled)return;const l=_he(t,H_);l===s()&&i()===1||r(l).catch(()=>{const h=o.getPlugin(wm);h?.enabled&&h.revertPageSizeTo(e)})}const AU="columnSorting";function khe(n,e){if(n==null||typeof n!="object")return null;if(typeof n.column=="number"&&typeof e=="function")return{prop:e(n.column),order:n.sortOrder};const t=n.order??n.sortOrder;return typeof n.prop=="string"&&(t==="asc"||t==="desc")?{prop:n.prop,order:t}:null}function The(n,e){if(n==null||typeof n!="object"||typeof n.prop!="string")return null;const t=n.order??n.sortOrder;if(t!=="asc"&&t!=="desc"||typeof e!="function")return null;const o=e(n.prop);return typeof o!="number"?null:{column:o,sortOrder:t}}function xhe(n,e,t){if(!n?.enabled||typeof t!="function")return;const o=n.getSortConfig(),i=Array.isArray(o)&&o.length>0?o[0]:o;i&&typeof i=="object"&&typeof i.column=="number"?e.sort={prop:t(i.column),order:i.sortOrder}:e.sort=null}function Mhe(n,e){xhe(n.getPlugin(AU),e,t=>n.colToProp(t))}function Ihe(n,e){n.sort=khe(n.sort,t=>e.colToProp(t))}function Hhe(n,e){const t=The(e,o=>n.propToCol(o));return t&&typeof t=="object"&&"column"in t?t:[]}function Ahe(n,e,t,o){const{hot:i,hasFetchFn:s,applyQueryParametersFromPlugins:r,fetchData:a}=n;return!s()||!o?void 0:(i.getPlugin(AU).setSortConfig(t),r(),a({skipLoading:!0}),!1)}function Ohe(n){return!n||typeof n!="object"||Array.isArray(n)?!1:Object.keys(R0).every(e=>R0[e](n[e]))}function Dhe(n){return typeof n=="string"&&/^\d{3}$/.test(n.trim())}function Ku(n,e){if(typeof e=="string"){const t=e.trim();t&&n.push(t)}}function mD(n,e){!n||typeof n!="object"||Array.isArray(n)||(Ku(e,n.message),Ku(e,n.error),typeof n.detail=="string"&&Ku(e,n.detail))}function Nhe(n){const e=[];if(n==null)return"Unknown error";if(typeof n=="string")return n.trim()||"Unknown error";if(typeof n!="object")return String(n);const t=n.response?.data??n.data??n.body;if(t!=null)if(typeof t=="string")try{mD(JSON.parse(t),e)}catch{Ku(e,t)}else mD(t,e);typeof n.error=="string"&&Ku(e,n.error),typeof n.message=="string"&&Ku(e,n.message);const o=e.find(i=>!Dhe(i));return o||(e.length>0?e[0]:String(n))}function Phe(n,e,t){const o=typeof e=="number"&&e>=1?e:H_,i=Math.max(1,Math.ceil(t/o));return Math.max(1,Math.min(n,i))}function OU(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Lhe(n,e){return e.get?e.get.call(n):e.value}function Whe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function DU(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function $t(n,e){var t=DU(n,e,"get");return Lhe(n,t)}function Vi(n,e,t){OU(n,e),e.set(n,t)}function so(n,e,t){var o=DU(n,e,"set");return Whe(n,o,t),t}function We(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Mo(n,e){OU(n,e),e.add(n)}R2("dataProvider",["manualRowMove","manualColumnMove","trimRows","multiColumnSorting"]);var qo=new WeakMap,Zr=new WeakMap,E0=new WeakMap,Rf=new WeakSet,$d=new WeakSet,fp=new WeakSet,Fv=new WeakSet,gp=new WeakSet,Bv=new WeakSet,xu=new WeakSet,Vv=new WeakSet,NU=new WeakSet,wD=new WeakSet,bD=new WeakSet,zv=new WeakSet,Uv=new WeakSet,uC=new WeakSet,uy=new WeakSet,Yv=new WeakSet,Gv=new WeakSet,ob=new WeakMap,jv=new WeakMap,qv=new WeakMap,Kv=new WeakMap,Xv=new WeakMap,Zv=new WeakMap,Qv=new WeakMap,Jv=new WeakMap,eR=new WeakMap,tR=new WeakMap;let $he=class extends at{static get PLUGIN_KEY(){return up}static get PLUGIN_PRIORITY(){return qle}static get SETTING_KEYS(){return[up]}static get DEFAULT_SETTINGS(){return Kle}static get SETTINGS_VALIDATORS(){return R0}isEnabled(){return!!this.hot.getSettings()[up]}enablePlugin(){this.enabled||(We(this,Vv,_D).call(this),this.addHook("hasExternalDataSource",$t(this,ob)),this.addHook("afterInit",()=>$t(this,jv).call(this)),this.addHook("modifyRowHeader",(...e)=>$t(this,Qv).call(this,...e)),this.addHook("beforeColumnSort",(...e)=>$t(this,Zv).call(this,...e)),this.addHook("beforeUndoStackChange",(...e)=>$t(this,Jv).call(this,...e)),this.addHook("afterChange",(...e)=>$t(this,eR).call(this,...e)),this.addHook("beforeAlter",(...e)=>$t(this,tR).call(this,...e)),this.addHook("afterPageChange",(...e)=>$t(this,qv).call(this,...e)),this.addHook("afterPageSizeChange",(...e)=>$t(this,Kv).call(this,...e)),this.addHook("beforeFilter",(...e)=>$t(this,Xv).call(this,...e)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.hot.view&&this.fetchData(),super.updatePlugin()}disablePlugin(){We(this,Uv,vD).call(this),so(this,qo,{...gD}),super.disablePlugin()}getQueryParameters(){return We(this,xu,pp).call(this,$t(this,qo))}getRowId(e){return A_(this.hot,We(this,$d,bg).call(this),e)}async fetchData(e={}){const t=We(this,fp,fC).call(this);if(!_e(t))return this.hot.render(),null;const o=We(this,wD,Bhe).call(this,e),i=We(this,bD,Vhe).call(this),{signal:s}=i;if(this.hot.runHooks("beforeDataProviderFetch",o)===!1)return so(this,Zr,null),this.hot.render(),null;const r=We(this,xu,pp).call(this,o);try{const a=await t(r,{signal:s});if(s.aborted)return We(this,zv,SD).call(this,o,void 0),null;const l=Array.isArray(a?.rows)?a.rows:[],h=typeof a?.totalRows=="number"&&a.totalRows>=0?a.totalRows:l.length,c=We(this,xu,pp).call(this,o),d=Phe(c.page,c.pageSize,h);if(d!==c.page)return this.fetchData({...e,page:d,skipLoading:e.skipLoading});so(this,qo,c),this.hot.loadData(l,up);const u=Hhe(this.hot,c.sort??null),f=whe(this.hot,c.filters??null);return this.hot.runHooks("afterDataProviderFetch",{...a,rows:l,totalRows:h,queryParameters:c,columnSortConfig:u,filtersConditionsStack:f}),this.hot.render(),{rows:l,totalRows:h}}catch(a){if(s.aborted||a?.name==="AbortError")return We(this,zv,SD).call(this,o,a),null;throw this.hot.runHooks("afterDataProviderFetchError",a,We(this,xu,pp).call(this,o)),We(this,uy,kM).call(this,"fetch",a),a}finally{$t(this,Zr)===i&&so(this,Zr,null)}}async createRows(e={}){const t=We(this,Fv,CD).call(this);if(!_e(t))return Promise.resolve();const o={position:e.position??"below",referenceRowId:e.referenceRowId,rowsAmount:e.rowsAmount??1},i={rowsCreate:o};return We(this,Gv,ED).call(this,"create",i,()=>t(o),()=>this.fetchData({skipLoading:!0}))}async removeRows(e){const t=We(this,Bv,yD).call(this);if(!_e(t))return Promise.resolve();const o=Array.isArray(e)?e:[e];o.forEach(s=>{dy(s)&&Y(Jle)});const i={rowsRemove:o};return We(this,Gv,ED).call(this,"remove",i,()=>t(o),async()=>{const s=$t(this,qo).page,r=this.hot.countRows();if(o.length>=r&&r>=1&&s>1){await this.fetchData({page:s-1,skipLoading:!0});return}(await this.fetchData({skipLoading:!0}))?.rows.length===0&&s>1&&await this.fetchData({page:s-1,skipLoading:!0})})}async updateRows(e){if(!_e(We(this,gp,gC).call(this))||!Array.isArray(e)||e.length===0)return;e.forEach(o=>{dy(o.id)&&Y(Qle)});const t=ahe(this.hot,We(this,$d,bg).call(this),e);return We(this,uC,k0).call(this,()=>hhe(this.hot,{getRowIdOption:()=>We(this,$d,bg).call(this),commitRowsUpdate:o=>We(this,Yv,RD).call(this,o)},t))}destroy(){We(this,Uv,vD).call(this),super.destroy()}constructor(e){super(e),Mo(this,Rf),Mo(this,$d),Mo(this,fp),Mo(this,Fv),Mo(this,gp),Mo(this,Bv),Mo(this,xu),Mo(this,Vv),Mo(this,NU),Mo(this,wD),Mo(this,bD),Mo(this,zv),Mo(this,Uv),Mo(this,uC),Mo(this,uy),Mo(this,Yv),Mo(this,Gv),Vi(this,qo,{writable:!0,value:void 0}),Vi(this,Zr,{writable:!0,value:void 0}),Vi(this,E0,{writable:!0,value:void 0}),Vi(this,ob,{writable:!0,value:void 0}),Vi(this,jv,{writable:!0,value:void 0}),Vi(this,qv,{writable:!0,value:void 0}),Vi(this,Kv,{writable:!0,value:void 0}),Vi(this,Xv,{writable:!0,value:void 0}),Vi(this,Zv,{writable:!0,value:void 0}),Vi(this,Qv,{writable:!0,value:void 0}),Vi(this,Jv,{writable:!0,value:void 0}),Vi(this,eR,{writable:!0,value:void 0}),Vi(this,tR,{writable:!0,value:void 0}),so(this,qo,{...gD}),so(this,Zr,null),so(this,E0,{tail:Promise.resolve()}),so(this,ob,()=>Ohe(this.hot.getSettings().dataProvider)),so(this,jv,()=>{this.fetchData()}),so(this,qv,(t,o)=>{Rhe({hot:this.hot,getQueryPage:()=>$t(this,qo).page,goToPage:i=>this.fetchData({page:i})},t,o)}),so(this,Kv,(t,o)=>{Ehe({hot:this.hot,getQueryPage:()=>$t(this,qo).page,getQueryPageSize:()=>$t(this,qo).pageSize,setPageSize:i=>this.fetchData({pageSize:i,page:1})},t,o)}),so(this,Xv,t=>Che({hot:this.hot,hasFetchFn:()=>_e(We(this,fp,fC).call(this)),applyFiltersAndRefetch:o=>{$t(this,qo).filters=o??null,$t(this,qo).page=1,this.fetchData()}},t)),so(this,Zv,(t,o,i)=>Ahe({hot:this.hot,hasFetchFn:()=>_e(We(this,fp,fC).call(this)),applyQueryParametersFromPlugins:()=>We(this,Vv,_D).call(this),fetchData:s=>this.fetchData(s)},t,o,i)),so(this,Qv,t=>vhe($t(this,qo),t)),so(this,Jv,(t,o)=>{if(_e(We(this,gp,gC).call(this))&&TU.has(o))return!1}),so(this,eR,(t,o)=>{if(she(_e(We(this,gp,gC).call(this)),t,o))return;const i=rhe(this.hot,t);i.length!==0&&We(this,uC,k0).call(this,()=>che(this.hot,{getRowIdOption:()=>We(this,$d,bg).call(this),commitRowsUpdate:(s,r)=>We(this,Yv,RD).call(this,s,r)},i))}),so(this,tR,(t,o,i)=>ghe({hot:this.hot,getOnRowsCreate:()=>We(this,Fv,CD).call(this),getOnRowsRemove:()=>We(this,Bv,yD).call(this),getRowIdOption:()=>We(this,$d,bg).call(this),getRowId:s=>this.getRowId(s),createRows:s=>this.createRows(s),removeRows:s=>this.removeRows(s)},t,o,i)),this.addHook("hasExternalDataSource",$t(this,ob))}};function tw(){const n=this.hot.getSettings()[up];return n&&typeof n=="object"?n:void 0}function bg(){const n=We(this,Rf,tw).call(this);return n?n.rowId:void 0}function fC(){const n=We(this,Rf,tw).call(this);return n&&_e(n.fetchRows)?n.fetchRows:void 0}function CD(){const n=We(this,Rf,tw).call(this);return n&&_e(n.onRowsCreate)?n.onRowsCreate:void 0}function gC(){const n=We(this,Rf,tw).call(this);return n&&_e(n.onRowsUpdate)?n.onRowsUpdate:void 0}function yD(){const n=We(this,Rf,tw).call(this);return n&&_e(n.onRowsRemove)?n.onRowsRemove:void 0}function pp(n){return{page:n.page,pageSize:n.pageSize,sort:n.sort===null?null:{...n.sort},filters:mhe(n.filters)}}function _D(){She(this.hot,$t(this,qo)),Mhe(this.hot,$t(this,qo)),bhe(this.hot,$t(this,qo),()=>We(this,fp,fC).call(this))}function Fhe(){if(!$t(this,Zr))return;const n=new Error(Xle);n.name="AbortError",$t(this,Zr).abort(n)}function Bhe(n){const e={...$t(this,qo),...n};return Ihe(e,this.hot),typeof e.page=="number"&&!Number.isNaN(e.page)&&(e.page=Math.max(1,e.page)),e}function Vhe(){We(this,NU,Fhe).call(this);const n=new AbortController;return so(this,Zr,n),n}function SD(n,e){const t=We(this,xu,pp).call(this,n);this.hot.runHooks("afterDataProviderFetchAbort",t,e)}function vD(){$t(this,Zr)?.abort(),so(this,Zr,null)}function k0(n){return ehe($t(this,E0),n)}function kM(n,e){const t=this.hot.getPlugin("notification");if(!t?.enabled)return;const o={fetch:mx,create:wx,update:bx,remove:Cx},i=this.hot.getTranslatedPhrase(o[n]??yx),s=Nhe(e);let r="";const a={variant:"error",title:i,message:s};n==="fetch"&&(a.duration=0,a.actions=[{label:this.hot.getTranslatedPhrase(_x),type:"primary",callback:()=>{r&&t.hide(r),this.fetchData()}}]),r=t.showMessage(a)}function RD(n,e={}){return lhe(this.hot,{getOnRowsUpdate:()=>We(this,gp,gC).call(this),fetchData:()=>this.fetchData({skipLoading:!0}),logError:il,onRequestFailed:(t,o)=>We(this,uy,kM).call(this,t,o)},n,e)}function ED(n,e,t,o){return dhe({enqueueMutation:i=>We(this,uC,k0).call(this,i),runBeforeRowsMutation:(i,s)=>EM(this.hot,i,s),runAfterRowsMutation:(i,s)=>xU(this.hot,i,s),runAfterRowsMutationError:(i,s,r)=>cf(this.hot,i,s,r),logError:il,onRequestFailed:(i,s)=>We(this,uy,kM).call(this,i,s)},n,e,t,o)}function zhe(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function kD(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Uhe(n,e){zhe(n,e),e.add(n)}const TD="dragToScroll",Yhe=100;var nR=new WeakSet;class Ghe extends at{static get PLUGIN_KEY(){return TD}static get PLUGIN_PRIORITY(){return Yhe}isEnabled(){return!!this.hot.getSettings()[TD]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",e=>kD(this,nR,xD).call(this,e)),this.addHook("afterOnCellCornerMouseDown",e=>kD(this,nR,xD).call(this,e)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.unregisterEvents(),super.disablePlugin()}setBoundaries(e={left:0,right:this.hot.rootWindow.innerWidth,top:0,bottom:this.hot.rootWindow.innerHeight}){this.boundaries=e}setCallback(e){this.callback=e}check(e,t){let o=0,i=0;t<this.boundaries.top?i=t-this.boundaries.top:t>this.boundaries.bottom&&(i=t-this.boundaries.bottom),e<this.boundaries.left?o=e-this.boundaries.left:e>this.boundaries.right&&(o=e-this.boundaries.right),this.callback(o,i)}listen(){this.listening=!0}unlisten(){this.listening=!1}isListening(){return this.listening}registerEvents(){const{rootWindow:e}=this.hot;let t=e;for(;t;)this.eventManager.addEventListener(t.document,"contextmenu",()=>this.unlisten()),this.eventManager.addEventListener(t.document,"mouseup",()=>this.unlisten()),this.eventManager.addEventListener(t.document,"mousemove",o=>this.onMouseMove(o)),t=yh(t)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){this.isListening()&&this.check(e.clientX,e.clientY)}destroy(){super.destroy()}constructor(...e){super(...e),Uhe(this,nR),this.boundaries=null,this.callback=null,this.listening=!1}}function xD(n){if(Xc(n))return;const e=this.hot.view._wt.wtOverlays.topOverlay.mainTableScrollableElement;this.setBoundaries(e!==this.hot.rootWindow?e.getBoundingClientRect():void 0),this.setCallback((t,o)=>{const i=e.scrollLeft??e.scrollX,s=e.scrollTop??e.scrollY;e.scroll(i+Math.sign(t)*50,s+Math.sign(o)*20)}),this.listen()}function PU(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jhe(n,e){return e.get?e.get.call(n):e.value}function qhe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function LU(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Khe(n,e){var t=LU(n,e,"get");return jhe(n,t)}function Xhe(n,e,t){PU(n,e),e.set(n,t)}function TM(n,e,t){var o=LU(n,e,"set");return qhe(n,o,t),t}function ws(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Hr(n,e){PU(n,e),e.add(n)}de.getSingleton().register("afterDropdownMenuDefaultOptions");de.getSingleton().register("beforeDropdownMenuShow");de.getSingleton().register("afterDropdownMenuShow");de.getSingleton().register("afterDropdownMenuHide");de.getSingleton().register("afterDropdownMenuExecute");const pC="dropdownMenu",Zhe=230,Vc="changeType",oR=pC;var bm=new WeakMap,xM=new WeakSet,MD=new WeakSet,T0=new WeakSet,ID=new WeakSet,HD=new WeakSet,AD=new WeakSet,OD=new WeakSet,DD=new WeakSet,ND=new WeakSet,PD=new WeakSet;class O_ extends at{static get PLUGIN_KEY(){return pC}static get PLUGIN_PRIORITY(){return Zhe}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Zm,Qm,Ae,ew,Ae,v_,Ae,Jm,Ae,ys]}isEnabled(){return this.hot.getSettings()[pC]}enablePlugin(){if(this.enabled)return;this.itemsFactory=new uU(this.hot,O_.DEFAULT_ITEMS),this.addHook("beforeOnCellMouseDown",(...o)=>ws(this,PD,sce).call(this,...o)),this.addHook("beforeViewportScrollHorizontally",(...o)=>ws(this,ND,ice).call(this,...o)),this.addHook("beforeDialogShow",()=>this.close());const e=this.hot.getSettings()[pC],t={items:this.itemsFactory.getItems(e)};this.registerEvents(),typeof e.callback=="function"&&this.commandExecutor.setCommonCallback(e.callback),this.registerShortcuts(),super.enablePlugin(),this.callOnPluginsReady(()=>{this.hot.runHooks("afterDropdownMenuDefaultOptions",t),this.itemsFactory.setPredefinedItems(t.items);const o=this.itemsFactory.getItems(e);this.menu&&this.menu.destroy(),this.menu=new vf(this.hot,{className:"htDropdownMenu",keepInViewport:!0,container:e.uiContainer||this.hot.rootPortalElement}),this.hot.runHooks("beforeDropdownMenuSetItems",o),this.menu.setMenuItems(o),this.menu.addLocalHook("beforeOpen",()=>ws(this,HD,ece).call(this)),this.menu.addLocalHook("afterOpen",()=>ws(this,AD,tce).call(this)),this.menu.addLocalHook("afterSubmenuOpen",i=>ws(this,OD,nce).call(this,i)),this.menu.addLocalHook("afterClose",()=>ws(this,DD,oce).call(this)),this.menu.addLocalHook("executeCommand",(...i)=>this.executeCommand.call(this,...i)),O(o,i=>this.commandExecutor.registerCommand(i.key,i))})}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"),t=()=>{const{highlight:o}=this.hot.getSelectedRangeActive(),i=o.isHeader()?this.hot.getCell(o.row,o.col,!0):null,s=o.isHeader()&&o.col>=0&&uf(i),r=o.isHeader()&&o.col>=0&&i&&Se(i,"hiddenHeader");if((s||r||o.isCell())&&o.col>=0){let l=s||r?o.row:-1;this.hot.selectColumns(o.col,o.col,l);const{from:h}=this.hot.getSelectedRangeActive(),c=S_(this.menu.container,this.hot.rootDocument);let d=this.hot.getCell(l,h.col,!0)?.querySelector(`.${Vc}`);if(!d)for(let f=-this.hot.view.getColumnHeadersCount();f<=-1;f++){const p=this.hot.getCell(f,h.col,!0)?.querySelector(`.${Vc}`);if(p){d=p,l=f,this.hot.selectColumns(o.col,o.col,l);break}}if(!d&&r)for(let f=h.col-1;f>=0;f--){const p=this.hot.getCell(l,f,!0);if(!p||Se(p,"hiddenHeader"))continue;const C=p?.querySelector(`.${Vc}`);C&&(d=C,this.hot.selectColumns(f,f,l));break}if(!d)return;const u=ws(this,T0,$U).call(this,d);this.open({left:u.left+c.left,top:u.bottom+c.top},{left:u.width,right:0,above:0,below:3}),this.menu.getNavigator().toFirstItem()}};e.addShortcuts([{keys:[["Shift","Alt","ArrowDown"],["Control/Meta","Enter"]],callback:t,runOnlyIf:()=>{const o=this.hot.getSelectedRangeActive()?.highlight,i=o?.isHeader()?this.hot.getCell(o.row,o.col,!0):null,s=o?.isHeader()&&o.col>=0&&i&&Se(i,"hiddenHeader");return o&&!this.menu.isOpened()&&o.isHeader()&&(this.hot.selection.isCellVisible(o)||s)},captureCtrl:!0,group:oR},{keys:[["Shift","Alt","ArrowDown"]],callback:t,runOnlyIf:()=>{const o=this.hot.getSelectedRangeActive()?.highlight;return o&&this.hot.selection.isCellVisible(o)&&o.isCell()&&!this.menu.isOpened()},group:oR}])}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(oR)}registerEvents(){this.eventManager.addEventListener(this.hot.rootElement,"click",e=>ws(this,MD,Qhe).call(this,e))}open(e,t={above:0,below:0,left:0,right:0}){this.menu?.isOpened()||(this.menu.open(),nt(t,(o,i)=>{this.menu.setOffset(i,o)}),this.menu.setPosition(e))}close(){this.menu?.close()}executeCommand(e,...t){this.commandExecutor.execute(e,...t)}setListening(e=!0){this.menu.isOpened()&&(e?this.menu.hotMenu.listen():this.menu.hotMenu.unlisten())}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}constructor(e){super(e),Hr(this,xM),Hr(this,MD),Hr(this,T0),Hr(this,ID),Hr(this,HD),Hr(this,AD),Hr(this,OD),Hr(this,DD),Hr(this,ND),Hr(this,PD),Xhe(this,bm,{writable:!0,value:void 0}),this.commandExecutor=new dU(this.hot),this.itemsFactory=null,this.menu=null,TM(this,bm,!1),this.hot.addHook("afterGetColHeader",(t,o)=>ws(this,ID,Jhe).call(this,t,o))}}function WU(n){n.getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Control/Meta","A"]],callback:()=>!1}])}function Qhe(n){if(Se(n.target,Vc)){const e=S_(this.menu.container,this.hot.rootDocument),t=ws(this,T0,$U).call(this,n.target);n.stopPropagation(),TM(this,bm,!1),this.open({left:t.left+e.left,top:t.bottom+e.top},{left:t.width,right:0,above:0,below:3})}}function $U(n){const e=n.getBoundingClientRect(),t=this.hot.rootWindow.getComputedStyle(n,"::before"),o=Number.parseFloat(t.width);if(Number.isFinite(o)&&e.width>=o&&e.height>=o){const i=e.left+(e.width-o)/2,s=e.top+(e.height-o)/2;return{top:s,left:i,right:i+o,bottom:s+o,width:o,height:o}}return{top:e.top,left:e.left,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}function Jhe(n,e){if(n<0||!uf(e))return;const t=e.querySelector(`.${Vc}`);if(this.enabled&&t)return;if(!this.enabled){t&&t.parentNode.removeChild(t);return}const o=this.hot.rootDocument.createElement("button");o.className=Vc,o.type="button",o.tabIndex=-1,this.hot.getSettings().ariaTags&&(fe(o,[hl(),Pi(" ")]),fe(e,[sF("menu")])),o.onclick=function(){return!1};const i=e.firstChild;if(!i)return;const s=i.querySelector(".colHeader");s?i.insertBefore(o,s.nextSibling):i.appendChild(o)}function ece(){this.hot.runHooks("beforeDropdownMenuShow",this)}function tce(){this.hot.runHooks("afterDropdownMenuShow",this),ws(this,xM,WU).call(this,this.menu)}function nce(n){ws(this,xM,WU).call(this,n)}function oce(){this.hot.listen(),this.hot.runHooks("afterDropdownMenuHide",this)}function ice(n){return Khe(this,bm)?null:n}function sce(n){Se(n.target,Vc)&&TM(this,bm,!0)}O_.SEPARATOR={name:Ae};class FU{setOptions(e){if(e&&"columnHeaders"in e&&!("colHeaders"in e)){this.options={...e,colHeaders:e.columnHeaders};return}this.options=e}_extractDataMatrix(e){const{startRow:t,startCol:o,endRow:i,endCol:s}=this._getDataRange(),r=this.options,a=[];for(let l=t;l<=i;l++){if(r.exportHiddenRows===!1&&this._isHiddenRow(l))continue;const h=[];for(let c=o;c<=s;c++)r.exportHiddenColumns===!1&&this._isHiddenColumn(c)||h.push(e(l,c));a.push(h)}return a}getData(){return this._extractDataMatrix((e,t)=>this.hot.getDataAtCell(e,t))}getRowHeaders(){const e=[];if(this.options.rowHeaders){const{startRow:t,endRow:o}=this._getDataRange(),i=this.hot.getRowHeader();for(let s=t;s<=o;s++)this.options.exportHiddenRows===!1&&this._isHiddenRow(s)||e.push(i[s])}return e}getColumnHeaders(){const e=[];if(this.options.colHeaders){const{startCol:t,endCol:o}=this._getDataRange(),i=this.hot.getColHeader();for(let s=t;s<=o;s++)this.options.exportHiddenColumns===!1&&this._isHiddenColumn(s)||e.push(i[s])}return e}_getDataRange(){const e=this.hot.countCols()-1,t=this.hot.countRows()-1;let[o=0,i=0,s=t,r=e]=this.options.range;return o=Math.max(o,0),i=Math.max(i,0),s=Math.min(s,t),r=Math.min(r,e),{startRow:o,startCol:i,endRow:s,endCol:r}}getSourceData(){return this._extractDataMatrix((e,t)=>this.hot.getSourceDataAtCell(e,t))}getExcludedHiddenRows(){const e=new Set;if(this.options.exportHiddenRows!==!1)return e;const{startRow:t,endRow:o}=this._getDataRange();for(let i=t;i<=o;i++)this._isHiddenRow(i)&&e.add(this.hot.toPhysicalRow(i));return e}getExcludedHiddenColumns(){const e=new Set;if(this.options.exportHiddenColumns!==!1)return e;const{startCol:t,endCol:o}=this._getDataRange();for(let i=t;i<=o;i++)this._isHiddenColumn(i)&&e.add(this.hot.toPhysicalColumn(i));return e}getHiddenRowDataIndices(){if(this.options.exportHiddenRows!=="hide")return[];const{startRow:e,endRow:t}=this._getDataRange(),o=[];let i=0;for(let s=e;s<=t;s++)this._isHiddenRow(s)&&o.push(i),i+=1;return o}getHiddenColumnDataIndices(){if(this.options.exportHiddenColumns!=="hide")return[];const{startCol:e,endCol:t}=this._getDataRange(),o=[];let i=0;for(let s=e;s<=t;s++)this._isHiddenColumn(s)&&o.push(i),i+=1;return o}getFormulasSeparator(){const e=this.hot.getPlugin("formulas");return!e||!e.isEnabled()?",":e.engine?.getConfig()?.functionArgSeparator??","}getCellsMeta(){return this._extractDataMatrix((e,t)=>this.hot.getCellMeta(e,t))}getCellElements(){return this._extractDataMatrix((e,t)=>this.hot.getCell(e,t))}getMergeCells(){const{startRow:e,startCol:t,endRow:o,endCol:i}=this._getDataRange(),s=this.hot.getPlugin("mergeCells");if(!s||!s.isEnabled())return[];const r=s.mergedCellsCollection.mergedCells,a=[],l=this.options.exportHiddenRows===!1,h=this.options.exportHiddenColumns===!1,c=u=>!l||!this._isHiddenRow(u),d=u=>!h||!this._isHiddenColumn(u);return r.forEach(u=>{const f=u.row+u.rowspan-1,p=u.col+u.colspan-1;if(u.row<e||f>o||u.col<t||p>i||!c(u.row)||!d(u.col))return;const C=this._countVisibleBefore(u.row,e,c),y=this._countVisibleBefore(u.col,t,d),_=this._countVisibleBefore(f+1,u.row,c),T=this._countVisibleBefore(p+1,u.col,d);_<=1&&T<=1||a.push({row:C,col:y,rowspan:_,colspan:T})}),a}getColumnsWidths(){const{startCol:e,endCol:t}=this._getDataRange(),o=this.options,i=[];for(let s=e;s<=t;s++){if(o.exportHiddenColumns===!1&&this._isHiddenColumn(s))continue;const r=this._isHiddenColumn(s)?this._getNaturalColWidth(s):this.hot.getColWidth(s);i.push(r)}return i}getRowsHeights(){const{startRow:e,endRow:t}=this._getDataRange(),o=this.options,i=[];for(let s=e;s<=t;s++){if(o.exportHiddenRows===!1&&this._isHiddenRow(s))continue;const r=this._isHiddenRow(s)?this._getNaturalRowHeight(s):this.hot.getRowHeight(s);i.push(r)}return i}getFrozenRows(){return this.hot.getSettings().fixedRowsTop||0}getFrozenColumns(){return this.hot.getSettings().fixedColumnsStart||0}getNestedColumnHeaders(){const e=this.hot.getPlugin("nestedHeaders");if(!e||!e.isEnabled())return null;const t=e.getLayersCount(),{startCol:o,endCol:i}=this._getDataRange(),r=!!this.options.exportHiddenColumns,a=[];for(let l=0;l<t;l++){const h=[];let c=o;for(;c<=i;){if(!r&&this._isHiddenColumn(c)){c+=1;continue}if(r){const d=e.getStateManager().getHeaderTreeNodeData(l,c);if(!d||d.columnIndex===c){const u=d?.origColspan??1,f=Math.min(u,i-c+1),p=(d?.headerClassNames??[]).join(" ");h.push({label:d?.label??"",colspan:f,className:p}),c+=u}else h.push({label:"",colspan:1,className:""}),c+=1}else{const d=e.getHeaderSettings(l,c);if(!d||d.isRoot){const u=d?.colspan??1;let f=0;for(let C=c;C<c+u&&C<=i;C++)this._isHiddenColumn(C)||(f+=1);const p=(d?.headerClassNames??[]).join(" ");h.push({label:d?.label??"",colspan:f,className:p}),c+=u}else h.push({label:"",colspan:1,className:""}),c+=1}}a.push(h)}return a}getColumnHeadersClassNames(){if(!this.options.colHeaders)return[];const{startCol:e,endCol:t}=this._getDataRange(),o=this.options,i=[];for(let s=e;s<=t;s++)o.exportHiddenColumns===!1&&this._isHiddenColumn(s)||i.push(this.hot.getColumnMeta(s).headerClassName||"");return i}getLayoutDirection(){return this.hot.getSettings().layoutDirection==="rtl"?"rtl":"ltr"}getColumnSummaries(){const e=this.hot.getPlugin("columnSummary");if(!e||!e.isEnabled())return[];const{startRow:t,startCol:o,endRow:i,endCol:s}=this._getDataRange(),r=e.endpoints.getAllEndpoints(),a=new Set;r.forEach(h=>{const c=this._physicalRowToDataIndex(h.destinationRow,t,i);c!==null&&a.add(c)});const l=[];return r.forEach(h=>{const c=this._transformEndpointToSummary(h,t,i,o,s,a);c!==null&&l.push(c)}),l}_transformEndpointToSummary(e,t,o,i,s,r){const a=this._physicalRowToDataIndex(e.destinationRow,t,o),l=this._physicalColToDataIndex(e.destinationColumn,i,s);if(a===null||l===null)return null;const h=e.sourceColumn??e.destinationColumn,c=this._physicalColToDataIndex(h,i,s);if(c===null)return null;const d=e.ranges||[[0,this.hot.countRows()-1]],u=[];return d.forEach(f=>{const p=f[0],C=f[1]!==void 0?f[1]:f[0];for(let y=p;y<=C;y++){const _=this._physicalRowToDataIndex(y,t,o);if(!(_===null||r.has(_))){if(u.length>0){const T=u[u.length-1];if(T[1]+1===_){T[1]=_;continue}}u.push([_,_])}}}),u.length===0?null:{destRow:a,destCol:l,type:String(e.type||"sum").toLowerCase(),sourceCol:c,sourceRanges:u}}_countVisibleBefore(e,t,o){let i=0;for(let s=t;s<e;s++)o(s)&&(i+=1);return i}_physicalRowToDataIndex(e,t,o){const i=this.hot.toVisualRow(e);return i===null||i<t||i>o||this.options.exportHiddenRows===!1&&this._isHiddenRow(i)?null:this._countVisibleBefore(i,t,s=>this.options.exportHiddenRows!==!1||!this._isHiddenRow(s))}_physicalColToDataIndex(e,t,o){const i=this.hot.toVisualColumn(e);return i===null||i<t||i>o||this.options.exportHiddenColumns===!1&&this._isHiddenColumn(i)?null:this._countVisibleBefore(i,t,s=>this.options.exportHiddenColumns!==!1||!this._isHiddenColumn(s))}_getNaturalColWidth(e){const t=this.hot.getSettings(),o=this.hot.getColumnMeta(e).width;if(o!=null)return o;const{colWidths:i,defaultColumnWidth:s}=t,r=s??50;return Array.isArray(i)?i[e]??r:typeof i=="function"?i(e)??r:typeof i=="number"?i:r}_getNaturalRowHeight(e){const t=this.hot.getSettings(),{rowHeights:o,defaultRowHeight:i}=t,s=i??23;return Array.isArray(o)?o[e]??s:typeof o=="function"?o(e)??s:typeof o=="number"?o:s}_isHiddenRow(e){return this.hot.rowIndexMapper.isHidden(this.hot.toPhysicalRow(e))}_isHiddenColumn(e){return this.hot.columnIndexMapper.isHidden(this.hot.toPhysicalColumn(e))}constructor(e){this.options={},this.hot=e}}class D_{static get DEFAULT_OPTIONS(){return{mimeType:"text/plain",fileExtension:"txt",filename:"Handsontable [YYYY]-[MM]-[DD]",encoding:"utf-8",bom:!1,colHeaders:!1,rowHeaders:!1,exportHiddenColumns:!1,exportHiddenRows:!1,range:[]}}get binary(){return!1}_mergeOptions(e){let t=oa(this.constructor.DEFAULT_OPTIONS);const o=new Date;return t=Fn(oa(D_.DEFAULT_OPTIONS),t),e&&"columnHeaders"in e&&!("colHeaders"in e)&&(e={...e,colHeaders:e.columnHeaders}),t=Fn(t,e),t.filename=Py(t.filename,{YYYY:o.getFullYear(),MM:`${o.getMonth()+1}`.padStart(2,"0"),DD:`${o.getDate()}`.padStart(2,"0")}),t}constructor(e,t){this.dataProvider=e,this.options=this._mergeOptions(t),this.dataProvider.setOptions(this.options)}}function rce(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function LD(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function WD(n,e){rce(n,e),e.add(n)}const BU="\r",ace='"',lce=`
238
- `,hce="=",cce="+",dce="-",uce="@",fce=" ";var $D=new WeakSet,FD=new WeakSet;class gce extends D_{static get DEFAULT_OPTIONS(){return{mimeType:"text/csv",fileExtension:"csv",bom:!0,columnDelimiter:",",rowDelimiter:`\r
239
- `,sanitizeValues:!1}}_mergeOptions(e){const t=super._mergeOptions(e),o={};return t.exportHiddenRows==="hide"&&(o.exportHiddenRows=!1),t.exportHiddenColumns==="hide"&&(o.exportHiddenColumns=!1),Object.keys(o).length>0?Fn(t,o):t}export(){const e=this.options,t=this.dataProvider.getData();let o=this.dataProvider.getColumnHeaders();const i=o.length>0,s=this.dataProvider.getRowHeaders(),r=s.length>0;let a=e.bom?"\uFEFF":"";return i&&(o=o.map(l=>this._escapeCell(l,{force:!0,sanitizeValue:e.sanitizeValues})),r&&(a+=e.columnDelimiter),a+=o.join(e.columnDelimiter),a+=e.rowDelimiter),t.forEach((l,h)=>{h>0&&(a+=e.rowDelimiter),r&&(a+=this._escapeCell(s[h],{sanitizeValue:e.sanitizeValues}),a+=e.columnDelimiter);const c=l.map(d=>this._escapeCell(d,{sanitizeValue:e.sanitizeValues})).join(e.columnDelimiter);a+=c}),a}_escapeCell(e,{force:t=!1,sanitizeValue:o=!1}={}){let i=yt(e);return i===""||(o&&(t=!0),o instanceof RegExp?i=LD(this,FD,mce).call(this,i,o):typeof o=="function"?i=o(i):o&&(i=LD(this,$D,pce).call(this,i)),(t||i.indexOf(BU)>=0||i.indexOf(ace)>=0||i.indexOf(lce)>=0||i.indexOf(this.options.columnDelimiter)>=0)&&(i=i.replace(new RegExp('"',"g"),'""'),i=`"${i}"`)),i}constructor(...e){super(...e),WD(this,$D),WD(this,FD)}}function pce(n){return n.startsWith(hce)||n.startsWith(cce)||n.startsWith(dce)||n.startsWith(uce)||n.startsWith(fce)||n.startsWith(BU)?`'${n}`:n}function mce(n,e){return e.test(n)?`'${n}`:n}const wce={sum:"SUM",min:"MIN",max:"MAX",count:"COUNT",average:"AVERAGE"};function Cm(n){let e="",t=n;for(;t>0;){const o=(t-1)%26;e=String.fromCharCode(65+o)+e,t=Math.floor((t-1)/26)}return e}function BD(n){let e=0;for(let t=0;t<n.length;t++)e=e*26+(n.charCodeAt(t)-64);return e}function bce(n){return typeof n=="string"&&n.startsWith("=")}function Cce(n,e,t){const o=wce[n.type];if(!o)return null;const i=Cm(n.sourceCol+t),s=n.sourceRanges.map(([r,a])=>{const l=r+e,h=a+e;return l===h?`${i}${l}`:`${i}${l}:${i}${h}`});return{formula:`${o}(${s.join(",")})`}}function yce(n,e,t){let o="",i=!1,s="";for(let r=0;r<n.length;r++){const a=n[r];i?(o+=a,a===s&&(n[r+1]===s?(o+=n[r+1],r+=1):i=!1)):a==='"'||a==="'"?(i=!0,s=a,o+=a):n.startsWith(e,r)?(o+=t,r+=e.length-1):o+=a}return o}function VD(n,e){let t=0;return n.forEach(o=>{o<e&&(t+=1)}),t}function _ce(n,e,t,o,i,s){let r=n.startsWith("=")?n.slice(1):n;const a=i?.size>0,l=s?.size>0;return(t!==0||o!==0||a||l)&&(r=r.replace(new RegExp(`("(?:[^"]|"")*"|'[^']*')|(?<![0-9])(\\$?)([A-Z]{1,3})(\\$?)(\\d{1,7})(?!\\()`,"g"),(h,c,d,u,f,p)=>{if(c!==void 0)return c;const C=BD(u)-1,y=parseInt(p,10)-1,_=l?VD(s,C):0,T=a?VD(i,y):0,P=BD(u)+o-_,$=parseInt(p,10)+t-T;return`${d}${Cm(P)}${f}${$}`})),e&&e!==","&&(r=yce(r,e,",")),r}const Sce="FFF0F0F0",vce="FF808080";function x0(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"&&e.length>0):typeof n=="string"?n.split(" ").filter(e=>e.length>0):[]}const M0=new WeakMap,I0=new WeakMap;function Rce(n){M0.delete(n),I0.delete(n)}const fy=new Set(["htLeft","htRight","htCenter","htJustify","htTop","htMiddle","htBottom"]);function gy(n){if(!n)return null;const e=n.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(!e||(ee(e[4])?parseFloat(e[4]):1)===0)return null;const o=parseInt(e[1],10).toString(16).padStart(2,"0"),i=parseInt(e[2],10).toString(16).padStart(2,"0"),s=parseInt(e[3],10).toString(16).padStart(2,"0");return`#${o}${i}${s}`.toUpperCase()}function Ece(n,e,t){const o=e.join(" ");let i=M0.get(n);if(i||(i=new Map,M0.set(n,i)),i.has(o))return i.get(o);const s=n.createElement("div");s.className="handsontable",s.style.cssText="position:absolute;top:-99999px;left:-99999px;visibility:hidden;pointer-events:none;";const r=n.createElement("table"),a=n.createElement("tbody"),l=n.createElement("tr"),h=n.createElement("td");h.className=o;const c=n.createElement("td");c.className=e.filter(p=>fy.has(p)).join(" "),l.appendChild(h),l.appendChild(c),a.appendChild(l),r.appendChild(a),s.appendChild(r),n.body.appendChild(s);const d=t.getComputedStyle(h).backgroundColor,u=t.getComputedStyle(c).backgroundColor;n.body.removeChild(s);const f=d!==u?gy(d):null;return i.set(o,f),f}function kce(n,e,t){const o=t.join(" ");let i=I0.get(n);if(i||(i=new Map,I0.set(n,i)),i.has(o))return i.get(o);const s=n.createElement("div");s.className="handsontable",s.style.cssText="position:absolute;top:-99999px;left:-99999px;visibility:hidden;pointer-events:none;";const r=n.createElement("table"),a=n.createElement("tbody"),l=n.createElement("tr"),h=n.createElement("td");h.className=o;const c=n.createElement("td");c.className=t.filter(T=>fy.has(T)).join(" "),l.appendChild(h),l.appendChild(c),a.appendChild(l),r.appendChild(a),s.appendChild(r),n.body.appendChild(s);const d=e.getComputedStyle(h),u=e.getComputedStyle(c),f=d.backgroundColor,p=u.backgroundColor,C=d.color,y=u.color;n.body.removeChild(s);const _={fontBold:parseInt(d.fontWeight,10)>=700||d.fontWeight==="bold",fontItalic:d.fontStyle==="italic",fontUnderline:(d.textDecorationLine||d.textDecoration||"").includes("underline"),fontColor:C!==y?gy(C):null,backgroundColor:f!==p?gy(f):null};return i.set(o,_),_}function Tce(n,e,t=null,o=null){if(!n){if(!t||!o)return null;const l=x0(e);return l.some(h=>!fy.has(h))?kce(t,o,l):null}const i=n.ownerDocument?.defaultView;if(!i)return null;const s=i.getComputedStyle(n),r=x0(e),a=r.some(l=>!fy.has(l));return{fontBold:parseInt(s.fontWeight,10)>=700||s.fontWeight==="bold",fontItalic:s.fontStyle==="italic",fontUnderline:(s.textDecorationLine||s.textDecoration||"").includes("underline"),fontColor:a?gy(s.color):null,backgroundColor:a?Ece(n.ownerDocument,r,i):null}}function nw(n){if(!n||typeof n!="string")return"FF000000";const e=n.startsWith("#")?n.slice(1):n;if(e.length===3){const t=e[0]+e[0],o=e[1]+e[1],i=e[2]+e[2];return`FF${t}${o}${i}`.toUpperCase()}return e.length===6?`FF${e}`.toUpperCase():e.length===8?e.toUpperCase():"FF000000"}function VU(n){return n?zU({className:n}):null}function zU(n){if(!n?.className)return null;const e=x0(n.className),t={};return e.includes("htLeft")?t.horizontal="left":e.includes("htCenter")?t.horizontal="center":e.includes("htRight")?t.horizontal="right":e.includes("htJustify")&&(t.horizontal="justify"),e.includes("htTop")?t.vertical="top":e.includes("htMiddle")?t.vertical="middle":e.includes("htBottom")&&(t.vertical="bottom"),Object.keys(t).length>0?t:null}function xce(n){return n>=3?"thick":n===2?"medium":"thin"}function Mce(n){if(!n?.borders)return null;const{borders:e}=n,t={};return["top","bottom","left","right"].forEach(o=>{e[o]&&e[o].width>0&&(t[o]={style:xce(e[o].width),color:{argb:nw(e[o].color)}})}),Object.keys(t).length>0?t:null}function Ice(n,e=null){const t=n?.readOnly===!0,o=e?.fontBold||!1,i=e?.fontItalic||!1,s=e?.fontUnderline||!1,r=e?.fontColor??null;if(!o&&!i&&!s&&!r&&!t)return null;const a={};return o&&(a.bold=!0),i&&(a.italic=!0),s&&(a.underline=!0),r?a.color={argb:nw(r)}:t&&(a.color={argb:vce}),Object.keys(a).length>0?a:null}function Hce(n,e=null){let t=null;return e?.backgroundColor?t=nw(e.backgroundColor):n?.readOnly===!0&&(t=Sce),t?{type:"pattern",pattern:"solid",fgColor:{argb:t}}:null}function Ace(n,e){return!n||!e||!(n.type==="dropdown"||n.type==="autocomplete")||!Array.isArray(n.source)?null:{type:"list",allowBlank:!0,formulae:[e]}}const Oce=Date.UTC(1899,11,30),Dce=864e5;function Nce(n){const e=Date.UTC(n.getFullYear(),n.getMonth(),n.getDate());return Math.round((e-Oce)/Dce)}function Pce(n){if(!n)return null;const e=String(n).match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!e)return null;const t=parseInt(e[1],10),o=parseInt(e[2],10),i=parseInt(e[3],10),s=new Date(t,o-1,i);return Number.isNaN(s.getTime())?null:Nce(s)}function Lce(n){if(!n)return null;const e=String(n).trim(),t=e.match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/);if(t){const i=parseInt(t[1],10),s=parseInt(t[2],10),r=t[3]?parseInt(t[3],10):0;return i>23||s>59||r>59?null:(i*3600+s*60+r)/86400}const o=e.match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?\s*(AM|PM)$/i);if(o){let i=parseInt(o[1],10);const s=parseInt(o[2],10),r=o[3]?parseInt(o[3],10):0,a=o[4].toUpperCase();return i>12||s>59||r>59?null:(a==="AM"&&i===12?i=0:a==="PM"&&i!==12&&(i+=12),(i*3600+s*60+r)/86400)}return null}function Wce(){return"mm-dd-yy"}function $ce(){return"h:mm:ss"}function Fce(n){return!n||typeof n!="string"?null:n.replace(/0,0/g,"#,##0")}function Bce(n,e){try{const t=new Intl.NumberFormat(e||"en",{style:"currency",currency:n,minimumFractionDigits:0,maximumFractionDigits:0}).formatToParts(0),o=t.find(a=>a.type==="currency")?.value??n,i=t.findIndex(a=>a.type==="currency"),s=t.findIndex(a=>a.type==="integer"),r=i<s;return{symbol:o,isPrefix:r}}catch{return{symbol:n,isPrefix:!0}}}function Vce(n,e){if(!n)return null;if(n.pattern)return Fce(n.pattern);const{style:t,currency:o,minimumFractionDigits:i=0,maximumFractionDigits:s,useGrouping:r=!0}=n,a=s??i,l=a>0?`.${"0".repeat(a)}`:"",h=r!==!1?"#,##0":"0";if(t==="percent")return`${h}${l}%`;if(t==="currency"&&o){const{symbol:c,isPrefix:d}=Bce(o,e);return d?`${c}${h}${l}`:`${h}${l}${c}`}return`${h}${l}`}function zce(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function un(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function An(n,e){zce(n,e),e.add(n)}const Uce=7,Yce=.75,Gce=5;var iR=new WeakSet,UU=new WeakSet,YU=new WeakSet,GU=new WeakSet,jU=new WeakSet,mC=new WeakSet,qU=new WeakSet,KU=new WeakSet,XU=new WeakSet,ZU=new WeakSet,zD=new WeakSet,QU=new WeakSet,JU=new WeakSet,e3=new WeakSet,t3=new WeakSet,n3=new WeakSet,o3=new WeakSet,i3=new WeakSet,s3=new WeakSet,r3=new WeakSet,a3=new WeakSet;class jce extends D_{static get BINARY(){return!0}get binary(){return!0}static get DEFAULT_OPTIONS(){return{mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",fileExtension:"xlsx",bom:!1,engine:null,compression:null,conditionalFormatting:[],exportFormulas:!1,headerStyle:{backgroundColor:"#F2F2F2",border:{style:"thin"}}}}async export(){const{engine:e}=this.options;(!e||typeof e.Workbook!="function")&&Y("Missing or invalid ExcelJS engine. Pass the ExcelJS module via the `engines` option in the exportFile plugin settings: `exportFile: { engines: { xlsx: ExcelJS } }`.");const{sheets:t}=this.options;(t&&t.length>0?new Set(t.map(s=>s.instance.rootDocument)):new Set([this.dataProvider.hot.rootDocument])).forEach(s=>Rce(s));const i=new e.Workbook;if(t&&t.length>0){const s=new Set;t.forEach(r=>{const a=new FU(r.instance),l="columnHeaders"in r&&!("colHeaders"in r)?{...r,colHeaders:r.columnHeaders}:r,h={...this.options,...l};a.setOptions(h);const c=r.name||"Sheet";let d=c,u=1;for(;s.has(d);)d=`${c}${u}`,u+=1;s.add(d);const f=i.addWorksheet(d);un(this,iR,UD).call(this,i,f,a,h)})}else{const s=i.addWorksheet("Sheet1");un(this,iR,UD).call(this,i,s,this.dataProvider,this.options)}return i.xlsx.writeBuffer(un(this,zD,nde).call(this))}constructor(...e){super(...e),An(this,iR),An(this,UU),An(this,YU),An(this,GU),An(this,jU),An(this,mC),An(this,qU),An(this,KU),An(this,XU),An(this,ZU),An(this,zD),An(this,QU),An(this,JU),An(this,e3),An(this,t3),An(this,n3),An(this,o3),An(this,i3),An(this,s3),An(this,r3),An(this,a3)}}function UD(n,e,t,o){const i=t.getData(),s=t.getCellsMeta(),r=un(this,a3,ude).call(this,n,s),a=t.getCellElements(),l=t.getColumnHeaders(),h=t.getColumnHeadersClassNames(),c=t.getRowHeaders(),d=t.getColumnsWidths(),u=t.getRowsHeights(),f=t.getMergeCells(),p=t.getFrozenRows(),C=t.getFrozenColumns(),y=t.getNestedColumnHeaders(),_=t.getLayoutDirection()==="rtl",{exportFormulas:T}=o,P=new Map;t.getColumnSummaries().forEach(Ee=>{P.set(`${Ee.destRow}:${Ee.destCol}`,Ee)});const F=T?t.getSourceData():null,N=T?t.getFormulasSeparator():",",I=l.length>0,j=c.length>0,U=y!==null&&I;let G=0;U?G=y.length:I&&(G=1);const te=G+1,Q=j?2:1,be=T?t.getExcludedHiddenRows():null,Oe=T?t.getExcludedHiddenColumns():null,Ve=t.getHiddenRowDataIndices(),Ke=t.getHiddenColumnDataIndices(),{rootDocument:He,rootWindow:Ye}=t.hot;un(this,e3,sde).call(this,e,d,j),Ke.length>0&&un(this,t3,rde).call(this,e,Ke,j),un(this,o3,lde).call(this,e,p,C,G,j,_);const bt=un(this,XU,ede).call(this,o.headerStyle),sn=un(this,ZU,tde).call(this,o.headerStyle);U?(un(this,s3,cde).call(this,e,y,j,Q,bt,sn),un(this,r3,dde).call(this,e,y,j,Q)):I&&un(this,i3,hde).call(this,e,l,h,j,Q,bt,sn);const K=!(P.size>0)&&s.some(Ee=>Ee.some(Ge=>Ge.readOnly===!0)),ye={exportFormulas:T,formulasSeparator:N,dataRowOffset:te,dataColOffset:Q,excludedHiddenRows:be,excludedHiddenCols:Oe,summaryMap:P,sourceData:F,hasRowHeaders:j,headerFill:bt,headerBorder:sn,hasReadOnlyCells:K,rootDocument:He,rootWindow:Ye,validationMap:r,cellsMeta:s,cellElements:a,rowHeaders:c,rowsHeights:u};un(this,UU,qce).call(this,e,i,ye),Ve.length>0&&un(this,n3,ade).call(this,e,Ve,te),K&&e.protect("",{selectLockedCells:!0,selectUnlockedCells:!0,formatColumns:!0,formatRows:!0,sort:!0,autoFilter:!0}),f.forEach(Ee=>{const Ge=Ee.row+te,g=Ee.col+Q,b=Ge+Ee.rowspan-1,v=g+Ee.colspan-1;e.mergeCells(Ge,g,b,v)});const{conditionalFormatting:z}=o;return z&&z.length>0&&un(this,QU,ode).call(this,e,z,te,Q,i.length,i[0]?.length??0),i.length}function qce(n,e,t){for(let o=0;o<e.length;o++){const i=e[o],s=o+t.dataRowOffset,r=n.getRow(s);if(ee(t.rowsHeights[o])&&(r.height=t.rowsHeights[o]*Yce),t.hasRowHeaders){const a=r.getCell(1);a.value=t.rowHeaders[o]??null,t.headerFill&&(a.fill=t.headerFill),t.headerBorder&&(a.border=t.headerBorder)}un(this,YU,Kce).call(this,r,i,o,t),r.commit()}}function Kce(n,e,t,o){for(let i=0;i<e.length;i++){const s=e[i],r=n.getCell(i+o.dataColOffset),a=o.cellsMeta[t][i],l=o.summaryMap.get(`${t}:${i}`),h=o.sourceData?.[t][i],{value:c,numFmt:d}=un(this,jU,Zce).call(this,s,a,h,l,o);r.value=c,d&&(r.numFmt=d);const u=Tce(o.cellElements[t][i],a.className,o.rootDocument,o.rootWindow);un(this,GU,Xce).call(this,r,a,u,o),o.hasReadOnlyCells&&(r.protection={locked:a.readOnly===!0})}}function Xce(n,e,t,o){const i=zU(e);i&&(n.alignment=i);const s=Mce(e);s&&(n.border=s);const r=Ice(e,t);r&&(n.font=r);const a=Hce(e,t);a&&(n.fill=a);const l=Array.isArray(e.source)?o.validationMap.get(JSON.stringify(e.source))??null:null,h=Ace(e,l);h&&(n.dataValidation=h),e.comment?.value&&(n.note=String(e.comment.value))}function Zce(n,e,t,o,i){const{exportFormulas:s,formulasSeparator:r,dataRowOffset:a,dataColOffset:l,excludedHiddenRows:h,excludedHiddenCols:c}=i;if(o&&s){const d=Cce(o,a,l),u=un(this,mC,sR).call(this,n,e);return{value:d?{...d,result:n}:u,numFmt:null}}if(s&&bce(t))return{value:{formula:_ce(t,r,a-1,l-1,h,c)},numFmt:null};if(e.type==="date"||e.type==="intl-date"){const d=Pce(n);if(d!==null)return{value:d,numFmt:Wce()}}if(e.type==="time"||e.type==="intl-time"){const d=Lce(n);if(d!==null)return{value:d,numFmt:$ce()}}return e.type==="checkbox"?{value:un(this,qU,Qce).call(this,n,e),numFmt:null}:e.type==="multiselect"?{value:un(this,KU,Jce).call(this,n),numFmt:null}:e.type==="numeric"?{value:un(this,mC,sR).call(this,n,e),numFmt:Vce(e.numericFormat,e.locale)}:{value:un(this,mC,sR).call(this,n,e),numFmt:null}}function sR(n,e){if(n==null)return null;if(e.type==="numeric"){if(typeof n=="number")return n;const t=Number(n);return Number.isNaN(t)?yt(n):t}return yt(n)}function Qce(n,e){const t=e.checkedTemplate??!0;return n===t}function Jce(n){return Array.isArray(n)?n.length===0?null:n.map(e=>e!==null&&typeof e=="object"?e.value:e).join(", "):n==null?null:yt(n)}function ede(n){return n?.backgroundColor?{type:"pattern",pattern:"solid",fgColor:{argb:nw(n.backgroundColor)}}:null}function tde(n){if(!n?.border)return null;const{style:e="thin",color:t}=n.border,o=t?{style:e,color:{argb:nw(t)}}:{style:e};return{top:o,bottom:o,left:o,right:o}}function nde(){const{compression:n}=this.options;let e=null;return n===!0?e=6:typeof n=="number"&&n>=1&&n<=9&&(e=n),e===null?{}:{zip:{compression:"DEFLATE",compressionOptions:{level:e}}}}function ode(n,e,t,o,i,s){i===0||s===0||e.forEach(({rows:r,cols:a,rules:l})=>{if(!l||l.length===0)return;const h=(r?r[0]:0)+t,c=(r?r[1]:i-1)+t,d=(a?a[0]:0)+o,u=(a?a[1]:s-1)+o;n.addConditionalFormatting({ref:un(this,JU,ide).call(this,h,d,c,u),rules:l})})}function ide(n,e,t,o){return`${Cm(e)}${n}:${Cm(o)}${t}`}function sde(n,e,t){t&&(n.getColumn(1).width=Gce);const o=t?1:0;for(let i=0;i<e.length;i++)n.getColumn(i+1+o).width=Math.max(e[i]/Uce,1)}function rde(n,e,t){const o=t?1:0;e.forEach(i=>{n.getColumn(i+1+o).hidden=!0})}function ade(n,e,t){e.forEach(o=>{n.getRow(o+t).hidden=!0})}function lde(n,e,t,o,i,s){const r=e>0||t>0;if(!r&&!s)return;const a={};s&&(a.rightToLeft=!0),r&&(a.state="frozen",a.xSplit=t+(i?1:0),a.ySplit=e+o),n.views=[a]}function hde(n,e,t,o,i,s,r){const a=n.getRow(1);if(o){const l=a.getCell(1);l.value="",s&&(l.fill=s),r&&(l.border=r)}for(let l=0;l<e.length;l++){const h=a.getCell(l+i);h.value=e[l]??null;const c=VU(t[l]);c&&(h.alignment=c),s&&(h.fill=s),r&&(h.border=r)}a.commit()}function cde(n,e,t,o,i,s){for(let r=0;r<e.length;r++){const a=e[r],l=n.getRow(r+1);if(t&&r===0){const c=l.getCell(1);c.value="",i&&(c.fill=i),s&&(c.border=s)}let h=o;a.forEach(c=>{const d=l.getCell(h);d.value=c.label??null;const u=VU(c.className);u&&(d.alignment=u),i&&(d.fill=i),s&&(d.border=s),h+=c.colspan}),l.commit()}}function dde(n,e,t,o){t&&e.length>1&&n.mergeCells(1,1,e.length,1);for(let i=0;i<e.length;i++){const s=e[i],r=i+1;let a=o;s.forEach(l=>{l.colspan>1&&n.mergeCells(r,a,r,a+l.colspan-1),a+=l.colspan})}}function ude(n,e){const t=new Map;for(let h=0;h<e.length;h++)for(let c=0;c<e[h].length;c++){const d=e[h][c];if((d.type==="dropdown"||d.type==="autocomplete")&&Array.isArray(d.source)&&d.source.length>0){const f=JSON.stringify(d.source);t.has(f)||t.set(f,d.source)}}if(t.size===0)return new Map;const o=new Set(n.worksheets.map(h=>h.name));let i="_HotValidation",s=1;for(;o.has(i);)i=`_HotValidation${s}`,s+=1;const r=n.addWorksheet(i);r.state="veryHidden";const a=new Map;let l=1;return t.forEach((h,c)=>{for(let p=0;p<h.length;p++){const C=h[p];r.getCell(p+1,l).value=$n(C)?String(C.value):String(C)}const d=Cm(l),f=`'${i.replace(/'/g,"''")}'!$${d}$1:$${d}$${h.length}`;a.set(c,f),l+=1}),a}const fde="csv",gde="xlsx",py={[fde]:gce,[gde]:jce};function pde(n,e,t){return typeof py[n]=="function"?new py[n](e,t):null}function YD(n){const e=n.getSettings(),t=!!(e.colHeaders||e.nestedHeaders),o=!!e.rowHeaders,i=n.getSelectedRangeLast(),s={colHeaders:t,rowHeaders:o};return!i||i.isSingleCell()||i.from.row<0&&i.from.col<0?s:{...s,range:[Math.max(0,Math.min(i.from.row,i.to.row)),Math.max(0,Math.min(i.from.col,i.to.col)),Math.max(i.from.row,i.to.row),Math.max(i.from.col,i.to.col)]}}function mde(n){return{key:"export_file",name(){return this.getTranslatedPhrase(Kk)},hidden(){return this.getSettings()[mp]===void 0},submenu:{items:[{key:"export_file:csv",name(){return this.getTranslatedPhrase(Xk)},callback(){n.downloadFile("csv",YD(this))},disabled:!1},{key:"export_file:xlsx",name(){return this.getTranslatedPhrase(Zk)},callback(){n.downloadFileAsync("xlsx",YD(this)).catch(e=>{il("ExportFile: XLSX export failed.",e)})},hidden(){return!n.supportsExportFormat("xlsx")}}]}}}function wde(n){const{fragment:e}=jc`
240
- <div class="${Qi}__content">
241
- <i class="${Qi}__icon">
242
- <svg class="${Qi}__icon-svg"
243
- xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16">
244
- <path stroke="currentColor" stroke-width="2" d="M15 8a7 7 0 1 1-3.5-6.062"></path>
245
- </svg>
246
- </i>
247
- <div class="${Qi}__text">
248
- <h2 class="${Qi}__title">${n}</h2>
249
- </div>
250
- </div>
251
- `;return e}function bde(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function rR(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function GD(n,e){bde(n,e),e.add(n)}const mp="exportFile",Cde=240;var jD=new WeakSet,aR=new WeakSet;class yde extends at{static get PLUGIN_KEY(){return mp}static get PLUGIN_PRIORITY(){return Cde}static get SETTING_KEYS(){return[mp]}isEnabled(){return!0}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",(...e)=>rR(this,jD,_de).call(this,...e)),super.enablePlugin())}disablePlugin(){super.disablePlugin()}exportAsString(e,t={}){const o=this._createTypeFormatter(e,t);return o.binary&&Y(`Export format type "${e}" cannot be exported as a string (binary format).`),o.export()}exportAsBlob(e,t={}){const o=this._createTypeFormatter(e,t);return o.binary&&Y(`exportAsBlob() does not support binary formats such as "${e}". Use exportAsBlobAsync() instead.`),this._createBlob(o)}async exportAsBlobAsync(e,t={}){return this._createBlob(this._createTypeFormatter(e,t))}downloadFile(e,t={}){const o=this._createTypeFormatter(e,t);o.binary&&Y(`downloadFile() does not support binary formats such as "${e}". Use downloadFileAsync() instead.`);const i=`${o.options.filename}.${o.options.fileExtension}`;rR(this,aR,qD).call(this,this._createBlob(o),i)}async downloadFileAsync(e,t={}){const o=this._createTypeFormatter(e,t),i=this.hot.getPlugin("dialog"),s=i?.isEnabled(),{rootWindow:r}=this.hot,a=`${o.options.filename}.${o.options.fileExtension}`,l=async()=>{const h=await Promise.resolve(this._createBlob(o));rR(this,aR,qD).call(this,h,a)};if(s&&o.binary){i.show({content:wde(this.hot.getTranslatedPhrase(lx)),customClassName:Qi,background:"semi-transparent",closable:!1,animation:!1}),await new Promise(h=>{r.requestAnimationFrame(()=>{r.requestAnimationFrame(h)})});try{await l()}finally{i.hide()}return}await l()}supportsExportFormat(e){if(!py[e])return!1;if(e==="xlsx"){const t=this.hot.getSettings()[mp];return ie(t)&&ie(t.engines)&&!!t.engines.xlsx}return!0}_createTypeFormatter(e,t={}){py[e]||Y(`Export format type "${e}" is not supported.`);const o=this.hot.getSettings()[mp],s=(ie(o)&&ie(o.engines)?o.engines:void 0)?.[e],r=s!==void 0?{engine:s,...t}:t;return pde(e,new FU(this.hot),r)}_createBlob(e){typeof Blob>"u"&&Y("Blob is not available in this environment.");const t=e.export();return typeof t?.then=="function"?t.then(o=>new Blob([o],{type:e.options.mimeType})):new Blob([t],{type:`${e.options.mimeType};charset=${e.options.encoding}`})}constructor(...e){super(...e),GD(this,jD),GD(this,aR)}}function _de(n){n.items.push({name:"---------"},mde(this))}function qD(n,e){const{rootDocument:t,rootWindow:o}=this.hot,i=o.URL||o.webkitURL,s=i.createObjectURL(n),r=t.createElement("a");r.style.display="none",r.setAttribute("href",s),r.setAttribute("download",e),t.body.appendChild(r),r.dispatchEvent(new MouseEvent("click")),t.body.removeChild(r),this.hot._registerTimeout(()=>{i.revokeObjectURL(s)},100)}class ow{getElements(){return this.elements}reset(){O(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(){Y("The state setting logic is not implemented")}saveState(e){this.state&&this.state.setValueAtIndex(e,this.getState())}getState(){Y("The state gathering logic is not implemented")}destroy(){this.hot.columnIndexMapper.unregisterMap(this.stateId),this.clearLocalHooks(),O(this.elements,e=>e.destroy()),this.state=null,this.elements=null,this.hot=null}constructor(e,{id:t,stateless:o=!0}){this.elements=[],this.hidden=!1,this.stateId="",this.hot=e,this.id=t,this.stateId=`Filters.component.${this.id}`,this.state=o?null:this.hot.columnIndexMapper.registerMap(this.stateId,new Yy)}}_t(ow,Bn);const ym={};function Ts(n,e){ym[n]||Y(`Filter condition "${n}" does not exist.`);const{condition:t,descriptor:o}=ym[n];let i=e;return o.inputValuesDecorator&&(i=o.inputValuesDecorator(i)),function(s){return t.apply(s.meta.instance,[].concat([s],[i]))}}function Hc(n){return ym[n]||Y(`Filter condition "${n}" does not exist.`),ym[n].descriptor}function Ht(n,e,t){t.key=n,ym[n]={condition:e,descriptor:t}}const Xn="none";function Sde(){return!0}Ht(Xn,Sde,{name:Gy,inputsCount:0,showOperators:!1});const Sc="empty";function vde(n){return ht(n.value)}Ht(Sc,vde,{name:kT,inputsCount:0,showOperators:!0});const Mu="not_empty";function Rde(n,e){return!Ts(Sc,e)(n)}Ht(Mu,Rde,{name:TT,inputsCount:0,showOperators:!0});const vc="eq";function Ede(n,[e]){return yt(n.value).toLocaleLowerCase(n.meta.locale)===yt(e)}Ht(vc,Ede,{name:xT,inputsCount:1,showOperators:!0});const Iu="neq";function kde(n,e){return!Ts(vc,e)(n)}Ht(Iu,kde,{name:MT,inputsCount:1,showOperators:!0});const l3="gt";function Tde(n,[e]){let t=e;return n.meta.type==="numeric"&&(t=parseFloat(t,10)),n.value>t}Ht(l3,Tde,{name:DT,inputsCount:1,showOperators:!0});const h3="gte";function xde(n,[e]){let t=e;return n.meta.type==="numeric"&&(t=parseFloat(t,10)),n.value>=t}Ht(h3,xde,{name:NT,inputsCount:1,showOperators:!0});const c3="lt";function Mde(n,[e]){let t=e;return n.meta.type==="numeric"&&(t=parseFloat(t,10)),n.value<t}Ht(c3,Mde,{name:PT,inputsCount:1,showOperators:!0});const d3="lte";function Ide(n,[e]){let t=e;return n.meta.type==="numeric"&&(t=parseFloat(t,10)),n.value<=t}Ht(d3,Ide,{name:LT,inputsCount:1,showOperators:!0});const MM="date_after";function Hde(n,[e]){const t=Z(n.value,n.meta.dateFormat),o=Z(e,n.meta.dateFormat);return!t.isValid()||!o.isValid()?!1:t.diff(o)>=0}Ht(MM,Hde,{name:zm,inputsCount:1,showOperators:!0});const IM="date_before";function Ade(n,[e]){const t=Z(n.value,n.meta.dateFormat),o=Z(e,n.meta.dateFormat);return!t.isValid()||!o.isValid()?!1:t.diff(o)<=0}Ht(IM,Ade,{name:Um,inputsCount:1,showOperators:!0});const my="between";function Ode(n,[e,t]){let o=e,i=t;if(n.meta.type==="numeric"){const s=parseFloat(o,10),r=parseFloat(i,10);o=Math.min(s,r),i=Math.max(s,r)}else if(n.meta.type==="date"){const s=Ts(IM,[i]),r=Ts(MM,[o]);return s(n)&&r(n)}return n.value>=o&&n.value<=i}Ht(my,Ode,{name:Vm,inputsCount:2,showOperators:!0});const u3="not_between";function Dde(n,e){return!Ts(my,e)(n)}Ht(u3,Dde,{name:WT,inputsCount:2,showOperators:!0});const H0="begins_with";function Nde(n,[e]){return yt(n.value).toLocaleLowerCase(n.meta.locale).startsWith(yt(e))}Ht(H0,Nde,{name:IT,inputsCount:1,showOperators:!0});const A0="ends_with";function Pde(n,[e]){return yt(n.value).toLocaleLowerCase(n.meta.locale).endsWith(yt(e))}Ht(A0,Pde,{name:HT,inputsCount:1,showOperators:!0});const wy="contains";function Lde(n,[e]){return yt(n.value).toLocaleLowerCase(n.meta.locale).indexOf(yt(e))>=0}Ht(wy,Lde,{name:AT,inputsCount:1,showOperators:!0});const O0="not_contains";function Wde(n,e){return!Ts(wy,e)(n)}Ht(O0,Wde,{name:OT,inputsCount:1,showOperators:!0});const f3="date_tomorrow";function $de(n){const e=Z(n.value,n.meta.dateFormat);return e.isValid()?e.isSame(Z().subtract(-1,"days").startOf("day"),"d"):!1}Ht(f3,$de,{name:qy,inputsCount:0});const g3="date_today";function Fde(n){const e=Z(n.value,n.meta.dateFormat);return e.isValid()?e.isSame(Z().startOf("day"),"d"):!1}Ht(g3,Fde,{name:jy,inputsCount:0});const p3="date_yesterday";function Bde(n){const e=Z(n.value,n.meta.dateFormat);return e.isValid()?e.isSame(Z().subtract(1,"days").startOf("day"),"d"):!1}Ht(p3,Bde,{name:Ky,inputsCount:0});const HM="intl_date_before";function Vde(n,[e]){const t=sa(n.value),o=sa(e);return t===null||o===null?!1:t<=o}Ht(HM,Vde,{name:Um,inputsCount:1,showOperators:!0,inputType:"date"});const AM="intl_date_after";function zde(n,[e]){const t=sa(n.value),o=sa(e);return t===null||o===null?!1:t>=o}Ht(AM,zde,{name:zm,inputsCount:1,showOperators:!0,inputType:"date"});const m3="intl_date_between";function Ude(n,[e,t]){const o=Ts(HM,[t]),i=Ts(AM,[e]);return o(n)&&i(n)}Ht(m3,Ude,{name:Vm,inputsCount:2,showOperators:!0,inputType:"date"});const w3="intl_date_tomorrow";function Yde(n){const e=sa(n.value);if(e===null)return!1;const t=new Date;return t.setDate(t.getDate()+1),e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}Ht(w3,Yde,{name:qy,inputsCount:0,inputType:"date"});const b3="intl_date_today";function Gde(n){const e=sa(n.value);if(e===null)return!1;const t=new Date;return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}Ht(b3,Gde,{name:jy,inputsCount:0,inputType:"date"});const C3="intl_date_yesterday";function jde(n){const e=sa(n.value);if(e===null)return!1;const t=new Date;return t.setDate(t.getDate()-1),e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}Ht(C3,jde,{name:Ky,inputsCount:0,inputType:"date"});const OM="intl_time_before";function qde(n,[e]){const t=td(n.value),o=td(e);return t===null||o===null?!1:t<=o}Ht(OM,qde,{name:Um,inputsCount:1,showOperators:!0,inputType:"time"});const DM="intl_time_after";function Kde(n,[e]){const t=td(n.value),o=td(e);return t===null||o===null?!1:t>=o}Ht(DM,Kde,{name:zm,inputsCount:1,showOperators:!0,inputType:"time"});const y3="intl_time_between";function Xde(n,[e,t]){const o=Ts(OM,[t]),i=Ts(DM,[e]);return o(n)&&i(n)}Ht(y3,Xde,{name:Vm,inputsCount:2,showOperators:!0,inputType:"time"});S4();function Zde(n,e){let t=n;return t===""&&(t=`(${e})`),t}function iw(n){const e=new Set(n);return function(t){return e.has(t)}}function NM(n){return n??""}function D0(n){return Array.from(new Set(n)).map(e=>NM(e)).sort((e,t)=>typeof e=="number"&&typeof t=="number"?e-t:e===t?0:e>t?1:-1)}function KD(n,e,t,o){const i=[],s=n===e;let r;return s||(r=iw(e)),n.forEach(a=>{let l=!1;(s||r(a))&&(l=!0);const h={checked:l,value:a,visualValue:Zde(a,t)};o&&o(h),i.push(h)}),i}const lh="by_value";function Qde(n,[e]){return e(n.value)}Ht(lh,Qde,{name:"By value",inputsCount:0,inputValuesDecorator([n]){return[iw(n)]},showOperators:!1});const _m={};function Jde(n){_m[n]||Y(`Operation with id "${n}" does not exist.`);const e=_m[n].func;return function(t,o){return e(t,o)}}function eue(n){return _m[n].name}function PM(n,e,t){_m[n]={name:e,func:t}}const ph="conjunction",tue=BT;function nue(n,e){return n.every(t=>t.func(e))}PM(ph,tue,nue);const by="disjunction",oue=Xy;function iue(n,e){return n.some(t=>t.func(e))}PM(by,oue,iue);const LM="disjunctionWithExtraCondition",sue=Xy;function rue(n,e){return n.length<3&&Y("Operation doesn't work on less then three conditions."),n.slice(0,n.length-1).some(t=>t.func(e))&&n[n.length-1].func(e)}PM(LM,sue,rue);const aue="numeric",_3="text",lue="date",hue="intl-date",cue="intl-time",XD={[aue]:[Xn,Ae,Sc,Mu,Ae,vc,Iu,Ae,l3,h3,c3,d3,my,u3],[_3]:[Xn,Ae,Sc,Mu,Ae,vc,Iu,Ae,H0,A0,Ae,wy,O0],[lue]:[Xn,Ae,Sc,Mu,Ae,vc,Iu,Ae,IM,MM,my,Ae,f3,g3,p3],[hue]:[Xn,Ae,Sc,Mu,Ae,vc,Iu,Ae,HM,AM,m3,Ae,w3,b3,C3],[cue]:[Xn,Ae,Sc,Mu,Ae,vc,Iu,Ae,Ae,H0,A0,Ae,wy,O0,Ae,OM,DM,y3]};function due(n){const e=[];let t=n;return XD[t]||(t=_3),O(XD[t],o=>{let i;o===Ae?i={name:Ae}:i=oa(Hc(o)),e.push(i)}),e}const lR="built",hR="building",ZD=["click","input","keydown","keypress","keyup","focus","blur","change"];let pr=class S3{static get DEFAULTS(){return oa({className:"",value:"",tagName:"div",children:[],wrapIt:!0})}setValue(e){this.options.value=e,this.update()}getValue(){return this.options.value}get element(){return this.buildState===hR?this._element:this.buildState===lR?(this.update(),this._element):(this.buildState=hR,this.build(),this.buildState=lR,this._element)}isBuilt(){return this.buildState===lR}translateIfPossible(e){return typeof e=="string"&&e.startsWith(Ci)?this.hot.getTranslatedPhrase(e):e}build(){const e=(t,o)=>{this.eventManager.addEventListener(t,o,i=>this.runLocalHooks(o,i,this))};if(this.buildState||(this.buildState=hR),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&&V(this._element,this.options.className),this.options.children.length)O(this.options.children,t=>this._element.appendChild(t.element));else if(this.options.wrapIt){const t=this.hot.rootDocument.createElement(this.options.tagName);t.setAttribute("data-hot-input",!0),nt(this.options,(o,i)=>{t[i]!==void 0&&i!=="className"&&i!=="tagName"&&i!=="children"&&(t[i]=this.translateIfPossible(o))}),this._element.appendChild(t),O(ZD,o=>e(t,o))}else O(ZD,t=>e(this._element,t))}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}constructor(e,t){this.eventManager=new $i(this),this.hot=e,this.options=Fn(S3.DEFAULTS,t),this._element=this.hot.rootDocument.createElement(this.options.wrapIt?"div":this.options.tagName)}};_t(pr,Bn);function v3(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function uue(n,e){return e.get?e.get.call(n):e.value}function fue(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function R3(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function ib(n,e){var t=R3(n,e,"get");return uue(n,t)}function gue(n,e,t){v3(n,e),e.set(n,t)}function pue(n,e,t){var o=R3(n,e,"set");return fue(n,o,t),t}function QD(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function mue(n,e){v3(n,e),e.add(n)}var Fd=new WeakMap,cR=new WeakSet;class mh extends pr{static get DEFAULTS(){return oa({placeholder:"",type:"text",tagName:"input",tabIndex:-1})}registerHooks(){this.addLocalHook("keyup",e=>QD(this,cR,JD).call(this,e)),this.addLocalHook("input",e=>QD(this,cR,JD).call(this,e))}build(){super.build();const e=this.hot.rootDocument.createElement("div");pue(this,Fd,this._element.firstChild),V(this._element,"htUIInput"),V(e,"htUIInputIcon"),this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(ib(this,Fd).type=this.options.type,ib(this,Fd).placeholder=this.translateIfPossible(this.options.placeholder),ib(this,Fd).value=this.translateIfPossible(this.options.value))}focus(){this.isBuilt()&&ib(this,Fd).focus()}constructor(e,t){super(e,Fn(mh.DEFAULTS,t)),mue(this,cR),gue(this,Fd,{writable:!0,value:void 0}),this.registerHooks()}}function JD(n){this.options.value=n.target.value}function E3(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wue(n,e){return e.get?e.get.call(n):e.value}function bue(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function k3(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function fn(n,e){var t=k3(n,e,"get");return wue(n,t)}function Cg(n,e,t){E3(n,e),e.set(n,t)}function Hl(n,e,t){var o=k3(n,e,"set");return bue(n,o,t),t}function dR(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function uR(n,e){E3(n,e),e.add(n)}var zn=new WeakMap,yg=new WeakMap,sb=new WeakMap,fR=new WeakMap,rb=new WeakMap,eN=new WeakSet,tN=new WeakSet,nN=new WeakSet;class Sm extends pr{static get DEFAULTS(){return oa({className:"htUISelect",wrapIt:!1,tabIndex:-1})}getMenu(){return fn(this,zn)}registerHooks(){this.addLocalHook("click",()=>dR(this,nN,_ue).call(this))}setItems(e){Hl(this,yg,this.translateNames(e)),fn(this,zn)&&fn(this,zn).setMenuItems(fn(this,yg))}translateNames(e){return O(e,t=>{t.name=this.translateIfPossible(t.name)}),e}build(){super.build(),Hl(this,zn,new vf(this.hot,{className:"htSelectUI htFiltersConditionsMenu",keepInViewport:!1,standalone:!0,container:this.options.menuContainer})),fn(this,zn).setMenuItems(fn(this,yg));const e=new pr(this.hot,{className:"htUISelectCaption"}),t=new pr(this.hot,{className:"htUISelectDropdown"});Hl(this,sb,e),Hl(this,fR,e.element),Hl(this,rb,t),this.hot.getSettings().ariaTags&&(fe(t.element,[hl()]),fe(this._element,[iF()])),O([e,t],o=>this._element.appendChild(o.element)),fn(this,zn).addLocalHook("select",o=>dR(this,eN,Cue).call(this,o)),fn(this,zn).addLocalHook("afterClose",()=>dR(this,tN,yue).call(this)),this.update()}update(){if(!this.isBuilt())return;let e;this.options.value?e=this.options.value.name:e=fn(this,zn).hot.getTranslatedPhrase(Gy),fn(this,fR).textContent=e,super.update()}openOptions(){const e=this.element.getBoundingClientRect();fn(this,zn)&&(fn(this,zn).open(),fn(this,zn).setPosition({left:this.hot.isLtr()?e.left-5:e.left-31,top:e.top-1,width:e.width,height:e.height}),fn(this,zn).getNavigator().toFirstItem(),fn(this,zn).getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:t=>{this.closeOptions(),this.runLocalHooks("tabKeydown",t)}},{keys:[["Control/Meta","A"]],callback:()=>!1}]))}closeOptions(){fn(this,zn)&&fn(this,zn).close()}focus(){this.isBuilt()&&this.element.focus()}destroy(){fn(this,zn)&&(fn(this,zn).destroy(),Hl(this,zn,null)),fn(this,sb)&&fn(this,sb).destroy(),fn(this,rb)&&fn(this,rb).destroy(),super.destroy()}constructor(e,t){super(e,Fn(Sm.DEFAULTS,t)),uR(this,eN),uR(this,tN),uR(this,nN),Cg(this,zn,{writable:!0,value:void 0}),Cg(this,yg,{writable:!0,value:void 0}),Cg(this,sb,{writable:!0,value:void 0}),Cg(this,fR,{writable:!0,value:void 0}),Cg(this,rb,{writable:!0,value:void 0}),Hl(this,zn,null),Hl(this,yg,[]),this.registerHooks()}}function Cue(n){n.name!==Ae&&(this.options.value=n,this.update(),this.runLocalHooks("select",this.options.value))}function yue(){this.runLocalHooks("afterClose")}function _ue(){this.openOptions()}function Sue(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function oN(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function iN(n,e){Sue(n,e),e.add(n)}var sN=new WeakSet,rN=new WeakSet;class N0 extends ow{registerHooks(){this.getSelectElement().addLocalHook("select",e=>oN(this,sN,vue).call(this,e)).addLocalHook("afterClose",()=>this.runLocalHooks("afterClose")).addLocalHook("tabKeydown",e=>this.runLocalHooks("selectTabKeydown",e)),O(this.getInputElements(),e=>{e.addLocalHook("keydown",t=>oN(this,rN,Rue).call(this,t))})}setState(e){if(this.reset(),!e)return;const t=oa(e.command);t.name.startsWith(yn)&&(t.name=this.hot.getTranslatedPhrase(t.name)),this.getSelectElement().setValue(t),O(e.args,(o,i)=>{if(i>t.inputsCount-1)return!1;const s=this.getInputElement(i);s.setValue(o),s[t.inputsCount>i?"show":"hide"](),i||this.hot._registerTimeout(()=>s.focus(),10)})}getState(){const e=this.getSelectElement().getValue()||Hc(Xn),t=[];return O(this.getInputElements(),(o,i)=>{e.inputsCount>i&&t.push(o.getValue())}),{command:e,args:t}}updateState(e,t){const o=Hc(e?e.name:Xn);this.state.setValueAtIndex(t,{command:o,args:e?e.args:[]}),e||O(this.getInputElements(),i=>i.setValue(null))}getSelectElement(){return this.elements.filter(e=>e instanceof Sm)[0]}getInputElement(e=0){return this.getInputElements()[e]}getInputElements(){return this.elements.filter(e=>e instanceof mh)}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,t,o,i,s,r)=>{V(t.parentNode,"htFiltersMenuCondition"),this.addSeparator&&V(t.parentNode,"border");const a=this.hot.rootDocument.createElement("div");return V(a,"htFiltersMenuLabel"),a.textContent=r,t.appendChild(a),t.parentElement.hasAttribute("ghost-table")||O(this.elements,l=>t.appendChild(l.element)),t}}}reset(){const e=this.hot.getPlugin("filters").getSelectedColumn();let t=[Hc(Xn)];if(e!==null){const{visualIndex:o}=e;t=due(this.hot.getDataType(0,o,this.hot.countRows(),o))}O(this.getInputElements(),o=>o.hide()),this.getSelectElement().setItems(t),super.reset(),this.getSelectElement().setValue(t[0])}constructor(e,t){super(e,{id:t.id,stateless:!1}),iN(this,sN),iN(this,rN),this.name="",this.addSeparator=!1,this.name=t.name,this.addSeparator=t.addSeparator,this.elements.push(new Sm(this.hot,{menuContainer:t.menuContainer})),this.elements.push(new mh(this.hot,{placeholder:jT})),this.elements.push(new mh(this.hot,{placeholder:qT})),this.registerHooks()}}function vue(n){O(this.getInputElements(),(e,t)=>{e[n.inputsCount>t?"show":"hide"](),e.options.type=n.inputType??"text",t===0&&this.hot._registerTimeout(()=>e.focus(),10)}),this.runLocalHooks("change",n)}function Rue(n){tf(n.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),es(n))}function Eue(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function kue(n,e){return e.get?e.get.call(n):e.value}function Tue(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function T3(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function _g(n,e){var t=T3(n,e,"get");return kue(n,t)}function aN(n,e,t){Eue(n,e),e.set(n,t)}function lN(n,e,t){var o=T3(n,e,"set");return Tue(n,o,t),t}var Bd=new WeakMap,gR=new WeakMap;class Cy extends pr{static get DEFAULTS(){return oa({type:"radio",tagName:"input",className:"htUIRadio",label:{}})}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),lN(this,gR,e),lN(this,Bd,this._element.firstChild),_g(this,Bd).checked=this.options.checked,this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(_g(this,gR).textContent=this.translateIfPossible(this.options.label.textContent))}isChecked(){return this.isBuilt()?_g(this,Bd).checked:!1}setChecked(e=!0){this.isBuilt()&&(_g(this,Bd).checked=e)}focus(){this.isBuilt()&&_g(this,Bd).focus()}constructor(e,t){super(e,Fn(Cy.DEFAULTS,t)),aN(this,Bd,{writable:!0,value:void 0}),aN(this,gR,{writable:!0,value:void 0})}}function xue(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Mue(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Iue(n,e){xue(n,e),e.add(n)}const hN=0;var cN=new WeakSet;class Hue extends ow{getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,t)=>(V(t.parentNode,"htFiltersMenuOperators"),O(this.elements,o=>t.appendChild(o.element)),t)}}buildOperatorsElement(){const e=[ph,by];O(e,t=>{const o=new Cy(this.hot,{name:"operator",label:{htmlFor:t,textContent:eue(t)},value:t,checked:t===e[hN],id:t});o.addLocalHook("change",i=>Mue(this,cN,Aue).call(this,i)),this.elements.push(o)})}setChecked(e){this.elements.length<e&&Y(pt`Radio button with index ${e} doesn't exist.`),O(this.elements,(t,o)=>{t.setChecked(o===e)})}getActiveOperationId(){const e=this.elements.find(t=>t instanceof Cy&&t.isChecked());return e?e.getValue():ph}getState(){return this.getActiveOperationId()}setState(e){this.reset(),e&&this.getActiveOperationId()!==e&&O(this.elements,t=>{t.setChecked(t.getValue()===e)})}updateState(e=ph,t){let o=e;o===LM&&(o=by),this.state.setValueAtIndex(t,o)}reset(){this.setChecked(hN)}constructor(e,t){super(e,{id:t.id,stateless:!1}),Iue(this,cN),this.name="",this.name=t.name,this.buildOperatorsElement()}}function Aue(n){this.setState(n.target.value)}function Oue(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Due(n,e){return e.get?e.get.call(n):e.value}function Nue(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function x3(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function pR(n,e){var t=x3(n,e,"get");return Due(n,t)}function Pue(n,e,t){Oue(n,e),e.set(n,t)}function Lue(n,e,t){var o=x3(n,e,"set");return Nue(n,o,t),t}var Sg=new WeakMap;class vm extends pr{static get DEFAULTS(){return oa({href:"#",tagName:"a",tabIndex:-1,role:"button"})}build(){super.build(),Lue(this,Sg,this._element.firstChild)}update(){this.isBuilt()&&(pR(this,Sg).textContent=this.translateIfPossible(this.options.textContent))}focus(){this.isBuilt()&&pR(this,Sg).focus()}activate(){pR(this,Sg).click()}constructor(e,t){super(e,Fn(vm.DEFAULTS,t)),Pue(this,Sg,{writable:!0,value:void 0})}}function M3(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Wue(n,e){return e.get?e.get.call(n):e.value}function $ue(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function I3(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Pe(n,e){var t=I3(n,e,"get");return Wue(n,t)}function Vd(n,e,t){M3(n,e),e.set(n,t)}function cs(n,e,t){var o=I3(n,e,"set");return $ue(n,o,t),t}function ab(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function lb(n,e){M3(n,e),e.add(n)}const dN="multipleSelect.itemBox";var bs=new WeakMap,Jt=new WeakMap,mR=new WeakMap,xa=new WeakMap,Al=new WeakMap,Ol=new WeakMap,uN=new WeakSet,fN=new WeakSet,gN=new WeakSet,pN=new WeakSet;class Rm extends pr{static get DEFAULTS(){return oa({className:"htUIMultipleSelect",value:[]})}getItemsBox(){return Pe(this,Jt)}registerHooks(){Pe(this,xa).addLocalHook("keydown",e=>ab(this,fN,Bue).call(this,e)),Pe(this,xa).addLocalHook("input",e=>ab(this,uN,Fue).call(this,e)),Pe(this,Al).addLocalHook("click",e=>ab(this,gN,Vue).call(this,e)),Pe(this,Ol).addLocalHook("click",e=>ab(this,pN,zue).call(this,e))}setItems(e){cs(this,bs,e),Pe(this,Jt)?.loadData(Pe(this,bs))}setLocale(e){cs(this,mR,e)}getLocale(){return Pe(this,mR)}getItems(){return[...Pe(this,bs)]}getValue(){return Yue(Pe(this,bs))}getSearchInputElement(){return Pe(this,xa)}getSelectAllElement(){return Pe(this,Al)}getClearAllElement(){return Pe(this,Ol)}isSelectedAllValues(){return Pe(this,bs).length===this.getValue().length}build(){super.build();const{rootDocument:e}=this.hot,t=e.createElement("div"),o=new pr(this.hot,{className:"htUISelectionControls",children:[Pe(this,Al),Pe(this,Ol)]});this._element.appendChild(Pe(this,xa).element),this._element.appendChild(o.element),this._element.appendChild(t),Pe(this,Jt)?.destroy(),V(t,"htUIMultipleSelectHot"),cs(this,Jt,new this.hot.constructor(t,{data:[[]],columns:[{data:"checked",type:"checkbox",label:{property:"visualValue",position:"after"}}],beforeRenderer:(r,a,l,h,c,d)=>{r.title=d.instance.getDataAtRowProp(a,d.label.property)},afterListen:()=>{this.runLocalHooks("focus",this)},beforeOnCellMouseUp:()=>{Pe(this,Jt).listen()},modifyColWidth:r=>{const a=Pe(this,Jt).container.scrollWidth-Mn(e);return r!==void 0&&r<a?a:r},autoColumnSize:!0,autoRowSize:!1,hiddenRows:!0,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"})),Pe(this,Jt).init();const s=Pe(this,Jt).getShortcutManager().getContext("grid");s.removeShortcutsByKeys(["Tab"]),s.removeShortcutsByKeys(["Shift","Tab"]),s.addShortcut({keys:[["Escape"]],callback:r=>{this.runLocalHooks("keydown",r,this)},group:dN}),s.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:r=>{Pe(this,Jt).deselectCell(),this.runLocalHooks("keydown",r,this),this.runLocalHooks("listTabKeydown",r,this)},group:dN})}focus(){this.isBuilt()&&Pe(this,Jt).listen()}reset(){Pe(this,xa).reset(),Pe(this,Al).reset(),Pe(this,Ol).reset()}update(){!this.isBuilt()||Pe(this,Jt).rootElement.offsetHeight===0||(Pe(this,Jt).updateSettings({data:Uue(Pe(this,bs),this.options.value)}),super.update())}destroy(){Pe(this,Jt)?.destroy(),Pe(this,xa).destroy(),Pe(this,Ol).destroy(),Pe(this,Al).destroy(),cs(this,xa,null),cs(this,Ol,null),cs(this,Al,null),cs(this,Jt,null),cs(this,bs,null),super.destroy()}constructor(e,t){super(e,Fn(Rm.DEFAULTS,t)),lb(this,uN),lb(this,fN),lb(this,gN),lb(this,pN),Vd(this,bs,{writable:!0,value:void 0}),Vd(this,Jt,{writable:!0,value:void 0}),Vd(this,mR,{writable:!0,value:void 0}),Vd(this,xa,{writable:!0,value:void 0}),Vd(this,Al,{writable:!0,value:void 0}),Vd(this,Ol,{writable:!0,value:void 0}),cs(this,bs,[]),cs(this,xa,new mh(this.hot,{placeholder:GT,className:"htUIMultipleSelectSearch"})),cs(this,Al,new vm(this.hot,{textContent:VT,className:"htUISelectAll"})),cs(this,Ol,new vm(this.hot,{textContent:zT,className:"htUIClearAll"})),this.registerHooks()}}function Fue(n){const t=n.target.value.trim().toLocaleLowerCase(this.getLocale());if(this.options.searchMode==="apply"){const o=Pe(this,Jt).getPlugin("hiddenRows"),i=[];o.showRows(o.getHiddenRows()),Pe(this,bs).forEach((s,r)=>{s.checked=`${s.value}`.toLocaleLowerCase(this.getLocale()).indexOf(t)>=0,s.checked||i.push(r)}),o.hideRows(i),Pe(this,Jt).view.adjustElementsSize(),Pe(this,Jt).render()}else{let o;t===""?o=[...Pe(this,bs)]:o=Pe(this,bs).filter(i=>`${i.value}`.toLocaleLowerCase(this.getLocale()).indexOf(t)>=0),Pe(this,Jt).loadData(o)}}function Bue(n){this.runLocalHooks("keydown",n,this),RF(tf,n.keyCode)("ARROW_DOWN")&&(n.preventDefault(),es(n),Pe(this,Jt).listen(),Pe(this,Jt).selectCell(0,0))}function Vue(n){const e=[];n.preventDefault(),Pe(this,Jt).getSourceData().forEach((t,o)=>{t.checked=!0,e.push(CB(t,o)[0])}),Pe(this,Jt).setSourceDataAtCell(e)}function zue(n){const e=[];n.preventDefault(),Pe(this,Jt).getSourceData().forEach((t,o)=>{t.checked=!1,e.push(CB(t,o)[0])}),Pe(this,Jt).setSourceDataAtCell(e)}function Uue(n,e){const t=iw(e);return n.map(o=>(o.checked=t(o.value),o))}function Yue(n){const e=[];return n.forEach(t=>{t.checked&&e.push(t.value)}),e}function Gue(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hb(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function wR(n,e){Gue(n,e),e.add(n)}var mN=new WeakSet,bR=new WeakSet,wN=new WeakSet;class jue extends ow{registerHooks(){this.getMultipleSelectElement().addLocalHook("keydown",e=>hb(this,mN,que).call(this,e)).addLocalHook("listTabKeydown",e=>this.runLocalHooks("listTabKeydown",e)),this.hot.addHook("modifyFiltersMultiSelectValue",(e,t)=>hb(this,wN,Kue).call(this,e,t))}getElements(){const e=this.getMultipleSelectElement();return[e.getSearchInputElement(),e.getSelectAllElement(),e.getClearAllElement(),this.getMultipleSelectElement()]}setState(e){if(this.reset(),e&&e.command.key===lh){const t=this.getMultipleSelectElement();t.setItems(e.itemsSnapshot),t.setValue(e.args[0]),t.setLocale(e.locale)}}getState(){const e=this.getMultipleSelectElement(),t=e.getItems();return{command:{key:e.isSelectedAllValues()||!t.length?Xn:lh},args:[e.getValue()],itemsSnapshot:t}}updateState(e){const t=(o,i,s,r,a)=>{const[l]=Gc(i,d=>d.name===lh),h={},c=this.hot.getTranslatedPhrase(LC);if(l){const d=r(o,a),u=Mt(d,T=>T.value),f=new Map(d.map(T=>[T.value,T.meta])),p=D0(u);s&&(l.args[0]=s);const C=[],y=KD(p,l.args[0],c,T=>{T.checked&&C.push(T.value),hb(this,bR,bN).call(this,T,f)}),_=e.editedConditionStack.column;h.locale=this.hot.getCellMeta(0,_).locale,h.args=[C],h.command=Hc(lh),h.itemsSnapshot=y}else h.args=[],h.command=Hc(Xn);this.state.setValueAtIndex(o,h)};t(e.editedConditionStack.column,e.editedConditionStack.conditions,e.conditionArgsChange,e.filteredRowsFactory),e.dependentConditionStacks.length&&t(e.dependentConditionStacks[0].column,e.dependentConditionStacks[0].conditions,e.conditionArgsChange,e.filteredRowsFactory,e.editedConditionStack)}getMultipleSelectElement(){return this.elements.filter(e=>e instanceof Rm)[0]}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden()||typeof this.hiddenWhen=="function"&&this.hiddenWhen(),renderer:(e,t,o,i,s,r)=>{V(t.parentNode,"htFiltersMenuValue");const a=this.hot.rootDocument.createElement("div");return V(a,"htFiltersMenuLabel"),a.textContent=r,t.appendChild(a),t.parentElement.hasAttribute("ghost-table")||O(this.elements,l=>t.appendChild(l.element)),t}}}reset(){const e=this.hot.getTranslatedPhrase(LC),t=this._getColumnVisibleValues(),o=t.map(l=>l.value),i=new Map(t.map(l=>[l.value,l.meta])),s=D0(o),r=KD(s,s,e,l=>{hb(this,bR,bN).call(this,l,i)});this.getMultipleSelectElement().setItems(r),super.reset(),this.getMultipleSelectElement().setValue(s);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?[]:Mt(this.hot.getDataAtCol(e.visualIndex),(t,o)=>({value:NM(t),meta:this.hot.getCellMeta(o,e.visualIndex)}))}constructor(e,t){super(e,{id:t.id,stateless:!1}),wR(this,mN),wR(this,bR),wR(this,wN),this.name="",this.name=t.name,this.searchMode=t.searchMode,this.hiddenWhen=t.hiddenWhen,this.elements.push(new Rm(this.hot,{searchMode:this.searchMode})),this.registerHooks()}}function que(n){tf(n.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),es(n)),tf(n.keyCode,"ENTER")&&(this.searchMode==="apply"&&this.runLocalHooks("accept"),es(n))}function bN(n,e){this.hot.hasHook("modifyFiltersMultiSelectValue")&&(n.visualValue=this.hot.runHooks("modifyFiltersMultiSelectValue",n.visualValue,e.get(n.value)))}function Kue(n,e){return e.valueFormatter?e.valueFormatter(n,e):n}function Xue(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Zue(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Que(n,e){Xue(n,e),e.add(n)}var CN=new WeakSet;class Em extends ow{static get BUTTON_OK(){return"ok"}static get BUTTON_CANCEL(){return"cancel"}registerHooks(){O(this.elements,e=>{e.addLocalHook("click",(t,o)=>Zue(this,CN,Jue).call(this,t,o))})}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,t)=>(V(t.parentNode,"htFiltersMenuActionBar"),O(this.elements,o=>t.appendChild(o.element)),t)}}accept(){this.runLocalHooks("accept")}cancel(){this.runLocalHooks("cancel")}constructor(e,t){super(e,{id:t.id,stateless:!0}),Que(this,CN),this.name="",this.name=t.name,this.elements.push(new mh(this.hot,{type:"button",value:UT,className:"htUIButton htUIButtonOK",identifier:Em.BUTTON_OK})),this.elements.push(new mh(this.hot,{type:"button",value:YT,className:"htUIButton htUIButtonCancel",identifier:Em.BUTTON_CANCEL})),this.registerHooks()}}function Jue(n,e){e.options.identifier===Em.BUTTON_OK?this.accept():this.cancel()}const yN="ConditionCollection.filteringStates";class WM{isEmpty(){return this.getFilteredColumns().length===0}isMatch(e,t){const o=this.filteringStates.getValueAtIndex(t),i=o?.conditions??[],s=o?.operation;return this.isMatchInConditions(i,e,s)}isMatchInConditions(e,t,o=ph){return e.length?Jde(o)(e,t):!0}addCondition(e,t,o=ph,i){const s=this.hot.getCellMeta(0,e).locale,r=t.args.map(c=>typeof c=="string"?c.toLocaleLowerCase(s):c),a=t.name||t.command.key;this.runLocalHooks("beforeAdd",e);const l=this.getOperation(e);l?l!==o&&Y(pt`The column of index ${e} has been already applied with a \`${l}\`\x20
252
- filter operation. Use \`removeConditions\` to clear the current conditions and then add new ones.\x20
253
- Mind that you cannot mix different types of operations (for instance, if you use \`conjunction\`,\x20
254
- use it consequently for a particular column).`):en(_m[o])&&Y(pt`Unexpected operation named \`${o}\`. Possible ones are\x20
255
- \`disjunction\` and \`conjunction\`.`);const h=this.getConditions(e);h.length===0?this.filteringStates.setValueAtIndex(e,{operation:o,conditions:[{name:a,args:r,func:Ts(a,r)}]},i):h.push({name:a,args:r,func:Ts(a,r)}),this.runLocalHooks("afterAdd",e)}getConditions(e){return this.filteringStates.getValueAtIndex(e)?.conditions??[]}getOperation(e){return this.filteringStates.getValueAtIndex(e)?.operation}getFilteredColumns(){return this.filteringStates.getEntries().map(([e])=>e)}getColumnStackPosition(e){return this.getFilteredColumns().indexOf(e)}exportAllConditions(){return this.filteringStates.getEntries().reduce((e,[t,{operation:o,conditions:i}])=>(e.push({column:t,operation:o,conditions:i.map(({name:s,args:r})=>({name:s,args:[...r]}))}),e),[])}importAllConditions(e){this.clean(),e.forEach(t=>{t.conditions.forEach(o=>this.addCondition(t.column,o,t.operation))})}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,t){const o=this.getConditions(e);return t?o.some(i=>i.name===t):o.length>0}destroy(){this.isMapRegistrable&&this.hot.columnIndexMapper.unregisterMap(yN),this.filteringStates=null,this.clearLocalHooks()}constructor(e,t=!0){this.filteringStates=new Yy,this.hot=e,this.isMapRegistrable=t,this.isMapRegistrable===!0?this.hot.columnIndexMapper.registerMap(yN,this.filteringStates):this.filteringStates.init(this.hot.columnIndexMapper.getNumberOfIndexes())}}_t(WM,Bn);class H3{filter(){let e=[];return O(this.conditionCollection.getFilteredColumns(),(t,o)=>{let i=this.columnDataFactory(t);o&&(i=this._getIntersectData(i,e)),e=this.filterByColumn(t,i)}),e}filterByColumn(e,t=[]){const o=[];return O(t,i=>{i!==void 0&&this.conditionCollection.isMatch(i,e)&&o.push(i)}),o}_getIntersectData(e,t){const o=[];return O(t,i=>{const s=i.meta.row;e[s]!==void 0&&(o[s]=e[s])}),o}constructor(e,t=()=>[]){this.conditionCollection=e,this.columnDataFactory=t}}function efe(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function CR(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function yR(n,e){efe(n,e),e.add(n)}var _N=new WeakSet,SN=new WeakSet,vN=new WeakSet;class A3{groupChanges(){this.grouping=!0}flush(){this.grouping=!1,O(this.changes,e=>{this.updateStatesAtColumn(e)}),this.changes.length=0}updateStatesAtColumn(e,t){if(this.grouping){this.changes.indexOf(e)===-1&&this.changes.push(e);return}const o=this.conditionCollection.exportAllConditions();let i=this.conditionCollection.getColumnStackPosition(e);i===-1&&(i=this.latestEditedColumnPosition);const s=o.slice(0,i),r=o.slice(i);r.length&&r[0].column===e&&r.shift();const a=Y4((h,c,d=[])=>{const u=new WM(this.hot,!1),f=[].concat(h,d);u.importAllConditions(f);const p=this.columnDataFactory(c);let C;u.isEmpty()?C=p:C=new H3(u,T=>this.columnDataFactory(T)).filter();const y=Mt(C,T=>T.meta.row),_=iw(y);return u.destroy(),Gc(p,T=>_(T.meta.row))})(s),l=[].concat(this.conditionCollection.getConditions(e));this.runLocalHooks("update",{editedConditionStack:{column:e,conditions:l},dependentConditionStacks:r,filteredRowsFactory:a,conditionArgsChange:t})}destroy(){this.clearLocalHooks(),nt(this,(e,t)=>{this[t]=null})}constructor(e,t,o=()=>[]){yR(this,_N),yR(this,SN),yR(this,vN),this.changes=[],this.grouping=!1,this.latestEditedColumnPosition=-1,this.latestOrderStack=[],this.hot=e,this.conditionCollection=t,this.columnDataFactory=o,this.conditionCollection.addLocalHook("beforeRemove",i=>CR(this,_N,tfe).call(this,i)),this.conditionCollection.addLocalHook("afterRemove",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("afterAdd",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("beforeClean",()=>CR(this,SN,nfe).call(this)),this.conditionCollection.addLocalHook("afterClean",()=>CR(this,vN,ofe).call(this))}}function tfe(n){this.latestEditedColumnPosition=this.conditionCollection.getColumnStackPosition(n)}function nfe(){this.latestOrderStack=this.conditionCollection.getFilteredColumns()}function ofe(){O(this.latestOrderStack,n=>{this.updateStatesAtColumn(n)})}_t(A3,Bn);function ife(n){return gU({initialPage:0,size:()=>n.length,onItemSelect:(t,o)=>{const i=n[t];if(i instanceof Rm)return o;if(i.element&&!Kc(i.element))return!1;i.focus()}})}const vg="filters";function sfe(n,e){let t=-1,o;const i=ife(e),s=d=>()=>{o.isOpened()&&o.getKeyboardShortcutsCtrl().listen(vg),i.setCurrentPage(e.indexOf(d))};e.forEach(d=>{d instanceof pr&&(d.addLocalHook("click",s(d)),d.addLocalHook("focus",s(d)),d.addLocalHook("afterClose",s(d)))}),l(n);function r(d){const u=o.getKeyboardShortcutsCtrl(),f=d.getKeyboardShortcutsCtrl();i.clear(),f.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],forwardToContext:u.getContext(vg),callback:()=>{d.isSubMenu()&&d.close(),u.listen(vg)}}]),!d.isSubMenu()&&u.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:p=>{const C=o.getNavigator();C.getCurrentPage()>-1&&(t=C.getCurrentPage()),C.clear(),p.shiftKey?i.toPreviousItem():i.toNextItem()}},{keys:[["Escape"]],callback:()=>{o.close()}},{keys:[["Enter"],["Space"]],preventDefault:!1,callback:p=>{const C=e[i.getCurrentPage()];C instanceof Sm&&(C.openOptions(),p.preventDefault()),C instanceof vm&&(C.activate(),p.preventDefault()),C instanceof pr||p.preventDefault()}}],vg)}function a(){o.focus(),o.getKeyboardShortcutsCtrl().listen(vg)}function l(d){d.addLocalHook("afterSelectionChange",u=>{u.key.startsWith("filter_")||i.clear()}),d.addLocalHook("afterSubmenuOpen",r),d.addLocalHook("afterOpen",r),o=d}function h(){return o}function c(){return t}return{...i,listen:a,setMenu:l,getMenu:h,getLastMenuPage:c}}function O3(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function rfe(n,e){return e.get?e.get.call(n):e.value}function afe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function D3(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function ao(n,e){var t=D3(n,e,"get");return rfe(n,t)}function Rg(n,e,t){O3(n,e),e.set(n,t)}function Js(n,e,t){var o=D3(n,e,"set");return afe(n,o,t),t}function vi(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function ds(n,e){O3(n,e),e.add(n)}const P0="filters",lfe=250,RN=P0;var Na=new WeakMap,yy=new WeakMap,Br=new WeakMap,wC=new WeakMap,ql=new WeakMap,EN=new WeakSet,kN=new WeakSet,TN=new WeakSet,xN=new WeakSet,MN=new WeakSet,IN=new WeakSet,HN=new WeakSet,_R=new WeakSet,AN=new WeakSet,SR=new WeakSet,ON=new WeakSet,DN=new WeakSet;class hfe extends at{static get PLUGIN_KEY(){return P0}static get PLUGIN_PRIORITY(){return lfe}static get DEFAULT_SETTINGS(){return{searchMode:"show"}}static get SETTINGS_VALIDATORS(){return{searchMode:e=>typeof e=="string"&&["show","apply"].includes(e)}}static get PLUGIN_DEPS(){return["plugin:DropdownMenu","plugin:HiddenRows","cell-type:checkbox"]}isEnabled(){return!!this.hot.getSettings()[P0]}enablePlugin(){if(this.enabled)return;Js(this,ql,this.hot.runHooks("hasExternalDataSource")===!0),this.filtersRowsMap=this.hot.rowIndexMapper.registerMap(this.pluginName,new of),this.dropdownMenuPlugin=this.hot.getPlugin("dropdownMenu");const e=this.hot.getSettings().dropdownMenu,t=e&&e.uiContainer||this.hot.rootPortalElement,o=r=>(r.addLocalHook("accept",()=>vi(this,_R,NN).call(this,"accept")),r.addLocalHook("cancel",()=>vi(this,_R,NN).call(this,"cancel")),r.addLocalHook("change",a=>vi(this,AN,wfe).call(this,r,a)),r),i=()=>`${this.hot.getTranslatedPhrase($T)}:`,s=()=>`${this.hot.getTranslatedPhrase(FT)}:`;if(!this.components.get("filter_by_condition")){const r=new N0(this.hot,{id:"filter_by_condition",name:i,addSeparator:!1,menuContainer:t});r.addLocalHook("afterClose",()=>vi(this,SR,PN).call(this)),this.components.set("filter_by_condition",o(r))}if(this.components.get("filter_operators")||this.components.set("filter_operators",new Hue(this.hot,{id:"filter_operators",name:"Operators"})),!this.components.get("filter_by_condition2")){const r=new N0(this.hot,{id:"filter_by_condition2",name:"",addSeparator:!0,menuContainer:t});r.addLocalHook("afterClose",()=>vi(this,SR,PN).call(this)),this.components.set("filter_by_condition2",o(r))}if(!this.components.get("filter_by_value")){const r=this.getSetting("searchMode");this.components.set("filter_by_value",o(new jue(this.hot,{id:"filter_by_value",name:s,searchMode:r,hiddenWhen:()=>ao(this,ql)})))}if(this.components.get("filter_action_bar")||this.components.set("filter_action_bar",o(new Em(this.hot,{id:"filter_action_bar",name:"Action bar"}))),this.conditionCollection||(this.conditionCollection=new WM(this.hot)),this.conditionUpdateObserver||(this.conditionUpdateObserver=new A3(this.hot,this.conditionCollection,r=>this.getDataMapAtColumn(r)),this.conditionUpdateObserver.addLocalHook("update",r=>vi(this,DN,Cfe).call(this,r))),this.components.forEach(r=>r.show()),this.addHook("afterDropdownMenuDefaultOptions",(...r)=>vi(this,HN,mfe).call(this,...r)),this.addHook("beforeDropdownMenuShow",()=>vi(this,IN,pfe).call(this)),this.addHook("afterDropdownMenuShow",()=>vi(this,xN,ffe).call(this)),this.addHook("afterDropdownMenuHide",()=>vi(this,MN,gfe).call(this)),this.addHook("afterChange",r=>vi(this,EN,cfe).call(this,r)),this.addHook("afterDataProviderFetch",r=>vi(this,kN,dfe).call(this,r)),this.addHook("afterDataProviderFetchError",()=>vi(this,TN,ufe).call(this)),this.hot.getSettings().dropdownMenu&&this.dropdownMenuPlugin&&(this.dropdownMenuPlugin.disablePlugin(),this.dropdownMenuPlugin.enablePlugin()),!ao(this,Na)&&this.dropdownMenuPlugin.enabled){const r=[{focus:()=>{const l=ao(this,Na).getMenu(),h=l.getNavigator(),c=ao(this,Na).getLastMenuPage();l.focus(),c>0?h.setCurrentPage(c):h.toFirstItem()}},...Array.from(this.components).map(([,l])=>l.getElements()).flat()];Js(this,Na,sfe(this.dropdownMenuPlugin.menu,r));const a=l=>{ao(this,Na).listen(),l.preventDefault(),tf(l.keyCode,"TAB")&&(l.shiftKey?ao(this,Na).toPreviousItem():ao(this,Na).toNextItem())};this.components.get("filter_by_value").addLocalHook("listTabKeydown",a),this.components.get("filter_by_condition").addLocalHook("selectTabKeydown",a)}this.registerShortcuts(),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.enabled&&(this.dropdownMenuPlugin?.enabled&&this.dropdownMenuPlugin.menu.clearLocalHooks(),this.components.forEach((e,t)=>{e.destroy(),this.components.set(t,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:RN})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(RN)}addCondition(e,t,o,i=ph){if(t===lh&&ao(this,ql))return;const s=this.hot.toPhysicalColumn(e);this.conditionCollection.addCondition(s,{command:{key:t},args:o},i)}removeConditions(e){const t=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(t)}clearConditions(e){if(e===void 0)this.conditionCollection.clean();else{const t=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(t)}}importConditions(e){this.conditionCollection.importAllConditions(e)}exportConditions(){return this.conditionCollection.exportAllConditions()}filter(){const{navigableHeaders:e}=this.hot.getSettings(),t=!this.conditionCollection.isEmpty(),o=this.exportConditions();ao(this,ql)&&Js(this,wC,Jn(ao(this,Br)));const i=this.hot.runHooks("beforeFilter",o,ao(this,Br));if(i!==!1&&t){const s=this._createDataFilter(),r=[];let a=[];this.hot.batchExecution(()=>{this.filtersRowsMap.clear(),a=Mt(s.filter(),h=>h.meta.row);const l=iw(a);Re(this.hot.countSourceRows()-1,h=>{l(h)||r.push(h)}),O(r,h=>{this.filtersRowsMap.setValueAtIndex(h,!0)})},!0),!e&&!a.length&&this.hot.deselectCell(),Js(this,Br,this.exportConditions())}else i!==!1&&!t?(Js(this,Br,this.exportConditions()),this.filtersRowsMap.clear()):ao(this,ql)?Js(this,Br,this.exportConditions()):this.importConditions(ao(this,Br));this.hot.selection.isSelected()&&this.hot.selectCell(e?-1:0,this.hot.getSelectedRangeActive().highlight.col),i!==!1&&(this.hot.runHooks("afterFilter",o),this.hot.view.adjustElementsSize(),this.hot.render())}getSelectedColumn(){const e=this.hot.getSelectedRangeActive()?.highlight;return e?{visualIndex:e.col,physicalIndex:this.hot.toPhysicalColumn(e.col)}:null}getDataMapAtColumn(e){const t=this.hot.countSourceRows(),o=this.hot.toVisualColumn(e),i=[];for(let s=0;s<t;s++){const r=this.hot._getMetaManager().getCellMeta(s,e,{visualRow:s,visualColumn:e,skipMetaExtension:!0});let a=Jy(this.hot.getSourceDataAtCell(s,o),r);if(this.hot.hasHook("modifyData")){const l=Li(a);this.hot.runHooks("modifyData",s,e,l,"get"),l.isTouched()&&(a=l.value)}i.push({meta:r,value:NM(a)})}return i}updateValueComponentCondition(e){const t=this.hot.toVisualColumn(e),o=this.hot.getDataAtCol(t),i=D0(o);this.conditionUpdateObserver.updateStatesAtColumn(e,i)}restoreComponents(e){const t=this.getSelectedColumn()?.physicalIndex;e.forEach(o=>{o.isHidden()||o.restoreState(t)}),this.updateDependentComponentsVisibility()}getOperationBasedOnArguments(e,t,o,i){let s=e;return s===by&&t.command.key!==Xn&&o.command.key!==Xn&&i.command.key!==Xn?s=LM:i.command.key!==Xn&&(t.command.key===Xn||o.command.key===Xn)&&(s=ph),s}setListeningDropdownMenu(){this.dropdownMenuPlugin&&this.dropdownMenuPlugin.setListening()}updateDependentComponentsVisibility(){const e=this.components.get("filter_by_condition"),{command:t}=e.getState(),o=[this.components.get("filter_by_condition2"),this.components.get("filter_operators")];t.showOperators?this.showComponents(...o):this.hideComponents(...o)}_createDataFilter(e=this.conditionCollection){return new H3(e,t=>this.getDataMapAtColumn(t))}getIndexesOfComponents(...e){const t=[];if(!this.dropdownMenuPlugin)return t;const o=this.dropdownMenuPlugin.menu;return O(e,i=>{O(o.menuItems,(s,r)=>{s.key===i.getMenuItemDescriptor().key&&t.push(r)})}),t}changeComponentsVisibility(e=!0,...t){if(!this.dropdownMenuPlugin)return;const i=this.dropdownMenuPlugin.menu.hotMenu,s=i.getPlugin("hiddenRows"),r=this.getIndexesOfComponents(...t);e?s.showRows(r):s.hideRows(r),i.render()}hideComponents(...e){this.changeComponentsVisibility(!1,...e)}showComponents(...e){this.changeComponentsVisibility(!0,...e)}destroy(){this.enabled&&(this.components.forEach((e,t)=>{e!==null&&(e.destroy(),this.components.set(t,null))}),this.conditionCollection.destroy(),this.conditionUpdateObserver.destroy(),this.hot.rowIndexMapper.unregisterMap(this.pluginName)),super.destroy()}constructor(e){super(e),ds(this,EN),ds(this,kN),ds(this,TN),ds(this,xN),ds(this,MN),ds(this,IN),ds(this,HN),ds(this,_R),ds(this,AN),ds(this,SR),ds(this,ON),ds(this,DN),Rg(this,Na,{writable:!0,value:void 0}),Rg(this,yy,{writable:!0,value:void 0}),Rg(this,Br,{writable:!0,value:void 0}),Rg(this,wC,{writable:!0,value:void 0}),Rg(this,ql,{writable:!0,value:void 0}),this.dropdownMenuPlugin=null,this.conditionCollection=null,this.conditionUpdateObserver=null,this.components=new Map([["filter_by_condition",null],["filter_operators",null],["filter_by_condition2",null],["filter_by_value",null],["filter_action_bar",null]]),this.filtersRowsMap=null,Js(this,yy,new WeakSet),Js(this,Br,[]),Js(this,wC,[]),Js(this,ql,!1),this.hot.addHook("afterGetColHeader",(...t)=>vi(this,ON,bfe).call(this,...t))}}function cfe(n){n&&O(n,e=>{const[,t]=e,o=this.hot.propToCol(t),i=this.hot.toPhysicalColumn(o);this.conditionCollection.hasConditions(i)&&this.updateValueComponentCondition(i)})}function dfe(n){this.importConditions(n?.filtersConditionsStack??[])}function ufe(){this.importConditions(ao(this,wC))}function ffe(){const n=this.dropdownMenuPlugin.menu;this.restoreComponents(Array.from(this.components.values())),n.updateMenuDimensions()}function gfe(){this.components.get("filter_by_condition").getSelectElement().closeOptions(),this.components.get("filter_by_condition2").getSelectElement().closeOptions()}function pfe(){const n=this.dropdownMenuPlugin.menu;ao(this,yy).has(n)||ao(this,Na).setMenu(n),ao(this,yy).add(n)}function mfe(n){n.items.push({name:Ae}),this.components.forEach(e=>{n.items.push(e.getMenuItemDescriptor())})}function NN(n){if(n==="accept"){const e=this.getSelectedColumn();if(e===null){this.dropdownMenuPlugin?.close();return}const{physicalIndex:t}=e,o=this.components.get("filter_by_condition").getState(),i=this.components.get("filter_by_condition2").getState(),s=this.components.get("filter_by_value").getState(),r=this.getOperationBasedOnArguments(this.components.get("filter_operators").getActiveOperationId(),o,i,s);this.conditionUpdateObserver.groupChanges();let a=this.conditionCollection.getColumnStackPosition(t);a===-1&&(a=void 0),this.conditionCollection.removeConditions(t),o.command.key!==Xn&&(this.conditionCollection.addCondition(t,o,r,a),i.command.key!==Xn&&this.conditionCollection.addCondition(t,i,r,a)),s.command.key!==Xn&&!ao(this,ql)&&this.conditionCollection.addCondition(t,s,r,a),this.conditionUpdateObserver.flush(),this.components.forEach(l=>l.saveState(t)),this.filter()}this.dropdownMenuPlugin?.close()}function wfe(n,e){const t=this.dropdownMenuPlugin.menu;this.updateDependentComponentsVisibility(),n.constructor===N0&&!e.inputsCount&&this.setListeningDropdownMenu(),t.updateMenuDimensions()}function PN(){this.setListeningDropdownMenu()}function bfe(n,e){const t=this.hot.toPhysicalColumn(n);this.enabled&&this.conditionCollection.hasConditions(t)&&uf(e)?V(e,"htFiltersActive"):re(e,"htFiltersActive")}function Cfe(n){if(!this.dropdownMenuPlugin?.enabled)return;const{editedConditionStack:{conditions:e,column:t},conditionArgsChange:o}=n;Array.isArray(o)&&Js(this,Br,ao(this,Br).map(r=>(r.column===t&&e.length>0&&r.conditions.forEach(a=>{a.name==="by_value"&&(a.args=[[...o]])}),r)));const i=e.filter(r=>r.name===lh),s=e.filter(r=>r.name!==lh);if(i.length>=2||s.length>=3)Ie(pt`The filter conditions have been applied properly, but couldn’t be displayed visually.\x20
256
- The dropdown menu supports at most 2 regular conditions and 1 'filter by value' condition per column,\x20
257
- but more were provided. For more details see the documentation.`);else{const r=this.conditionCollection.getOperation(t);this.components.get("filter_by_condition").updateState(s[0],t),this.components.get("filter_by_condition2").updateState(s[1],t),this.components.get("filter_operators").updateState(r,t),this.components.get("filter_by_value").updateState(n)}}const N3="internal-use-in-handsontable",L0={licenseKey:N3,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 P3(n){return{maxColumns:n.maxColumns,maxRows:n.maxRows,language:n[Qo]?.language?.langCode}}function L3(n){return Object.keys(n).reduce((e,t)=>(t!=="hyperformula"&&(e[t]=n[t]),e),{})}function yfe(n){const e=n[Qo],t=L3(e?.engine?.hyperformula?e.engine:{}),o=P3(n);return{...L0,...t,...o}}function _fe(n){const e=n[Qo],t=L3(e?.engine?.hyperformula?e.engine:{}),o=P3(n);return{...t,...o}}function Sfe(n,e){return Object.keys(e).some(t=>e[t]!==void 0&&e[t]!==n[t])}function N_(){const n="engine_relationship",e=ts(Qo);return e.hasItem(n)||e.register(n,new Map),e.getItem(n)}function $M(){const n="shared_engine_usage",e=ts(Qo);return e.hasItem(n)||e.register(n,new Map),e.getItem(n)}function vfe(n){const e=n.getSettings(),t=e[Qo],o=t?.engine;if(t===!0||en(o))return null;if(typeof o.hyperformula=="function"||typeof o=="function")return Rfe(o.hyperformula??o,e,n);if(typeof o=="object"&&en(o.hyperformula)){const i=N_(),s=$M().get(o);return i.has(o)||i.set(o,[]),i.get(o).push(n),s&&s.push(n.guid),o.getConfig().licenseKey||o.updateConfig({licenseKey:N3}),(o.getConfig().leapYear1900!==L0.leapYear1900||bh(o.getConfig().nullDate,L0.nullDate)===!1)&&Ie(pt`If you use HyperFormula with Handsontable, keep the default \`leapYear1900\` and \`nullDate\`
258
- settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates.`),o}return null}function Rfe(n,e,t){const o=e[Qo],i=yfe(e),s=N_(),r=$M();Efe(n,o.functions),kfe(n,o.language);const a=n.buildEmpty(i);return s.set(a,[t]),r.set(a,[t.guid]),Tfe(a,o.namedExpressions),a.on("sheetAdded",()=>{a.rebuildAndRecalculate()}),a.on("sheetRemoved",()=>{a.rebuildAndRecalculate()}),a}function LN(n){const e=N_(),t=e.size===0?[]:Array.from(e.get(n)??[]);return new Map(t.map(o=>[o.getPlugin("formulas").sheetId,o]))}function WN(n,e){if(n){const t=N_(),o=t.get(n),i=$M(),s=i.get(n);o&&o.includes(e)&&(o.splice(o.indexOf(e),1),o.length===0&&t.delete(n)),s&&s.includes(e.guid)&&(s.splice(s.indexOf(e.guid),1),s.length===0&&(i.delete(n),n.destroy()))}}function Efe(n,e){e&&e.forEach(t=>{const{name:o,plugin:i,translations:s}=t;try{n.registerFunction(o,i,s)}catch(r){Ie(r.message)}})}function kfe(n,e){if(e){const{langCode:t}=e;try{n.registerLanguage(t,e)}catch(o){Ie(o.message)}}}function Tfe(n,e){e&&(n.suspendEvaluation(),e.forEach(t=>{const{name:o,expression:i,scope:s,options:r}=t;try{n.addNamedExpression(o,i,s,r)}catch(a){Ie(a.message)}}),n.resumeEvaluation())}function xfe(n,e){return(en(e)||!n.doesSheetExist(e))&&(e=n.addSheet(e)),e}const W3="DD/MM/YYYY";function Mfe(n){return typeof n=="string"&&n.charAt(0)==="'"&&n.charAt(1)==="="}function Ife(n){return Mfe(n)?n.substr(1):n}function Hfe(n){return typeof n=="string"&&n.startsWith("=")}function FM(n,e){return typeof n=="string"&&e==="date"}function $3(n,e){return Z(n,e,!0).isValid()}function F3(n,e){return Z(n,e,!0).format(W3)}function Afe(n,e){return Z(n,W3,!0).format(e)}function B3(n,e){const o=new Date(Date.UTC(0,0,n+-1));return Z(o).format(e)}function V3(n){return Array.isArray(n)?v2(n):n}function Ofe(n,e,t){const o=Array.from(Array(t).keys()).filter(i=>n.includes(i)===!1);return e===0?o[e]??0:o[e-1]+1}function Dfe(n,e){const t=[];return n.forEach(o=>{const i={from:o,to:e};t.forEach(s=>{const r=s.from>s.to,a=s.to<=i.from;s.from>i.from&&a&&r&&(i.from+=1)}),i.from>=e&&(e+=1),t.push(i)}),t}function Nfe(n){return n.forEach((e,t)=>{n.slice(t+1).forEach(i=>{const s=i.from<i.to;i.from>e.from&&s&&(i.from-=1)})}),n}function BM(n,e,t){const o=Dfe(n,Ofe(n,e,t));return Nfe(o)}function Pfe(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Lfe(n,e){return e.get?e.get.call(n):e.value}function Wfe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function z3(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Xt(n,e){var t=z3(n,e,"get");return Lfe(n,t)}function Zh(n,e,t){Pfe(n,e),e.set(n,t)}function Ds(n,e,t){var o=z3(n,e,"set");return Wfe(n,o,t),t}var Eg=new WeakMap,Dl=new WeakMap,zi=new WeakMap,kg=new WeakMap,cb=new WeakMap,vR=new WeakMap,Tg=new WeakMap;class $N{setRemovedHfIndexes(e){return Ds(this,Tg,e.map(t=>{const o=Xt(this,Dl).getVisualFromPhysicalIndex(t);return this.getHfIndexFromVisualIndex(o)})),Xt(this,Tg)}getRemovedHfIndexes(){return Xt(this,Tg)}getHfIndexFromVisualIndex(e){const t=Xt(this,Dl).getIndexesSequence(),o=Xt(this,Dl).getNotTrimmedIndexes();return t.indexOf(o[e],e)}syncMoves(e){const o=`move${mr(Xt(this,Eg))}s`;Xt(this,zi).getEngine().batch(()=>{e.forEach(i=>{const s=i.from!==i.to,r=i.from+1!==i.to;s&&r&&Xt(this,zi).getEngine()[o](Xt(this,zi).getSheetId(),i.from,1,i.to)})})}storeMovesInformation(e,t,o){o!==!1&&(Ds(this,cb,e.map(i=>this.getHfIndexFromVisualIndex(i))),Ds(this,vR,this.getHfIndexFromVisualIndex(t)))}calculateAndSyncMoves(e,t){if(Xt(this,zi).isPerformingUndoRedo()||e===!1||t===!1)return;const o=BM(Xt(this,cb),Xt(this,vR),Xt(this,Dl).getNumberOfIndexes());Xt(this,zi).getSheetId()===null?Xt(this,zi).getPostponeAction(()=>this.syncMoves(o)):this.syncMoves(o)}getIndexesChangeSyncMethod(){const e=`set${mr(Xt(this,Eg))}Order`;return t=>{if(Xt(this,zi).isPerformingUndoRedo())return;const o=Xt(this,Dl).getIndexesSequence();if(t==="update"&&o.length>0){const i=Xt(this,kg).map(l=>o.indexOf(l)),s=Xt(this,zi).getEngine().getSheetDimensions(Xt(this,zi).getSheetId());let r;Xt(this,Eg)==="row"?r=s.height:r=s.width;const a=i.length;for(let l=a;l<r;l+=1)i.push(l);Xt(this,zi).getEngine()[e](Xt(this,zi).getSheetId(),i)}Ds(this,kg,o)}}init(){Ds(this,kg,Xt(this,Dl).getIndexesSequence())}constructor(e,t,o){Zh(this,Eg,{writable:!0,value:void 0}),Zh(this,Dl,{writable:!0,value:void 0}),Zh(this,zi,{writable:!0,value:void 0}),Zh(this,kg,{writable:!0,value:void 0}),Zh(this,cb,{writable:!0,value:void 0}),Zh(this,vR,{writable:!0,value:void 0}),Zh(this,Tg,{writable:!0,value:void 0}),Ds(this,kg,[]),Ds(this,cb,[]),Ds(this,Tg,[]),Ds(this,Eg,e),Ds(this,Dl,t),Ds(this,zi,o)}}function $fe(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ffe(n,e){return e.get?e.get.call(n):e.value}function Bfe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function U3(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Ma(n,e){var t=U3(n,e,"get");return Ffe(n,t)}function Qh(n,e,t){$fe(n,e),e.set(n,t)}function Ns(n,e,t){var o=U3(n,e,"set");return Bfe(n,o,t),t}var db=new WeakMap,ub=new WeakMap,RR=new WeakMap,fb=new WeakMap,gb=new WeakMap,pb=new WeakMap,mb=new WeakMap;class Vfe{getForAxis(e){return e==="row"?Ma(this,db):Ma(this,ub)}setPerformUndo(e){Ns(this,fb,e)}setPerformRedo(e){Ns(this,gb,e)}isPerformingUndoRedo(){return Ma(this,fb)||Ma(this,gb)}getSheetId(){return Ma(this,mb)}getEngine(){return Ma(this,pb)}getPostponeAction(){return Ma(this,RR)}setupSyncEndpoint(e,t){Ns(this,pb,e),Ns(this,mb,t),Ma(this,db).init(),Ma(this,ub).init()}constructor(e,t,o){Qh(this,db,{writable:!0,value:void 0}),Qh(this,ub,{writable:!0,value:void 0}),Qh(this,RR,{writable:!0,value:void 0}),Qh(this,fb,{writable:!0,value:void 0}),Qh(this,gb,{writable:!0,value:void 0}),Qh(this,pb,{writable:!0,value:void 0}),Qh(this,mb,{writable:!0,value:void 0}),Ns(this,fb,!1),Ns(this,gb,!1),Ns(this,pb,null),Ns(this,mb,null),Ns(this,db,new $N("row",e,this)),Ns(this,ub,new $N("column",t,this)),Ns(this,RR,o)}}function Y3(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function zfe(n,e){return e.get?e.get.call(n):e.value}function Ufe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function G3(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function zc(n,e){var t=G3(n,e,"get");return zfe(n,t)}function ER(n,e,t){Y3(n,e),e.set(n,t)}function ur(n,e,t){var o=G3(n,e,"set");return Ufe(n,o,t),t}function st(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function zt(n,e){Y3(n,e),e.add(n)}const Qo="formulas",Yfe=["maxRows","maxColumns","language"],Gfe=260;de.getSingleton().register("afterNamedExpressionAdded");de.getSingleton().register("afterNamedExpressionRemoved");de.getSingleton().register("afterSheetAdded");de.getSingleton().register("afterSheetRemoved");de.getSingleton().register("afterSheetRenamed");de.getSingleton().register("afterFormulasValuesUpdate");const Ef=n=>n==="UndoRedo.undo"||n==="UndoRedo.redo"||n==="auto";var ra=new WeakMap,km=new WeakMap,zd=new WeakMap,Lu=new WeakSet,VM=new WeakSet,Xu=new WeakSet,FN=new WeakSet,BN=new WeakSet,kR=new WeakSet,VN=new WeakSet,TR=new WeakSet,zN=new WeakSet,UN=new WeakSet,xR=new WeakSet,YN=new WeakSet,GN=new WeakSet,jN=new WeakSet,qN=new WeakSet,KN=new WeakSet,XN=new WeakSet,ZN=new WeakSet,QN=new WeakSet,JN=new WeakSet,eP=new WeakSet,tP=new WeakSet,nP=new WeakSet,oP=new WeakSet,iP=new WeakSet,sP=new WeakSet,rP=new WeakSet;class jfe extends at{static get PLUGIN_KEY(){return Qo}static get PLUGIN_PRIORITY(){return Gfe}static get SETTING_KEYS(){return[Qo,...Yfe]}isEnabled(){return!!this.hot.getSettings()[Qo]}enablePlugin(){if(!this.enabled){if(this.engine=vfe(this.hot)??this.engine,!this.engine){Ie("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 e=this.addSheet(this.sheetName,st(this,Xu,Tm).call(this));e!==!1&&st(this,Lu,Np).call(this,e)}this.addHook("beforeLoadData",(...e)=>st(this,kR,aP).call(this,...e)),this.addHook("afterLoadData",(...e)=>st(this,TR,lP).call(this,...e)),this.addHook("beforeUpdateData",(...e)=>st(this,kR,aP).call(this,...e)),this.addHook("afterUpdateData",(...e)=>st(this,TR,lP).call(this,...e)),this.addHook("modifyData",(...e)=>st(this,zN,Zfe).call(this,...e)),this.addHook("modifySourceData",(...e)=>st(this,UN,Qfe).call(this,...e)),this.addHook("beforeValidate",(...e)=>st(this,FN,qfe).call(this,...e)),this.addHook("afterSetSourceDataAtCell",(...e)=>st(this,YN,Jfe).call(this,...e)),this.addHook("afterSetDataAtCell",(...e)=>st(this,xR,hP).call(this,...e)),this.addHook("afterSetDataAtRowProp",(...e)=>st(this,xR,hP).call(this,...e)),this.addHook("beforeCreateRow",(...e)=>st(this,GN,ege).call(this,...e)),this.addHook("beforeCreateCol",(...e)=>st(this,jN,tge).call(this,...e)),this.addHook("afterCreateRow",(...e)=>st(this,XN,ige).call(this,...e)),this.addHook("afterCreateCol",(...e)=>st(this,ZN,sge).call(this,...e)),this.addHook("beforeRemoveRow",(...e)=>st(this,qN,nge).call(this,...e)),this.addHook("beforeRemoveCol",(...e)=>st(this,KN,oge).call(this,...e)),this.addHook("afterRemoveRow",(...e)=>st(this,QN,rge).call(this,...e)),this.addHook("afterRemoveCol",(...e)=>st(this,JN,age).call(this,...e)),this.indexSyncer=new Vfe(this.hot.rowIndexMapper,this.hot.columnIndexMapper,e=>{this.hot.addHookOnce("init",()=>{e()})}),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",(e,t,o,i)=>{this.rowAxisSyncer.storeMovesInformation(e,t,i)}),this.hot.addHook("beforeColumnMove",(e,t,o,i)=>{this.columnAxisSyncer.storeMovesInformation(e,t,i)}),this.hot.addHook("afterRowMove",(e,t,o,i,s)=>{this.rowAxisSyncer.calculateAndSyncMoves(i,s)}),this.hot.addHook("afterColumnMove",(e,t,o,i,s)=>{this.columnAxisSyncer.calculateAndSyncMoves(i,s)}),this.hot.addHook("beforeColumnFreeze",(e,t)=>{this.columnAxisSyncer.storeMovesInformation([e],this.hot.getSettings().fixedColumnsStart,t)}),this.hot.addHook("afterColumnFreeze",(e,t)=>{this.columnAxisSyncer.calculateAndSyncMoves(t,t)}),this.hot.addHook("beforeColumnUnfreeze",(e,t)=>{this.columnAxisSyncer.storeMovesInformation([e],this.hot.getSettings().fixedColumnsStart-1,t)}),this.hot.addHook("afterColumnUnfreeze",(e,t)=>{this.columnAxisSyncer.calculateAndSyncMoves(t,t)}),this.addHook("afterCellMetaReset",(...e)=>st(this,VN,Xfe).call(this,...e)),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",(...e)=>st(this,eP,lge).call(this,...e)),this.addHook("beforeAutofill",(...e)=>st(this,BN,Kfe).call(this,...e)),zc(this,zd).forEach(([e,t])=>this.engine.on(e,t)),super.enablePlugin()}}disablePlugin(){zc(this,zd).forEach(([e,t])=>this.engine.off(e,t)),WN(this.engine,this.hot),this.engine=null,super.disablePlugin()}updatePlugin(e){const t=_fe(this.hot.getSettings());Sfe(this.engine.getConfig(),t)&&this.engine.updateConfig(t);const o=this.hot.getSettings()[Qo];if(ee(o)&&ee(o.sheetName)&&o.sheetName!==this.sheetName&&this.switchSheet(o.sheetName),!e.data&&this.sheetName===null){const i=this.hot.getSettings()[Qo].sheetName;if(i&&this.engine.doesSheetExist(i))this.switchSheet(this.sheetName);else{const s=this.addSheet(i??void 0,st(this,Xu,Tm).call(this));st(this,Lu,Np).call(this,s)}}super.updatePlugin(e)}destroy(){zc(this,zd).forEach(([e,t])=>this.engine?.off(e,t)),ur(this,zd,null),WN(this.engine,this.hot),this.engine=null,super.destroy()}addSheet(e,t){if(ee(t)&&!P7(t))return Ie("The provided data should be an array of arrays."),!1;if(e!=null&&this.engine.doesSheetExist(e))return Ie("Sheet with the provided name already exists."),!1;try{const o=this.engine.addSheet(e??void 0);return t&&this.engine.setSheetContent(this.engine.getSheetId(o),t),o}catch(o){return Ie(o.message),!1}}switchSheet(e){if(!this.engine.doesSheetExist(e)){il(`The sheet named \`${e}\` does not exist, switch aborted.`);return}st(this,Lu,Np).call(this,e);const t=this.engine.getSheetSerialized(this.sheetId);t.length>0&&this.hot.loadData(t,`${mr(Qo)}.switchSheet`)}getCellType(e,t,o=this.sheetId){const i=this.hot.toPhysicalRow(e),s=this.hot.toPhysicalColumn(t);return i!==null&&s!==null?this.engine.getCellType({sheet:o,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(t)}):"EMPTY"}isFormulaCellType(e,t,o=this.sheetId){return this.engine.doesCellHaveFormula({sheet:o,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(t)})}renderDependentSheets(e,t=!1){const o=new Set;e.forEach(i=>{const s=i?.address?.sheet;s!==void 0&&(o.has(s)||o.add(s))}),LN(this.engine).forEach((i,s)=>{(t||s!==this.sheetId)&&o.has(s)&&(i.render(),i.view?.adjustElementsSize())})}validateDependentCells(e,t=[]){const o=s=>{const{row:r,col:a,sheet:l}=s?.address??{};return ee(l)?`${l}:${r}x${a}`:""},i=new Set(t.map(s=>o(s)));e.forEach(s=>{const{row:r,col:a}=s.address??{};if(ee(r)===!1||ee(a)===!1||r>=this.hot.countRows()||a>=this.hot.countCols())return;const l=s?.address?.sheet,h=o(s);if(l!==void 0&&!i.has(h)){const c=LN(this.engine).get(l);if(!c)return;c.validateCell(c.getDataAtCell(r,a),c.getCellMeta(r,a),()=>{})}})}syncChangeWithEngine(e,t,o){const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(t),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(i)){Ie(`Not possible to set cell data at ${JSON.stringify(i)}`);return}const s=this.hot.getCellMeta(e,t);return FM(o,s.type)&&($3(o,s.dateFormat)?o=F3(o,s.dateFormat):Hfe(o)===!1&&(o=`'${o}`)),this.engine.setCellContents(i,o)}constructor(...e){super(...e),zt(this,Lu),zt(this,VM),zt(this,Xu),zt(this,FN),zt(this,BN),zt(this,kR),zt(this,VN),zt(this,TR),zt(this,zN),zt(this,UN),zt(this,xR),zt(this,YN),zt(this,GN),zt(this,jN),zt(this,qN),zt(this,KN),zt(this,XN),zt(this,ZN),zt(this,QN),zt(this,JN),zt(this,eP),zt(this,tP),zt(this,nP),zt(this,oP),zt(this,iP),zt(this,sP),zt(this,rP),ER(this,ra,{writable:!0,value:void 0}),ER(this,km,{writable:!0,value:void 0}),ER(this,zd,{writable:!0,value:void 0}),ur(this,ra,!1),ur(this,km,!1),ur(this,zd,[["valuesUpdated",(...t)=>st(this,tP,hge).call(this,...t)],["namedExpressionAdded",(...t)=>st(this,nP,cge).call(this,...t)],["namedExpressionRemoved",(...t)=>st(this,oP,dge).call(this,...t)],["sheetAdded",(...t)=>st(this,iP,uge).call(this,...t)],["sheetRenamed",(...t)=>st(this,sP,fge).call(this,...t)],["sheetRemoved",(...t)=>st(this,rP,gge).call(this,...t)]]),this.staticRegister=ts("formulas"),this.engine=null,this.sheetId=null,this.sheetName=null,this.indexSyncer=null,this.rowAxisSyncer=null,this.columnAxisSyncer=null}}function Np(n){this.sheetName=n,this.sheetId=this.engine.getSheetId(this.sheetName)}function j3(n,e,t){if(ie(t)&&t!==null){const o=this.hot.toVisualRow(n),i=this.hot.toVisualColumn(e);t=Jy(t,this.hot.getCellMeta(o,i)),t=t.toString()}return V3(t)}function Tm(n,e,t,o){return this.hot.getSourceDataArray(n,e,t,o).map((i,s)=>i.map((r,a)=>st(this,VM,j3).call(this,s,a,r)))}function qfe(n,e,t){const o=this.hot.propToCol(t);if(this.isFormulaCellType(e,o)){const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(o),sheet:this.sheetId},s=this.hot.getCellMeta(e,o);let r=this.engine.getCellValue(i);return s.type==="date"&&mi(r)&&(r=B3(r,s.dateFormat)),typeof r=="object"&&r!==null?r.value:r}return n}function Kfe(n,e,t){const{row:o,col:i}=e.getTopStartCorner(),{row:s,col:r}=e.getBottomEndCorner(),{row:a,col:l}=t.getTopStartCorner(),{row:h,col:c}=t.getBottomEndCorner(),d={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(i),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(s),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r),sheet:this.sheetId}},u={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(a),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(h),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(c),sheet:this.sheetId}};if(this.engine.isItPossibleToSetCellContents(u)===!1)return!1;const f=this.engine.getFillRangeData(d,u),{row:p,col:C}=d.start,{row:y,col:_}=d.end,T=y-p+1,P=_-C+1;for(let $=0;$<f.length;$+=1)for(let F=0;F<f[$].length;F+=1){const N=f[$][F],I=p+$%T,j=C+F%P,U=this.hot.getCellMeta(I,j);FM(N,U.type)&&(N.startsWith("'")?f[$][F]=N.slice(1):this.isFormulaCellType(I,j,this.sheetId)===!1&&(f[$][F]=Afe(N,U.dateFormat)))}return f}function aP(n,e,t=""){t.includes(mr(Qo))||ur(this,km,en(this.hot.getSettings().data))}function Xfe(){if(zc(this,km)){this.switchSheet(this.sheetName);return}const n=st(this,Xu,Tm).call(this);n.forEach((t,o)=>{t.forEach((i,s)=>{const r=this.hot.getCellMeta(o,s,{skipMetaExtension:!0}),a=r.dateFormat;FM(i,r.type)&&($3(i,a)?n[o][s]=F3(i,a):i.startsWith("=")||(n[o][s]=`'${i}`))})}),ur(this,ra,!0);const e=this.engine.setSheetContent(this.sheetId,n);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(e),ur(this,ra,!1)}function lP(n,e,t=""){if(t.includes(mr(Qo)))return;const o=xfe(this.engine,this.hot.getSettings()[Qo].sheetName);if(st(this,Lu,Np).call(this,o),t!=="updateSettings")if(zc(this,km))this.switchSheet(this.sheetName);else{const i=st(this,Xu,Tm).call(this);if(this.engine.isItPossibleToReplaceSheetContent(this.sheetId,i)){ur(this,ra,!0);const s=this.engine.setSheetContent(this.sheetId,i);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(s),ur(this,ra,!1)}}}function Zfe(n,e,t,o){if(o!=="get"||zc(this,ra)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName)||n===null||e===null)return;const i=this.getCellType(n,e);if(i==="VALUE"||i==="EMPTY"){t.value=Ife(t.value);return}const s={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(n),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(e),sheet:this.sheetId};let r=this.engine.getCellValue(s);const a=this.hot.getCellMeta(n,e,{skipMetaExtension:!0});a.type==="date"&&mi(r)&&(r=B3(r,a.dateFormat)),t.value=typeof r=="object"&&r!==null?r.value:r}function Qfe(n,e,t,o){if(o!=="get"||zc(this,ra)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(n),s=this.hot.propToCol(e);if(i===null||s===null)return;const r=this.getCellType(i,s);if(r==="VALUE"||r==="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(s),sheet:this.sheetId};t.value=this.engine.getCellSerialized(l)}function hP(n,e){if(Ef(e)||n.length===0)return;const t=[],o=[],i=this.engine.batch(()=>{n.forEach(([s,r,,a])=>{const l=this.hot.propToCol(r),h=this.hot.toPhysicalRow(s),c=this.hot.toPhysicalColumn(l),d={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(s),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId};a=st(this,VM,j3).call(this,h,c,a),h!==null&&c!==null?this.syncChangeWithEngine(s,l,a):t.push([s,l,a]),o.push({address:d})})});t.length&&this.hot.addHookOnce("afterChange",()=>{const s=this.engine.batch(()=>{t.forEach(([r,a,l])=>{this.syncChangeWithEngine(r,a,l)})});this.renderDependentSheets(s,!0)}),this.renderDependentSheets(i),this.validateDependentCells(i,o)}function Jfe(n,e){if(Ef(e))return;const t=[],o=[];n.forEach(([i,s,,r])=>{const a=this.hot.propToCol(s);if(!mi(a))return;const l={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(a),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(l)){Ie(`Not possible to set source cell data at ${JSON.stringify(l)}`);return}r=V3(r),o.push({address:l}),t.push(...this.engine.setCellContents(l,r))}),this.renderDependentSheets(t),this.validateDependentCells(t,o)}function ege(n,e){let t=this.rowAxisSyncer.getHfIndexFromVisualIndex(n);if(n>=this.hot.countRows()&&(t=n),this.sheetId===null||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddRows(this.sheetId,[t,e]))return!1}function tge(n,e){let t=this.columnAxisSyncer.getHfIndexFromVisualIndex(n);if(n>=this.hot.countCols()&&(t=n),this.sheetId===null||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddColumns(this.sheetId,[t,e]))return!1}function nge(n,e,t){return this.rowAxisSyncer.setRemovedHfIndexes(t).every(s=>this.engine.isItPossibleToRemoveRows(this.sheetId,[s,1]))===!1?!1:void 0}function oge(n,e,t){return this.columnAxisSyncer.setRemovedHfIndexes(t).every(s=>this.engine.isItPossibleToRemoveColumns(this.sheetId,[s,1]))===!1?!1:void 0}function ige(n,e,t){if(Ef(t))return;const o=this.engine.addRows(this.sheetId,[this.rowAxisSyncer.getHfIndexFromVisualIndex(n),e]);this.renderDependentSheets(o)}function sge(n,e,t){if(Ef(t))return;const o=this.engine.addColumns(this.sheetId,[this.columnAxisSyncer.getHfIndexFromVisualIndex(n),e]);this.renderDependentSheets(o)}function rge(n,e,t,o){if(Ef(o))return;const i=this.rowAxisSyncer.getRemovedHfIndexes().sort((r,a)=>a-r),s=this.engine.batch(()=>{i.forEach(r=>{this.engine.removeRows(this.sheetId,[r,1])})});this.renderDependentSheets(s)}function age(n,e,t,o){if(Ef(o))return;const i=this.columnAxisSyncer.getRemovedHfIndexes().sort((r,a)=>a-r),s=this.engine.batch(()=>{i.forEach(r=>{this.engine.removeColumns(this.sheetId,[r,1])})});this.renderDependentSheets(s)}function lge(n,e,t){ur(this,ra,!0);const o=st(this,Xu,Tm).call(this,t,0,t+(e.__children?.length||0),this.hot.countSourceCols());ur(this,ra,!1),o.forEach((i,s)=>{i.forEach((r,a)=>{this.engine.setCellContents({col:a,row:t+s,sheet:this.sheetId},[[r]])})})}function hge(n){this.hot.runHooks("afterFormulasValuesUpdate",n)}function cge(n,e){this.hot.runHooks("afterNamedExpressionAdded",n,e)}function dge(n,e){this.hot.runHooks("afterNamedExpressionRemoved",n,e)}function uge(n){this.hot.runHooks("afterSheetAdded",n)}function fge(n,e){st(this,Lu,Np).call(this,e),this.hot.runHooks("afterSheetRenamed",n,e)}function gge(n,e){this.hot.runHooks("afterSheetRemoved",n,e)}function pge(n){return{key:"hidden_columns_hide",name(){const e=this.getSelectedActive();let t=0;if(Array.isArray(e)){const[,o,,i]=e;o-i!==0&&(t=1)}return this.getTranslatedPhrase(ST,t)},callback(){const{from:e,to:t}=this.getSelectedRangeActive(),o=Math.max(Math.min(e.col,t.col),0),i=Math.max(e.col,t.col),s=[];for(let l=o;l<=i;l+=1)s.push(l);n.hideColumns(s);const r=s[s.length-1],a=this.columnIndexMapper.getNearestNotHiddenIndex(r,1,!0);Number.isInteger(a)&&a>=0?this.selectColumns(a):this.deselectCell(),this.view.adjustElementsSize(),this.render()},disabled:!1,hidden(){return!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())}}}function mge(n){const e=[];return{key:"hidden_columns_show",name(){const t=e.length>1?1:0;return this.getTranslatedPhrase(vT,t)},callback(){if(e.length===0)return;let t=e[0],o=e[e.length-1];t=this.columnIndexMapper.getNearestNotHiddenIndex(t-1,-1)??0,o=this.columnIndexMapper.getNearestNotHiddenIndex(o+1,1)??this.countCols()-1,n.showColumns(e),this.view.adjustElementsSize(),this.render(),o-t+1===this.countCols()||this.selectColumns(t,o)},disabled:!1,hidden(){const t=Mt(n.getHiddenColumns(),d=>this.toPhysicalColumn(d));if(!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())||t.length<1)return!0;e.length=0;const o=this.getSelectedRangeActive(),i=o.getTopStartCorner().col,s=o.getBottomEndCorner().col,r=this.columnIndexMapper,a=r.getRenderableFromVisualIndex(i),l=r.getRenderableFromVisualIndex(s),h=r.getNotTrimmedIndexes(),c=[];if(i!==s){const d=s-i+1,u=l-a+1;if(d>u){const f=h.slice(i,s+1);c.push(...f.filter(p=>t.includes(p)))}}else if(a===0&&a<i)c.push(...h.slice(0,i));else if(a===null)c.push(...h.slice(0,this.countCols()));else{const d=this.countCols()-1,u=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(d,-1));l===u&&d>s&&c.push(...h.slice(s+1))}return O(c,d=>{e.push(this.toVisualColumn(d))}),e.length===0}}}function q3(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wge(n,e){return e.get?e.get.call(n):e.value}function bge(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function K3(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Jh(n,e){var t=K3(n,e,"get");return wge(n,t)}function Cge(n,e,t){q3(n,e),e.set(n,t)}function MR(n,e,t){var o=K3(n,e,"set");return bge(n,o,t),t}function Ud(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Yd(n,e){q3(n,e),e.add(n)}de.getSingleton().register("beforeHideColumns");de.getSingleton().register("afterHideColumns");de.getSingleton().register("beforeUnhideColumns");de.getSingleton().register("afterUnhideColumns");const cP="hiddenColumns",yge=310;var Ps=new WeakMap,dP=new WeakSet,uP=new WeakSet,fP=new WeakSet,gP=new WeakSet,pP=new WeakSet,mP=new WeakSet;class _ge extends at{static get PLUGIN_KEY(){return cP}static get PLUGIN_PRIORITY(){return yge}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,columns:[]}}isEnabled(){return!!this.hot.getSettings()[cP]}enablePlugin(){this.enabled||(MR(this,Ps,new sm),Jh(this,Ps).addLocalHook("init",()=>Ud(this,mP,Tge).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,Jh(this,Ps)),this.addHook("afterContextMenuDefaultOptions",(...e)=>Ud(this,pP,kge).call(this,...e)),this.addHook("afterGetCellMeta",(e,t,o)=>Ud(this,uP,vge).call(this,e,t,o)),this.addHook("modifyColWidth",(e,t)=>Ud(this,dP,Sge).call(this,e,t),2),this.addHook("afterGetColHeader",(...e)=>Ud(this,gP,Ege).call(this,...e)),this.addHook("modifyCopyableRange",e=>Ud(this,fP,Rge).call(this,e)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.columnIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showColumns(e){const t=this.getHiddenColumns(),o=this.isValidConfig(e);let i=t;const s=Jh(this,Ps).getValues().slice(),r=e.length>0;if(o&&r){const l=e.map(h=>this.hot.toPhysicalColumn(h));O(l,h=>{s[h]=!1}),i=Fi(s,(h,c,d)=>(c&&h.push(this.hot.toVisualColumn(d)),h),[])}this.hot.runHooks("beforeUnhideColumns",t,i,o&&r)!==!1&&(o&&r&&Jh(this,Ps).setValues(s),this.hot.view.adjustElementsSize(),this.hot.runHooks("afterUnhideColumns",t,i,o&&r,o&&i.length<t.length))}showColumn(...e){this.showColumns(e)}hideColumns(e){const t=this.getHiddenColumns(),o=this.isValidConfig(e);let i=t;o&&(i=Array.from(new Set(t.concat(e)))),this.hot.runHooks("beforeHideColumns",t,i,o)!==!1&&(o&&this.hot.batchExecution(()=>{O(e,r=>{Jh(this,Ps).setValueAtIndex(this.hot.toPhysicalColumn(r),!0)})},!0),this.hot.runHooks("afterHideColumns",t,i,o,o&&i.length>t.length))}hideColumn(...e){this.hideColumns(e)}getHiddenColumns(){return Mt(Jh(this,Ps).getHiddenIndexes(),e=>this.hot.toVisualColumn(e))}isHidden(e){return Jh(this,Ps).getValueAtIndex(this.hot.toPhysicalColumn(e))||!1}isValidConfig(e){const t=this.hot.countCols();return Array.isArray(e)&&e.length>0?e.every(o=>Number.isInteger(o)&&o>=0&&o<t):!1}resetCellsMeta(){O(this.hot.getCellsMeta(),e=>{e.skipColumnOnPaste=!1})}destroy(){MR(this,Ps,null),super.destroy()}constructor(...e){super(...e),Yd(this,dP),Yd(this,uP),Yd(this,fP),Yd(this,gP),Yd(this,pP),Yd(this,mP),Cge(this,Ps,{writable:!0,value:void 0}),MR(this,Ps,null)}}function Sge(n,e){if(this.isHidden(e))return 0;if(this.getSetting("indicators")&&(this.isHidden(e+1)||this.isHidden(e-1))&&typeof n=="number"&&this.hot.hasColHeaders())return n+15}function vge(n,e,t){if(this.getSetting("copyPasteEnabled")===!1&&this.isHidden(e)&&(t.skipColumnOnPaste=!0),this.isHidden(e-1))t.className=t.className||"",t.className.indexOf("afterHiddenColumn")===-1&&(t.className+=" afterHiddenColumn");else if(t.className){const o=t.className.split(" ");if(o.length>0){const i=o.indexOf("afterHiddenColumn");i>-1&&o.splice(i,1),t.className=o.join(" ")}}}function Rge(n){if(this.getSetting("copyPasteEnabled"))return n;const e=[],t=(o,i,s,r)=>{e.push({startRow:o,endRow:i,startCol:s,endCol:r})};return O(n,o=>{let i=!0,s=0;Re(o.startCol,o.endCol,r=>{this.isHidden(r)?(i||t(o.startRow,o.endRow,s,r-1),i=!0):(i&&(s=r),r===o.endCol&&t(o.startRow,o.endRow,s,r),i=!1)})}),e}function Ege(n,e){if(!this.getSetting("indicators")||n<0)return;const t=[];n>=1&&this.isHidden(n-1)&&t.push("afterHiddenColumn"),n<this.hot.countCols()-1&&this.isHidden(n+1)&&t.push("beforeHiddenColumn"),V(e,t)}function kge(n){n.items.push({name:Ae},pge(this),mge(this))}function Tge(){const n=this.getSetting("columns");Array.isArray(n)&&this.hideColumns(n)}function xge(n){return{key:"hidden_rows_hide",name(){const e=this.getSelectedActive();let t=0;if(Array.isArray(e)){const[o,,i]=e;o-i!==0&&(t=1)}return this.getTranslatedPhrase(RT,t)},callback(){const{from:e,to:t}=this.getSelectedRangeActive(),o=Math.max(Math.min(e.row,t.row),0),i=Math.max(e.row,t.row),s=[];for(let l=o;l<=i;l+=1)s.push(l);n.hideRows(s);const r=s[s.length-1],a=this.rowIndexMapper.getNearestNotHiddenIndex(r,1,!0);Number.isInteger(a)&&a>=0?this.selectRows(a):this.deselectCell(),this.view.adjustElementsSize(),this.render()},disabled:!1,hidden(){return!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())}}}function Mge(n){const e=[];return{key:"hidden_rows_show",name(){const t=e.length>1?1:0;return this.getTranslatedPhrase(ET,t)},callback(){if(e.length===0)return;let t=e[0],o=e[e.length-1];t=this.rowIndexMapper.getNearestNotHiddenIndex(t-1,-1)??0,o=this.rowIndexMapper.getNearestNotHiddenIndex(o+1,1)??this.countRows()-1,n.showRows(e),this.view.adjustElementsSize(),this.render(),o-t+1===this.countRows()||this.selectRows(t,o)},disabled:!1,hidden(){const t=Mt(n.getHiddenRows(),d=>this.toPhysicalRow(d));if(!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())||t.length<1)return!0;e.length=0;const o=this.getSelectedRangeActive(),i=o.getTopStartCorner().row,s=o.getBottomEndCorner().row,r=this.rowIndexMapper,a=r.getRenderableFromVisualIndex(i),l=r.getRenderableFromVisualIndex(s),h=r.getNotTrimmedIndexes(),c=[];if(i!==s){const d=s-i+1,u=l-a+1;if(d>u){const f=h.slice(i,s+1);c.push(...f.filter(p=>t.includes(p)))}}else if(a===0&&a<i)c.push(...h.slice(0,i));else if(a===null)c.push(...h.slice(0,this.countRows()));else{const d=this.countRows()-1,u=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(d,-1));l===u&&d>s&&c.push(...h.slice(s+1))}return O(c,d=>{e.push(this.toVisualRow(d))}),e.length===0}}}function X3(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ige(n,e){return e.get?e.get.call(n):e.value}function Hge(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function Z3(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function ec(n,e){var t=Z3(n,e,"get");return Ige(n,t)}function Age(n,e,t){X3(n,e),e.set(n,t)}function IR(n,e,t){var o=Z3(n,e,"set");return Hge(n,o,t),t}function Gd(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function jd(n,e){X3(n,e),e.add(n)}de.getSingleton().register("beforeHideRows");de.getSingleton().register("afterHideRows");de.getSingleton().register("beforeUnhideRows");de.getSingleton().register("afterUnhideRows");const wP="hiddenRows",Oge=320;var Ls=new WeakMap,bP=new WeakSet,CP=new WeakSet,yP=new WeakSet,_P=new WeakSet,SP=new WeakSet,vP=new WeakSet;class Dge extends at{static get PLUGIN_KEY(){return wP}static get PLUGIN_PRIORITY(){return Oge}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,rows:[]}}isEnabled(){return!!this.hot.getSettings()[wP]}enablePlugin(){this.enabled||(IR(this,Ls,new sm),ec(this,Ls).addLocalHook("init",()=>Gd(this,vP,Fge).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,ec(this,Ls)),this.addHook("afterContextMenuDefaultOptions",(...e)=>Gd(this,SP,$ge).call(this,...e)),this.addHook("afterGetCellMeta",(e,t,o)=>Gd(this,CP,Pge).call(this,e,t,o)),this.addHook("modifyRowHeight",(e,t)=>Gd(this,bP,Nge).call(this,e,t)),this.addHook("afterGetRowHeader",(...e)=>Gd(this,_P,Wge).call(this,...e)),this.addHook("modifyCopyableRange",e=>Gd(this,yP,Lge).call(this,e)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.rowIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showRows(e){const t=this.getHiddenRows(),o=this.isValidConfig(e);let i=t;const s=ec(this,Ls).getValues().slice(),r=e.length>0;if(o&&r){const l=e.map(h=>this.hot.toPhysicalRow(h));O(l,h=>{s[h]=!1}),i=Fi(s,(h,c,d)=>(c&&h.push(this.hot.toVisualRow(d)),h),[])}this.hot.runHooks("beforeUnhideRows",t,i,o&&r)!==!1&&(o&&r&&ec(this,Ls).setValues(s),this.hot.runHooks("afterUnhideRows",t,i,o&&r,o&&i.length<t.length))}showRow(...e){this.showRows(e)}hideRows(e){const t=this.getHiddenRows(),o=this.isValidConfig(e);let i=t;o&&(i=Array.from(new Set(t.concat(e)))),this.hot.runHooks("beforeHideRows",t,i,o)!==!1&&(o&&this.hot.batchExecution(()=>{O(e,r=>{ec(this,Ls).setValueAtIndex(this.hot.toPhysicalRow(r),!0)})},!0),this.hot.runHooks("afterHideRows",t,i,o,o&&i.length>t.length))}hideRow(...e){this.hideRows(e)}getHiddenRows(){return Mt(ec(this,Ls).getHiddenIndexes(),e=>this.hot.toVisualRow(e))}isHidden(e){return ec(this,Ls).getValueAtIndex(this.hot.toPhysicalRow(e))||!1}isValidConfig(e){const t=this.hot.countRows();return Array.isArray(e)&&e.length>0?e.every(o=>Number.isInteger(o)&&o>=0&&o<t):!1}resetCellsMeta(){O(this.hot.getCellsMeta(),e=>{e.skipRowOnPaste=!1})}destroy(){IR(this,Ls,null),super.destroy()}constructor(...e){super(...e),jd(this,bP),jd(this,CP),jd(this,yP),jd(this,_P),jd(this,SP),jd(this,vP),Age(this,Ls,{writable:!0,value:void 0}),IR(this,Ls,null)}}function Nge(n,e){return this.isHidden(e)?0:n}function Pge(n,e,t){if(this.getSetting("copyPasteEnabled")===!1&&this.isHidden(n)&&(t.skipRowOnPaste=!0),this.isHidden(n-1))t.className=t.className||"",t.className.indexOf("afterHiddenRow")===-1&&(t.className+=" afterHiddenRow");else if(t.className){const o=t.className.split(" ");if(o.length>0){const i=o.indexOf("afterHiddenRow");i>-1&&o.splice(i,1),t.className=o.join(" ")}}}function Lge(n){if(this.getSetting("copyPasteEnabled"))return n;const e=[],t=(o,i,s,r)=>{e.push({startRow:o,endRow:i,startCol:s,endCol:r})};return O(n,o=>{let i=!0,s=0;Re(o.startRow,o.endRow,r=>{this.isHidden(r)?(i||t(s,r-1,o.startCol,o.endCol),i=!0):(i&&(s=r),r===o.endRow&&t(s,r,o.startCol,o.endCol),i=!1)})}),e}function Wge(n,e){if(!this.getSetting("indicators")||n<0)return;const t=[];n>=1&&this.isHidden(n-1)&&t.push("afterHiddenRow"),n<this.hot.countRows()-1&&this.isHidden(n+1)&&t.push("beforeHiddenRow"),V(e,t)}function $ge(n){n.items.push({name:Ae},xge(this),Mge(this))}function Fge(){const n=this.getSetting("rows");Array.isArray(n)&&this.hideRows(n)}function Bge(n){return{key:"freeze_column",name(){return this.getTranslatedPhrase(Qk)},callback(e,t){const[{start:{col:o}}]=t;n.freezeColumn(o),this.view.adjustElementsSize(),this.render()},hidden(){const e=this.getSelectedRange();let t=!1;return(e===void 0||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col<=this.getSettings().fixedColumnsStart-1)&&(t=!0),t}}}function Vge(n){return{key:"unfreeze_column",name(){return this.getTranslatedPhrase(Jk)},callback(e,t){const[{start:{col:o}}]=t;n.unfreezeColumn(o),this.view.adjustElementsSize(),this.render()},hidden(){const e=this.getSelectedRange();let t=!1;return(e===void 0||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col>=this.getSettings().fixedColumnsStart)&&(t=!0),t}}}function Q3(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function zge(n,e){return e.get?e.get.call(n):e.value}function Uge(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function J3(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function W0(n,e){var t=J3(n,e,"get");return zge(n,t)}function Yge(n,e,t){Q3(n,e),e.set(n,t)}function wb(n,e,t){var o=J3(n,e,"set");return Uge(n,o,t),t}function RP(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function EP(n,e){Q3(n,e),e.add(n)}de.getSingleton().register("beforeColumnFreeze");de.getSingleton().register("afterColumnFreeze");de.getSingleton().register("beforeColumnUnfreeze");de.getSingleton().register("afterColumnUnfreeze");const kP="manualColumnFreeze",Gge=110;var Kl=new WeakMap,TP=new WeakSet,xP=new WeakSet;class jge extends at{static get PLUGIN_KEY(){return kP}static get PLUGIN_PRIORITY(){return Gge}isEnabled(){return!!this.hot.getSettings()[kP]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>RP(this,TP,qge).call(this,e)),this.addHook("beforeColumnMove",(e,t)=>RP(this,xP,Kge).call(this,e,t)),super.enablePlugin())}disablePlugin(){wb(this,Kl,!1),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}freezeColumn(e){const t=this.hot.getSettings(),o=t.fixedColumnsStart<this.hot.countCols()&&e>t.fixedColumnsStart-1;W0(this,Kl)||wb(this,Kl,!0),this.hot.runHooks("beforeColumnFreeze",e,o)!==!1&&(o&&(this.hot.columnIndexMapper.moveIndexes(e,t.fixedColumnsStart),t._fixedColumnsStart+=1),this.hot.runHooks("afterColumnFreeze",e,o))}unfreezeColumn(e){const t=this.hot.getSettings(),o=t.fixedColumnsStart>0&&e<=t.fixedColumnsStart-1;W0(this,Kl)||wb(this,Kl,!0),this.hot.runHooks("beforeColumnUnfreeze",e,o)!==!1&&(o&&(t._fixedColumnsStart-=1,this.hot.columnIndexMapper.moveIndexes(e,t.fixedColumnsStart)),this.hot.runHooks("afterColumnUnfreeze",e,o))}constructor(...e){super(...e),EP(this,TP),EP(this,xP),Yge(this,Kl,{writable:!0,value:void 0}),wb(this,Kl,!1)}}function qge(n){n.items.push({name:"---------"},Bge(this),Vge(this))}function Kge(n,e){if(W0(this,Kl)){const t=this.hot.getSettings().fixedColumnsStart;if(e<t||n.some(o=>o<t))return!1}}const HR=0,MP=1,IP=2,qd="px";let eY=class{appendTo(e){e.appendChild(this._element),this.state=IP}build(){this.state===HR&&(this._element=this.hot.rootDocument.createElement("div"),this.state=MP)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=HR}isAppended(){return this.state===IP}isBuilt(){return this.state>=MP}setPosition(e,t){mi(e)&&(this._element.style.top=e+qd),mi(t)&&(this._element.style[this.inlineProperty]=t+qd)}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,t){mi(e)&&(this._element.style.width=e+qd),mi(t)&&(this._element.style.height=t+qd)}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,t){mi(e)&&(this._element.style.marginTop=e+qd),mi(t)&&(this._element.style[`margin${mr(this.inlineProperty)}`]=t+qd)}getOffset(){const e=this._element.style,t=`margin${mr(this.inlineProperty)}`;return{top:e.marginTop?parseInt(e.marginTop,10):0,start:e[t]?parseInt(e[t],10):0}}constructor(e){this._element=null,this.state=HR,this.hot=e,this.inlineProperty=e.isRtl()?"right":"left"}};const Xge="ht__manualColumnMove--backlight";let Zge=class extends eY{build(){super.build(),V(this._element,Xge)}};const Qge="ht__manualColumnMove--guideline";let Jge=class extends eY{build(){super.build(),V(this._element,Qge)}};function tY(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function epe(n,e){return e.get?e.get.call(n):e.value}function tpe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function nY(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function me(n,e){var t=nY(n,e,"get");return epe(n,t)}function Ws(n,e,t){tY(n,e),e.set(n,t)}function qn(n,e,t){var o=nY(n,e,"set");return tpe(n,o,t),t}function Kd(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Xd(n,e){tY(n,e),e.add(n)}de.getSingleton().register("beforeColumnMove");de.getSingleton().register("afterColumnMove");const AR="manualColumnMove",npe=120,HP="ht__manualColumnMove",_y="show-ui",$0="on-moving--columns",F0="after-selection--columns";var Xo=new WeakMap,za=new WeakMap,Jr=new WeakMap,wp=new WeakMap,Qa=new WeakMap,Ko=new WeakMap,bb=new WeakMap,Cs=new WeakMap,Hu=new WeakMap,Sy=new WeakMap,Pp=new WeakMap,AP=new WeakSet,OP=new WeakSet,DP=new WeakSet,NP=new WeakSet,PP=new WeakSet,LP=new WeakSet;class ope extends at{static get PLUGIN_KEY(){return AR}static get PLUGIN_PRIORITY(){return npe}isEnabled(){return!!this.hot.getSettings()[AR]}enablePlugin(){this.enabled||(this.addHook("beforeOnCellMouseDown",(...e)=>Kd(this,AP,ipe).call(this,...e)),this.addHook("beforeOnCellMouseOver",(...e)=>Kd(this,DP,rpe).call(this,...e)),this.addHook("afterScrollVertically",()=>Kd(this,PP,lpe).call(this)),this.addHook("afterLoadData",(...e)=>Kd(this,LP,hpe).call(this,...e)),this.buildPluginUI(),this.registerEvents(),V(this.hot.rootElement,HP),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){re(this.hot.rootElement,HP),this.unregisterEvents(),me(this,Xo).destroy(),me(this,za).destroy(),super.disablePlugin()}moveColumn(e,t){return this.moveColumns([e],t)}moveColumns(e,t){const o=me(this,bb),i=this.isMovePossible(e,t),s=this.hot.runHooks("beforeColumnMove",e,t,o,i);if(qn(this,bb,void 0),s===!1)return;i&&this.hot.columnIndexMapper.moveIndexes(e,t);const r=i&&this.isColumnOrderChanged(e,t);return this.hot.runHooks("afterColumnMove",e,t,o,i,r),r}dragColumn(e,t){return this.dragColumns([e],t)}dragColumns(e,t){const o=this.countFinalIndex(e,t);return qn(this,bb,t),this.moveColumns(e,o)}isMovePossible(e,t){const o=this.hot.columnIndexMapper.getNotTrimmedIndexesLength(),i=e.length+t>o,s=t<0,r=e.some(l=>l<0),a=e.some(l=>l>=o);return!(i||s||r||a)}isColumnOrderChanged(e,t){return e.some((o,i)=>o-i!==t)}countFinalIndex(e,t){const o=Fi(e,(i,s)=>(s<t&&(i+=1),i),0);return t-o}getColumnsWidth(e,t){const o=this.hot.columnIndexMapper;let i=0;for(let s=e;s<=t;s+=1){const r=o.getRenderableFromVisualIndex(s);s<0?i+=this.hot.view._wt.wtViewport.getRowHeaderWidth()||0:r!==null&&(i+=this.hot.view._wt.wtTable.getColumnWidth(r)||0)}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[AR];Array.isArray(e)&&this.moveColumns(e,0)}isFixedColumnsStart(e){return e<this.hot.getSettings().fixedColumnsStart}prepareColumnsToMoving(e,t){const o=[];return Re(e,t,i=>{o.push(i)}),o}refreshPositions(){const e=this.hot.view.getFirstFullyVisibleColumn();this.isFixedColumnsStart(me(this,Cs))&&e>0&&this.hot.scrollViewportTo({col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(e-1,-1)});const t=this.hot.view._wt.wtTable,o=this.hot.view._wt.wtOverlays.scrollableElement,i=typeof o.scrollX=="number"?o.scrollX:o.scrollLeft;let s=this.hot.view.THEAD.offsetLeft+this.getColumnsWidth(0,me(this,Cs)-1);const r=t.hider.offsetWidth,a=t.TBODY.offsetLeft,l=me(this,Xo).getOffset().start,h=me(this,Xo).getSize().width;let c=0,d=0;if(this.hot.isRtl()){const p=this.hot.rootWindow,C=Cn(this.hot.rootElement),y=p.innerWidth-me(this,Hu)-C;d=p.innerWidth-me(this,Ko).eventPageX-y-(o.scrollX===void 0?i:0)}else d=me(this,Ko).eventPageX-(me(this,Hu)-(o.scrollX===void 0?i:0));if(me(this,Sy)&&(c=this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth),this.isFixedColumnsStart(me(this,Cs))&&(s+=i),s+=c,me(this,Cs)<0)me(this,Pp)>0?me(this,Ko).col=0:me(this,Ko).col=e>0?e-1:e;else if(me(this,Ko).TD.offsetWidth/2+s<=d){const p=me(this,Cs)>=me(this,wp)?me(this,wp)-1:me(this,Cs);me(this,Ko).col=p+1,s+=me(this,Ko).TD.offsetWidth}else me(this,Ko).col=me(this,Cs);let u=d,f=s;d+h+l>=r?u=r-h-l:d+l<a+c&&(u=a+c+Math.abs(l)),s>=r-1?f=r-1:f===0?f=1:o.scrollX!==void 0&&me(this,Cs)<me(this,Pp)&&(f-=me(this,Hu)<=o.scrollX?me(this,Hu):0),me(this,Xo).setPosition(null,u),me(this,za).setPosition(null,f)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",t=>Kd(this,OP,spe).call(this,t)),this.eventManager.addEventListener(e,"mouseup",()=>Kd(this,NP,ape).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){me(this,Xo).build(),me(this,za).build()}destroy(){me(this,Xo).destroy(),me(this,za).destroy(),super.destroy()}constructor(...e){super(...e),Xd(this,AP),Xd(this,OP),Xd(this,DP),Xd(this,NP),Xd(this,PP),Xd(this,LP),Ws(this,Xo,{writable:!0,value:void 0}),Ws(this,za,{writable:!0,value:void 0}),Ws(this,Jr,{writable:!0,value:void 0}),Ws(this,wp,{writable:!0,value:void 0}),Ws(this,Qa,{writable:!0,value:void 0}),Ws(this,Ko,{writable:!0,value:void 0}),Ws(this,bb,{writable:!0,value:void 0}),Ws(this,Cs,{writable:!0,value:void 0}),Ws(this,Hu,{writable:!0,value:void 0}),Ws(this,Sy,{writable:!0,value:void 0}),Ws(this,Pp,{writable:!0,value:void 0}),qn(this,Xo,new Zge(this.hot)),qn(this,za,new Jge(this.hot)),qn(this,Jr,[]),qn(this,wp,0),qn(this,Qa,!1),qn(this,Ko,{})}}function ipe(n,e,t,o){const i=this.hot.view._wt.wtTable,s=this.hot.selection.isSelectedByColumnHeader(),r=this.hot.getSelectedRangeActive(),a=Se(n.target,"sortAction");if(!r||!s||me(this,Qa)||n.button!==0||a){qn(this,Qa,!1),me(this,Jr).length=0,re(this.hot.rootElement,[$0,_y]);return}const l=me(this,za).isBuilt()&&!me(this,za).isAppended(),h=me(this,Xo).isBuilt()&&!me(this,Xo).isAppended();l&&h&&(me(this,za).appendTo(i.hider),me(this,Xo).appendTo(i.hider));const{from:c,to:d}=r,u=Math.min(c.col,d.col),f=Math.max(c.col,d.col);if(e.row<0&&e.col>=u&&e.col<=f){o.column=!0,qn(this,Qa,!0);const p=t.firstChild?K4(n,t.firstChild).x:n.offsetX;me(this,Ko).eventPageX=n.pageX,qn(this,Cs,e.col),me(this,Ko).TD=t,me(this,Ko).col=e.col,qn(this,Jr,this.prepareColumnsToMoving(u,f)),qn(this,Sy,!!this.hot.getSettings().rowHeaders),qn(this,wp,this.hot.countCols()),qn(this,Pp,this.hot.getSettings().fixedColumnsStart),qn(this,Hu,Jo(this.hot.rootElement).left);const C=me(this,Sy)?-1:0,y=i.holder.scrollTop+i.getColumnHeaderHeight(0)+1,_=e.col<me(this,Pp),T=this.hot.view._wt.wtOverlays.inlineStartOverlay.getOverlayOffset(),P=Math.abs(p-(this.hot.isRtl()?t.offsetWidth:0)),$=this.getColumnsWidth(u,e.col-1)+P,F=this.getColumnsWidth(C,u-1)+(_?T:0)+$;me(this,Xo).setPosition(y,F),me(this,Xo).setSize(this.getColumnsWidth(u,f),i.hider.offsetHeight-y),me(this,Xo).setOffset(null,-$),V(this.hot.rootElement,$0)}else re(this.hot.rootElement,F0),qn(this,Qa,!1),me(this,Jr).length=0}function spe(n){me(this,Qa)&&(me(this,Ko).eventPageX=n.pageX,this.refreshPositions())}function rpe(n,e,t,o){!this.hot.getSelectedRangeActive()||!me(this,Qa)||(me(this,Jr).indexOf(e.col)>-1?re(this.hot.rootElement,_y):V(this.hot.rootElement,_y),o.row=!0,o.column=!0,o.cell=!0,qn(this,Cs,e.col),me(this,Ko).TD=t)}function ape(){const n=me(this,Ko).col,e=me(this,Jr).length;if(qn(this,Cs,void 0),qn(this,Qa,!1),re(this.hot.rootElement,[$0,_y,F0]),this.hot.selection.isSelectedByColumnHeader()&&V(this.hot.rootElement,F0),e<1||n===void 0)return;const t=me(this,Jr)[0],o=this.hot.toPhysicalColumn(t),i=this.dragColumns(me(this,Jr),n);if(me(this,Jr).length=0,i===!0){this.hot.view.adjustElementsSize(),this.hot.render();const s=this.hot.toVisualColumn(o),r=s+e-1;this.hot.selectColumns(s,r)}}function lpe(){const n=this.hot.view._wt.wtTable,e=n.getColumnHeaderHeight(0)+1,t=n.holder.scrollTop,o=e+t;me(this,Xo).setPosition(o),me(this,Xo).setSize(null,n.hider.offsetHeight-o)}function hpe(){this.moveBySettingsOrLoad()}function oY(n,e="horizontal"){const t=n.getBoundingClientRect(),o=e==="vertical"?t.height:t.width,i=e==="vertical"?n.offsetHeight:n.offsetWidth;if(!Number.isFinite(o)||!Number.isFinite(i)||o<=0||i<=0||o>=i&&o-i<=1)return 1;const s=o/i;return Number.isFinite(s)&&s>0?s:1}function iY(n,e){return!Number.isFinite(e)||e<=0?n:Math.round(n/e)}function sY(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function cpe(n,e){return e.get?e.get.call(n):e.value}function dpe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function rY(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function le(n,e){var t=rY(n,e,"get");return cpe(n,t)}function mo(n,e,t){sY(n,e),e.set(n,t)}function Ze(n,e,t){var o=rY(n,e,"set");return dpe(n,o,t),t}function Ia(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Ha(n,e){sY(n,e),e.add(n)}const vy="manualColumnResize",upe=130;var rr=new WeakMap,xg=new WeakMap,Ai=new WeakMap,Lp=new WeakMap,lr=new WeakMap,WP=new WeakMap,Ac=new WeakMap,Mg=new WeakMap,bC=new WeakMap,ci=new WeakMap,Lr=new WeakMap,vh=new WeakMap,xm=new WeakMap,Rc=new WeakMap,Wp=new WeakMap,_s=new WeakMap,Zd=new WeakMap,$p=new WeakMap,$P=new WeakSet,FP=new WeakSet,BP=new WeakSet,VP=new WeakSet,zP=new WeakSet,UP=new WeakSet,YP=new WeakSet,GP=new WeakSet,jP=new WeakSet;class fpe extends at{static get PLUGIN_KEY(){return vy}static get PLUGIN_PRIORITY(){return upe}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[vy]}enablePlugin(){this.enabled||(Ze(this,_s,new Eh),le(this,_s).addLocalHook("init",()=>Ia(this,$P,gpe).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,le(this,_s)),Ze(this,Zd,this.hot.columnIndexMapper.observeMapChange(le(this,_s),()=>{this.hot.view?.invalidateColumnWidthCache()})),this.addHook("modifyColWidth",(...e)=>Ia(this,YP,ype).call(this,...e),1),this.addHook("beforeStretchingColumnWidth",(...e)=>Ia(this,GP,_pe).call(this,...e),1),this.addHook("beforeColumnResize",(...e)=>Ia(this,jP,Spe).call(this,...e)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){le(this,Zd)&&(le(this,Zd).call(this),Ze(this,Zd,null)),Ze(this,$p,le(this,_s).getValues()),this.hot.columnIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}setManualSize(e,t){const o=Math.max(t,20),i=this.hot.toPhysicalColumn(e);return le(this,_s).setValueAtIndex(i,o),o}clearManualSize(e){const t=this.hot.toPhysicalColumn(e);le(this,_s).setValueAtIndex(t,null)}setupHandlePosition(e){if(!e.parentNode||le(this,Rc)>1)return;Ze(this,rr,e);const{_wt:t}=this.hot.view,o=t.wtTable.getCoords(le(this,rr)),i=o.col;if(i<0)return;const s=xn(le(this,rr)),r=i<t.getSetting("fixedColumnsStart");let a;r&&(a=t.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(le(this,rr),o.row,o.col)),a||(a=t.wtOverlays.topOverlay.getRelativeCellPosition(le(this,rr),o.row,o.col)),Ze(this,xg,this.hot.columnIndexMapper.getVisualFromRenderableIndex(i)),Ze(this,Ai,[]);const l=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByColumnHeader();if(this.hot.selection.isSelected()&&l){const h=this.hot.getSelectedRange();O(h,c=>{const d=c.getTopStartCorner().col,u=c.getBottomEndCorner().col;Re(d,u,f=>{le(this,Ai).includes(f)||le(this,Ai).push(f)})})}le(this,Ai).includes(le(this,xg))||Ze(this,Ai,[le(this,xg)]),Ze(this,Mg,a.start-6),Ze(this,Ac,Cn(le(this,rr))),Ze(this,bC,oY(le(this,rr))),le(this,ci).style.top=`${a.top}px`,le(this,ci).style[this.inlineDir]=`${le(this,Mg)+le(this,Ac)}px`,le(this,ci).style.height=`${s}px`,this.hot.rootElement.appendChild(le(this,ci))}refreshHandlePosition(){le(this,ci).style[this.inlineDir]=`${le(this,Mg)+le(this,Lp)}px`}setupGuidePosition(){const e=parseInt(xn(le(this,ci)),10),t=parseInt(le(this,ci).style.top,10)+e,o=this.hot.view.getTableHeight();V(le(this,ci),"active"),V(le(this,Lr),"active"),le(this,Lr).style.top=`${t}px`,this.refreshGuidePosition(),le(this,Lr).style.height=`${o-e}px`,this.hot.rootElement.appendChild(le(this,Lr))}refreshGuidePosition(){le(this,Lr).style[this.inlineDir]=le(this,ci).style[this.inlineDir]}hideHandleAndGuide(){re(le(this,ci),"active"),re(le(this,Lr),"active")}checkIfColumnHeader(e){const t=qc(e,["THEAD"],this.hot.rootElement),{topOverlay:o,topInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;return[o.clone.wtTable.THEAD,i.clone.wtTable.THEAD].includes(t)}getClosestTHParent(e){return e.tagName!=="TABLE"?e.tagName==="TH"?e:this.getClosestTHParent(e.parentNode):null}afterMouseDownTimeout(){const e=()=>{this.hot.view.adjustElementsSize(),this.hot.render()},t=(o,i)=>{const s=this.hot.runHooks("beforeColumnResize",le(this,lr),o,!0);s!==void 0&&Ze(this,lr,s),this.setManualSize(o,le(this,lr)),this.hot.runHooks("afterColumnResize",le(this,lr),o,!0),i&&e()};le(this,Rc)>=2&&(le(this,Ai).length>1?(O(le(this,Ai),i=>{t(i)}),e()):O(le(this,Ai),i=>{t(i,!0)})),Ze(this,Rc,0),Ze(this,Wp,null)}bindEvents(){const{rootWindow:e,rootElement:t}=this.hot;this.eventManager.addEventListener(t,"mouseover",o=>Ia(this,FP,ppe).call(this,o)),this.eventManager.addEventListener(t,"mousedown",o=>Ia(this,BP,mpe).call(this,o)),this.eventManager.addEventListener(e,"mousemove",o=>Ia(this,VP,wpe).call(this,o)),this.eventManager.addEventListener(e,"mouseup",()=>Ia(this,zP,bpe).call(this)),this.eventManager.addEventListener(le(this,ci),"contextmenu",()=>Ia(this,UP,Cpe).call(this))}destroy(){super.destroy()}constructor(e){super(e),Ha(this,$P),Ha(this,FP),Ha(this,BP),Ha(this,VP),Ha(this,zP),Ha(this,UP),Ha(this,YP),Ha(this,GP),Ha(this,jP),mo(this,rr,{writable:!0,value:void 0}),mo(this,xg,{writable:!0,value:void 0}),mo(this,Ai,{writable:!0,value:void 0}),mo(this,Lp,{writable:!0,value:void 0}),mo(this,lr,{writable:!0,value:void 0}),mo(this,WP,{writable:!0,value:void 0}),mo(this,Ac,{writable:!0,value:void 0}),mo(this,Mg,{writable:!0,value:void 0}),mo(this,bC,{writable:!0,value:void 0}),mo(this,ci,{writable:!0,value:void 0}),mo(this,Lr,{writable:!0,value:void 0}),mo(this,vh,{writable:!0,value:void 0}),mo(this,xm,{writable:!0,value:void 0}),mo(this,Rc,{writable:!0,value:void 0}),mo(this,Wp,{writable:!0,value:void 0}),mo(this,_s,{writable:!0,value:void 0}),mo(this,Zd,{writable:!0,value:void 0}),mo(this,$p,{writable:!0,value:void 0}),Ze(this,rr,null),Ze(this,xg,null),Ze(this,Ai,[]),Ze(this,Lp,null),Ze(this,lr,null),Ze(this,WP,null),Ze(this,Ac,null),Ze(this,Mg,null),Ze(this,bC,1),Ze(this,ci,this.hot.rootDocument.createElement("DIV")),Ze(this,Lr,this.hot.rootDocument.createElement("DIV")),Ze(this,vh,null),Ze(this,xm,!1),Ze(this,Rc,0),Ze(this,Wp,null),Ze(this,Zd,null),V(le(this,ci),"manualColumnResizer"),V(le(this,Lr),"manualColumnResizerGuide")}}function gpe(){const n=this.hot.getSettings()[vy];Array.isArray(n)?(this.hot.batchExecution(()=>{n.forEach((e,t)=>{le(this,_s).setValueAtIndex(t,e)})},!0),Ze(this,$p,n)):n===!0&&Array.isArray(le(this,$p))&&this.hot.batchExecution(()=>{le(this,$p).forEach((e,t)=>{le(this,_s).setValueAtIndex(t,e)})},!0)}function ppe(n){if(!_F(n.target)&&le(this,xm)!==!0&&this.checkIfColumnHeader(n.target)){const e=this.getClosestTHParent(n.target);if(!e)return;const t=e.getAttribute("colspan");e&&(t===null||t==="1")&&(le(this,vh)||this.setupHandlePosition(e))}}function mpe(n){n.target.parentNode===this.hot.rootElement&&Se(n.target,"manualColumnResizer")&&(this.setupHandlePosition(le(this,rr)),this.setupGuidePosition(),Ze(this,vh,!0),le(this,Wp)===null&&Ze(this,Wp,this.hot._registerTimeout(()=>this.afterMouseDownTimeout(),500)),Ze(this,Rc,le(this,Rc)+1),this.startX=n.pageX,Ze(this,lr,le(this,Ac)))}function wpe(n){if(le(this,vh)){const e=(n.pageX-this.startX)*this.hot.getDirectionFactor(),t=iY(e,le(this,bC));Ze(this,Lp,le(this,Ac)+t),O(le(this,Ai),o=>{Ze(this,lr,this.setManualSize(o,le(this,Lp)))}),this.refreshHandlePosition(),this.refreshGuidePosition()}}function bpe(){const n=()=>{this.hot.view.adjustElementsSize(),this.hot.render()},e=(t,o)=>{this.hot.runHooks("beforeColumnResize",le(this,lr),t,!1),o&&n(),this.hot.runHooks("afterColumnResize",le(this,lr),t,!1)};le(this,vh)&&(this.hideHandleAndGuide(),Ze(this,vh,!1),le(this,lr)!==le(this,Ac)&&(le(this,Ai).length>1?(O(le(this,Ai),o=>{e(o)}),n()):O(le(this,Ai),o=>{e(o,!0)})),this.setupHandlePosition(le(this,rr)))}function Cpe(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(le(this,ci)),this.hot.rootElement.removeChild(le(this,Lr)),Ze(this,vh,!1),Ze(this,xm,!0),this.hot._registerMicrotask(()=>{Ze(this,xm,!1)})}function ype(n,e){let t=n;if(this.enabled){const o=this.hot.toPhysicalColumn(e),i=le(this,_s).getValueAtIndex(o);this.hot.getSettings()[vy]&&i&&(t=i)}return t}function _pe(n,e){const t=le(this,_s).getValueAtIndex(this.hot.toPhysicalColumn(e));return typeof t=="number"?t:n}function Spe(){this.hot.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked()}const OR=0,qP=1,KP=2,Qd="px";let aY=class{appendTo(e){e.appendChild(this._element),this.state=KP}build(){this.state===OR&&(this._element=this.hot.rootDocument.createElement("div"),this.state=qP)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=OR}isAppended(){return this.state===KP}isBuilt(){return this.state>=qP}setPosition(e,t){e!==void 0&&(this._element.style.top=e+Qd),t!==void 0&&(this._element.style.left=t+Qd)}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,t){e&&(this._element.style.width=e+Qd),t&&(this._element.style.height=t+Qd)}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,t){e&&(this._element.style.marginTop=e+Qd),t&&(this._element.style.marginLeft=t+Qd)}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}}constructor(e){this._element=null,this.state=OR,this.hot=e}};const vpe="ht__manualRowMove--backlight";class Rpe extends aY{build(){super.build(),V(this._element,vpe)}}const Epe="ht__manualRowMove--guideline";class kpe extends aY{build(){super.build(),V(this._element,Epe)}}function lY(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Tpe(n,e){return e.get?e.get.call(n):e.value}function xpe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function hY(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Fe(n,e){var t=hY(n,e,"get");return Tpe(n,t)}function Jd(n,e,t){lY(n,e),e.set(n,t)}function hr(n,e,t){var o=hY(n,e,"set");return xpe(n,o,t),t}function eu(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function tu(n,e){lY(n,e),e.add(n)}de.getSingleton().register("beforeRowMove");de.getSingleton().register("afterRowMove");const Cb="manualRowMove",Mpe=140,XP="ht__manualRowMove",Ry="show-ui",B0="on-moving--rows",V0="after-selection--rows";var Zo=new WeakMap,Ua=new WeakMap,ea=new WeakMap,hh=new WeakMap,pi=new WeakMap,yb=new WeakMap,ZP=new WeakSet,QP=new WeakSet,JP=new WeakSet,eL=new WeakSet,tL=new WeakSet,nL=new WeakSet;class Ipe extends at{static get PLUGIN_KEY(){return Cb}static get PLUGIN_PRIORITY(){return Mpe}static get SETTING_KEYS(){return[Cb]}isEnabled(){return!!this.hot.getSettings()[Cb]}enablePlugin(){this.enabled||(this.addHook("beforeOnCellMouseDown",(...e)=>eu(this,ZP,Hpe).call(this,...e)),this.addHook("beforeOnCellMouseOver",(...e)=>eu(this,JP,Ope).call(this,...e)),this.addHook("afterScrollHorizontally",()=>eu(this,tL,Npe).call(this)),this.addHook("afterLoadData",(...e)=>eu(this,nL,Ppe).call(this,...e)),this.buildPluginUI(),this.registerEvents(),V(this.hot.rootElement,XP),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){re(this.hot.rootElement,XP),this.unregisterEvents(),Fe(this,Zo).destroy(),Fe(this,Ua).destroy(),super.disablePlugin()}moveRow(e,t){return this.moveRows([e],t)}moveRows(e,t){const o=Fe(this,yb),i=this.isMovePossible(e,t),s=this.hot.runHooks("beforeRowMove",e,t,o,i);if(hr(this,yb,void 0),s===!1)return;i&&this.hot.rowIndexMapper.moveIndexes(e,t);const r=i&&this.isRowOrderChanged(e,t);return this.hot.runHooks("afterRowMove",e,t,o,i,r),r}dragRow(e,t){return this.dragRows([e],t)}dragRows(e,t){const o=this.countFinalIndex(e,t);return hr(this,yb,t),this.moveRows(e,o)}isMovePossible(e,t){const o=this.hot.rowIndexMapper.getNotTrimmedIndexesLength(),i=e.length+t>o,s=t<0,r=e.some(l=>l<0),a=e.some(l=>l>=o);return!(i||s||r||a)}isRowOrderChanged(e,t){return e.some((o,i)=>o-i!==t)}countFinalIndex(e,t){const o=Fi(e,(i,s)=>(s<t&&(i+=1),i),0);return t-o}getRowsHeight(e,t){const o=this.hot.rowIndexMapper;let i=0;for(let s=e;s<=t;s++){const r=o.getRenderableFromVisualIndex(s);r!==null&&(i+=this.hot.view._wt.wtTable.getRowHeight(r)||this.hot.stylesHandler.getDefaultRowHeight())}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[Cb];Array.isArray(e)&&this.moveRows(e,0)}isFixedRowTop(e){return e<this.hot.getSettings().fixedRowsTop}isFixedRowBottom(e){return e>this.hot.countRows()-1-this.hot.getSettings().fixedRowsBottom}prepareRowsToMoving(){const e=this.hot.getSelectedRangeActive(),t=[];if(!e)return t;const{from:o,to:i}=e,s=Math.min(o.row,i.row),r=Math.max(o.row,i.row);return Re(s,r,a=>{t.push(a)}),t}refreshPositions(){const e=Fe(this,pi).coords,t=this.hot.getFirstFullyVisibleRow(),o=this.hot.getLastFullyVisibleRow(),i=this.hot.countRows();this.isFixedRowTop(e.row)&&t>0&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(t-1,-1)),this.isFixedRowBottom(e.row)&&o<i&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(o+1,1),void 0,!0);const s=this.hot.view._wt.wtTable,r=Fe(this,pi).TD,a=this.hot.rootElement,l=Jo(a),h=em(a),c=s.holder.scrollTop,d=this.hot.rootWindow!==h?h.scrollTop:0,u=l.top-d,f=Fe(this,pi).eventPageY-u+c,p=s.hider.offsetHeight,C=s.TBODY.offsetTop,y=Fe(this,Zo).getOffset().top,_=Fe(this,Zo).getSize().height,T=r.offsetHeight/2,P=r.offsetHeight;let $=this.hot.view.THEAD.offsetHeight+this.getRowsHeight(0,e.row-1);const F=f>=$+T;this.isFixedRowTop(e.row)&&($+=this.hot.view._wt.wtOverlays.topOverlay.getOverlayOffset()),e.row<0?Fe(this,pi).row=t>0?t-1:t:F?(Fe(this,pi).row=e.row+1,$+=e.row===0?P-1:P):Fe(this,pi).row=e.row;let N=f,I=$;f+_+y>=p?N=p-_-y:f+y<C&&(N=C+Math.abs(y)),$>=p-1&&(I=p-1),Fe(this,Zo).setPosition(N),Fe(this,Ua).setPosition(I)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",t=>eu(this,QP,Ape).call(this,t)),this.eventManager.addEventListener(e,"mouseup",()=>eu(this,eL,Dpe).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){Fe(this,Zo).build(),Fe(this,Ua).build()}destroy(){Fe(this,Zo).destroy(),Fe(this,Ua).destroy(),super.destroy()}constructor(...e){super(...e),tu(this,ZP),tu(this,QP),tu(this,JP),tu(this,eL),tu(this,tL),tu(this,nL),Jd(this,Zo,{writable:!0,value:void 0}),Jd(this,Ua,{writable:!0,value:void 0}),Jd(this,ea,{writable:!0,value:void 0}),Jd(this,hh,{writable:!0,value:void 0}),Jd(this,pi,{writable:!0,value:void 0}),Jd(this,yb,{writable:!0,value:void 0}),hr(this,Zo,new Rpe(this.hot)),hr(this,Ua,new kpe(this.hot)),hr(this,ea,[]),hr(this,pi,{})}}function Hpe(n,e,t,o){const{wtTable:i,wtViewport:s}=this.hot.view._wt,r=this.hot.selection.isSelectedByRowHeader(),a=this.hot.getSelectedRangeActive();if(!a||!r||Fe(this,hh)||n.button!==0){hr(this,hh,!1),Fe(this,ea).length=0,re(this.hot.rootElement,[B0,Ry]);return}const l=Fe(this,Ua).isBuilt()&&!Fe(this,Ua).isAppended(),h=Fe(this,Zo).isBuilt()&&!Fe(this,Zo).isAppended();l&&h&&(Fe(this,Ua).appendTo(i.hider),Fe(this,Zo).appendTo(i.hider));const{from:c,to:d}=a,u=Math.min(c.row,d.row),f=Math.max(c.row,d.row);if(e.col<0&&e.row>=u&&e.row<=f){o.row=!0,hr(this,hh,!0),Fe(this,pi).eventPageY=n.pageY,Fe(this,pi).coords=e,Fe(this,pi).TD=t,hr(this,ea,this.prepareRowsToMoving());const p=i.holder.scrollLeft+s.getRowHeaderWidth(),C=this.getRowsHeight(u,e.row-1)+(n.clientY-t.getBoundingClientRect().top);Fe(this,Zo).setPosition(null,p),Fe(this,Zo).setSize(i.hider.offsetWidth-p,this.getRowsHeight(u,f)),Fe(this,Zo).setOffset(-C,null),V(this.hot.rootElement,B0),this.refreshPositions()}else re(this.hot.rootElement,V0),hr(this,hh,!1),Fe(this,ea).length=0}function Ape(n){Fe(this,hh)&&(Fe(this,pi).eventPageY=n.pageY,this.refreshPositions())}function Ope(n,e,t,o){!this.hot.getSelectedRangeActive()||!Fe(this,hh)||(Fe(this,ea).indexOf(e.row)>-1?re(this.hot.rootElement,Ry):V(this.hot.rootElement,Ry),o.row=!0,o.column=!0,o.cell=!0,Fe(this,pi).coords=e,Fe(this,pi).TD=t)}function Dpe(){const n=Fe(this,pi).row,e=Fe(this,ea).length;if(hr(this,hh,!1),re(this.hot.rootElement,[B0,Ry,V0]),this.hot.selection.isSelectedByRowHeader()&&V(this.hot.rootElement,V0),e<1||n===void 0)return;const t=Fe(this,ea)[0],o=this.hot.toPhysicalRow(t),i=this.dragRows(Fe(this,ea),n);if(Fe(this,ea).length=0,i===!0){this.hot.view.adjustElementsSize(),this.hot.render();const s=this.hot.toVisualRow(o),r=s+e-1;this.hot.selectRows(s,r)}}function Npe(){const n=this.hot.view._wt.wtTable,e=this.hot.view._wt.wtViewport.getRowHeaderWidth(),t=n.holder.scrollLeft,o=e+t;Fe(this,Zo).setPosition(null,o),Fe(this,Zo).setSize(n.hider.offsetWidth-o)}function Ppe(){this.moveBySettingsOrLoad()}function cY(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Lpe(n,e){return e.get?e.get.call(n):e.value}function Wpe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function dY(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function ae(n,e){var t=dY(n,e,"get");return Lpe(n,t)}function wo(n,e,t){cY(n,e),e.set(n,t)}function qe(n,e,t){var o=dY(n,e,"set");return Wpe(n,o,t),t}function tc(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function nc(n,e){cY(n,e),e.add(n)}const Ey="manualRowResize",$pe=30;var ps=new WeakMap,Ig=new WeakMap,Oi=new WeakMap,Wu=new WeakMap,Ya=new WeakMap,ky=new WeakMap,Oc=new WeakMap,Hg=new WeakMap,CC=new WeakMap,Bo=new WeakMap,er=new WeakMap,Rh=new WeakMap,Mm=new WeakMap,Ec=new WeakMap,Fp=new WeakMap,Yr=new WeakMap,nu=new WeakMap,Bp=new WeakMap,oL=new WeakSet,iL=new WeakSet,sL=new WeakSet,rL=new WeakSet,aL=new WeakSet,lL=new WeakSet,hL=new WeakSet;class Fpe extends at{static get PLUGIN_KEY(){return Ey}static get PLUGIN_PRIORITY(){return $pe}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[Ey]}enablePlugin(){this.enabled||(qe(this,Yr,new Eh),ae(this,Yr).addLocalHook("init",()=>tc(this,hL,jpe).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,ae(this,Yr)),qe(this,nu,this.hot.rowIndexMapper.observeMapChange(ae(this,Yr),()=>{this.hot.view?.invalidateRowHeightCache()})),this.addHook("modifyRowHeight",(e,t)=>tc(this,lL,Gpe).call(this,e,t)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){ae(this,nu)&&(ae(this,nu).call(this),qe(this,nu,null)),qe(this,Bp,ae(this,Yr).getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}setManualSize(e,t){const o=this.hot.toPhysicalRow(e),i=Math.max(t,this.hot.stylesHandler.getDefaultRowHeight());return ae(this,Yr).setValueAtIndex(o,i),i}getLastDesiredRowHeight(){return ae(this,Wu)}setupHandlePosition(e){if(!e.parentNode||ae(this,Ec)>1)return;qe(this,ps,e);const{view:t}=this.hot,{_wt:o}=t,i=o.wtTable.getCoords(ae(this,ps)),s=i.row;if(s<0)return;const r=Cn(ae(this,ps)),a=s<o.getSetting("fixedRowsTop"),l=s>=t.countNotHiddenRowIndexes(0,1)-o.getSetting("fixedRowsBottom");let h;a?h=o.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(ae(this,ps),i.row,i.col):l&&(h=o.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(ae(this,ps),i.row,i.col)),h||(h=o.wtOverlays.inlineStartOverlay.getRelativeCellPosition(ae(this,ps),i.row,i.col)),qe(this,Ig,this.hot.rowIndexMapper.getVisualFromRenderableIndex(s)),qe(this,Oi,[]);const c=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByRowHeader();if(this.hot.selection.isSelected()&&c){const d=this.hot.getSelectedRange();O(d,u=>{const f=u.getTopStartCorner().row,p=u.getBottomStartCorner().row;Re(f,p,C=>{ae(this,Oi).includes(C)||ae(this,Oi).push(C)})})}ae(this,Oi).includes(ae(this,Ig))||qe(this,Oi,[ae(this,Ig)]),qe(this,Hg,h.top-6),qe(this,Oc,xn(ae(this,ps))),qe(this,CC,oY(ae(this,ps),"vertical")),ae(this,Bo).style.top=`${ae(this,Hg)+ae(this,Oc)}px`,ae(this,Bo).style[this.inlineDir]=`${h.start}px`,ae(this,Bo).style.width=`${r}px`,this.hot.rootElement.appendChild(ae(this,Bo))}refreshHandlePosition(){ae(this,Bo).style.top=`${ae(this,Hg)+ae(this,Wu)}px`}setupGuidePosition(){const e=parseInt(Cn(ae(this,Bo)),10),t=parseInt(ae(this,Bo).style[this.inlineDir],10)+e,o=this.hot.view.getTableWidth();V(ae(this,Bo),"active"),V(ae(this,er),"active"),ae(this,er).style.top=ae(this,Bo).style.top,ae(this,er).style[this.inlineDir]=`${t}px`,ae(this,er).style.width=`${o-e}px`,this.hot.rootElement.appendChild(ae(this,er))}refreshGuidePosition(){ae(this,er).style.top=ae(this,Bo).style.top}hideHandleAndGuide(){re(ae(this,Bo),"active"),re(ae(this,er),"active")}checkIfRowHeader(e){const t=qc(e,["TBODY"],this.hot.rootElement),{inlineStartOverlay:o,topInlineStartCornerOverlay:i,bottomInlineStartCornerOverlay:s}=this.hot.view._wt.wtOverlays;return[o.clone.wtTable.TBODY,i.clone.wtTable.TBODY,s.clone.wtTable.TBODY].includes(t)}getClosestTHParent(e){return e.tagName!=="TABLE"?e.tagName==="TH"?e:this.getClosestTHParent(e.parentNode):null}getActualRowHeight(e){const t=this.hot.view._wt.wtTable.getRowHeight(e);return t!==void 0&&ae(this,Ya)<t?t:ae(this,Ya)}afterMouseDownTimeout(){const e=()=>{this.hot.view.adjustElementsSize(),this.hot.render()},t=(o,i)=>{const s=this.hot.runHooks("beforeRowResize",this.getActualRowHeight(o),o,!0);s!==void 0&&qe(this,Ya,s),this.setManualSize(o,ae(this,Ya)),this.hot.runHooks("afterRowResize",this.getActualRowHeight(o),o,!0),i&&e()};ae(this,Ec)>=2&&(ae(this,Oi).length>1?(O(ae(this,Oi),i=>{t(i)}),e()):O(ae(this,Oi),i=>{t(i,!0)})),qe(this,Ec,0),qe(this,Fp,null)}bindEvents(){const{rootElement:e,rootWindow:t}=this.hot;this.eventManager.addEventListener(e,"mouseover",o=>tc(this,oL,Bpe).call(this,o)),this.eventManager.addEventListener(e,"mousedown",o=>tc(this,iL,Vpe).call(this,o)),this.eventManager.addEventListener(t,"mousemove",o=>tc(this,sL,zpe).call(this,o)),this.eventManager.addEventListener(t,"mouseup",()=>tc(this,rL,Upe).call(this)),this.eventManager.addEventListener(ae(this,Bo),"contextmenu",()=>tc(this,aL,Ype).call(this))}destroy(){super.destroy()}constructor(e){super(e),nc(this,oL),nc(this,iL),nc(this,sL),nc(this,rL),nc(this,aL),nc(this,lL),nc(this,hL),wo(this,ps,{writable:!0,value:void 0}),wo(this,Ig,{writable:!0,value:void 0}),wo(this,Oi,{writable:!0,value:void 0}),wo(this,Wu,{writable:!0,value:void 0}),wo(this,Ya,{writable:!0,value:void 0}),wo(this,ky,{writable:!0,value:void 0}),wo(this,Oc,{writable:!0,value:void 0}),wo(this,Hg,{writable:!0,value:void 0}),wo(this,CC,{writable:!0,value:void 0}),wo(this,Bo,{writable:!0,value:void 0}),wo(this,er,{writable:!0,value:void 0}),wo(this,Rh,{writable:!0,value:void 0}),wo(this,Mm,{writable:!0,value:void 0}),wo(this,Ec,{writable:!0,value:void 0}),wo(this,Fp,{writable:!0,value:void 0}),wo(this,Yr,{writable:!0,value:void 0}),wo(this,nu,{writable:!0,value:void 0}),wo(this,Bp,{writable:!0,value:void 0}),qe(this,ps,null),qe(this,Ig,null),qe(this,Oi,[]),qe(this,Wu,null),qe(this,Ya,null),qe(this,ky,null),qe(this,Oc,null),qe(this,Hg,null),qe(this,CC,1),qe(this,Bo,this.hot.rootDocument.createElement("DIV")),qe(this,er,this.hot.rootDocument.createElement("DIV")),qe(this,Rh,!1),qe(this,Mm,!1),qe(this,Ec,0),qe(this,Fp,null),qe(this,nu,null),V(ae(this,Bo),"manualRowResizer"),V(ae(this,er),"manualRowResizerGuide")}}function Bpe(n){if(!_F(n.target)&&ae(this,Mm)!==!0&&this.checkIfRowHeader(n.target)){const e=this.getClosestTHParent(n.target);e&&(ae(this,Rh)||this.setupHandlePosition(e))}}function Vpe(n){n.target.parentNode===this.hot.rootElement&&Se(n.target,"manualRowResizer")&&(this.setupHandlePosition(ae(this,ps)),this.setupGuidePosition(),qe(this,Rh,!0),ae(this,Fp)===null&&qe(this,Fp,this.hot._registerTimeout(()=>this.afterMouseDownTimeout(),500)),qe(this,Ec,ae(this,Ec)+1),qe(this,ky,n.pageY),qe(this,Ya,ae(this,Oc)))}function zpe(n){if(ae(this,Rh)){const e=n.pageY-ae(this,ky),t=iY(e,ae(this,CC));qe(this,Wu,ae(this,Oc)+t),O(ae(this,Oi),o=>{qe(this,Ya,this.setManualSize(o,ae(this,Wu)))}),this.refreshHandlePosition(),this.refreshGuidePosition()}}function Upe(){const n=()=>{this.hot.view.adjustElementsSize(),this.hot.render()},e=(t,o)=>{this.hot.runHooks("beforeRowResize",this.getActualRowHeight(t),t,!1),o&&n(),this.hot.runHooks("afterRowResize",this.getActualRowHeight(t),t,!1)};ae(this,Rh)&&(this.hideHandleAndGuide(),qe(this,Rh,!1),ae(this,Ya)!==ae(this,Oc)&&(ae(this,Oi).length>1?(O(ae(this,Oi),o=>{e(o)}),n()):O(ae(this,Oi),o=>{e(o,!0)})),this.setupHandlePosition(ae(this,ps)))}function Ype(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(ae(this,Bo)),this.hot.rootElement.removeChild(ae(this,er)),qe(this,Rh,!1),qe(this,Mm,!0),this.hot._registerMicrotask(()=>{qe(this,Mm,!1)})}function Gpe(n,e){let t=n;if(this.enabled){const o=this.hot.toPhysicalRow(e),i=ae(this,Yr).getValueAtIndex(o);this.hot.getSettings()[Ey]&&i&&(this.hot.getPlugin("autoRowSize")?.isEnabled()?t=Math.max(i,t??0):t=i)}return t}function jpe(){const n=this.hot.getSettings()[Ey];this.hot.batchExecution(()=>{Array.isArray(n)?(n.forEach((e,t)=>{ae(this,Yr).setValueAtIndex(t,e)}),qe(this,Bp,n)):n===!0&&Array.isArray(ae(this,Bp))&&ae(this,Bp).forEach((e,t)=>{ae(this,Yr).setValueAtIndex(t,e)})},!0)}function qpe(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Kpe(n,e){return e.get?e.get.call(n):e.value}function Xpe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function uY(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function cL(n,e){var t=uY(n,e,"get");return Kpe(n,t)}function Zpe(n,e,t){qpe(n,e),e.set(n,t)}function Ag(n,e,t){var o=uY(n,e,"set");return Xpe(n,o,t),t}var Nl=new WeakMap;class Vr{static NEGATIVE_VALUES_WARNING({row:e,col:t,rowspan:o,colspan:i}){return pt`The merged cell declared with {row: ${e}, col: ${t},\x20
259
- rowspan: ${o}, colspan: ${i}} contains negative values, which is\x20
260
- not supported. It will not be added to the collection.`}static IS_OUT_OF_BOUNDS_WARNING({row:e,col:t}){return pt`The merged cell declared at [${e}, ${t}] is positioned\x20
261
- (or positioned partially) outside of the table range. It was not added to the table, please fix your setup.`}static IS_SINGLE_CELL({row:e,col:t}){return pt`The merged cell declared at [${e}, ${t}] has both "rowspan"\x20
262
- and "colspan" declared as "1", which makes it a single cell. It cannot be added to the collection.`}static ZERO_SPAN_WARNING({row:e,col:t}){return pt`The merged cell declared at [${e}, ${t}] has "rowspan"\x20
263
- or "colspan" declared as "0", which is not supported. It cannot be added to the collection.`}static containsNegativeValues({row:e,col:t,rowspan:o,colspan:i}){return e<0||t<0||o<0||i<0}static isSingleCell({rowspan:e,colspan:t}){return t===1&&e===1}static containsZeroSpan({rowspan:e,colspan:t}){return t===0||e===0}static isOutOfBounds(e,t,o){return e.row<0||e.col<0||e.row>=t||e.row+e.rowspan-1>=t||e.col>=o||e.col+e.colspan-1>=o}normalize(e){const t=e.countRows(),o=e.countCols();this.row<0?this.row=0:this.row>t-1&&(this.row=t-1),this.col<0?this.col=0:this.col>o-1&&(this.col=o-1),this.row+this.rowspan>t-1&&(this.rowspan=t-this.row),this.col+this.colspan>o-1&&(this.colspan=o-this.col),Ag(this,Nl,null)}includes(e,t){return this.row<=e&&this.col<=t&&this.row+this.rowspan-1>=e&&this.col+this.colspan-1>=t}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,t){const o=e[0]||e[1],i=t+Math.abs(e[0]||e[1])-1,s=e[0]?"colspan":"rowspan",r=e[0]?"col":"row",a=Math.min(t,i),l=Math.max(t,i),h=this[r],c=this[r]+this[s]-1;if(h>=t&&(this[r]+=o),o>0)t<=c&&t>h&&(this[s]+=o);else if(o<0){if(a<=h&&l>=c)return this.removed=!0,Ag(this,Nl,null),!1;if(h>=a&&h<=l){const d=l-h+1,u=Math.abs(o)-d;this[r]-=u+o,this[s]-=d}else if(h<=a&&c>=l)this[s]+=o;else if(h<=a&&c>=a&&c<l){const d=c-a+1;this[s]-=d}}return Ag(this,Nl,null),!0}isFarther(e,t){return e?t==="down"?e.row+e.rowspan-1<this.row+this.rowspan-1:t==="up"?e.row>this.row:t==="right"?e.col+e.colspan-1<this.col+this.colspan-1:t==="left"?e.col>this.col:null:!0}getLastRow(){return this.row+this.rowspan-1}getLastColumn(){return this.col+this.colspan-1}getRange(){return cL(this,Nl)||Ag(this,Nl,this.cellRangeFactory(this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.getLastRow(),this.getLastColumn()))),cL(this,Nl)}constructor(e,t,o,i,s,r){Zpe(this,Nl,{writable:!0,value:void 0}),this.removed=!1,Ag(this,Nl,null),this.row=e,this.col=t,this.rowspan=o,this.colspan=i,this.cellCoordsFactory=s,this.cellRangeFactory=r}}function Qpe(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function oc(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function DR(n,e){Qpe(n,e),e.add(n)}var Og=new WeakSet,NR=new WeakSet,dL=new WeakSet;class Ty{static IS_OVERLAPPING_WARNING({row:e,col:t}){return pt`The merged cell declared at [${e}, ${t}], overlaps\x20
264
- with the other declared merged cell. The overlapping merged cell was not added to the table, please\x20
265
- fix your setup.`}get(e,t){return this.mergedCellsMatrix.has(e)?this.mergedCellsMatrix.get(e).get(t)??!1:!1}getByRange(e){const{row:t,col:o}=e.getTopStartCorner(),{row:i,col:s}=e.getBottomEndCorner(),r=this.mergedCells.length;let a=!1;for(let l=0;l<r;l++){const h=this.mergedCells[l],{row:c,col:d,rowspan:u,colspan:f}=h;if(c>=t&&c+u-1<=i&&d>=o&&d+f-1<=s){a=h;break}}return a}filterOverlappingMergeCells(e){const t=new Set;return this.mergedCells.forEach(i=>{const{row:s,col:r,colspan:a,rowspan:l}=i;for(let h=s;h<s+l;h++)for(let c=r;c<r+a;c++)t.add(`r${h},c${c}`)}),e.filter(i=>{const{row:s,col:r,colspan:a,rowspan:l}=i,h=new Set;let c=!1;for(let d=s;d<s+l;d++){for(let u=r;u<r+a;u++){const f=`r${d},c${u}`;if(t.has(f)){Ie(Ty.IS_OVERLAPPING_WARNING(i)),c=!0;break}h.add(f)}if(c)break}return c||t.add(...h),!c})}getWithinRange(e,t=!1){const{row:o,col:i}=e.getTopStartCorner(),{row:s,col:r}=e.getBottomEndCorner(),a=[];for(let l=o;l<=s;l++)for(let h=i;h<=r;h++){const c=this.get(l,h);c&&(t||!t&&c.row===l&&c.col===h)&&a.push(c)}return a}add(e,t=!1){const o=e.row,i=e.col,s=e.rowspan,r=e.colspan,a=new Vr(o,i,s,r,this.hot._createCellCoords,this.hot._createCellRange),l=this.get(o,i),h=t?!1:this.isOverlapping(a);return!l&&!h?(this.hot&&a.normalize(this.hot),this.mergedCells.push(a),oc(this,NR,uL).call(this,a),a):(h&&Ie(Ty.IS_OVERLAPPING_WARNING(a)),!1)}remove(e,t){const o=this.get(e,t),i=o?this.mergedCells.indexOf(o):-1;return o&&i!==-1?(this.mergedCells.splice(i,1),oc(this,dL,Jpe).call(this,o),o):!1}clear(){O(this.mergedCells,({row:e,col:t,rowspan:o,colspan:i})=>{Re(e,e+o,s=>{Re(t,t+i,r=>{const a=this.hot.getCell(s,r);a&&(a.removeAttribute("rowspan"),a.removeAttribute("colspan"),a.style.display="")})})}),this.mergedCells.length=0,this.mergedCellsMatrix=new Map}isOverlapping(e){const t=e.getRange();for(let o=0;o<this.mergedCells.length;o++)if(this.mergedCells[o].getRange().overlaps(t))return!0;return!1}isFirstRenderableMergedCell(e,t){const o=this.get(e,t);if(!o)return!1;const{row:i,col:s,rowspan:r,colspan:a}=o,l=this.hot.view.getActiveOverlayName(),h=["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(),d=tt(h,i,i+r-1),u=tt(c,s,s+a-1);return this.hot.rowIndexMapper.getNearestNotHiddenIndex(d,1)===e&&this.hot.columnIndexMapper.getNearestNotHiddenIndex(u,1)===t}getFirstRenderableCoords(e,t){const o=this.get(e,t);if(!o||this.isFirstRenderableMergedCell(e,t))return this.hot._createCellCoords(e,t);const i=this.hot.rowIndexMapper.getNearestNotHiddenIndex(o.row,1),s=this.hot.columnIndexMapper.getNearestNotHiddenIndex(o.col,1);return this.hot._createCellCoords(i,s)}getStartMostColumnIndex(e,t){const o=oc(this,Og,_b).call(this,e,"col",-1);let i=t;for(let s=0;s<o.length;s++)if(o[s]<=t){i=o[s];break}return i}getEndMostColumnIndex(e,t){const o=oc(this,Og,_b).call(this,e,"col",1);let i=t;for(let s=0;s<o.length;s++)if(o[s]>=t){i=o[s];break}return i}getTopMostRowIndex(e,t){const o=oc(this,Og,_b).call(this,e,"row",-1);let i=t;for(let s=0;s<o.length;s++)if(o[s]<=t){i=o[s];break}return i}getBottomMostRowIndex(e,t){const o=oc(this,Og,_b).call(this,e,"row",1);let i=t;for(let s=0;s<o.length;s++)if(o[s]>=t){i=o[s];break}return i}shiftCollections(e,t,o){const i=[0,0];switch(e){case"right":i[0]+=o;break;case"left":i[0]-=o;break;case"down":i[1]+=o;break;case"up":i[1]-=o;break}const s=[];this.mergedCells.forEach(r=>{r.shift(i,t),r.removed&&s.push(r)}),s.forEach(r=>{this.mergedCells.splice(this.mergedCells.indexOf(r),1)}),this.mergedCellsMatrix.clear(),this.mergedCells.forEach(r=>{oc(this,NR,uL).call(this,r)})}constructor(e){DR(this,Og),DR(this,NR),DR(this,dL),this.mergedCells=[],this.mergedCellsMatrix=new Map,this.plugin=e,this.hot=e.hot}}function _b(n,e,t=1){const o=new Map,i=t===1?n.getTopStartCorner():n.getBottomEndCorner(),s=t===1?n.getBottomEndCorner():n.getTopStartCorner();for(let r=i.row;t===1?r<=s.row:r>=s.row;r+=t)for(let a=i.col;t===1?a<=s.col:a>=s.col;a+=t){const l=e==="row"?r:a,h=this.get(r,a);let c=l;h&&(c=t===1?h[e]+h[`${e}span`]-1:h[e]),o.has(l)||o.set(l,new Set),o.get(l).add(c)}return Array.from(new Set(Array.from(o.entries()).filter(([,r])=>r.size===1).flatMap(([,r])=>Array.from(r))))}function uL(n){for(let e=n.row;e<n.row+n.rowspan;e++)for(let t=n.col;t<n.col+n.colspan;t++)this.mergedCellsMatrix.has(e)||this.mergedCellsMatrix.set(e,new Map),this.mergedCellsMatrix.get(e).set(t,n)}function Jpe(n){for(let e=n.row;e<n.row+n.rowspan;e++)for(let t=n.col;t<n.col+n.colspan;t++)this.mergedCellsMatrix.get(e).delete(t)}class eme{getDirection(e,t){let o=null;return t[0]===e[0]&&t[1]===e[1]&&t[3]===e[3]?o="down":t[2]===e[2]&&t[1]===e[1]&&t[3]===e[3]?o="up":t[1]===e[1]&&t[2]===e[2]?o="right":o="left",o}snapDragArea(e,t,o,i){const s=t.slice(0),r=this.getAutofillSize(e,t,o),[a,l,h,c]=e,u=["up","down"].indexOf(o)>-1?h-a+1:c-l+1,f=Math.floor(r/u)*u,p=r-f,C=this.getFarthestCollection(e,t,o,i);if(C){if(o==="down"){const y=C.row+C.rowspan-a-p;s[2]+y>=this.plugin.hot.countRows()?s[2]-=p:s[2]+=p?y:0}else if(o==="right"){const y=C.col+C.colspan-l-p;s[3]+y>=this.plugin.hot.countCols()?s[3]-=p:s[3]+=p?y:0}else if(o==="up"){const y=h-p-C.row+1;s[0]+y<0?s[0]+=p:s[0]-=p?y:0}else if(o==="left"){const y=c-p-C.col+1;s[1]+y<0?s[1]+=p:s[1]-=p?y:0}}return this.updateCurrentFillCache({baseArea:e,dragDirection:o,foundMergedCells:i,fillSize:r,dragArea:s,cycleLength:u}),s}updateCurrentFillCache(e){this.currentFillData||(this.currentFillData={}),Fn(this.currentFillData,e)}getAutofillSize(e,t,o){const[i,s,r,a]=e,[l,h,c,d]=t;switch(o){case"up":return i-l;case"down":return c-r;case"left":return s-h;case"right":return d-a;default:return null}}getDragArea(e,t,o){const[i,s,r,a]=e,[l,h,c,d]=t;switch(o){case"up":return[l,h,i-1,a];case"down":{const u=this.mergedCellsCollection.get(c,a),f=u?u.rowspan-1:0;return[r+1,s,c+f,a]}case"left":return[l,h,r,s-1];case"right":{const u=this.mergedCellsCollection.get(c,a),f=u?u.colspan-1:0;return[i,a+f,c,d]}default:return null}}getFarthestCollection(e,t,o,i){const[s,r,a,l]=e,h=["up","down"].indexOf(o)>-1,c=h?a:l,d=h?s:r,u=this.getAutofillSize(e,t,o),f=h?a-s+1:l-r+1,p=Math.floor(u/f)*f,C=u-p;let y=null,_=null,T=null;switch(o){case"up":y="includesVertically",T=c-C+1;break;case"left":y="includesHorizontally",T=c-C+1;break;case"down":y="includesVertically",T=d+C-1;break;case"right":y="includesHorizontally",T=d+C-1;break}return O(i,P=>{P[y](T)&&P.isFarther(_,o)&&(_=P)}),_}recreateAfterDataPopulation(e){if(!this.currentFillData)return;const t=this.getRangeFromChanges(e),o=this.currentFillData.foundMergedCells,i=this.currentFillData.dragDirection,s=(h,c)=>{switch(i){case"up":return h.row-c>=t.from.row;case"down":return h.row+h.rowspan-1+c<=t.to.row;case"left":return h.col-c>=t.from.column;case"right":return h.col+h.colspan-1+c<=t.to.column;default:return null}};let r=0,a=null,l=1;do for(let h=0;h<o.length;h+=1){if(a=o[h],r=l*this.currentFillData.cycleLength,s(a,r))switch(i){case"up":this.plugin.mergedCellsCollection.add({row:a.row-r,rowspan:a.rowspan,col:a.col,colspan:a.colspan},!0);break;case"down":this.plugin.mergedCellsCollection.add({row:a.row+r,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-r,colspan:a.colspan},!0);break;case"right":this.plugin.mergedCellsCollection.add({row:a.row,rowspan:a.rowspan,col:a.col+r,colspan:a.colspan},!0);break}h===o.length-1&&(l+=1)}while(s(a,r));this.currentFillData=null,this.plugin.hot.render(),o.length>0&&this.plugin.ifChromeForceRepaint()}getRangeFromChanges(e){const t={min:null,max:null},o={min:null,max:null};return O(e,i=>{const s=i[0],r=this.plugin.hot.propToCol(i[1]);(t.min===null||s<t.min)&&(t.min=s),(t.max===null||s>t.max)&&(t.max=s),(o.min===null||r<o.min)&&(o.min=r),(o.max===null||r>o.max)&&(o.max=r)}),{from:{row:t.min,column:o.min},to:{row:t.max,column:o.max}}}dragAreaOverlapsCollections(e,t,o){const i=this.getDragArea(e,t,o),[s,r,a,l]=i,h=this.plugin.hot._createCellCoords(s,r),c=this.plugin.hot._createCellCoords(a,l),d=this.plugin.hot._createCellRange(h,h,c);if(this.mergedCellsCollection.getWithinRange(d,!0).length===0)return!1;const f=this.mergedCellsCollection.getWithinRange(d,!1);return f.length===0?!0:o==="up"||o==="down"?!f.every(({colspan:p})=>p===d.getWidth()):!f.every(({rowspan:p})=>p===d.getHeight())}constructor(e){this.currentFillData=null,this.plugin=e,this.mergedCellsCollection=this.plugin.mergedCellsCollection}}class tme{getSelectedMergedCellClassName(e,t,o,i){const s=Math.min(o[0],o[2]),r=Math.min(o[1],o[3]),a=Math.max(o[0],o[2]),l=Math.max(o[1],o[3]);if(i===void 0||!this.plugin.mergedCellsCollection.isFirstRenderableMergedCell(e,t))return;const c=this.plugin.mergedCellsCollection.get(e,t);if(!c)return;const d=c.getLastRow(),u=c.getLastColumn();if(s<=c.row&&r<=c.col&&a>=d&&l>=u)return`${this.fullySelectedMergedCellClassName}-${i}`;if(this.isMergeCellFullySelected(c,this.plugin.hot.getSelectedRange()))return`${this.fullySelectedMergedCellClassName}-multiple`}isMergeCellFullySelected(e,t){const o=[];if(!t||!e)return!1;for(let i=0;i<e.rowspan;i+=1)for(let s=0;s<e.colspan;s+=1)o.push(this.hot._createCellCoords(e.row+i,e.col+s));for(let i=0;i<o.length;i+=1){const s=[];for(let r=0;r<t.length;r+=1)s[r]=t[r].includes(o[i]);if(!s.includes(!0))return!1}return!0}getSelectedMergedCellClassNameToRemove(){const e=[];for(let t=0;t<=7;t+=1)e.push(`${this.fullySelectedMergedCellClassName}-${t}`);return e.push(`${this.fullySelectedMergedCellClassName}-multiple`),e}constructor(e){this.fullySelectedMergedCellClassName="fullySelectedMergedCell",this.plugin=e,this.hot=e.hot}}function nme(n){return{key:"mergeCells",name(){const e=this.getSelectedActive();if(e){const t=n.mergedCellsCollection.get(e[0],e[1]);if(t.row===e[0]&&t.col===e[1]&&t.row+t.rowspan-1===e[2]&&t.col+t.colspan-1===e[3])return this.getTranslatedPhrase(tT)}return this.getTranslatedPhrase(eT)},callback(){const e=this.getSelectedRangeActive();if(!e)return;e.setDirection(this.isRtl()?"NE-SW":"NW-SE");const{from:t,to:o}=e;n.toggleMerge(e),this.selectCell(t.row,t.col,o.row,o.col,!1)},disabled(){const e=this.getSelectedActive();return e?Vr.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}}class fL{constructor(e){this.next=null,this.prev=null,this.data=e}}class Sb{push(e){const t=new fL(e);if(this.first===null)this.first=t,this.last=t;else{const o=this.last;this.last=t,t.prev=o,o.next=t}return t}unshift(e){const t=new fL(e);if(this.first===null)this.first=t,this.last=t;else{const o=this.first;this.first=t,t.next=o,o.prev=t}}inorder(e){let t=this.first;for(;t;){const o=e(t);if(t===this.last||o===!0)break;t=t.next}}remove(e){if(this.first===null)return!1;let t=this.first,o,i;for(;t;){if(t.data===e)return o=t.next,i=t.prev,o&&(o.prev=i),i&&(i.next=o),t===this.first&&(this.first=o),t===this.last&&(this.last=i),!0;t=t.next}return!1}hasCycle(){let e=this.first,t=this.first;for(;;){if(e===null||(e=e.next,e===null))return!1;if(e=e.next,t=t.next,e===t)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(o,i){i&&(e(i,i.next),i.next=o)}if(!this.first)return;e(this.first,this.first.next),this.first.next=null;const t=this.first;this.first=this.last,this.last=t}reverse(){if(!this.first||!this.first.next)return;let e=this.first.next,t=this.first,o;for(;e;)o=e.next,e.next=t,t.prev=e,t=e,e=o;this.first.next=null,this.last.prev=null,o=this.first,this.first=t,this.last=o}constructor(){this.first=null,this.last=null}}function fY(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ome(n,e){return e.get?e.get.call(n):e.value}function ime(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function gY(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Et(n,e){var t=gY(n,e,"get");return ome(n,t)}function ic(n,e,t){fY(n,e),e.set(n,t)}function Un(n,e,t){var o=gY(n,e,"set");return ime(n,o,t),t}function gL(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function sme(n,e){fY(n,e),e.add(n)}var $s=new WeakMap,Fs=new WeakMap,Bs=new WeakMap,Vs=new WeakMap,yC=new WeakMap,Dg=new WeakMap,Ng=new WeakMap,PR=new WeakSet;class rme{getCurrentVerticalNode(){return Et(this,Vs).data}getFirstVerticalNode(){return Et(this,Fs).first.data}getNextVerticalNode(){return Et(this,Vs).next.data}getPrevVerticalNode(){return Et(this,Vs).prev.data}getCurrentHorizontalNode(){return Et(this,Bs).data}getFirstHorizontalNode(){return Et(this,$s).first.data}getNextHorizontalNode(){return Et(this,Bs).next.data}getPrevHorizontalNode(){return Et(this,Bs).prev.data}setPrevNodeAsActive(){Un(this,Vs,Et(this,Vs).prev),Un(this,Bs,Et(this,Bs).prev)}setNextNodeAsActive(){Un(this,Vs,Et(this,Vs).next),Un(this,Bs,Et(this,Bs).next)}buildFocusOrder(e){Un(this,$s,new Sb),e.forEach((t,o)=>{const i=new WeakSet,s=t.getTopStartCorner(),r=t.getBottomEndCorner();for(let a=s.row;a<=r.row;a++)if(!Et(this,Dg).isHidden(a))for(let l=s.col;l<=r.col;l++){if(Et(this,Ng).isHidden(l))continue;const h=gL(this,PR,pL).call(this,{selectedRange:t,selectionLayer:o,listOrder:Et(this,$s),mergeCellsVisitor:i,row:a,column:l});h&&Un(this,Bs,h)}}),Et(this,$s).first&&(Et(this,$s).first.prev=Et(this,$s).last,Et(this,$s).last.next=Et(this,$s).first),Un(this,Fs,new Sb),e.forEach((t,o)=>{const i=new WeakSet,s=t.getTopStartCorner(),r=t.getBottomEndCorner();for(let a=s.col;a<=r.col;a++)if(!Et(this,Ng).isHidden(a))for(let l=s.row;l<=r.row;l++){if(Et(this,Dg).isHidden(l))continue;const h=gL(this,PR,pL).call(this,{selectedRange:t,selectionLayer:o,listOrder:Et(this,Fs),mergeCellsVisitor:i,row:l,column:a});h&&Un(this,Vs,h)}}),Et(this,Fs).first&&(Et(this,Fs).first.prev=Et(this,Fs).last,Et(this,Fs).last.next=Et(this,Fs).first)}setActiveNode(e,t,o){return Et(this,$s).inorder(i=>{const{selectionLayer:s,rowStart:r,rowEnd:a,colStart:l,colEnd:h}=i.data;if(s===o&&e>=r&&e<=a&&t>=l&&t<=h)return Un(this,Bs,i),!0}),Et(this,Fs).inorder(i=>{const{selectionLayer:s,rowStart:r,rowEnd:a,colStart:l,colEnd:h}=i.data;if(s===o&&e>=r&&e<=a&&t>=l&&t<=h)return Un(this,Vs,i),!0}),this}constructor({mergedCellsGetter:e,rowIndexMapper:t,columnIndexMapper:o}){sme(this,PR),ic(this,$s,{writable:!0,value:void 0}),ic(this,Fs,{writable:!0,value:void 0}),ic(this,Bs,{writable:!0,value:void 0}),ic(this,Vs,{writable:!0,value:void 0}),ic(this,yC,{writable:!0,value:void 0}),ic(this,Dg,{writable:!0,value:void 0}),ic(this,Ng,{writable:!0,value:void 0}),Un(this,$s,new Sb),Un(this,Fs,new Sb),Un(this,Bs,null),Un(this,Vs,null),Un(this,yC,null),Un(this,Dg,null),Un(this,Ng,null),Un(this,yC,e),Un(this,Dg,t),Un(this,Ng,o)}}function pL({selectedRange:n,selectionLayer:e,listOrder:t,mergeCellsVisitor:o,row:i,column:s}){const r=n.getTopStartCorner(),a=n.getBottomEndCorner(),l=n.highlight.clone().normalize(),h=Et(this,yC).call(this,i,s);if(h&&o.has(h))return null;const c={selectionLayer:e,colStart:s,colEnd:s,rowStart:i,rowEnd:i};if(h){if(o.add(h),h.row<r.row||h.row+h.rowspan-1>a.row||h.col<r.col||h.col+h.colspan-1>a.col)return null;c.colStart=h.col,c.colEnd=h.col+h.colspan-1,c.rowStart=h.row,c.rowEnd=h.row+h.rowspan-1}const d=t.push(c);return i===l.row&&s===l.col||h&&l.row>=h.row&&l.row<=h.row+h.rowspan-1&&l.col>=h.col&&l.col<=h.col+h.colspan-1?d:null}function pY(n,e,t){const{rowIndexMapper:o,stylesHandler:i}=n;let s=0;for(let r=e;r<e+t;r++)o.isHidden(r)||(s+=n.getRowHeight(r)??i.getDefaultRowHeight(r));return s}function ame(n){const{hot:e}=n,{rowIndexMapper:t,columnIndexMapper:o}=e,i=new Map;function s(){}function r(a,l,h){const c=n.mergedCellsCollection.get(l,h);if(!ie(c)){a.removeAttribute("rowspan"),a.removeAttribute("colspan"),i.has(l)&&!e.getSettings().rowHeaders&&(a.style.height=`${i.get(l)}px`,i.delete(l)),a.style.display="";return}const{row:d,col:u,colspan:f,rowspan:p}=c,[C,y]=n.translateMergedCellToRenderable(d,p,u,f),_=n.getSetting("virtualized");if(u===0&&!e.getSettings().rowHeaders){const G=e._getRowHeightFromSettings(l);if(G!==void 0){const Q=e.stylesHandler.areCellsBorderBox()?0:1;i.set(l,G-Q)}else if($y()){const te=pY(e,d,p);i.set(l,te/p)}}const T=t.getRenderableFromVisualIndex(l),P=o.getRenderableFromVisualIndex(h),$=C-T+1,F=y-P+1;let N=t.getNearestNotHiddenIndex(d,1),I=o.getNearestNotHiddenIndex(u,1);if(_){const G=e.view.getActiveOverlayName();["top","top_inline_start_corner"].includes(G)||(N=Math.max(N,e.getFirstRenderedVisibleRow())),["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(G)||(I=Math.max(I,e.getFirstRenderedVisibleColumn()))}const j=Math.min(p,$),U=Math.min(f,F);N===l&&I===h?(a.setAttribute("rowspan",j),a.setAttribute("colspan",U)):(a.removeAttribute("rowspan"),a.removeAttribute("colspan"),a.style.display="none")}return{before:s,after:r}}function mY(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lme(n,e){return e.get?e.get.call(n):e.value}function hme(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function wY(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Ut(n,e){var t=wY(n,e,"get");return lme(n,t)}function vb(n,e,t){mY(n,e),e.set(n,t)}function Ja(n,e,t){var o=wY(n,e,"set");return hme(n,o,t),t}function Wt(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function jt(n,e){mY(n,e),e.add(n)}de.getSingleton().register("beforeMergeCells");de.getSingleton().register("afterMergeCells");de.getSingleton().register("beforeUnmergeCells");de.getSingleton().register("afterUnmergeCells");const z0="mergeCells",cme=150,mL=z0;var Xi=new WeakMap,Ji=new WeakMap,cr=new WeakMap,LR=new WeakMap,wL=new WeakSet,bL=new WeakSet,CL=new WeakSet,yL=new WeakSet,_L=new WeakSet,SL=new WeakSet,WR=new WeakSet,vL=new WeakSet,$R=new WeakSet,RL=new WeakSet,EL=new WeakSet,kL=new WeakSet,TL=new WeakSet,xL=new WeakSet,ML=new WeakSet,IL=new WeakSet,HL=new WeakSet,AL=new WeakSet,OL=new WeakSet,DL=new WeakSet,NL=new WeakSet,PL=new WeakSet,LL=new WeakSet,WL=new WeakSet,$L=new WeakSet,FL=new WeakSet;class dme extends at{static get PLUGIN_KEY(){return z0}static get PLUGIN_PRIORITY(){return cme}static get DEFAULT_SETTINGS(){return{[T2]:"cells",virtualized:!1,cells:[]}}isEnabled(){return!!this.hot.getSettings()[z0]}enablePlugin(){this.enabled||(this.mergedCellsCollection=new Ty(this),this.autofillCalculations=new eme(this),this.selectionCalculations=new tme(this),this.addHook("afterInit",(...e)=>Wt(this,wL,ume).call(this,...e)),this.addHook("modifyTransformFocus",(...e)=>Wt(this,CL,gme).call(this,...e)),this.addHook("modifyTransformStart",(...e)=>Wt(this,yL,pme).call(this,...e)),this.addHook("modifyTransformEnd",(...e)=>Wt(this,_L,mme).call(this,...e)),this.addHook("beforeSelectionHighlightSet",(...e)=>Wt(this,SL,wme).call(this,...e)),this.addHook("beforeSetRangeStart",(...e)=>Wt(this,$R,VL).call(this,...e)),this.addHook("beforeSetRangeStartOnly",(...e)=>Wt(this,$R,VL).call(this,...e)),this.addHook("beforeSelectionFocusSet",(...e)=>Wt(this,RL,Cme).call(this,...e)),this.addHook("afterSelectionFocusSet",(...e)=>Wt(this,EL,yme).call(this,...e)),this.addHook("afterSelectionEnd",(...e)=>Wt(this,kL,_me).call(this,...e)),this.addHook("modifyGetCellCoords",(...e)=>Wt(this,WR,BL).call(this,...e)),this.addHook("modifyGetCoordsElement",(...e)=>Wt(this,WR,BL).call(this,...e)),this.addHook("afterIsMultipleSelection",(...e)=>Wt(this,bL,fme).call(this,...e)),this.addHook("afterRenderer",(...e)=>Ut(this,LR).after(...e)),this.addHook("afterContextMenuDefaultOptions",(...e)=>Wt(this,vL,bme).call(this,...e)),this.addHook("afterGetCellMeta",(...e)=>Wt(this,TL,Sme).call(this,...e)),this.addHook("afterViewportRowCalculatorOverride",(...e)=>Wt(this,xL,vme).call(this,...e)),this.addHook("afterViewportColumnCalculatorOverride",(...e)=>Wt(this,ML,Rme).call(this,...e)),this.addHook("modifyAutofillRange",(...e)=>Wt(this,IL,Eme).call(this,...e)),this.addHook("afterCreateCol",(...e)=>Wt(this,HL,kme).call(this,...e)),this.addHook("afterRemoveCol",(...e)=>Wt(this,AL,Tme).call(this,...e)),this.addHook("afterCreateRow",(...e)=>Wt(this,OL,xme).call(this,...e)),this.addHook("afterRemoveRow",(...e)=>Wt(this,DL,Mme).call(this,...e)),this.addHook("afterChange",(...e)=>Wt(this,NL,Ime).call(this,...e)),this.addHook("beforeDrawBorders",(...e)=>Wt(this,PL,Hme).call(this,...e)),this.addHook("afterDrawSelection",(...e)=>Wt(this,LL,Ame).call(this,...e)),this.addHook("beforeRemoveCellClassNames",(...e)=>Wt(this,WL,Ome).call(this,...e)),this.addHook("beforeBeginEditing",(...e)=>Wt(this,$L,Dme).call(this,...e)),this.addHook("modifyRowHeightByOverlayName",(...e)=>Wt(this,FL,Nme).call(this,...e)),this.addHook("beforeUndoStackChange",(e,t)=>{if(t==="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(!E4())return;const e=[];let t=[];this.mergedCellsCollection.mergedCells.forEach(o=>{const{row:i,rowspan:s}=o;for(let r=i+1;r<i+s;r++)t.push(r)}),t=[...new Set(t)],t.forEach(o=>{const i=this.hot.rowIndexMapper.getRenderableFromVisualIndex(o);this.hot.view._wt.wtOverlays.getOverlays(!0).map(s=>s?.name==="master"?s:s.clone.wtTable).forEach(s=>{const r=s.getRow(i);r&&(r.style.background=IC(r,"backgroundColor").replace(")",", 0.99)"),e.push(r))})}),this.hot._registerTimeout(()=>{e.forEach(o=>{o.style.background=IC(o,"backgroundColor")?.replace(", 0.99)",")")})},1)}validateSetting(e){return e?Vr.containsNegativeValues(e)?(Ie(Vr.NEGATIVE_VALUES_WARNING(e)),!1):Vr.isOutOfBounds(e,this.hot.countRows(),this.hot.countCols())?(Ie(Vr.IS_OUT_OF_BOUNDS_WARNING(e)),!1):Vr.isSingleCell(e)?(Ie(Vr.IS_SINGLE_CELL(e)),!1):Vr.containsZeroSpan(e)?(Ie(Vr.ZERO_SPAN_WARNING(e)),!1):!0:!1}generateFromSettings(){const e=this.getSetting("cells").filter(i=>this.validateSetting(i)),t=this.mergedCellsCollection.filterOverlappingMergeCells(e),o=[];t.forEach(i=>{const{row:s,col:r,rowspan:a,colspan:l}=i,h=this.hot._createCellCoords(s,r),c=this.hot._createCellCoords(s+a-1,r+l-1),d=this.hot._createCellRange(h,h,c);this.mergeRange(d,!0,!0);for(let u=s;u<s+a;u++)for(let f=r;f<r+l;f++)(u!==s||f!==r)&&o.push([u,f,null])}),o.length!==0&&this.hot.setDataAtCell(o,void 0,void 0,this.pluginName)}clearCollections(){this.mergedCellsCollection.clear()}canMergeRange(e,t=!1){return t?!0:this.validateSetting(e)}mergeSelection(e=this.hot.getSelectedRangeActive()){if(!e)return;e.setDirection(this.hot.isRtl()?"NE-SW":"NW-SE");const{from:t,to:o}=e;this.unmergeRange(e,!0),this.mergeRange(e),this.hot.selectCell(t.row,t.col,o.row,o.col,!1)}unmergeSelection(e=this.hot.getSelectedRangeActive()){if(!e)return;const{from:t,to:o}=e;this.unmergeRange(e,!0),this.hot.selectCell(t.row,t.col,o.row,o.col,!1)}mergeRange(e,t=!1,o=!1){const i=e.getTopStartCorner(),s=e.getBottomEndCorner(),r={row:i.row,col:i.col,rowspan:s.row-i.row+1,colspan:s.col-i.col+1},a=[];let l=null;return this.canMergeRange(r,t)?(this.hot.runHooks("beforeMergeCells",e,t),Re(0,r.rowspan-1,c=>{Re(0,r.colspan-1,d=>{let u=null;a[c]||(a[c]=[]),c===0&&d===0?u=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(r.row),this.hot.toPhysicalColumn(r.col)):this.hot.setCellMeta(r.row+c,r.col+d,"hidden",!0),a[c][d]=u})}),this.hot.setCellMeta(r.row,r.col,"spanned",!0),this.mergedCellsCollection.add(r,t)?(o?l=[r.row,r.col,a]:this.hot.populateFromArray(r.row,r.col,a,void 0,void 0,this.pluginName),t||this.ifChromeForceRepaint(),this.hot.runHooks("afterMergeCells",e,r,t),l):!0):!1}unmergeRange(e,t=!1){const o=this.mergedCellsCollection.getWithinRange(e);o.length!==0&&(this.hot.runHooks("beforeUnmergeCells",e,t),O(o,i=>{this.mergedCellsCollection.remove(i.row,i.col),Re(0,i.rowspan-1,s=>{Re(0,i.colspan-1,r=>{this.hot.removeCellMeta(i.row+s,i.col+r,"hidden"),this.hot.removeCellMeta(i.row+s,i.col+r,"copyable")})}),this.hot.removeCellMeta(i.row,i.col,"spanned")}),this.hot.runHooks("afterUnmergeCells",e,t),this.hot.render())}toggleMerge(e){const{from:t,to:o}=e.clone().normalize(),i=this.mergedCellsCollection.get(t.row,t.col);i.row===t.row&&i.col===t.col&&i.row+i.rowspan-1===o.row&&i.col+i.colspan-1===o.col?this.unmergeRange(e):this.mergeSelection(e)}merge(e,t,o,i){const s=this.hot._createCellCoords(e,t),r=this.hot._createCellCoords(o,i);this.mergeRange(this.hot._createCellRange(s,s,r))}unmerge(e,t,o,i){const s=this.hot._createCellCoords(e,t),r=this.hot._createCellCoords(o,i);this.unmergeRange(this.hot._createCellRange(s,s,r))}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control","m"]],callback:()=>{const o=this.hot.getSelectedRangeActive();o&&!o.isSingleHeader()&&(this.toggleMerge(o),this.hot.render())},runOnlyIf:o=>!o.altKey,group:mL})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(mL)}modifyViewportRowStart(e,t){const o=this.hot.rowIndexMapper,i=o.getVisualFromRenderableIndex(e.startRow);for(let s=0;s<t;s+=1){const r=this.mergedCellsCollection.get(i,s);if(ie(r)){const a=o.getRenderableFromVisualIndex(o.getNearestNotHiddenIndex(r.row,1));if(a<e.startRow){e.startRow=a,this.modifyViewportRowStart(e,t);return}}}}modifyViewportRowEnd(e,t){const o=this.hot.rowIndexMapper,i=o.getVisualFromRenderableIndex(e.endRow);for(let s=0;s<t;s+=1){const r=this.mergedCellsCollection.get(i,s);if(ie(r)){const a=r.row+r.rowspan-1,l=o.getRenderableFromVisualIndex(o.getNearestNotHiddenIndex(a,-1));if(l>e.endRow){e.endRow=l,this.modifyViewportRowEnd(e,t);return}}}}modifyViewportColumnStart(e,t){const o=this.hot.columnIndexMapper,i=o.getVisualFromRenderableIndex(e.startColumn);for(let s=0;s<t;s+=1){const r=this.mergedCellsCollection.get(s,i);if(ie(r)){const a=o.getRenderableFromVisualIndex(o.getNearestNotHiddenIndex(r.col,1));if(a<e.startColumn){e.startColumn=a,this.modifyViewportColumnStart(e,t);return}}}}modifyViewportColumnEnd(e,t){const o=this.hot.columnIndexMapper,i=o.getVisualFromRenderableIndex(e.endColumn);for(let s=0;s<t;s+=1){const r=this.mergedCellsCollection.get(s,i);if(ie(r)){const a=r.col+r.colspan-1,l=o.getRenderableFromVisualIndex(o.getNearestNotHiddenIndex(a,-1));if(l>e.endColumn){e.endColumn=l,this.modifyViewportColumnEnd(e,t);return}}}}translateMergedCellToRenderable(e,t,o,i){const{rowIndexMapper:s,columnIndexMapper:r}=this.hot;let a,l;t===0?a=s.getNearestNotHiddenIndex(e,1):a=s.getNearestNotHiddenIndex(e+t-1,-1),i===0?l=r.getNearestNotHiddenIndex(o,1):l=r.getNearestNotHiddenIndex(o+i-1,-1);const h=e>=0?s.getRenderableFromVisualIndex(a):e,c=o>=0?r.getRenderableFromVisualIndex(l):o;return[h,c]}constructor(...e){super(...e),jt(this,wL),jt(this,bL),jt(this,CL),jt(this,yL),jt(this,_L),jt(this,SL),jt(this,WR),jt(this,vL),jt(this,$R),jt(this,RL),jt(this,EL),jt(this,kL),jt(this,TL),jt(this,xL),jt(this,ML),jt(this,IL),jt(this,HL),jt(this,AL),jt(this,OL),jt(this,DL),jt(this,NL),jt(this,PL),jt(this,LL),jt(this,WL),jt(this,$L),jt(this,FL),vb(this,Xi,{writable:!0,value:void 0}),vb(this,Ji,{writable:!0,value:void 0}),vb(this,cr,{writable:!0,value:void 0}),vb(this,LR,{writable:!0,value:void 0}),this.mergedCellsCollection=null,this.autofillCalculations=null,this.selectionCalculations=null,Ja(this,Xi,null),Ja(this,Ji,{row:0,col:0}),Ja(this,cr,new rme({mergedCellsGetter:(t,o)=>this.mergedCellsCollection.get(t,o),rowIndexMapper:this.hot.rowIndexMapper,columnIndexMapper:this.hot.columnIndexMapper})),Ja(this,LR,ame(this))}}function ume(){this.generateFromSettings(),this.hot.render()}function fme(n){if(n){const e=this.mergedCellsCollection.mergedCells,t=this.hot.getSelectedRangeActive(),o=t.getTopStartCorner(),i=t.getBottomEndCorner();for(let s=0;s<e.length;s+=1)if(o.row===e[s].row&&o.col===e[s].col&&i.row===e[s].row+e[s].rowspan-1&&i.col===e[s].col+e[s].colspan-1)return!1}return n}function gme(n){Ut(this,Ji).row=n.row,Ut(this,Ji).col=n.col}function pme(n){const e=this.hot.getSelectedRangeActive(),{highlight:t}=e,{columnIndexMapper:o,rowIndexMapper:i}=this.hot;Ut(this,Xi)&&(i.getRenderableFromVisualIndex(Ut(this,Xi).row)!==null&&(t.row=Ut(this,Xi).row),o.getRenderableFromVisualIndex(Ut(this,Xi).col)!==null&&(t.col=Ut(this,Xi).col),Ja(this,Xi,null));const s=this.mergedCellsCollection.get(t.row,t.col);if(!s)return;const r=s.col,a=s.col+s.colspan-1;if(n.col<0){const c=t.col>=r&&t.col<=a?r-1:a,d=o.getNearestNotHiddenIndex(c,-1);d===null?n.col=-this.hot.view.countRenderableColumnsInRange(0,t.col):n.col=-Math.max(this.hot.view.countRenderableColumnsInRange(d,t.col)-1,1)}else if(n.col>0){const c=t.col>=r&&t.col<=a?a+1:r,d=o.getNearestNotHiddenIndex(c,1);d===null?n.col=this.hot.view.countRenderableColumnsInRange(t.col,this.hot.countCols()):n.col=Math.max(this.hot.view.countRenderableColumnsInRange(t.col,d)-1,1)}const l=s.row,h=s.row+s.rowspan-1;if(n.row<0){const c=t.row>=l&&t.row<=h?l-1:h,d=i.getNearestNotHiddenIndex(c,-1);d===null?n.row=-this.hot.view.countRenderableRowsInRange(0,t.row):n.row=-Math.max(this.hot.view.countRenderableRowsInRange(d,t.row)-1,1)}else if(n.row>0){const c=t.row>=l&&t.row<=h?h+1:l,d=i.getNearestNotHiddenIndex(c,1);d===null?n.row=this.hot.view.countRenderableRowsInRange(t.row,this.hot.countRows()):n.row=Math.max(this.hot.view.countRenderableRowsInRange(t.row,d)-1,1)}}function mme(n){const e=this.hot.getSelectedRangeActive(),t=e.clone(),{to:o}=e,{columnIndexMapper:i,rowIndexMapper:s}=this.hot,r=(a,l)=>{t.expand(this.hot._createCellCoords(a,l));for(let h=0;h<this.mergedCellsCollection.mergedCells.length;h+=1)t.expandByRange(this.mergedCellsCollection.mergedCells[h].getRange())};if(n.col<0){let a=this.mergedCellsCollection.getStartMostColumnIndex(e,o.col)+n.col;r(o.row,a),e.getHorizontalDirection()==="E-W"&&t.getHorizontalDirection()==="E-W"&&(a=t.getTopStartCorner().col);const l=i.getNearestNotHiddenIndex(a,1);l!==null&&(n.col=-Math.max(this.hot.view.countRenderableColumnsInRange(l,o.col)-1,1))}else if(n.col>0){let a=this.mergedCellsCollection.getEndMostColumnIndex(e,o.col)+n.col;r(o.row,a),e.getHorizontalDirection()==="W-E"&&t.getHorizontalDirection()==="W-E"&&(a=t.getBottomEndCorner().col);const l=i.getNearestNotHiddenIndex(a,-1);l!==null&&(n.col=Math.max(this.hot.view.countRenderableColumnsInRange(o.col,l)-1,1))}if(n.row<0){let a=this.mergedCellsCollection.getTopMostRowIndex(e,o.row)+n.row;r(a,o.col),e.getVerticalDirection()==="S-N"&&t.getVerticalDirection()==="S-N"&&(a=t.getTopStartCorner().row);const l=s.getNearestNotHiddenIndex(a,1);l!==null&&(n.row=-Math.max(this.hot.view.countRenderableRowsInRange(l,o.row)-1,1))}else if(n.row>0){let a=this.mergedCellsCollection.getBottomMostRowIndex(e,o.row)+n.row;r(a,o.col),e.getVerticalDirection()==="N-S"&&t.getVerticalDirection()==="N-S"&&(a=t.getBottomStartCorner().row);const l=s.getNearestNotHiddenIndex(a,-1);l!==null&&(n.row=Math.max(this.hot.view.countRenderableRowsInRange(o.row,l)-1,1))}}function wme(){const n=this.hot.getSelectedRangeLast(),{highlight:e}=n;if(this.hot.selection.isSelectedByColumnHeader()||this.hot.selection.isSelectedByRowHeader()){Ja(this,Xi,e.clone());return}for(let o=0;o<this.mergedCellsCollection.mergedCells.length;o+=1)n.expandByRange(this.mergedCellsCollection.mergedCells[o].getRange(),!1);for(let o=0;o<this.mergedCellsCollection.mergedCells.length;o+=1)n.expandByRange(this.mergedCellsCollection.mergedCells[o].getRange(),!1);const t=this.mergedCellsCollection.get(e.row,e.col);Ja(this,Xi,e.clone()),t&&e.assign(t)}function BL(n,e,t,o){if(n<0||e<0)return;const i=this.mergedCellsCollection.get(n,e);if(!i)return;const{row:s,col:r,colspan:a,rowspan:l}=i,h=s,c=r,d=s+l-1,u=r+a-1;if(o==="render"&&this.getSetting("virtualized")){const f=this.hot.view.getActiveOverlayName(),p=["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[tt(p,h,d),tt(C,c,u),tt(this.hot.getLastRenderedVisibleRow(),h,d),tt(this.hot.getLastRenderedVisibleColumn(),c,u)]}return[h,c,d,u]}function bme(n){n.items.push({name:"---------"},nme(this))}function VL(){Ja(this,Xi,null)}function Cme(){if(Ut(this,Xi).isCell())return;const n=this.hot.getSelectedRangeActive(),e=n.getVerticalDirection(),t=n.getHorizontalDirection(),o=Ut(this,Xi).clone().normalize();Ut(this,cr).setActiveNode(o.row,o.col),Ut(this,Ji).row>0||Ut(this,Ji).col>0?Ut(this,cr).setPrevNodeAsActive():(t==="E-W"&&Ut(this,Ji).col<0||e==="S-N"&&Ut(this,Ji).row<0)&&Ut(this,cr).setNextNodeAsActive()}function yme(n,e){const{columnIndexMapper:t,rowIndexMapper:o}=this.hot;let i=this.hot.getActiveSelectionLayerIndex(),s=null,r=null;if(Ut(this,Ji).col<0){const{rowEnd:a,colEnd:l,selectionLayer:h}=Ut(this,cr).getPrevHorizontalNode();r=t.getNearestNotHiddenIndex(l,-1),s=o.getNearestNotHiddenIndex(a,-1),i=h}else if(Ut(this,Ji).col>0){const{rowStart:a,colStart:l,selectionLayer:h}=Ut(this,cr).getNextHorizontalNode();r=t.getNearestNotHiddenIndex(l,1),s=o.getNearestNotHiddenIndex(a,1),i=h}else if(Ut(this,Ji).row<0){const{rowEnd:a,colEnd:l,selectionLayer:h}=Ut(this,cr).getPrevVerticalNode();r=t.getNearestNotHiddenIndex(l,-1),s=o.getNearestNotHiddenIndex(a,-1),i=h}else if(Ut(this,Ji).row>0){const{rowStart:a,colStart:l,selectionLayer:h}=Ut(this,cr).getNextVerticalNode();r=t.getNearestNotHiddenIndex(l,1),s=o.getNearestNotHiddenIndex(a,1),i=h}if(s!==null||r!==null){this.hot.selection.setActiveSelectionLayerIndex(i);const a=this.hot.getSelectedRangeActive(),l=this.hot._createCellCoords(s,r),h=this.mergedCellsCollection.get(l.row,l.col),c=this.hot.selection.highlight.getFocus();n=l.row,e=l.col,h?a.highlight.assign({row:this.hot.rowIndexMapper.getNearestNotHiddenIndex(h.row,1),col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(h.col,1)}):a.highlight.assign(l),c.clear(),c.add(l).commit()}Ut(this,cr).setActiveNode(n,e,i),Ja(this,Ji,{row:0,col:0})}function _me(){Ut(this,cr).buildFocusOrder(this.hot.getSelectedRange())}function Sme(n,e,t){const o=this.mergedCellsCollection.get(n,e);o&&(o.row!==n||o.col!==e?t.copyable=!1:(t.rowspan=o.rowspan,t.colspan=o.colspan))}function vme(n){if(this.getSetting("virtualized"))return;const e=this.hot.countCols();this.modifyViewportRowStart(n,e),this.modifyViewportRowEnd(n,e)}function Rme(n){if(this.getSetting("virtualized"))return;const e=this.hot.countRows();this.modifyViewportColumnStart(n,e),this.modifyViewportColumnEnd(n,e)}function Eme(n,e){const t=this.autofillCalculations.getDirection(e,n);if(this.autofillCalculations.dragAreaOverlapsCollections(e,n,t))return e;const o=this.hot._createCellCoords(e[0],e[1]),i=this.hot._createCellCoords(e[2],e[3]),s=this.hot._createCellRange(o,o,i),r=this.mergedCellsCollection.getWithinRange(s);return r.length===0?n:this.autofillCalculations.snapDragArea(e,n,t,r)}function kme(n,e){this.mergedCellsCollection.shiftCollections("right",n,e)}function Tme(n,e){this.mergedCellsCollection.shiftCollections("left",n,e)}function xme(n,e,t){t!=="auto"&&this.mergedCellsCollection.shiftCollections("down",n,e)}function Mme(n,e){this.mergedCellsCollection.shiftCollections("up",n,e)}function Ime(n,e){e==="Autofill.fill"&&this.autofillCalculations.recreateAfterDataPopulation(n)}function Hme(n,e){if(e&&e==="area"){const t=this.hot.getSelectedRangeActive(),o=this.mergedCellsCollection.getWithinRange(t);O(o,i=>{t.getBottomEndCorner().row===i.getLastRow()&&t.getBottomEndCorner().col===i.getLastColumn()&&(n[2]=i.row,n[3]=i.col)})}}function Ame(n,e,t,o){if(t)return this.selectionCalculations.getSelectedMergedCellClassName(n,e,t,o)}function Ome(){return this.selectionCalculations.getSelectedMergedCellClassNameToRemove()}function Dme(n,e,t,o){if(!(o instanceof MouseEvent))return;const i=this.hot.getSelectedRangeActive(),s=this.mergedCellsCollection.getByRange(i);if(!s)return;const r=this.hot._createCellCoords(s.row,s.col),a=this.hot._createCellCoords(s.row+s.rowspan-1,s.col+s.colspan-1);return this.hot.selection.getLayerLevel()===0&&i.isEqual(this.hot._createCellRange(r,r,a))}function Nme(n,e,t){if(this.hot.getSettings().rowHeaders||t==="bottom"||t==="bottom_inline_start_corner")return n;let o,i;if(t==="master")o=this.hot.getFirstRenderedVisibleColumn(),i=this.hot.getLastRenderedVisibleColumn();else{const u=this.hot.view.getOverlayByName(t);o=this.hot.columnIndexMapper.getVisualFromRenderableIndex(u.clone.wtTable.getFirstRenderedColumn()),i=this.hot.columnIndexMapper.getVisualFromRenderableIndex(u.clone.wtTable.getLastRenderedColumn())}if(!this.mergedCellsCollection.get(e,o))return n;const r=this.hot._createCellCoords(e,o),a=this.hot._createCellCoords(e,i),l=this.hot._createCellRange(r,r,a),h=this.mergedCellsCollection.getWithinRange(l,!0),c=h.reduce((u,{rowspan:f})=>Math.max(u,f),1);let d=0;return h.length>1&&h[0].rowspan<c&&(d=c-h[0].rowspan),h.forEach(({rowspan:u})=>{let f=0;t==="top"||t==="top_inline_start_corner"?f=Math.min(c,this.hot.view.countNotHiddenFixedRowsTop()-e):f=u-d,n=Math.max(n??0,pY(this.hot,e,f))}),n}function Pme(n,e){return function(t,o){const[,...i]=t,[,...s]=o;return(function r(a){const l=n[a],h=e[a],c=i[a],d=s[a],u=h.multiColumnSorting,p=(u.compareFunctionFactory?u.compareFunctionFactory:z2(h.type))(l,h,u)(c,d);if(p===ti){const C=a+1;if(typeof e[C]<"u")return r(C)}return p})(0)}}const bY="sort";function Lme(n,e,t){const o=[];return t===!1||n.isColumnSorted(e)&&n.getNumberOfSortedColumns()>1&&o.push(`${bY}-${n.getIndexOfColumnInSortQueue(e)+1}`),o}function Wme(n){const e=n.className.split(" "),t=new RegExp(`^${bY}-[0-9]{1,2}$`);return e.filter(o=>t.test(o))}const Vp="multiColumnSorting",$me=170,zL=Vp;V2(Vp,Pme);class Fme extends eU{static get PLUGIN_KEY(){return Vp}static get PLUGIN_PRIORITY(){return $me}static get SETTING_KEYS(){return[Vp]}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){this.enabled||super.enablePlugin()}disablePlugin(){super.disablePlugin()}registerShortcuts(){super.registerShortcuts(),this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Shift","Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeActive();return e.row===-1&&e.col>=0&&this.sort(this.getNextSortConfig(e.col,ay)),!1},runOnlyIf:()=>{const e=this.hot.getSelectedRangeActive()?.highlight;return e&&this.hot.getSelectedRangeActive()?.isSingle()&&this.hot.selection.isCellVisible(e)&&e.isHeader()},relativeToGroup:fl,position:"before",group:zL})}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(zL)}sort(e){super.sort(e)}clearSort(){super.clearSort()}isSorted(){return super.isSorted()}getSortConfig(e){return super.getSortConfig(e)}setSortConfig(e){super.setSortConfig(e)}getNormalizedSortConfigs(e=[]){return Array.isArray(e)?e:[e]}updateHeaderClasses(e,...t){super.updateHeaderClasses(e,...t),re(e,Wme(e)),this.enabled!==!1&&V(e,Lme(...t))}onAfterOnCellMouseDown(e,t){vM(t.row,t.col,e)!==!1&&this.wasClickableHeaderClicked(e,t.col)&&(this.hot.getShortcutManager().isCtrlPressed()?(this.hot.deselectCell(),this.hot.selectColumns(t.col),this.sort(this.getNextSortConfig(t.col,ay))):this.sort(this.getColumnNextConfig(t.col)))}constructor(...e){super(...e),this.pluginKey=Vp}}const Bme="multipleSelectionHandles",Vme=160;class zme extends at{static get PLUGIN_KEY(){return Bme}static get PLUGIN_PRIORITY(){return Vme}isEnabled(){return Qr()}enablePlugin(){this.enabled||(this.registerListeners(),super.enablePlugin())}registerListeners(){const e=this,{rootElement:t}=this.hot;function o(i){if(e.dragged.length===1)return e.dragged.splice(0,e.dragged.length),!0;const s=e.dragged.indexOf(i);if(s===-1)return!1;s===0?e.dragged=e.dragged.slice(0,1):s===1&&(e.dragged=e.dragged.slice(-1))}this.eventManager.addEventListener(t,"touchstart",i=>{let s;if(Se(i.target,"topSelectionHandle-HitArea"))return s=e.hot.getSelectedRangeActive(),e.dragged.push("top"),e.touchStartRange={width:s.getWidth(),height:s.getHeight(),direction:s.getDirection()},i.preventDefault(),!1;if(Se(i.target,"bottomSelectionHandle-HitArea"))return s=e.hot.getSelectedRangeActive(),e.dragged.push("bottom"),e.touchStartRange={width:s.getWidth(),height:s.getHeight(),direction:s.getDirection()},i.preventDefault(),!1}),this.eventManager.addEventListener(t,"touchend",i=>{if(Se(i.target,"topSelectionHandle-HitArea"))return o.call(e,"top"),e.touchStartRange=void 0,i.preventDefault(),!1;if(Se(i.target,"bottomSelectionHandle-HitArea"))return o.call(e,"bottom"),e.touchStartRange=void 0,i.preventDefault(),!1}),this.eventManager.addEventListener(t,"touchmove",i=>{const{rootDocument:s}=this.hot;let r,a,l,h,c,d;if(e.dragged.length===0)return;const u=s.elementFromPoint(i.touches[0].clientX,i.touches[0].clientY);!u||u===e.lastSetCell||((u.nodeName==="TD"||u.nodeName==="TH")&&(r=e.hot.getCoords(u),r.col===-1&&(r.col=0),a=e.hot.getSelectedRangeActive(),l=a.getWidth(),h=a.getHeight(),c=a.getDirection(),l===1&&h===1&&e.hot.selection.setRangeEnd(r),d=e.getCurrentRangeCoords(a,r,e.touchStartRange.direction,c,e.dragged[0]),d.start!==null&&e.hot.selection.setRangeStart(d.start),e.hot.selection.setRangeEnd(d.end),e.lastSetCell=u),i.preventDefault())})}getCurrentRangeCoords(e,t,o,i,s){const r=e.getTopStartCorner(),a=e.getBottomEndCorner(),l=e.getBottomStartCorner(),h=e.getTopEndCorner();let c={start:null,end:null};switch(o){case"NE-SW":switch(i){case"NE-SW":case"NW-SE":s==="top"?c={start:this.hot._createCellCoords(t.row,e.highlight.col),end:this.hot._createCellCoords(l.row,t.col)}:c={start:this.hot._createCellCoords(e.highlight.row,t.col),end:this.hot._createCellCoords(t.row,r.col)};break;case"SE-NW":s==="bottom"&&(c={start:this.hot._createCellCoords(a.row,t.col),end:this.hot._createCellCoords(t.row,r.col)});break}break;case"NW-SE":switch(i){case"NE-SW":s==="top"?c={start:t,end:l}:c.end=t;break;case"NW-SE":s==="top"?c={start:t,end:a}:c.end=t;break;case"SE-NW":s==="top"?c={start:t,end:r}:c.end=t;break;case"SW-NE":s==="top"?c={start:t,end:h}:c.end=t;break}break;case"SW-NE":switch(i){case"NW-SE":s==="bottom"?c={start:this.hot._createCellCoords(t.row,r.col),end:this.hot._createCellCoords(l.row,t.col)}:c={start:this.hot._createCellCoords(r.row,t.col),end:this.hot._createCellCoords(t.row,a.col)};break;case"SW-NE":s==="top"?c={start:this.hot._createCellCoords(e.highlight.row,t.col),end:this.hot._createCellCoords(t.row,a.col)}:c={start:this.hot._createCellCoords(t.row,r.col),end:this.hot._createCellCoords(r.row,t.col)};break;case"SE-NW":s==="bottom"?c={start:this.hot._createCellCoords(t.row,h.col),end:this.hot._createCellCoords(r.row,t.col)}:s==="top"&&(c={start:l,end:t});break}break;case"SE-NW":switch(i){case"NW-SE":case"NE-SW":case"SW-NE":s==="top"&&(c.end=t);break;case"SE-NW":s==="top"?c.end=t:c={start:t,end:r};break}break}return c}isDragged(){return this.dragged.length>0}constructor(...e){super(...e),this.dragged=[],this.lastSetCell=null}}function _C({label:n="",colspan:e=1,origColspan:t=1,rowspan:o=1,origRowspan:i=1,collapsible:s=!1,crossHiddenColumns:r=[],isCollapsed:a=!1,isHidden:l=!1,isRoot:h=!1,isPlaceholder:c=!1,isRowspanPlaceholder:d=!1,headerClassNames:u=[]}={}){return{label:n,colspan:e,origColspan:t,rowspan:o,origRowspan:i,collapsible:s,isCollapsed:a,crossHiddenColumns:r,isHidden:l,isRoot:h,isPlaceholder:c,isRowspanPlaceholder:d,headerClassNames:u}}function CY(){return{label:"",isPlaceholder:!0}}function Ume(n,e=1/0){const t=[],o=[];if(e===0)return t;const i=a=>{if(a==="")return!0;if(!ie(a))return!1;const{label:l,colspan:h,rowspan:c,headerClassName:d}=a;return yt(l)===""&&(h===void 0||h===1)&&(c===void 0||c===1)&&d===void 0},s=a=>{const l=_C();if(ie(a)){const{label:h,colspan:c,rowspan:d,headerClassName:u}=a;l.label=yt(h),typeof c=="number"&&c>1&&(l.colspan=c,l.origColspan=c),typeof d=="number"&&d>1&&(l.rowspan=d,l.origRowspan=d),typeof u=="string"&&(l.headerClassNames=[...u.split(" ")])}else l.label=yt(a);return l};O(n,(a=[])=>{const l=[];let h=0,c=0;for(t.push(l);(h<a.length||o[c]>0)&&!(c>=e);){const d=a[h];if(o[c]>0){i(d)&&(h+=1),l.push(_C()),o[c]-=1,c+=1;continue}if(h>=a.length)break;const f=s(d);let p=f.origColspan;if(c+p>=e&&(p-=c+p-e,f.colspan=p,f.origColspan=p),f.origRowspan>1)for(let C=0;C<p;C++)o[c+C]=Math.max(o[c+C]??0,f.origRowspan-1);if(l.push(f),f.colspan>1)for(let C=0;C<f.colspan-1;C++)l.push(CY());c+=p,h+=1}});const r=Math.max(...Mt(t,a=>a.length));return O(t,a=>{if(a.length<r){const l=Mt(new Array(r-a.length),()=>_C());a.splice(a.length,0,...l)}}),t}function Yme(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Gme(n,e){return e.get?e.get.call(n):e.value}function jme(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function yY(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function zs(n,e){var t=yY(n,e,"get");return Gme(n,t)}function FR(n,e,t){Yme(n,e),e.set(n,t)}function Pl(n,e,t){var o=yY(n,e,"set");return jme(n,o,t),t}const UL=["label","collapsible"];var Ar=new WeakMap,Ll=new WeakMap,Rb=new WeakMap;class qme{setColumnsLimit(e){Pl(this,Rb,e)}setData(e=[]){Pl(this,Ar,Ume(e,zs(this,Rb))),Pl(this,Ll,zs(this,Ar).length)}getData(){return zs(this,Ar)}mergeWith(e){O(e,({row:t,col:o,...i})=>{const s=this.getHeaderSettings(t,o);s!==null&&Fn(s,i,UL)})}map(e){O(zs(this,Ar),t=>{O(t,o=>{const i=e({...o});ie(i)&&Fn(o,i,UL)})})}getHeaderSettings(e,t){if(e>=zs(this,Ll)||e<0)return null;const o=zs(this,Ar)[e];return Array.isArray(o)===!1||t>=o.length?null:o[t]??null}getHeadersSettings(e,t,o=1){const i=[];if(e>=zs(this,Ll)||e<0)return i;const s=zs(this,Ar)[e];let r=0;for(let a=t;a<s.length;a++){const l=s[a];if(l.isPlaceholder&&Y("The first column settings cannot overlap the other header layers"),r+=l.colspan,i.push(l),l.colspan>1&&(a+=l.colspan-1),r===o)break;r>o&&Y("The last column settings cannot overlap the other header layers")}return i}getLayersCount(){return zs(this,Ll)}getColumnsCount(){return zs(this,Ll)>0?zs(this,Ar)[0].length:0}clear(){Pl(this,Ar,[]),Pl(this,Ll,0)}constructor(){FR(this,Ar,{writable:!0,value:void 0}),FR(this,Ll,{writable:!0,value:void 0}),FR(this,Rb,{writable:!0,value:void 0}),Pl(this,Ar,[]),Pl(this,Ll,0),Pl(this,Rb,1/0)}}const _Y="DF-pre-order";function SY(n,e){let t=n.call(e,this);for(let o=0;o<this.childs.length;o++){if(t===!1)return!1;t=SY.call(this.childs[o],n,e)}return t}const Kme="DF-post-order";function vY(n,e){for(let t=0;t<this.childs.length;t++)if(vY.call(this.childs[t],n,e)===!1)return!1;return n.call(e,this)}const RY="BF";function Xme(n,e){const t=[this];function o(){if(t.length===0)return;const i=t.shift();t.push(...i.childs),n.call(e,i)!==!1&&o()}o()}const Zme=RY,YL=new Map([[_Y,SY],[Kme,vY],[RY,Xme]]);class xy{addChild(e){e.parent=this,this.childs.push(e)}cloneTree(e=this){const t=new xy({...e.data});for(let o=0;o<e.childs.length;o++)t.addChild(this.cloneTree(e.childs[o]));return t}replaceTreeWith(e){this.data={...e.data},this.childs=[];for(let t=0;t<e.childs.length;t++)this.addChild(e.childs[t])}walkDown(e,t=Zme){YL.has(t)||Y(`Traversal strategy "${t}" does not exist`),YL.get(t).call(this,e,this)}walkUp(e){const t=this,o=i=>{e.call(t,i)!==!1&&i.parent!==null&&o(i.parent)};o(this)}constructor(e){this.data={},this.parent=null,this.childs=[],this.data=e}}function Qme(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Jme(n,e){return e.get?e.get.call(n):e.value}function ewe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function EY(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function li(n,e){var t=EY(n,e,"get");return Jme(n,t)}function BR(n,e,t){Qme(n,e),e.set(n,t)}function Eb(n,e,t){var o=EY(n,e,"set");return ewe(n,o,t),t}var sc=new WeakMap,Wl=new WeakMap,rc=new WeakMap;class twe{getRoots(){return Array.from(li(this,sc).values())}getRootByColumn(e){let t;return li(this,Wl).has(e)&&(t=li(this,sc).get(li(this,Wl).get(e))),t}getNode(e,t){const o=this.getRootByColumn(t);if(!o)return;const i=t-li(this,Wl).get(t);let s=0,r;return o.walkDown(a=>{const{data:{origColspan:l,headerLevel:h}}=a;if(e===h){if(i>=s&&i<=s+l-1)return r=a,r.data.isRoot=t===r.data.columnIndex,!1;s+=l}}),r}rebuildTreeIndex(){let e=0;li(this,Wl).clear(),O(li(this,sc),([,{data:{colspan:t}}])=>{for(let o=e;o<e+t;o++)li(this,Wl).set(o,e);e+=t})}buildTree(){this.clear();const e=li(this,rc).getColumnsCount();let t=0;for(;t<e;){const o=li(this,rc).getHeaderSettings(0,t),i=new xy;li(this,sc).set(t,i),this.buildLeaves(i,t,0,o.origColspan),t+=o.origColspan}this.rebuildTreeIndex()}buildLeaves(e,t,o,i=1){const s=li(this,rc).getHeadersSettings(o,t,i);o+=1,O(s,r=>{const a={...r,headerLevel:o-1,columnIndex:t};let l;o===1?(e.data=a,l=e):(l=new xy(a),e.addChild(l)),o<li(this,rc).getLayersCount()&&this.buildLeaves(l,t,o,r.origColspan),t+=r.origColspan})}clear(){li(this,sc).clear(),li(this,Wl).clear()}constructor(e){BR(this,sc,{writable:!0,value:void 0}),BR(this,Wl,{writable:!0,value:void 0}),BR(this,rc,{writable:!0,value:void 0}),Eb(this,sc,new Map),Eb(this,Wl,new Map),Eb(this,rc,null),Eb(this,rc,e)}}function kY(n,e){n.walkDown(({data:t,childs:o})=>{if(!t.isHidden&&(e(t.columnIndex),o.length===0))for(let i=1;i<t.colspan;i++)e(t.columnIndex+i)})}function My({childs:n},e){if(n.length!==0)return n[0].data[e]}function Iy(n){return My(n,"origColspan")===n.data.origColspan}function zM(n){const{data:e,childs:t}=n;if(!e.isCollapsed||e.isHidden||e.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(Iy(n))return zM(t[0]);e.isCollapsed=!1;const i=t.slice(1),s=new Set;let r=0;if(i.length>0)O(i,a=>{a.replaceTreeWith(a.data.clonedTree),a.data.clonedTree=null;const l=a.data;r+=l.colspan,kY(a,h=>{s.add(h)})});else{const{colspan:a,origColspan:l,columnIndex:h}=e;r=l-a;for(let c=1;c<l;c++)s.add(h+c)}return n.walkUp(a=>{const{data:l}=a;l.colspan+=r,l.colspan>=l.origColspan?(l.colspan=l.origColspan,l.isCollapsed=!1):Iy(a)&&(l.isCollapsed=My(a,"isCollapsed"))}),{rollbackModification:()=>UM(n),affectedColumns:Array.from(s),colspanCompensation:r}}function UM(n){const{data:e,childs:t}=n;if(e.isCollapsed||e.isHidden||e.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(Iy(n))return UM(t[0]);e.isCollapsed=!0;const i=t.slice(1),s=new Set;if(i.length>0)O(i,a=>{kY(a,l=>{s.add(l)}),a.data.clonedTree=a.cloneTree(),a.walkDown(({data:l})=>{l.isHidden=!0})});else{const{origColspan:a,columnIndex:l}=e;for(let h=1;h<a;h++){const c=l+h;s.add(c)}}const r=e.colspan-(My(n,"colspan")??1);return n.walkUp(a=>{const{data:l}=a;l.colspan-=r,l.colspan<=1?(l.colspan=1,l.isCollapsed=!0):Iy(a)&&(l.isCollapsed=My(a,"isCollapsed"))}),{rollbackModification:()=>zM(n),affectedColumns:Array.from(s),colspanCompensation:r}}function nwe(n,e){Number.isInteger(e)||Y("The passed gridColumnIndex argument has invalid type."),n.childs.length>0&&Y(pt`The passed node is not the last node on the tree. Only for\x20
266
- the last node, the hide column modification can be applied.`);const{crossHiddenColumns:t}=n.data;if(t.includes(e))return;let o=!1;n.walkUp(i=>{const{data:{collapsible:s}}=i;if(s)return o=!0,!1}),!o&&n.walkUp(i=>{const{data:s}=i;s.crossHiddenColumns.push(e),s.colspan>1?s.colspan-=1:s.isHidden=!0})}function owe(n,e){Number.isInteger(e)||Y("The passed gridColumnIndex argument has invalid type."),n.childs.length>0&&Y(pt`The passed node is not the last node on the tree. Only for\x20
267
- the last node, the show column modification can be applied.`);const{crossHiddenColumns:t}=n.data;if(!t.includes(e))return;let o=!1;n.walkUp(i=>{const{data:{collapsible:s}}=i;if(s)return o=!0,!1}),!o&&n.walkUp(i=>{const{data:s}=i;s.crossHiddenColumns.splice(s.crossHiddenColumns.indexOf(e),1),!s.isHidden&&s.colspan<s.origColspan&&(s.colspan+=1),s.isHidden=!1})}const GL=new Map([["collapse",UM],["expand",zM],["hide-column",nwe],["show-column",owe]]);function iwe(n,e,t){return GL.has(n)||Y(`The node modifier action ("${n}") does not exist.`),GL.get(n)(e,t)}function kb(n){const e=[];return O(n,t=>{t.walkDown(o=>{const i=o.data,{origColspan:s,columnIndex:r,headerLevel:a,crossHiddenColumns:l}=i,h=awe(e,a);let c=!1;for(let d=r;d<r+s;d++)if(l.includes(d)||c)h.push(CY());else{const f=rwe(i);f.isRoot=!0,h.push(f),c=!0}})}),swe(e),e}function swe(n){for(let e=0;e<n.length;e++){const t=n[e];for(let o=0;o<t.length;o++){const i=t[o];if(!i||!i.isRoot||!i.origRowspan||i.origRowspan<=1)continue;const s=Math.min(i.origRowspan,n.length-e),r=i.origColspan||1;for(let a=1;a<s;a++){const l=e+a;if(n[l])for(let h=o;h<o+r&&h<n[l].length;h++)n[l][h]={label:"",isPlaceholder:!0,isRowspanPlaceholder:!0}}}}}function rwe(n){const{crossHiddenColumns:e,...t}=_C(n);return t}function awe(n,e){let t;return Array.isArray(n[e])?t=n[e]:(t=[],n[e]=t),t}function lwe(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hwe(n,e){return e.get?e.get.call(n):e.value}function cwe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function TY(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function gn(n,e){var t=TY(n,e,"get");return hwe(n,t)}function VR(n,e,t){lwe(n,e),e.set(n,t)}function $l(n,e,t){var o=TY(n,e,"set");return cwe(n,o,t),t}var Us=new WeakMap,hi=new WeakMap,Fl=new WeakMap;class dwe{setState(e){gn(this,Us).setData(e);let t=!1;try{gn(this,hi).buildTree()}catch{gn(this,hi).clear(),gn(this,Us).clear(),t=!0}return $l(this,Fl,kb(gn(this,hi).getRoots())),t}setColumnsLimit(e){gn(this,Us).setColumnsLimit(e)}mergeStateWith(e){const t=Mt(e,({row:o,...i})=>({row:o<0?this.rowCoordsToLevel(o):o,...i}));gn(this,Us).mergeWith(t),gn(this,hi).buildTree(),$l(this,Fl,kb(gn(this,hi).getRoots()))}mapState(e){gn(this,Us).map(e),gn(this,hi).buildTree(),$l(this,Fl,kb(gn(this,hi).getRoots()))}mapNodes(e){return Fi(gn(this,hi).getRoots(),(t,o)=>(o.walkDown(i=>{const s=e(i.data);s!==void 0&&t.push(s)}),t),[])}triggerNodeModification(e,t,o){t<0&&(t=this.rowCoordsToLevel(t));const i=gn(this,hi).getNode(t,o);let s;return i&&(s=iwe(e,i,o),$l(this,Fl,kb(gn(this,hi).getRoots()))),s}triggerColumnModification(e,t){return this.triggerNodeModification(e,-1,t)}rowCoordsToLevel(e){if(e>=0)return null;const t=e+Math.max(this.getLayersCount(),1);return t<0?null:t}levelToRowCoords(e){if(e<0)return null;const t=e-Math.max(this.getLayersCount(),1);return t>=0?null:t}getHeaderSettings(e,t){return e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount()?null:gn(this,Fl)[e]?.[t]??null}getHeaderTreeNodeData(e,t){const o=this.getHeaderTreeNode(e,t);return o?{...o.data}:null}getHeaderTreeNode(e,t){if(e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount())return null;const o=gn(this,hi).getNode(e,t);return o||null}findTopMostEntireHeaderLevel(e,t=e){const o=t-e+1;let i=!1,s=null;for(let r=e;r<=t;r++){const a=gn(this,hi).getRootByColumn(r);if(!a)break;i=!0,a.walkDown(l=>{const{columnIndex:h,headerLevel:c,origColspan:d,isHidden:u}=l.data;u||d<=o&&h>=e&&h+d-1<=t&&(s===null||c<s)&&(s=c)},_Y)}return i&&s===null?-1:this.levelToRowCoords(s??0)}findLeftMostColumnIndex(e,t){const{isRoot:o}=this.getHeaderSettings(e,t)??{isRoot:!0};if(o)return t;let i=t-1;for(;i>=0;){const{isRoot:s}=this.getHeaderSettings(e,i)??{isRoot:!0};if(s)break;i-=1}return i}findRightMostColumnIndex(e,t){const{isRoot:o,origColspan:i}=this.getHeaderSettings(e,t)??{isRoot:!0,origColspan:1};if(o)return t+i-1;let s=t+1;for(;s<this.getColumnsCount();){const{isRoot:r}=this.getHeaderSettings(e,s)??{isRoot:!0};if(r)break;s+=1}return s-1}getLayersCount(){return gn(this,Us).getLayersCount()}getColumnsCount(){return gn(this,Us).getColumnsCount()}clear(){$l(this,Fl,[]),gn(this,Us).clear(),gn(this,hi).clear()}constructor(){VR(this,Us,{writable:!0,value:void 0}),VR(this,hi,{writable:!0,value:void 0}),VR(this,Fl,{writable:!0,value:void 0}),$l(this,Us,new qme),$l(this,hi,new twe(gn(this,Us))),$l(this,Fl,[[]])}}function uwe(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wh(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function ou(n,e){uwe(n,e),e.add(n)}var jL=new WeakSet,qL=new WeakSet,KL=new WeakSet,xY=new WeakSet,U0=new WeakSet,YM=new WeakSet;class fwe{setLayersCount(e){return this.layersCount=e,this}getWidth(e){return this.widthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e))}buildWidthsMap(){const e=wh(this,qL,pwe).call(this),t=e.size>0,o=this.hot.getCurrentThemeName();this.container=this.hot.rootDocument.createElement("div"),this.container.classList.add("handsontable","htGhostTable","htAutoSize","htNestedHeaders"),o&&this.container.classList.add(o),wh(this,KL,mwe).call(this,this.container,t),this.hot.rootDocument.body.appendChild(this.container);const i=t?wh(this,jL,gwe).call(this):null,r=this.container.querySelector('[data-ghost-table="rendered"]').querySelectorAll("th[data-column]"),a=new Map;for(let l=0;l<r.length;l++){const h=r[l];if(h.colSpan>1)continue;const c=Number.parseInt(h.dataset.column,10);a.set(c,h)}this.widthsMap.clear(),a.forEach((l,h)=>{const c=this.hot.toPhysicalColumn(h);if(this.hot.columnIndexMapper.isHidden(c))return;let d;if(t&&e.has(c)){const u=i.get(c);u!==void 0&&(d=u)}d===void 0&&(d=l.getBoundingClientRect().width),this.widthsMap.setValueAtIndex(c,d)}),this.container.remove(),this.container=null}clear(){this.widthsMap.clear(),this.container=null}constructor({hot:e,headersStateManager:t}){ou(this,jL),ou(this,qL),ou(this,KL),ou(this,xY),ou(this,U0),ou(this,YM),this.layersCount=0,this.hot=e,this.headersStateManager=t,this.widthsMap=this.hot.columnIndexMapper.createAndRegisterIndexMap("nestedHeaders.widthsMap","physicalIndexToValue")}}function gwe(){const e=this.container.querySelector('[data-ghost-table="full"]').querySelectorAll("tr:last-of-type th"),t=new Map;for(let o=0;o<e.length;o++){const i=Number.parseInt(e[o].dataset.column,10),s=this.hot.toPhysicalColumn(i);t.set(s,e[o].getBoundingClientRect().width)}return t}function pwe(){const n=new Set,e=this.hot.countCols();for(let t=0;t<e;t++){const o=this.headersStateManager.getHeaderTreeNode(-1,t);if(!o)continue;let i=!1;o.walkUp(s=>{if(s.data.isCollapsed===!0)return i=!0,!1}),i&&n.add(this.hot.toPhysicalColumn(t))}return n}function mwe(n,e){const t=this.hot.getSettings(),o=!!t.dropdownMenu,i=!!t.collapsibleColumns,s=this.hot.countCols(),r=t.sanitizer;e?n.innerHTML=wh(this,xY,wwe).call(this,s,o,i,r)+wh(this,U0,XL).call(this,s,o,i,r):n.innerHTML=wh(this,U0,XL).call(this,s,o,i,r)}function wwe(n,e,t,o){let i="";for(let s=0;s<this.layersCount;s++){let r="";for(let a=0;a<n;a++){const l=this.headersStateManager.getHeaderTreeNodeData(s,a);l&&l.isRoot&&(r+=`<th data-column="${a}" colspan="${l.origColspan}">${wh(this,YM,MY).call(this,l,e,t,o)}</th>`)}i+=`<tr>${r}</tr>`}return`<table data-ghost-table="full"><thead>${i}</thead></table>`}function XL(n,e,t,o){let i="";for(let s=0;s<this.layersCount;s++){let r="";for(let a=0;a<n;a++){const l=this.headersStateManager.getHeaderSettings(s,a);if(l&&!l.isPlaceholder&&!l.isHidden&&!l.isRowspanPlaceholder){const h=l.rowspan>1?` rowspan="${l.rowspan}"`:"";r+=`<th data-column="${a}" colspan="${l.colspan}"${h}>${wh(this,YM,MY).call(this,l,e,t,o)}</th>`}}i+=`<tr>${r}</tr>`}return`<table data-ghost-table="rendered"><thead>${i}</thead></table>`}function MY(n,e,t,o){const i=typeof o=="function"?o(n.label,"innerHTML"):n.label,s=e?'<button class="changeType"></button>':"",a=t&&(n.origColspan>1||n.colspan>1)?'<div class="collapsibleIndicator expanded">-</div>':"";return`<div class="relative"><span class="colHeader">${i}</span>${s}${a}</div>`}function bwe(n,e,t,o){if(n<=t)return n;for(let i=n+1;i<=-1;i++){const s=o(i,e);if(!s)continue;const{isPlaceholder:r,isRowspanPlaceholder:a,isHidden:l}=s;if(!r&&!a&&!l)return i}return n}function IY(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Cwe(n,e){return e.get?e.get.call(n):e.value}function ywe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function HY(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function ue(n,e){var t=HY(n,e,"get");return Cwe(n,t)}function Or(n,e,t){IY(n,e),e.set(n,t)}function St(n,e,t){var o=HY(n,e,"set");return ywe(n,o,t),t}function qt(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function pn(n,e){IY(n,e),e.add(n)}const ZL="nestedHeaders",_we=280;var Ne=new WeakMap,Aa=new WeakMap,Zu=new WeakMap,Im=new WeakMap,Hm=new WeakMap,Di=new WeakMap,Dc=new WeakMap,zp=new WeakMap,bp=new WeakMap,Bl=new WeakMap,Up=new WeakSet,AY=new WeakSet,OY=new WeakSet,DY=new WeakSet,QL=new WeakSet,JL=new WeakSet,eW=new WeakSet,tW=new WeakSet,nW=new WeakSet,oW=new WeakSet,iW=new WeakSet,sW=new WeakSet,rW=new WeakSet,aW=new WeakSet,lW=new WeakSet,hW=new WeakSet,cW=new WeakSet,dW=new WeakSet,uW=new WeakSet,fW=new WeakSet,gW=new WeakSet,pW=new WeakSet,mW=new WeakSet;class Swe extends at{static get PLUGIN_KEY(){return ZL}static get PLUGIN_PRIORITY(){return _we}isEnabled(){return!!this.hot.getSettings()[ZL]}enablePlugin(){if(this.enabled)return;const{nestedHeaders:e}=this.hot.getSettings();(!Array.isArray(e)||!Array.isArray(e[0]))&&Ie(pt`Your Nested Headers plugin configuration is invalid. The settings has to be\x20
268
- passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]`),this.addHook("init",()=>qt(this,gW,Vwe).call(this)),this.addHook("afterLoadData",(...t)=>qt(this,pW,zwe).call(this,...t)),this.addHook("beforeOnCellMouseDown",(...t)=>qt(this,tW,Mwe).call(this,...t)),this.addHook("afterOnCellMouseDown",(...t)=>qt(this,nW,Iwe).call(this,...t)),this.addHook("beforeOnCellMouseOver",(...t)=>qt(this,oW,Hwe).call(this,...t)),this.addHook("beforeOnCellMouseUp",(...t)=>qt(this,iW,Awe).call(this,...t)),this.addHook("beforeSelectionHighlightSet",(...t)=>qt(this,sW,Owe).call(this,...t)),this.addHook("modifyTransformStart",(...t)=>qt(this,rW,Dwe).call(this,...t)),this.addHook("afterSelection",()=>ue(this,Bl).call(this)),this.addHook("afterSelectionFocusSet",()=>ue(this,Bl).call(this)),this.addHook("beforeViewportScrollHorizontally",(...t)=>qt(this,QL,kwe).call(this,...t)),this.addHook("afterGetColumnHeaderRenderers",t=>qt(this,lW,Pwe).call(this,t)),this.addHook("modifyColWidth",(...t)=>qt(this,cW,Wwe).call(this,...t)),this.addHook("modifyColumnHeaderHeight",(...t)=>qt(this,dW,$we).call(this,...t)),this.addHook("modifyColumnHeaderValue",(...t)=>qt(this,uW,Fwe).call(this,...t)),this.addHook("beforeHighlightingColumnHeader",(...t)=>qt(this,JL,Twe).call(this,...t)),this.addHook("beforeCopy",(...t)=>qt(this,eW,xwe).call(this,...t)),this.addHook("beforeSelectColumns",(...t)=>qt(this,aW,Nwe).call(this,...t)),this.addHook("beforeViewRender",()=>qt(this,mW,Uwe).call(this)),this.addHook("afterViewportColumnCalculatorOverride",(...t)=>qt(this,hW,Lwe).call(this,...t)),this.addHook("modifyFocusedElement",(...t)=>qt(this,fW,Bwe).call(this,...t)),this.hot.columnIndexMapper.addLocalHook("cacheUpdated",ue(this,Bl)),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",ue(this,Bl)),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(!this.hot.view)return;const{nestedHeaders:e}=this.hot.getSettings();St(this,Di,null),St(this,Dc,null),ue(this,Ne).setColumnsLimit(this.hot.countCols()),Array.isArray(e)&&(this.detectedOverlappedHeaders=ue(this,Ne).setState(e)),St(this,bp,ue(this,Ne).mapNodes(({origRowspan:t})=>t>1?!0:void 0).length>0),ue(this,bp)?V(this.hot.rootElement,"htHasRowspanHeaders"):re(this.hot.rootElement,"htHasRowspanHeaders"),this.detectedOverlappedHeaders&&Ie(pt`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20
269
- is currently not supported.`),this.enabled&&this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach((t,o)=>{const i=t===!0?"hide-column":"show-column";ue(this,Ne).triggerColumnModification(i,o)}),!ue(this,Aa)&&this.enabled&&St(this,Aa,this.hot.columnIndexMapper.createChangesObserver("hiding").subscribe(t=>{t.forEach(({op:o,index:i,newValue:s})=>{if(o==="replace"){const r=s===!0?"hide-column":"show-column";ue(this,Ne).triggerColumnModification(r,i)}}),this.ghostTable.buildWidthsMap()})),St(this,zp,!0),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.removeLocalHook("cacheUpdated",ue(this,Bl)),this.hot.columnIndexMapper.removeLocalHook("cacheUpdated",ue(this,Bl)),this.clearColspans(),ue(this,Ne).clear(),St(this,Di,null),St(this,Dc,null),re(this.hot.rootElement,"htHasRowspanHeaders"),ue(this,Aa).unsubscribe(),St(this,Aa,null),this.ghostTable.clear(),super.disablePlugin()}getStateManager(){return ue(this,Ne)}getLayersCount(){return ue(this,Ne).getLayersCount()}getHeaderSettings(e,t){return ue(this,Ne).getHeaderSettings(e,t)}clearColspans(){if(!this.hot.view)return;const{_wt:e}=this.hot.view,t=e.getSetting("columnHeaders").length,o=e.wtTable.THEAD,i=e.wtOverlays.topOverlay.clone.wtTable.THEAD,s=e.wtOverlays.topInlineStartCornerOverlay?e.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null;for(let r=0;r<t;r++){const a=o.childNodes[r];if(!a)break;const l=i.childNodes[r],h=s?s.childNodes[r]:null;for(let c=0,d=a.childNodes.length;c<d;c++)a.childNodes[c].removeAttribute("colspan"),a.childNodes[c].removeAttribute("rowspan"),a.childNodes[c].style.display="",re(a.childNodes[c],"hiddenHeader"),l&&l.childNodes[c]&&(l.childNodes[c].removeAttribute("colspan"),l.childNodes[c].removeAttribute("rowspan"),l.childNodes[c].style.display="",re(l.childNodes[c],"hiddenHeader")),s&&h&&h.childNodes[c]&&(h.childNodes[c].removeAttribute("colspan"),h.childNodes[c].removeAttribute("rowspan"),h.childNodes[c].style.display="",re(h.childNodes[c],"hiddenHeader"))}}headerRendererFactory(e){const t=this.hot.view._wt.getSetting("fixedColumnsStart");return(o,i)=>{const{columnIndexMapper:s,view:r}=this.hot;let a=s.getVisualFromRenderableIndex(o);a===null&&(a=o),i.removeAttribute("colspan"),i.removeAttribute("rowspan"),i.style.display="",re(i,"hiddenHeader"),re(i,"hiddenHeaderText"),re(i,"htRowspanHeader"),re(i,"htRowspanBottomLevel");const{colspan:l,rowspan:h,isHidden:c,isPlaceholder:d,isRowspanPlaceholder:u,headerClassNames:f}=ue(this,Ne).getHeaderSettings(e,a)??{};if(u)V(i,"hiddenHeader"),i.style.display="none";else if(d||c)V(i,"hiddenHeader");else{if(l>1){const{wtOverlays:p}=r._wt,C=p.topInlineStartCornerOverlay?.clone.wtTable.THEAD.contains(i),y=p.inlineStartOverlay?.clone.wtTable.THEAD.contains(i);p.topOverlay?.clone.wtTable.THEAD.contains(i)&&a<t&&V(i,"hiddenHeaderText");const T=C||y?Math.min(l,t-o):l;T>1&&i.setAttribute("colspan",T)}if(h>1){const p=e+h===this.getLayersCount();V(i,"htRowspanHeader"),p&&V(i,"htRowspanBottomLevel"),i.setAttribute("rowspan",h)}}if(this.hot.view.appendColHeader(a,i,(...p)=>this.getColumnHeaderValue(...p),e),!d&&!c&&!u){const p=i.querySelector("div.relative");p&&f&&f.length>0&&(re(p,this.hot.getColumnMeta(a).headerClassName),V(p,f))}}}getColumnHeaderValue(e,t){const{isHidden:o,isPlaceholder:i,isRowspanPlaceholder:s}=ue(this,Ne).getHeaderSettings(t,e)??{};return i||o||s?"":this.hot.getColHeader(e,t)}destroy(){St(this,Ne,null),re(this.hot.rootElement,"htHasRowspanHeaders"),ue(this,Aa)!==null&&(ue(this,Aa).unsubscribe(),St(this,Aa,null)),super.destroy()}_getHeaderTreeNodeDataByCoords(e){if(!(e.row>=0||e.col<0))return ue(this,Ne).getHeaderTreeNodeData(e.row,e.col)}constructor(...e){super(...e),pn(this,Up),pn(this,AY),pn(this,OY),pn(this,DY),pn(this,QL),pn(this,JL),pn(this,eW),pn(this,tW),pn(this,nW),pn(this,oW),pn(this,iW),pn(this,sW),pn(this,rW),pn(this,aW),pn(this,lW),pn(this,hW),pn(this,cW),pn(this,dW),pn(this,uW),pn(this,fW),pn(this,gW),pn(this,pW),pn(this,mW),Or(this,Ne,{writable:!0,value:void 0}),Or(this,Aa,{writable:!0,value:void 0}),Or(this,Zu,{writable:!0,value:void 0}),Or(this,Im,{writable:!0,value:void 0}),Or(this,Hm,{writable:!0,value:void 0}),Or(this,Di,{writable:!0,value:void 0}),Or(this,Dc,{writable:!0,value:void 0}),Or(this,zp,{writable:!0,value:void 0}),Or(this,bp,{writable:!0,value:void 0}),Or(this,Bl,{writable:!0,value:void 0}),St(this,Ne,new dwe),St(this,Aa,null),St(this,Zu,null),St(this,Im,!1),St(this,Hm,null),St(this,Di,null),St(this,Dc,null),St(this,zp,!1),this.ghostTable=new fwe({hot:this.hot,headersStateManager:ue(this,Ne)}),this.detectedOverlappedHeaders=!1,St(this,bp,!1),St(this,Bl,()=>{const t=this.hot?.getSelectedRangeActive();if(!t)return;const{highlight:o}=t;if(o.isHeader()&&o.col>=0){const{isRowspanPlaceholder:s}=ue(this,Ne).getHeaderSettings(o.row,o.col)??{},r=s?qt(this,Up,SC).call(this,o.row,o.col):o.row,a=ue(this,Ne).findLeftMostColumnIndex(r,o.col),l=this.hot.selection.highlight.getFocus(),h=l.visualCellRange;if(h===null)return;h.highlight.row=r,h.highlight.col=a,h.from.row=r,h.from.col=a,h.to.row=r,h.to.col=a,l.commit()}})}}function SC(n,e){const t=-this.getLayersCount();for(let o=n;o>=t;o--){const{isRowspanPlaceholder:i}=ue(this,Ne).getHeaderSettings(o,e)??{};if(!i)return o}return n}function vwe(n,e){const t=ue(this,Ne).findLeftMostColumnIndex(n,e),{rowspan:o=1}=ue(this,Ne).getHeaderSettings(n,t)??{};return o}function Rwe(n,e){const t=ue(this,Ne).getHeaderSettings(n,e);if(!t)return!1;const{isPlaceholder:o,isRowspanPlaceholder:i,isHidden:s}=t;return i?n<-1:!o&&!i&&!s}function Ewe(n,e,t){if(![-1,1].includes(t))return null;for(let o=e;o>=0&&o<this.hot.countCols();o+=t)if(qt(this,OY,Rwe).call(this,n,o))return o;return null}function kwe(n,e){const t=this.hot.getSelectedRangeActive();if(!t)return n;const{highlight:o}=t,{navigableHeaders:i}=this.hot.getSettings(),s=this.hot.selection.isSelectedByColumnHeader(),r=i?o.row:ue(this,Hm)?.row,a=s?n:o.col,l=r<0&&a>=0;if(St(this,Hm,null),!l)return n;const h=this.hot.getFirstFullyVisibleColumn(),c=this.hot.getLastFullyVisibleColumn(),d=c-h+1,u=ue(this,Ne).findLeftMostColumnIndex(r,a),f=ue(this,Ne).findRightMostColumnIndex(r,a),p=f-u+1;if(u<h&&f>c)return u;if(s){let C=null;return u>=h&&f>c?p>d?(e.value="start",C=u):(e.value="end",C=f):u<h&&f<=c&&(p>d?(e.value="end",C=f):(e.value="start",C=u)),C}return u<=h?u:f}function Twe(n,e,t){const o=ue(this,Ne).getHeaderTreeNodeData(e,n);if(!o)return n;const{columnCursor:i,selectionType:s,selectionWidth:r}=t,{isRoot:a,colspan:l}=ue(this,Ne).getHeaderSettings(e,n);if(s===mk){if(!a)return o.columnIndex}else if(s===sB&&(l>r-i||!a))return null;return n}function xwe(n,e,{columnHeadersCount:t}){if(t!==0)for(let o=0;o<e.length;o++){const{startRow:i,startCol:s,endRow:r,endCol:a}=e[o],l=r-i+1,h=s-a+1;if(i>=0||h===1)break;for(let c=s;c<=a;c++)for(let d=i;d<=r;d++){const u=l+d,f=c-s;if(f===0)continue;ue(this,Ne).getHeaderTreeNodeData(d,c)?.isRoot===!1&&(n[u][f]="")}}}function Mwe(n,e,t,o){St(this,Di,null),St(this,Dc,null),this._getHeaderTreeNodeDataByCoords(e)&&(o.column=!0)}function Iwe(n,e){const t=this._getHeaderTreeNodeDataByCoords(e);if(!t)return;St(this,Zu,e.clone()),St(this,Im,!0);const{selection:o}=this.hot,i=o.isSelected()?o.getSelectedRange().current():null,s=[],{columnIndex:r,origColspan:a}=t,l=!o.inInSelection(e);n.shiftKey&&i?e.col<i.from.col?s.push(i.getTopEndCorner().col,r,e.row):e.col>i.from.col?s.push(i.getTopStartCorner().col,r+a-1,e.row):s.push(r,r+a-1,e.row):(ak(n)||Xc(n)&&l||q4(n))&&s.push(r,r+a-1,e.row),o.selectColumns(...s)}function Hwe(n,e,t,o){if(!this.hot.view.isMouseDown()||o.column)return;const i=this._getHeaderTreeNodeDataByCoords(e);if(!i)return;const{columnIndex:s,origColspan:r}=i,a=this.hot.getSelectedRangeActive(),l=a.getTopStartCorner(),h=a.getBottomEndCorner(),{from:c}=a;o.column=!0,o.cell=!0;const d=[],u=tt(e.row,-1/0,-1);e.col<c.col?d.push(h.col,s,u):e.col>c.col?d.push(l.col,s+r-1,u):d.push(s,s+r-1,u),this.hot.selection.selectColumns(...d)}function Awe(){St(this,Im,!1)}function Owe(){const{navigableHeaders:n}=this.hot.getSettings();if(!this.hot.view.isMouseDown()||!ue(this,Im)||!n)return;const e=this.hot.getSelectedRangeLast(),t=e.getTopStartCorner().col,o=e.getBottomEndCorner().col,{columnIndex:i,origColspan:s}=ue(this,Ne).getHeaderTreeNodeData(ue(this,Zu).row,ue(this,Zu).col);if(e.setHighlight(ue(this,Zu)),s>e.getWidth()||i<t||i+s-1>o){const r=ue(this,Ne).findTopMostEntireHeaderLevel(tt(t,i,i+s-1),tt(o,i,i+s-1));e.highlight.row=r,e.highlight.col=e.from.col}}function Dwe(n){const{highlight:e}=this.hot.getSelectedRangeActive(),{row:t,col:o}=ue(this,Dc)??{};Number.isInteger(t)&&Number.isInteger(o)&&(e.row!==t||e.col!==o)&&St(this,Di,null);const i=n.row,s=n.col;let r=e.col+n.col,a=e.row+n.row;if(n.row!==0&&r>=0){const c=Math.sign(n.row),d=-1,u=-this.getLayersCount();let f=a;for(;f<=d&&f>=u;){const{isRowspanPlaceholder:p}=ue(this,Ne).getHeaderSettings(f,r)??{};if(!p)break;f+=c}n.row=f-e.row,a=f}if(i===0&&s!==0&&e.row<0){if(Number.isInteger(ue(this,Di))){const y=qt(this,DY,Ewe).call(this,ue(this,Di),r,Math.sign(s));y!==null&&(r=y,a=ue(this,Di))}r<0&&s<0&&Number.isInteger(ue(this,Di))&&(a=ue(this,Di));const c=ue(this,Ne).findLeftMostColumnIndex(e.row,e.col),d=ue(this,Ne).findRightMostColumnIndex(e.row,e.col),{isRowspanPlaceholder:u}=ue(this,Ne).getHeaderSettings(a,r)??{},f=a===e.row&&r>=c&&r<=d,p=a===e.row&&u&&s>0&&e.row<-1;!f&&!p&&(a=qt(this,Up,SC).call(this,a,r)),n.row=a-e.row,qt(this,AY,vwe).call(this,a,r)>1&&!Number.isInteger(ue(this,Di))&&St(this,Di,bwe(e.row,r,-this.getLayersCount(),(y,_)=>ue(this,Ne).getHeaderSettings(y,_)))}const l=this.hot._createCellCoords(a,r),h=l.isHeader()&&l.col>=0;if((!h||i!==0)&&St(this,Di,null),h){const{isRowspanPlaceholder:c}=ue(this,Ne).getHeaderSettings(e.row,e.col)??{},{isRowspanPlaceholder:d}=ue(this,Ne).getHeaderSettings(l.row,l.col)??{};let u=ue(this,Ne).findLeftMostColumnIndex(l.row,l.col),f=ue(this,Ne).findRightMostColumnIndex(l.row,l.col);if(d){const p=qt(this,Up,SC).call(this,l.row,l.col);u=ue(this,Ne).findLeftMostColumnIndex(p,l.col),f=ue(this,Ne).findRightMostColumnIndex(p,l.col)}if(c){const p=qt(this,Up,SC).call(this,e.row,e.col);u=ue(this,Ne).findLeftMostColumnIndex(p,e.col),f=ue(this,Ne).findRightMostColumnIndex(p,e.col),s<0?u=Math.max(u,Math.min(e.col,l.col)):s>0&&(f=Math.min(f,Math.max(e.col,l.col)))}if(n.col<0){const p=e.col>=u&&e.col<=f?u-1:f,C=this.hot.columnIndexMapper.getNearestNotHiddenIndex(p,-1);C===null?n.col=-this.hot.view.countRenderableColumnsInRange(0,e.col):n.col=-Math.max(this.hot.view.countRenderableColumnsInRange(C,e.col)-1,1)}else if(n.col>0){const p=e.col>=u&&e.col<=f?f+1:u,C=this.hot.columnIndexMapper.getNearestNotHiddenIndex(p,1);C===null?(n.col=this.hot.view.countRenderableColumnsInRange(e.col,this.hot.countCols()),c&&(n.col+=1,e.row<-1&&(n.row=1,n.col=-(e.col+1)))):n.col=Math.max(this.hot.view.countRenderableColumnsInRange(e.col,C)-1,1)}}St(this,Dc,{row:e.row+n.row,col:e.col+n.col})}function Nwe(n,e,t){const o=n.row,i=this._getHeaderTreeNodeDataByCoords({row:o,col:n.col}),s=this._getHeaderTreeNodeDataByCoords({row:o,col:e.col});St(this,Hm,t.clone()),e.col<n.col?(i&&(n.col=i.columnIndex+i.origColspan-1),s&&(e.col=s.columnIndex)):e.col>=n.col&&(i&&(n.col=i.columnIndex),s&&(e.col=s.columnIndex+s.origColspan-1))}function Pwe(n){if(ue(this,Ne).getLayersCount()>0){n.length=0;for(let e=0;e<ue(this,Ne).getLayersCount();e++)n.push(this.headerRendererFactory(e))}}function Lwe(n){const e=ue(this,Ne).getLayersCount();let t=n.startColumn,o=!!e;for(let i=0;i<e;i++){const s=ue(this,Ne).findLeftMostColumnIndex(i,n.startColumn),r=this.hot.columnIndexMapper.getRenderableFromVisualIndex(s);if(s>=0&&(o=!1),mi(r)&&r<n.startColumn){t=r;break}}n.startColumn=o?ue(this,Ne).getHeaderTreeNodeData(0,t).columnIndex:t}function Wwe(n,e){const t=this.ghostTable.getWidth(e);return n>t?n:t}function $we(){if(!ue(this,bp))return;const n=this.hot.rootWindow.getComputedStyle(this.hot.rootElement),e=Number.parseFloat(n.getPropertyValue("--ht-cell-vertical-padding")),t=Number.parseFloat(n.getPropertyValue("--ht-line-height")),o=Math.round(e*2+t+1);if(Number.isFinite(o))return new Array(this.getLayersCount()).fill(o)}function Fwe(n,e,t){const{label:o}=ue(this,Ne).getHeaderTreeNodeData(t,e)??{label:""};return o}function Bwe(n,e){if(n<0)return this.hot.getCell(n,ue(this,Ne).findLeftMostColumnIndex(n,e),!0)}function Vwe(){this.updatePlugin()}function zwe(n,e){e||this.updatePlugin()}function Uwe(){ue(this,zp)&&(this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap(),St(this,zp,!1))}class Ywe{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},Re(0,this.data.length-1,e=>{this.cacheNode(this.data[e],0,null)})}cacheNode(e,t,o){this.cache.levels[t]||(this.cache.levels[t]=[],this.cache.levelCount+=1),this.cache.levels[t].push(e),this.cache.rows.push(e),this.cache.nodeInfo.set(e,{parent:o,row:this.cache.rows.length-1,level:t}),this.hasChildren(e)&&O(e.__children,i=>{this.cacheNode(i,t+1,e)})}getDataObject(e){return e==null?null:this.cache.rows[e]}readTreeNodes(e,t,o,i){let s=!1,r=t;if(isNaN(r)&&r.end)return r;let a=e;return a||(a={__children:this.data},s=!0,r-=1),o!=null&&r===o?{result:a,end:!0}:i!=null&&a===i?{result:r,end:!0}:(r+=1,a.__children&&O(a.__children,l=>{if(this.parentReference.set(l,s?null:a),r=this.readTreeNodes(l,r,o,i),isNaN(r)&&r.end)return!1}),r)}mockParent(){const e=this.mockNode();return e.__children=this.data,e}mockNode(){const e={};return nt(this.data[0],(t,o)=>{e[o]=null}),e}getRowIndex(e){return e==null?null:this.cache.nodeInfo.get(e).row}getRowIndexWithinParent(e){let t=null;isNaN(e)?t=e:t=this.getDataObject(e);const o=this.getRowParent(e);return o==null?this.data.indexOf(t):o.__children.indexOf(t)}countAllRows(){const e={__children:this.data};return this.countChildren(e)}countChildren(e){let t=0,o=e;return isNaN(o)||(o=this.getDataObject(o)),!o||!o.__children?0:(O(o.__children,i=>{t+=1,i.__children&&(t+=this.countChildren(i))}),t)}getRowParent(e){let t;return isNaN(e)?t=e:t=this.getDataObject(e),this.getRowObjectParent(t)}getRowObjectParent(e){return!e||typeof e!="object"?null:this.cache.nodeInfo.get(e).parent}getRowLevel(e){let t=null;return isNaN(e)?t=e:t=this.getDataObject(e),t?this.getRowObjectLevel(t):null}getRowObjectLevel(e){return e==null?null:this.cache.nodeInfo.get(e).level}hasChildren(e){let t=e;return isNaN(t)||(t=this.getDataObject(t)),!!(t.__children&&t.__children.length)}isChild(e){return this.getRowParent(e)!==null}getChild(e,t){return e.__children?.[t]||null}isRowHighestLevel(e){return!this.isChild(e)}isParent(e){let t=e;return isNaN(t)||(t=this.getDataObject(t)),t&&!!t.__children&&t.__children?.length!==0}addChild(e,t){let o=t;this.hot.runHooks("beforeAddChild",e,o);let i=null;e&&(i=this.getRowIndex(e)),this.hot.runHooks("beforeCreateRow",i+this.countChildren(e)+1,1);let s=e;e||(s=this.mockParent()),s.__children||(s.__children=[]),o||(o=this.mockNode()),s.__children.push(o),this.rewriteCache();const r=this.getRowIndex(o);this.hot.rowIndexMapper.insertIndexes(r,1),this.hot.runHooks("afterCreateRow",r,1),this.hot.runHooks("afterAddChild",e,o)}addChildAtIndex(e,t,o){let i=o,s;if(i||(i=this.mockNode()),this.hot.runHooks("beforeAddChild",e,i,t),e){const a=this.getRowIndex(e)+t+1;this.hot.runHooks("beforeCreateRow",a,1),e.__children.splice(t,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),s=a}else this.plugin.disableCoreAPIModifiers(),this.hot.alter("insert_row_above",t,1,"NestedRows.addChildAtIndex"),this.plugin.enableCoreAPIModifiers(),s=this.getRowIndex(this.data[t]);i=this.getDataObject(s),this.hot.runHooks("afterAddChild",e,i,t)}addSibling(e,t="below"){const o=this.translateTrimmedRow(e),i=this.getRowParent(o),s=this.getRowIndexWithinParent(o);switch(t){case"below":this.addChildAtIndex(i,s+1,null);break;case"above":this.addChildAtIndex(i,s,null);break}}detachFromParent(e,t=!0){let o=null;const i=[];Array.isArray(e)?(Re(e[0],e[2],u=>{const f=this.translateTrimmedRow(u);i.push(this.getDataObject(f))}),Re(0,i.length-2,u=>{this.detachFromParent(i[u],!1)}),o=i[i.length-1]):o=e;const s=this.getRowIndex(o),r=this.countChildren(o),a=this.getRowIndexWithinParent(o),l=this.getRowParent(o),h=this.getRowParent(l),c=this.getRowIndex(h);let d=null;if(this.hot.runHooks("beforeDetachChild",l,o),a!=null){const u=Array.from(new Array(s+r+1).keys()).splice(-1*(r+1));if(this.hot.runHooks("beforeRemoveRow",s,r+1,u,this.plugin.pluginName),l.__children.splice(a,1),this.rewriteCache(),this.hot.runHooks("afterRemoveRow",s,r+1,u,this.plugin.pluginName),h){d=c+this.countChildren(h);const f=this.getChild(h,this.countChildren(h)-1),p=this.getRowIndex(f);this.hot.runHooks("beforeCreateRow",p+1,r+1,this.plugin.pluginName),h.__children.push(o)}else d=this.hot.countRows()+1,this.hot.runHooks("beforeCreateRow",d-2,r+1,this.plugin.pluginName),this.data.push(o)}this.rewriteCache(),this.hot.runHooks("afterCreateRow",d-2,r+1,this.plugin.pluginName),this.hot.runHooks("afterDetachChild",l,o,this.getRowIndex(o)),t&&this.hot.render()}filterData(e,t,o){const i=[];O(o,s=>{i.push(this.getDataObject(s))}),O(i,s=>{const r=this.getRowIndexWithinParent(s),a=this.getRowParent(s);a===null?this.data.splice(r,1):a.__children.splice(r,1)}),this.rewriteCache()}spliceData(e,t,o){const i=this.getDataObject(e-1);let s=null,r=e;i&&i.__children&&i.__children.length===0?(s=i,r=0):e<this.countAllRows()&&(s=this.getRowParent(e),r=this.getRowIndexWithinParent(e)),s?o?s.__children.splice(r,t,...o):s.__children.splice(r,t):o?this.data.splice(r,t,...o):this.data.splice(r,t),this.rewriteCache()}syncRowWithRawSource(e){let t=e,o=t;do o=this.getRowParent(o),o!==null&&(t=o);while(o!==null);this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(t),"__children",t.__children,"NestedRows.syncRowWithRawSource"),this.plugin.enableCoreAPIModifiers()}moveRow(e,t,o,i){const s=t===this.hot.countRows(),r=this.getRowParent(e),a=this.getRowIndexWithinParent(e),l=r.__children.slice(a,a+1),h=e>t;let c=s?this.getRowParent(t-1):this.getRowParent(t);c==null&&(c=this.getRowParent(t-1)),c==null&&(c=this.getDataObject(t-1)),c?c.__children||(c.__children=[]):(c=this.getDataObject(t),c.__children=[]);const d=s||o||i?c.__children.length:this.getRowIndexWithinParent(t),u=r===c;c.__children.splice(d,0,l[0]),r.__children.splice(a+(h&&u?1:0),1),this.syncRowWithRawSource(r),u||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}constructor(e,t){this.data=null,this.parentReference=new WeakMap,this.cache={levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap},this.hot=t,this.plugin=e}}class GM{constructor(e,t){this.hot=t,this.plugin=e}}class Gr extends GM{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"}}appendLevelIndicators(e,t){const o=this.hot.toPhysicalRow(e),i=this.dataManager.getDataObject(o);if(!i)return;const s=this.dataManager.getRowLevel(o),r=t.getElementsByTagName("DIV")[0],a=r.querySelector("span.rowHeader"),l=r.querySelectorAll('[class^="ht_nesting"]'),h=this.hot.getSettings().ariaTags;if(O(l,c=>{c&&r.removeChild(c)}),V(t,Gr.CSS_CLASSES.indicatorContainer),s){const{rootDocument:c}=this.hot,d=a.cloneNode(!0);r.innerHTML="",Re(0,s-1,()=>{const u=c.createElement("SPAN");V(u,Gr.CSS_CLASSES.emptyIndicator),r.appendChild(u)}),r.appendChild(d)}if(this.dataManager.hasChildren(i)){const c=this.hot.rootDocument.createElement("DIV");h&&fe(c,[hl()]),V(t,Gr.CSS_CLASSES.parent),this.collapsingUI.areChildrenCollapsed(o)?(V(c,`${Gr.CSS_CLASSES.button} ${Gr.CSS_CLASSES.expandButton}`),h&&fe(t,[ks(!1)])):(V(c,`${Gr.CSS_CLASSES.button} ${Gr.CSS_CLASSES.collapseButton}`),h&&fe(t,[ks(!0)])),r.appendChild(c)}}updateRowHeaderWidth(e){let t=e;t||(t=this.dataManager.cache.levelCount);let o=11;o=this.hot.stylesHandler.getCSSVariableValue("cell-horizontal-padding")*2,this.rowHeaderWidthCache=Math.max(50,o+10*t+25),this.hot.render()}constructor(e,t){super(e,t),this.dataManager=this.plugin.dataManager,this.collapsingUI=this.plugin.collapsingUI,this.rowHeaderWidthCache=null}}class Gwe extends GM{collapseChildren(e,t=!0,o=!0){const i=[];let s=null,r=null,a=null;return isNaN(e)?(s=e,r=this.dataManager.getRowIndex(s)):(s=this.dataManager.getDataObject(e),r=e),this.dataManager.hasChildren(s)&&O(s.__children,l=>{i.push(this.dataManager.getRowIndex(l))}),a=this.collapseRows(i,!0,!1),o&&this.trimRows(a),t&&this.renderAndAdjust(),this.collapsedRows.indexOf(r)===-1&&this.collapsedRows.push(r),a}collapseMultipleChildren(e,t=!0,o=!0){const i=[];O(e,s=>{i.push(...this.collapseChildren(s,!1,!1))}),o&&this.trimRows(i),t&&this.renderAndAdjust()}collapseRow(e,t=!0){this.collapseRows([e],t)}collapseRows(e,t=!0,o=!1){const i=[];return O(e,s=>{i.push(s),t&&this.collapseChildRows(s,i)}),o&&this.trimRows(i),i}collapseChildRows(e,t=[],o,i=!1){if(this.dataManager.hasChildren(e)){const s=this.dataManager.getDataObject(e);O(s.__children,r=>{const a=this.dataManager.getRowIndex(r);t.push(a),this.collapseChildRows(a,t)})}i&&this.trimRows(t)}expandRow(e,t=!0){this.expandRows([e],t)}expandRows(e,t=!0,o=!1){const i=[];return O(e,s=>{i.push(s),t&&this.expandChildRows(s,i)}),o&&this.untrimRows(i),i}expandChildRows(e,t=[],o,i=!1){if(this.dataManager.hasChildren(e)){const s=this.dataManager.getDataObject(e);O(s.__children,r=>{if(!this.isAnyParentCollapsed(r)){const a=this.dataManager.getRowIndex(r);t.push(a),this.expandChildRows(a,t)}})}i&&this.untrimRows(t)}expandChildren(e,t=!0,o=!0){const i=[];let s=null,r=null,a=null;return isNaN(e)?(s=e,r=this.dataManager.getRowIndex(e)):(s=this.dataManager.getDataObject(e),r=e),this.collapsedRows.splice(this.collapsedRows.indexOf(r),1),this.dataManager.hasChildren(s)&&O(s.__children,l=>{const h=this.dataManager.getRowIndex(l);i.push(h)}),a=this.expandRows(i,!0,!1),o&&this.untrimRows(a),t&&this.renderAndAdjust(),a}expandMultipleChildren(e,t=!0,o=!0){const i=[];O(e,s=>{i.push(...this.expandChildren(s,!1,!1))}),o&&this.untrimRows(i),t&&this.renderAndAdjust()}collapseAll(){const e=this.dataManager.getData(),t=[];O(e,o=>{this.dataManager.hasChildren(o)&&t.push(o)}),this.collapseMultipleChildren(t),this.renderAndAdjust()}expandAll(){const e=this.dataManager.getData(),t=[];O(e,o=>{this.dataManager.hasChildren(o)&&t.push(o)}),this.expandMultipleChildren(t),this.renderAndAdjust()}trimRows(e){this.hot.batchExecution(()=>{O(e,t=>{this.plugin.collapsedRowsMap.setValueAtIndex(t,!0)})},!0)}untrimRows(e){this.hot.batchExecution(()=>{O(e,t=>{this.plugin.collapsedRowsMap.setValueAtIndex(t,!1)})},!0)}areChildrenCollapsed(e){let t=isNaN(e)?e:this.dataManager.getDataObject(e),o=!0;return t===null&&(t={__children:this.dataManager.data}),this.dataManager.hasChildren(t)&&O(t.__children,i=>{const s=this.dataManager.getRowIndex(i);if(!this.plugin.collapsedRowsMap.getValueAtIndex(s))return o=!1,!1}),o}isAnyParentCollapsed(e){let t=e;for(;t!==null;){t=this.dataManager.getRowParent(t);const o=this.dataManager.getRowIndex(t);if(this.collapsedRows.indexOf(o)>-1)return!0}return!1}toggleState(e,t){if(t.col>=0)return;const o=this.translateTrimmedRow(t.row);Se(e.target,Gr.CSS_CLASSES.button)&&(this.areChildrenCollapsed(o)?this.expandChildren(o):this.collapseChildren(o),es(e))}translateTrimmedRow(e){return this.hot.toPhysicalRow(e)}untranslateTrimmedRow(e){return this.hot.toVisualRow(e)}renderAndAdjust(){this.hot.view.adjustElementsSize(),this.hot.render()}constructor(e,t){super(e,t),this.dataManager=this.plugin.dataManager,this.collapsedRows=[],this.collapsedRowsStash={stash:(o=!1)=>{this.lastCollapsedRows=this.collapsedRows.slice(0),this.expandMultipleChildren(this.lastCollapsedRows,o)},shiftStash:(o,i,s=1)=>{i==null&&(i=1/0),O(this.lastCollapsedRows,(r,a)=>{r>=o&&r<i&&(this.lastCollapsedRows[a]=r+s)})},applyStash:(o=!0)=>{this.collapseMultipleChildren(this.lastCollapsedRows,o),this.lastCollapsedRows=void 0},trimStash:(o,i)=>{Re(o,o+i-1,s=>{const r=this.lastCollapsedRows.indexOf(s);r>-1&&this.lastCollapsedRows.splice(r,1)})}}}}function jwe(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qwe(n,e){return e.get?e.get.call(n):e.value}function Kwe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function NY(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Xwe(n,e){var t=NY(n,e,"get");return qwe(n,t)}function Zwe(n,e,t){jwe(n,e),e.set(n,t)}function Qwe(n,e,t){var o=NY(n,e,"set");return Kwe(n,o,t),t}var zR=new WeakMap;class Jwe extends GM{appendOptions(e){const t=[{key:"add_child",name(){return this.getTranslatedPhrase(yT)},callback:()=>{const o=this.dataManager.translateTrimmedRow(this.hot.getSelectedActive()[0]),i=this.dataManager.getDataObject(o);this.dataManager.addChild(i)},disabled:()=>{const o=this.hot.getSelectedActive();return!o||o[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{key:"detach_from_parent",name(){return this.getTranslatedPhrase(_T)},callback:()=>{this.dataManager.detachFromParent(this.hot.getSelectedActive())},disabled:()=>{const o=this.hot.getSelectedActive(),i=this.dataManager.translateTrimmedRow(o[0]);return!this.dataManager.getRowParent(i)||!o||o[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{name:"---------"}];return Re(0,e.items.length-1,o=>{if(o===0)return O(t,(i,s)=>{e.items.splice(o+s,0,i)}),!1}),this.modifyRowInsertingOptions(e)}modifyRowInsertingOptions(e){return Re(0,e.items.length-1,t=>{const o=Xwe(this,zR)[e.items[t].key];o!=null&&(e.items[t].callback=o)}),e}constructor(...e){super(...e),Zwe(this,zR,{writable:!0,value:void 0}),this.dataManager=this.plugin.dataManager,Qwe(this,zR,{row_above:(t,o)=>{const i=o[o.length-1];this.dataManager.addSibling(i.start.row,"above")},row_below:(t,o)=>{const i=o[o.length-1];this.dataManager.addSibling(i.start.row,"below")}})}}function ebe(n){return Array.isArray(n)&&(n.length===0||L7(n))}class tbe{onBeforeRowMove(e,t,o,i){if(this.displayAPICompatibilityWarning({rows:e,finalIndex:t,dropIndex:o,movePossible:i}))return!1;this.movedToCollapsed=!1;const r=o===this.hot.countRows(),a=r?this.hot.countSourceRows():this.dataManager.translateTrimmedRow(o);let l=!0;const h=e.map(p=>{if(!l)return!1;const C=this.dataManager.translateTrimmedRow(p);return l=this.shouldAllowMoving(C,a),C}),c=h.indexOf(a)===-1;if(!l||!c)return!1;const d=this.getBaseParent(h),u=this.getTargetParent(r,a),f=d===u;return this.movedToCollapsed=this.collapsingUI.areChildrenCollapsed(u),this.collapsingUI.collapsedRowsStash.stash(),this.shiftCollapsibleParentsLocations(h,a,f),this.moveRows(h,a,u),this.dataManager.rewriteCache(),this.moveCellsMeta(h,a),this.collapsingUI.collapsedRowsStash.applyStash(!1),this.hot.runHooks("afterRowMove",e,t,o,i,i&&this.isRowOrderChanged(e,t)),this.hot.render(),this.selectCells(e,o),!1}displayAPICompatibilityWarning(e){const{rows:t,finalIndex:o,dropIndex:i,movePossible:s}=e;let r=!1;return en(i)&&(Ie(pt`Since version 8.0.0 of the Handsontable the 'moveRows' method isn't used for moving rows\x20
270
- when the NestedRows plugin is enabled. Please use the 'dragRows' method instead.`),this.hot.runHooks("afterRowMove",t,o,i,s,!1),r=!0),r}shouldAllowMoving(e,t){return!(this.dataManager.isParent(e)||this.dataManager.isRowHighestLevel(e)||e===t||t===0)}getBaseParent(e){return this.dataManager.getRowParent(e[0])}getTargetParent(e,t){let o=this.dataManager.getRowParent(e?t-1:t);return o==null&&(o=this.dataManager.getRowParent(t-1)),o}shiftCollapsibleParentsLocations(e,t,o){o||(Math.max(...e)<=t?this.collapsingUI.collapsedRowsStash.shiftStash(e[0],t,-1*e.length):this.collapsingUI.collapsedRowsStash.shiftStash(t,e[0],e.length))}moveRows(e,t,o){const i=t===this.dataManager.getRowIndex(o)+this.dataManager.countChildren(o)+1;this.hot.batchRender(()=>{e.forEach(s=>{this.dataManager.moveRow(s,t,this.movedToCollapsed,i)})})}moveCellsMeta(e,t){const o=[],i=Math.max(...e)<t;e.forEach(s=>{o.push(this.hot.getCellMetaAtRow(s))}),this.hot.spliceCellsMeta(e[0],e.length),this.hot.spliceCellsMeta(t-(i?o.length:0),0,...o)}selectCells(e,t){const o=e.length;let i=0,s=0;if(this.movedToCollapsed){let r=null;e[o-1]<t?r=this.dataManager.translateTrimmedRow(t-o):r=this.dataManager.translateTrimmedRow(t);const a=this.dataManager.getRowParent(r===null?this.hot.countSourceRows()-1:r-1),l=this.dataManager.getRowIndex(a);i=this.dataManager.untranslateTrimmedRow(l),s=i}else e[o-1]<t?(s=t-1,i=s-o+1):(i=t,s=i+o-1);this.hot.selectCells([[i,0,s,this.hot.countCols()-1]],!1)}isRowOrderChanged(e,t){return e.some((o,i)=>o-i!==t)}constructor(e){this.plugin=e,this.hot=e.hot,this.dataManager=e.dataManager,this.collapsingUI=e.collapsingUI}}function PY(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nbe(n,e){return e.get?e.get.call(n):e.value}function obe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function LY(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Yp(n,e){var t=LY(n,e,"get");return nbe(n,t)}function UR(n,e,t){PY(n,e),e.set(n,t)}function Ga(n,e,t){var o=LY(n,e,"set");return obe(n,o,t),t}function bo(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Io(n,e){PY(n,e),e.add(n)}const Hy="nestedRows",ibe=300,wW=Hy,sbe="The Nested Rows plugin requires an Array of Objects as a dataset to be provided. The plugin has been disabled.";var Am=new WeakMap,ac=new WeakMap,Gp=new WeakMap,bW=new WeakSet,CW=new WeakSet,yW=new WeakSet,_W=new WeakSet,SW=new WeakSet,vW=new WeakSet,RW=new WeakSet,EW=new WeakSet,kW=new WeakSet,TW=new WeakSet,xW=new WeakSet,MW=new WeakSet,IW=new WeakSet,HW=new WeakSet,AW=new WeakSet,OW=new WeakSet,YR=new WeakSet;class rbe extends at{static get PLUGIN_KEY(){return Hy}static get PLUGIN_PRIORITY(){return ibe}isEnabled(){return!!this.hot.getSettings()[Hy]}enablePlugin(){this.enabled||(this.collapsedRowsMap=this.hot.rowIndexMapper.registerMap("nestedRows",new of),Ga(this,Gp,!0),this.dataManager=new Ywe(this,this.hot),this.collapsingUI=new Gwe(this,this.hot),this.headersUI=new Gr(this,this.hot),this.contextMenuUI=new Jwe(this,this.hot),this.rowMoveController=new tbe(this),this.addHook("afterInit",(...e)=>bo(this,HW,ybe).call(this,...e)),this.addHook("afterRender",(...e)=>bo(this,AW,_be).call(this,...e)),this.addHook("beforeViewRender",(...e)=>bo(this,OW,Sbe).call(this,...e)),this.addHook("modifyRowData",(...e)=>this.onModifyRowData(...e)),this.addHook("modifySourceLength",(...e)=>this.onModifySourceLength(...e)),this.addHook("beforeDataSplice",(...e)=>this.onBeforeDataSplice(...e)),this.addHook("filterData",(...e)=>bo(this,yW,hbe).call(this,...e)),this.addHook("afterContextMenuDefaultOptions",(...e)=>bo(this,_W,cbe).call(this,...e)),this.addHook("afterGetRowHeader",(...e)=>bo(this,SW,dbe).call(this,...e)),this.addHook("beforeOnCellMouseDown",(...e)=>bo(this,CW,lbe).call(this,...e)),this.addHook("beforeRemoveRow",(...e)=>bo(this,EW,gbe).call(this,...e)),this.addHook("afterRemoveRow",(...e)=>bo(this,RW,fbe).call(this,...e)),this.addHook("beforeAddChild",(...e)=>bo(this,kW,pbe).call(this,...e)),this.addHook("afterAddChild",(...e)=>bo(this,TW,mbe).call(this,...e)),this.addHook("beforeDetachChild",(...e)=>bo(this,xW,wbe).call(this,...e)),this.addHook("afterDetachChild",(...e)=>bo(this,MW,bbe).call(this,...e)),this.addHook("modifyRowHeaderWidth",(...e)=>bo(this,vW,ube).call(this,...e)),this.addHook("afterCreateRow",(...e)=>bo(this,IW,Cbe).call(this,...e)),this.addHook("beforeRowMove",(...e)=>bo(this,bW,abe).call(this,...e)),this.addHook("beforeLoadData",e=>bo(this,YR,DW).call(this,e)),this.addHook("beforeUpdateData",e=>bo(this,YR,DW).call(this,e)),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.getSelectedRangeActive(),t=this.collapsingUI.translateTrimmedRow(e.row);return this.collapsingUI.areChildrenCollapsed(t)?this.collapsingUI.expandChildren(t):this.collapsingUI.collapseChildren(t),!1},runOnlyIf:()=>{const e=this.hot.getSelectedRangeActive()?.highlight;return e&&this.hot.getSelectedRangeActive()?.isSingle()&&this.hot.selection.isCellVisible(e)&&e.col===-1&&e.row>=0},group:wW,relativeToGroup:fl,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(wW)}disableCoreAPIModifiers(){Ga(this,ac,!0)}enableCoreAPIModifiers(){Ga(this,ac,!1)}onModifyRowData(e){if(!Yp(this,ac))return this.dataManager.getDataObject(e)}onModifySourceLength(){if(!Yp(this,ac))return this.dataManager.countAllRows()}onBeforeDataSplice(e,t,o){return Yp(this,ac)||this.dataManager.isRowHighestLevel(e)?!0:(this.dataManager.spliceData(e,t,o),!1)}destroy(){super.destroy()}constructor(...e){super(...e),Io(this,bW),Io(this,CW),Io(this,yW),Io(this,_W),Io(this,SW),Io(this,vW),Io(this,RW),Io(this,EW),Io(this,kW),Io(this,TW),Io(this,xW),Io(this,MW),Io(this,IW),Io(this,HW),Io(this,AW),Io(this,OW),Io(this,YR),UR(this,Am,{writable:!0,value:void 0}),UR(this,ac,{writable:!0,value:void 0}),UR(this,Gp,{writable:!0,value:void 0}),this.dataManager=null,this.headersUI=null,this.collapsedRowsMap=null,Ga(this,Am,!1),Ga(this,ac,!1),Ga(this,Gp,!0)}}function abe(n,e,t,o){return this.rowMoveController.onBeforeRowMove(n,e,t,o)}function lbe(n,e,t){this.collapsingUI.toggleState(n,e,t)}function hbe(n,e,t){return this.collapsingUI.collapsedRowsStash.stash(),this.collapsingUI.collapsedRowsStash.trimStash(t[0],e),this.collapsingUI.collapsedRowsStash.shiftStash(t[0],null,-1*e),this.dataManager.filterData(n,e,t),Ga(this,Am,!0),this.dataManager.getData().slice()}function cbe(n){return this.contextMenuUI.appendOptions(n)}function dbe(n,e){this.headersUI.appendLevelIndicators(n,e)}function ube(n){return Math.max(this.headersUI.rowHeaderWidthCache,n)}function fbe(n,e,t,o){o!==this.pluginName&&this.hot._registerTimeout(()=>{Ga(this,Am,!1),this.headersUI.updateRowHeaderWidth(),this.collapsingUI.collapsedRowsStash.applyStash()})}function gbe(n,e,t){const o=Array.from(t.reduce((i,s)=>{if(this.dataManager.isParent(s)){const r=this.dataManager.getDataObject(s).__children;return i.add(s),Array.isArray(r)&&r.forEach(a=>i.add(this.dataManager.getRowIndex(a))),i}return i.add(s)},new Set));t.length=0,t.push(...o)}function pbe(){this.collapsingUI.collapsedRowsStash.stash()}function mbe(n,e){this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(e)),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function wbe(){this.collapsingUI.collapsedRowsStash.stash()}function bbe(n,e,t){this.collapsingUI.collapsedRowsStash.shiftStash(t,null,-1),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function Cbe(){this.dataManager.rewriteCache()}function ybe(){this.headersUI.updateRowHeaderWidth()}function _be(){Yp(this,Gp)&&this.hot.view&&(Ga(this,Gp,!1),this.hot.rootWindow.requestAnimationFrame(()=>{this.hot&&this.hot.view&&!this.hot.isDestroyed&&this.hot.view.adjustElementsSize(!0)}))}function Sbe(n,e){Yp(this,Am)&&(e.skipRender=!0)}function DW(n){if(!ebe(n)){il(sbe),this.hot.getSettings()[Hy]=!1,this.disablePlugin();return}this.dataManager.setData(n),this.dataManager.rewriteCache()}function WY(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function vbe(n,e){return e.get?e.get.call(n):e.value}function Rbe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function $Y(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function rt(n,e){var t=$Y(n,e,"get");return vbe(n,t)}function Vl(n,e,t){WY(n,e),e.set(n,t)}function Ys(n,e,t){var o=$Y(n,e,"set");return Rbe(n,o,t),t}function GR(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Ebe(n,e){WY(n,e),e.add(n)}const kbe=`
271
- <div data-ref="container" class="ht-pagination handsontable">
272
- <div class="ht-pagination__inner">
273
- <div data-ref="pageSizeSection" class="ht-page-size-section">
274
- <span data-ref="pageSizeLabel" class="ht-page-size-section__label"></span>
275
- <div class="ht-page-size-section__select-wrapper">
276
- <select data-ref="pageSizeSelect" name="pageSize" data-hot-input></select>
277
- </div>
278
- </div>
279
- <div data-ref="pageCounterSection" class="ht-page-counter-section"></div>
280
- <nav data-ref="pageNavSection" class="ht-page-navigation-section">
281
- <button data-ref="first" class="ht-page-navigation-section__button ht-page-first"></button>
282
- <button data-ref="prev" class="ht-page-navigation-section__button ht-page-prev"></button>
283
- <span data-ref="pageNavLabel" class="ht-page-navigation-section__label"></span>
284
- <button data-ref="next" class="ht-page-navigation-section__button ht-page-next"></button>
285
- <button data-ref="last" class="ht-page-navigation-section__button ht-page-last"></button>
286
- </nav>
287
- </div>
288
- </div>
289
- `;var $u=new WeakMap,mc=new WeakMap,Tb=new WeakMap,Vo=new WeakMap,iu=new WeakMap,us=new WeakMap,jR=new WeakMap,qR=new WeakMap,xb=new WeakSet;class FY{install(){if(rt(this,Vo)?.container)return;const e=jc`${kbe}`,{container:t,first:o,prev:i,next:s,last:r,pageSizeSelect:a}=e.refs;Ys(this,Vo,e.refs),t.setAttribute("dir",rt(this,Tb)?"rtl":"ltr"),t.tabIndex=-1;const l=c=>c.currentTarget.disabled,h=(c,d,u)=>{d.addEventListener(c,f=>{l(f)||u()})};h("click",o,()=>this.runLocalHooks("firstPageClick")),h("click",i,()=>this.runLocalHooks("prevPageClick")),h("click",s,()=>this.runLocalHooks("nextPageClick")),h("click",r,()=>this.runLocalHooks("lastPageClick")),a.addEventListener("change",()=>{const c=a.value==="auto"?"auto":Number.parseInt(a.value,10);this.runLocalHooks("pageSizeChange",c)}),this.setCounterSectionVisibility(!1),this.setNavigationSectionVisibility(!1),this.setPageSizeSectionVisibility(!1),rt(this,mc)?(rt(this,mc).appendChild(e.fragment),V(t,[rt(this,iu),"handsontable"])):rt(this,$u).after(e.fragment)}getContainer(){return rt(this,Vo).container}getFocusableElements(){const{first:e,prev:t,next:o,last:i,pageSizeSelect:s}=rt(this,Vo);return[s,e,t,o,i].filter(r=>!r.disabled)}updateWidth(e){return rt(this,Vo).container.style.width=`${e}px`,this}updateTheme(e){if(Ys(this,iu,e),rt(this,mc)){const{container:t}=rt(this,Vo);re(t,/ht-theme-.*/g),rt(this,iu)&&V(t,rt(this,iu))}return this}getHeight(){return rt(this,Vo).container.offsetHeight}refreshBorderState(){const{container:e}=rt(this,Vo);return rt(this,mc)||rt(this,jR).call(this)?V(e,"ht-pagination--bordered"):re(e,"ht-pagination--bordered"),this}updateState({currentPage:e,totalPages:t,firstVisibleRowIndex:o,lastVisibleRowIndex:i,totalRenderedRows:s,pageSizeList:r,pageSize:a,autoPageSize:l,counterStartRow:h,counterEndRow:c}){const{first:d,prev:u,next:f,last:p,pageCounterSection:C,pageNavSection:y,pageNavLabel:_,pageSizeSelect:T,pageSizeLabel:P}=rt(this,Vo),$=h??o+1,F=c??i+1,N=rt(this,us).call(this,ZT,{start:$,end:F,total:s}),I=rt(this,us).call(this,QT,{currentPage:e,totalPages:t}),j=rt(this,us).call(this,WC);C.textContent=N,_.textContent=I,T.textContent="",P.textContent=`${j}:`,fe(y,[Pi(rt(this,us).call(this,KT))]),fe(T,[Pi(rt(this,us).call(this,WC))]),rt(this,qR).call(this,I),this.refreshBorderState(),r.forEach(te=>{const Q=te==="auto"?rt(this,us).call(this,XT):te,be=new Option(Q,te);(l&&te==="auto"||!l&&te===a)&&(be.selected=!0),T.add(be)});const U=e===1,G=e===t;if(y.style.display!=="none"){const te=rt(this,$u).ownerDocument.activeElement;U?(V(d,"ht-page-navigation-section__button--disabled"),V(u,"ht-page-navigation-section__button--disabled"),d.disabled=!0,u.disabled=!0):(re(d,"ht-page-navigation-section__button--disabled"),re(u,"ht-page-navigation-section__button--disabled"),d.disabled=!1,u.disabled=!1),G?(V(f,"ht-page-navigation-section__button--disabled"),V(p,"ht-page-navigation-section__button--disabled"),f.disabled=!0,p.disabled=!0):(re(f,"ht-page-navigation-section__button--disabled"),re(p,"ht-page-navigation-section__button--disabled"),f.disabled=!1,p.disabled=!1),[d,u,f,p].includes(te)&&(u.disabled?f.focus():f.disabled&&u.focus())}return fe(d,[Pi(rt(this,us).call(this,JT)),Kg(U)]),fe(u,[Pi(rt(this,us).call(this,ex)),Kg(U)]),fe(f,[Pi(rt(this,us).call(this,tx)),Kg(G)]),fe(p,[Pi(rt(this,us).call(this,nx)),Kg(G)]),this}setPageSizeSectionVisibility(e){const{pageSizeSection:t,pageSizeSelect:o}=rt(this,Vo);return t.style.display=e?"":"none",o.disabled=!e,GR(this,xb,KR).call(this),this}setCounterSectionVisibility(e){return rt(this,Vo).pageCounterSection.style.display=e?"":"none",GR(this,xb,KR).call(this),this}setNavigationSectionVisibility(e){const{pageNavSection:t,first:o,prev:i,next:s,last:r}=rt(this,Vo);return t.style.display=e?"":"none",o.disabled=!e,i.disabled=!e,s.disabled=!e,r.disabled=!e,GR(this,xb,KR).call(this),this}destroy(){rt(this,Vo)?.container.remove(),Ys(this,Vo,null)}constructor({rootElement:e,uiContainer:t,isRtl:o,themeName:i,phraseTranslator:s,shouldHaveBorder:r,a11yAnnouncer:a}){Ebe(this,xb),Vl(this,$u,{writable:!0,value:void 0}),Vl(this,mc,{writable:!0,value:void 0}),Vl(this,Tb,{writable:!0,value:void 0}),Vl(this,Vo,{writable:!0,value:void 0}),Vl(this,iu,{writable:!0,value:void 0}),Vl(this,us,{writable:!0,value:void 0}),Vl(this,jR,{writable:!0,value:void 0}),Vl(this,qR,{writable:!0,value:void 0}),Ys(this,Tb,!1),Ys(this,$u,e),Ys(this,mc,t),Ys(this,Tb,o),Ys(this,iu,i),Ys(this,us,s),Ys(this,jR,r),Ys(this,qR,a),this.install()}}function KR(){const{container:n,pageSizeSection:e,pageCounterSection:t,pageNavSection:o}=rt(this,Vo),i=e.style.display!=="none"||t.style.display!=="none"||o.style.display!=="none";rt(this,mc)||(i?V(rt(this,$u).querySelector(".ht-wrapper"),"htPagination"):re(rt(this,$u).querySelector(".ht-wrapper"),"htPagination")),n.style.display=i?"":"none"}_t(FY,Bn);class Tbe{calculate({pageSize:e,totalItems:t}){this.pageSize=Math.max(e,1),this.totalItems=t,this.totalPages=Math.max(1,Math.ceil(this.totalItems/this.pageSize))}getTotalPages(){return this.totalPages}getState(e){if(e-=1,e<0||e>=this.getTotalPages())return;const t=e*this.pageSize,o=Math.max(0,Math.min(t+this.pageSize-1,this.totalItems-1));return{startIndex:t,endIndex:o,pageSize:this.pageSize}}constructor(){this.pageSize=1,this.totalItems=0,this.totalPages=0}}class xbe{calculate({itemsSizeProvider:e,viewportSizeProvider:t}){const o=e(),i=t(),s=[];let r=0,a=0,l=0;for(let h=0;h<o.length;h++){const c=o[h];l>0&&a+c>=i&&(s.push({startIndex:r,endIndex:h-1,pageSize:l}),r=h,a=0,l=0),a+=c,l+=1}s.push({startIndex:r,endIndex:Math.max(0,o.length-1),pageSize:l}),this.pages=s}getTotalPages(){return this.pages.length}getState(e){if(e-=1,!(e<0||e>=this.getTotalPages()))return this.pages[e]}constructor(){this.pages=[]}}const NW=new Map([["fixed",Tbe],["auto",xbe]]);function BY(n){NW.has(n)||Y(`Unknown pagination strategy type: ${n}`);const e=NW.get(n);return new e}function VY(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Mbe(n,e){return e.get?e.get.call(n):e.value}function Ibe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function zY(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function he(n,e){var t=zY(n,e,"get");return Mbe(n,t)}function Gs(n,e,t){VY(n,e),e.set(n,t)}function Tt(n,e,t){var o=zY(n,e,"set");return Ibe(n,o,t),t}function ut(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function no(n,e){VY(n,e),e.add(n)}R2("pagination",["nestedRows","mergeCells","fixedRowsTop","fixedRowsBottom"]);const Qu="pagination",Hbe=900,Abe=`plugin:${Qu}`,PW=pt`The \`auto\` page size setting requires the \`autoRowSize\`\x20
290
- plugin to be enabled. Set the \`autoRowSize: true\` in the configuration to ensure correct behavior.`;var Fu=new WeakMap,Qt=new WeakMap,ro=new WeakMap,wn=new WeakMap,Ni=new WeakMap,jp=new WeakMap,qp=new WeakMap,wc=new WeakMap,Cp=new WeakMap,XR=new WeakMap,Mb=new WeakSet,Pg=new WeakSet,Fa=new WeakSet,ZR=new WeakSet,Ay=new WeakSet,LW=new WeakSet,WW=new WeakSet,$W=new WeakSet,QR=new WeakSet,FW=new WeakSet,BW=new WeakSet,VW=new WeakSet,zW=new WeakSet,UW=new WeakSet,YW=new WeakSet,GW=new WeakSet,jW=new WeakSet,qW=new WeakSet,KW=new WeakSet,Ib=new WeakMap;class Obe extends at{static get PLUGIN_KEY(){return Qu}static get PLUGIN_PRIORITY(){return Hbe}static get DEFAULT_SETTINGS(){return{pageSize:10,pageSizeList:["auto",5,10,20,50,100],initialPage:1,showPageSize:!0,showCounter:!0,showNavigation:!0,uiContainer:null}}isEnabled(){return!!this.hot.getSettings()[Qu]}enablePlugin(){if(this.enabled)return;const e=this.hot.getSettings()[Qu];e?.initialPage!==void 0&&Tt(this,Qt,this.getSetting("initialPage")),e?.pageSize!==void 0&&Tt(this,ro,this.getSetting("pageSize")),Tt(this,wc,this.hot.runHooks("hasExternalDataSource")===!0),Tt(this,Cp,null),Tt(this,Fu,this.hot.rowIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding",!1)),he(this,ro)==="auto"&&!this.hot.getPlugin("autoRowSize")?.enabled&&Ie(PW),Tt(this,Ni,BY(he(this,ro)==="auto"?"auto":"fixed")),he(this,wn)||(Tt(this,wn,new FY({rootElement:this.hot.rootGridElement,uiContainer:this.getSetting("uiContainer"),isRtl:this.hot.isRtl(),themeName:this.hot.getCurrentThemeName(),phraseTranslator:(...t)=>this.hot.getTranslatedPhrase(...t),shouldHaveBorder:()=>ut(this,LW,Dbe).call(this),a11yAnnouncer:t=>Yq(t)})),ut(this,ZR,XW).call(this),he(this,wn).addLocalHook("firstPageClick",()=>this.firstPage()).addLocalHook("prevPageClick",()=>this.prevPage()).addLocalHook("nextPageClick",()=>this.nextPage()).addLocalHook("lastPageClick",()=>this.lastPage()).addLocalHook("pageSizeChange",t=>this.setPageSize(t))),this.addHook("init",(...t)=>ut(this,GW,zbe).call(this,...t),-1),this.addHook("beforeSelectAll",(...t)=>ut(this,QR,ZW).call(this,...t)),this.addHook("beforeSelectColumns",(...t)=>ut(this,QR,ZW).call(this,...t)),this.addHook("beforeSetRangeEnd",(...t)=>ut(this,FW,Lbe).call(this,...t)),this.addHook("beforeSelectionHighlightSet",(...t)=>ut(this,BW,Wbe).call(this,...t)),this.addHook("beforePaste",(...t)=>ut(this,VW,$be).call(this,...t)),this.addHook("afterViewRender",(...t)=>ut(this,zW,Fbe).call(this,...t)),this.addHook("afterRender",(...t)=>ut(this,UW,Bbe).call(this,...t)),this.addHook("afterScrollVertically",(...t)=>ut(this,jW,Ube).call(this,...t)),this.addHook("afterLanguageChange",(...t)=>ut(this,qW,Ybe).call(this,...t)),this.addHook("beforeHeightChange",(...t)=>ut(this,YW,Vbe).call(this,...t)),this.addHook("afterSetTheme",(...t)=>ut(this,KW,Gbe).call(this,...t)),this.addHook("afterDataProviderFetch",(...t)=>he(this,XR).call(this,...t),-1),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",he(this,Ib)),ut(this,WW,Nbe).call(this),super.enablePlugin()}revertPageTo(e){const t=he(this,Qt);ut(this,Mb,JR).call(this,e),this.hot.scrollViewportTo({row:0}),ut(this,Fa,Jl).call(this),this.hot.runHooks("afterPageChange",t,e)}revertPageSizeTo(e){const t=he(this,ro);ut(this,Pg,Hb).call(this,e),ut(this,Fa,Jl).call(this),this.hot.runHooks("afterPageSizeChange",t,e)}updatePlugin(){this.disablePlugin(),this.enablePlugin(),ut(this,Fa,Jl).call(this),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.removeLocalHook("cacheUpdated",he(this,Ib)).unregisterMap(this.pluginName),ut(this,$W,Pbe).call(this),he(this,wn).destroy(),Tt(this,wn,null),super.disablePlugin()}getPaginationData(){const e=he(this,Ni).getTotalPages();let t=-1,o=-1;if(he(this,wc)){const s=this.hot.countRows();s>0&&(t=0,o=s-1)}else{const{pageSize:s,startIndex:r}=he(this,Ni).getState(he(this,Qt)),a=this.hot.countRows();let l=0;for(let h=r;l<s&&!(h>=a);h++)this.hot.rowIndexMapper.isHidden(this.hot.toPhysicalRow(h))||(t===-1&&(t=h),o=h,l+=1)}const i=he(this,Ni).getState(he(this,Qt));return{currentPage:he(this,Qt),totalPages:e,pageSize:i?.pageSize??he(this,ro),pageSizeList:[...this.getSetting("pageSizeList")],autoPageSize:he(this,ro)==="auto",numberOfRenderedRows:this.hot.rowIndexMapper.getRenderableIndexesLength(),firstVisibleRowIndex:t,lastVisibleRowIndex:o}}getCurrentPage(){return he(this,Qt)}getCurrentPageSize(){return he(this,ro)}setPage(e){const t=he(this,Qt);this.hot.runHooks("beforePageChange",t,e)!==!1&&(ut(this,Mb,JR).call(this,e),ut(this,Fa,Jl).call(this),this.hot.scrollViewportTo({row:0}),this.hot.runHooks("afterPageChange",t,he(this,Qt)))}resetPage(){this.setPage(this.getSetting("initialPage"))}setPageSize(e){const t=he(this,ro);this.hot.runHooks("beforePageSizeChange",t,e)!==!1&&(e==="auto"&&!this.hot.getPlugin("autoRowSize")?.enabled&&Ie(PW),ut(this,Pg,Hb).call(this,e),ut(this,Fa,Jl).call(this),this.hot.runHooks("afterPageSizeChange",t,he(this,ro)))}resetPageSize(){this.setPageSize(this.getSetting("pageSize"))}resetPagination(){this.resetPage(),this.resetPageSize(),ut(this,ZR,XW).call(this)}nextPage(){this.setPage(he(this,Qt)+1)}prevPage(){this.setPage(he(this,Qt)-1)}firstPage(){this.setPage(1)}lastPage(){this.setPage(he(this,Ni).getTotalPages())}hasPreviousPage(){return he(this,Qt)>1}hasNextPage(){return he(this,Qt)<he(this,Ni).getTotalPages()}getCurrentPageData(){const{firstVisibleRowIndex:e,lastVisibleRowIndex:t}=this.getPaginationData();return e===-1||t===-1?[]:this.hot.getData(e,0,t,this.hot.countCols()-1)}showPageSizeSection(){he(this,wn).setPageSizeSectionVisibility(!0),this.hot.runHooks("afterPageSizeVisibilityChange",!0)}hidePageSizeSection(){he(this,wn).setPageSizeSectionVisibility(!1),this.hot.runHooks("afterPageSizeVisibilityChange",!1)}showPageCounterSection(){he(this,wn).setCounterSectionVisibility(!0),this.hot.runHooks("afterPageCounterVisibilityChange",!0)}hidePageCounterSection(){he(this,wn).setCounterSectionVisibility(!1),this.hot.runHooks("afterPageCounterVisibilityChange",!1)}showPageNavigationSection(){he(this,wn).setNavigationSectionVisibility(!0),this.hot.runHooks("afterPageNavigationVisibilityChange",!0)}hidePageNavigationSection(){he(this,wn).setNavigationSectionVisibility(!1),this.hot.runHooks("afterPageNavigationVisibilityChange",!1)}destroy(){Tt(this,Fu,null),Tt(this,Ni,null),he(this,wn)?.destroy(),Tt(this,wn,null),super.destroy()}constructor(...e){super(...e),no(this,Mb),no(this,Pg),no(this,Fa),no(this,ZR),no(this,Ay),no(this,LW),no(this,WW),no(this,$W),no(this,QR),no(this,FW),no(this,BW),no(this,VW),no(this,zW),no(this,UW),no(this,YW),no(this,GW),no(this,jW),no(this,qW),no(this,KW),Gs(this,Fu,{writable:!0,value:void 0}),Gs(this,Qt,{writable:!0,value:void 0}),Gs(this,ro,{writable:!0,value:void 0}),Gs(this,wn,{writable:!0,value:void 0}),Gs(this,Ni,{writable:!0,value:void 0}),Gs(this,jp,{writable:!0,value:void 0}),Gs(this,qp,{writable:!0,value:void 0}),Gs(this,wc,{writable:!0,value:void 0}),Gs(this,Cp,{writable:!0,value:void 0}),Gs(this,XR,{writable:!0,value:void 0}),Gs(this,Ib,{writable:!0,value:void 0}),Tt(this,Fu,null),Tt(this,Qt,1),Tt(this,ro,10),Tt(this,wn,null),Tt(this,Ni,null),Tt(this,jp,!1),Tt(this,qp,!1),Tt(this,wc,!1),Tt(this,Cp,null),Tt(this,XR,({queryParameters:t,totalRows:o})=>{if(!he(this,wc))return;const i=he(this,Qt),s=he(this,ro),{page:r,pageSize:a}=t;typeof r=="number"&&r>=1&&ut(this,Mb,JR).call(this,r),a==="auto"?ut(this,Pg,Hb).call(this,"auto"):typeof a=="number"&&a>=1&&ut(this,Pg,Hb).call(this,a),he(this,wc)&&typeof o=="number"&&o>=0&&Tt(this,Cp,o),ut(this,Fa,Jl).call(this),i!==he(this,Qt)&&this.hot.runHooks("afterPageChange",i,he(this,Qt)),s!==he(this,ro)&&this.hot.runHooks("afterPageSizeChange",s,he(this,ro))}),Tt(this,Ib,()=>{!he(this,jp)&&this.hot?.view&&ut(this,Ay,jM).call(this)})}}function JR(n){Tt(this,Qt,n)}function Hb(n){Tt(this,Ni,BY(n==="auto"?"auto":"fixed")),Tt(this,ro,n)}function Jl(){ut(this,Ay,jM).call(this),this.hot.view.adjustElementsSize(),this.hot.render()}function XW(){this.getSetting("showPageSize")?this.showPageSizeSection():this.hidePageSizeSection(),this.getSetting("showCounter")?this.showPageCounterSection():this.hidePageCounterSection(),this.getSetting("showNavigation")?this.showPageNavigationSection():this.hidePageNavigationSection()}function jM(){Tt(this,jp,!0),he(this,Fu).clear();const n=this.hot.rowIndexMapper.getRenderableIndexes(),e=n.length,{stylesHandler:t}=this.hot,o=he(this,wc),i=o?he(this,Cp)??e:e;he(this,Ni).calculate({pageSize:he(this,ro),totalItems:i,viewportSizeProvider:()=>{const{view:l}=this.hot;if(l.isVerticallyScrollableByWindow()){const c=getComputedStyle(this.hot.rootDocument.body),d=Number.parseInt(c.marginTop,10)+Number.parseInt(c.marginBottom,10),u=this.hot.hasColHeaders()?l._wt.wtTable.getColumnHeaderHeight():0,f=he(this,wn).getHeight();return l.getWorkspaceHeight()-f-u-d}const h=l.hasHorizontalScroll()?Mn():0;return l.getViewportHeight()-h},itemsSizeProvider:()=>this.hot.rowIndexMapper.getRenderableIndexes().map(h=>{const c=this.hot.toVisualRow(h);return this.hot.getRowHeight(c)??t.getDefaultRowHeight(c)})});const s=he(this,Ni).getTotalPages();if(Tt(this,Qt,tt(he(this,Qt),1,s)),!o&&n.length>0){const{startIndex:l,pageSize:h}=he(this,Ni).getState(he(this,Qt));n.splice(l,h)}!o&&n.length>0?this.hot.batchExecution(()=>{n.forEach(l=>he(this,Fu).setValueAtIndex(l,!0))},!0):o||this.hot.rowIndexMapper.updateCache(!0),Tt(this,jp,!1);const a={...this.getPaginationData(),totalRenderedRows:o?i:e};if(o){const l=i,h=he(this,Ni).getState(he(this,Qt))?.pageSize??he(this,ro);a.counterStartRow=(he(this,Qt)-1)*h+1,a.counterEndRow=Math.min(he(this,Qt)*h,l)}he(this,wn).updateState(a)}function Dbe(){if(!this.hot.view)return!0;const{view:n}=this.hot;if(n.isVerticallyScrollableByWindow())return!1;if(n.hasHorizontalScroll()||n.getTableHeight()<n.getWorkspaceHeight())return!0;const{lastVisibleRowIndex:e}=this.getPaginationData();return n.getLastFullyVisibleRow()!==e}function Nbe(){this.hot.getFocusScopeManager().registerScope(Qu,he(this,wn).getContainer(),{shortcutsContextName:Abe,runOnlyIf:()=>this.getSetting("showPageSize")||this.getSetting("showNavigation"),onActivate:n=>{const e=he(this,wn).getFocusableElements();e.length>0&&(n==="tab_from_above"?e.at(0).focus():n==="tab_from_below"&&e.at(-1).focus())}})}function Pbe(){this.hot.getFocusScopeManager().unregisterScope(Qu)}function ZW(n,e){const{firstVisibleRowIndex:t,lastVisibleRowIndex:o}=this.getPaginationData();(he(this,Qt)>1||n.row>=0)&&(n.row=t),e.row=o}function Lbe(n){if(this.hot.selection.isSelectedByColumnHeader()){const{lastVisibleRowIndex:e}=this.getPaginationData();n.row=e}}function Wbe(){if(!this.hot.getSettings().navigableHeaders)return;const n=this.hot.getSelectedRangeLast();if(!n.isSingle()){const{highlight:e}=n;e.row=tt(e.row,n.getTopStartCorner().row,n.getBottomEndCorner().row)}}function $be(n,e){const{firstVisibleRowIndex:t,lastVisibleRowIndex:o}=this.getPaginationData();if(t===-1||o===-1)return!1;e.forEach(({startRow:i})=>{if(n.length===0)return;const s=Math.min(n.length-(o-i+1),n.length);n.splice(0,s)})}function Fbe(){if(he(this,ro)!=="auto"||he(this,qp)){Tt(this,qp,!1);return}Tt(this,qp,!0),ut(this,Fa,Jl).call(this)}function Bbe(){const{view:n}=this.hot,e=n.isHorizontallyScrollableByWindow()?n.getTotalTableWidth():n.getWorkspaceWidth();he(this,wn).updateWidth(e).refreshBorderState()}function Vbe(n){return this.getSetting("uiContainer")||!(typeof n=="number"||typeof n=="string"&&/^\d+$/.test(n)||typeof n=="string"&&n.endsWith("px"))?n:`calc(${typeof n=="string"&&n.endsWith("px")?n:`${n}px`} - ${he(this,wn).getHeight()}px)`}function zbe(){he(this,ro)!=="auto"&&ut(this,Ay,jM).call(this)}function Ube(){he(this,wn).refreshBorderState()}function Ybe(){ut(this,Fa,Jl).call(this)}function Gbe(n){he(this,wn).updateTheme(n)}function jbe(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function QW(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function qbe(n,e){jbe(n,e),e.add(n)}const eE="search",Kbe=190,Xbe="htSearchResult",Zbe=function(n,e,t,o,i){n.getCellMeta(e,t).isSearchResult=i},Qbe=function(n,e,t){return en(n)||n===null||!n.toLocaleLowerCase||n.length===0||en(e)||e===null?!1:e.toString().toLocaleLowerCase(t.locale).indexOf(n.toLocaleLowerCase(t.locale))!==-1};var tE=new WeakSet;class Jbe extends at{static get PLUGIN_KEY(){return eE}static get PLUGIN_PRIORITY(){return Kbe}isEnabled(){return this.hot.getSettings()[eE]}enablePlugin(){if(this.enabled)return;const e=this.hot.getSettings()[eE];this.updatePluginSettings(e),this.addHook("beforeRenderer",(...t)=>QW(this,tE,JW).call(this,...t)),super.enablePlugin()}disablePlugin(){const e=(...t)=>QW(this,tE,JW).call(this,...t);this.hot.addHook("beforeRenderer",e),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("beforeRenderer",e)}),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}query(e,t=this.getCallback(),o=this.getQueryMethod()){const i=this.hot.countRows(),s=this.hot.countCols(),r=[],a=this.hot;return Re(0,i-1,l=>{Re(0,s-1,h=>{const c=this.hot.getDataAtCell(l,h),d=this.hot.getCellMeta(l,h),u=d.search.callback||t,p=(d.search.queryMethod||o)(e,c,d);if(p){const C={row:l,col:h,data:c};r.push(C)}u&&u(a,l,h,c,p)})}),r}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){ie(e)&&(e.searchResultClass&&this.setSearchResultClass(e.searchResultClass),e.queryMethod&&this.setQueryMethod(e.queryMethod),e.callback&&this.setCallback(e.callback))}destroy(){super.destroy()}constructor(...e){super(...e),qbe(this,tE),this.callback=Zbe,this.queryMethod=Qbe,this.searchResultClass=Xbe}}function JW(n,e,t,o,i,s){const r=s.className||[];let a=[];typeof r=="string"?a=r.split(" "):a.push(...r),this.isEnabled()&&s.isSearchResult?a.includes(this.searchResultClass)||a.push(`${this.searchResultClass}`):a.includes(this.searchResultClass)&&a.splice(a.indexOf(this.searchResultClass),1),s.className=a.join(" ")}class UY{prepare({viewportWidth:e}){this.viewportWidth=e,this.baseWidths.clear(),this.stretchedWidths.clear()}setColumnBaseWidth(e,t){this.baseWidths.set(e,t)}calculate(){}getWidths(){return Array.from(this.stretchedWidths)}constructor(e){this.baseWidths=new Map,this.stretchedWidths=new Map,this.overwriteColumnWidthFn=e}}class eCe extends UY{calculate(){const e=Array.from(this.baseWidths).reduce((d,[,u])=>d+u,0);if(this.viewportWidth-e<0){this.stretchedWidths.clear();return}const o=this.viewportWidth/e,i=[],s=[];let r=this.viewportWidth,a=0;if(this.baseWidths.forEach((d,u)=>{const f=Math.round(d*o),p=this.overwriteColumnWidthFn(f,u);f===p&&f>=nf?(i.push([u,p]),a+=p):f!==p&&(i.push([u,p]),s.push(u),r-=p)}),r<=nf){this.stretchedWidths.clear();return}const l=r/a;let h=-1,c=0;i.forEach(([d,u],f)=>{let p=u;s.includes(d)||(p=Math.round(u*l)),this.stretchedWidths.set(d,p),h=d,f<i.length-1&&(c+=p)}),this.stretchedWidths.size>1&&this.stretchedWidths.set(h,Math.round(this.viewportWidth-c))}}function tCe(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nCe(n,e){return e.get?e.get.call(n):e.value}function oCe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function YY(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Ab(n,e){var t=YY(n,e,"get");return nCe(n,t)}function e$(n,e,t){tCe(n,e),e.set(n,t)}function su(n,e,t){var o=YY(n,e,"set");return oCe(n,o,t),t}var ru=new WeakMap,au=new WeakMap;class iCe extends UY{prepare(e){super.prepare(e),su(this,ru,0),su(this,au,-1)}setColumnBaseWidth(e,t){super.setColumnBaseWidth(e,t),su(this,au,e),su(this,ru,t)}calculate(){if(Ab(this,au)===-1)return;const e=Array.from(this.baseWidths).reduce((o,[,i])=>o+i,0),t=this.viewportWidth-e+Ab(this,ru);if(t<Ab(this,ru)){this.stretchedWidths.clear();return}this.stretchedWidths.set(Ab(this,au),t)}constructor(...e){super(...e),e$(this,ru,{writable:!0,value:void 0}),e$(this,au,{writable:!0,value:void 0}),su(this,ru,0),su(this,au,-1)}}function GY(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function sCe(n,e){return e.get?e.get.call(n):e.value}function rCe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function jY(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function hn(n,e){var t=jY(n,e,"get");return sCe(n,t)}function Ob(n,e,t){GY(n,e),e.set(n,t)}function Lg(n,e,t){var o=jY(n,e,"set");return rCe(n,o,t),t}function Db(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function nE(n,e){GY(n,e),e.add(n)}const aCe="stretchColumns";var Ro=new WeakMap,lu=new WeakMap,Nb=new WeakMap,Wg=new WeakMap,t$=new WeakSet,n$=new WeakSet,oE=new WeakSet;class lCe{useStrategy(e){Lg(this,Wg,hn(this,Nb).has(e)?e:"none")}refreshStretching(){if(hn(this,Wg)==="none"){hn(this,lu).clear();return}hn(this,Ro).batchExecution(()=>{hn(this,lu).clear();const e=hn(this,Nb).get(hn(this,Wg));let o=hn(this,Ro).view.getViewportWidth();Db(this,t$,hCe).call(this)&&(o-=Mn(hn(this,Ro).rootDocument)),e.prepare({viewportWidth:o});for(let i=0;i<hn(this,Ro).countCols();i++)hn(this,Ro).columnIndexMapper.isHidden(hn(this,Ro).toPhysicalColumn(i))||e.setColumnBaseWidth(i,Db(this,n$,cCe).call(this,i));e.calculate(),e.getWidths().forEach(([i,s])=>{hn(this,lu).setValueAtIndex(hn(this,Ro).toPhysicalColumn(i),s)})},!0)}getStretchedWidth(e){return hn(this,lu).getValueAtIndex(hn(this,Ro).toPhysicalColumn(e))}constructor(e){nE(this,t$),nE(this,n$),nE(this,oE),Ob(this,Ro,{writable:!0,value:void 0}),Ob(this,lu,{writable:!0,value:void 0}),Ob(this,Nb,{writable:!0,value:void 0}),Ob(this,Wg,{writable:!0,value:void 0}),Lg(this,Nb,new Map([["all",new eCe(Db(this,oE,o$).bind(this))],["last",new iCe(Db(this,oE,o$).bind(this))]])),Lg(this,Wg,"none"),Lg(this,Ro,e),Lg(this,lu,hn(this,Ro).columnIndexMapper.createAndRegisterIndexMap(aCe,"physicalIndexToValue"))}}function hCe(){const{view:n,stylesHandler:e}=hn(this,Ro);if(n.isVerticallyScrollableByWindow())return!1;const t=n.getViewportHeight(),o=hn(this,Ro).countRows(),i=e.getDefaultRowHeight();let s=0,r=!1;for(let a=0;a<o;a++)if(!hn(this,Ro).rowIndexMapper.isHidden(hn(this,Ro).toPhysicalRow(a))&&(s+=hn(this,Ro).getRowHeight(a)??i,s>t)){r=!0;break}return r}function cCe(n){return hn(this,Ro).getColWidth(n,"StretchColumns")??nf}function o$(n,e){return hn(this,Ro).runHooks("beforeStretchingColumnWidth",n,e)}function qY(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function dCe(n,e){return e.get?e.get.call(n):e.value}function uCe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function KY(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Pa(n,e){var t=KY(n,e,"get");return dCe(n,t)}function iE(n,e,t){qY(n,e),e.set(n,t)}function hu(n,e,t){var o=KY(n,e,"set");return uCe(n,o,t),t}function i$(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function s$(n,e){qY(n,e),e.add(n)}const fCe="stretchColumns",gCe=155;var bc=new WeakMap,$g=new WeakMap,cu=new WeakMap,r$=new WeakSet,a$=new WeakSet;class pCe extends at{static get PLUGIN_KEY(){return fCe}static get PLUGIN_PRIORITY(){return gCe}static get SETTING_KEYS(){return!0}isEnabled(){return["all","last"].includes(this.hot.getSettings().stretchH)}enablePlugin(){this.enabled||(Pa(this,bc).useStrategy(this.hot.getSettings().stretchH),Pa(this,cu).observe(this.hot.rootElement),this.addHook("beforeRender",(...e)=>i$(this,a$,wCe).call(this,...e)),this.addHook("modifyColWidth",(...e)=>i$(this,r$,mCe).call(this,...e),10),super.enablePlugin())}updatePlugin(){Pa(this,bc).useStrategy(this.hot.getSettings().stretchH),super.updatePlugin()}disablePlugin(){super.disablePlugin(),Pa(this,cu).unobserve(this.hot.rootElement)}getColumnWidth(e){return Pa(this,bc).getStretchedWidth(e)}destroy(){Pa(this,cu).disconnect(),hu(this,cu,null),hu(this,bc,null),super.destroy()}constructor(...e){super(...e),s$(this,r$),s$(this,a$),iE(this,bc,{writable:!0,value:void 0}),iE(this,$g,{writable:!0,value:void 0}),iE(this,cu,{writable:!0,value:void 0}),hu(this,bc,new lCe(this.hot)),hu(this,$g,null),hu(this,cu,new ResizeObserver(t=>{requestAnimationFrame(()=>{this.hot?.view.isHorizontallyScrollableByWindow()&&t.forEach(({contentRect:o})=>{Pa(this,$g)!==null&&Pa(this,$g)!==o.width&&(this.hot.view.adjustElementsSize(),this.hot.refreshDimensions()),hu(this,$g,o.width)})})}))}}function mCe(n,e,t){if(t===this.pluginName)return;const o=this.getColumnWidth(e);return typeof o=="number"?o:n}function wCe(n){n&&Pa(this,bc).refreshStretching()}function bCe(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function sE(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function rE(n,e){bCe(n,e),e.add(n)}const CCe="touchScroll",yCe=200;var l$=new WeakSet,h$=new WeakSet,c$=new WeakSet;class _Ce extends at{static get PLUGIN_KEY(){return CCe}static get PLUGIN_PRIORITY(){return yCe}static get SETTING_KEYS(){return!0}isEnabled(){return hF()}enablePlugin(){this.enabled||(this.addHook("afterViewRender",()=>sE(this,l$,SCe).call(this)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.lockedCollection=!1,super.updatePlugin()}disablePlugin(){super.disablePlugin()}registerEvents(){this.addHook("beforeTouchScroll",()=>sE(this,h$,vCe).call(this)),this.addHook("afterMomentumScroll",()=>sE(this,c$,RCe).call(this))}constructor(...e){super(...e),rE(this,l$),rE(this,h$),rE(this,c$),this.scrollbars=[],this.clones=[],this.lockedCollection=!1,this.freezeOverlays=!1}}function SCe(){if(this.lockedCollection)return;const{topOverlay:n,bottomOverlay:e,inlineStartOverlay:t,topInlineStartCornerOverlay:o,bottomInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;this.lockedCollection=!0,this.scrollbars.length=0,this.scrollbars.push(n),e.clone&&this.scrollbars.push(e),this.scrollbars.push(t),o&&this.scrollbars.push(o),i&&i.clone&&this.scrollbars.push(i),this.clones=[],n.needFullRender&&this.clones.push(n.clone.wtTable.holder.parentNode),e.needFullRender&&this.clones.push(e.clone.wtTable.holder.parentNode),t.needFullRender&&this.clones.push(t.clone.wtTable.holder.parentNode),o&&this.clones.push(o.clone.wtTable.holder.parentNode),i&&i.clone&&this.clones.push(i.clone.wtTable.holder.parentNode)}function vCe(){this.freezeOverlays=!0,O(this.clones,n=>{V(n,"hide-tween")})}function RCe(){this.freezeOverlays=!1,O(this.clones,n=>{re(n,"hide-tween"),V(n,"show-tween")}),this.hot._registerTimeout(()=>{O(this.clones,n=>{re(n,"show-tween")})},400),O(this.scrollbars,n=>{n.refresh(),n.resetFixedPosition()}),this.hot.view._wt.wtOverlays.syncScrollWithMaster()}function ECe(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function kCe(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function TCe(n,e){ECe(n,e),e.add(n)}const yp="trimRows",xCe=330;var d$=new WeakSet;class MCe extends at{static get PLUGIN_KEY(){return yp}static get PLUGIN_PRIORITY(){return xCe}static get SETTING_KEYS(){return[yp]}isEnabled(){return!!this.hot.getSettings()[yp]}enablePlugin(){this.enabled||(this.trimmedRowsMap=this.hot.rowIndexMapper.registerMap("trimRows",new of),this.trimmedRowsMap.addLocalHook("init",()=>kCe(this,d$,ICe).call(this)),super.enablePlugin())}updatePlugin(){const e=this.hot.getSettings()[yp];Array.isArray(e)&&this.hot.batchExecution(()=>{this.trimmedRowsMap.clear(),O(e,t=>{this.trimmedRowsMap.setValueAtIndex(t,!0)})},!0),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("trimRows"),super.disablePlugin()}getTrimmedRows(){return this.trimmedRowsMap.getTrimmedIndexes()}trimRows(e){const t=this.getTrimmedRows(),o=this.isValidConfig(e);let i=t;o&&(i=Array.from(new Set(t.concat(e)))),this.hot.runHooks("beforeTrimRow",t,i,o)!==!1&&(o&&this.hot.batchExecution(()=>{O(e,r=>{this.trimmedRowsMap.setValueAtIndex(r,!0)})},!0),this.hot.runHooks("afterTrimRow",t,i,o,o&&i.length>t.length))}trimRow(...e){this.trimRows(e)}untrimRows(e){const t=this.getTrimmedRows(),o=this.isValidConfig(e);let i=t;const s=this.trimmedRowsMap.getValues().slice(),r=e.length>0;o&&r&&(O(e,l=>{s[l]=!1}),i=Fi(s,(l,h,c)=>(h&&l.push(c),l),[])),this.hot.runHooks("beforeUntrimRow",t,i,o&&r)!==!1&&(o&&r&&this.trimmedRowsMap.setValues(s),this.hot.runHooks("afterUntrimRow",t,i,o&&r,o&&i.length<t.length))}untrimRow(...e){this.untrimRows(e)}isTrimmed(e){return this.trimmedRowsMap.getValueAtIndex(e)||!1}untrimAll(){this.untrimRows(this.getTrimmedRows())}isValidConfig(e){const t=this.hot.countSourceRows();return e.every(o=>Number.isInteger(o)&&o>=0&&o<t)}destroy(){super.destroy()}constructor(...e){super(...e),TCe(this,d$),this.trimmedRowsMap=null}}function ICe(){const n=this.hot.getSettings()[yp];Array.isArray(n)&&this.hot.batchExecution(()=>{O(n,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0)}class Is{undo(){Y("Not implemented")}redo(){Y("Not implemented")}constructor(e){this.actionType="",this.actionType=e}}class qM extends Is{static startRegisteringEvents(e,t){e.addHook("beforeCellAlignment",(o,i,s,r)=>{t.done(()=>new qM({stateBefore:o,range:i,type:s,alignment:r}))})}undo(e,t){O(this.range,o=>{o.forAll((i,s)=>{i>=0&&s>=0&&e.setCellMeta(i,s,"className",this.stateBefore[i][s]||" htLeft")})}),e.addHookOnce("afterViewRender",t),e.render()}redo(e,t){jl(this.range,this.type,this.alignment,(o,i)=>e.getCellMeta(o,i),(o,i,s,r)=>e.setCellMeta(o,i,s,r)),e.addHookOnce("afterViewRender",t),e.render()}constructor({stateBefore:e,range:t,type:o,alignment:i}){super("cell_alignment"),this.stateBefore=e,this.range=t,this.type=o,this.alignment=i}}class KM extends Is{static startRegisteringEvents(e,t){e.addHook("beforeColumnMove",(o,i)=>{o!==!1&&t.done(()=>new KM({columns:o,finalIndex:i}))})}undo(e,t){const o=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",t),BM(this.columns,this.finalColumnIndex,e.columnIndexMapper.getNumberOfIndexes()).reverse().forEach(({from:s,to:r})=>{s<r&&(r-=1),o.moveColumn(r,s)}),e.render(),e.deselectCell(),e.selectColumns(this.columns[0],this.columns[0]+this.columns.length-1)}redo(e,t){const o=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",t),o.moveColumns(this.columns.slice(),this.finalColumnIndex),e.render(),e.deselectCell(),e.selectColumns(this.finalColumnIndex,this.finalColumnIndex+this.columns.length-1)}constructor({columns:e,finalIndex:t}){super("col_move"),this.columns=e.slice(),this.finalColumnIndex=t}}class XM extends Is{static startRegisteringEvents(e,t){e.addHook("beforeColumnSort",(o,i,s)=>{s&&t.done(()=>new XM({currentSortState:o,newSortState:i}))})}undo(e,t){const o=e.getPlugin("columnSorting"),i=e.getPlugin("multiColumnSorting"),s=i.isEnabled()?i:o;this.previousSortState.length?s.sort(this.previousSortState):s.clearSort(),t()}redo(e,t){const o=e.getPlugin("columnSorting"),i=e.getPlugin("multiColumnSorting");(i.isEnabled()?i:o).sort(this.nextSortState),t()}constructor({currentSortState:e,newSortState:t}){super("col_sort"),this.previousSortState=e,this.nextSortState=t}}class ZM extends Is{static startRegisteringEvents(e,t){e.addHook("afterCreateCol",(o,i,s)=>{t.done(()=>new ZM({index:o,amount:i}),s)})}undo(e,t){e.addHookOnce("afterRemoveCol",t),e.alter("remove_col",this.index,this.amount,"UndoRedo.undo")}redo(e,t){e.addHookOnce("afterCreateCol",t),e.alter("insert_col_start",this.index,this.amount,"UndoRedo.redo")}constructor({index:e,amount:t}){super("insert_col"),this.index=e,this.amount=t}}class QM extends Is{static startRegisteringEvents(e,t){e.addHook("afterCreateRow",(o,i,s)=>{t.done(()=>new QM({index:o,amount:i}),s)})}undo(e,t){const o=e.countRows(),i=e.getSettings().minSpareRows;this.index>=o&&this.index-i<o&&(this.index-=i),e.addHookOnce("afterRemoveRow",t),e.alter("remove_row",this.index,this.amount,"UndoRedo.undo")}redo(e,t){e.addHookOnce("afterCreateRow",t),e.alter("insert_row_above",this.index,this.amount,"UndoRedo.redo")}constructor({index:e,amount:t}){super("insert_row"),this.index=e,this.amount=t}}class JM extends Is{static startRegisteringEvents(e,t){e.addHook("beforeChange",function(o,i){const s=o&&o.length;if(!s)return;o.find(a=>{if(a===null)return!1;const[,,l,h]=a;return l!==h});const r=()=>{const a=o.reduce((h,c)=>(c!==null&&h.push([...c]),h),[]);if(a.length===0)return null;a.forEach(h=>{h[1]=e.propToCol(h[1])});const l=s>1?this.getSelected():[[a[0][0],a[0][1]]];return new JM({changes:a,selected:l,countCols:e.countCols(),countRows:e.countRows()})};t.done(r,i)},t.constructor.PLUGIN_PRIORITY)}undo(e,t){const o=Jn(this.changes);for(let i=0,s=o.length;i<s;i++)o[i].splice(3,1);e.addHookOnce("afterChange",()=>{const i=e.countRows()-this.countRows;i>0&&e.alter("remove_row",null,i,"UndoRedo.undo");const s=e.countCols()-this.countCols;s>0&&e.isColumnModificationAllowed()&&e.alter("remove_col",null,s,"UndoRedo.undo"),e.scrollToFocusedCell(),e.selectCells(this.selected,!1,!1),t()}),e.setDataAtCell(o,null,null,"UndoRedo.undo")}redo(e,t){const o=Jn(this.changes);for(let i=0,s=o.length;i<s;i++)o[i].splice(2,1);e.addHookOnce("afterChange",()=>{e.selectCells(this.selected,!1,!1),t()}),e.setDataAtCell(o,null,null,"UndoRedo.redo")}constructor({changes:e,selected:t,countCols:o,countRows:i}){super("change"),this.changes=e,this.selected=t,this.countCols=o,this.countRows=i}}class eI extends Is{static startRegisteringEvents(e,t){e.addHook("beforeFilter",(o,i)=>{t.done(()=>new eI({conditionsStack:o,previousConditionsStack:i}))})}undo(e,t){const o=e.getPlugin("filters");e.addHookOnce("afterViewRender",t),o.importConditions(this.previousConditionsStack),o.filter()}redo(e,t){const o=e.getPlugin("filters");e.addHookOnce("afterViewRender",t),o.importConditions(this.conditionsStack),o.filter()}constructor({conditionsStack:e,previousConditionsStack:t}){super("filter"),this.conditionsStack=e,this.previousConditionsStack=t}}class tI extends Is{static startRegisteringEvents(e,t){e.addHook("beforeMergeCells",(o,i)=>{if(i)return;const s=o.getTopStartCorner(),r=o.getBottomEndCorner(),a=e.getData(s.row,s.col,r.row,r.col);t.done(()=>new tI({data:a,cellRange:o}))})}undo(e,t){const o=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",t),o.unmergeRange(this.cellRange,!0);const i=this.cellRange.getTopStartCorner();e.populateFromArray(i.row,i.col,this.data,void 0,void 0,"MergeCells")}redo(e,t){const o=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",t),o.mergeRange(this.cellRange)}constructor({data:e,cellRange:t}){super("merge_cells"),this.cellRange=t,this.data=e}}function XY(n,e,t,o,i){const s=[];return Re(o,i,r=>{Re(e,t,a=>{const l=n.getCellMeta(a,r);s.push([l.visualRow,l.visualCol,l])})}),s}class nI extends Is{static startRegisteringEvents(e,t){e.addHook("beforeRemoveCol",(o,i,s,r)=>{const a=()=>{const l=e.getSourceDataArray(),h=(e.countCols()+o)%e.countCols(),c=h+i-1,d=[],u=[],f=[];return Re(l.length-1,p=>{const C=[],y=l[p];Re(h,c,_=>{C.push(y[e.toPhysicalColumn(_)])}),d.push(C)}),Re(i-1,p=>{f.push(e.toPhysicalColumn(h+p))}),Array.isArray(e.getSettings().colHeaders)&&Re(i-1,p=>{u.push(e.getSettings().colHeaders[e.toPhysicalColumn(h+p)]||null)}),new nI({index:h,indexes:f,data:d,amount:i,headers:u,columnPositions:e.columnIndexMapper.getIndexesSequence(),rowPositions:e.rowIndexMapper.getIndexesSequence(),fixedColumnsStart:e.getSettings().fixedColumnsStart,removedCellMetas:XY(e,0,e.countRows(),h,c)})};t.done(a,r)})}undo(e,t){const o=e.getSettings();o.fixedColumnsStart=this.fixedColumnsStart;const i=this.indexes.slice(0).sort(),s=(c,d,u)=>u[this.indexes.indexOf(i[d])],r=this.data.length,a=[];for(let c=0;c<r;c++)a.push(Mt(this.data[c],s));const l=Mt(this.headers,s),h=[];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),O(e.getSourceDataArray(),(c,d)=>{O(i,(u,f)=>{c[u]=a[d][f],h.push([d,u,c[u]])})}),typeof this.headers<"u"&&O(l,(c,d)=>{e.getSettings().colHeaders[i[d]]=c}),this.removedCellMetas.forEach(([c,d,u])=>{e.setCellMetaObject(c,d,u)}),e.addHookOnce("afterViewRender",t),e.setSourceDataAtCell(h,null,null,"UndoRedo.undo")}redo(e,t){e.addHookOnce("afterRemoveCol",t),e.alter("remove_col",this.index,this.amount,"UndoRedo.redo")}constructor({index:e,indexes:t,data:o,amount:i,headers:s,columnPositions:r,rowPositions:a,fixedColumnsStart:l,removedCellMetas:h}){super("remove_col"),this.index=e,this.indexes=t,this.data=o,this.amount=i,this.headers=s,this.columnPositions=r.slice(0),this.rowPositions=a.slice(0),this.fixedColumnsStart=l,this.removedCellMetas=h}}class oI extends Is{static startRegisteringEvents(e,t){e.addHook("beforeRemoveRow",(o,i,s,r)=>{const a=()=>{const l=e.toPhysicalRow(o),h=l+i-1,c=Jn(e.getSourceData(l,0,l+i-1,e.countSourceCols()-1));return new oI({index:l,data:c,fixedRowsBottom:e.getSettings().fixedRowsBottom,fixedRowsTop:e.getSettings().fixedRowsTop,rowIndexesSequence:e.rowIndexMapper.getIndexesSequence(),removedCellMetas:XY(e,l,h,0,e.countCols()-1)})};t.done(a,r)})}undo(e,t){const o=e.getSettings(),i=[];o.fixedRowsBottom=this.fixedRowsBottom,o.fixedRowsTop=this.fixedRowsTop,this.data.forEach((s,r)=>{Object.keys(s).forEach(a=>{const l=parseInt(a,10);i.push([this.index+r,isNaN(l)?a:l,s[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(([s,r,a])=>{e.setCellMetaObject(s,r,a)}),e.addHookOnce("afterViewRender",t),e.setSourceDataAtCell(i,null,null,"UndoRedo.undo")}redo(e,t){e.addHookOnce("afterRemoveRow",t),e.alter("remove_row",e.toVisualRow(this.index),this.data.length,"UndoRedo.redo")}constructor({index:e,data:t,fixedRowsBottom:o,fixedRowsTop:i,rowIndexesSequence:s,removedCellMetas:r}){super("remove_row"),this.index=e,this.data=t,this.fixedRowsBottom=o,this.fixedRowsTop=i,this.rowIndexesSequence=s,this.removedCellMetas=r}}class iI extends Is{static startRegisteringEvents(e,t){e.addHook("beforeRowMove",(o,i)=>{o!==!1&&t.done(()=>new iI({rows:o,finalIndex:i}))})}undo(e,t){const o=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",t),BM(this.rows,this.finalRowIndex,e.rowIndexMapper.getNumberOfIndexes()).reverse().forEach(({from:s,to:r})=>{s<r&&(r-=1),o.moveRow(r,s)}),e.render(),e.deselectCell(),e.selectRows(this.rows[0],this.rows[0]+this.rows.length-1)}redo(e,t){const o=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",t),o.moveRows(this.rows.slice(),this.finalRowIndex),e.render(),e.deselectCell(),e.selectRows(this.finalRowIndex,this.finalRowIndex+this.rows.length-1)}constructor({rows:e,finalIndex:t}){super("row_move"),this.rows=e.slice(),this.finalRowIndex=t}}class sI extends Is{static startRegisteringEvents(e,t){e.addHook("afterUnmergeCells",(o,i)=>{i||t.done(()=>new sI({cellRange:o}))})}undo(e,t){const o=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",t),o.mergeRange(this.cellRange,!0)}redo(e,t){const o=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",t),o.unmergeRange(this.cellRange,!0),e.render()}constructor({cellRange:e}){super("unmerge_cells"),this.cellRange=e}}function HCe(n,e){[qM,KM,XM,ZM,QM,JM,eI,tI,nI,oI,iI,sI].forEach(t=>t.startRegisteringEvents(n,e))}function ACe(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function OCe(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function DCe(n,e){ACe(n,e),e.add(n)}const u$="undoRedo",NCe="undoRedo",PCe=1e3;de.getSingleton().register("beforeUndo");de.getSingleton().register("afterUndo");de.getSingleton().register("beforeRedo");de.getSingleton().register("afterRedo");var f$=new WeakSet;class LCe extends at{static get PLUGIN_KEY(){return NCe}static get PLUGIN_PRIORITY(){return PCe}static get SETTING_KEYS(){return!0}isEnabled(){return!!this.hot.getSettings().undo}enablePlugin(){this.enabled||(this.addHook("afterChange",(...e)=>OCe(this,f$,WCe).call(this,...e)),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){super.disablePlugin(),this.clear(),this.unregisterShortcuts()}registerShortcuts(){const t=this.hot.getShortcutManager().getContext("grid"),i={runOnlyIf:s=>!s.altKey,group:u$};t.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(u$)}done(e,t){if(this.ignoreNewActions||t==="UndoRedo.undo"||t==="UndoRedo.redo"||t==="auto")return;const i=this.doneActions.slice();if(this.hot.runHooks("beforeUndoStackChange",i,t)===!1)return;const r=e(),a=this.undoneActions.slice();r!==null&&this.doneActions.push(r),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 t=this.doneActions.pop();this.hot.runHooks("afterUndoStackChange",e,this.doneActions.slice());const o=Jn(t);if(this.hot.runHooks("beforeUndo",o)===!1)return;this.ignoreNewActions=!0;const s=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",s),t.undo(this.hot,()=>{this.ignoreNewActions=!1,this.undoneActions.push(t)}),this.hot.runHooks("afterRedoStackChange",s,this.undoneActions.slice()),this.hot.runHooks("afterUndo",o)}redo(){if(!this.isRedoAvailable())return;const e=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",e);const t=this.undoneActions.pop();this.hot.runHooks("afterRedoStackChange",e,this.undoneActions.slice());const o=Jn(t);if(this.hot.runHooks("beforeRedo",o)===!1)return;this.ignoreNewActions=!0;const s=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",s),t.redo(this.hot,()=>{this.ignoreNewActions=!1,this.doneActions.push(t)}),this.hot.runHooks("afterUndoStackChange",s,this.doneActions.slice()),this.hot.runHooks("afterRedo",o)}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()}constructor(e){super(e),DCe(this,f$),this.doneActions=[],this.undoneActions=[],this.ignoreNewActions=!1,HCe(e,this)}}function WCe(n,e){e==="loadData"&&this.clear()}const ko="ht-dialog";function $Ce(){function n(){return`
291
- <div data-ref="contentElement" class="${ko}__content"></div>
292
- `}let e=null;const t={};function o(){const s=jc`${n()}`;return Object.assign(t,s.refs),e=s.fragment,s}function i(){return e===null&&Y("Compile the template first."),[]}return{TEMPLATE_NAME:"base",dialogA11YOptions(){return{role:"dialog"}},compile:o,focusableElements:i}}function FCe({id:n="",title:e="",description:t="",buttons:o=[]}){function i(){return`
293
- <div tabindex="-1" data-ref="contentElement" class="${ko}__content-wrapper-inner">
294
- <div class="${ko}__content">
295
- <h2
296
- id="${n}-dialog-confirm-title"
297
- class="${ko}__title">${gr(e)}</h2>
298
- <p
299
- id="${n}-dialog-confirm-description"
300
- class="${ko}__description">${gr(t)}</p>
301
- </div>
302
- ${o.length>0?`
303
- <div data-ref="buttonsContainer" class="${ko}__buttons">
304
- ${o.map(h=>`
305
- <button class="ht-button ht-button--${h.type}">${gr(h.text)}</button>
306
- `).join("")}
307
- </div>
308
- `:""}
309
- </div>
310
- `}let s=null;const r={};function a(){const h=jc`${i()}`;return Object.assign(r,h.refs),s=h.fragment,h}function l(){s===null&&Y("Compile the template first.");const{contentElement:h,buttonsContainer:c}=r,d=[];return c?d.push(...Array.from(c.children)):d.push(h),d}return{TEMPLATE_NAME:"confirm",dialogA11YOptions(){return{role:"alertdialog",ariaLabelledby:`${n}-dialog-confirm-title`,ariaDescribedby:t?`${n}-dialog-confirm-description`:void 0}},compile:a,focusableElements:l}}const Fg=new Map([["base",$Ce],["confirm",FCe]]);function ZY(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function BCe(n,e){return e.get?e.get.call(n):e.value}function VCe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function QY(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Zt(n,e){var t=QY(n,e,"get");return BCe(n,t)}function lc(n,e,t){ZY(n,e),e.set(n,t)}function zo(n,e,t){var o=QY(n,e,"set");return VCe(n,o,t),t}function g$(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function p$(n,e){ZY(n,e),e.add(n)}const zCe=`
311
- <div data-ref="dialogElement" class="${ko}">
312
- <div data-ref="dialogWrapperElement" class="${ko}__content-wrapper">
313
- </div>
314
- `;var aE=new WeakMap,Uo=new WeakMap,Pb=new WeakMap,Au=new WeakMap,js=new WeakMap,Bg=new WeakMap,lE=new WeakMap,m$=new WeakSet,w$=new WeakSet;class JY{useTemplate(e,t={}){if(!Fg.has(e)||e==="base"){const o=Array.from(Fg.keys()).filter(i=>i!=="base").join(", ");Y(pt`Invalid template: ${e}.\x20
315
- Valid templates are: ${o}.`)}zo(this,js,Fg.get(e)(t)),zo(this,Bg,(t.buttons??[]).map(o=>o.callback))}useDefaultTemplate(){zo(this,js,Fg.get("base")()),zo(this,Bg,[])}install(){if(Zt(this,Uo)?.dialogElement)return;const e=jc`${zCe}`;zo(this,Uo,e.refs);const{dialogElement:t}=Zt(this,Uo);fe(t,[C4(),["dir",Zt(this,Pb)?"rtl":"ltr"]]),t.addEventListener("transitionstart",()=>g$(this,w$,YCe).call(this)),t.addEventListener("transitionend",()=>g$(this,m$,UCe).call(this)),Zt(this,aE).after(e.fragment)}getContainer(){return Zt(this,Uo).dialogElement}getFocusableElements(){return Zt(this,js).focusableElements()}updateDialog({isVisible:e,content:t,customClassName:o,background:i,contentBackground:s,animation:r,a11y:a}){const l=Zt(this,js).compile(),{dialogElement:h,dialogWrapperElement:c}=Zt(this,Uo);c.innerHTML="",c.appendChild(l.fragment),Object.assign(Zt(this,Uo),l.refs);const{contentElement:d,buttonsContainer:u}=Zt(this,Uo);Zt(this,js).TEMPLATE_NAME!=="base"&&Object.assign(a,Zt(this,js).dialogA11YOptions());const f=o?` ${o}`:"",p=i?` ${ko}--background-${i}`:"",C=r?` ${ko}--animation`:"",y=e?` ${ko}--show`:"";h.className=[ko,`${ko}--${Zt(this,js).TEMPLATE_NAME}`,"handsontable",f,p,C,y].join(" "),fe(h,[Zt(this,js).TEMPLATE_NAME==="base"?wr(-1):void 0]),fe(h,[a.role==="alertdialog"?o4():n4()]),a.ariaLabel&&!a.ariaLabelledby?fe(h,[a.ariaLabel?Pi(a.ariaLabel):void 0]):ta(h,"aria-label"),a.ariaLabelledby?fe(h,[l4(a.ariaLabelledby)]):ta(h,"aria-labelledby"),a.ariaDescribedby?fe(h,[h4(a.ariaDescribedby)]):ta(h,"aria-describedby");const _=s?` ${ko}__content--background`:"";return V(d,`${ko}__content${_}`),Zt(this,js).TEMPLATE_NAME==="base"?(d.innerHTML="",typeof t=="string"?id(d,t,Zt(this,lE)):(t instanceof HTMLElement||t instanceof DocumentFragment)&&d.appendChild(t)):u&&Array.from(u.children).forEach((T,P)=>{const $=Zt(this,Bg)[P];$&&T.addEventListener("click",$)}),this}showDialog(e){const{dialogElement:t}=Zt(this,Uo);return t.style.display="block",e&&t.offsetHeight,V(t,`${ko}--show`),zo(this,Au,!1),this}hideDialog(e){const{dialogElement:t}=Zt(this,Uo);return re(t,`${ko}--show`),(e&&!Zt(this,Au)||!e)&&(t.style.display="none"),zo(this,Au,!1),this}focusDialog(){Zt(this,Uo).dialogElement.focus()}updateWidth(e){return Zt(this,Uo).dialogElement.style.width=`${e}px`,this}updateHeight(e){return Zt(this,Uo).dialogElement.style.height=`calc(100% - ${e}px)`,this}destroyDialog(){Zt(this,Uo)?.dialogElement.remove(),zo(this,Uo,null)}constructor({rootElement:e,isRtl:t,sanitizer:o}){p$(this,m$),p$(this,w$),lc(this,aE,{writable:!0,value:void 0}),lc(this,Uo,{writable:!0,value:void 0}),lc(this,Pb,{writable:!0,value:void 0}),lc(this,Au,{writable:!0,value:void 0}),lc(this,js,{writable:!0,value:void 0}),lc(this,Bg,{writable:!0,value:void 0}),lc(this,lE,{writable:!0,value:void 0}),zo(this,Pb,!1),zo(this,Au,!1),zo(this,js,Fg.get("base")),zo(this,Bg,[]),zo(this,aE,e),zo(this,Pb,t),zo(this,lE,o),this.install()}}function UCe(){const{dialogElement:n}=Zt(this,Uo);Se(n,`${ko}--show`)||(n.style.display="none")}function YCe(){zo(this,Au,!0)}_t(JY,Bn);function e6(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function GCe(n,e){return e.get?e.get.call(n):e.value}function jCe(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function t6(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Eo(n,e){var t=t6(n,e,"get");return GCe(n,t)}function hE(n,e,t){e6(n,e),e.set(n,t)}function fs(n,e,t){var o=t6(n,e,"set");return jCe(n,o,t),t}function Vg(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function zg(n,e){e6(n,e),e.add(n)}const ch="dialog",qCe=360,Y0=ch,Oy=`plugin:${ch}`;var vo=new WeakMap,Cc=new WeakMap,zl=new WeakMap,b$=new WeakSet,C$=new WeakSet,y$=new WeakSet,_$=new WeakSet,S$=new WeakSet;class Dy extends at{static get PLUGIN_KEY(){return ch}static get PLUGIN_PRIORITY(){return qCe}static get DEFAULT_SETTINGS(){return{template:null,content:"",customClassName:"",background:"solid",contentBackground:!1,animation:!0,closable:!1,a11y:{role:"dialog",ariaLabel:"Dialog",ariaLabelledby:"",ariaDescribedby:""}}}static get SETTINGS_VALIDATORS(){return{template:e=>ie(e)&&typeof["alert","confirm"].includes(e.type)&&typeof e.title=="string"&&(typeof e?.description>"u"||typeof e?.description=="string")&&(typeof e?.buttons>"u"||Array.isArray(e?.buttons)&&e.buttons.every(t=>typeof t=="object"&&typeof t.text=="string"&&["primary","secondary"].includes(t.type)&&(typeof t.callback>"u"||typeof t.callback=="function"))),content:e=>typeof e=="string"||typeof HTMLElement<"u"&&e instanceof HTMLElement||typeof DocumentFragment<"u"&&e instanceof DocumentFragment,customClassName:e=>typeof e=="string",background:e=>["solid","semi-transparent"].includes(e),contentBackground:e=>typeof e=="boolean",animation:e=>typeof e=="boolean",closable:e=>typeof e=="boolean",a11y:e=>ie(e)&&(typeof e?.role>"u"||["dialog","alertdialog"].includes(e?.role))&&(typeof e?.ariaLabel>"u"||typeof e?.ariaLabel=="string")&&(typeof e?.ariaLabelledby>"u"||typeof e?.ariaLabelledby=="string")&&(typeof e?.ariaDescribedby>"u"||typeof e?.ariaDescribedby=="string")}}isEnabled(){return!!this.hot.getSettings()[ch]}enablePlugin(){this.enabled||(Eo(this,vo)||fs(this,vo,new JY({rootElement:this.hot.rootGridElement,sanitizer:this.hot.getSettings().sanitizer,isRtl:this.hot.isRtl()})),Vg(this,b$,KCe).call(this),Vg(this,y$,ZCe).call(this),this.addHook("afterViewRender",()=>Vg(this,S$,JCe).call(this)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hide(),Vg(this,C$,XCe).call(this),Vg(this,_$,QCe).call(this),super.disablePlugin()}isVisible(){return Eo(this,Cc)}show(e={}){if(this.enabled){if(this.isVisible()){this.update(e);return}this.hot.runHooks("beforeDialogShow"),this.update(e),Eo(this,vo).showDialog(this.getSetting("animation")),fs(this,Cc,!0),this.hot.getFocusScopeManager().activateScope(ch),fs(this,zl,this.hot.selection.exportSelection()),this.hot.deselectCell(),this.hot.runHooks("afterDialogShow")}}hide(){this.isVisible()&&(this.hot.runHooks("beforeDialogHide"),Eo(this,vo).hideDialog(this.getSetting("animation")),fs(this,Cc,!1),this.hot.getFocusScopeManager().deactivateScope(ch),Eo(this,zl)?.ranges.length>0?(this.hot.selection.importSelection(Eo(this,zl)),this.hot.view.render(),fs(this,zl,null)):(this.hot.view.render(),fs(this,zl,null)),this.hot.runHooks("afterDialogHide"))}update(e){if(!this.enabled)return;this.updatePluginSettings(e);const t=this.getSetting("template");t!==Dy.DEFAULT_SETTINGS.template&&this.getSetting("content")!==Dy.DEFAULT_SETTINGS.content&&Y("The `template` option cannot be used together with the `content` option."),t?Eo(this,vo).useTemplate(t.type,{id:this.hot.guid,...t}):Eo(this,vo).useDefaultTemplate(),Eo(this,vo).updateDialog({isVisible:this.isVisible(),content:this.getSetting("content"),customClassName:this.getSetting("customClassName"),background:this.getSetting("background"),contentBackground:this.getSetting("contentBackground"),animation:this.getSetting("animation"),a11y:this.getSetting("a11y")})}showAlert(e,t){const{title:o="Alert",description:i}=ie(e)?e:{title:e};this.show({template:{type:"confirm",title:o,description:i,buttons:[{text:this.hot.getTranslatedPhrase(NC),type:"primary",callback:(...s)=>t?.(...s)}]},contentBackground:!1,background:"solid",animation:!0,closable:!1})}showConfirm(e,t,o){const{title:i="Confirm",description:s}=ie(e)?e:{title:e};this.show({template:{type:"confirm",title:i,description:s,buttons:[{text:this.hot.getTranslatedPhrase(Ok),type:"secondary",callback:(...r)=>o?.(...r)},{text:this.hot.getTranslatedPhrase(NC),type:"primary",callback:(...r)=>t?.(...r)}]},contentBackground:!0,background:"semi-transparent",animation:!0,closable:!1})}focus(){Eo(this,vo).focusDialog()}destroy(){Eo(this,vo)?.destroyDialog(),fs(this,vo,null),fs(this,Cc,!1),fs(this,zl,null),super.destroy()}constructor(...e){super(...e),zg(this,b$),zg(this,C$),zg(this,y$),zg(this,_$),zg(this,S$),hE(this,vo,{writable:!0,value:void 0}),hE(this,Cc,{writable:!0,value:void 0}),hE(this,zl,{writable:!0,value:void 0}),fs(this,vo,null),fs(this,Cc,!1),fs(this,zl,null)}}function KCe(){const n=this.hot.getShortcutManager(),e=n.getContext(Oy)??n.addContext(Oy);e.addShortcut({keys:[["Escape"]],callback:()=>{this.hide()},runOnlyIf:()=>Eo(this,Cc)&&this.getSetting("closable"),group:Y0}),e.addShortcut({keys:[["Shift","Tab"],["Tab"]],preventDefault:!1,callback:t=>{this.hot._registerTimeout(()=>{t.shiftKey?this.hot.runHooks("dialogFocusPreviousElement"):this.hot.runHooks("dialogFocusNextElement")})},group:Y0})}function XCe(){this.hot.getShortcutManager().getContext(Oy).removeShortcutsByGroup(Y0)}function ZCe(){this.hot.getFocusScopeManager().registerScope(ch,Eo(this,vo).getContainer(),{shortcutsContextName:Oy,type:"modal",runOnlyIf:()=>this.isVisible(),onActivate:n=>{const e=this.hot.isListening(),t=Eo(this,vo).getFocusableElements();t.length>0?n==="tab_from_above"?t.at(0).focus():n==="tab_from_below"&&t.at(-1).focus():n!=="tab_from_above"&&n!=="tab_from_below"&&e&&!Eo(this,vo).getContainer().contains(this.hot.rootDocument.activeElement)&&Eo(this,vo).getContainer().focus(),e&&this.hot.runHooks("afterDialogFocus",n==="unknown"?"show":n)}})}function QCe(){this.hot.getFocusScopeManager().unregisterScope(ch)}function JCe(){const{view:n,rootWrapperElement:e,rootWindow:t}=this.hot,o=n.isHorizontallyScrollableByWindow()?n.getTotalTableWidth():n.getWorkspaceWidth();Eo(this,vo).updateWidth(o);const i=e.querySelector(".hot-display-license-info");if(i){const s=i.offsetHeight,r=Number.parseFloat(t.getComputedStyle(i).marginTop);Eo(this,vo).updateHeight(s+r)}}function eye({id:n,icon:e,title:t,description:o}){return`
316
- <div class="${Qi}__content">
317
- <i class="${Qi}__icon">${e}</i>
318
- <div class="${Qi}__text">
319
- <h2 id="${n}-${Bu}-title" class="${Qi}__title">${t}</h2>
320
- ${o?`<p id="${n}-${Bu}-description" class="${Qi}__description">${o}</p>`:""}
321
- </div>
322
- </div>
323
- `}function n6(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function tye(n,e){return e.get?e.get.call(n):e.value}function nye(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function o6(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Yi(n,e){var t=o6(n,e,"get");return tye(n,t)}function oye(n,e,t){n6(n,e),e.set(n,t)}function cE(n,e,t){var o=o6(n,e,"set");return nye(n,o,t),t}function iye(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function sye(n,e){n6(n,e),e.add(n)}const Bu="loading",rye=350;var Ao=new WeakMap,v$=new WeakSet;class aye extends at{static get PLUGIN_KEY(){return Bu}static get PLUGIN_PRIORITY(){return rye}static get DEFAULT_SETTINGS(){return{icon:`<svg class="${Qi}__icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path stroke="currentColor" stroke-width="2" d="M15 8a7 7 0 1 1-3.5-6.062"></path></svg>`,title:void 0,description:""}}static get SETTINGS_VALIDATORS(){return{icon:e=>typeof e=="string",title:e=>typeof e=="string",description:e=>typeof e=="string"}}isEnabled(){return!!this.hot.getSettings()[Bu]}enablePlugin(){this.enabled||(Yi(this,Ao)===null&&(cE(this,Ao,this.hot.getPlugin("dialog")),Yi(this,Ao)?.isEnabled()||(this.hot.getSettings().dialog=!0),this.hot.addHook("afterDialogFocus",()=>iye(this,v$,lye).call(this))),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hide(),super.disablePlugin()}isVisible(){return Yi(this,Ao)?.isVisible()??!1}show(e={}){if(!this.isEnabled()||!Yi(this,Ao)||!Yi(this,Ao)?.isEnabled())return;if(this.isVisible()){this.update(e);return}this.hot.runHooks("beforeLoadingShow")!==!1&&(this.update(e),Yi(this,Ao).show(),this.hot.runHooks("afterLoadingShow"))}hide(){!Yi(this,Ao)||!Yi(this,Ao)?.isEnabled()||!this.isVisible()||this.hot.runHooks("beforeLoadingHide")===!1||(Yi(this,Ao).hide(),this.hot.runHooks("afterLoadingHide"))}update(e){if(!this.isEnabled()||!Yi(this,Ao)||!Yi(this,Ao)?.isEnabled())return;this.updatePluginSettings(e);const t=this.hot.guid,o=this.getSetting("icon"),i=this.getSetting("title")??this.hot.getTranslatedPhrase(rx),s=this.getSetting("description"),r=eye({id:t,icon:o,title:i,description:s});Yi(this,Ao).update({content:r,customClassName:Qi,background:this.hot.countSourceRows()===0?"solid":"semi-transparent",a11y:{role:"alertdialog",ariaLabelledby:`${t}-${Bu}-title`,ariaDescribedby:s?`${t}-${Bu}-description`:void 0}})}destroy(){cE(this,Ao,null),super.destroy()}constructor(...e){super(...e),sye(this,v$),oye(this,Ao,{writable:!0,value:void 0}),cE(this,Ao,null)}}function lye(){Yi(this,Ao).focus()}const Gn="ht-notification",Ju=["top-start","top-end","bottom-start","bottom-end"],hye=["info","success","warning","error"];function cye(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function dye(n,e){return e.get?e.get.call(n):e.value}function uye(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function i6(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function Ri(n,e){var t=i6(n,e,"get");return dye(n,t)}function Ug(n,e,t){cye(n,e),e.set(n,t)}function Dr(n,e,t){var o=i6(n,e,"set");return uye(n,o,t),t}var du=new WeakMap,Lb=new WeakMap,Yg=new WeakMap,Oa=new WeakMap,Gg=new WeakMap;class P_{install(){if(Ri(this,Oa))return;const e=Ri(this,du).ownerDocument,t=e.createElement("div");t.className=`${Gn} handsontable`,t.setAttribute("dir",Ri(this,Yg)?"rtl":"ltr"),Ju.forEach(o=>{const i=e.createElement("div");i.className=`${Gn}__stack ${Gn}__stack--${o}`,i.dataset.htNotificationPosition=o,i.tabIndex=-1,t.appendChild(i),Ri(this,Gg).set(o,i)}),Ri(this,du).after(t),Dr(this,Oa,t)}getHost(){return Ri(this,Oa)}getStack(e){return Ri(this,Gg).get(e)}setRtl(e){Dr(this,Yg,e),Ri(this,Oa)&&Ri(this,Oa).setAttribute("dir",e?"rtl":"ltr")}setSanitizer(e){Dr(this,Lb,e)}createToastElement(e,t,o){const i=Ri(this,du).ownerDocument,s=i.createElement("div"),r=e.variant==="error";s.className=`${Gn}__toast ${Gn}__toast--${e.variant}`,s.dataset.htNotificationId=e.id,s.setAttribute("role",r?"alert":"status"),s.setAttribute("aria-live",r?"assertive":"polite"),s.setAttribute("aria-atomic","true"),o&&(s.classList.add(`${Gn}__toast--animate`),s.classList.add(e.position.startsWith("top")?`${Gn}__toast--stack-top`:`${Gn}__toast--stack-bottom`));const a=i.createElement("div");a.className=`${Gn}__toast-inner`;const l=i.createElement("div");l.className=`${Gn}__accent`,l.setAttribute("aria-hidden","true"),a.appendChild(l);const h=i.createElement("div");if(h.className=`${Gn}__body`,e.title){const u=i.createElement("div");u.className=`${Gn}__title`,u.textContent=gr(e.title),h.appendChild(u)}const c=i.createElement("div");if(c.className=`${Gn}__message`,typeof e.message=="string"?id(c,e.message,Ri(this,Lb)):c.appendChild(e.message),h.appendChild(c),e.actions?.length){const u=i.createElement("div");u.className=`${Gn}__actions`,e.actions.forEach((f,p)=>{const C=i.createElement("button");C.type="button",C.className=`ht-button ht-button--${f.type==="primary"?"primary":"secondary"}`,C.textContent=gr(f.label),C.dataset.htNotificationAction=String(p),u.appendChild(C)}),h.appendChild(u)}if(a.appendChild(h),e.closable){const u=i.createElement("button");u.type="button",u.className=`${Gn}__close`,u.setAttribute("aria-label",t),a.appendChild(u)}s.appendChild(a),s.tabIndex=-1,a.querySelectorAll("button").forEach(u=>{u.tabIndex=-1});const d=Ri(this,du).ownerDocument.defaultView;return o?d.requestAnimationFrame(()=>{d.requestAnimationFrame(()=>{s.classList.add(`${Gn}__toast--visible`)})}):s.classList.add(`${Gn}__toast--visible`),{element:s}}static getFocusables(e){const t=Array.from(e.querySelectorAll("button")).filter(o=>!o.disabled);return t.length>0?t:[e]}static setSequentialFocusWithinHost(e,t){if(!e)return;const o=t?0:-1;e.querySelectorAll(`.${Gn}__toast`).forEach(i=>{const s=Array.from(i.querySelectorAll("button")).filter(r=>!r.disabled);s.forEach(r=>{r.tabIndex=o}),s.length===0?i.tabIndex=o:i.tabIndex=-1})}destroy(){Ri(this,Oa)?.remove(),Dr(this,Oa,null),Ri(this,Gg).clear()}constructor({rootElement:e,sanitizer:t,isRtl:o}){Ug(this,du,{writable:!0,value:void 0}),Ug(this,Lb,{writable:!0,value:void 0}),Ug(this,Yg,{writable:!0,value:void 0}),Ug(this,Oa,{writable:!0,value:void 0}),Ug(this,Gg,{writable:!0,value:void 0}),Dr(this,Yg,!1),Dr(this,Oa,null),Dr(this,Gg,new Map),Dr(this,du,e),Dr(this,Lb,t),Dr(this,Yg,o)}}function s6(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fye(n,e){return e.get?e.get.call(n):e.value}function gye(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function r6(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function we(n,e){var t=r6(n,e,"get");return fye(n,t)}function qs(n,e,t){s6(n,e),e.set(n,t)}function ct(n,e,t){var o=r6(n,e,"set");return gye(n,o,t),t}function ve(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function lt(n,e){s6(n,e),e.add(n)}const ni="notification",pye=375,Ny=`plugin:${ni}`,a6=`plugin:${ni}:global`,Nc=ni,mye=new Set(Ju),wye=new Set(hye),l6=200;var Ft=new WeakMap,Wn=new WeakMap,ja=new WeakMap,Es=new WeakMap,el=new WeakMap,Kp=new WeakMap,df=new WeakMap,nd=new WeakMap,hc=new WeakMap,dE=new WeakSet,R$=new WeakSet,uE=new WeakMap,E$=new WeakSet,G0=new WeakSet,j0=new WeakSet,h6=new WeakSet,c6=new WeakSet,Om=new WeakSet,L_=new WeakSet,d6=new WeakSet,rI=new WeakSet,aI=new WeakSet,q0=new WeakSet,k$=new WeakSet,T$=new WeakSet,fE=new WeakSet,gE=new WeakMap,lI=new WeakSet,u6=new WeakSet,hI=new WeakSet,f6=new WeakSet,g6=new WeakSet,p6=new WeakSet,pE=new WeakSet,x$=new WeakSet,m6=new WeakSet,cI=new WeakSet,K0=new WeakSet,w6=new WeakSet,b6=new WeakSet,C6=new WeakSet,y6=new WeakSet,M$=new WeakSet,I$=new WeakSet,H$=new WeakSet,Dm=new WeakSet,_6=new WeakSet,X0=new WeakSet;class bye extends at{static get PLUGIN_KEY(){return ni}static get PLUGIN_PRIORITY(){return pye}static get DEFAULT_SETTINGS(){return{stackLimit:10,animation:!0}}static get SETTINGS_VALIDATORS(){return{stackLimit:e=>typeof e=="number"&&e>0&&Number.isInteger(e),animation:e=>typeof e=="boolean"}}isEnabled(){return!!this.hot.getSettings()[ni]}enablePlugin(){this.enabled||(we(this,Ft)||ct(this,Ft,new P_({rootElement:this.hot.rootGridElement,sanitizer:this.hot.getSettings().sanitizer,isRtl:this.hot.isRtl()})),we(this,Ft).install(),ve(this,k$,Rye).call(this),ve(this,T$,Eye).call(this),this.eventManager.addEventListener(this.hot.rootDocument,"focusin",we(this,gE),!0),this.addHook("afterUpdateSettings",we(this,uE)),this.eventManager.addEventListener(this.hot.rootDocument,"visibilitychange",()=>{ve(this,X0,M6).call(this)&&ve(this,Dm,$_).call(this)}),super.enablePlugin(),ct(this,hc,ve(this,dE,A$).call(this)))}updatePlugin(e){const t=ve(this,dE,A$).call(this);if(e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,ni)&&we(this,hc)!==null&&ve(this,R$,Cye).call(this,we(this,hc),t)){super.updatePlugin();return}this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hideAll(),ve(this,fE,D$).call(this),ve(this,pE,N$).call(this),super.disablePlugin(),we(this,Ft)?.destroy(),ct(this,Ft,null),ct(this,Es,null),ct(this,el,!1),ct(this,hc,null)}showMessage(e){if(!this.enabled)return"";const t=ve(this,E$,yye).call(this,e);if(this.hot.runHooks("beforeNotificationShow",t)===!1)return"";const o=this.getSetting("stackLimit");return ve(this,G0,S6).call(this,t.position)>=o?(we(this,ja)[t.position].push(t),t.id):(ve(this,j0,v6).call(this,t),t.id)}hide(e){if(!this.enabled||!e)return;const t=we(this,Wn).get(e);if(!t){ve(this,H$,Wye).call(this,e);return}if(this.hot.runHooks("beforeNotificationHide",e)===!1){t.durationMs>0&&t.remainingMs<=0&&(t.remainingMs=t.durationMs);return}const i=this.hot.rootDocument.activeElement,s=i instanceof this.hot.rootWindow.HTMLElement&&t.element.contains(i);ve(this,x$,Iye).call(this,t,!0),this.hot.runHooks("afterNotificationHide",e),ve(this,I$,Lye).call(this,t.options.position),ve(this,M$,Pye).call(this,s)}hideAll(){if(!this.enabled)return;Ju.forEach(t=>{we(this,ja)[t].length=0}),[...we(this,Wn).keys()].forEach(t=>this.hide(t))}isVisible(e){return e===void 0?we(this,Wn).size>0:we(this,Wn).has(e)}getQueueSize(){return Ju.reduce((e,t)=>e+we(this,ja)[t].length,0)}destroy(){Ju.forEach(e=>{we(this,ja)[e].length=0}),we(this,Wn).clear(),ve(this,fE,D$).call(this),ve(this,pE,N$).call(this),we(this,Ft)?.destroy(),ct(this,Ft,null),ct(this,Es,null),ct(this,el,!1),ct(this,hc,null),super.destroy()}constructor(...e){super(...e),lt(this,dE),lt(this,R$),lt(this,E$),lt(this,G0),lt(this,j0),lt(this,h6),lt(this,c6),lt(this,Om),lt(this,L_),lt(this,d6),lt(this,rI),lt(this,aI),lt(this,q0),lt(this,k$),lt(this,T$),lt(this,fE),lt(this,lI),lt(this,u6),lt(this,hI),lt(this,f6),lt(this,g6),lt(this,p6),lt(this,pE),lt(this,x$),lt(this,m6),lt(this,cI),lt(this,K0),lt(this,w6),lt(this,b6),lt(this,C6),lt(this,y6),lt(this,M$),lt(this,I$),lt(this,H$),lt(this,Dm),lt(this,_6),lt(this,X0),qs(this,Ft,{writable:!0,value:void 0}),qs(this,Wn,{writable:!0,value:void 0}),qs(this,ja,{writable:!0,value:void 0}),qs(this,Es,{writable:!0,value:void 0}),qs(this,el,{writable:!0,value:void 0}),qs(this,Kp,{writable:!0,value:void 0}),qs(this,df,{writable:!0,value:void 0}),qs(this,nd,{writable:!0,value:void 0}),qs(this,hc,{writable:!0,value:void 0}),qs(this,uE,{writable:!0,value:void 0}),qs(this,gE,{writable:!0,value:void 0}),ct(this,Ft,null),ct(this,Wn,new Map),ct(this,ja,{"top-start":[],"top-end":[],"bottom-start":[],"bottom-end":[]}),ct(this,Es,null),ct(this,el,!1),ct(this,Kp,!1),ct(this,df,!1),ct(this,nd,!1),ct(this,hc,null),ct(this,uE,()=>{if(!this.enabled||!we(this,Ft))return;const o=this.hot.rootElement.getAttribute("dir");o==="rtl"||o==="ltr"?we(this,Ft).setRtl(o==="rtl"):we(this,Ft).setRtl(this.hot.isRtl()),we(this,Ft).setSanitizer(this.hot.getSettings().sanitizer)}),ct(this,gE,t=>{if(we(this,Wn).size===0)return;const o=we(this,Ft)?.getHost(),i=t.target;if(!(!(i instanceof this.hot.rootWindow.HTMLElement)||!o)){if(o.contains(i)){if(we(this,Es)!==null)return;const s=t.relatedTarget;s instanceof this.hot.rootWindow.HTMLElement&&this.hot.rootWrapperElement.contains(s)&&!o.contains(s)&&ct(this,Es,s);return}ve(this,Om,W_).call(this)}})}}function A$(){return{stackLimit:this.getSetting("stackLimit"),animation:this.getSetting("animation")}}function Cye(n,e){return n.stackLimit===e.stackLimit&&n.animation===e.animation}function yye(n){(!ie(n)||typeof n.message!="string"&&!(typeof HTMLElement<"u"&&n.message instanceof HTMLElement))&&Y("Notification.showMessage expects an object with a `message` string or HTMLElement.");const e=`htn-${Q0()}`,t=wye.has(n.variant)?n.variant:"info",o=mye.has(n.position)?n.position:"bottom-end",i=typeof n.duration=="number"&&n.duration>=0?n.duration:4e3,s=typeof n.closable=="boolean"?n.closable:!0,r=Array.isArray(n.actions)?n.actions.map(a=>{(!ie(a)||typeof a.label!="string"||typeof a.callback!="function")&&Y("Each notification action needs `label` (string) and `callback` (function).");const l=a.type==="primary"?"primary":"secondary";return{label:a.label,type:l,callback:a.callback}}):[];return{id:e,variant:t,title:typeof n.title=="string"?n.title:void 0,message:n.message,duration:i,position:o,closable:s,actions:r}}function S6(n){let e=0;return we(this,Wn).forEach(t=>{t.options.position===n&&(e+=1)}),e}function v6(n){const e=this.hot.getTranslatedPhrase(ax),t=this.getSetting("animation"),{element:o}=we(this,Ft).createToastElement(n,e,t),i=we(this,Ft).getStack(n.position);i||Y(`Unknown notification position "${n.position}".`),n.position.startsWith("top")?i.prepend(o):i.appendChild(o),n.position.startsWith("bottom")&&this.hot.rootWindow.requestAnimationFrame(()=>{this.enabled&&(i.scrollTop=i.scrollHeight)});const s=n.duration,r={id:n.id,options:n,element:o,durationMs:s,remainingMs:s,paused:!1};we(this,Wn).set(n.id,r),ve(this,h6,_ye).call(this,r),we(this,el)&&ve(this,L_,dI).call(this),this.hot.runHooks("afterNotificationShow",n.id,n),s>0&&ve(this,Dm,$_).call(this)}function _ye(n){n.toastEventDisposers=[this.eventManager.addEventListener(n.element,"click",e=>ve(this,c6,Sye).call(this,e,n)),this.eventManager.addEventListener(n.element,"mouseenter",()=>{n.paused=!0}),this.eventManager.addEventListener(n.element,"mouseleave",()=>{n.paused=!1,n.durationMs>0&&!this.hot.rootDocument.hidden&&ve(this,Dm,$_).call(this)})]}function Sye(n,e){const t=n.target;if(!(t instanceof this.hot.rootWindow.HTMLElement))return;if(t.closest(`.${Gn}__close`)){this.hide(e.id);return}const o=t.closest("[data-ht-notification-action]");if(!o||!e.element.contains(o))return;const i=Number.parseInt(o.dataset.htNotificationAction,10),s=e.options.actions[i];s&&s.callback()}function W_(){const n=we(this,Ft)?.getHost();n&&P_.setSequentialFocusWithinHost(n,!1),ct(this,el,!1)}function dI(){const n=we(this,Ft)?.getHost();!n||we(this,Wn).size===0||(P_.setSequentialFocusWithinHost(n,!0),ct(this,el,!0))}function vye(){const n=we(this,Ft)?.getHost();if(!n||we(this,Wn).size===0)return;const t=this.hot.rootDocument.activeElement;t instanceof this.hot.rootWindow.HTMLElement&&!n.contains(t)&&ct(this,Es,t),this.hot.listen(),this.hot.getFocusScopeManager().activateScope(ni)}function R6(){const n=this.hot.getFocusScopeManager();n.getActiveScopeId()!==Sh&&n.activateScope(Sh)}function E6(){const n=this.hot.getFocusScopeManager();if(ct(this,nd,!0),n.getActiveScopeId()===ni)n.deactivateScope(ni);else{ct(this,nd,!1),ve(this,Om,W_).call(this);const e=we(this,Es);ct(this,Es,null),e?.isConnected&&this.hot.getFocusManager().focusElement(e,{preventScroll:!0}),ve(this,rI,R6).call(this)}}function O$(){const n=this.hot.rootDocument;we(this,Ft)?.getHost()?.contains(n.activeElement)&&ve(this,aI,E6).call(this)}function Rye(){we(this,df)||(this.hot.getFocusScopeManager().registerScope(ni,we(this,Ft).getHost(),{shortcutsContextName:Ny,runOnlyIf:()=>we(this,Wn).size>0,enableFocusCatchers:!1,onActivate:()=>{we(this,Ft)?.getHost()&&(ve(this,L_,dI).call(this),ve(this,w6,Aye).call(this))},onDeactivate:()=>{if(ve(this,Om,W_).call(this),we(this,nd)){ct(this,nd,!1);const e=we(this,Es);ct(this,Es,null),e?.isConnected&&this.hot.getFocusManager().focusElement(e,{preventScroll:!0}),ve(this,rI,R6).call(this)}}}),ct(this,df,!0))}function Eye(){const n=this.hot.getShortcutManager(),e=n.getContext(Ny)??n.addContext(Ny),t=n.getOrCreateContext(a6,"global"),o=n.getContext(Sh),i={keys:[["f6"]],preventDefault:!0,callback:()=>{ve(this,d6,vye).call(this)},runOnlyIf:()=>ve(this,C6,Dye).call(this),group:Nc};t.addShortcut(i),o&&o.addShortcut(i),e.addShortcut({keys:[["Escape"]],callback:()=>ve(this,q0,O$).call(this),runOnlyIf:()=>we(this,Ft)?.getHost()?.contains(this.hot.rootDocument.activeElement)===!0,group:Nc}),e.addShortcut({keys:[["Tab"]],preventDefault:!0,callback:()=>ve(this,p6,Mye).call(this),runOnlyIf:()=>ve(this,f6,Tye).call(this),group:Nc}),e.addShortcut({keys:[["Shift","Tab"]],preventDefault:!0,callback:()=>ve(this,q0,O$).call(this),runOnlyIf:()=>ve(this,g6,xye).call(this),group:Nc})}function D$(){const n=this.hot.getShortcutManager();n.getContext(Ny)?.removeShortcutsByGroup(Nc),n.getContext(a6)?.removeShortcutsByGroup(Nc),n.getContext(Sh)?.removeShortcutsByGroup(Nc)}function k6(){const n=we(this,Ft)?.getHost();if(!n)return[];const e=[...n.querySelectorAll(`.${Gn}__toast`)],t=[];for(let o=0;o<e.length;o+=1)t.push(...P_.getFocusables(e[o]));return t}function kye(){return ve(this,lI,k6).call(this)[0]}function T6(){if(we(this,Wn).size===0)return null;const n=this.hot.rootDocument.activeElement,e=we(this,Ft)?.getHost();if(!(n instanceof this.hot.rootWindow.HTMLElement)||!e?.contains(n))return null;const t=ve(this,lI,k6).call(this);if(t.length===0)return null;const o=t.indexOf(n);return o===-1?null:(we(this,el)||ve(this,L_,dI).call(this),{list:t,idx:o})}function Tye(){const n=ve(this,hI,T6).call(this);return n!==null&&n.idx===n.list.length-1}function xye(){const n=ve(this,hI,T6).call(this);return n!==null&&n.idx===0}function Mye(){const n=this.hot.getFocusScopeManager();ct(this,nd,!1),n.getActiveScopeId()===ni?n.deactivateScope(ni):ve(this,Om,W_).call(this),this.hot.listen(),n.activateScope(Sh,jr.TAB_FROM_ABOVE),ct(this,Es,null)}function N$(){we(this,df)&&(this.hot.getFocusScopeManager().unregisterScope(ni),ct(this,df,!1))}function Iye(n,e){n.toastEventDisposers&&(n.toastEventDisposers.forEach(t=>t()),n.toastEventDisposers=null),we(this,Wn).delete(n.id),e&&n.element.remove()}function Hye(n){const e=we(this,Ft)?.getHost();return e?n instanceof this.hot.rootWindow.HTMLElement&&e.contains(n):!1}function x6(n){let e=!1;return we(this,Wn).forEach(t=>{t.element.contains(n)&&(e=!0)}),e}function P$(){this.hot.listen();const n=this.hot.getFocusScopeManager();n.getActiveScopeId()===ni&&n.deactivateScope(ni),n.activateScope(ni)}function Aye(){const n=this.hot.rootDocument;if(!this.enabled||we(this,Wn).size===0||ve(this,cI,x6).call(this,n.activeElement))return;const e=ve(this,u6,kye).call(this);e&&this.hot.getFocusManager().focusElement(e)}function Oye(n){if(!(n instanceof this.hot.rootWindow.HTMLElement))return!1;const e=n.closest(".ht-root-wrapper");return e!==null?e===this.hot.rootWrapperElement:this.hot.rootDocument.querySelectorAll(".ht-root-wrapper").length<=1}function Dye(){if(!this.enabled||we(this,Wn).size===0)return!1;const n=we(this,Ft)?.getHost();if(!n)return!1;const e=this.hot.rootDocument.activeElement;return e instanceof this.hot.rootWindow.HTMLElement&&n.contains(e)?!1:ve(this,b6,Oye).call(this,e)}function Nye(){ve(this,aI,E6).call(this)}function Pye(n=!1){const e=this.hot.rootDocument,t=we(this,Ft)?.getHost(),o=e.activeElement;if(we(this,Wn).size>0){const a=o instanceof this.hot.rootWindow.HTMLElement&&t?.contains(o)===!0;a&&!ve(this,cI,x6).call(this,o)?ve(this,K0,P$).call(this):!a&&n&&ve(this,K0,P$).call(this);return}const i=we(this,el),s=ve(this,m6,Hye).call(this,e.activeElement);(i||n||s)&&ve(this,y6,Nye).call(this)}function Lye(n){const e=this.getSetting("stackLimit");for(;we(this,ja)[n].length>0&&ve(this,G0,S6).call(this,n)<e;){const t=we(this,ja)[n].shift();ve(this,j0,v6).call(this,t)}}function Wye(n){Ju.forEach(e=>{const t=we(this,ja)[e],o=t.findIndex(i=>i.id===n);o>=0&&t.splice(o,1)})}function $_(){we(this,Kp)||!this.enabled||(ct(this,Kp,!0),this.hot._registerTimeout(()=>{ct(this,Kp,!1),this.enabled&&(ve(this,_6,$ye).call(this),ve(this,X0,M6).call(this)&&ve(this,Dm,$_).call(this))},l6))}function $ye(){const e=!this.hot.rootDocument.hidden,t=[];we(this,Wn).forEach(o=>{o.durationMs<=0||o.paused||!e||(o.remainingMs-=l6,o.remainingMs<=0&&t.push(o.id))}),t.forEach(o=>this.hide(o))}function M6(){if(this.hot.rootDocument.hidden)return!1;let e=!1;return we(this,Wn).forEach(t=>{t.durationMs>0&&!t.paused&&(e=!0)}),e}function Fye(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Bye(n,e){return e.get?e.get.call(n):e.value}function Vye(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function I6(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function oo(n,e){var t=I6(n,e,"get");return Bye(n,t)}function Wb(n,e,t){Fye(n,e),e.set(n,t)}function Ul(n,e,t){var o=I6(n,e,"set");return Vye(n,o,t),t}const To="ht-empty-data-state",zye=150,Uye=`<div data-ref="emptyDataStateElement" class="${To} handsontable">
324
- <div class="${To}__content-wrapper">
325
- <div data-ref="emptyDataStateInner" class="${To}__content-wrapper-inner"></div>
326
- </div>
327
- </div>`,Yye=({title:n,description:e,buttons:t},o=!1)=>`
328
- ${o?`<div class="${To}__spinner" aria-hidden="true"></div>`:""}
329
- <div class="${To}__content">
330
- ${n?`<h2 class="${To}__title">${gr(n)}</h2>`:""}
331
- ${e?`<p class="${To}__description">${gr(e)}</p>`:""}
332
- </div>
333
- <div
334
- data-ref="emptyDataStateButtons"
335
- class="${To}__buttons${t?.length>0?` ${To}__buttons--has-buttons`:""}"
336
- >${!o&&t?.length>0?t.map(s=>`<button class="ht-button ht-button--${s.type}">${gr(s.text)}</button>`).join(""):""}</div>`;function Gye(n,e,t,o,i){if(t!==0){i.element?.remove(),i.element=null;return}i.element||(i.element=n.createElement("div"),i.element.classList.add(`${o}-placeholder`),e._wt.wtTable.holder.appendChild(i.element)),i.element.style.width="100%",i.element.style.height=`${zye}px`}function jye(n,e,t){let o=n.getWorkspaceWidth();return n.isHorizontallyScrollableByWindow()?e>0?o=n.getTotalTableWidth():t&&(o=n.getViewportWidth()):n.getTableWidth()-n.getRowHeaderWidth()<n.getViewportWidth()&&e>0&&(o=n.getTableWidth()),o}function qye(n,e,t,o){let i=n.getTableHeight();return n.isVerticallyScrollableByWindow()||n.hasVerticalScroll()?e>0?i=n.hot.getTableHeight()-n.getColumnHeaderHeight():i=n.hot.getTableHeight():t>0&&e>0?i=n.getViewportHeight()-o:t>0&&e===0&&(i=n.getWorkspaceHeight()-o),i}var mE=new WeakMap,wE=new WeakMap,Co=new WeakMap,cc=new WeakMap;class Kye{install(){if(oo(this,Co)?.emptyDataStateElement)return;const e=jc`${Uye}`;Ul(this,Co,e.refs);const{emptyDataStateInner:t,emptyDataStateElement:o}=oo(this,Co);fe(t,[wr(-1)]),fe(o,[wr(-1)]),oo(this,mE).after(e.fragment)}getElement(){return oo(this,Co)?.emptyDataStateElement}getFocusableElements(){const{emptyDataStateButtons:e,emptyDataStateInner:t}=oo(this,Co),o=Array.from(e?.children);return o.length===0?[t]:o}show(){oo(this,Co)?.emptyDataStateElement&&(oo(this,Co).emptyDataStateElement.style.display="block")}hide(){oo(this,Co)?.emptyDataStateElement&&(oo(this,cc)?.remove(),Ul(this,cc,null),oo(this,Co).emptyDataStateElement.style.display="none")}updateContent(e,t=!1){const{emptyDataStateElement:o,emptyDataStateInner:i}=oo(this,Co);let s="";typeof e=="string"?s={title:e}:s={title:e?.title,description:e?.description,buttons:e?.buttons};const r=jc`${Yye(s,t)}`;t?(V(o,`${To}--loading`),fe(i,[QI()])):(re(o,`${To}--loading`),ta(i,QI()[0])),Ul(this,Co,{...oo(this,Co),...r.refs}),i.innerHTML="",i.appendChild(r.fragment),!t&&s.buttons?.length>0&&Array.from(oo(this,Co).emptyDataStateButtons.children).forEach((a,l)=>{a.addEventListener("click",s.buttons[l].callback)})}updateClassNames(e){const{emptyDataStateElement:t}=oo(this,Co);e.countRenderableColumns()>0&&e.getColumnHeadersCount()>0?V(t,`${To}--disable-top-border`):re(t,`${To}--disable-top-border`),e.countRenderableRows()>0&&e.getRowHeadersCount()>0?V(t,`${To}--disable-inline-border`):re(t,`${To}--disable-inline-border`),e.hasHorizontalScroll()&&!e.isHorizontallyScrollableByWindow()?V(t,`${To}--disable-bottom-border`):re(t,`${To}--disable-bottom-border`)}updateSize(e,t=!1){const{emptyDataStateElement:o}=oo(this,Co),i=e.hasHorizontalScroll()?Mn(e.hot.rootDocument):0,s=e.countRenderableRows(),r=e.countRenderableColumns(),a=e.getColumnHeadersCount(),l=t===!0&&r>0,h=s>0||l;o.style.top=r>0?`${e.getColumnHeaderHeight()}px`:"0px",o.style.insetInlineStart="0px";const c={element:oo(this,cc)};Gye(oo(this,wE),e,s,To,c),Ul(this,cc,c.element);const d=jye(e,r,h),u=qye(e,r,a,i);o.style.width=`${d}px`,o.style.height=`${u}px`}destroy(){oo(this,Co)?.emptyDataStateElement?.remove(),oo(this,cc)?.remove(),Ul(this,cc,null),Ul(this,Co,null)}constructor({rootElement:e,rootDocument:t}){Wb(this,mE,{writable:!0,value:void 0}),Wb(this,wE,{writable:!0,value:void 0}),Wb(this,Co,{writable:!0,value:void 0}),Wb(this,cc,{writable:!0,value:void 0}),Ul(this,mE,e),Ul(this,wE,t),this.install()}}function H6(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xye(n,e){return e.get?e.get.call(n):e.value}function Zye(n,e,t){if(e.set)e.set.call(n,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function A6(n,e,t){if(!e.has(n))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(n)}function It(n,e){var t=A6(n,e,"get");return Xye(n,t)}function uu(n,e,t){H6(n,e),e.set(n,t)}function cn(n,e,t){var o=A6(n,e,"set");return Zye(n,o,t),t}function Pt(n,e,t){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return t}function Fo(n,e){H6(n,e),e.add(n)}const od="emptyDataState",Qye=370,Xp=Object.freeze({UNKNOWN:"unknown",FILTERS:"filters",LOADING:"loading"}),Jye=`plugin:${od}`;var tl=new WeakMap,Ln=new WeakMap,Uc=new WeakMap,Zp=new WeakMap,Yc=new WeakMap,fr=new WeakMap,L$=new WeakSet,W$=new WeakSet,$$=new WeakSet,bE=new WeakSet,F$=new WeakSet,B$=new WeakSet,V$=new WeakSet,vC=new WeakSet,Pc=new WeakSet,Z0=new WeakSet,Nm=new WeakSet,uI=new WeakSet,O6=new WeakSet,z$=new WeakSet,U$=new WeakSet,Y$=new WeakSet;class e_e extends at{static get PLUGIN_KEY(){return od}static get PLUGIN_PRIORITY(){return Qye}static get DEFAULT_SETTINGS(){return{message:void 0}}static get SETTINGS_VALIDATORS(){return{message:e=>typeof e=="string"||typeof e=="function"||ie(e)&&(typeof e?.title>"u"||typeof e?.title=="string")&&(typeof e?.description>"u"||typeof e?.description=="string")&&(typeof e?.buttons>"u"||Array.isArray(e?.buttons)&&e?.buttons.every(t=>typeof t=="object"&&typeof t.text=="string"&&typeof t.type=="string"&&["primary","secondary"].includes(t.type)&&typeof t.callback=="function"))||e===void 0}}isEnabled(){return!!this.hot.getSettings()[od]}enablePlugin(){this.enabled||(It(this,Ln)||(cn(this,Ln,new Kye({rootElement:this.hot.rootGridElement,rootDocument:this.hot.rootDocument})),Pt(this,B$,s_e).call(this),Pt(this,L$,t_e).call(this),Pt(this,W$,n_e).call(this)),this.addHook("afterInit",()=>Pt(this,z$,l_e).call(this)),this.addHook("afterRender",()=>Pt(this,U$,h_e).call(this)),this.addHook("afterRowSequenceCacheUpdate",()=>{Pt(this,Pc,ef).call(this)}),this.addHook("afterColumnSequenceCacheUpdate",()=>{Pt(this,Pc,ef).call(this)}),this.addHook("beforeFilter",e=>Pt(this,Y$,c_e).call(this,e)),this.addHook("beforeDataProviderFetch",e=>{e.skipLoading||Pt(this,$$,o_e).call(this)}),this.addHook("afterDataProviderFetch",()=>Pt(this,bE,G$).call(this)),this.addHook("afterDataProviderFetchError",()=>Pt(this,bE,G$).call(this)),super.enablePlugin(),Pt(this,Pc,ef).call(this))}updatePlugin(){this.disablePlugin(),this.enablePlugin(),Pt(this,Nm,F_).call(this),this.isVisible()&&It(this,Ln).show(),super.updatePlugin()}disablePlugin(){cn(this,fr,!1),Pt(this,V$,r_e).call(this),Pt(this,F$,i_e).call(this),It(this,Ln).destroy(),cn(this,Ln,null),super.disablePlugin()}isVisible(){return It(this,tl)}destroy(){cn(this,fr,!1),cn(this,tl,!1),It(this,Ln)?.destroy(),cn(this,Ln,null),cn(this,Uc,null),cn(this,Zp,!1),cn(this,Yc,null),super.destroy()}constructor(...e){super(...e),Fo(this,L$),Fo(this,W$),Fo(this,$$),Fo(this,bE),Fo(this,F$),Fo(this,B$),Fo(this,V$),Fo(this,vC),Fo(this,Pc),Fo(this,Z0),Fo(this,Nm),Fo(this,uI),Fo(this,O6),Fo(this,z$),Fo(this,U$),Fo(this,Y$),uu(this,tl,{writable:!0,value:void 0}),uu(this,Ln,{writable:!0,value:void 0}),uu(this,Uc,{writable:!0,value:void 0}),uu(this,Zp,{writable:!0,value:void 0}),uu(this,Yc,{writable:!0,value:void 0}),uu(this,fr,{writable:!0,value:void 0}),cn(this,tl,!1),cn(this,Ln,null),cn(this,Uc,null),cn(this,Zp,!1),cn(this,Yc,null),cn(this,fr,!1)}}function t_e(){this.eventManager.addEventListener(It(this,Ln).getElement(),"wheel",n=>Pt(this,O6,a_e).call(this,n))}function n_e(){cn(this,Uc,new MutationObserver(()=>{if(!this.hot)return;const n=It(this,Ln).getElement();this.hot.rootGridElement.nextElementSibling!==n&&this.hot.rootGridElement.after(n)})),It(this,Uc).observe(this.hot.rootWrapperElement,{childList:!0})}function o_e(){It(this,fr)||(cn(this,fr,!0),Pt(this,Pc,ef).call(this))}function G$(){It(this,fr)&&(cn(this,fr,!1),Pt(this,uI,D6).call(this),Pt(this,Pc,ef).call(this),this.hot.render())}function i_e(){It(this,Uc).disconnect(),cn(this,Uc,null)}function s_e(){this.hot.getFocusScopeManager().registerScope(od,It(this,Ln).getElement(),{shortcutsContextName:Jye,runOnlyIf:()=>this.isVisible(),onActivate:n=>{const e=It(this,Ln)?.getFocusableElements();e.length>0&&(n==="tab_from_above"?e.at(0).focus():n==="tab_from_below"&&e.at(-1).focus())}})}function r_e(){this.hot.getFocusScopeManager().unregisterScope(od)}function CE(n){let e;return typeof this.getSetting("message")=="function"?e=this.getSetting("message")(n):e=this.getSetting("message"),typeof e=="string"&&(e={title:e}),!e?.title&&!e?.description&&!e?.buttons&&(e={},n===Xp.FILTERS?(e.title=this.hot.getTranslatedPhrase(dx),e.description=this.hot.getTranslatedPhrase(ux),e.buttons=[{text:this.hot.getTranslatedPhrase(fx),type:"secondary",callback:()=>{const t=this.hot.getPlugin("filters");t&&(t.clearConditions(),t.filter())}}]):n===Xp.LOADING?(e.title=this.hot.getTranslatedPhrase(gx),e.description=this.hot.getTranslatedPhrase(px)):(e.title=this.hot.getTranslatedPhrase(hx),e.description=this.hot.getTranslatedPhrase(cx))),e}function ef(){if(this.hot.view){if(It(this,fr)){It(this,tl)?Pt(this,Nm,F_).call(this):Pt(this,Z0,j$).call(this);return}this.hot.view.countRenderableColumns()===0||this.hot.view.countRenderableRows()===0?Pt(this,Z0,j$).call(this):Pt(this,uI,D6).call(this)}}function j$(){It(this,tl)||(this.hot.runHooks("beforeEmptyDataStateShow"),Pt(this,Nm,F_).call(this),It(this,Ln).show(),cn(this,tl,!0),cn(this,Yc,this.hot.selection.exportSelection()),this.hot.getFocusScopeManager().activateScope(od),this.hot.runHooks("afterEmptyDataStateShow"))}function F_(){It(this,fr)?It(this,Ln).updateContent(Pt(this,vC,CE).call(this,Xp.LOADING),!0):It(this,Zp)?It(this,Ln).updateContent(Pt(this,vC,CE).call(this,Xp.FILTERS),!1):It(this,Ln).updateContent(Pt(this,vC,CE).call(this,Xp.UNKNOWN),!1)}function D6(){It(this,tl)&&(this.hot.runHooks("beforeEmptyDataStateHide"),It(this,Ln).hide(),cn(this,tl,!1),this.hot.getFocusScopeManager().deactivateScope(od),It(this,Yc)?.ranges.length>0?(this.hot.selection.importSelection(It(this,Yc)),this.hot.view.render(),cn(this,Yc,null)):this.hot.selectCell(0,0,void 0,void 0,!1),this.hot.runHooks("afterEmptyDataStateHide"))}function a_e(n){const e=Number.isNaN(n.deltaX)?-1*n.wheelDeltaX:n.deltaX;e!==0&&this.hot.view.hasHorizontalScroll()&&!this.hot.view.isHorizontallyScrollableByWindow()&&(this.hot.view.setTableScrollPosition({left:this.hot.view.getTableScrollPosition().left+e}),n.preventDefault())}function l_e(){Pt(this,Pc,ef).call(this),this.hot.render()}function h_e(){It(this,Ln)?.getElement()&&this.isVisible()&&this.hot.view&&(It(this,Ln).updateSize(this.hot.view,It(this,fr)),It(this,Ln).updateClassNames(this.hot.view))}function c_e(n){cn(this,Zp,n?.length>0),this.isVisible()&&Pt(this,Nm,F_).call(this)}function d_e(){it(Mp),it(tse),it(Ip),it(Ise),it(Lse),it(eU),it(Are),it(yae),it(M_),it(Sle),it(Ule),it($he),it(Ghe),it(O_),it(yde),it(hfe),it(jfe),it(_ge),it(Dge),it(jge),it(ope),it(fpe),it(Ipe),it(Fpe),it(dme),it(Fme),it(zme),it(Swe),it(rbe),it(Obe),it(Jbe),it(pCe),it(_Ce),it(MCe),it(LCe),it(Dy),it(aye),it(bye),it(e_e)}function A_e(){qte(),koe(),Boe(),Mie(),d_e()}export{DT as $,GT as A,YT as B,UT as C,_x as D,px as E,qT as F,zT as G,VT as H,Xy as I,BT as J,FT as K,rx as L,$T as M,ax as N,LC as O,nx as P,Ky as Q,Zn as R,qy as S,jy as T,Um as U,zm as V,WT as W,Vm as X,LT as Y,PT as Z,NT as _,K$ as a,MX as a$,OT as a0,AT as a1,HT as a2,IT as a3,MT as a4,xT as a5,TT as a6,kT as a7,Gy as a8,ET as a9,uT as aA,dT as aB,cT as aC,hT as aD,lT as aE,aT as aF,rT as aG,zk as aH,PC as aI,Vk as aJ,Bk as aK,Fk as aL,$k as aM,Wk as aN,Lk as aO,Pk as aP,Nk as aQ,Ok as aR,NC as aS,jk as aT,Gk as aU,Yk as aV,sx as aW,ix as aX,Dk as aY,A_e as aZ,$B as a_,RT as aa,vT as ab,ST as ac,_T as ad,yT as ae,lx as af,Zk as ag,Xk as ah,Kk as ai,qk as aj,Uk as ak,tT as al,eT as am,sT as an,iT as ao,oT as ap,nT as aq,CT as ar,bT as as,wT as at,mT as au,pT as av,gT as aw,Jk as ax,Qk as ay,fT as az,eG as b,LB as b0,DV as b1,tG as c,f_e as d,X$ as e,yx as f,Cx as g,bx as h,wx as i,mx as j,gx as k,fx as l,ux as m,dx as n,cx as o,hx as p,tx as q,Be as r,ex as s,JT as t,QT as u,ZT as v,XT as w,WC as x,KT as y,jT as z};