adminizer 4.6.0 → 4.7.0-build.221

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 (335) hide show
  1. package/Readme.md +12 -0
  2. package/assets/RelationDialogStack-CnHFOYyR.css +1 -0
  3. package/assets/RelationDialogStack-DI2bZxQX.js +20 -0
  4. package/assets/add-4213XScp.js +1 -0
  5. package/assets/add-group--F1XxfJ1.js +1 -0
  6. package/assets/add-group-form-DKRXC2n-.js +1 -0
  7. package/assets/add-user-b9HfMq7z.js +1 -0
  8. package/assets/add-user-form-UXAToWQd.js +1 -0
  9. package/assets/app-Clx8f5hd.css +1 -0
  10. package/assets/app-layout-C02ja4OI.js +1 -0
  11. package/assets/app-shell-D8wtkECO.js +1 -0
  12. package/assets/app-sidebar-BR5_zwxj.js +1 -0
  13. package/assets/app-sidebar-header-BZbIBQjq.js +1 -0
  14. package/assets/app.js +59 -7990
  15. package/assets/breadcrumbs-CODaqVkB.js +1 -0
  16. package/assets/catalog-6ZZjWdFs.js +6 -0
  17. package/assets/dashboard-CftAdKiH.js +3 -0
  18. package/assets/date-picker-DSOkNiNo.js +1 -0
  19. package/assets/del-modal-Cd4M7af8.js +1 -0
  20. package/assets/dynamic-controls-BsrJhPDY.js +1 -0
  21. package/assets/geo-json-CzR5JBXL.js +1 -0
  22. package/assets/handsontable-BI98OF5R.js +336 -0
  23. package/assets/history-DLHSU7Ak.js +1 -0
  24. package/assets/home-NcQ7nnU0.js +2 -0
  25. package/assets/icon-C2JNaLxH.js +1 -0
  26. package/assets/init-user-D2HSyXup.js +1 -0
  27. package/assets/input-error-CH2caTtO.js +1 -0
  28. package/assets/jsoneditor-DVNQmA6G.js +3869 -0
  29. package/assets/list-CFU0-TgN.js +4 -0
  30. package/assets/login-DFSLEO17.js +1 -0
  31. package/assets/manifest.json +246 -273
  32. package/assets/material-icon-Bx9pGQiQ.js +1 -0
  33. package/assets/media-manager-WcKe1EvD.js +6 -0
  34. package/assets/module-CT7PC6pc.js +1 -0
  35. package/assets/monaco-Bl4zdWCn.js +11 -0
  36. package/assets/nav-footer-BiSQkPt4.js +1 -0
  37. package/assets/nav-main-rTH0PfDw.js +1 -0
  38. package/assets/nav-user-Bj6cWs0a.js +1 -0
  39. package/assets/notification-Bi-PX87D.js +20 -0
  40. package/assets/pagination-render-AKJvTIRA.js +1 -0
  41. package/assets/register-BTP4uxsK.js +1 -0
  42. package/assets/ru-eW0WKkga.js +1 -0
  43. package/assets/theme-switcher-Dm8EOGzx.js +1 -0
  44. package/assets/toast-editor-DOg_gvSp.js +668 -0
  45. package/assets/user-filters-list-YUfR4XMI.js +1 -0
  46. package/assets/user-info-BgSbT02v.js +1 -0
  47. package/assets/user-menu-content-TQTXHIv6.js +1 -0
  48. package/assets/{vanilla-picker-l5rcX3cq.js → vanilla-picker-B3LgXoKV.js} +1 -7
  49. package/assets/welcome-vLwTu1R6.js +1 -0
  50. package/controllers/add.d.ts +1 -1
  51. package/controllers/add.js +20 -26
  52. package/controllers/addGroup.d.ts +1 -1
  53. package/controllers/addGroup.js +7 -15
  54. package/controllers/addUser.d.ts +1 -1
  55. package/controllers/addUser.js +10 -16
  56. package/controllers/catalog/Catalog.d.ts +1 -1
  57. package/controllers/catalog/Catalog.js +1 -10
  58. package/controllers/catalog/FrontendCatalogAdapter.d.ts +3 -3
  59. package/controllers/catalog/FrontendCatalogAdapter.js +0 -6
  60. package/controllers/catalog/FrontentCatalogAdapter.d.ts +3 -3
  61. package/controllers/catalog/FrontentCatalogAdapter.js +0 -4
  62. package/controllers/ckeditorUpload.js +2 -18
  63. package/controllers/dashboard.d.ts +1 -1
  64. package/controllers/dashboard.js +2 -5
  65. package/controllers/edit.js +24 -37
  66. package/controllers/editGroup.d.ts +1 -1
  67. package/controllers/editGroup.js +10 -21
  68. package/controllers/editUser.d.ts +1 -1
  69. package/controllers/editUser.js +11 -23
  70. package/controllers/exportData.d.ts +6 -0
  71. package/controllers/exportData.js +315 -0
  72. package/controllers/feed.d.ts +6 -0
  73. package/controllers/feed.js +73 -0
  74. package/controllers/feedback/feedbackController.d.ts +1 -1
  75. package/controllers/feedback/feedbackController.js +5 -7
  76. package/controllers/filter-fields/columns.d.ts +11 -0
  77. package/controllers/filter-fields/columns.js +106 -0
  78. package/controllers/filter-fields/filterFields.d.ts +10 -0
  79. package/controllers/filter-fields/filterFields.js +141 -0
  80. package/controllers/filter-fields/getAllUserFilters.d.ts +6 -0
  81. package/controllers/filter-fields/getAllUserFilters.js +115 -0
  82. package/controllers/filter-fields/groups.d.ts +5 -0
  83. package/controllers/filter-fields/groups.js +26 -0
  84. package/controllers/filter-fields/savedFilters.d.ts +25 -0
  85. package/controllers/filter-fields/savedFilters.js +317 -0
  86. package/controllers/getAllWidgets.d.ts +1 -1
  87. package/controllers/getAllWidgets.js +1 -9
  88. package/controllers/history-actions/HistoryController.js +6 -31
  89. package/controllers/initUser.js +6 -5
  90. package/controllers/inlineUpdate.d.ts +7 -0
  91. package/controllers/inlineUpdate.js +148 -0
  92. package/controllers/list.d.ts +1 -1
  93. package/controllers/list.js +383 -70
  94. package/controllers/listUserFilters.d.ts +5 -0
  95. package/controllers/listUserFilters.js +26 -0
  96. package/controllers/login.js +2 -2
  97. package/controllers/media-manager/mediaManagerApi.js +0 -9
  98. package/controllers/navigation/edit.js +3 -9
  99. package/controllers/notifications/NotificationController.d.ts +1 -1
  100. package/controllers/notifications/NotificationController.js +12 -36
  101. package/controllers/register.js +10 -9
  102. package/controllers/remove.js +10 -19
  103. package/controllers/timezones.d.ts +1 -1
  104. package/controllers/timezones.js +0 -6
  105. package/controllers/userApiKey.d.ts +7 -0
  106. package/controllers/userApiKey.js +36 -0
  107. package/controllers/view.js +14 -26
  108. package/controllers/welcome.d.ts +1 -1
  109. package/controllers/welcome.js +0 -4
  110. package/controllers/widgets/Action.d.ts +1 -1
  111. package/controllers/widgets/Action.js +1 -9
  112. package/controllers/widgets/Custom.d.ts +1 -1
  113. package/controllers/widgets/Custom.js +1 -9
  114. package/controllers/widgets/Info.d.ts +1 -1
  115. package/controllers/widgets/Info.js +1 -9
  116. package/controllers/widgets/filterInfo.d.ts +1 -0
  117. package/controllers/widgets/filterInfo.js +44 -0
  118. package/controllers/widgets/switch.d.ts +1 -1
  119. package/controllers/widgets/switch.js +1 -9
  120. package/controllers/widgetsDB.d.ts +1 -1
  121. package/controllers/widgetsDB.js +2 -8
  122. package/helpers/accessRightsHelper.d.ts +1 -1
  123. package/helpers/accessRightsHelper.js +5 -4
  124. package/helpers/apiKeyHelper.d.ts +5 -0
  125. package/helpers/apiKeyHelper.js +8 -0
  126. package/helpers/configHelper.js +12 -15
  127. package/helpers/controllerHelper.d.ts +14 -21
  128. package/helpers/controllerHelper.js +50 -83
  129. package/helpers/fieldsHelper.js +3 -3
  130. package/helpers/filterDatetimeHelper.d.ts +5 -0
  131. package/helpers/filterDatetimeHelper.js +84 -0
  132. package/helpers/inertiaActionsHelper.d.ts +2 -2
  133. package/helpers/inertiaActionsHelper.js +5 -4
  134. package/helpers/inertiaAddHelper.d.ts +3 -414
  135. package/helpers/inertiaAddHelper.js +39 -15
  136. package/helpers/inertiaGroupHelper.d.ts +2 -2
  137. package/helpers/inertiaGroupHelper.js +3 -3
  138. package/helpers/inertiaListHelper.d.ts +7 -3
  139. package/helpers/inertiaListHelper.js +26 -12
  140. package/helpers/inertiaMenuHelper.d.ts +1 -0
  141. package/helpers/inertiaMenuHelper.js +15 -3
  142. package/helpers/inertiaUserHelper.d.ts +3 -2
  143. package/helpers/inertiaUserHelper.js +7 -3
  144. package/helpers/menuHelper.d.ts +5 -2
  145. package/helpers/menuHelper.js +64 -12
  146. package/helpers/viteHelper.js +1 -2
  147. package/index.d.ts +6 -2
  148. package/index.js +6 -2
  149. package/interfaces/adminpanelConfig.d.ts +126 -39
  150. package/interfaces/internalModelAccess.d.ts +37 -0
  151. package/interfaces/internalModelAccess.js +1 -0
  152. package/interfaces/listQueryBuilder.d.ts +22 -0
  153. package/interfaces/listQueryBuilder.js +1 -0
  154. package/interfaces/queryCriteria.d.ts +54 -0
  155. package/interfaces/queryCriteria.js +1 -0
  156. package/interfaces/types.d.ts +1 -13
  157. package/lib/Adminizer.d.ts +4 -2
  158. package/lib/Adminizer.js +29 -10
  159. package/lib/DataAccessor.d.ts +8 -5
  160. package/lib/DataAccessor.js +89 -42
  161. package/lib/I18n.d.ts +5 -1
  162. package/lib/I18n.js +45 -19
  163. package/lib/MiddlewareManager.d.ts +8 -0
  164. package/lib/MiddlewareManager.js +53 -0
  165. package/lib/ai-assistant/OpenAiModelService.d.ts +3 -3
  166. package/lib/ai-assistant/OpenAiModelService.js +23 -24
  167. package/lib/catalog/Navigation.d.ts +1 -0
  168. package/lib/catalog/Navigation.js +12 -11
  169. package/lib/controls/jsoneditor/JsonEditor.d.ts +1 -2
  170. package/lib/controls/markdown/ToastUiEditor.d.ts +1 -2
  171. package/lib/feedback/FeedbackHandler.js +2 -2
  172. package/lib/filters/ConditionValidator.d.ts +107 -0
  173. package/lib/filters/ConditionValidator.js +483 -0
  174. package/lib/filters/CustomFilterHandler.d.ts +122 -0
  175. package/lib/filters/CustomFilterHandler.js +131 -0
  176. package/lib/filters/FilterCustomFieldHandler.d.ts +2 -0
  177. package/lib/filters/FilterCustomFieldHandler.js +2 -0
  178. package/lib/filters/FilterService.d.ts +82 -0
  179. package/lib/filters/FilterService.js +323 -0
  180. package/lib/filters/index.d.ts +6 -0
  181. package/lib/filters/index.js +4 -0
  182. package/lib/history-actions/AbstractHistoryAdapter.d.ts +5 -4
  183. package/lib/history-actions/AbstractHistoryAdapter.js +45 -30
  184. package/lib/history-actions/DefaultHistoryAdapter.d.ts +2 -0
  185. package/lib/history-actions/DefaultHistoryAdapter.js +12 -6
  186. package/lib/history-actions/HistoryHandler.js +1 -1
  187. package/lib/list-query-builder/ListQueryBuilder.d.ts +117 -0
  188. package/lib/list-query-builder/ListQueryBuilder.js +707 -0
  189. package/lib/media-manager/AbstractMediaManager.d.ts +9 -8
  190. package/lib/media-manager/DefaultMediaManager.d.ts +2 -0
  191. package/lib/media-manager/DefaultMediaManager.js +27 -15
  192. package/lib/media-manager/Items.d.ts +4 -1
  193. package/lib/media-manager/Items.js +62 -59
  194. package/lib/media-manager/MediaManagerHandler.js +1 -1
  195. package/lib/media-manager/helpers/MediaManagerHelper.d.ts +5 -1
  196. package/lib/media-manager/helpers/MediaManagerHelper.js +38 -4
  197. package/lib/model/AbstractModel.d.ts +33 -25
  198. package/lib/model/AbstractModel.js +54 -2
  199. package/lib/model/InternalModelAccessFactory.d.ts +18 -0
  200. package/lib/model/InternalModelAccessFactory.js +82 -0
  201. package/lib/model/ModelHandler.d.ts +6 -0
  202. package/lib/model/ModelHandler.js +14 -0
  203. package/lib/model/adapter/sequelize.d.ts +32 -10
  204. package/lib/model/adapter/sequelize.js +409 -62
  205. package/lib/model/adapter/typeorm.d.ts +62 -0
  206. package/lib/model/adapter/typeorm.js +777 -0
  207. package/lib/model/internalModelAccessToken.d.ts +1 -0
  208. package/lib/model/internalModelAccessToken.js +1 -0
  209. package/lib/model/internalModelRepository.d.ts +3 -0
  210. package/lib/model/internalModelRepository.js +4 -0
  211. package/lib/notifications/AbstractNotificationService.d.ts +3 -0
  212. package/lib/notifications/AbstractNotificationService.js +42 -36
  213. package/lib/notifications/GeneralNotificationService.js +37 -40
  214. package/lib/notifications/SystemNotificationService.js +33 -36
  215. package/lib/requestProcessor.js +0 -3
  216. package/lib/ui-i18n/getUiTranslations.d.ts +1 -0
  217. package/lib/ui-i18n/getUiTranslations.js +3 -0
  218. package/lib/ui-i18n/uiTranslationKeys.d.ts +6 -0
  219. package/lib/ui-i18n/uiTranslationKeys.js +268 -0
  220. package/lib/widgets/widgetHandler.d.ts +7 -2
  221. package/lib/widgets/widgetHandler.js +98 -18
  222. package/models/FilterAP.d.ts +116 -0
  223. package/models/FilterAP.js +68 -0
  224. package/models/FilterColumnAP.d.ts +32 -0
  225. package/models/FilterColumnAP.js +21 -0
  226. package/models/GroupAP.d.ts +1 -1
  227. package/models/HistoryActionsAP.d.ts +3 -3
  228. package/models/MediaManagerMetaAP.d.ts +1 -1
  229. package/models/NavigationAP.d.ts +1 -1
  230. package/models/UserAP.d.ts +6 -1
  231. package/models/UserAP.js +4 -0
  232. package/package.json +39 -32
  233. package/policies/authPolicies.d.ts +12 -0
  234. package/policies/authPolicies.js +104 -0
  235. package/policies/permissionResolvers.d.ts +12 -0
  236. package/policies/permissionResolvers.js +52 -0
  237. package/services/FeedService.d.ts +70 -0
  238. package/services/FeedService.js +334 -0
  239. package/system/Router.d.ts +1 -0
  240. package/system/Router.js +136 -59
  241. package/system/bindAccessRights.js +11 -30
  242. package/system/bindAuthorization.js +18 -18
  243. package/system/bindCors.js +16 -1
  244. package/system/bindCustomFilterHandlers.d.ts +2 -0
  245. package/system/bindCustomFilterHandlers.js +4 -0
  246. package/system/bindInertia.js +18 -61
  247. package/system/bindReqFunctions.js +10 -2
  248. package/system/bindTranslations.js +7 -3
  249. package/system/buildInternalModelAccess.d.ts +4 -0
  250. package/system/buildInternalModelAccess.js +59 -0
  251. package/system/defaults.js +18 -14
  252. package/system/routePolicies.d.ts +2 -0
  253. package/system/routePolicies.js +29 -0
  254. package/translations/en.json +151 -39
  255. package/translations/ru.json +211 -64
  256. package/ui/components/handsontable.js +13 -27
  257. package/ui/components/ui/dialog-stack.js +1 -3
  258. package/ui/components/ui/popover.js +1 -1
  259. package/ui/components/ui/sidebar.js +1 -1
  260. package/assets/RelationDialogStack-D9UVEF9s.js +0 -407
  261. package/assets/RelationDialogStack-DV8OITPR.css +0 -4
  262. package/assets/add-BlvzWQKF.js +0 -1
  263. package/assets/add-group-1Uoq9NWe.js +0 -1
  264. package/assets/add-group-form-B01gwDGu.js +0 -1
  265. package/assets/add-user-BQCAsaRy.js +0 -1
  266. package/assets/add-user-form-Cgwc9JkI.js +0 -1
  267. package/assets/app-DaOMy1nl.css +0 -72
  268. package/assets/app-layout-CAm60qoE.js +0 -1
  269. package/assets/app-shell-QWCtn9ye.js +0 -1
  270. package/assets/app-sidebar-CfaYbnSy.js +0 -1
  271. package/assets/app-sidebar-header-BsPFDhZ8.js +0 -1
  272. package/assets/breadcrumbs-CZZirDj8.js +0 -1
  273. package/assets/catalog-k5myk7fk.js +0 -6
  274. package/assets/dashboard-BkL9ybBw.js +0 -3
  275. package/assets/date-picker-B5AZ_7Q9.js +0 -1
  276. package/assets/del-modal-BoyXZloG.js +0 -1
  277. package/assets/dynamic-controls-k61T9W2P.js +0 -1
  278. package/assets/form-1WGY0YgG.js +0 -1
  279. package/assets/form-DJapG3qF.js +0 -1
  280. package/assets/geo-json-DsMUHo0l.js +0 -4
  281. package/assets/handsontable-PxYdjN8c.js +0 -298
  282. package/assets/history-CluyR-yJ.js +0 -1
  283. package/assets/home-Dug9zBzM.js +0 -2
  284. package/assets/icon-DfDLMG5f.js +0 -1
  285. package/assets/init-user-CF80MEnT.js +0 -1
  286. package/assets/input-error-DuuqFgZa.js +0 -1
  287. package/assets/jsoneditor-De1FvcYu.js +0 -3882
  288. package/assets/list-CuexshNt.js +0 -1
  289. package/assets/list-table-BsEWjTKY.js +0 -22
  290. package/assets/login-eDemYzN-.js +0 -1
  291. package/assets/material-icon-DMT8KdmE.js +0 -1
  292. package/assets/media-manager-DfYa_mT_.js +0 -14
  293. package/assets/module-Cd4Tm6uq.js +0 -1
  294. package/assets/monaco-BhBYtg3d.js +0 -11
  295. package/assets/nav-footer-D3olYxtz.js +0 -1
  296. package/assets/nav-main-BctqyzeV.js +0 -1
  297. package/assets/nav-user-Bn1Lt-BZ.js +0 -1
  298. package/assets/notification-D64qvni-.js +0 -27
  299. package/assets/pagination-render-DxD78ahJ.js +0 -1
  300. package/assets/register-349PwYbe.js +0 -1
  301. package/assets/theme-switcher-DfExsHW2.js +0 -1
  302. package/assets/toast-editor-ESK5iWPx.js +0 -845
  303. package/assets/user-info-DtBK5Kh8.js +0 -1
  304. package/assets/user-menu-content-0XYOCMaA.js +0 -1
  305. package/assets/welcome-PDp-gUei.js +0 -1
  306. package/controllers/form.d.ts +0 -1
  307. package/controllers/form.js +0 -86
  308. package/helpers/formHelper.d.ts +0 -6
  309. package/helpers/formHelper.js +0 -38
  310. package/helpers/inertiaFromHelper.d.ts +0 -11
  311. package/helpers/inertiaFromHelper.js +0 -98
  312. package/helpers/runtimeMode.d.ts +0 -1
  313. package/helpers/runtimeMode.js +0 -3
  314. package/lib/PolicyManager.d.ts +0 -8
  315. package/lib/PolicyManager.js +0 -53
  316. package/lib/datatable/NodeTable.d.ts +0 -49
  317. package/lib/datatable/NodeTable.js +0 -207
  318. package/lib/model/adapter/waterline.d.ts +0 -32
  319. package/lib/model/adapter/waterline.js +0 -180
  320. package/migrations/index.d.ts +0 -3
  321. package/migrations/index.js +0 -4
  322. package/migrations/knex/20250106000001_adminizer_init.d.ts +0 -8
  323. package/migrations/knex/20250106000001_adminizer_init.js +0 -164
  324. package/migrations/umzug/0001.d.ts +0 -7
  325. package/migrations/umzug/0001.js +0 -121
  326. package/migrations/umzugExports.d.ts +0 -2
  327. package/migrations/umzugExports.js +0 -9
  328. package/system/bindForms.d.ts +0 -2
  329. package/system/bindForms.js +0 -20
  330. /package/{policies → middlewares}/addMessages.d.ts +0 -0
  331. /package/{policies → middlewares}/addMessages.js +0 -0
  332. /package/{policies → middlewares}/checkAuth.d.ts +0 -0
  333. /package/{policies → middlewares}/checkAuth.js +0 -0
  334. /package/{policies → middlewares}/setLocale.d.ts +0 -0
  335. /package/{policies → middlewares}/setLocale.js +0 -0
@@ -1,298 +0,0 @@
1
- import{g as w1,c as i_}from"./jsoneditor-De1FvcYu.js";function oF(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var jp={exports:{}},Te={};/**
2
- * @license React
3
- * react.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var o_;function sF(){if(o_)return Te;o_=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),d=Symbol.iterator;function f(P){return P===null||typeof P!="object"?null:(P=d&&P[d]||P["@@iterator"],typeof P=="function"?P:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,y={};function E(P,g,w){this.props=P,this.context=g,this.refs=y,this.updater=w||m}E.prototype.isReactComponent={},E.prototype.setState=function(P,g){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,g,"setState")},E.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function v(){}v.prototype=E.prototype;function O(P,g,w){this.props=P,this.context=g,this.refs=y,this.updater=w||m}var x=O.prototype=new v;x.constructor=O,C(x,E.prototype),x.isPureReactComponent=!0;var F=Array.isArray;function I(){}var _={H:null,A:null,T:null,S:null},q=Object.prototype.hasOwnProperty;function G(P,g,w){var p=w.ref;return{$$typeof:t,type:P,key:g,ref:p!==void 0?p:null,props:w}}function U(P,g){return G(P.type,g,P.props)}function J(P){return typeof P=="object"&&P!==null&&P.$$typeof===t}function te(P){var g={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(w){return g[w]})}var le=/\/+/g;function ne(P,g){return typeof P=="object"&&P!==null&&P.key!=null?te(""+P.key):g.toString(36)}function se(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(I,I):(P.status="pending",P.then(function(g){P.status==="pending"&&(P.status="fulfilled",P.value=g)},function(g){P.status==="pending"&&(P.status="rejected",P.reason=g)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function Ge(P,g,w,p,T){var M=typeof P;(M==="undefined"||M==="boolean")&&(P=null);var V=!1;if(P===null)V=!0;else switch(M){case"bigint":case"string":case"number":V=!0;break;case"object":switch(P.$$typeof){case t:case e:V=!0;break;case c:return V=P._init,Ge(V(P._payload),g,w,p,T)}}if(V)return T=T(P),V=p===""?"."+ne(P,0):p,F(T)?(w="",V!=null&&(w=V.replace(le,"$&/")+"/"),Ge(T,g,w,"",function(S){return S})):T!=null&&(J(T)&&(T=U(T,w+(T.key==null||P&&P.key===T.key?"":(""+T.key).replace(le,"$&/")+"/")+V)),g.push(T)),1;V=0;var z=p===""?".":p+":";if(F(P))for(var Y=0;Y<P.length;Y++)p=P[Y],M=z+ne(p,Y),V+=Ge(p,g,w,M,T);else if(Y=f(P),typeof Y=="function")for(P=Y.call(P),Y=0;!(p=P.next()).done;)p=p.value,M=z+ne(p,Y++),V+=Ge(p,g,w,M,T);else if(M==="object"){if(typeof P.then=="function")return Ge(se(P),g,w,p,T);throw g=String(P),Error("Objects are not valid as a React child (found: "+(g==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":g)+"). If you meant to render a collection of children, use an array instead.")}return V}function ve(P,g,w){if(P==null)return P;var p=[],T=0;return Ge(P,p,"","",function(M){return g.call(w,M,T++)}),p}function Oe(P){if(P._status===-1){var g=P._result;g=g(),g.then(function(w){(P._status===0||P._status===-1)&&(P._status=1,P._result=w)},function(w){(P._status===0||P._status===-1)&&(P._status=2,P._result=w)}),P._status===-1&&(P._status=0,P._result=g)}if(P._status===1)return P._result.default;throw P._result}var it=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var g=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(g))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},Le={map:ve,forEach:function(P,g,w){ve(P,function(){g.apply(this,arguments)},w)},count:function(P){var g=0;return ve(P,function(){g++}),g},toArray:function(P){return ve(P,function(g){return g})||[]},only:function(P){if(!J(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return Te.Activity=h,Te.Children=Le,Te.Component=E,Te.Fragment=n,Te.Profiler=i,Te.PureComponent=O,Te.StrictMode=r,Te.Suspense=l,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,Te.__COMPILER_RUNTIME={__proto__:null,c:function(P){return _.H.useMemoCache(P)}},Te.cache=function(P){return function(){return P.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(P,g,w){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var p=C({},P.props),T=P.key;if(g!=null)for(M in g.key!==void 0&&(T=""+g.key),g)!q.call(g,M)||M==="key"||M==="__self"||M==="__source"||M==="ref"&&g.ref===void 0||(p[M]=g[M]);var M=arguments.length-2;if(M===1)p.children=w;else if(1<M){for(var V=Array(M),z=0;z<M;z++)V[z]=arguments[z+2];p.children=V}return G(P.type,T,p)},Te.createContext=function(P){return P={$$typeof:s,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:o,_context:P},P},Te.createElement=function(P,g,w){var p,T={},M=null;if(g!=null)for(p in g.key!==void 0&&(M=""+g.key),g)q.call(g,p)&&p!=="key"&&p!=="__self"&&p!=="__source"&&(T[p]=g[p]);var V=arguments.length-2;if(V===1)T.children=w;else if(1<V){for(var z=Array(V),Y=0;Y<V;Y++)z[Y]=arguments[Y+2];T.children=z}if(P&&P.defaultProps)for(p in V=P.defaultProps,V)T[p]===void 0&&(T[p]=V[p]);return G(P,M,T)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(P){return{$$typeof:a,render:P}},Te.isValidElement=J,Te.lazy=function(P){return{$$typeof:c,_payload:{_status:-1,_result:P},_init:Oe}},Te.memo=function(P,g){return{$$typeof:u,type:P,compare:g===void 0?null:g}},Te.startTransition=function(P){var g=_.T,w={};_.T=w;try{var p=P(),T=_.S;T!==null&&T(w,p),typeof p=="object"&&p!==null&&typeof p.then=="function"&&p.then(I,it)}catch(M){it(M)}finally{g!==null&&w.types!==null&&(g.types=w.types),_.T=g}},Te.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},Te.use=function(P){return _.H.use(P)},Te.useActionState=function(P,g,w){return _.H.useActionState(P,g,w)},Te.useCallback=function(P,g){return _.H.useCallback(P,g)},Te.useContext=function(P){return _.H.useContext(P)},Te.useDebugValue=function(){},Te.useDeferredValue=function(P,g){return _.H.useDeferredValue(P,g)},Te.useEffect=function(P,g){return _.H.useEffect(P,g)},Te.useEffectEvent=function(P){return _.H.useEffectEvent(P)},Te.useId=function(){return _.H.useId()},Te.useImperativeHandle=function(P,g,w){return _.H.useImperativeHandle(P,g,w)},Te.useInsertionEffect=function(P,g){return _.H.useInsertionEffect(P,g)},Te.useLayoutEffect=function(P,g){return _.H.useLayoutEffect(P,g)},Te.useMemo=function(P,g){return _.H.useMemo(P,g)},Te.useOptimistic=function(P,g){return _.H.useOptimistic(P,g)},Te.useReducer=function(P,g,w){return _.H.useReducer(P,g,w)},Te.useRef=function(P){return _.H.useRef(P)},Te.useState=function(P){return _.H.useState(P)},Te.useSyncExternalStore=function(P,g,w){return _.H.useSyncExternalStore(P,g,w)},Te.useTransition=function(){return _.H.useTransition()},Te.version="19.2.4",Te}var s_;function v1(){return s_||(s_=1,jp.exports=sF()),jp.exports}var C1=v1();const Ot=w1(C1),Xle=oF({__proto__:null,default:Ot},[C1]);var Up={exports:{}},_n={};/**
10
- * @license React
11
- * react-dom.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var a_;function aF(){if(a_)return _n;a_=1;var t=v1();function e(l){var u="https://react.dev/errors/"+l;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)u+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+l+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(l,u,c){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:h==null?null:""+h,children:l,containerInfo:u,implementation:c}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(l,u){if(l==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return _n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,_n.createPortal=function(l,u){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(e(299));return o(l,u,null,c)},_n.flushSync=function(l){var u=s.T,c=r.p;try{if(s.T=null,r.p=2,l)return l()}finally{s.T=u,r.p=c,r.d.f()}},_n.preconnect=function(l,u){typeof l=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,r.d.C(l,u))},_n.prefetchDNS=function(l){typeof l=="string"&&r.d.D(l)},_n.preinit=function(l,u){if(typeof l=="string"&&u&&typeof u.as=="string"){var c=u.as,h=a(c,u.crossOrigin),d=typeof u.integrity=="string"?u.integrity:void 0,f=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;c==="style"?r.d.S(l,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:h,integrity:d,fetchPriority:f}):c==="script"&&r.d.X(l,{crossOrigin:h,integrity:d,fetchPriority:f,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},_n.preinitModule=function(l,u){if(typeof l=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var c=a(u.as,u.crossOrigin);r.d.M(l,{crossOrigin:c,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&r.d.M(l)},_n.preload=function(l,u){if(typeof l=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var c=u.as,h=a(c,u.crossOrigin);r.d.L(l,c,{crossOrigin:h,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},_n.preloadModule=function(l,u){if(typeof l=="string")if(u){var c=a(u.as,u.crossOrigin);r.d.m(l,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:c,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else r.d.m(l)},_n.requestFormReset=function(l){r.d.r(l)},_n.unstable_batchedUpdates=function(l,u){return l(u)},_n.useFormState=function(l,u,c){return s.H.useFormState(l,u,c)},_n.useFormStatus=function(){return s.H.useHostTransitionStatus()},_n.version="19.2.4",_n}var l_;function lF(){if(l_)return Up.exports;l_=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Up.exports=aF(),Up.exports}var uF=lF();const y1=w1(uF);var u_={},sc,c_;function Zt(){if(c_)return sc;c_=1;var t=function(e){return e&&e.Math===Math&&e};return sc=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof i_=="object"&&i_)||t(typeof sc=="object"&&sc)||(function(){return this})()||Function("return this")(),sc}var zp={},Yp,h_;function Jt(){return h_||(h_=1,Yp=function(t){try{return!!t()}catch{return!0}}),Yp}var Gp,d_;function Jr(){if(d_)return Gp;d_=1;var t=Jt();return Gp=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Gp}var qp,f_;function Bm(){if(f_)return qp;f_=1;var t=Jt();return qp=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),qp}var Kp,g_;function un(){if(g_)return Kp;g_=1;var t=Bm(),e=Function.prototype.call;return Kp=t?e.bind(e):function(){return e.apply(e,arguments)},Kp}var Xp={},m_;function cF(){if(m_)return Xp;m_=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,n=e&&!t.call({1:2},1);return Xp.f=n?function(i){var o=e(this,i);return!!o&&o.enumerable}:t,Xp}var Zp,p_;function jm(){return p_||(p_=1,Zp=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),Zp}var Jp,w_;function Qt(){if(w_)return Jp;w_=1;var t=Bm(),e=Function.prototype,n=e.call,r=t&&e.bind.bind(n,n);return Jp=t?r:function(i){return function(){return n.apply(i,arguments)}},Jp}var Qp,v_;function ml(){if(v_)return Qp;v_=1;var t=Qt(),e=t({}.toString),n=t("".slice);return Qp=function(r){return n(e(r),8,-1)},Qp}var ew,C_;function hF(){if(C_)return ew;C_=1;var t=Qt(),e=Jt(),n=ml(),r=Object,i=t("".split);return ew=e(function(){return!r("z").propertyIsEnumerable(0)})?function(o){return n(o)==="String"?i(o,""):r(o)}:r,ew}var tw,y_;function nR(){return y_||(y_=1,tw=function(t){return t==null}),tw}var nw,S_;function ld(){if(S_)return nw;S_=1;var t=nR(),e=TypeError;return nw=function(n){if(t(n))throw new e("Can't call method on "+n);return n},nw}var rw,b_;function ud(){if(b_)return rw;b_=1;var t=hF(),e=ld();return rw=function(n){return t(e(n))},rw}var iw,R_;function pn(){if(R_)return iw;R_=1;var t=typeof document=="object"&&document.all;return iw=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"},iw}var ow,E_;function Ar(){if(E_)return ow;E_=1;var t=pn();return ow=function(e){return typeof e=="object"?e!==null:t(e)},ow}var sw,T_;function ju(){if(T_)return sw;T_=1;var t=Zt(),e=pn(),n=function(r){return e(r)?r:void 0};return sw=function(r,i){return arguments.length<2?n(t[r]):t[r]&&t[r][i]},sw}var aw,__;function cd(){if(__)return aw;__=1;var t=Qt();return aw=t({}.isPrototypeOf),aw}var lw,M_;function Um(){if(M_)return lw;M_=1;var t=Zt(),e=t.navigator,n=e&&e.userAgent;return lw=n?String(n):"",lw}var uw,I_;function dF(){if(I_)return uw;I_=1;var t=Zt(),e=Um(),n=t.process,r=t.Deno,i=n&&n.versions||r&&r.version,o=i&&i.v8,s,a;return o&&(s=o.split("."),a=s[0]>0&&s[0]<4?1:+(s[0]+s[1])),!a&&e&&(s=e.match(/Edge\/(\d+)/),(!s||s[1]>=74)&&(s=e.match(/Chrome\/(\d+)/),s&&(a=+s[1]))),uw=a,uw}var cw,P_;function rR(){if(P_)return cw;P_=1;var t=dF(),e=Jt(),n=Zt(),r=n.String;return cw=!!Object.getOwnPropertySymbols&&!e(function(){var i=Symbol("symbol detection");return!r(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&t&&t<41}),cw}var hw,O_;function S1(){if(O_)return hw;O_=1;var t=rR();return hw=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",hw}var dw,x_;function iR(){if(x_)return dw;x_=1;var t=ju(),e=pn(),n=cd(),r=S1(),i=Object;return dw=r?function(o){return typeof o=="symbol"}:function(o){var s=t("Symbol");return e(s)&&n(s.prototype,i(o))},dw}var fw,A_;function zm(){if(A_)return fw;A_=1;var t=String;return fw=function(e){try{return t(e)}catch{return"Object"}},fw}var gw,H_;function mr(){if(H_)return gw;H_=1;var t=pn(),e=zm(),n=TypeError;return gw=function(r){if(t(r))return r;throw new n(e(r)+" is not a function")},gw}var mw,N_;function hd(){if(N_)return mw;N_=1;var t=mr(),e=nR();return mw=function(n,r){var i=n[r];return e(i)?void 0:t(i)},mw}var pw,D_;function fF(){if(D_)return pw;D_=1;var t=un(),e=pn(),n=Ar(),r=TypeError;return pw=function(i,o){var s,a;if(o==="string"&&e(s=i.toString)&&!n(a=t(s,i))||e(s=i.valueOf)&&!n(a=t(s,i))||o!=="string"&&e(s=i.toString)&&!n(a=t(s,i)))return a;throw new r("Can't convert object to primitive value")},pw}var ww={exports:{}},vw,k_;function Xs(){return k_||(k_=1,vw=!1),vw}var Cw,L_;function oR(){if(L_)return Cw;L_=1;var t=Zt(),e=Object.defineProperty;return Cw=function(n,r){try{e(t,n,{value:r,configurable:!0,writable:!0})}catch{t[n]=r}return r},Cw}var $_;function sR(){if($_)return ww.exports;$_=1;var t=Xs(),e=Zt(),n=oR(),r="__core-js_shared__",i=ww.exports=e[r]||n(r,{});return(i.versions||(i.versions=[])).push({version:"3.48.0",mode:t?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.48.0/LICENSE",source:"https://github.com/zloirock/core-js"}),ww.exports}var yw,F_;function b1(){if(F_)return yw;F_=1;var t=sR();return yw=function(e,n){return t[e]||(t[e]=n||{})},yw}var Sw,V_;function Uu(){if(V_)return Sw;V_=1;var t=ld(),e=Object;return Sw=function(n){return e(t(n))},Sw}var bw,W_;function Hr(){if(W_)return bw;W_=1;var t=Qt(),e=Uu(),n=t({}.hasOwnProperty);return bw=Object.hasOwn||function(i,o){return n(e(i),o)},bw}var Rw,B_;function aR(){if(B_)return Rw;B_=1;var t=Qt(),e=0,n=Math.random(),r=t(1.1.toString);return Rw=function(i){return"Symbol("+(i===void 0?"":i)+")_"+r(++e+n,36)},Rw}var Ew,j_;function Mi(){if(j_)return Ew;j_=1;var t=Zt(),e=b1(),n=Hr(),r=aR(),i=rR(),o=S1(),s=t.Symbol,a=e("wks"),l=o?s.for||s:s&&s.withoutSetter||r;return Ew=function(u){return n(a,u)||(a[u]=i&&n(s,u)?s[u]:l("Symbol."+u)),a[u]},Ew}var Tw,U_;function gF(){if(U_)return Tw;U_=1;var t=un(),e=Ar(),n=iR(),r=hd(),i=fF(),o=Mi(),s=TypeError,a=o("toPrimitive");return Tw=function(l,u){if(!e(l)||n(l))return l;var c=r(l,a),h;if(c){if(u===void 0&&(u="default"),h=t(c,l,u),!e(h)||n(h))return h;throw new s("Can't convert object to primitive value")}return u===void 0&&(u="number"),i(l,u)},Tw}var _w,z_;function R1(){if(z_)return _w;z_=1;var t=gF(),e=iR();return _w=function(n){var r=t(n,"string");return e(r)?r:r+""},_w}var Mw,Y_;function lR(){if(Y_)return Mw;Y_=1;var t=Zt(),e=Ar(),n=t.document,r=e(n)&&e(n.createElement);return Mw=function(i){return r?n.createElement(i):{}},Mw}var Iw,G_;function E1(){if(G_)return Iw;G_=1;var t=Jr(),e=Jt(),n=lR();return Iw=!t&&!e(function(){return Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a!==7}),Iw}var q_;function T1(){if(q_)return zp;q_=1;var t=Jr(),e=un(),n=cF(),r=jm(),i=ud(),o=R1(),s=Hr(),a=E1(),l=Object.getOwnPropertyDescriptor;return zp.f=t?l:function(c,h){if(c=i(c),h=o(h),a)try{return l(c,h)}catch{}if(s(c,h))return r(!e(n.f,c,h),c[h])},zp}var Pw={},Ow,K_;function _1(){if(K_)return Ow;K_=1;var t=Jr(),e=Jt();return Ow=t&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ow}var xw,X_;function cn(){if(X_)return xw;X_=1;var t=Ar(),e=String,n=TypeError;return xw=function(r){if(t(r))return r;throw new n(e(r)+" is not an object")},xw}var Z_;function Zs(){if(Z_)return Pw;Z_=1;var t=Jr(),e=E1(),n=_1(),r=cn(),i=R1(),o=TypeError,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l="enumerable",u="configurable",c="writable";return Pw.f=t?n?function(d,f,m){if(r(d),f=i(f),r(m),typeof d=="function"&&f==="prototype"&&"value"in m&&c in m&&!m[c]){var C=a(d,f);C&&C[c]&&(d[f]=m.value,m={configurable:u in m?m[u]:C[u],enumerable:l in m?m[l]:C[l],writable:!1})}return s(d,f,m)}:s:function(d,f,m){if(r(d),f=i(f),r(m),e)try{return s(d,f,m)}catch{}if("get"in m||"set"in m)throw new o("Accessors not supported");return"value"in m&&(d[f]=m.value),d},Pw}var Aw,J_;function zu(){if(J_)return Aw;J_=1;var t=Jr(),e=Zs(),n=jm();return Aw=t?function(r,i,o){return e.f(r,i,n(1,o))}:function(r,i,o){return r[i]=o,r},Aw}var Hw={exports:{}},Nw,Q_;function mF(){if(Q_)return Nw;Q_=1;var t=Jr(),e=Hr(),n=Function.prototype,r=t&&Object.getOwnPropertyDescriptor,i=e(n,"name"),o=i&&(function(){}).name==="something",s=i&&(!t||t&&r(n,"name").configurable);return Nw={EXISTS:i,PROPER:o,CONFIGURABLE:s},Nw}var Dw,eM;function pF(){if(eM)return Dw;eM=1;var t=Qt(),e=pn(),n=sR(),r=t(Function.toString);return e(n.inspectSource)||(n.inspectSource=function(i){return r(i)}),Dw=n.inspectSource,Dw}var kw,tM;function wF(){if(tM)return kw;tM=1;var t=Zt(),e=pn(),n=t.WeakMap;return kw=e(n)&&/native code/.test(String(n)),kw}var Lw,nM;function uR(){if(nM)return Lw;nM=1;var t=b1(),e=aR(),n=t("keys");return Lw=function(r){return n[r]||(n[r]=e(r))},Lw}var $w,rM;function cR(){return rM||(rM=1,$w={}),$w}var Fw,iM;function hR(){if(iM)return Fw;iM=1;var t=wF(),e=Zt(),n=Ar(),r=zu(),i=Hr(),o=sR(),s=uR(),a=cR(),l="Object already initialized",u=e.TypeError,c=e.WeakMap,h,d,f,m=function(v){return f(v)?d(v):h(v,{})},C=function(v){return function(O){var x;if(!n(O)||(x=d(O)).type!==v)throw new u("Incompatible receiver, "+v+" required");return x}};if(t||o.state){var y=o.state||(o.state=new c);y.get=y.get,y.has=y.has,y.set=y.set,h=function(v,O){if(y.has(v))throw new u(l);return O.facade=v,y.set(v,O),O},d=function(v){return y.get(v)||{}},f=function(v){return y.has(v)}}else{var E=s("state");a[E]=!0,h=function(v,O){if(i(v,E))throw new u(l);return O.facade=v,r(v,E,O),O},d=function(v){return i(v,E)?v[E]:{}},f=function(v){return i(v,E)}}return Fw={set:h,get:d,has:f,enforce:m,getterFor:C},Fw}var oM;function M1(){if(oM)return Hw.exports;oM=1;var t=Qt(),e=Jt(),n=pn(),r=Hr(),i=Jr(),o=mF().CONFIGURABLE,s=pF(),a=hR(),l=a.enforce,u=a.get,c=String,h=Object.defineProperty,d=t("".slice),f=t("".replace),m=t([].join),C=i&&!e(function(){return h(function(){},"length",{value:8}).length!==8}),y=String(String).split("String"),E=Hw.exports=function(v,O,x){d(c(O),0,7)==="Symbol("&&(O="["+f(c(O),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),x&&x.getter&&(O="get "+O),x&&x.setter&&(O="set "+O),(!r(v,"name")||o&&v.name!==O)&&(i?h(v,"name",{value:O,configurable:!0}):v.name=O),C&&x&&r(x,"arity")&&v.length!==x.arity&&h(v,"length",{value:x.arity});try{x&&r(x,"constructor")&&x.constructor?i&&h(v,"prototype",{writable:!1}):v.prototype&&(v.prototype=void 0)}catch{}var F=l(v);return r(F,"source")||(F.source=m(y,typeof O=="string"?O:"")),v};return Function.prototype.toString=E(function(){return n(this)&&u(this).source||s(this)},"toString"),Hw.exports}var Vw,sM;function dR(){if(sM)return Vw;sM=1;var t=pn(),e=Zs(),n=M1(),r=oR();return Vw=function(i,o,s,a){a||(a={});var l=a.enumerable,u=a.name!==void 0?a.name:o;if(t(s)&&n(s,u,a),a.global)l?i[o]=s:r(o,s);else{try{a.unsafe?i[o]&&(l=!0):delete i[o]}catch{}l?i[o]=s:e.f(i,o,{value:s,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return i},Vw}var Ww={},Bw,aM;function vF(){if(aM)return Bw;aM=1;var t=Math.ceil,e=Math.floor;return Bw=Math.trunc||function(r){var i=+r;return(i>0?e:t)(i)},Bw}var jw,lM;function dd(){if(lM)return jw;lM=1;var t=vF();return jw=function(e){var n=+e;return n!==n||n===0?0:t(n)},jw}var Uw,uM;function CF(){if(uM)return Uw;uM=1;var t=dd(),e=Math.max,n=Math.min;return Uw=function(r,i){var o=t(r);return o<0?e(o+i,0):n(o,i)},Uw}var zw,cM;function yF(){if(cM)return zw;cM=1;var t=dd(),e=Math.min;return zw=function(n){var r=t(n);return r>0?e(r,9007199254740991):0},zw}var Yw,hM;function Yu(){if(hM)return Yw;hM=1;var t=yF();return Yw=function(e){return t(e.length)},Yw}var Gw,dM;function SF(){if(dM)return Gw;dM=1;var t=ud(),e=CF(),n=Yu(),r=function(i){return function(o,s,a){var l=t(o),u=n(l);if(u===0)return!i&&-1;var c=e(a,u),h;if(i&&s!==s){for(;u>c;)if(h=l[c++],h!==h)return!0}else for(;u>c;c++)if((i||c in l)&&l[c]===s)return i||c||0;return!i&&-1}};return Gw={includes:r(!0),indexOf:r(!1)},Gw}var qw,fM;function I1(){if(fM)return qw;fM=1;var t=Qt(),e=Hr(),n=ud(),r=SF().indexOf,i=cR(),o=t([].push);return qw=function(s,a){var l=n(s),u=0,c=[],h;for(h in l)!e(i,h)&&e(l,h)&&o(c,h);for(;a.length>u;)e(l,h=a[u++])&&(~r(c,h)||o(c,h));return c},qw}var Kw,gM;function fR(){return gM||(gM=1,Kw=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Kw}var mM;function bF(){if(mM)return Ww;mM=1;var t=I1(),e=fR(),n=e.concat("length","prototype");return Ww.f=Object.getOwnPropertyNames||function(i){return t(i,n)},Ww}var Xw={},pM;function RF(){return pM||(pM=1,Xw.f=Object.getOwnPropertySymbols),Xw}var Zw,wM;function EF(){if(wM)return Zw;wM=1;var t=ju(),e=Qt(),n=bF(),r=RF(),i=cn(),o=e([].concat);return Zw=t("Reflect","ownKeys")||function(a){var l=n.f(i(a)),u=r.f;return u?o(l,u(a)):l},Zw}var Jw,vM;function P1(){if(vM)return Jw;vM=1;var t=Hr(),e=EF(),n=T1(),r=Zs();return Jw=function(i,o,s){for(var a=e(o),l=r.f,u=n.f,c=0;c<a.length;c++){var h=a[c];!t(i,h)&&!(s&&t(s,h))&&l(i,h,u(o,h))}},Jw}var Qw,CM;function TF(){if(CM)return Qw;CM=1;var t=Jt(),e=pn(),n=/#|\.prototype\./,r=function(l,u){var c=o[i(l)];return c===a?!0:c===s?!1:e(u)?t(u):!!u},i=r.normalize=function(l){return String(l).replace(n,".").toLowerCase()},o=r.data={},s=r.NATIVE="N",a=r.POLYFILL="P";return Qw=r,Qw}var ev,yM;function vt(){if(yM)return ev;yM=1;var t=Zt(),e=T1().f,n=zu(),r=dR(),i=oR(),o=P1(),s=TF();return ev=function(a,l){var u=a.target,c=a.global,h=a.stat,d,f,m,C,y,E;if(c?f=t:h?f=t[u]||i(u,{}):f=t[u]&&t[u].prototype,f)for(m in l){if(y=l[m],a.dontCallGetSet?(E=e(f,m),C=E&&E.value):C=f[m],d=s(c?m:u+(h?".":"#")+m,a.forced),!d&&C!==void 0){if(typeof y==typeof C)continue;o(y,C)}(a.sham||C&&C.sham)&&n(y,"sham",!0),r(f,m,y,a)}},ev}var tv,SM;function fd(){if(SM)return tv;SM=1;var t=Bm(),e=Function.prototype,n=e.apply,r=e.call;return tv=typeof Reflect=="object"&&Reflect.apply||(t?r.bind(n):function(){return r.apply(n,arguments)}),tv}var nv,bM;function O1(){if(bM)return nv;bM=1;var t=Qt(),e=mr();return nv=function(n,r,i){try{return t(e(Object.getOwnPropertyDescriptor(n,r)[i]))}catch{}},nv}var rv,RM;function _F(){if(RM)return rv;RM=1;var t=Ar();return rv=function(e){return t(e)||e===null},rv}var iv,EM;function MF(){if(EM)return iv;EM=1;var t=_F(),e=String,n=TypeError;return iv=function(r){if(t(r))return r;throw new n("Can't set "+e(r)+" as a prototype")},iv}var ov,TM;function x1(){if(TM)return ov;TM=1;var t=O1(),e=Ar(),n=ld(),r=MF();return ov=Object.setPrototypeOf||("__proto__"in{}?(function(){var i=!1,o={},s;try{s=t(Object.prototype,"__proto__","set"),s(o,[]),i=o instanceof Array}catch{}return function(l,u){return n(l),r(u),e(l)&&(i?s(l,u):l.__proto__=u),l}})():void 0),ov}var sv,_M;function IF(){if(_M)return sv;_M=1;var t=Zs().f;return sv=function(e,n,r){r in e||t(e,r,{configurable:!0,get:function(){return n[r]},set:function(i){n[r]=i}})},sv}var av,MM;function PF(){if(MM)return av;MM=1;var t=pn(),e=Ar(),n=x1();return av=function(r,i,o){var s,a;return n&&t(s=i.constructor)&&s!==o&&e(a=s.prototype)&&a!==o.prototype&&n(r,a),r},av}var lv,IM;function OF(){if(IM)return lv;IM=1;var t=Mi(),e=t("toStringTag"),n={};return n[e]="z",lv=String(n)==="[object z]",lv}var uv,PM;function A1(){if(PM)return uv;PM=1;var t=OF(),e=pn(),n=ml(),r=Mi(),i=r("toStringTag"),o=Object,s=n((function(){return arguments})())==="Arguments",a=function(l,u){try{return l[u]}catch{}};return uv=t?n:function(l){var u,c,h;return l===void 0?"Undefined":l===null?"Null":typeof(c=a(u=o(l),i))=="string"?c:s?n(u):(h=n(u))==="Object"&&e(u.callee)?"Arguments":h},uv}var cv,OM;function Ym(){if(OM)return cv;OM=1;var t=A1(),e=String;return cv=function(n){if(t(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(n)},cv}var hv,xM;function xF(){if(xM)return hv;xM=1;var t=Ym();return hv=function(e,n){return e===void 0?arguments.length<2?"":n:t(e)},hv}var dv,AM;function AF(){if(AM)return dv;AM=1;var t=Ar(),e=zu();return dv=function(n,r){t(r)&&"cause"in r&&e(n,"cause",r.cause)},dv}var fv,HM;function HF(){if(HM)return fv;HM=1;var t=Qt(),e=Error,n=t("".replace),r=(function(s){return String(new e(s).stack)})("zxcasd"),i=/\n\s*at [^:]*:[^\n]*/,o=i.test(r);return fv=function(s,a){if(o&&typeof s=="string"&&!e.prepareStackTrace)for(;a--;)s=n(s,i,"");return s},fv}var gv,NM;function NF(){if(NM)return gv;NM=1;var t=Jt(),e=jm();return gv=!t(function(){var n=new Error("a");return"stack"in n?(Object.defineProperty(n,"stack",e(1,7)),n.stack!==7):!0}),gv}var mv,DM;function DF(){if(DM)return mv;DM=1;var t=zu(),e=HF(),n=NF(),r=Error.captureStackTrace;return mv=function(i,o,s,a){n&&(r?r(i,o):t(i,"stack",e(s,a)))},mv}var pv,kM;function kF(){if(kM)return pv;kM=1;var t=ju(),e=Hr(),n=zu(),r=cd(),i=x1(),o=P1(),s=IF(),a=PF(),l=xF(),u=AF(),c=DF(),h=Jr(),d=Xs();return pv=function(f,m,C,y){var E="stackTraceLimit",v=y?2:1,O=f.split("."),x=O[O.length-1],F=t.apply(null,O);if(F){var I=F.prototype;if(!d&&e(I,"cause")&&delete I.cause,!C)return F;var _=t("Error"),q=m(function(G,U){var J=l(y?U:G,void 0),te=y?new F(G):new F;return J!==void 0&&n(te,"message",J),c(te,q,te.stack,2),this&&r(I,this)&&a(te,this,q),arguments.length>v&&u(te,arguments[v]),te});if(q.prototype=I,x!=="Error"?i?i(q,_):o(q,_,{name:!0}):h&&E in F&&(s(q,F,E),s(q,F,"prepareStackTrace")),o(q,F),!d)try{I.name!==x&&n(I,"name",x),I.constructor=q}catch{}return q}},pv}var LM;function LF(){if(LM)return u_;LM=1;var t=vt(),e=Zt(),n=fd(),r=kF(),i="WebAssembly",o=e[i],s=new Error("e",{cause:7}).cause!==7,a=function(u,c){var h={};h[u]=r(u,c,s),t({global:!0,constructor:!0,arity:1,forced:s},h)},l=function(u,c){if(o&&o[u]){var h={};h[u]=r(i+"."+u,c,s),t({target:i,stat:!0,constructor:!0,arity:1,forced:s},h)}};return a("Error",function(u){return function(h){return n(u,this,arguments)}}),a("EvalError",function(u){return function(h){return n(u,this,arguments)}}),a("RangeError",function(u){return function(h){return n(u,this,arguments)}}),a("ReferenceError",function(u){return function(h){return n(u,this,arguments)}}),a("SyntaxError",function(u){return function(h){return n(u,this,arguments)}}),a("TypeError",function(u){return function(h){return n(u,this,arguments)}}),a("URIError",function(u){return function(h){return n(u,this,arguments)}}),l("CompileError",function(u){return function(h){return n(u,this,arguments)}}),l("LinkError",function(u){return function(h){return n(u,this,arguments)}}),l("RuntimeError",function(u){return function(h){return n(u,this,arguments)}}),u_}LF();var $M={},wv,FM;function H1(){if(FM)return wv;FM=1;var t=ml();return wv=Array.isArray||function(n){return t(n)==="Array"},wv}var vv,VM;function N1(){if(VM)return vv;VM=1;var t=Jr(),e=H1(),n=TypeError,r=Object.getOwnPropertyDescriptor,i=t&&!(function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(o){return o instanceof TypeError}})();return vv=i?function(o,s){if(e(o)&&!r(o,"length").writable)throw new n("Cannot set read only .length");return o.length=s}:function(o,s){return o.length=s},vv}var Cv,WM;function D1(){if(WM)return Cv;WM=1;var t=TypeError,e=9007199254740991;return Cv=function(n){if(n>e)throw t("Maximum allowed index exceeded");return n},Cv}var BM;function $F(){if(BM)return $M;BM=1;var t=vt(),e=Uu(),n=Yu(),r=N1(),i=D1(),o=Jt(),s=o(function(){return[].push.call({length:4294967296},1)!==4294967297}),a=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(u){return u instanceof TypeError}},l=s||!a();return t({target:"Array",proto:!0,arity:1,forced:l},{push:function(c){var h=e(this),d=n(h),f=arguments.length;i(d+f);for(var m=0;m<f;m++)h[d]=arguments[m],d++;return r(h,d),d}}),$M}$F();var jM={},yv,UM;function FF(){if(UM)return yv;UM=1;var t=ml(),e=Qt();return yv=function(n){if(t(n)==="Function")return e(n)},yv}var Sv,zM;function k1(){if(zM)return Sv;zM=1;var t=FF(),e=mr(),n=Bm(),r=t(t.bind);return Sv=function(i,o){return e(i),o===void 0?i:n?r(i,o):function(){return i.apply(o,arguments)}},Sv}var bv,YM;function L1(){return YM||(YM=1,bv={}),bv}var Rv,GM;function VF(){if(GM)return Rv;GM=1;var t=Mi(),e=L1(),n=t("iterator"),r=Array.prototype;return Rv=function(i){return i!==void 0&&(e.Array===i||r[n]===i)},Rv}var Ev,qM;function gR(){if(qM)return Ev;qM=1;var t=A1(),e=hd(),n=nR(),r=L1(),i=Mi(),o=i("iterator");return Ev=function(s){if(!n(s))return e(s,o)||e(s,"@@iterator")||r[t(s)]},Ev}var Tv,KM;function WF(){if(KM)return Tv;KM=1;var t=un(),e=mr(),n=cn(),r=zm(),i=gR(),o=TypeError;return Tv=function(s,a){var l=arguments.length<2?i(s):a;if(e(l))return n(t(l,s));throw new o(r(s)+" is not iterable")},Tv}var _v,XM;function pr(){if(XM)return _v;XM=1;var t=un(),e=cn(),n=hd();return _v=function(r,i,o){var s,a;e(r);try{if(s=n(r,"return"),!s){if(i==="throw")throw o;return o}s=t(s,r)}catch(l){a=!0,s=l}if(i==="throw")throw o;if(a)throw s;return e(s),o},_v}var Mv,ZM;function Gu(){if(ZM)return Mv;ZM=1;var t=k1(),e=un(),n=cn(),r=zm(),i=VF(),o=Yu(),s=cd(),a=WF(),l=gR(),u=pr(),c=TypeError,h=function(f,m){this.stopped=f,this.result=m},d=h.prototype;return Mv=function(f,m,C){var y=C&&C.that,E=!!(C&&C.AS_ENTRIES),v=!!(C&&C.IS_RECORD),O=!!(C&&C.IS_ITERATOR),x=!!(C&&C.INTERRUPTED),F=t(m,y),I,_,q,G,U,J,te,le=function(se){return I&&u(I,"normal"),new h(!0,se)},ne=function(se){return E?(n(se),x?F(se[0],se[1],le):F(se[0],se[1])):x?F(se,le):F(se)};if(v)I=f.iterator;else if(O)I=f;else{if(_=l(f),!_)throw new c(r(f)+" is not iterable");if(i(_)){for(q=0,G=o(f);G>q;q++)if(U=ne(f[q]),U&&s(d,U))return U;return new h(!1)}I=a(f,_)}for(J=v?f.next:I.next;!(te=e(J,I)).done;){try{U=ne(te.value)}catch(se){u(I,"throw",se)}if(typeof U=="object"&&U&&s(d,U))return U}return new h(!1)},Mv}var Iv,JM;function $1(){if(JM)return Iv;JM=1;var t=Jr(),e=Zs(),n=jm();return Iv=function(r,i,o){t?e.f(r,i,n(0,o)):r[i]=o},Iv}var QM;function BF(){if(QM)return jM;QM=1;var t=vt(),e=Gu(),n=$1();return t({target:"Object",stat:!0},{fromEntries:function(i){var o={};return e(i,function(s,a){n(o,s,a)},{AS_ENTRIES:!0}),o}}),jM}BF();var eI={},Pv,tI;function go(){if(tI)return Pv;tI=1;var t=Qt(),e=Set.prototype;return Pv={Set,add:t(e.add),has:t(e.has),remove:t(e.delete),proto:e},Pv}var Ov,nI;function pl(){if(nI)return Ov;nI=1;var t=go().has;return Ov=function(e){return t(e),e},Ov}var xv,rI;function wl(){if(rI)return xv;rI=1;var t=un();return xv=function(e,n,r){for(var i=r?e:e.iterator,o=e.next,s,a;!(s=t(o,i)).done;)if(a=n(s.value),a!==void 0)return a},xv}var Av,iI;function gd(){if(iI)return Av;iI=1;var t=Qt(),e=wl(),n=go(),r=n.Set,i=n.proto,o=t(i.forEach),s=t(i.keys),a=s(new r).next;return Av=function(l,u,c){return c?e({iterator:s(l),next:a},u):o(l,u)},Av}var Hv,oI;function mR(){if(oI)return Hv;oI=1;var t=go(),e=gd(),n=t.Set,r=t.add;return Hv=function(i){var o=new n;return e(i,function(s){r(o,s)}),o},Hv}var Nv,sI;function md(){if(sI)return Nv;sI=1;var t=O1(),e=go();return Nv=t(e.proto,"size","get")||function(n){return n.size},Nv}var Dv,aI;function mo(){return aI||(aI=1,Dv=function(t){return{iterator:t,next:t.next,done:!1}}),Dv}var kv,lI;function vl(){if(lI)return kv;lI=1;var t=mr(),e=cn(),n=un(),r=dd(),i=mo(),o="Invalid size",s=RangeError,a=TypeError,l=Math.max,u=function(c,h){this.set=c,this.size=l(h,0),this.has=t(c.has),this.keys=t(c.keys)};return u.prototype={getIterator:function(){return i(e(n(this.keys,this.set)))},includes:function(c){return n(this.has,this.set,c)}},kv=function(c){e(c);var h=+c.size;if(h!==h)throw new a(o);var d=r(h);if(d<0)throw new s(o);return new u(c,d)},kv}var Lv,uI;function jF(){if(uI)return Lv;uI=1;var t=pl(),e=go(),n=mR(),r=md(),i=vl(),o=gd(),s=wl(),a=e.has,l=e.remove;return Lv=function(c){var h=t(this),d=i(c),f=n(h);return r(h)<=d.size?o(h,function(m){d.includes(m)&&l(f,m)}):s(d.getIterator(),function(m){a(f,m)&&l(f,m)}),f},Lv}var $v,cI;function Cl(){if(cI)return $v;cI=1;var t=ju(),e=function(r){return{size:r,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},n=function(r){return{size:r,has:function(){return!0},keys:function(){throw new Error("e")}}};return $v=function(r,i){var o=t("Set");try{new o()[r](e(0));try{return new o()[r](e(-1)),!1}catch{if(!i)return!0;try{return new o()[r](n(-1/0)),!1}catch{var s=new o([1,2]);return i(s[r](n(1/0)))}}}catch{return!1}},$v}var hI;function UF(){if(hI)return eI;hI=1;var t=vt(),e=jF(),n=Jt(),r=Cl(),i=!r("difference",function(s){return s.size===0}),o=i||n(function(){var s={size:1,has:function(){return!0},keys:function(){var l=0;return{next:function(){var u=l++>1;return a.has(1)&&a.clear(),{done:u,value:2}}}}},a=new Set([1,2,3,4]);return a.difference(s).size!==3});return t({target:"Set",proto:!0,real:!0,forced:o},{difference:e}),eI}UF();var dI={},Fv,fI;function zF(){if(fI)return Fv;fI=1;var t=pl(),e=go(),n=md(),r=vl(),i=gd(),o=wl(),s=e.Set,a=e.add,l=e.has;return Fv=function(c){var h=t(this),d=r(c),f=new s;return n(h)>d.size?o(d.getIterator(),function(m){l(h,m)&&a(f,m)}):i(h,function(m){d.includes(m)&&a(f,m)}),f},Fv}var gI;function YF(){if(gI)return dI;gI=1;var t=vt(),e=Jt(),n=zF(),r=Cl(),i=!r("intersection",function(o){return o.size===2&&o.has(1)&&o.has(2)})||e(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});return t({target:"Set",proto:!0,real:!0,forced:i},{intersection:n}),dI}YF();var mI={},Vv,pI;function GF(){if(pI)return Vv;pI=1;var t=pl(),e=go().has,n=md(),r=vl(),i=gd(),o=wl(),s=pr();return Vv=function(l){var u=t(this),c=r(l);if(n(u)<=c.size)return i(u,function(d){if(c.includes(d))return!1},!0)!==!1;var h=c.getIterator();return o(h,function(d){if(e(u,d))return s(h,"normal",!1)})!==!1},Vv}var wI;function qF(){if(wI)return mI;wI=1;var t=vt(),e=GF(),n=Cl(),r=!n("isDisjointFrom",function(i){return!i});return t({target:"Set",proto:!0,real:!0,forced:r},{isDisjointFrom:e}),mI}qF();var vI={},Wv,CI;function KF(){if(CI)return Wv;CI=1;var t=pl(),e=md(),n=gd(),r=vl();return Wv=function(o){var s=t(this),a=r(o);return e(s)>a.size?!1:n(s,function(l){if(!a.includes(l))return!1},!0)!==!1},Wv}var yI;function XF(){if(yI)return vI;yI=1;var t=vt(),e=KF(),n=Cl(),r=!n("isSubsetOf",function(i){return i});return t({target:"Set",proto:!0,real:!0,forced:r},{isSubsetOf:e}),vI}XF();var SI={},Bv,bI;function ZF(){if(bI)return Bv;bI=1;var t=pl(),e=go().has,n=md(),r=vl(),i=wl(),o=pr();return Bv=function(a){var l=t(this),u=r(a);if(n(l)<u.size)return!1;var c=u.getIterator();return i(c,function(h){if(!e(l,h))return o(c,"normal",!1)})!==!1},Bv}var RI;function JF(){if(RI)return SI;RI=1;var t=vt(),e=ZF(),n=Cl(),r=!n("isSupersetOf",function(i){return!i});return t({target:"Set",proto:!0,real:!0,forced:r},{isSupersetOf:e}),SI}JF();var EI={},jv,TI;function QF(){if(TI)return jv;TI=1;var t=pl(),e=go(),n=mR(),r=vl(),i=wl(),o=e.add,s=e.has,a=e.remove;return jv=function(u){var c=t(this),h=r(u).getIterator(),d=n(c);return i(h,function(f){s(c,f)?a(d,f):o(d,f)}),d},jv}var Uv,_I;function F1(){return _I||(_I=1,Uv=function(t){try{var e=new Set,n={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return e.clear(),e.add(4),function(){return{done:!0}}}})}},r=e[t](n);return r.size===1&&r.values().next().value===4}catch{return!1}}),Uv}var MI;function eV(){if(MI)return EI;MI=1;var t=vt(),e=QF(),n=F1(),r=Cl(),i=!r("symmetricDifference")||!n("symmetricDifference");return t({target:"Set",proto:!0,real:!0,forced:i},{symmetricDifference:e}),EI}eV();var II={},zv,PI;function tV(){if(PI)return zv;PI=1;var t=pl(),e=go().add,n=mR(),r=vl(),i=wl();return zv=function(s){var a=t(this),l=r(s).getIterator(),u=n(a);return i(l,function(c){e(u,c)}),u},zv}var OI;function nV(){if(OI)return II;OI=1;var t=vt(),e=tV(),n=F1(),r=Cl(),i=!r("union")||!n("union");return t({target:"Set",proto:!0,real:!0,forced:i},{union:e}),II}nV();var xI={},AI={},Yv,HI;function rV(){if(HI)return Yv;HI=1;var t=cd(),e=TypeError;return Yv=function(n,r){if(t(r,n))return n;throw new e("Incorrect invocation")},Yv}var Gv,NI;function iV(){if(NI)return Gv;NI=1;var t=Jt();return Gv=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Gv}var qv,DI;function V1(){if(DI)return qv;DI=1;var t=Hr(),e=pn(),n=Uu(),r=uR(),i=iV(),o=r("IE_PROTO"),s=Object,a=s.prototype;return qv=i?s.getPrototypeOf:function(l){var u=n(l);if(t(u,o))return u[o];var c=u.constructor;return e(c)&&u instanceof c?c.prototype:u instanceof s?a:null},qv}var Kv,kI;function oV(){if(kI)return Kv;kI=1;var t=M1(),e=Zs();return Kv=function(n,r,i){return i.get&&t(i.get,r,{getter:!0}),i.set&&t(i.set,r,{setter:!0}),e.f(n,r,i)},Kv}var Xv={},Zv,LI;function sV(){if(LI)return Zv;LI=1;var t=I1(),e=fR();return Zv=Object.keys||function(r){return t(r,e)},Zv}var $I;function aV(){if($I)return Xv;$I=1;var t=Jr(),e=_1(),n=Zs(),r=cn(),i=ud(),o=sV();return Xv.f=t&&!e?Object.defineProperties:function(a,l){r(a);for(var u=i(l),c=o(l),h=c.length,d=0,f;h>d;)n.f(a,f=c[d++],u[f]);return a},Xv}var Jv,FI;function W1(){if(FI)return Jv;FI=1;var t=ju();return Jv=t("document","documentElement"),Jv}var Qv,VI;function pR(){if(VI)return Qv;VI=1;var t=cn(),e=aV(),n=fR(),r=cR(),i=W1(),o=lR(),s=uR(),a=">",l="<",u="prototype",c="script",h=s("IE_PROTO"),d=function(){},f=function(v){return l+c+a+v+l+"/"+c+a},m=function(v){v.write(f("")),v.close();var O=v.parentWindow.Object;return v=null,O},C=function(){var v=o("iframe"),O="java"+c+":",x;return v.style.display="none",i.appendChild(v),v.src=String(O),x=v.contentWindow.document,x.open(),x.write(f("document.F=Object")),x.close(),x.F},y,E=function(){try{y=new ActiveXObject("htmlfile")}catch{}E=typeof document<"u"?document.domain&&y?m(y):C():m(y);for(var v=n.length;v--;)delete E[u][n[v]];return E()};return r[h]=!0,Qv=Object.create||function(O,x){var F;return O!==null?(d[u]=t(O),F=new d,d[u]=null,F[h]=O):F=E(),x===void 0?F:e.f(F,x)},Qv}var eC,WI;function B1(){if(WI)return eC;WI=1;var t=Jt(),e=pn(),n=Ar(),r=pR(),i=V1(),o=dR(),s=Mi(),a=Xs(),l=s("iterator"),u=!1,c,h,d;[].keys&&(d=[].keys(),"next"in d?(h=i(i(d)),h!==Object.prototype&&(c=h)):u=!0);var f=!n(c)||t(function(){var m={};return c[l].call(m)!==m});return f?c={}:a&&(c=r(c)),e(c[l])||o(c,l,function(){return this}),eC={IteratorPrototype:c,BUGGY_SAFARI_ITERATORS:u},eC}var BI;function lV(){if(BI)return AI;BI=1;var t=vt(),e=Zt(),n=rV(),r=cn(),i=pn(),o=V1(),s=oV(),a=$1(),l=Jt(),u=Hr(),c=Mi(),h=B1().IteratorPrototype,d=Jr(),f=Xs(),m="constructor",C="Iterator",y=c("toStringTag"),E=TypeError,v=e[C],O=f||!i(v)||v.prototype!==h||!l(function(){v({})}),x=function(){if(n(this,h),o(this)===h)throw new E("Abstract class Iterator not directly constructable")},F=function(I,_){d?s(h,I,{configurable:!0,get:function(){return _},set:function(q){if(r(this),this===h)throw new E("You can't redefine this property");u(this,I)?this[I]=q:a(this,I,q)}}):h[I]=_};return u(h,y)||F(y,C),(O||!u(h,m)||h[m]===Object)&&F(m,x),x.prototype=h,t({global:!0,constructor:!0,forced:O},{Iterator:x}),AI}var jI;function uV(){return jI||(jI=1,lV()),xI}uV();var UI={},zI={},tC,YI;function cV(){if(YI)return tC;YI=1;var t=dR();return tC=function(e,n,r){for(var i in n)t(e,i,n[i],r);return e},tC}var nC,GI;function hV(){return GI||(GI=1,nC=function(t,e){return{value:t,done:e}}),nC}var rC,qI;function dV(){if(qI)return rC;qI=1;var t=pr();return rC=function(e,n,r){for(var i=e.length-1;i>=0;i--)if(e[i]!==void 0)try{r=t(e[i].iterator,n,r)}catch(o){n="throw",r=o}if(n==="throw")throw r;return r},rC}var iC,KI;function wR(){if(KI)return iC;KI=1;var t=un(),e=pR(),n=zu(),r=cV(),i=Mi(),o=hR(),s=hd(),a=B1().IteratorPrototype,l=hV(),u=pr(),c=dV(),h=i("toStringTag"),d="IteratorHelper",f="WrapForValidIterator",m="normal",C="throw",y=o.set,E=function(x){var F=o.getterFor(x?f:d);return r(e(a),{next:function(){var _=F(this);if(x)return _.nextHandler();if(_.done)return l(void 0,!0);try{var q=_.nextHandler();return _.returnHandlerResult?q:l(q,_.done)}catch(G){throw _.done=!0,G}},return:function(){var I=F(this),_=I.iterator;if(I.done=!0,x){var q=s(_,"return");return q?t(q,_):l(void 0,!0)}if(I.inner)try{u(I.inner.iterator,m)}catch(G){return u(_,C,G)}if(I.openIters)try{c(I.openIters,m)}catch(G){return u(_,C,G)}return _&&u(_,m),l(void 0,!0)}})},v=E(!0),O=E(!1);return n(O,h,"Iterator Helper"),iC=function(x,F,I){var _=function(G,U){U?(U.iterator=G.iterator,U.next=G.next):U=G,U.type=F?f:d,U.returnHandlerResult=!!I,U.nextHandler=x,U.counter=0,U.done=!1,y(this,U)};return _.prototype=F?v:O,_},iC}var oC,XI;function j1(){if(XI)return oC;XI=1;var t=cn(),e=pr();return oC=function(n,r,i,o){try{return o?r(t(i)[0],i[1]):r(i)}catch(s){e(n,"throw",s)}},oC}var sC,ZI;function vR(){return ZI||(ZI=1,sC=function(t,e){var n=typeof Iterator=="function"&&Iterator.prototype[t];if(n)try{n.call({next:null},e).next()}catch{return!0}}),sC}var aC,JI;function Js(){if(JI)return aC;JI=1;var t=Zt();return aC=function(e,n){var r=t.Iterator,i=r&&r.prototype,o=i&&i[e],s=!1;if(o)try{o.call({next:function(){return{done:!0}},return:function(){s=!0}},-1)}catch(a){a instanceof n||(s=!1)}if(!s)return o},aC}var QI;function fV(){if(QI)return zI;QI=1;var t=vt(),e=un(),n=mr(),r=cn(),i=mo(),o=wR(),s=j1(),a=Xs(),l=pr(),u=vR(),c=Js(),h=!a&&!u("filter",function(){}),d=!a&&!h&&c("filter",TypeError),f=a||h||d,m=o(function(){for(var C=this.iterator,y=this.predicate,E=this.next,v,O,x;;){if(v=r(e(E,C)),O=this.done=!!v.done,O)return;if(x=v.value,s(C,y,[x,this.counter++],!0))return x}});return t({target:"Iterator",proto:!0,real:!0,forced:f},{filter:function(y){r(this);try{n(y)}catch(E){l(this,"throw",E)}return d?e(d,this,y):new m(i(this),{predicate:y})}}),zI}var eP;function gV(){return eP||(eP=1,fV()),UI}gV();var tP={},nP={},rP;function mV(){if(rP)return nP;rP=1;var t=vt(),e=un(),n=Gu(),r=mr(),i=cn(),o=mo(),s=pr(),a=Js(),l=a("forEach",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{forEach:function(c){i(this);try{r(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;n(h,function(f){c(f,d++)},{IS_RECORD:!0})}}),nP}var iP;function pV(){return iP||(iP=1,mV()),tP}pV();var oP={},sP={},aP;function wV(){if(aP)return sP;aP=1;var t=vt(),e=un(),n=mr(),r=cn(),i=mo(),o=wR(),s=j1(),a=pr(),l=vR(),u=Js(),c=Xs(),h=!c&&!l("map",function(){}),d=!c&&!h&&u("map",TypeError),f=c||h||d,m=o(function(){var C=this.iterator,y=r(e(this.next,C)),E=this.done=!!y.done;if(!E)return s(C,this.mapper,[y.value,this.counter++],!0)});return t({target:"Iterator",proto:!0,real:!0,forced:f},{map:function(y){r(this);try{n(y)}catch(E){a(this,"throw",E)}return d?e(d,this,y):new m(i(this),{mapper:y})}}),sP}var lP;function vV(){return lP||(lP=1,wV()),oP}vV();var uP={},cP={},lC,hP;function CR(){if(hP)return lC;hP=1;var t=Qt();return lC=t([].slice),lC}var uC,dP;function U1(){if(dP)return uC;dP=1;var t=TypeError;return uC=function(e,n){if(e<n)throw new t("Not enough arguments");return e},uC}var cC,fP;function CV(){if(fP)return cC;fP=1;var t=Um();return cC=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),cC}var hC,gP;function z1(){if(gP)return hC;gP=1;var t=Zt(),e=Um(),n=ml(),r=function(i){return e.slice(0,i.length)===i};return hC=(function(){return r("Bun/")?"BUN":r("Cloudflare-Workers")?"CLOUDFLARE":r("Deno/")?"DENO":r("Node.js/")?"NODE":t.Bun&&typeof Bun.version=="string"?"BUN":t.Deno&&typeof Deno.version=="object"?"DENO":n(t.process)==="process"?"NODE":t.window&&t.document?"BROWSER":"REST"})(),hC}var dC,mP;function yV(){if(mP)return dC;mP=1;var t=z1();return dC=t==="NODE",dC}var fC,pP;function Y1(){if(pP)return fC;pP=1;var t=Zt(),e=fd(),n=k1(),r=pn(),i=Hr(),o=Jt(),s=W1(),a=CR(),l=lR(),u=U1(),c=CV(),h=yV(),d=t.setImmediate,f=t.clearImmediate,m=t.process,C=t.Dispatch,y=t.Function,E=t.MessageChannel,v=t.String,O=0,x={},F="onreadystatechange",I,_,q,G;o(function(){I=t.location});var U=function(ne){if(i(x,ne)){var se=x[ne];delete x[ne],se()}},J=function(ne){return function(){U(ne)}},te=function(ne){U(ne.data)},le=function(ne){t.postMessage(v(ne),I.protocol+"//"+I.host)};return(!d||!f)&&(d=function(se){u(arguments.length,1);var Ge=r(se)?se:y(se),ve=a(arguments,1);return x[++O]=function(){e(Ge,void 0,ve)},_(O),O},f=function(se){delete x[se]},h?_=function(ne){m.nextTick(J(ne))}:C&&C.now?_=function(ne){C.now(J(ne))}:E&&!c?(q=new E,G=q.port2,q.port1.onmessage=te,_=n(G.postMessage,G)):t.addEventListener&&r(t.postMessage)&&!t.importScripts&&I&&I.protocol!=="file:"&&!o(le)?(_=le,t.addEventListener("message",te,!1)):F in l("script")?_=function(ne){s.appendChild(l("script"))[F]=function(){s.removeChild(this),U(ne)}}:_=function(ne){setTimeout(J(ne),0)}),fC={set:d,clear:f},fC}var wP;function SV(){if(wP)return cP;wP=1;var t=vt(),e=Zt(),n=Y1().clear;return t({global:!0,bind:!0,enumerable:!0,forced:e.clearImmediate!==n},{clearImmediate:n}),cP}var vP={},gC,CP;function bV(){if(CP)return gC;CP=1;var t=Zt(),e=fd(),n=pn(),r=z1(),i=Um(),o=CR(),s=U1(),a=t.Function,l=/MSIE .\./.test(i)||r==="BUN"&&(function(){var u=t.Bun.version.split(".");return u.length<3||u[0]==="0"&&(u[1]<3||u[1]==="3"&&u[2]==="0")})();return gC=function(u,c){var h=c?2:1;return l?function(d,f){var m=s(arguments.length,1)>h,C=n(d)?d:a(d),y=m?o(arguments,h):[],E=m?function(){e(C,this,y)}:C;return c?u(E,f):u(E)}:u},gC}var yP;function RV(){if(yP)return vP;yP=1;var t=vt(),e=Zt(),n=Y1().set,r=bV(),i=e.setImmediate?r(n,!1):n;return t({global:!0,bind:!0,enumerable:!0,forced:e.setImmediate!==i},{setImmediate:i}),vP}var SP;function EV(){return SP||(SP=1,SV(),RV()),uP}EV();/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:G1,setPrototypeOf:bP,isFrozen:TV,getPrototypeOf:_V,getOwnPropertyDescriptor:MV}=Object;let{freeze:Gn,seal:Zr,create:QS}=Object,{apply:eb,construct:tb}=typeof Reflect<"u"&&Reflect;Gn||(Gn=function(e){return e});Zr||(Zr=function(e){return e});eb||(eb=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return e.apply(n,i)});tb||(tb=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new e(...r)});const $d=qn(Array.prototype.forEach),IV=qn(Array.prototype.lastIndexOf),RP=qn(Array.prototype.pop),ac=qn(Array.prototype.push),PV=qn(Array.prototype.splice),bg=qn(String.prototype.toLowerCase),mC=qn(String.prototype.toString),pC=qn(String.prototype.match),lc=qn(String.prototype.replace),OV=qn(String.prototype.indexOf),xV=qn(String.prototype.trim),di=qn(Object.prototype.hasOwnProperty),Ln=qn(RegExp.prototype.test),uc=AV(TypeError);function qn(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return eb(t,e,r)}}function AV(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return tb(t,n)}}function Ve(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:bg;bP&&bP(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const o=n(i);o!==i&&(TV(e)||(e[r]=o),i=o)}t[i]=!0}return t}function HV(t){for(let e=0;e<t.length;e++)di(t,e)||(t[e]=null);return t}function Xi(t){const e=QS(null);for(const[n,r]of G1(t))di(t,n)&&(Array.isArray(r)?e[n]=HV(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=Xi(r):e[n]=r);return e}function cc(t,e){for(;t!==null;){const r=MV(t,e);if(r){if(r.get)return qn(r.get);if(typeof r.value=="function")return qn(r.value)}t=_V(t)}function n(){return null}return n}const EP=Gn(["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"]),wC=Gn(["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"]),vC=Gn(["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"]),NV=Gn(["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"]),CC=Gn(["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"]),DV=Gn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),TP=Gn(["#text"]),_P=Gn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),yC=Gn(["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"]),MP=Gn(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Fd=Gn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),kV=Zr(/\{\{[\w\W]*|[\w\W]*\}\}/gm),LV=Zr(/<%[\w\W]*|[\w\W]*%>/gm),$V=Zr(/\$\{[\w\W]*/gm),FV=Zr(/^data-[\-\w.\u00B7-\uFFFF]+$/),VV=Zr(/^aria-[\-\w]+$/),q1=Zr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),WV=Zr(/^(?:\w+script|data):/i),BV=Zr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K1=Zr(/^html$/i),jV=Zr(/^[a-z][.\w]*(-[.\w]+)+$/i);var IP=Object.freeze({__proto__:null,ARIA_ATTR:VV,ATTR_WHITESPACE:BV,CUSTOM_ELEMENT:jV,DATA_ATTR:FV,DOCTYPE_NAME:K1,ERB_EXPR:LV,IS_ALLOWED_URI:q1,IS_SCRIPT_OR_DATA:WV,MUSTACHE_EXPR:kV,TMPLIT_EXPR:$V});const hc={element:1,text:3,progressingInstruction:7,comment:8,document:9},UV=function(){return typeof window>"u"?null:window},zV=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},PP=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function X1(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:UV();const e=Ce=>X1(Ce);if(e.version="3.3.1",e.removed=[],!t||!t.document||t.document.nodeType!==hc.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const r=n,i=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:u,NamedNodeMap:c=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:d,trustedTypes:f}=t,m=l.prototype,C=cc(m,"cloneNode"),y=cc(m,"remove"),E=cc(m,"nextSibling"),v=cc(m,"childNodes"),O=cc(m,"parentNode");if(typeof s=="function"){const Ce=n.createElement("template");Ce.content&&Ce.content.ownerDocument&&(n=Ce.content.ownerDocument)}let x,F="";const{implementation:I,createNodeIterator:_,createDocumentFragment:q,getElementsByTagName:G}=n,{importNode:U}=r;let J=PP();e.isSupported=typeof G1=="function"&&typeof O=="function"&&I&&I.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:te,ERB_EXPR:le,TMPLIT_EXPR:ne,DATA_ATTR:se,ARIA_ATTR:Ge,IS_SCRIPT_OR_DATA:ve,ATTR_WHITESPACE:Oe,CUSTOM_ELEMENT:it}=IP;let{IS_ALLOWED_URI:Le}=IP,P=null;const g=Ve({},[...EP,...wC,...vC,...CC,...TP]);let w=null;const p=Ve({},[..._P,...yC,...MP,...Fd]);let T=Object.seal(QS(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}})),M=null,V=null;const z=Object.seal(QS(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Y=!0,S=!0,R=!1,b=!0,L=!1,A=!0,k=!1,j=!1,N=!1,$=!1,B=!1,W=!1,K=!0,ae=!1;const de="user-content-";let Ie=!0,$e=!1,Ue={},be=null;const Fe=Ve({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let St=null;const xi=Ve({},["audio","video","img","source","image","track"]);let Ai=null;const Hi=Ve({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),bt="http://www.w3.org/1998/Math/MathML",kn="http://www.w3.org/2000/svg",ht="http://www.w3.org/1999/xhtml";let mt=ht,Be=!1,Zn=null;const kd=Ve({},[bt,kn,ht],mC);let na=Ve({},["mi","mo","mn","ms","mtext"]),Ld=Ve({},["annotation-xml"]);const Q$=Ve({},["title","style","font","a","script"]);let oc=null;const eF=["application/xhtml+xml","text/html"],tF="text/html";let hn=null,Tl=null;const nF=n.createElement("form"),YT=function(D){return D instanceof RegExp||D instanceof Function},Vp=function(){let D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Tl&&Tl===D)){if((!D||typeof D!="object")&&(D={}),D=Xi(D),oc=eF.indexOf(D.PARSER_MEDIA_TYPE)===-1?tF:D.PARSER_MEDIA_TYPE,hn=oc==="application/xhtml+xml"?mC:bg,P=di(D,"ALLOWED_TAGS")?Ve({},D.ALLOWED_TAGS,hn):g,w=di(D,"ALLOWED_ATTR")?Ve({},D.ALLOWED_ATTR,hn):p,Zn=di(D,"ALLOWED_NAMESPACES")?Ve({},D.ALLOWED_NAMESPACES,mC):kd,Ai=di(D,"ADD_URI_SAFE_ATTR")?Ve(Xi(Hi),D.ADD_URI_SAFE_ATTR,hn):Hi,St=di(D,"ADD_DATA_URI_TAGS")?Ve(Xi(xi),D.ADD_DATA_URI_TAGS,hn):xi,be=di(D,"FORBID_CONTENTS")?Ve({},D.FORBID_CONTENTS,hn):Fe,M=di(D,"FORBID_TAGS")?Ve({},D.FORBID_TAGS,hn):Xi({}),V=di(D,"FORBID_ATTR")?Ve({},D.FORBID_ATTR,hn):Xi({}),Ue=di(D,"USE_PROFILES")?D.USE_PROFILES:!1,Y=D.ALLOW_ARIA_ATTR!==!1,S=D.ALLOW_DATA_ATTR!==!1,R=D.ALLOW_UNKNOWN_PROTOCOLS||!1,b=D.ALLOW_SELF_CLOSE_IN_ATTR!==!1,L=D.SAFE_FOR_TEMPLATES||!1,A=D.SAFE_FOR_XML!==!1,k=D.WHOLE_DOCUMENT||!1,$=D.RETURN_DOM||!1,B=D.RETURN_DOM_FRAGMENT||!1,W=D.RETURN_TRUSTED_TYPE||!1,N=D.FORCE_BODY||!1,K=D.SANITIZE_DOM!==!1,ae=D.SANITIZE_NAMED_PROPS||!1,Ie=D.KEEP_CONTENT!==!1,$e=D.IN_PLACE||!1,Le=D.ALLOWED_URI_REGEXP||q1,mt=D.NAMESPACE||ht,na=D.MATHML_TEXT_INTEGRATION_POINTS||na,Ld=D.HTML_INTEGRATION_POINTS||Ld,T=D.CUSTOM_ELEMENT_HANDLING||{},D.CUSTOM_ELEMENT_HANDLING&&YT(D.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(T.tagNameCheck=D.CUSTOM_ELEMENT_HANDLING.tagNameCheck),D.CUSTOM_ELEMENT_HANDLING&&YT(D.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(T.attributeNameCheck=D.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),D.CUSTOM_ELEMENT_HANDLING&&typeof D.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(T.allowCustomizedBuiltInElements=D.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),L&&(S=!1),B&&($=!0),Ue&&(P=Ve({},TP),w=[],Ue.html===!0&&(Ve(P,EP),Ve(w,_P)),Ue.svg===!0&&(Ve(P,wC),Ve(w,yC),Ve(w,Fd)),Ue.svgFilters===!0&&(Ve(P,vC),Ve(w,yC),Ve(w,Fd)),Ue.mathMl===!0&&(Ve(P,CC),Ve(w,MP),Ve(w,Fd))),D.ADD_TAGS&&(typeof D.ADD_TAGS=="function"?z.tagCheck=D.ADD_TAGS:(P===g&&(P=Xi(P)),Ve(P,D.ADD_TAGS,hn))),D.ADD_ATTR&&(typeof D.ADD_ATTR=="function"?z.attributeCheck=D.ADD_ATTR:(w===p&&(w=Xi(w)),Ve(w,D.ADD_ATTR,hn))),D.ADD_URI_SAFE_ATTR&&Ve(Ai,D.ADD_URI_SAFE_ATTR,hn),D.FORBID_CONTENTS&&(be===Fe&&(be=Xi(be)),Ve(be,D.FORBID_CONTENTS,hn)),D.ADD_FORBID_CONTENTS&&(be===Fe&&(be=Xi(be)),Ve(be,D.ADD_FORBID_CONTENTS,hn)),Ie&&(P["#text"]=!0),k&&Ve(P,["html","head","body"]),P.table&&(Ve(P,["tbody"]),delete M.tbody),D.TRUSTED_TYPES_POLICY){if(typeof D.TRUSTED_TYPES_POLICY.createHTML!="function")throw uc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof D.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw uc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=D.TRUSTED_TYPES_POLICY,F=x.createHTML("")}else x===void 0&&(x=zV(f,i)),x!==null&&typeof F=="string"&&(F=x.createHTML(""));Gn&&Gn(D),Tl=D}},GT=Ve({},[...wC,...vC,...NV]),qT=Ve({},[...CC,...DV]),rF=function(D){let ee=O(D);(!ee||!ee.tagName)&&(ee={namespaceURI:mt,tagName:"template"});const ge=bg(D.tagName),It=bg(ee.tagName);return Zn[D.namespaceURI]?D.namespaceURI===kn?ee.namespaceURI===ht?ge==="svg":ee.namespaceURI===bt?ge==="svg"&&(It==="annotation-xml"||na[It]):!!GT[ge]:D.namespaceURI===bt?ee.namespaceURI===ht?ge==="math":ee.namespaceURI===kn?ge==="math"&&Ld[It]:!!qT[ge]:D.namespaceURI===ht?ee.namespaceURI===kn&&!Ld[It]||ee.namespaceURI===bt&&!na[It]?!1:!qT[ge]&&(Q$[ge]||!GT[ge]):!!(oc==="application/xhtml+xml"&&Zn[D.namespaceURI]):!1},Ni=function(D){ac(e.removed,{element:D});try{O(D).removeChild(D)}catch{y(D)}},ra=function(D,ee){try{ac(e.removed,{attribute:ee.getAttributeNode(D),from:ee})}catch{ac(e.removed,{attribute:null,from:ee})}if(ee.removeAttribute(D),D==="is")if($||B)try{Ni(ee)}catch{}else try{ee.setAttribute(D,"")}catch{}},KT=function(D){let ee=null,ge=null;if(N)D="<remove></remove>"+D;else{const tn=pC(D,/^[\r\n\t ]+/);ge=tn&&tn[0]}oc==="application/xhtml+xml"&&mt===ht&&(D='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+D+"</body></html>");const It=x?x.createHTML(D):D;if(mt===ht)try{ee=new d().parseFromString(It,oc)}catch{}if(!ee||!ee.documentElement){ee=I.createDocument(mt,"template",null);try{ee.documentElement.innerHTML=Be?F:It}catch{}}const Tn=ee.body||ee.documentElement;return D&&ge&&Tn.insertBefore(n.createTextNode(ge),Tn.childNodes[0]||null),mt===ht?G.call(ee,k?"html":"body")[0]:k?ee.documentElement:Tn},XT=function(D){return _.call(D.ownerDocument||D,D,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Wp=function(D){return D instanceof h&&(typeof D.nodeName!="string"||typeof D.textContent!="string"||typeof D.removeChild!="function"||!(D.attributes instanceof c)||typeof D.removeAttribute!="function"||typeof D.setAttribute!="function"||typeof D.namespaceURI!="string"||typeof D.insertBefore!="function"||typeof D.hasChildNodes!="function")},ZT=function(D){return typeof a=="function"&&D instanceof a};function Co(Ce,D,ee){$d(Ce,ge=>{ge.call(e,D,ee,Tl)})}const JT=function(D){let ee=null;if(Co(J.beforeSanitizeElements,D,null),Wp(D))return Ni(D),!0;const ge=hn(D.nodeName);if(Co(J.uponSanitizeElement,D,{tagName:ge,allowedTags:P}),A&&D.hasChildNodes()&&!ZT(D.firstElementChild)&&Ln(/<[/\w!]/g,D.innerHTML)&&Ln(/<[/\w!]/g,D.textContent)||D.nodeType===hc.progressingInstruction||A&&D.nodeType===hc.comment&&Ln(/<[/\w]/g,D.data))return Ni(D),!0;if(!(z.tagCheck instanceof Function&&z.tagCheck(ge))&&(!P[ge]||M[ge])){if(!M[ge]&&e_(ge)&&(T.tagNameCheck instanceof RegExp&&Ln(T.tagNameCheck,ge)||T.tagNameCheck instanceof Function&&T.tagNameCheck(ge)))return!1;if(Ie&&!be[ge]){const It=O(D)||D.parentNode,Tn=v(D)||D.childNodes;if(Tn&&It){const tn=Tn.length;for(let Jn=tn-1;Jn>=0;--Jn){const yo=C(Tn[Jn],!0);yo.__removalCount=(D.__removalCount||0)+1,It.insertBefore(yo,E(D))}}}return Ni(D),!0}return D instanceof l&&!rF(D)||(ge==="noscript"||ge==="noembed"||ge==="noframes")&&Ln(/<\/no(script|embed|frames)/i,D.innerHTML)?(Ni(D),!0):(L&&D.nodeType===hc.text&&(ee=D.textContent,$d([te,le,ne],It=>{ee=lc(ee,It," ")}),D.textContent!==ee&&(ac(e.removed,{element:D.cloneNode()}),D.textContent=ee)),Co(J.afterSanitizeElements,D,null),!1)},QT=function(D,ee,ge){if(K&&(ee==="id"||ee==="name")&&(ge in n||ge in nF))return!1;if(!(S&&!V[ee]&&Ln(se,ee))){if(!(Y&&Ln(Ge,ee))){if(!(z.attributeCheck instanceof Function&&z.attributeCheck(ee,D))){if(!w[ee]||V[ee]){if(!(e_(D)&&(T.tagNameCheck instanceof RegExp&&Ln(T.tagNameCheck,D)||T.tagNameCheck instanceof Function&&T.tagNameCheck(D))&&(T.attributeNameCheck instanceof RegExp&&Ln(T.attributeNameCheck,ee)||T.attributeNameCheck instanceof Function&&T.attributeNameCheck(ee,D))||ee==="is"&&T.allowCustomizedBuiltInElements&&(T.tagNameCheck instanceof RegExp&&Ln(T.tagNameCheck,ge)||T.tagNameCheck instanceof Function&&T.tagNameCheck(ge))))return!1}else if(!Ai[ee]){if(!Ln(Le,lc(ge,Oe,""))){if(!((ee==="src"||ee==="xlink:href"||ee==="href")&&D!=="script"&&OV(ge,"data:")===0&&St[D])){if(!(R&&!Ln(ve,lc(ge,Oe,"")))){if(ge)return!1}}}}}}}return!0},e_=function(D){return D!=="annotation-xml"&&pC(D,it)},t_=function(D){Co(J.beforeSanitizeAttributes,D,null);const{attributes:ee}=D;if(!ee||Wp(D))return;const ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:w,forceKeepAttr:void 0};let It=ee.length;for(;It--;){const Tn=ee[It],{name:tn,namespaceURI:Jn,value:yo}=Tn,_l=hn(tn),Bp=yo;let Sn=tn==="value"?Bp:xV(Bp);if(ge.attrName=_l,ge.attrValue=Sn,ge.keepAttr=!0,ge.forceKeepAttr=void 0,Co(J.uponSanitizeAttribute,D,ge),Sn=ge.attrValue,ae&&(_l==="id"||_l==="name")&&(ra(tn,D),Sn=de+Sn),A&&Ln(/((--!?|])>)|<\/(style|title|textarea)/i,Sn)){ra(tn,D);continue}if(_l==="attributename"&&pC(Sn,"href")){ra(tn,D);continue}if(ge.forceKeepAttr)continue;if(!ge.keepAttr){ra(tn,D);continue}if(!b&&Ln(/\/>/i,Sn)){ra(tn,D);continue}L&&$d([te,le,ne],r_=>{Sn=lc(Sn,r_," ")});const n_=hn(D.nodeName);if(!QT(n_,_l,Sn)){ra(tn,D);continue}if(x&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Jn)switch(f.getAttributeType(n_,_l)){case"TrustedHTML":{Sn=x.createHTML(Sn);break}case"TrustedScriptURL":{Sn=x.createScriptURL(Sn);break}}if(Sn!==Bp)try{Jn?D.setAttributeNS(Jn,tn,Sn):D.setAttribute(tn,Sn),Wp(D)?Ni(D):RP(e.removed)}catch{ra(tn,D)}}Co(J.afterSanitizeAttributes,D,null)},iF=function Ce(D){let ee=null;const ge=XT(D);for(Co(J.beforeSanitizeShadowDOM,D,null);ee=ge.nextNode();)Co(J.uponSanitizeShadowNode,ee,null),JT(ee),t_(ee),ee.content instanceof o&&Ce(ee.content);Co(J.afterSanitizeShadowDOM,D,null)};return e.sanitize=function(Ce){let D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee=null,ge=null,It=null,Tn=null;if(Be=!Ce,Be&&(Ce="<!-->"),typeof Ce!="string"&&!ZT(Ce))if(typeof Ce.toString=="function"){if(Ce=Ce.toString(),typeof Ce!="string")throw uc("dirty is not a string, aborting")}else throw uc("toString is not a function");if(!e.isSupported)return Ce;if(j||Vp(D),e.removed=[],typeof Ce=="string"&&($e=!1),$e){if(Ce.nodeName){const yo=hn(Ce.nodeName);if(!P[yo]||M[yo])throw uc("root node is forbidden and cannot be sanitized in-place")}}else if(Ce instanceof a)ee=KT("<!---->"),ge=ee.ownerDocument.importNode(Ce,!0),ge.nodeType===hc.element&&ge.nodeName==="BODY"||ge.nodeName==="HTML"?ee=ge:ee.appendChild(ge);else{if(!$&&!L&&!k&&Ce.indexOf("<")===-1)return x&&W?x.createHTML(Ce):Ce;if(ee=KT(Ce),!ee)return $?null:W?F:""}ee&&N&&Ni(ee.firstChild);const tn=XT($e?Ce:ee);for(;It=tn.nextNode();)JT(It),t_(It),It.content instanceof o&&iF(It.content);if($e)return Ce;if($){if(B)for(Tn=q.call(ee.ownerDocument);ee.firstChild;)Tn.appendChild(ee.firstChild);else Tn=ee;return(w.shadowroot||w.shadowrootmode)&&(Tn=U.call(r,Tn,!0)),Tn}let Jn=k?ee.outerHTML:ee.innerHTML;return k&&P["!doctype"]&&ee.ownerDocument&&ee.ownerDocument.doctype&&ee.ownerDocument.doctype.name&&Ln(K1,ee.ownerDocument.doctype.name)&&(Jn="<!DOCTYPE "+ee.ownerDocument.doctype.name+`>
18
- `+Jn),L&&$d([te,le,ne],yo=>{Jn=lc(Jn,yo," ")}),x&&W?x.createHTML(Jn):Jn},e.setConfig=function(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vp(Ce),j=!0},e.clearConfig=function(){Tl=null,j=!1},e.isValidAttribute=function(Ce,D,ee){Tl||Vp({});const ge=hn(Ce),It=hn(D);return QT(ge,It,ee)},e.addHook=function(Ce,D){typeof D=="function"&&ac(J[Ce],D)},e.removeHook=function(Ce,D){if(D!==void 0){const ee=IV(J[Ce],D);return ee===-1?void 0:PV(J[Ce],ee,1)[0]}return RP(J[Ce])},e.removeHooks=function(Ce){J[Ce]=[]},e.removeAllHooks=function(){J=PP()},e}var YV=X1();//! moment.js
19
- //! version : 2.30.1
20
- //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
21
- //! license : MIT
22
- //! momentjs.com
23
- var Z1;function Z(){return Z1.apply(null,arguments)}function GV(t){Z1=t}function Ri(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function nl(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function nt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function yR(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(nt(t,e))return!1;return!0}function lr(t){return t===void 0}function ns(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function pd(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function J1(t,e){var n=[],r,i=t.length;for(r=0;r<i;++r)n.push(e(t[r],r));return n}function Ls(t,e){for(var n in e)nt(e,n)&&(t[n]=e[n]);return nt(e,"toString")&&(t.toString=e.toString),nt(e,"valueOf")&&(t.valueOf=e.valueOf),t}function po(t,e,n,r){return SN(t,e,n,r,!0).utc()}function qV(){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 Ae(t){return t._pf==null&&(t._pf=qV()),t._pf}var nb;Array.prototype.some?nb=Array.prototype.some:nb=function(t){var e=Object(this),n=e.length>>>0,r;for(r=0;r<n;r++)if(r in e&&t.call(this,e[r],r,e))return!0;return!1};function SR(t){var e=null,n=!1,r=t._d&&!isNaN(t._d.getTime());if(r&&(e=Ae(t),n=nb.call(e.parsedDateParts,function(i){return i!=null}),r=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&n),t._strict&&(r=r&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=r;else return r;return t._isValid}function Gm(t){var e=po(NaN);return t!=null?Ls(Ae(e),t):Ae(e).userInvalidated=!0,e}var OP=Z.momentProperties=[],SC=!1;function bR(t,e){var n,r,i,o=OP.length;if(lr(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),lr(e._i)||(t._i=e._i),lr(e._f)||(t._f=e._f),lr(e._l)||(t._l=e._l),lr(e._strict)||(t._strict=e._strict),lr(e._tzm)||(t._tzm=e._tzm),lr(e._isUTC)||(t._isUTC=e._isUTC),lr(e._offset)||(t._offset=e._offset),lr(e._pf)||(t._pf=Ae(e)),lr(e._locale)||(t._locale=e._locale),o>0)for(n=0;n<o;n++)r=OP[n],i=e[r],lr(i)||(t[r]=i);return t}function wd(t){bR(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),SC===!1&&(SC=!0,Z.updateOffset(this),SC=!1)}function Ei(t){return t instanceof wd||t!=null&&t._isAMomentObject!=null}function Q1(t){Z.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function Qr(t,e){var n=!0;return Ls(function(){if(Z.deprecationHandler!=null&&Z.deprecationHandler(null,t),n){var r=[],i,o,s,a=arguments.length;for(o=0;o<a;o++){if(i="",typeof arguments[o]=="object"){i+=`
24
- [`+o+"] ";for(s in arguments[0])nt(arguments[0],s)&&(i+=s+": "+arguments[0][s]+", ");i=i.slice(0,-2)}else i=arguments[o];r.push(i)}Q1(t+`
25
- Arguments: `+Array.prototype.slice.call(r).join("")+`
26
- `+new Error().stack),n=!1}return e.apply(this,arguments)},e)}var xP={};function eN(t,e){Z.deprecationHandler!=null&&Z.deprecationHandler(t,e),xP[t]||(Q1(e),xP[t]=!0)}Z.suppressDeprecationWarnings=!1;Z.deprecationHandler=null;function wo(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function KV(t){var e,n;for(n in t)nt(t,n)&&(e=t[n],wo(e)?this[n]=e:this["_"+n]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function rb(t,e){var n=Ls({},t),r;for(r in e)nt(e,r)&&(nl(t[r])&&nl(e[r])?(n[r]={},Ls(n[r],t[r]),Ls(n[r],e[r])):e[r]!=null?n[r]=e[r]:delete n[r]);for(r in t)nt(t,r)&&!nt(e,r)&&nl(t[r])&&(n[r]=Ls({},n[r]));return n}function RR(t){t!=null&&this.set(t)}var ib;Object.keys?ib=Object.keys:ib=function(t){var e,n=[];for(e in t)nt(t,e)&&n.push(e);return n};var XV={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function ZV(t,e,n){var r=this._calendar[t]||this._calendar.sameElse;return wo(r)?r.call(e,n):r}function ho(t,e,n){var r=""+Math.abs(t),i=e-r.length,o=t>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var ER=/(\[[^\[]*\])|(\\)?([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,Vd=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,bC={},_u={};function Se(t,e,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),t&&(_u[t]=i),e&&(_u[e[0]]=function(){return ho(i.apply(this,arguments),e[1],e[2])}),n&&(_u[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function JV(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function QV(t){var e=t.match(ER),n,r;for(n=0,r=e.length;n<r;n++)_u[e[n]]?e[n]=_u[e[n]]:e[n]=JV(e[n]);return function(i){var o="",s;for(s=0;s<r;s++)o+=wo(e[s])?e[s].call(i,t):e[s];return o}}function Rg(t,e){return t.isValid()?(e=tN(e,t.localeData()),bC[e]=bC[e]||QV(e),bC[e](t)):t.localeData().invalidDate()}function tN(t,e){var n=5;function r(i){return e.longDateFormat(i)||i}for(Vd.lastIndex=0;n>=0&&Vd.test(t);)t=t.replace(Vd,r),Vd.lastIndex=0,n-=1;return t}var eW={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 tW(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(ER).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[t])}var nW="Invalid date";function rW(){return this._invalidDate}var iW="%d",oW=/\d{1,2}/;function sW(t){return this._ordinal.replace("%d",t)}var aW={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 lW(t,e,n,r){var i=this._relativeTime[n];return wo(i)?i(t,e,n,r):i.replace(/%d/i,t)}function uW(t,e){var n=this._relativeTime[t>0?"future":"past"];return wo(n)?n(e):n.replace(/%s/i,e)}var AP={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 ei(t){return typeof t=="string"?AP[t]||AP[t.toLowerCase()]:void 0}function TR(t){var e={},n,r;for(r in t)nt(t,r)&&(n=ei(r),n&&(e[n]=t[r]));return e}var cW={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 hW(t){var e=[],n;for(n in t)nt(t,n)&&e.push({unit:n,priority:cW[n]});return e.sort(function(r,i){return r.priority-i.priority}),e}var nN=/\d/,Nr=/\d\d/,rN=/\d{3}/,_R=/\d{4}/,qm=/[+-]?\d{6}/,Mt=/\d\d?/,iN=/\d\d\d\d?/,oN=/\d\d\d\d\d\d?/,Km=/\d{1,3}/,MR=/\d{1,4}/,Xm=/[+-]?\d{1,6}/,qu=/\d+/,Zm=/[+-]?\d+/,dW=/Z|[+-]\d\d:?\d\d/gi,Jm=/Z|[+-]\d\d(?::?\d\d)?/gi,fW=/[+-]?\d+(\.\d{1,3})?/,vd=/[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,Ku=/^[1-9]\d?/,IR=/^([1-9]\d|\d)/,zg;zg={};function ce(t,e,n){zg[t]=wo(e)?e:function(r,i){return r&&n?n:e}}function gW(t,e){return nt(zg,t)?zg[t](e._strict,e._locale):new RegExp(mW(t))}function mW(t){return Qo(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,n,r,i,o){return n||r||i||o}))}function Qo(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Gr(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function Ye(t){var e=+t,n=0;return e!==0&&isFinite(e)&&(n=Gr(e)),n}var ob={};function pt(t,e){var n,r=e,i;for(typeof t=="string"&&(t=[t]),ns(e)&&(r=function(o,s){s[e]=Ye(o)}),i=t.length,n=0;n<i;n++)ob[t[n]]=r}function Cd(t,e){pt(t,function(n,r,i,o){i._w=i._w||{},e(n,i._w,i,o)})}function pW(t,e,n){e!=null&&nt(ob,t)&&ob[t](e,n._a,n,t)}function Qm(t){return t%4===0&&t%100!==0||t%400===0}var Dn=0,zo=1,so=2,mn=3,yi=4,Yo=5,Xa=6,wW=7,vW=8;Se("Y",0,0,function(){var t=this.year();return t<=9999?ho(t,4):"+"+t});Se(0,["YY",2],0,function(){return this.year()%100});Se(0,["YYYY",4],0,"year");Se(0,["YYYYY",5],0,"year");Se(0,["YYYYYY",6,!0],0,"year");ce("Y",Zm);ce("YY",Mt,Nr);ce("YYYY",MR,_R);ce("YYYYY",Xm,qm);ce("YYYYYY",Xm,qm);pt(["YYYYY","YYYYYY"],Dn);pt("YYYY",function(t,e){e[Dn]=t.length===2?Z.parseTwoDigitYear(t):Ye(t)});pt("YY",function(t,e){e[Dn]=Z.parseTwoDigitYear(t)});pt("Y",function(t,e){e[Dn]=parseInt(t,10)});function wh(t){return Qm(t)?366:365}Z.parseTwoDigitYear=function(t){return Ye(t)+(Ye(t)>68?1900:2e3)};var sN=Xu("FullYear",!0);function CW(){return Qm(this.year())}function Xu(t,e){return function(n){return n!=null?(aN(this,t,n),Z.updateOffset(this,e),this):Vh(this,t)}}function Vh(t,e){if(!t.isValid())return NaN;var n=t._d,r=t._isUTC;switch(e){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function aN(t,e,n){var r,i,o,s,a;if(!(!t.isValid()||isNaN(n))){switch(r=t._d,i=t._isUTC,e){case"Milliseconds":return void(i?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(i?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(i?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(i?r.setUTCHours(n):r.setHours(n));case"Date":return void(i?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}o=n,s=t.month(),a=t.date(),a=a===29&&s===1&&!Qm(o)?28:a,i?r.setUTCFullYear(o,s,a):r.setFullYear(o,s,a)}}function yW(t){return t=ei(t),wo(this[t])?this[t]():this}function SW(t,e){if(typeof t=="object"){t=TR(t);var n=hW(t),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](t[n[r].unit])}else if(t=ei(t),wo(this[t]))return this[t](e);return this}function bW(t,e){return(t%e+e)%e}var Kt;Array.prototype.indexOf?Kt=Array.prototype.indexOf:Kt=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function PR(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=bW(e,12);return t+=(e-n)/12,n===1?Qm(t)?29:28:31-n%7%2}Se("M",["MM",2],"Mo",function(){return this.month()+1});Se("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)});Se("MMMM",0,0,function(t){return this.localeData().months(this,t)});ce("M",Mt,Ku);ce("MM",Mt,Nr);ce("MMM",function(t,e){return e.monthsShortRegex(t)});ce("MMMM",function(t,e){return e.monthsRegex(t)});pt(["M","MM"],function(t,e){e[zo]=Ye(t)-1});pt(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);i!=null?e[zo]=i:Ae(n).invalidMonth=t});var RW="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),lN="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),uN=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,EW=vd,TW=vd;function _W(t,e){return t?Ri(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||uN).test(e)?"format":"standalone"][t.month()]:Ri(this._months)?this._months:this._months.standalone}function MW(t,e){return t?Ri(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[uN.test(e)?"format":"standalone"][t.month()]:Ri(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function IW(t,e,n){var r,i,o,s=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)o=po([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(o,"").toLocaleLowerCase();return n?e==="MMM"?(i=Kt.call(this._shortMonthsParse,s),i!==-1?i:null):(i=Kt.call(this._longMonthsParse,s),i!==-1?i:null):e==="MMM"?(i=Kt.call(this._shortMonthsParse,s),i!==-1?i:(i=Kt.call(this._longMonthsParse,s),i!==-1?i:null)):(i=Kt.call(this._longMonthsParse,s),i!==-1?i:(i=Kt.call(this._shortMonthsParse,s),i!==-1?i:null))}function PW(t,e,n){var r,i,o;if(this._monthsParseExact)return IW.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=po([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&e==="MMMM"&&this._longMonthsParse[r].test(t))return r;if(n&&e==="MMM"&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function cN(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=Ye(e);else if(e=t.localeData().monthsParse(e),!ns(e))return t}var n=e,r=t.date();return r=r<29?r:Math.min(r,PR(t.year(),n)),t._isUTC?t._d.setUTCMonth(n,r):t._d.setMonth(n,r),t}function hN(t){return t!=null?(cN(this,t),Z.updateOffset(this,!0),this):Vh(this,"Month")}function OW(){return PR(this.year(),this.month())}function xW(t){return this._monthsParseExact?(nt(this,"_monthsRegex")||dN.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(nt(this,"_monthsShortRegex")||(this._monthsShortRegex=EW),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function AW(t){return this._monthsParseExact?(nt(this,"_monthsRegex")||dN.call(this),t?this._monthsStrictRegex:this._monthsRegex):(nt(this,"_monthsRegex")||(this._monthsRegex=TW),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function dN(){function t(l,u){return u.length-l.length}var e=[],n=[],r=[],i,o,s,a;for(i=0;i<12;i++)o=po([2e3,i]),s=Qo(this.monthsShort(o,"")),a=Qo(this.months(o,"")),e.push(s),n.push(a),r.push(a),r.push(s);e.sort(t),n.sort(t),r.sort(t),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function HW(t,e,n,r,i,o,s){var a;return t<100&&t>=0?(a=new Date(t+400,e,n,r,i,o,s),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,n,r,i,o,s),a}function Wh(t){var e,n;return t<100&&t>=0?(n=Array.prototype.slice.call(arguments),n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function Yg(t,e,n){var r=7+e-n,i=(7+Wh(t,0,r).getUTCDay()-e)%7;return-i+r-1}function fN(t,e,n,r,i){var o=(7+n-r)%7,s=Yg(t,r,i),a=1+7*(e-1)+o+s,l,u;return a<=0?(l=t-1,u=wh(l)+a):a>wh(t)?(l=t+1,u=a-wh(t)):(l=t,u=a),{year:l,dayOfYear:u}}function Bh(t,e,n){var r=Yg(t.year(),e,n),i=Math.floor((t.dayOfYear()-r-1)/7)+1,o,s;return i<1?(s=t.year()-1,o=i+es(s,e,n)):i>es(t.year(),e,n)?(o=i-es(t.year(),e,n),s=t.year()+1):(s=t.year(),o=i),{week:o,year:s}}function es(t,e,n){var r=Yg(t,e,n),i=Yg(t+1,e,n);return(wh(t)-r+i)/7}Se("w",["ww",2],"wo","week");Se("W",["WW",2],"Wo","isoWeek");ce("w",Mt,Ku);ce("ww",Mt,Nr);ce("W",Mt,Ku);ce("WW",Mt,Nr);Cd(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=Ye(t)});function NW(t){return Bh(t,this._week.dow,this._week.doy).week}var DW={dow:0,doy:6};function kW(){return this._week.dow}function LW(){return this._week.doy}function $W(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function FW(t){var e=Bh(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}Se("d",0,"do","day");Se("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)});Se("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)});Se("dddd",0,0,function(t){return this.localeData().weekdays(this,t)});Se("e",0,0,"weekday");Se("E",0,0,"isoWeekday");ce("d",Mt);ce("e",Mt);ce("E",Mt);ce("dd",function(t,e){return e.weekdaysMinRegex(t)});ce("ddd",function(t,e){return e.weekdaysShortRegex(t)});ce("dddd",function(t,e){return e.weekdaysRegex(t)});Cd(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);i!=null?e.d=i:Ae(n).invalidWeekday=t});Cd(["d","e","E"],function(t,e,n,r){e[r]=Ye(t)});function VW(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function WW(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function OR(t,e){return t.slice(e,7).concat(t.slice(0,e))}var BW="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),gN="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),jW="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),UW=vd,zW=vd,YW=vd;function GW(t,e){var n=Ri(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?OR(n,this._week.dow):t?n[t.day()]:n}function qW(t){return t===!0?OR(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function KW(t){return t===!0?OR(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function XW(t,e,n){var r,i,o,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=po([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?e==="dddd"?(i=Kt.call(this._weekdaysParse,s),i!==-1?i:null):e==="ddd"?(i=Kt.call(this._shortWeekdaysParse,s),i!==-1?i:null):(i=Kt.call(this._minWeekdaysParse,s),i!==-1?i:null):e==="dddd"?(i=Kt.call(this._weekdaysParse,s),i!==-1||(i=Kt.call(this._shortWeekdaysParse,s),i!==-1)?i:(i=Kt.call(this._minWeekdaysParse,s),i!==-1?i:null)):e==="ddd"?(i=Kt.call(this._shortWeekdaysParse,s),i!==-1||(i=Kt.call(this._weekdaysParse,s),i!==-1)?i:(i=Kt.call(this._minWeekdaysParse,s),i!==-1?i:null)):(i=Kt.call(this._minWeekdaysParse,s),i!==-1||(i=Kt.call(this._weekdaysParse,s),i!==-1)?i:(i=Kt.call(this._shortWeekdaysParse,s),i!==-1?i:null))}function ZW(t,e,n){var r,i,o;if(this._weekdaysParseExact)return XW.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=po([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&e==="dddd"&&this._fullWeekdaysParse[r].test(t))return r;if(n&&e==="ddd"&&this._shortWeekdaysParse[r].test(t))return r;if(n&&e==="dd"&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function JW(t){if(!this.isValid())return t!=null?this:NaN;var e=Vh(this,"Day");return t!=null?(t=VW(t,this.localeData()),this.add(t-e,"d")):e}function QW(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function eB(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=WW(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function tB(t){return this._weekdaysParseExact?(nt(this,"_weekdaysRegex")||xR.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(nt(this,"_weekdaysRegex")||(this._weekdaysRegex=UW),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function nB(t){return this._weekdaysParseExact?(nt(this,"_weekdaysRegex")||xR.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(nt(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=zW),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function rB(t){return this._weekdaysParseExact?(nt(this,"_weekdaysRegex")||xR.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(nt(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=YW),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function xR(){function t(c,h){return h.length-c.length}var e=[],n=[],r=[],i=[],o,s,a,l,u;for(o=0;o<7;o++)s=po([2e3,1]).day(o),a=Qo(this.weekdaysMin(s,"")),l=Qo(this.weekdaysShort(s,"")),u=Qo(this.weekdays(s,"")),e.push(a),n.push(l),r.push(u),i.push(a),i.push(l),i.push(u);e.sort(t),n.sort(t),r.sort(t),i.sort(t),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function AR(){return this.hours()%12||12}function iB(){return this.hours()||24}Se("H",["HH",2],0,"hour");Se("h",["hh",2],0,AR);Se("k",["kk",2],0,iB);Se("hmm",0,0,function(){return""+AR.apply(this)+ho(this.minutes(),2)});Se("hmmss",0,0,function(){return""+AR.apply(this)+ho(this.minutes(),2)+ho(this.seconds(),2)});Se("Hmm",0,0,function(){return""+this.hours()+ho(this.minutes(),2)});Se("Hmmss",0,0,function(){return""+this.hours()+ho(this.minutes(),2)+ho(this.seconds(),2)});function mN(t,e){Se(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}mN("a",!0);mN("A",!1);function pN(t,e){return e._meridiemParse}ce("a",pN);ce("A",pN);ce("H",Mt,IR);ce("h",Mt,Ku);ce("k",Mt,Ku);ce("HH",Mt,Nr);ce("hh",Mt,Nr);ce("kk",Mt,Nr);ce("hmm",iN);ce("hmmss",oN);ce("Hmm",iN);ce("Hmmss",oN);pt(["H","HH"],mn);pt(["k","kk"],function(t,e,n){var r=Ye(t);e[mn]=r===24?0:r});pt(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t});pt(["h","hh"],function(t,e,n){e[mn]=Ye(t),Ae(n).bigHour=!0});pt("hmm",function(t,e,n){var r=t.length-2;e[mn]=Ye(t.substr(0,r)),e[yi]=Ye(t.substr(r)),Ae(n).bigHour=!0});pt("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[mn]=Ye(t.substr(0,r)),e[yi]=Ye(t.substr(r,2)),e[Yo]=Ye(t.substr(i)),Ae(n).bigHour=!0});pt("Hmm",function(t,e,n){var r=t.length-2;e[mn]=Ye(t.substr(0,r)),e[yi]=Ye(t.substr(r))});pt("Hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[mn]=Ye(t.substr(0,r)),e[yi]=Ye(t.substr(r,2)),e[Yo]=Ye(t.substr(i))});function oB(t){return(t+"").toLowerCase().charAt(0)==="p"}var sB=/[ap]\.?m?\.?/i,aB=Xu("Hours",!0);function lB(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var wN={calendar:XV,longDateFormat:eW,invalidDate:nW,ordinal:iW,dayOfMonthOrdinalParse:oW,relativeTime:aW,months:RW,monthsShort:lN,week:DW,weekdays:BW,weekdaysMin:jW,weekdaysShort:gN,meridiemParse:sB},Pt={},dc={},jh;function uB(t,e){var n,r=Math.min(t.length,e.length);for(n=0;n<r;n+=1)if(t[n]!==e[n])return n;return r}function HP(t){return t&&t.toLowerCase().replace("_","-")}function cB(t){for(var e=0,n,r,i,o;e<t.length;){for(o=HP(t[e]).split("-"),n=o.length,r=HP(t[e+1]),r=r?r.split("-"):null;n>0;){if(i=ep(o.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&uB(o,r)>=n-1)break;n--}e++}return jh}function hB(t){return!!(t&&t.match("^[^/\\\\]*$"))}function ep(t){var e=null,n;if(Pt[t]===void 0&&typeof module<"u"&&module&&module.exports&&hB(t))try{e=jh._abbr,n=require,n("./locale/"+t),Us(e)}catch{Pt[t]=null}return Pt[t]}function Us(t,e){var n;return t&&(lr(e)?n=as(t):n=HR(t,e),n?jh=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),jh._abbr}function HR(t,e){if(e!==null){var n,r=wN;if(e.abbr=t,Pt[t]!=null)eN("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=Pt[t]._config;else if(e.parentLocale!=null)if(Pt[e.parentLocale]!=null)r=Pt[e.parentLocale]._config;else if(n=ep(e.parentLocale),n!=null)r=n._config;else return dc[e.parentLocale]||(dc[e.parentLocale]=[]),dc[e.parentLocale].push({name:t,config:e}),null;return Pt[t]=new RR(rb(r,e)),dc[t]&&dc[t].forEach(function(i){HR(i.name,i.config)}),Us(t),Pt[t]}else return delete Pt[t],null}function dB(t,e){if(e!=null){var n,r,i=wN;Pt[t]!=null&&Pt[t].parentLocale!=null?Pt[t].set(rb(Pt[t]._config,e)):(r=ep(t),r!=null&&(i=r._config),e=rb(i,e),r==null&&(e.abbr=t),n=new RR(e),n.parentLocale=Pt[t],Pt[t]=n),Us(t)}else Pt[t]!=null&&(Pt[t].parentLocale!=null?(Pt[t]=Pt[t].parentLocale,t===Us()&&Us(t)):Pt[t]!=null&&delete Pt[t]);return Pt[t]}function as(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return jh;if(!Ri(t)){if(e=ep(t),e)return e;t=[t]}return cB(t)}function fB(){return ib(Pt)}function NR(t){var e,n=t._a;return n&&Ae(t).overflow===-2&&(e=n[zo]<0||n[zo]>11?zo:n[so]<1||n[so]>PR(n[Dn],n[zo])?so:n[mn]<0||n[mn]>24||n[mn]===24&&(n[yi]!==0||n[Yo]!==0||n[Xa]!==0)?mn:n[yi]<0||n[yi]>59?yi:n[Yo]<0||n[Yo]>59?Yo:n[Xa]<0||n[Xa]>999?Xa:-1,Ae(t)._overflowDayOfYear&&(e<Dn||e>so)&&(e=so),Ae(t)._overflowWeeks&&e===-1&&(e=wW),Ae(t)._overflowWeekday&&e===-1&&(e=vW),Ae(t).overflow=e),t}var gB=/^\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)?)?$/,mB=/^\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)?)?$/,pB=/Z|[+-]\d\d(?::?\d\d)?/,Wd=[["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]],RC=[["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/]],wB=/^\/?Date\((-?\d+)/i,vB=/^(?:(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}))$/,CB={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function vN(t){var e,n,r=t._i,i=gB.exec(r)||mB.exec(r),o,s,a,l,u=Wd.length,c=RC.length;if(i){for(Ae(t).iso=!0,e=0,n=u;e<n;e++)if(Wd[e][1].exec(i[1])){s=Wd[e][0],o=Wd[e][2]!==!1;break}if(s==null){t._isValid=!1;return}if(i[3]){for(e=0,n=c;e<n;e++)if(RC[e][1].exec(i[3])){a=(i[2]||" ")+RC[e][0];break}if(a==null){t._isValid=!1;return}}if(!o&&a!=null){t._isValid=!1;return}if(i[4])if(pB.exec(i[4]))l="Z";else{t._isValid=!1;return}t._f=s+(a||"")+(l||""),kR(t)}else t._isValid=!1}function yB(t,e,n,r,i,o){var s=[SB(t),lN.indexOf(e),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return o&&s.push(parseInt(o,10)),s}function SB(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function bB(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function RB(t,e,n){if(t){var r=gN.indexOf(t),i=new Date(e[0],e[1],e[2]).getDay();if(r!==i)return Ae(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function EB(t,e,n){if(t)return CB[t];if(e)return 0;var r=parseInt(n,10),i=r%100,o=(r-i)/100;return o*60+i}function CN(t){var e=vB.exec(bB(t._i)),n;if(e){if(n=yB(e[4],e[3],e[2],e[5],e[6],e[7]),!RB(e[1],n,t))return;t._a=n,t._tzm=EB(e[8],e[9],e[10]),t._d=Wh.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),Ae(t).rfc2822=!0}else t._isValid=!1}function TB(t){var e=wB.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(vN(t),t._isValid===!1)delete t._isValid;else return;if(CN(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:Z.createFromInputFallback(t)}Z.createFromInputFallback=Qr("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))});function hu(t,e,n){return t??e??n}function _B(t){var e=new Date(Z.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function DR(t){var e,n,r=[],i,o,s;if(!t._d){for(i=_B(t),t._w&&t._a[so]==null&&t._a[zo]==null&&MB(t),t._dayOfYear!=null&&(s=hu(t._a[Dn],i[Dn]),(t._dayOfYear>wh(s)||t._dayOfYear===0)&&(Ae(t)._overflowDayOfYear=!0),n=Wh(s,0,t._dayOfYear),t._a[zo]=n.getUTCMonth(),t._a[so]=n.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=r[e]=i[e];for(;e<7;e++)t._a[e]=r[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[mn]===24&&t._a[yi]===0&&t._a[Yo]===0&&t._a[Xa]===0&&(t._nextDay=!0,t._a[mn]=0),t._d=(t._useUTC?Wh:HW).apply(null,r),o=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[mn]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==o&&(Ae(t).weekdayMismatch=!0)}}function MB(t){var e,n,r,i,o,s,a,l,u;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(o=1,s=4,n=hu(e.GG,t._a[Dn],Bh(_t(),1,4).year),r=hu(e.W,1),i=hu(e.E,1),(i<1||i>7)&&(l=!0)):(o=t._locale._week.dow,s=t._locale._week.doy,u=Bh(_t(),o,s),n=hu(e.gg,t._a[Dn],u.year),r=hu(e.w,u.week),e.d!=null?(i=e.d,(i<0||i>6)&&(l=!0)):e.e!=null?(i=e.e+o,(e.e<0||e.e>6)&&(l=!0)):i=o),r<1||r>es(n,o,s)?Ae(t)._overflowWeeks=!0:l!=null?Ae(t)._overflowWeekday=!0:(a=fN(n,r,i,o,s),t._a[Dn]=a.year,t._dayOfYear=a.dayOfYear)}Z.ISO_8601=function(){};Z.RFC_2822=function(){};function kR(t){if(t._f===Z.ISO_8601){vN(t);return}if(t._f===Z.RFC_2822){CN(t);return}t._a=[],Ae(t).empty=!0;var e=""+t._i,n,r,i,o,s,a=e.length,l=0,u,c;for(i=tN(t._f,t._locale).match(ER)||[],c=i.length,n=0;n<c;n++)o=i[n],r=(e.match(gW(o,t))||[])[0],r&&(s=e.substr(0,e.indexOf(r)),s.length>0&&Ae(t).unusedInput.push(s),e=e.slice(e.indexOf(r)+r.length),l+=r.length),_u[o]?(r?Ae(t).empty=!1:Ae(t).unusedTokens.push(o),pW(o,r,t)):t._strict&&!r&&Ae(t).unusedTokens.push(o);Ae(t).charsLeftOver=a-l,e.length>0&&Ae(t).unusedInput.push(e),t._a[mn]<=12&&Ae(t).bigHour===!0&&t._a[mn]>0&&(Ae(t).bigHour=void 0),Ae(t).parsedDateParts=t._a.slice(0),Ae(t).meridiem=t._meridiem,t._a[mn]=IB(t._locale,t._a[mn],t._meridiem),u=Ae(t).era,u!==null&&(t._a[Dn]=t._locale.erasConvertYear(u,t._a[Dn])),DR(t),NR(t)}function IB(t,e,n){var r;return n==null?e:t.meridiemHour!=null?t.meridiemHour(e,n):(t.isPM!=null&&(r=t.isPM(n),r&&e<12&&(e+=12),!r&&e===12&&(e=0)),e)}function PB(t){var e,n,r,i,o,s,a=!1,l=t._f.length;if(l===0){Ae(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;i<l;i++)o=0,s=!1,e=bR({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[i],kR(e),SR(e)&&(s=!0),o+=Ae(e).charsLeftOver,o+=Ae(e).unusedTokens.length*10,Ae(e).score=o,a?o<r&&(r=o,n=e):(r==null||o<r||s)&&(r=o,n=e,s&&(a=!0));Ls(t,n||e)}function OB(t){if(!t._d){var e=TR(t._i),n=e.day===void 0?e.date:e.day;t._a=J1([e.year,e.month,n,e.hour,e.minute,e.second,e.millisecond],function(r){return r&&parseInt(r,10)}),DR(t)}}function xB(t){var e=new wd(NR(yN(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function yN(t){var e=t._i,n=t._f;return t._locale=t._locale||as(t._l),e===null||n===void 0&&e===""?Gm({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),Ei(e)?new wd(NR(e)):(pd(e)?t._d=e:Ri(n)?PB(t):n?kR(t):AB(t),SR(t)||(t._d=null),t))}function AB(t){var e=t._i;lr(e)?t._d=new Date(Z.now()):pd(e)?t._d=new Date(e.valueOf()):typeof e=="string"?TB(t):Ri(e)?(t._a=J1(e.slice(0),function(n){return parseInt(n,10)}),DR(t)):nl(e)?OB(t):ns(e)?t._d=new Date(e):Z.createFromInputFallback(t)}function SN(t,e,n,r,i){var o={};return(e===!0||e===!1)&&(r=e,e=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(nl(t)&&yR(t)||Ri(t)&&t.length===0)&&(t=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=i,o._l=n,o._i=t,o._f=e,o._strict=r,xB(o)}function _t(t,e,n,r){return SN(t,e,n,r,!1)}var HB=Qr("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=_t.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:Gm()}),NB=Qr("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=_t.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:Gm()});function bN(t,e){var n,r;if(e.length===1&&Ri(e[0])&&(e=e[0]),!e.length)return _t();for(n=e[0],r=1;r<e.length;++r)(!e[r].isValid()||e[r][t](n))&&(n=e[r]);return n}function DB(){var t=[].slice.call(arguments,0);return bN("isBefore",t)}function kB(){var t=[].slice.call(arguments,0);return bN("isAfter",t)}var LB=function(){return Date.now?Date.now():+new Date},fc=["year","quarter","month","week","day","hour","minute","second","millisecond"];function $B(t){var e,n=!1,r,i=fc.length;for(e in t)if(nt(t,e)&&!(Kt.call(fc,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(r=0;r<i;++r)if(t[fc[r]]){if(n)return!1;parseFloat(t[fc[r]])!==Ye(t[fc[r]])&&(n=!0)}return!0}function FB(){return this._isValid}function VB(){return Ii(NaN)}function tp(t){var e=TR(t),n=e.year||0,r=e.quarter||0,i=e.month||0,o=e.week||e.isoWeek||0,s=e.day||0,a=e.hour||0,l=e.minute||0,u=e.second||0,c=e.millisecond||0;this._isValid=$B(e),this._milliseconds=+c+u*1e3+l*6e4+a*1e3*60*60,this._days=+s+o*7,this._months=+i+r*3+n*12,this._data={},this._locale=as(),this._bubble()}function Eg(t){return t instanceof tp}function sb(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function WB(t,e,n){var r=Math.min(t.length,e.length),i=Math.abs(t.length-e.length),o=0,s;for(s=0;s<r;s++)Ye(t[s])!==Ye(e[s])&&o++;return o+i}function RN(t,e){Se(t,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+ho(~~(n/60),2)+e+ho(~~n%60,2)})}RN("Z",":");RN("ZZ","");ce("Z",Jm);ce("ZZ",Jm);pt(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=LR(Jm,t)});var BB=/([\+\-]|\d\d)/gi;function LR(t,e){var n=(e||"").match(t),r,i,o;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(BB)||["-",0,0],o=+(i[1]*60)+Ye(i[2]),o===0?0:i[0]==="+"?o:-o)}function $R(t,e){var n,r;return e._isUTC?(n=e.clone(),r=(Ei(t)||pd(t)?t.valueOf():_t(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),Z.updateOffset(n,!1),n):_t(t).local()}function ab(t){return-Math.round(t._d.getTimezoneOffset())}Z.updateOffset=function(){};function jB(t,e,n){var r=this._offset||0,i;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=LR(Jm,t),t===null)return this}else Math.abs(t)<16&&!n&&(t=t*60);return!this._isUTC&&e&&(i=ab(this)),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==t&&(!e||this._changeInProgress?_N(this,Ii(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,Z.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:ab(this)}function UB(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function zB(t){return this.utcOffset(0,t)}function YB(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(ab(this),"m")),this}function GB(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=LR(dW,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function qB(t){return this.isValid()?(t=t?_t(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function KB(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function XB(){if(!lr(this._isDSTShifted))return this._isDSTShifted;var t={},e;return bR(t,this),t=yN(t),t._a?(e=t._isUTC?po(t._a):_t(t._a),this._isDSTShifted=this.isValid()&&WB(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function ZB(){return this.isValid()?!this._isUTC:!1}function JB(){return this.isValid()?this._isUTC:!1}function EN(){return this.isValid()?this._isUTC&&this._offset===0:!1}var QB=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,ej=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ii(t,e){var n=t,r=null,i,o,s;return Eg(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:ns(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(r=QB.exec(t))?(i=r[1]==="-"?-1:1,n={y:0,d:Ye(r[so])*i,h:Ye(r[mn])*i,m:Ye(r[yi])*i,s:Ye(r[Yo])*i,ms:Ye(sb(r[Xa]*1e3))*i}):(r=ej.exec(t))?(i=r[1]==="-"?-1:1,n={y:ia(r[2],i),M:ia(r[3],i),w:ia(r[4],i),d:ia(r[5],i),h:ia(r[6],i),m:ia(r[7],i),s:ia(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(s=tj(_t(n.from),_t(n.to)),n={},n.ms=s.milliseconds,n.M=s.months),o=new tp(n),Eg(t)&&nt(t,"_locale")&&(o._locale=t._locale),Eg(t)&&nt(t,"_isValid")&&(o._isValid=t._isValid),o}Ii.fn=tp.prototype;Ii.invalid=VB;function ia(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function NP(t,e){var n={};return n.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function tj(t,e){var n;return t.isValid()&&e.isValid()?(e=$R(e,t),t.isBefore(e)?n=NP(t,e):(n=NP(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function TN(t,e){return function(n,r){var i,o;return r!==null&&!isNaN(+r)&&(eN(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=r,r=o),i=Ii(n,r),_N(this,i,t),this}}function _N(t,e,n,r){var i=e._milliseconds,o=sb(e._days),s=sb(e._months);t.isValid()&&(r=r??!0,s&&cN(t,Vh(t,"Month")+s*n),o&&aN(t,"Date",Vh(t,"Date")+o*n),i&&t._d.setTime(t._d.valueOf()+i*n),r&&Z.updateOffset(t,o||s))}var nj=TN(1,"add"),rj=TN(-1,"subtract");function MN(t){return typeof t=="string"||t instanceof String}function ij(t){return Ei(t)||pd(t)||MN(t)||ns(t)||sj(t)||oj(t)||t===null||t===void 0}function oj(t){var e=nl(t)&&!yR(t),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,o,s=r.length;for(i=0;i<s;i+=1)o=r[i],n=n||nt(t,o);return e&&n}function sj(t){var e=Ri(t),n=!1;return e&&(n=t.filter(function(r){return!ns(r)&&MN(t)}).length===0),e&&n}function aj(t){var e=nl(t)&&!yR(t),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,o;for(i=0;i<r.length;i+=1)o=r[i],n=n||nt(t,o);return e&&n}function lj(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function uj(t,e){arguments.length===1&&(arguments[0]?ij(arguments[0])?(t=arguments[0],e=void 0):aj(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var n=t||_t(),r=$R(n,this).startOf("day"),i=Z.calendarFormat(this,r)||"sameElse",o=e&&(wo(e[i])?e[i].call(this,n):e[i]);return this.format(o||this.localeData().calendar(i,this,_t(n)))}function cj(){return new wd(this)}function hj(t,e){var n=Ei(t)?t:_t(t);return this.isValid()&&n.isValid()?(e=ei(e)||"millisecond",e==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf()):!1}function dj(t,e){var n=Ei(t)?t:_t(t);return this.isValid()&&n.isValid()?(e=ei(e)||"millisecond",e==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf()):!1}function fj(t,e,n,r){var i=Ei(t)?t:_t(t),o=Ei(e)?e:_t(e);return this.isValid()&&i.isValid()&&o.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===")"?this.isBefore(o,n):!this.isAfter(o,n))):!1}function gj(t,e){var n=Ei(t)?t:_t(t),r;return this.isValid()&&n.isValid()?(e=ei(e)||"millisecond",e==="millisecond"?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(e).valueOf()<=r&&r<=this.clone().endOf(e).valueOf())):!1}function mj(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function pj(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function wj(t,e,n){var r,i,o;if(!this.isValid())return NaN;if(r=$R(t,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,e=ei(e),e){case"year":o=Tg(this,r)/12;break;case"month":o=Tg(this,r);break;case"quarter":o=Tg(this,r)/3;break;case"second":o=(this-r)/1e3;break;case"minute":o=(this-r)/6e4;break;case"hour":o=(this-r)/36e5;break;case"day":o=(this-r-i)/864e5;break;case"week":o=(this-r-i)/6048e5;break;default:o=this-r}return n?o:Gr(o)}function Tg(t,e){if(t.date()<e.date())return-Tg(e,t);var n=(e.year()-t.year())*12+(e.month()-t.month()),r=t.clone().add(n,"months"),i,o;return e-r<0?(i=t.clone().add(n-1,"months"),o=(e-r)/(r-i)):(i=t.clone().add(n+1,"months"),o=(e-r)/(i-r)),-(n+o)||0}Z.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";Z.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function vj(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Cj(t){if(!this.isValid())return null;var e=t!==!0,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?Rg(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):wo(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Rg(n,"Z")):Rg(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function yj(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",n,r,i,o;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),n="["+t+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",o=e+'[")]',this.format(n+r+i+o)}function Sj(t){t||(t=this.isUtc()?Z.defaultFormatUtc:Z.defaultFormat);var e=Rg(this,t);return this.localeData().postformat(e)}function bj(t,e){return this.isValid()&&(Ei(t)&&t.isValid()||_t(t).isValid())?Ii({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Rj(t){return this.from(_t(),t)}function Ej(t,e){return this.isValid()&&(Ei(t)&&t.isValid()||_t(t).isValid())?Ii({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Tj(t){return this.to(_t(),t)}function IN(t){var e;return t===void 0?this._locale._abbr:(e=as(t),e!=null&&(this._locale=e),this)}var PN=Qr("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function ON(){return this._locale}var Gg=1e3,Mu=60*Gg,qg=60*Mu,xN=(365*400+97)*24*qg;function Iu(t,e){return(t%e+e)%e}function AN(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-xN:new Date(t,e,n).valueOf()}function HN(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-xN:Date.UTC(t,e,n)}function _j(t){var e,n;if(t=ei(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?HN:AN,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=Iu(e+(this._isUTC?0:this.utcOffset()*Mu),qg);break;case"minute":e=this._d.valueOf(),e-=Iu(e,Mu);break;case"second":e=this._d.valueOf(),e-=Iu(e,Gg);break}return this._d.setTime(e),Z.updateOffset(this,!0),this}function Mj(t){var e,n;if(t=ei(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?HN:AN,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=qg-Iu(e+(this._isUTC?0:this.utcOffset()*Mu),qg)-1;break;case"minute":e=this._d.valueOf(),e+=Mu-Iu(e,Mu)-1;break;case"second":e=this._d.valueOf(),e+=Gg-Iu(e,Gg)-1;break}return this._d.setTime(e),Z.updateOffset(this,!0),this}function Ij(){return this._d.valueOf()-(this._offset||0)*6e4}function Pj(){return Math.floor(this.valueOf()/1e3)}function Oj(){return new Date(this.valueOf())}function xj(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function Aj(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function Hj(){return this.isValid()?this.toISOString():null}function Nj(){return SR(this)}function Dj(){return Ls({},Ae(this))}function kj(){return Ae(this).overflow}function Lj(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Se("N",0,0,"eraAbbr");Se("NN",0,0,"eraAbbr");Se("NNN",0,0,"eraAbbr");Se("NNNN",0,0,"eraName");Se("NNNNN",0,0,"eraNarrow");Se("y",["y",1],"yo","eraYear");Se("y",["yy",2],0,"eraYear");Se("y",["yyy",3],0,"eraYear");Se("y",["yyyy",4],0,"eraYear");ce("N",FR);ce("NN",FR);ce("NNN",FR);ce("NNNN",qj);ce("NNNNN",Kj);pt(["N","NN","NNN","NNNN","NNNNN"],function(t,e,n,r){var i=n._locale.erasParse(t,r,n._strict);i?Ae(n).era=i:Ae(n).invalidEra=t});ce("y",qu);ce("yy",qu);ce("yyy",qu);ce("yyyy",qu);ce("yo",Xj);pt(["y","yy","yyy","yyyy"],Dn);pt(["yo"],function(t,e,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[Dn]=n._locale.eraYearOrdinalParse(t,i):e[Dn]=parseInt(t,10)});function $j(t,e){var n,r,i,o=this._eras||as("en")._eras;for(n=0,r=o.length;n<r;++n){switch(typeof o[n].since){case"string":i=Z(o[n].since).startOf("day"),o[n].since=i.valueOf();break}switch(typeof o[n].until){case"undefined":o[n].until=1/0;break;case"string":i=Z(o[n].until).startOf("day").valueOf(),o[n].until=i.valueOf();break}}return o}function Fj(t,e,n){var r,i,o=this.eras(),s,a,l;for(t=t.toUpperCase(),r=0,i=o.length;r<i;++r)if(s=o[r].name.toUpperCase(),a=o[r].abbr.toUpperCase(),l=o[r].narrow.toUpperCase(),n)switch(e){case"N":case"NN":case"NNN":if(a===t)return o[r];break;case"NNNN":if(s===t)return o[r];break;case"NNNNN":if(l===t)return o[r];break}else if([s,a,l].indexOf(t)>=0)return o[r]}function Vj(t,e){var n=t.since<=t.until?1:-1;return e===void 0?Z(t.since).year():Z(t.since).year()+(e-t.offset)*n}function Wj(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].name;return""}function Bj(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].narrow;return""}function jj(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].abbr;return""}function Uj(){var t,e,n,r,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t)if(n=i[t].since<=i[t].until?1:-1,r=this.clone().startOf("day").valueOf(),i[t].since<=r&&r<=i[t].until||i[t].until<=r&&r<=i[t].since)return(this.year()-Z(i[t].since).year())*n+i[t].offset;return this.year()}function zj(t){return nt(this,"_erasNameRegex")||VR.call(this),t?this._erasNameRegex:this._erasRegex}function Yj(t){return nt(this,"_erasAbbrRegex")||VR.call(this),t?this._erasAbbrRegex:this._erasRegex}function Gj(t){return nt(this,"_erasNarrowRegex")||VR.call(this),t?this._erasNarrowRegex:this._erasRegex}function FR(t,e){return e.erasAbbrRegex(t)}function qj(t,e){return e.erasNameRegex(t)}function Kj(t,e){return e.erasNarrowRegex(t)}function Xj(t,e){return e._eraYearOrdinalRegex||qu}function VR(){var t=[],e=[],n=[],r=[],i,o,s,a,l,u=this.eras();for(i=0,o=u.length;i<o;++i)s=Qo(u[i].name),a=Qo(u[i].abbr),l=Qo(u[i].narrow),e.push(s),t.push(a),n.push(l),r.push(s),r.push(a),r.push(l);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}Se(0,["gg",2],0,function(){return this.weekYear()%100});Se(0,["GG",2],0,function(){return this.isoWeekYear()%100});function np(t,e){Se(0,[t,t.length],0,e)}np("gggg","weekYear");np("ggggg","weekYear");np("GGGG","isoWeekYear");np("GGGGG","isoWeekYear");ce("G",Zm);ce("g",Zm);ce("GG",Mt,Nr);ce("gg",Mt,Nr);ce("GGGG",MR,_R);ce("gggg",MR,_R);ce("GGGGG",Xm,qm);ce("ggggg",Xm,qm);Cd(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=Ye(t)});Cd(["gg","GG"],function(t,e,n,r){e[r]=Z.parseTwoDigitYear(t)});function Zj(t){return NN.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Jj(t){return NN.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function Qj(){return es(this.year(),1,4)}function eU(){return es(this.isoWeekYear(),1,4)}function tU(){var t=this.localeData()._week;return es(this.year(),t.dow,t.doy)}function nU(){var t=this.localeData()._week;return es(this.weekYear(),t.dow,t.doy)}function NN(t,e,n,r,i){var o;return t==null?Bh(this,r,i).year:(o=es(t,r,i),e>o&&(e=o),rU.call(this,t,e,n,r,i))}function rU(t,e,n,r,i){var o=fN(t,e,n,r,i),s=Wh(o.year,0,o.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}Se("Q",0,"Qo","quarter");ce("Q",nN);pt("Q",function(t,e){e[zo]=(Ye(t)-1)*3});function iU(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}Se("D",["DD",2],"Do","date");ce("D",Mt,Ku);ce("DD",Mt,Nr);ce("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient});pt(["D","DD"],so);pt("Do",function(t,e){e[so]=Ye(t.match(Mt)[0])});var DN=Xu("Date",!0);Se("DDD",["DDDD",3],"DDDo","dayOfYear");ce("DDD",Km);ce("DDDD",rN);pt(["DDD","DDDD"],function(t,e,n){n._dayOfYear=Ye(t)});function oU(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}Se("m",["mm",2],0,"minute");ce("m",Mt,IR);ce("mm",Mt,Nr);pt(["m","mm"],yi);var sU=Xu("Minutes",!1);Se("s",["ss",2],0,"second");ce("s",Mt,IR);ce("ss",Mt,Nr);pt(["s","ss"],Yo);var aU=Xu("Seconds",!1);Se("S",0,0,function(){return~~(this.millisecond()/100)});Se(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Se(0,["SSS",3],0,"millisecond");Se(0,["SSSS",4],0,function(){return this.millisecond()*10});Se(0,["SSSSS",5],0,function(){return this.millisecond()*100});Se(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Se(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Se(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Se(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});ce("S",Km,nN);ce("SS",Km,Nr);ce("SSS",Km,rN);var $s,kN;for($s="SSSS";$s.length<=9;$s+="S")ce($s,qu);function lU(t,e){e[Xa]=Ye(("0."+t)*1e3)}for($s="S";$s.length<=9;$s+="S")pt($s,lU);kN=Xu("Milliseconds",!1);Se("z",0,0,"zoneAbbr");Se("zz",0,0,"zoneName");function uU(){return this._isUTC?"UTC":""}function cU(){return this._isUTC?"Coordinated Universal Time":""}var Q=wd.prototype;Q.add=nj;Q.calendar=uj;Q.clone=cj;Q.diff=wj;Q.endOf=Mj;Q.format=Sj;Q.from=bj;Q.fromNow=Rj;Q.to=Ej;Q.toNow=Tj;Q.get=yW;Q.invalidAt=kj;Q.isAfter=hj;Q.isBefore=dj;Q.isBetween=fj;Q.isSame=gj;Q.isSameOrAfter=mj;Q.isSameOrBefore=pj;Q.isValid=Nj;Q.lang=PN;Q.locale=IN;Q.localeData=ON;Q.max=NB;Q.min=HB;Q.parsingFlags=Dj;Q.set=SW;Q.startOf=_j;Q.subtract=rj;Q.toArray=xj;Q.toObject=Aj;Q.toDate=Oj;Q.toISOString=Cj;Q.inspect=yj;typeof Symbol<"u"&&Symbol.for!=null&&(Q[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});Q.toJSON=Hj;Q.toString=vj;Q.unix=Pj;Q.valueOf=Ij;Q.creationData=Lj;Q.eraName=Wj;Q.eraNarrow=Bj;Q.eraAbbr=jj;Q.eraYear=Uj;Q.year=sN;Q.isLeapYear=CW;Q.weekYear=Zj;Q.isoWeekYear=Jj;Q.quarter=Q.quarters=iU;Q.month=hN;Q.daysInMonth=OW;Q.week=Q.weeks=$W;Q.isoWeek=Q.isoWeeks=FW;Q.weeksInYear=tU;Q.weeksInWeekYear=nU;Q.isoWeeksInYear=Qj;Q.isoWeeksInISOWeekYear=eU;Q.date=DN;Q.day=Q.days=JW;Q.weekday=QW;Q.isoWeekday=eB;Q.dayOfYear=oU;Q.hour=Q.hours=aB;Q.minute=Q.minutes=sU;Q.second=Q.seconds=aU;Q.millisecond=Q.milliseconds=kN;Q.utcOffset=jB;Q.utc=zB;Q.local=YB;Q.parseZone=GB;Q.hasAlignedHourOffset=qB;Q.isDST=KB;Q.isLocal=ZB;Q.isUtcOffset=JB;Q.isUtc=EN;Q.isUTC=EN;Q.zoneAbbr=uU;Q.zoneName=cU;Q.dates=Qr("dates accessor is deprecated. Use date instead.",DN);Q.months=Qr("months accessor is deprecated. Use month instead",hN);Q.years=Qr("years accessor is deprecated. Use year instead",sN);Q.zone=Qr("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",UB);Q.isDSTShifted=Qr("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",XB);function hU(t){return _t(t*1e3)}function dU(){return _t.apply(null,arguments).parseZone()}function LN(t){return t}var rt=RR.prototype;rt.calendar=ZV;rt.longDateFormat=tW;rt.invalidDate=rW;rt.ordinal=sW;rt.preparse=LN;rt.postformat=LN;rt.relativeTime=lW;rt.pastFuture=uW;rt.set=KV;rt.eras=$j;rt.erasParse=Fj;rt.erasConvertYear=Vj;rt.erasAbbrRegex=Yj;rt.erasNameRegex=zj;rt.erasNarrowRegex=Gj;rt.months=_W;rt.monthsShort=MW;rt.monthsParse=PW;rt.monthsRegex=AW;rt.monthsShortRegex=xW;rt.week=NW;rt.firstDayOfYear=LW;rt.firstDayOfWeek=kW;rt.weekdays=GW;rt.weekdaysMin=KW;rt.weekdaysShort=qW;rt.weekdaysParse=ZW;rt.weekdaysRegex=tB;rt.weekdaysShortRegex=nB;rt.weekdaysMinRegex=rB;rt.isPM=oB;rt.meridiem=lB;function Kg(t,e,n,r){var i=as(),o=po().set(r,e);return i[n](o,t)}function $N(t,e,n){if(ns(t)&&(e=t,t=void 0),t=t||"",e!=null)return Kg(t,e,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=Kg(t,r,n,"month");return i}function WR(t,e,n,r){typeof t=="boolean"?(ns(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,ns(e)&&(n=e,e=void 0),e=e||"");var i=as(),o=t?i._week.dow:0,s,a=[];if(n!=null)return Kg(e,(n+o)%7,r,"day");for(s=0;s<7;s++)a[s]=Kg(e,(s+o)%7,r,"day");return a}function fU(t,e){return $N(t,e,"months")}function gU(t,e){return $N(t,e,"monthsShort")}function mU(t,e,n){return WR(t,e,n,"weekdays")}function pU(t,e,n){return WR(t,e,n,"weekdaysShort")}function wU(t,e,n){return WR(t,e,n,"weekdaysMin")}Us("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=Ye(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+n}});Z.lang=Qr("moment.lang is deprecated. Use moment.locale instead.",Us);Z.langData=Qr("moment.langData is deprecated. Use moment.localeData instead.",as);var So=Math.abs;function vU(){var t=this._data;return this._milliseconds=So(this._milliseconds),this._days=So(this._days),this._months=So(this._months),t.milliseconds=So(t.milliseconds),t.seconds=So(t.seconds),t.minutes=So(t.minutes),t.hours=So(t.hours),t.months=So(t.months),t.years=So(t.years),this}function FN(t,e,n,r){var i=Ii(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function CU(t,e){return FN(this,t,e,1)}function yU(t,e){return FN(this,t,e,-1)}function DP(t){return t<0?Math.floor(t):Math.ceil(t)}function SU(){var t=this._milliseconds,e=this._days,n=this._months,r=this._data,i,o,s,a,l;return t>=0&&e>=0&&n>=0||t<=0&&e<=0&&n<=0||(t+=DP(lb(n)+e)*864e5,e=0,n=0),r.milliseconds=t%1e3,i=Gr(t/1e3),r.seconds=i%60,o=Gr(i/60),r.minutes=o%60,s=Gr(o/60),r.hours=s%24,e+=Gr(s/24),l=Gr(VN(e)),n+=l,e-=DP(lb(l)),a=Gr(n/12),n%=12,r.days=e,r.months=n,r.years=a,this}function VN(t){return t*4800/146097}function lb(t){return t*146097/4800}function bU(t){if(!this.isValid())return NaN;var e,n,r=this._milliseconds;if(t=ei(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+r/864e5,n=this._months+VN(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(lb(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return e*24+r/36e5;case"minute":return e*1440+r/6e4;case"second":return e*86400+r/1e3;case"millisecond":return Math.floor(e*864e5)+r;default:throw new Error("Unknown unit "+t)}}function ls(t){return function(){return this.as(t)}}var WN=ls("ms"),RU=ls("s"),EU=ls("m"),TU=ls("h"),_U=ls("d"),MU=ls("w"),IU=ls("M"),PU=ls("Q"),OU=ls("y"),xU=WN;function AU(){return Ii(this)}function HU(t){return t=ei(t),this.isValid()?this[t+"s"]():NaN}function yl(t){return function(){return this.isValid()?this._data[t]:NaN}}var NU=yl("milliseconds"),DU=yl("seconds"),kU=yl("minutes"),LU=yl("hours"),$U=yl("days"),FU=yl("months"),VU=yl("years");function WU(){return Gr(this.days()/7)}var Fo=Math.round,yu={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function BU(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function jU(t,e,n,r){var i=Ii(t).abs(),o=Fo(i.as("s")),s=Fo(i.as("m")),a=Fo(i.as("h")),l=Fo(i.as("d")),u=Fo(i.as("M")),c=Fo(i.as("w")),h=Fo(i.as("y")),d=o<=n.ss&&["s",o]||o<n.s&&["ss",o]||s<=1&&["m"]||s<n.m&&["mm",s]||a<=1&&["h"]||a<n.h&&["hh",a]||l<=1&&["d"]||l<n.d&&["dd",l];return n.w!=null&&(d=d||c<=1&&["w"]||c<n.w&&["ww",c]),d=d||u<=1&&["M"]||u<n.M&&["MM",u]||h<=1&&["y"]||["yy",h],d[2]=e,d[3]=+t>0,d[4]=r,BU.apply(null,d)}function UU(t){return t===void 0?Fo:typeof t=="function"?(Fo=t,!0):!1}function zU(t,e){return yu[t]===void 0?!1:e===void 0?yu[t]:(yu[t]=e,t==="s"&&(yu.ss=e-1),!0)}function YU(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=yu,i,o;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(r=Object.assign({},yu,e),e.s!=null&&e.ss==null&&(r.ss=e.s-1)),i=this.localeData(),o=jU(this,!n,r,i),n&&(o=i.pastFuture(+this,o)),i.postformat(o)}var EC=Math.abs;function Ml(t){return(t>0)-(t<0)||+t}function rp(){if(!this.isValid())return this.localeData().invalidDate();var t=EC(this._milliseconds)/1e3,e=EC(this._days),n=EC(this._months),r,i,o,s,a=this.asSeconds(),l,u,c,h;return a?(r=Gr(t/60),i=Gr(r/60),t%=60,r%=60,o=Gr(n/12),n%=12,s=t?t.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",u=Ml(this._months)!==Ml(a)?"-":"",c=Ml(this._days)!==Ml(a)?"-":"",h=Ml(this._milliseconds)!==Ml(a)?"-":"",l+"P"+(o?u+o+"Y":"")+(n?u+n+"M":"")+(e?c+e+"D":"")+(i||r||t?"T":"")+(i?h+i+"H":"")+(r?h+r+"M":"")+(t?h+s+"S":"")):"P0D"}var Je=tp.prototype;Je.isValid=FB;Je.abs=vU;Je.add=CU;Je.subtract=yU;Je.as=bU;Je.asMilliseconds=WN;Je.asSeconds=RU;Je.asMinutes=EU;Je.asHours=TU;Je.asDays=_U;Je.asWeeks=MU;Je.asMonths=IU;Je.asQuarters=PU;Je.asYears=OU;Je.valueOf=xU;Je._bubble=SU;Je.clone=AU;Je.get=HU;Je.milliseconds=NU;Je.seconds=DU;Je.minutes=kU;Je.hours=LU;Je.days=$U;Je.weeks=WU;Je.months=FU;Je.years=VU;Je.humanize=YU;Je.toISOString=rp;Je.toString=rp;Je.toJSON=rp;Je.locale=IN;Je.localeData=ON;Je.toIsoString=Qr("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",rp);Je.lang=PN;Se("X",0,0,"unix");Se("x",0,0,"valueOf");ce("x",Zm);ce("X",fW);pt("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)});pt("x",function(t,e,n){n._d=new Date(Ye(t))});//! moment.js
27
- Z.version="2.30.1";GV(_t);Z.fn=Q;Z.min=DB;Z.max=kB;Z.now=LB;Z.utc=po;Z.unix=hU;Z.months=fU;Z.isDate=pd;Z.locale=Us;Z.invalid=Gm;Z.duration=Ii;Z.isMoment=Ei;Z.weekdays=mU;Z.parseZone=dU;Z.localeData=as;Z.isDuration=Eg;Z.monthsShort=gU;Z.weekdaysMin=wU;Z.defineLocale=HR;Z.updateLocale=dB;Z.locales=fB;Z.weekdaysShort=pU;Z.normalizeUnits=ei;Z.relativeTimeRounding=UU;Z.relativeTimeThreshold=zU;Z.calendarFormat=lj;Z.prototype=Q;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"};function GU(t){const e=t.length;let n=0;for(;n<e;)t[n]=[t[n]],n+=1}function kP(t,e){const n=e.length;let r=0;for(;r<n;)t.push(e[r]),r+=1}function _g(t){const e=[];if(!t||t.length===0||!t[0]||t[0].length===0)return e;const n=t.length,r=t[0].length;for(let i=0;i<n;i++)for(let o=0;o<r;o++)e[o]||(e[o]=[]),e[o][i]=t[i][o];return e}function wr(t,e,n,r){let i=-1,o=t,s=n;Array.isArray(t)||(o=Array.from(t));const a=o.length;for(i+=1;i<a;)s=e(s,o[i],i,o),i+=1;return s}function ol(t,e){let n=0,r=t;Array.isArray(t)||(r=Array.from(t));const i=r.length,o=[];let s=-1;for(;n<i;){const a=r[n];e(a,n,r)&&(s+=1,o[s]=a),n+=1}return o}function ze(t,e){let n=0,r=t;Array.isArray(t)||(r=Array.from(t));const i=r.length,o=[];let s=-1;for(;n<i;){const a=r[n];s+=1,o[s]=e(a,n,r),n+=1}return o}function H(t,e){let n=0,r=t;Array.isArray(t)||(r=Array.from(t));const i=r.length;for(;n<i&&e(r[n],n,r)!==!1;)n+=1;return t}function qU(t){const e=[];return H(t,n=>{e.indexOf(n)===-1&&e.push(n)}),e}function LP(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const[r,...i]=[...e];let o=r;return H(i,s=>{o=o.filter(a=>!s.includes(a))}),o}function $P(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ";return t.split(e)}function st(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return wr(t,(o,s,a)=>{const l=s.replace(/\r?\n\s*/g,""),u=n[a]?n[a]:"";return o+l+u},"").trim()}function At(t){let e;switch(typeof t){case"string":case"number":e=`${t}`;break;case"object":e=t===null?"":t.toString();break;case"undefined":e="";break;default:e=t.toString();break}return e}function ue(t){return typeof t<"u"}function xt(t){return typeof t>"u"}function Yt(t){return t===null||t===""||xt(t)}function KU(t){return Object.prototype.toString.call(t)==="[object RegExp]"}const ch="length",vh=t=>parseInt(t,16),FP=t=>parseInt(t,10),Xg=(t,e,n)=>t.substr(e,n),Ch=t=>t.codePointAt(0)-65,ub=t=>`${t}`.replace(/\-/g,""),XU=t=>vh(Xg(ub(t),vh("12"),Ch("F")))/(vh(Xg(ub(t),Ch("B"),~~![][ch]))||9),ZU=()=>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 VP=!1;const WP={invalid:()=>st`
28
- The license key for Handsontable is invalid.\x20
29
- If you need any help, contact us at support@handsontable.com.`,expired:t=>{let{keyValidityDate:e,hotVersion:n}=t;return st`
30
- The license key for Handsontable expired on ${e}, and is not valid for the installed\x20
31
- version ${n}. Renew your license key at handsontable.com or downgrade to a version released prior\x20
32
- to ${e}. If you need any help, contact us at sales@handsontable.com.`},missing:()=>st`
33
- The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
34
- Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
35
- passing the key: 'non-commercial-and-evaluation'. If you need any help, contact\x20
36
- us at support@handsontable.com.`,non_commercial:()=>""},BP={invalid:()=>st`
37
- The license key for Handsontable is invalid.\x20
38
- <a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> on how to\x20
39
- install it properly or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,expired:t=>{let{keyValidityDate:e,hotVersion:n}=t;return st`
40
- The license key for Handsontable expired on ${e}, and is not valid for the installed\x20
41
- version ${n}. <a href="https://handsontable.com/pricing" target="_blank">Renew</a> your\x20
42
- license key or downgrade to a version released prior to ${e}. If you need any\x20
43
- help, contact us at <a href="mailto:sales@handsontable.com">sales@handsontable.com</a>.`},missing:()=>st`
44
- The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
45
- Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
46
- passing the key: 'non-commercial-and-evaluation'.\x20
47
- <a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> about it in\x20
48
- the documentation or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,non_commercial:()=>""};function JU(t,e){const n=!Yt(t),r=typeof t=="string"&&t.toLowerCase()==="non-commercial-and-evaluation",i="15.3.0";let o,s="invalid",a="invalid";t=ub(t||"");const l=QU(t);if(n||r||l)if(l){const u=Z("29/04/2025","DD/MM/YYYY"),c=Math.floor(u.toDate().getTime()/864e5),h=XU(t);o=Z((h+1)*864e5,"x").format("MMMM DD, YYYY"),c>h?(s="expired",a="expired"):(s="valid",a="valid")}else r?(s="non_commercial",a="valid"):(s="invalid",a="invalid");else s="missing",a="missing";if(ZU()&&(s="valid",a="valid"),!VP&&s!=="valid"&&(WP[s]({keyValidityDate:o,hotVersion:i})&&console[s==="non_commercial"?"info":"warn"](WP[s]({keyValidityDate:o,hotVersion:i})),VP=!0),a!=="valid"&&e.parentNode&&BP[a]({keyValidityDate:o,hotVersion:i})){const c=document.createElement("div");c.className="handsontable hot-display-license-info",c.innerHTML=BP[a]({keyValidityDate:o,hotVersion:i}),e.parentNode.insertBefore(c,e.nextSibling)}}function QU(t){let e=[][ch],n=e;if(t[ch]!==Ch("Z"))return!1;for(let r="",i="B<H4P+".split(""),o=Ch(i.shift());o;o=Ch(i.shift()||"A"))--o<""[ch]?n=n|(FP(`${FP(vh(r)+(vh(Xg(t,Math.abs(o),2))+[]).padStart(2,"0"))}`)%97||2)>>1:r=Xg(t,o,o?i[ch]===1?9:8:6);return n===e}function Ti(t){return t[0].toUpperCase()+t.substr(1)}function BN(){function t(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return t()+t()+t()+t()}function jN(t){return/^([0-9][0-9]?%$)|(^100%$)/.test(t)}function UN(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return`${t}`.replace(/(?:\\)?\[([^[\]]+)]/g,(n,r)=>n.charAt(0)==="\\"?n.substr(1,n.length-1):e[r]===void 0?"":e[r])}function jP(t){return BR(`${t}`,{ALLOWED_TAGS:[]})}function BR(t,e){return YV.sanitize(t,e)}const Sl=t=>["tabindex",t],ez=()=>["role","treegrid"],Go=()=>["role","presentation"],tz=()=>["role","gridcell"],nz=()=>["role","rowheader"],zN=()=>["role","rowgroup"],rz=()=>["role","columnheader"],cb=()=>["role","row"],iz=()=>["role","menu"],oz=()=>["role","menuitem"],sz=()=>["role","menuitemcheckbox"],az=()=>["role","combobox"],YN=()=>["role","listbox"],lz=()=>["role","option"],uz=()=>["role","checkbox"],cz=()=>["scope","col"],hz=()=>["scope","row"],dz=()=>["type","text"],Uh=t=>["aria-label",t],bl=()=>["aria-hidden","true"],fz=()=>["aria-disabled","true"],gz=()=>["aria-multiselectable","true"],GN=t=>["aria-haspopup",t],qN=t=>["aria-rowcount",t],ip=t=>["aria-colcount",t],KN=t=>["aria-rowindex",t],jR=t=>["aria-colindex",t],Xr=t=>["aria-expanded",t],mz=t=>["aria-sort",t],UP=()=>["aria-readonly","true"],zP=()=>["aria-invalid","true"],XN=t=>["aria-checked",t],UR=()=>["aria-selected","true"],pz=()=>["aria-autocomplete","list"],wz=t=>["aria-controls",t],vz=t=>["aria-activedescendant",t],Cz=t=>["aria-live",t],yz=t=>["aria-relevant",t],Sz=t=>["aria-setsize",t],bz=t=>["aria-posinset",t];function Rz(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=null,i=t;for(;i!==null;){if(n===e){r=i;break}i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:(n+=1,i=i.parentNode)}return r}function Mg(t,e){const n=t.closest(".handsontable");return!!n&&(n.parentNode===e||n===e)}function Ez(t){return Object.getPrototypeOf(t.parent)&&t.frameElement}function Nu(t){return Ez(t)&&t.parent}function sl(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;const{ELEMENT_NODE:r,DOCUMENT_FRAGMENT_NODE:i}=Node;let o=t;for(;o!=null&&o!==n;){const{nodeType:s,nodeName:a}=o;if(s===r&&(e.includes(a)||e.includes(o)))return o;const{host:l}=o;l&&s===i?o=l:o=o.parentNode}return null}function Bd(t,e,n){const r=[];let i=t;for(;i&&(i=sl(i,e,n),!(!i||n&&!n.contains(i)));)r.push(i),i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:i=i.parentNode;const o=r.length;return o?r[o-1]:null}function Tz(t,e){const n={element:void 0,classNames:[]};let r=t;for(;r!==null&&r!==t.ownerDocument.documentElement&&!n.element;){if(typeof e=="string"&&r.classList.contains(e))n.element=r,n.classNames.push(e);else if(e instanceof RegExp){const i=Array.from(r.classList).filter(o=>e.test(o));i.length&&(n.element=r,n.classNames.push(...i))}r=r.parentElement}return n}function rl(t,e){let n=t.parentNode,r=[];for(typeof e=="string"?t.defaultView?r=Array.prototype.slice.call(t.querySelectorAll(e),0):r=Array.prototype.slice.call(t.ownerDocument.querySelectorAll(e),0):r.push(e);n!==null;){if(r.indexOf(n)>-1)return!0;n=n.parentNode}return!1}function _z(t){let e=0,n=t;if(n.previousSibling)for(;n=n.previousSibling;)e+=1;return e}function oa(t,e,n){const r=n.parentElement.querySelector(`.ht_clone_${t}`);return r?r.contains(e):null}function ZN(t){return!t||!t.length?[]:t.filter(e=>!!e)}function JN(t,e){if(!t||!t.length)return{regexFree:[],regexes:[]};const n=[],r=[];return r.push(...t.filter(i=>{const o=i instanceof RegExp;return o&&e&&n.push(i),!o})),{regexFree:r,regexes:n}}function ye(t,e){return t.classList===void 0||typeof e!="string"||e===""?!1:t.classList.contains(e)}function X(t,e){typeof e=="string"&&(e=e.split(" ")),e=ZN(e),e.length>0&&t.classList.add(...e)}function we(t,e){typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);let{regexFree:n,regexes:r}=JN(e,!0);n=ZN(n),n.length>0&&t.classList.remove(...n),r.forEach(i=>{t.classList.forEach(o=>{i.test(o)&&t.classList.remove(o)})})}function Re(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;Array.isArray(e)||(e=[[e,n]]),e.forEach(r=>{Array.isArray(r)&&r[0]!==""&&t.setAttribute(...r)})}function Zu(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);const{regexFree:n,regexes:r}=JN(e,!0);n.forEach(i=>{i!==""&&t.removeAttribute(i)}),r.forEach(i=>{t.getAttributeNames().forEach(o=>{i.test(o)&&t.removeAttribute(o)})})}function QN(t){if(t.nodeType===3)t.parentNode.removeChild(t);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(t.nodeName)>-1){const e=t.childNodes;for(let n=e.length-1;n>=0;n--)QN(e[n])}}function rs(t){let e;for(;e=t.lastChild;)t.removeChild(e)}const Mz=/(<(.*)>|&(.*);)/;function Ju(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;Mz.test(e)?t.innerHTML=n?BR(e):e:al(t,e)}function al(t,e){const n=t.firstChild;n&&n.nodeType===3&&n.nextSibling===null?n.textContent=e:(rs(t),t.appendChild(t.ownerDocument.createTextNode(e)))}function Du(t){const e=t.ownerDocument.documentElement,n=t.ownerDocument.defaultView;let r=t;for(;r!==e;){if(r===null)return!1;if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE)if(r.host){if(r.host.impl)return Du(r.host.impl);if(r.host)return Du(r.host);throw new Error("Lost in Web Components world")}else return!1;else if(n.getComputedStyle(r).display==="none")return!1;r=r.parentNode}return!0}function Iz(t){const n=t.ownerDocument.defaultView;let r=t;for(;r.parentNode;){if(r.style.height==="0px"||r.style.height==="0")return n.getComputedStyle(r).overflow==="hidden";r=r.parentNode}return!1}function Nn(t){const e=t.ownerDocument,n=e.defaultView,r=e.documentElement;let i=t,o,s,a;for(o=i.offsetLeft,s=i.offsetTop,a=i;(i=i.offsetParent)&&!(i===e.body||!("offsetLeft"in i));)o+=i.offsetLeft,s+=i.offsetTop,a=i;return a&&a.style.position==="fixed"&&(o+=n.pageXOffset||r.scrollLeft,s+=n.pageYOffset||r.scrollTop),{left:o,top:s}}function eD(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollY}function zR(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollX}function YR(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?eD(e):t.scrollTop}function tD(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?zR(e):t.scrollLeft}function Zg(t){let e=t.ownerDocument,n=e?e.defaultView:void 0;e||(e=t.document?t.document:t,n=e.defaultView);const r=["auto","scroll"];let i=t.parentNode;for(;i&&i.style&&e.body!==i;){let{overflow:o,overflowX:s,overflowY:a}=i.style;if([o,s,a].includes("scroll"))return i;if({overflow:o,overflowX:s,overflowY:a}=n.getComputedStyle(i),r.includes(o)||r.includes(s)||r.includes(a)||i.clientHeight<=i.scrollHeight+1&&(r.includes(a)||r.includes(o))||i.clientWidth<=i.scrollWidth+1&&(r.includes(s)||r.includes(o)))return i;i=i.parentNode}return n}function Pz(t){return t.scrollHeight-t.clientHeight}function Oz(t){return t.scrollWidth-t.clientWidth}function zh(t){const e=t.ownerDocument,n=e.defaultView;let r=t.parentNode;for(;r&&r.style&&e.body!==r;){if(r.style.overflow!=="visible"&&r.style.overflow!=="")return r;const i=n.getComputedStyle(r),o=["scroll","hidden","auto"],s=i.getPropertyValue("overflow"),a=i.getPropertyValue("overflow-y"),l=i.getPropertyValue("overflow-x");if(o.includes(s)||o.includes(a)||o.includes(l))return r;r=r.parentNode}return n}function Jg(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:window;if(t){if(t===n)return e==="width"?`${n.innerWidth}px`:e==="height"?`${n.innerHeight}px`:void 0}else return;const r=t.style[e];if(r!==""&&r!==void 0)return r;const i=n.getComputedStyle(t);if(i[e]!==""&&i[e]!==void 0)return i[e]}function Xt(t){return t.offsetWidth}function an(t){return t.offsetHeight}function yh(t){return t.clientHeight||t.innerHeight}function nD(t){return t.clientWidth||t.innerWidth}function rD(t){return t.selectionStart?t.selectionStart:0}function xz(t){return t.selectionEnd?t.selectionEnd:0}function YP(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window;t.getSelection&&(t.getSelection().empty?t.getSelection().empty():t.getSelection().removeAllRanges&&t.getSelection().removeAllRanges())}function op(t,e,n){if(n===void 0&&(n=e),t.setSelectionRange){t.focus();try{t.setSelectionRange(e,n)}catch{const i=t.parentNode,o=i.style.display;i.style.display="block",t.setSelectionRange(e,n),i.style.display=o}}}let TC;function Az(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;const e=t.createElement("div");e.style.height="200px",e.style.width="100%";const n=t.createElement("div");n.style.boxSizing="content-box",n.style.height="150px",n.style.left="0px",n.style.overflow="hidden",n.style.position="absolute",n.style.top="0px",n.style.width="200px",n.style.visibility="hidden",n.appendChild(e),(t.body||t.documentElement).appendChild(n);const r=e.offsetWidth;n.style.overflow="scroll";let i=e.offsetWidth;return r===i&&(i=n.clientWidth),(t.body||t.documentElement).removeChild(n),r-i}function yn(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return TC===void 0&&(TC=Az(t)),TC}function iD(t){return t instanceof Window?t.document.body.scrollHeight>t.innerHeight:t.offsetWidth!==t.clientWidth}function oD(t){return t instanceof Window?t.document.body.scrollWidth>t.innerWidth:t.offsetHeight!==t.clientHeight}function GR(t,e,n){t.style.transform=`translate3d(${e},${n},0)`}function sp(t){t.style.transform&&t.style.transform!==""&&(t.style.transform="")}function Ig(t){return t&&(["INPUT","SELECT","TEXTAREA"].indexOf(t.nodeName)>-1||t.contentEditable==="true")}function sD(t){return Ig(t)&&t.hasAttribute("data-hot-input")===!1}function aD(t){return!t.parentNode}function Hz(t,e){new IntersectionObserver((r,i)=>{r.forEach(o=>{o.isIntersecting&&t.offsetParent!==null&&(e(),i.unobserve(t))})},{root:t.ownerDocument.body}).observe(t)}function lD(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const r=t.ownerDocument,i=r.createRange(),o=r.defaultView.getSelection();Re(t,"contenteditable",!0),n&&Re(t,...bl()),e&&X(t,"invisibleSelection"),i.selectNodeContents(t),o.removeAllRanges(),o.addRange(i)}function uD(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const n=t.ownerDocument.defaultView.getSelection();t.hasAttribute("aria-hidden")&&t.removeAttribute("aria-hidden"),n.removeAllRanges(),e&&we(t,"invisibleSelection"),t.removeAttribute("contenteditable")}function Nz(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;lD(t,n),e(),uD(t,n)}function ts(t){var e;const n=t==null||(e=t.ownerDocument)===null||e===void 0?void 0:e.defaultView.Element;return!!(n&&n!==null&&t instanceof n)}function ut(t){return typeof t=="function"}function ap(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200,n=null,r;function i(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return n&&clearTimeout(n),n=setTimeout(()=>{r=t.apply(this,s)},e),r}return i}function cD(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return t.apply(this,n.concat(s))}}function Dz(t){const e=t.length;function n(r){return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];const l=r.concat(s);let u;return l.length>=e?u=t.apply(this,l):u=n(l),u}}return n([])}function hb(t,e,n,r,i,o,s,a){return ue(a)?t.call(e,n,r,i,o,s,a):ue(s)?t.call(e,n,r,i,o,s):ue(o)?t.call(e,n,r,i,o):ue(i)?t.call(e,n,r,i):ue(r)?t.call(e,n,r):ue(n)?t.call(e,n):t.call(e)}var GP={},_C,qP;function kz(){if(qP)return _C;qP=1;var t=Ar(),e=hR().get;return _C=function(r){if(!t(r))return!1;var i=e(r);return!!i&&i.type==="RawJSON"},_C}var MC,KP;function Lz(){if(KP)return MC;KP=1;var t=Qt(),e=Hr(),n=SyntaxError,r=parseInt,i=String.fromCharCode,o=t("".charAt),s=t("".slice),a=t(/./.exec),l={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":`
49
- `,"\\r":"\r","\\t":" "},u=/^[\da-f]{4}$/i,c=/^[\u0000-\u001F]$/;return MC=function(h,d){for(var f=!0,m="";d<h.length;){var C=o(h,d);if(C==="\\"){var y=s(h,d,d+2);if(e(l,y))m+=l[y],d+=2;else if(y==="\\u"){d+=2;var E=s(h,d,d+4);if(!a(u,E))throw new n("Bad Unicode escape at: "+d);m+=i(r(E,16)),d+=4}else throw new n('Unknown escape sequence: "'+y+'"')}else if(C==='"'){f=!1,d++;break}else{if(a(c,C))throw new n("Bad control character in string literal at: "+d);m+=C,d++}}if(f)throw new n("Unterminated string at: "+d);return{value:m,end:d}},MC}var IC,XP;function $z(){if(XP)return IC;XP=1;var t=Jt();return IC=!t(function(){var e="9007199254740993",n=JSON.rawJSON(e);return!JSON.isRawJSON(n)||JSON.stringify(n)!==e}),IC}var ZP;function Fz(){if(ZP)return GP;ZP=1;var t=vt(),e=ju(),n=fd(),r=un(),i=Qt(),o=Jt(),s=H1(),a=pn(),l=kz(),u=iR(),c=ml(),h=Ym(),d=CR(),f=Lz(),m=aR(),C=rR(),y=$z(),E=String,v=e("JSON","stringify"),O=i(/./.exec),x=i("".charAt),F=i("".charCodeAt),I=i("".replace),_=i("".slice),q=i([].push),G=i(1.1.toString),U=/[\uD800-\uDFFF]/g,J=/^[\uD800-\uDBFF]$/,te=/^[\uDC00-\uDFFF]$/,le=m(),ne=le.length,se=!C||o(function(){var Le=e("Symbol")("stringify detection");return v([Le])!=="[null]"||v({a:Le})!=="{}"||v(Object(Le))!=="{}"}),Ge=o(function(){return v("\uDF06\uD834")!=='"\\udf06\\ud834"'||v("\uDEAD")!=='"\\udead"'}),ve=se?function(Le,P){var g=d(arguments),w=it(P);if(!(!a(w)&&(Le===void 0||u(Le))))return g[1]=function(p,T){if(a(w)&&(T=r(w,this,E(p),T)),!u(T))return T},n(v,null,g)}:v,Oe=function(Le,P,g){var w=x(g,P-1),p=x(g,P+1);return O(J,Le)&&!O(te,p)||O(te,Le)&&!O(J,w)?"\\u"+G(F(Le,0),16):Le},it=function(Le){if(a(Le))return Le;if(s(Le)){for(var P=Le.length,g=[],w=0;w<P;w++){var p=Le[w];typeof p=="string"?q(g,p):(typeof p=="number"||c(p)==="Number"||c(p)==="String")&&q(g,h(p))}var T=g.length,M=!0;return function(V,z){if(M)return M=!1,z;if(s(this))return z;for(var Y=0;Y<T;Y++)if(g[Y]===V)return z}}};return v&&t({target:"JSON",stat:!0,arity:3,forced:se||Ge||!y},{stringify:function(P,g,w){var p=it(g),T=[],M=ve(P,function(L,A){var k=a(p)?r(p,this,E(L),A):A;return!y&&l(k)?le+(q(T,k.rawJSON)-1):k},w);if(typeof M!="string"||(Ge&&(M=I(M,U,Oe)),y))return M;for(var V="",z=M.length,Y=0;Y<z;Y++){var S=x(M,Y);if(S==='"'){var R=f(M,++Y).end-1,b=_(M,Y,R);V+=_(b,0,ne)===le?T[_(b,ne)]:'"'+b+'"',Y=R}else V+=S}return V}}),GP}Fz();function Yh(t){let e;return Array.isArray(t)?e=t.length?new Array(t.length).fill(null):[]:(e={},ke(t,(n,r)=>{r!=="__children"&&(n&&typeof n=="object"&&!Array.isArray(n)?e[r]=Yh(n):Array.isArray(n)?n.length&&typeof n[0]=="object"&&!Array.isArray(n[0])?e[r]=[Yh(n[0])]:e[r]=[]:e[r]=null)})),e}function Vz(t,e){return e.prototype.constructor=e,t.prototype=new e,t.prototype.constructor=t,t}function ln(t,e,n){const r=Array.isArray(n);return ke(e,(i,o)=>{(r===!1||n.includes(o))&&(t[o]=i)}),t}function lp(t,e){ke(e,(n,r)=>{e[r]&&typeof e[r]=="object"?(t[r]||(Array.isArray(e[r])?t[r]=[]:Object.prototype.toString.call(e[r])==="[object Date]"?t[r]=e[r]:t[r]={}),lp(t[r],e[r])):t[r]=e[r]})}function Kn(t){return typeof t=="object"?JSON.parse(JSON.stringify(t)):t}function fo(t){const e={};return ke(t,(n,r)=>{e[r]=n}),e}function gt(t){t.MIXINS||(t.MIXINS=[]);for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return H(n,i=>{t.MIXINS.push(i.MIXIN_NAME),ke(i,(o,s)=>{if(t.prototype[s]!==void 0)throw new Error(`Mixin conflict. Property '${s}' already exist and cannot be overwritten.`);if(typeof o=="function")t.prototype[s]=o;else{const a=function(c,h){const d=`_${c}`,f=m=>{let C=m;return(Array.isArray(C)||De(C))&&(C=Kn(C)),C};return function(){return this[d]===void 0&&(this[d]=f(h)),this[d]}},l=function(c){const h=`_${c}`;return function(d){this[h]=d}};Object.defineProperty(t.prototype,s,{get:a(s,o),set:l(s),configurable:!0})}})}),t}function qR(t,e){return JSON.stringify(t)===JSON.stringify(e)}function De(t){return Object.prototype.toString.call(t)==="[object Object]"}function us(t,e,n,r){r.value=n,r.writable=r.writable!==!1,r.enumerable=r.enumerable!==!1,r.configurable=r.configurable!==!1,Object.defineProperty(t,e,r)}function ke(t,e){for(const n in t)if((!t.hasOwnProperty||t.hasOwnProperty&&Object.prototype.hasOwnProperty.call(t,n))&&e(t[n],n,t)===!1)break;return t}function Wz(t,e){const n=e.split(".");let r=t;return ke(n,i=>{if(r=r[i],r===void 0)return r=void 0,!1}),r}function PC(t,e,n){if(typeof e!="string")return;const r=e.split(".");let i=t;r.forEach((o,s)=>{o==="__proto__"||o==="constructor"||o==="prototype"||(s!==r.length-1?(sn(i,o)||(i[o]={}),i=i[o]):i[o]=n)})}function KR(t){if(!De(t))return 0;const e=function(n){let r=0;return De(n)?ke(n,(i,o)=>{o!=="__children"&&(r+=e(i))}):r+=1,r};return e(t)}function xr(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"value";const n=`_${e}`,r={_touched:!1,[n]:t,isTouched(){return this._touched}};return Object.defineProperty(r,e,{get(){return this[n]},set(i){this._touched=!0,this[n]=i},enumerable:!0,configurable:!0}),r}function sn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Qg(t){return window.requestAnimationFrame(t)}function em(t){window.cancelAnimationFrame(t)}function hD(){return"ontouchstart"in window}function Bz(){return typeof window<"u"}let Il;function jz(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Il||(typeof Intl=="object"?Il=new Intl.Collator(t,e).compare:typeof String.prototype.localeCompare=="function"?Il=(n,r)=>`${n}`.localeCompare(r):Il=(n,r)=>n===r?0:n>r?-1:1,Il)}const Br=t=>{const e={value:!1};return e.test=(n,r)=>{e.value=t(n,r)},e},Qs={chrome:Br((t,e)=>/Chrome/.test(t)&&/Google/.test(e)),chromeWebKit:Br(t=>/CriOS/.test(t)),edge:Br(t=>/Edge/.test(t)),edgeWebKit:Br(t=>/EdgiOS/.test(t)),firefox:Br(t=>/Firefox/.test(t)),firefoxWebKit:Br(t=>/FxiOS/.test(t)),mobile:Br(t=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t)),safari:Br((t,e)=>/Safari/.test(t)&&/Apple Computer/.test(e))},yd={mac:Br(t=>/^Mac/.test(t)),win:Br(t=>/^Win/.test(t)),linux:Br(t=>/^Linux/.test(t)),ios:Br(t=>/iPhone|iPad|iPod/i.test(t))};function Uz(){let{userAgent:t=navigator.userAgent,vendor:e=navigator.vendor}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ke(Qs,n=>{let{test:r}=n;return void r(t,e)})}function zz(){let{platform:t=navigator.platform}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ke(yd,e=>{let{test:n}=e;return void n(t)})}Bz()&&(Uz(),zz());function dD(){return Qs.chrome.value}function Yz(){return Qs.chromeWebKit.value}function OC(){return Qs.firefox.value}function Gz(){return Qs.firefoxWebKit.value}function tm(){return Qs.safari.value}function qz(){return Qs.edge.value}function qo(){return Qs.mobile.value}function fD(){return yd.ios.value}function gD(){let{maxTouchPoints:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:navigator;return t>2&&yd.mac.value}function JP(){return yd.win.value}function QP(){return yd.mac.value}const pe={ALT:18,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39,ARROW_UP:38,AUDIO_DOWN:OC()?182:174,AUDIO_MUTE:OC()?181:173,AUDIO_UP:OC()?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},Kz=[pe.ALT,pe.ARROW_DOWN,pe.ARROW_LEFT,pe.ARROW_RIGHT,pe.ARROW_UP,pe.AUDIO_DOWN,pe.AUDIO_MUTE,pe.AUDIO_UP,pe.BACKSPACE,pe.CAPS_LOCK,pe.DELETE,pe.END,pe.ENTER,pe.ESCAPE,pe.F1,pe.F2,pe.F3,pe.F4,pe.F5,pe.F6,pe.F7,pe.F8,pe.F9,pe.F10,pe.F11,pe.F12,pe.F13,pe.F14,pe.F15,pe.F16,pe.F17,pe.F18,pe.F19,pe.HOME,pe.INSERT,pe.MEDIA_NEXT,pe.MEDIA_PLAY_PAUSE,pe.MEDIA_PREV,pe.MEDIA_STOP,pe.NULL,pe.NUM_LOCK,pe.PAGE_DOWN,pe.PAGE_UP,pe.PAUSE,pe.SCROLL_LOCK,pe.SHIFT,pe.TAB];function Xz(t){return t===32||t>=48&&t<=57||t>=96&&t<=111||t>=186&&t<=192||t>=219&&t<=222||t>=226||t>=65&&t<=90}function mD(t){return Kz.includes(t)}function Zz(t){return[pe.CONTROL,pe.COMMAND_LEFT,pe.COMMAND_RIGHT,pe.COMMAND_FIREFOX].includes(t)}function Sd(t,e){const n=e.split("|");let r=!1;return H(n,i=>{if(t===pe[i])return r=!0,!1}),r}function Pi(t){t.isImmediatePropagationEnabled=!1,t.cancelBubble=!0}function Ga(t){return t.isImmediatePropagationEnabled===!1}function ll(t){return t.button===2}function XR(t){return t.button===0}function Jz(t){return t instanceof TouchEvent}function Qz(t,e){const n={x:t.offsetX,y:t.offsetY};let r=t.target;if(!ts(e)||r!==e&&r.contains(e))return n;for(;r!==e;)n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;return n}function tt(){ue(console)&&console.warn(...arguments)}function ZR(){ue(console)&&console.error(...arguments)}const qa=["afterCellMetaReset","afterChange","afterContextMenuDefaultOptions","beforeContextMenuSetItems","afterDropdownMenuDefaultOptions","beforeDropdownMenuSetItems","afterContextMenuHide","beforeContextMenuShow","afterContextMenuShow","afterCopyLimit","beforeCreateCol","afterColumnSequenceChange","afterCreateCol","beforeCreateRow","afterCreateRow","afterDeselect","afterDestroy","afterDocumentKeyDown","afterDrawSelection","beforeRemoveCellClassNames","beforeCompositionStart","afterGetCellMeta","afterGetColHeader","afterGetRowHeader","afterInit","afterLoadData","afterUpdateData","afterMomentumScroll","afterOnCellCornerMouseDown","afterOnCellCornerDblClick","afterOnCellMouseDown","afterOnCellMouseUp","afterOnCellContextMenu","afterOnCellMouseOver","afterOnCellMouseOut","afterRemoveCol","afterRemoveRow","beforeRenderer","afterRenderer","afterRowSequenceChange","beforeViewportScrollVertically","beforeViewportScrollHorizontally","beforeViewportScroll","afterScrollHorizontally","afterScrollVertically","afterScroll","afterSelection","afterSelectionByProp","afterSelectionEnd","afterSelectionEndByProp","afterSelectionFocusSet","beforeSelectColumns","afterSelectColumns","beforeSelectRows","afterSelectRows","afterSetCellMeta","afterRemoveCellMeta","afterSetDataAtCell","afterSetDataAtRowProp","afterSetSourceDataAtCell","afterSetTheme","afterUpdateSettings","afterValidate","beforeLanguageChange","afterLanguageChange","beforeAutofill","afterAutofill","beforeCellAlignment","beforeChange","beforeChangeRender","beforeDrawBorders","beforeGetCellMeta","beforeRemoveCellMeta","beforeInit","beforeInitWalkontable","beforeLoadData","beforeUpdateData","beforeKeyDown","beforeOnCellMouseDown","beforeOnCellMouseUp","beforeOnCellContextMenu","beforeOnCellMouseOver","beforeOnCellMouseOut","beforeRemoveCol","beforeRemoveRow","beforeViewRender","afterViewRender","beforeRender","afterRender","beforeRowWrap","beforeColumnWrap","beforeSetCellMeta","beforeSelectionFocusSet","beforeSetRangeStartOnly","beforeSetRangeStart","beforeSetRangeEnd","beforeSelectionHighlightSet","beforeTouchScroll","beforeValidate","beforeValueRender","construct","init","modifyColHeader","modifyColWidth","modifyFiltersMultiSelectValue","modifyFocusedElement","modifyRowHeader","modifyRowHeight","modifyRowHeightByOverlayName","modifyData","modifySourceData","modifyRowData","modifyGetCellCoords","modifyGetCoordsElement","modifyFocusOnTabNavigation","beforeHighlightingRowHeader","beforeHighlightingColumnHeader","persistentStateLoad","persistentStateReset","persistentStateSave","beforeColumnSort","afterColumnSort","modifyAutofillRange","modifyCopyableRange","beforeCut","afterCut","beforeCopy","afterCopy","beforePaste","afterPaste","beforeColumnFreeze","afterColumnFreeze","beforeColumnMove","afterColumnMove","beforeColumnUnfreeze","afterColumnUnfreeze","beforeRowMove","afterRowMove","beforeColumnResize","afterColumnResize","beforeRowResize","afterRowResize","afterGetColumnHeaderRenderers","afterGetRowHeaderRenderers","beforeStretchingColumnWidth","beforeFilter","afterFilter","afterFormulasValuesUpdate","afterNamedExpressionAdded","afterNamedExpressionRemoved","afterSheetAdded","afterSheetRenamed","afterSheetRemoved","modifyColumnHeaderHeight","modifyColumnHeaderValue","beforeUndo","beforeUndoStackChange","afterUndo","afterUndoStackChange","beforeRedo","beforeRedoStackChange","afterRedo","afterRedoStackChange","modifyRowHeaderWidth","modifyTransformFocus","modifyTransformStart","modifyTransformEnd","afterModifyTransformFocus","afterModifyTransformStart","afterModifyTransformEnd","afterViewportRowCalculatorOverride","afterViewportColumnCalculatorOverride","afterPluginsInitialized","beforeHideRows","afterHideRows","beforeUnhideRows","afterUnhideRows","beforeHideColumns","afterHideColumns","beforeUnhideColumns","afterUnhideColumns","beforeTrimRow","afterTrimRow","beforeUntrimRow","afterUntrimRow","beforeDropdownMenuShow","afterDropdownMenuShow","afterDropdownMenuHide","beforeAddChild","afterAddChild","beforeDetachChild","afterDetachChild","beforeBeginEditing","afterBeginEditing","beforeMergeCells","afterMergeCells","beforeUnmergeCells","afterUnmergeCells","afterListen","afterUnlisten","afterRefreshDimensions","beforeRefreshDimensions","beforeColumnCollapse","afterColumnCollapse","beforeColumnExpand","afterColumnExpand","modifyAutoColumnSizeSeed"],xC=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"]]),AC=new Map([[]]);var eO={},HC,tO;function eY(){if(tO)return HC;tO=1;var t=Yu();return HC=function(e,n,r){for(var i=0,o=arguments.length>2?r:t(n),s=new e(o);o>i;)s[i]=n[i++];return s},HC}var NC,nO;function tY(){if(nO)return NC;nO=1;var t=Zt();return NC=function(e,n){var r=t[e],i=r&&r.prototype;return i&&i[n]},NC}var DC,rO;function up(){if(rO)return DC;rO=1;var t=Mi(),e=pR(),n=Zs().f,r=t("unscopables"),i=Array.prototype;return i[r]===void 0&&n(i,r,{configurable:!0,value:e(null)}),DC=function(o){i[r][o]=!0},DC}var iO;function nY(){if(iO)return eO;iO=1;var t=vt(),e=Qt(),n=mr(),r=ud(),i=eY(),o=tY(),s=up(),a=Array,l=e(o("Array","sort"));return t({target:"Array",proto:!0},{toSorted:function(c){c!==void 0&&n(c);var h=r(this),d=i(a,h);return l(d,c)}}),s("toSorted"),eO}nY();var oO={},sO={},aO;function rY(){if(aO)return sO;aO=1;var t=vt(),e=un(),n=Gu(),r=mr(),i=cn(),o=mo(),s=pr(),a=Js(),l=a("find",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{find:function(c){i(this);try{r(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;return n(h,function(f,m){if(c(f,d++))return m(f)},{IS_RECORD:!0,INTERRUPTED:!0}).result}}),sO}var lO;function iY(){return lO||(lO=1,rY()),oO}iY();function oY(t,e){pD(t,e),e.add(t)}function kC(t,e,n){pD(t,e),e.set(t,n)}function pD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function uO(t,e,n){return t.set(nm(t,e),n),n}function Rn(t,e){return t.get(nm(t,e))}function nm(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const sY=100;var br=new WeakMap,du=new WeakMap,LC=new WeakMap,$C=new WeakSet;class cO{constructor(){oY(this,$C),kC(this,br,new Map),kC(this,du,new Map),kC(this,LC,new Set),qa.forEach(e=>nm($C,this,hO).call(this,e))}getHooks(e){var n;return(n=Rn(br,this).get(e))!==null&&n!==void 0?n:[]}add(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Rn(br,this).has(e)||(nm($C,this,hO).call(this,e),qa.push(e));const i=Rn(br,this).get(e);if(i.find(u=>u.callback===n))return;const o=Number.isInteger(r.orderIndex)?r.orderIndex:0,s=!!r.runOnce,a=!!r.initialHook;let l=!1;if(a){const u=i.find(c=>c.initialHook);u&&(u.callback=n,l=!0)}if(!l){i.push({callback:n,orderIndex:o,runOnce:s,initialHook:a,skip:!1});let u=Rn(LC,this).has(e);!u&&o!==0&&(u=!0,Rn(LC,this).add(e)),u&&i.length>1&&Rn(br,this).set(e,i.toSorted((c,h)=>c.orderIndex-h.orderIndex))}}has(e){return Rn(br,this).has(e)&&Rn(br,this).get(e).length>0}remove(e,n){if(!Rn(br,this).has(e))return!1;const r=Rn(br,this).get(e),i=r.find(o=>o.callback===n);if(i){let o=Rn(du,this).get(e);return i.skip=!0,o+=1,o>sY&&(Rn(br,this).set(e,r.filter(s=>!s.skip)),o=0),Rn(du,this).set(e,o),!0}return!1}destroy(){Rn(br,this).clear(),Rn(du,this).clear(),uO(br,this,null),uO(du,this,null)}}function hO(t){Rn(br,this).set(t,[]),Rn(du,this).set(t,0)}function aY(t,e,n){return(e=lY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lY(t){var e=uY(t,"string");return typeof e=="symbol"?e:e+""}function uY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const cY=st`The plugin hook "[hookName]" was removed in Handsontable [removedInVersion].\x20
50
- Please consult release notes https://github.com/handsontable/handsontable/releases/tag/[removedInVersion] to\x20
51
- learn about the migration path.`;class ie{constructor(){aY(this,"globalBucket",new cO)}static getSingleton(){return dY()}getBucket(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e?(e.pluginHookBucket||(e.pluginHookBucket=new cO),e.pluginHookBucket):this.globalBucket}add(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;return Array.isArray(n)?H(n,o=>this.add(e,o,r)):(xC.has(e)&&tt(UN(cY,{hookName:e,removedInVersion:xC.get(e)})),AC.has(e)&&tt(AC.get(e)),this.getBucket(r).add(e,n,{orderIndex:i,runOnce:!1})),this}once(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;return Array.isArray(n)?H(n,o=>this.once(e,o,r)):this.getBucket(r).add(e,n,{orderIndex:i,runOnce:!0}),this}addAsFixed(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return Array.isArray(n)?H(n,i=>this.addAsFixed(e,i,r)):this.getBucket(r).add(e,n,{initialHook:!0}),this}remove(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return this.getBucket(r).remove(e,n)}has(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this.getBucket(n).has(e)}run(e,n,r,i,o,s,a,l){{const u=this.getBucket().getHooks(n),c=u?u.length:0;let h=0;if(c)for(;h<c;){if(!u[h]||u[h].skip){h+=1;continue}const d=hb(u[h].callback,e,r,i,o,s,a,l);d!==void 0&&(r=d),u[h]&&u[h].runOnce&&this.remove(n,u[h].callback),h+=1}}{const u=this.getBucket(e).getHooks(n),c=u?u.length:0;let h=0;if(c)for(;h<c;){if(!u[h]||u[h].skip){h+=1;continue}const d=hb(u[h].callback,e,r,i,o,s,a,l);d!==void 0&&(r=d),u[h]&&u[h].runOnce&&this.remove(n,u[h].callback,e),h+=1}}return r}destroy(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.getBucket(e).destroy()}register(e){this.isRegistered(e)||qa.push(e)}deregister(e){this.isRegistered(e)&&qa.splice(qa.indexOf(e),1)}isDeprecated(e){return AC.has(e)||xC.has(e)}isRegistered(e){return qa.indexOf(e)>=0}getRegistered(){return qa}}const hY=new ie;function dY(){return hY}const FC=new Map;function Oi(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"common";FC.has(t)||FC.set(t,new Map);const e=FC.get(t);function n(a,l){e.set(a,l)}function r(a){return e.get(a)}function i(a){return e.has(a)}function o(){return[...e.keys()]}function s(){return[...e.values()]}return{register:n,getItem:r,hasItem:i,getNames:o,getValues:s}}const db=new WeakMap,{register:fY,getItem:wD,hasItem:vD,getNames:Zle,getValues:Jle}=Oi("editors");function gY(t){const e={},n=t;this.getConstructor=function(){return t},this.getInstance=function(r){return r.guid in e||(e[r.guid]=new n(r)),e[r.guid]},ie.getSingleton().add("afterDestroy",function(){e[this.guid]=null})}function CD(t,e){let n;if(typeof t=="function")db.get(t)||Er(null,t),n=db.get(t);else if(typeof t=="string")n=wD(t);else throw Error('Only strings and functions can be passed as "editor" parameter');if(!n)throw Error(`No editor registered under name "${t}"`);return n.getInstance(e)}function fb(t){if(typeof t=="function")return t;if(!vD(t))throw Error(`No registered editor found under "${t}" name`);return wD(t).getConstructor()}function Er(t,e){t&&typeof t!="string"&&(e=t,t=e.EDITOR_TYPE);const n=new gY(e);typeof t=="string"&&fY(t,n),db.set(e,n)}function mY(t,e,n){return(e=pY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pY(t){var e=wY(t,"string");return typeof e=="symbol"?e:e+""}function wY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class _i{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;mY(this,"context",void 0),this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])}addEventListener(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;function o(s){r.call(this,vY(s))}return this.context.eventListeners.push({element:e,event:n,callback:r,callbackProxy:o,options:i,eventManager:this}),e.addEventListener(n,o,i),()=>{this.removeEventListener(e,n,r)}}removeEventListener(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=this.context.eventListeners.length,s;for(;o;)if(o-=1,s=this.context.eventListeners[o],s.event===n&&s.element===e){if(r&&r!==s.callback||i&&s.eventManager!==this)continue;this.context.eventListeners.splice(o,1),s.element.removeEventListener(s.event,s.callbackProxy,s.options)}}clearEvents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.context)return;let n=this.context.eventListeners.length;for(;n;){n-=1;const r=this.context.eventListeners[n];e&&r.eventManager!==this||(this.context.eventListeners.splice(n,1),r.element.removeEventListener(r.event,r.callbackProxy,r.options))}}clear(){this.clearEvents()}destroy(){this.clearEvents(),this.context=null}destroyWithOwnEventsOnly(){this.clearEvents(!0),this.context=null}fireEvent(e,n){let r=e.document,i=e;r||(r=e.ownerDocument?e.ownerDocument:e,i=r.defaultView);const o={bubbles:!0,cancelable:n!=="mousemove",view:i,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0};let s;r.createEvent?(s=r.createEvent("MouseEvents"),s.initMouseEvent(n,o.bubbles,o.cancelable,o.view,o.detail,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,r.body.parentNode)):s=r.createEventObject(),e.dispatchEvent?e.dispatchEvent(s):e.fireEvent(`on${n}`,s)}}function vY(t){const e=t.stopImmediatePropagation;return t.stopImmediatePropagation=function(){e.apply(this),Pi(this)},t}function CY(t,e){yY(t,e),e.add(t)}function yY(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function sa(t,e,n){return(e=SY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function SY(t){var e=bY(t,"string");return typeof e=="symbol"?e:e+""}function bY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function VC(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var jd=new WeakSet;class gb{constructor(e,n,r){CY(this,jd),sa(this,"hot",void 0),sa(this,"tableMeta",void 0),sa(this,"selection",void 0),sa(this,"eventManager",void 0),sa(this,"destroyed",!1),sa(this,"activeEditor",void 0),sa(this,"cellProperties",void 0),this.hot=e,this.tableMeta=n,this.selection=r,this.eventManager=new _i(e),this.hot.addHook("afterDocumentKeyDown",i=>VC(jd,this,dO).call(this,i)),this.hot.addHook("beforeCompositionStart",i=>VC(jd,this,dO).call(this,i)),this.hot.view._wt.update("onCellDblClick",(i,o,s)=>VC(jd,this,RY).call(this,i,o,s))}getActiveEditor(){return this.activeEditor}prepareEditor(){var e;if(this.activeEditor&&this.activeEditor.isWaiting()){this.closeEditor(!1,!1,u=>{u&&this.prepareEditor()});return}const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!n||n.isHeader())return;const{row:r,col:i}=n,o=this.hot.runHooks("modifyGetCellCoords",r,i,!1,"meta");let s=r,a=i;if(Array.isArray(o)&&([s,a]=o),this.cellProperties=this.hot.getCellMeta(s,a),!this.isCellEditable()){this.clearActiveEditor();return}const l=this.hot.getCell(r,i,!0);if(l){const u=this.hot.getCellEditor(this.cellProperties),c=this.hot.colToProp(a),h=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(s),a);this.activeEditor=CD(u,this.hot),this.activeEditor.prepare(r,i,c,l,h,this.cellProperties)}}isEditorOpened(){return this.activeEditor&&this.activeEditor.isOpened()}openEditor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(!this.isCellEditable()){this.clearActiveEditor();return}const i=this.hot.getSelectedRangeLast();let o=this.hot.runHooks("beforeBeginEditing",i.highlight.row,i.highlight.col,e,n,r);if(n instanceof MouseEvent&&typeof o!="boolean"&&(o=this.hot.selection.getLayerLevel()===0&&i.isSingle()),o===!1){this.clearActiveEditor();return}this.activeEditor||(this.hot.scrollToFocusedCell(),this.prepareEditor()),this.activeEditor&&(r&&this.activeEditor.enableFullEditMode(),this.activeEditor.beginEditing(e,n))}closeEditor(e,n,r){this.activeEditor?this.activeEditor.finishEditing(e,n,r):r&&r(!1)}closeEditorAndSaveChanges(e){this.closeEditor(!1,e)}closeEditorAndRestoreOriginalValue(e){this.closeEditor(!0,e)}clearActiveEditor(){this.activeEditor=void 0}isCellEditable(){const e=this.hot.getSelectedRangeLast();if(!e)return!1;const n=this.hot.getCellEditor(this.cellProperties),{row:r,col:i}=e.highlight,{rowIndexMapper:o,columnIndexMapper:s}=this.hot,a=o.isHidden(this.hot.toPhysicalRow(r))||s.isHidden(this.hot.toPhysicalColumn(i));return!(this.cellProperties.readOnly||!n||a)}moveSelectionAfterEnter(e){const n={...typeof this.tableMeta.enterMoves=="function"?this.tableMeta.enterMoves(e):this.tableMeta.enterMoves};e.shiftKey&&(n.row=-n.row,n.col=-n.col),this.hot.selection.isMultiple()?this.selection.transformFocus(n.row,n.col):this.selection.transformStart(n.row,n.col,!0)}destroy(){this.destroyed=!0,this.eventManager.destroy()}}function dO(t){const e=this.hot.getSelectedRangeLast();if(!this.hot.isListening()||!e||e.highlight.isHeader()||Ga(t))return;const{keyCode:n}=t,r=(t.ctrlKey||t.metaKey)&&!t.altKey;(!this.activeEditor||this.activeEditor&&!this.activeEditor.isWaiting())&&!mD(n)&&!Zz(n)&&!r&&!this.isEditorOpened()&&this.openEditor("",t)}function RY(t,e){e.isCell()&&this.openEditor(null,t,!0)}const fO=new WeakMap;gb.getInstance=function(t,e,n){let r=fO.get(t);return r||(r=new gb(t,e,n),fO.set(t,r)),r};function EY(t,e){yD(t,e),e.add(t)}function gc(t,e,n){yD(t,e),e.set(t,n)}function yD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ct(t,e){return t.get(jo(t,e))}function mc(t,e,n){return t.set(jo(t,e),n),n}function jo(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Pu=Object.freeze({CELL:"cell",MIXED:"mixed"});var on=new WeakMap,Ud=new WeakMap,zd=new WeakMap,Yd=new WeakMap,Gd=new WeakMap,Ps=new WeakSet;class TY{constructor(e){var n=this;EY(this,Ps),gc(this,on,void 0),gc(this,Ud,void 0),gc(this,zd,1),gc(this,Yd,null),gc(this,Gd,new Map);const r=e.getSettings();mc(on,this,e),mc(Ud,this,r.imeFastEdit?Pu.MIXED:Pu.CELL),Ct(on,this).addHook("afterUpdateSettings",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return jo(Ps,n,MY).call(n,...o)}),Ct(on,this).addHook("afterSelection",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return jo(Ps,n,gO).call(n,...o)}),Ct(on,this).addHook("afterSelectionFocusSet",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return jo(Ps,n,gO).call(n,...o)}),Ct(on,this).addHook("afterSelectionEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return jo(Ps,n,_Y).call(n,...o)})}getFocusMode(){return Ct(Ud,this)}setFocusMode(e){Object.values(Pu).includes(e)?mc(Ud,this,e):tt(`"${e}" is not a valid focus mode.`)}getRefocusDelay(){return Ct(zd,this)}setRefocusDelay(e){mc(zd,this,e)}setRefocusElementGetter(e){mc(Yd,this,e)}getRefocusElement(){var e;return typeof Ct(Yd,this)=="function"?Ct(Yd,this).call(this):(e=Ct(on,this).getActiveEditor())===null||e===void 0?void 0:e.TEXTAREA}focusOnHighlightedCell(e){const n=r=>{var i,o;const s=(i=Ct(on,this).getSelectedRangeLast())===null||i===void 0?void 0:i.highlight;if(!s)return;let a=Ct(on,this).runHooks("modifyFocusedElement",s.row,s.col,r);ts(a)||(a=r),a&&!((o=Ct(on,this).getActiveEditor())!==null&&o!==void 0&&o.isOpened())&&a.focus({preventScroll:!0})};e?n(e):jo(Ps,this,JR).call(this,r=>n(r))}refocusToEditorTextarea(){var e;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ct(zd,this);if(Ct(on,this).getSettings().imeFastEdit&&!((e=Ct(on,this).getActiveEditor())!==null&&e!==void 0&&e.isOpened())){var r,i;(r=Ct(on,this).getActiveEditor())===null||r===void 0||(i=r.refreshValue)===null||i===void 0||i.call(r),Ct(Gd,this).has(n)||Ct(Gd,this).set(n,ap(()=>{if(!Ct(on,this).isDestroyed){var o;(o=this.getRefocusElement())===null||o===void 0||o.select()}},n)),Ct(Gd,this).get(n)()}}}function JR(t){var e;const n=(e=Ct(on,this).getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!n||!Ct(on,this).selection.isCellVisible(n)){t(null);return}const r=Ct(on,this).getCell(n.row,n.col,!0);r===null?Ct(on,this).addHookOnce("afterScroll",()=>{t(Ct(on,this).getCell(n.row,n.col,!0))}):t(r)}function gO(){jo(Ps,this,JR).call(this,t=>{const{activeElement:e}=Ct(on,this).rootDocument;e&&sD(e)&&e.blur(),this.focusOnHighlightedCell(t)})}function _Y(){jo(Ps,this,JR).call(this,t=>{this.getFocusMode()===Pu.MIXED&&(t==null?void 0:t.nodeName)==="TD"&&this.refocusToEditorTextarea()})}function MY(t){typeof t.imeFastEdit=="boolean"&&this.setFocusMode(t.imeFastEdit?Pu.MIXED:Pu.CELL)}var mO={},WC,pO;function IY(){if(pO)return WC;pO=1;var t=Ar(),e=ml(),n=Mi(),r=n("match");return WC=function(i){var o;return t(i)&&((o=i[r])!==void 0?!!o:e(i)==="RegExp")},WC}var BC,wO;function PY(){if(wO)return BC;wO=1;var t=Zt(),e=Jt(),n=t.RegExp,r=!e(function(){var i=!0;try{n(".","d")}catch{i=!1}var o={},s="",a=i?"dgimsy":"gimsy",l=function(d,f){Object.defineProperty(o,d,{get:function(){return s+=f,!0}})},u={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};i&&(u.hasIndices="d");for(var c in u)l(c,u[c]);var h=Object.getOwnPropertyDescriptor(n.prototype,"flags").get.call(o);return h!==a||s!==a});return BC={correct:r},BC}var jC,vO;function OY(){if(vO)return jC;vO=1;var t=cn();return jC=function(){var e=t(this),n="";return e.hasIndices&&(n+="d"),e.global&&(n+="g"),e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),e.dotAll&&(n+="s"),e.unicode&&(n+="u"),e.unicodeSets&&(n+="v"),e.sticky&&(n+="y"),n},jC}var UC,CO;function xY(){if(CO)return UC;CO=1;var t=un(),e=Hr(),n=cd(),r=PY(),i=OY(),o=RegExp.prototype;return UC=r.correct?function(s){return s.flags}:function(s){return!r.correct&&n(o,s)&&!e(s,"flags")?t(i,s):s.flags},UC}var zC,yO;function AY(){if(yO)return zC;yO=1;var t=Qt(),e=Uu(),n=Math.floor,r=t("".charAt),i=t("".replace),o=t("".slice),s=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,a=/\$([$&'`]|\d{1,2})/g;return zC=function(l,u,c,h,d,f){var m=c+l.length,C=h.length,y=a;return d!==void 0&&(d=e(d),y=s),i(f,y,function(E,v){var O;switch(r(v,0)){case"$":return"$";case"&":return l;case"`":return o(u,0,c);case"'":return o(u,m);case"<":O=d[o(v,1,-1)];break;default:var x=+v;if(x===0)return E;if(x>C){var F=n(x/10);return F===0?E:F<=C?h[F-1]===void 0?r(v,1):h[F-1]+r(v,1):E}O=h[x-1]}return O===void 0?"":O})},zC}var SO;function HY(){if(SO)return mO;SO=1;var t=vt(),e=un(),n=Qt(),r=ld(),i=pn(),o=Ar(),s=IY(),a=Ym(),l=hd(),u=xY(),c=AY(),h=Mi(),d=Xs(),f=h("replace"),m=TypeError,C=n("".indexOf),y=n("".replace),E=n("".slice),v=Math.max;return t({target:"String",proto:!0},{replaceAll:function(x,F){var I=r(this),_,q,G,U,J,te,le,ne,se,Ge,ve=0,Oe="";if(o(x)){if(_=s(x),_&&(q=a(r(u(x))),!~C(q,"g")))throw new m("`.replaceAll` does not allow non-global regexes");if(G=l(x,f),G)return e(G,x,I,F);if(d&&_)return y(a(I),x,F)}for(U=a(I),J=a(x),te=i(F),te||(F=a(F)),le=J.length,ne=v(1,le),se=C(U,J);se!==-1;)Ge=te?a(F(J,se,U)):c(J,U,se,[],void 0,F),Oe+=E(U,ve,se)+Ge,ve=se+le,se=se+ne>U.length?-1:C(U,J,se+ne);return ve<U.length&&(Oe+=E(U,ve)),Oe}}),mO}HY();var bO={},RO={},EO;function NY(){if(EO)return RO;EO=1;var t=vt(),e=Gu(),n=mr(),r=cn(),i=mo(),o=pr(),s=Js(),a=fd(),l=Jt(),u=TypeError,c=l(function(){[].keys().reduce(function(){},void 0)}),h=!c&&s("reduce",u);return t({target:"Iterator",proto:!0,real:!0,forced:c||h},{reduce:function(f){r(this);try{n(f)}catch(v){o(this,"throw",v)}var m=arguments.length<2,C=m?void 0:arguments[1];if(h)return a(h,this,m?[f]:[f,C]);var y=i(this),E=0;if(e(y,function(v){m?(m=!1,C=v):C=f(C,v,E),E++},{IS_RECORD:!0}),m)throw new u("Reduce of empty iterator with no initial value");return C}}),RO}var TO;function DY(){return TO||(TO=1,NY()),bO}DY();const SD={"&nbsp;":" ","&amp;":"&","&lt;":"<","&gt;":">"},kY=new RegExp(Object.keys(SD).map(t=>`(${t})`).join("|"),"gi");function LY(t){return(t&&t.nodeName||"")==="TABLE"}function _O(t){const e=t.hasColHeaders(),n=t.hasRowHeaders(),r=[e?-1:0,n?-1:0,t.countRows()-1,t.countCols()-1],i=t.getData(...r),o=i.length,s=o>0?i[0].length:0,a=["<table>","</table>"],l=e?["<thead>","</thead>"]:[],u=["<tbody>","</tbody>"],c=n?1:0,h=e?1:0;for(let d=0;d<o;d+=1){const f=e&&d===0,m=[];for(let y=0;y<s;y+=1){const E=!f&&n&&y===0;let v="";if(f)v=`<th>${t.getColHeader(y-c)}</th>`;else if(E)v=`<th>${t.getRowHeader(d-h)}</th>`;else{const O=i[d][y],{hidden:x,rowspan:F,colspan:I}=t.getCellMeta(d-h,y-c);if(!x){const _=[];if(F&&_.push(`rowspan="${F}"`),I&&_.push(`colspan="${I}"`),Yt(O))v=`<td ${_.join(" ")}></td>`;else{const q=O.toString().replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
52
- `).replace(/\x20/gi,"&nbsp;").replace(/\t/gi,"&#9;");v=`<td ${_.join(" ")}>${q}</td>`}}}m.push(v)}const C=["<tr>",...m,"</tr>"].join("");f?l.splice(1,0,C):u.splice(-1,0,C)}return a.splice(1,0,l.join(""),u.join("")),a.join("")}function MO(t){const e=t.length,n=["<table>"];for(let r=0;r<e;r+=1){const i=t[r],o=i.length,s=[];r===0&&n.push("<tbody>");for(let a=0;a<o;a+=1){const l=i[a],u=Yt(l)?"":l.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
53
- `).replace(/\x20{2,}/gi,c=>`<span style="mso-spacerun: yes">${"&nbsp;".repeat(c.length-1)} </span>`).replace(/\t/gi,"&#9;");s.push(`<td>${u}</td>`)}n.push("<tr>",...s,"</tr>"),r+1===e&&n.push("</tbody>")}return n.push("</table>"),n.join("")}function $Y(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;const n={},r=e.createDocumentFragment(),i=e.createElement("div");r.appendChild(i);let o=t;if(typeof o=="string"){const O=o.replace(/<td\b[^>]*?>([\s\S]*?)<\/\s*td>/g,x=>{const F=x.match(/<td\b[^>]*?>/g)[0],I=/<p.*?>/g,_=x.substring(F.length,x.lastIndexOf("<")).trim().replaceAll(/\n\s+/g," ").replaceAll(I,`
54
- `).replace(`
55
- `,"").replaceAll(/<\/(.*)>\s+$/mg,"</$1>").replace(/(<(?!br)([^>]+)>)/gi,"").replaceAll(/^&nbsp;$/mg,"");return`${F}${_}</td>`});i.insertAdjacentHTML("afterbegin",`${O}`),o=i.querySelector("table")}if(!o||!LY(o))return;const s=i.querySelector('meta[name$="enerator"]'),a=o.querySelector("tbody th")!==null,l=o.querySelector("tr"),u=l?Array.from(l.cells).reduce((O,x)=>O+x.colSpan,0)-(a?1:0):0,c=o.tFoot&&Array.from(o.tFoot.rows)||[],h=[];let d=!1,f=0,m=0;if(o.tHead){const O=Array.from(o.tHead.rows).filter(x=>{const F=x.querySelector("td")!==null;return F&&h.push(x),!F});f=O.length,d=f>0,f>1?n.nestedHeaders=Array.from(O).reduce((x,F)=>{const I=Array.from(F.cells).reduce((_,q,G)=>{if(a&&G===0)return _;const{colSpan:U,innerHTML:J}=q,te=U>1?{label:J,colspan:U}:J;return _.push(te),_},[]);return x.push(I),x},[]):d&&(n.colHeaders=Array.from(O[0].children).reduce((x,F,I)=>(a&&I===0||x.push(F.innerHTML),x),[]))}h.length&&(n.fixedRowsTop=h.length),c.length&&(n.fixedRowsBottom=c.length);const C=[...h,...Array.from(o.tBodies).reduce((O,x)=>(O.push(...Array.from(x.rows)),O),[]),...c];m=C.length;const y=new Array(m);for(let O=0;O<m;O++)y[O]=new Array(u);const E=[],v=[];for(let O=0;O<m;O++){const x=C[O],F=Array.from(x.cells),I=F.length;for(let _=0;_<I;_++){const q=F[_],{nodeName:G,innerHTML:U,rowSpan:J,colSpan:te}=q,le=y[O].findIndex(ne=>ne===void 0);if(G==="TD"){if(J>1||te>1){for(let ve=O;ve<O+J;ve++)if(ve<m)for(let Oe=le;Oe<le+te;Oe++)y[ve][Oe]=null;const se=q.getAttribute("style");se&&se.includes("mso-ignore:colspan")||E.push({col:le,row:O,rowspan:J,colspan:te})}let ne="";s&&/excel/gi.test(s.content)?ne=U.replace(/[\r\n][\x20]{0,2}/g," ").replace(/<br(\s*|\/)>[\r\n]?[\x20]{0,3}/gim,`\r
56
- `):ne=U.replace(/<br(\s*|\/)>[\r\n]?/gim,`\r
57
- `),y[O][le]=ne.replace(kY,se=>SD[se])}else v.push(U)}}return E.length&&(n.mergeCells=E),v.length&&(n.rowHeaders=v),y.length&&(n.data=y),n}function Yn(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=typeof t;if(n==="number")return!isNaN(t)&&isFinite(t);if(n==="string"){if(t.length===0)return!1;if(t.length===1)return/\d/.test(t);const r=Array.from(new Set([".",...e])).map(i=>`\\${i}`).join("|");return new RegExp(`^[+-]?(((${r})?\\d+((${r})\\d+)?(e[+-]?\\d+)?)|(0x[a-f\\d]+))$`,"i").test(t.trim())}else if(n==="object")return!!t&&typeof t.valueOf()=="number"&&!(t instanceof Date);return!1}function FY(t){return Yn(t,[","])}function fe(t,e,n){let r=-1;for(typeof e=="function"?(n=e,e=t):r=t-1;++r<=e&&n(r)!==!1;);}function IO(t,e,n){let r=t+1;for(typeof e=="function"&&(n=e,e=0);--r>=e&&n(r)!==!1;);}function bD(t,e){return e=parseInt(e.toString().replace("%",""),10),e=isNaN(e)?0:e,parseInt(t*e/100,10)}function qe(t,e,n){return Math.min(t,e)===t?e:Math.max(t,n)===t?n:t}const mb="asc",VY="desc",PO=new Map([[mb,[-1,1]],[VY,[1,-1]]]),WY=t=>`The priority '${t}' is already declared in a map.`,BY=t=>`The priority '${t}' is not a number.`;function jY(){let{errorPriorityExists:t,errorPriorityNaN:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=new Map;t=ut(t)?t:WY,e=ut(e)?e:BY;function r(o,s){if(!Yn(o))throw new Error(e(o));if(n.has(o))throw new Error(t(o));n.set(o,s)}function i(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mb;const[s,a]=PO.get(o)||PO.get(mb);return[...n].sort((l,u)=>l[0]<u[0]?s:a).map(l=>l[1])}return{addItem:r,getItems:i}}const UY=t=>`The id '${t}' is already declared in a map.`;function cp(){let{errorIdExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Map;t=ut(t)?t:UY;function n(u,c){if(l(u))throw new Error(t(u));e.set(u,c)}function r(u){return e.delete(u)}function i(){e.clear()}function o(u){const[c]=a().find(h=>{let[d,f]=h;return u===f?d:!1})||[null];return c}function s(u){return e.get(u)}function a(){return[...e]}function l(u){return e.has(u)}return{addItem:n,clear:i,getId:o,getItem:s,getItems:a,hasItem:l,removeItem:r}}const zY=t=>`'${t}' value is already declared in a unique set.`;function YY(){let{errorItemExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Set;t=ut(t)?t:zY;function n(o){if(e.has(o))throw new Error(t(o));e.add(o)}function r(){return[...e]}function i(){e.clear()}return{addItem:n,clear:i,getItems:r}}const QR=t=>`There is already registered "${t}" plugin.`,GY=t=>`There is already registered plugin on priority "${t}".`,qY=t=>`The priority "${t}" is not a number.`,RD=jY({errorPriorityExists:GY,errorPriorityNaN:qY}),ED=YY({errorItemExists:QR}),pb=cp({errorIdExists:QR});function TD(){return[...RD.getItems(),...ED.getItems()]}function eE(t){const e=Ti(t);return pb.getItem(e)}function KY(t){return!!eE(t)}function Ke(t,e,n){[t,e,n]=ZY(t,e,n),eE(t)===void 0&&XY(t,e,n)}function XY(t,e,n){const r=Ti(t);if(pb.hasItem(r))throw new Error(QR(r));n===void 0?ED.addItem(r):RD.addItem(n,r),pb.addItem(r,e)}function ZY(t,e,n){return typeof t=="function"&&(e=t,t=e.PLUGIN_KEY,n=e.PLUGIN_PRIORITY),[t,e,n]}const{register:JY,getItem:QY,hasItem:_D,getNames:Qle,getValues:eue}=Oi("renderers");function wb(t){if(typeof t=="function")return t;if(!_D(t))throw Error(`No registered renderer found under "${t}" name`);return QY(t)}function Vr(t,e){typeof t!="string"&&(e=t,t=e.RENDERER_TYPE),JY(t,e)}const{register:eG,getItem:tG,hasItem:MD,getNames:tue,getValues:nue}=Oi("validators");function nG(t){if(typeof t=="function")return t;if(!MD(t))throw Error(`No registered validator found under "${t}" name`);return tG(t)}function fu(t,e){typeof t!="string"&&(e=t,t=e.VALIDATOR_TYPE),eG(t,e)}var OO={},xO;function rG(){if(xO)return OO;xO=1;var t=vt(),e=Uu(),n=Yu(),r=dd(),i=up();return t({target:"Array",proto:!0},{at:function(s){var a=e(this),l=n(a),u=r(s),c=u>=0?u:l+u;return c<0||c>=l?void 0:a[c]}}),i("at"),OO}rG();var AO={},HO;function iG(){if(HO)return AO;HO=1;var t=vt(),e=Qt(),n=ld(),r=dd(),i=Ym(),o=Jt(),s=e("".charAt),a=o(function(){return"𠮷".at(-2)!=="\uD842"});return t({target:"String",proto:!0,forced:a},{at:function(u){var c=i(n(this)),h=c.length,d=r(u),f=d>=0?d:h+d;return f<0||f>=h?void 0:s(c,f)}}),AO}iG();function pc(t,e,n){return(e=oG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oG(t){var e=sG(t,"string");return typeof e=="symbol"?e:e+""}function sG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class aG{constructor(){pc(this,"count",0),pc(this,"startColumn",null),pc(this,"endColumn",null),pc(this,"startPosition",null),pc(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,n){const{totalCalculatedWidth:r,zeroBasedScrollOffset:i,viewportWidth:o,columnWidth:s}=n,a=i>0?o+1:o;r>=i&&r+s<=i+a&&((this.startColumn===null||this.startColumn===void 0)&&(this.startColumn=e),this.endColumn=e)}finalize(e){var n;const{scrollOffset:r,viewportWidth:i,inlineStartOffset:o,zeroBasedScrollOffset:s,totalColumns:a,needReverse:l,startPositions:u,columnWidth:c}=e;if(this.endColumn===a-1&&l)for(this.startColumn=this.endColumn;this.startColumn>0;){const m=u[this.endColumn]+c-u[this.startColumn-1];if(m<=i&&(this.startColumn-=1),m>=i)break}this.startPosition=(n=u[this.startColumn])!==null&&n!==void 0?n:null;const h=s>0?i+1:i,d=r+i-h,f=this.startColumn===null?0:e.getColumnWidth(this.startColumn);d<-1*o||r>u.at(-1)||-1*r-i>-1*f?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,a<this.endColumn&&(this.endColumn=a-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function wc(t,e,n){return(e=lG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lG(t){var e=uG(t,"string");return typeof e=="symbol"?e:e+""}function uG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class cG{constructor(){wc(this,"count",0),wc(this,"startRow",null),wc(this,"endRow",null),wc(this,"startPosition",null),wc(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,n){const{totalCalculatedHeight:r,zeroBasedScrollOffset:i,innerViewportHeight:o,rowHeight:s}=n;r>=i&&r+s<=o&&(this.startRow===null&&(this.startRow=e),this.endRow=e)}finalize(e){var n;const{scrollOffset:r,viewportHeight:i,horizontalScrollbarHeight:o,totalRows:s,needReverse:a,startPositions:l,rowHeight:u}=e;if(this.endRow===s-1&&a)for(this.startRow=this.endRow;this.startRow>0;){const d=l[this.endRow]+u-l[this.startRow-1];if(d<=i-o&&(this.startRow-=1),d>=i-o)break}this.startPosition=(n=l[this.startRow])!==null&&n!==void 0?n:null;const c=r+i-o,h=this.startRow===null?0:e.getRowHeight(this.startRow);c<h||r>l.at(-1)?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,s<this.endRow&&(this.endRow=s-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function vc(t,e,n){return(e=hG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hG(t){var e=dG(t,"string");return typeof e=="symbol"?e:e+""}function dG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ID{constructor(){vc(this,"count",0),vc(this,"startColumn",null),vc(this,"endColumn",null),vc(this,"startPosition",null),vc(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,n){const{totalCalculatedWidth:r,zeroBasedScrollOffset:i,viewportWidth:o}=n;r<=i&&(this.startColumn=e);const s=i>0?o+1:o;r>=i&&r<=i+s&&(this.startColumn===null||this.startColumn===void 0)&&(this.startColumn=e),this.endColumn=e}finalize(e){var n;const{scrollOffset:r,viewportWidth:i,inlineStartOffset:o,zeroBasedScrollOffset:s,totalColumns:a,needReverse:l,startPositions:u,columnWidth:c}=e;if(this.endColumn===a-1&&l)for(this.startColumn=this.endColumn;this.startColumn>0;){const f=u[this.endColumn]+c-u[this.startColumn-1];if(this.startColumn-=1,f>i)break}this.startPosition=(n=u[this.startColumn])!==null&&n!==void 0?n:null;const h=s>0?i+1:i;r+i-h<-1*o||r>u.at(-1)+c||-1*r-i>0?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,a<this.endColumn&&(this.endColumn=a-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function Cc(t,e,n){return(e=fG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fG(t){var e=gG(t,"string");return typeof e=="symbol"?e:e+""}function gG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class PD{constructor(){Cc(this,"count",0),Cc(this,"startRow",null),Cc(this,"endRow",null),Cc(this,"startPosition",null),Cc(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,n){const{totalCalculatedHeight:r,zeroBasedScrollOffset:i,innerViewportHeight:o}=n;r<=i&&(this.startRow=e),r>=i&&r<=o&&this.startRow===null&&(this.startRow=e),this.endRow=e}finalize(e){var n;const{scrollOffset:r,viewportHeight:i,horizontalScrollbarHeight:o,totalRows:s,needReverse:a,startPositions:l,rowHeight:u}=e;if(this.endRow===s-1&&a)for(this.startRow=this.endRow;this.startRow>0;){const h=l[this.endRow]+u-l[this.startRow-1];if(this.startRow-=1,h>=i-o)break}this.startPosition=(n=l[this.startRow])!==null&&n!==void 0?n:null,r+i-o<0||r>l.at(-1)+u?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,s<this.endRow&&(this.endRow=s-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function yc(t,e,n){return(e=mG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mG(t){var e=pG(t,"string");return typeof e=="symbol"?e:e+""}function pG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class wG{constructor(){yc(this,"count",0),yc(this,"startColumn",0),yc(this,"endColumn",0),yc(this,"startPosition",0),yc(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalColumns:n}=e;this.count=n,this.endColumn=this.count-1}process(){}finalize(){}}function Sc(t,e,n){return(e=vG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vG(t){var e=CG(t,"string");return typeof e=="symbol"?e:e+""}function CG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class yG{constructor(){Sc(this,"count",0),Sc(this,"startRow",0),Sc(this,"endRow",0),Sc(this,"startPosition",0),Sc(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalRows:n}=e;this.count=n,this.endRow=this.count-1}process(){}finalize(){}}function NO(t,e,n){return(e=SG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function SG(t){var e=bG(t,"string");return typeof e=="symbol"?e:e+""}function bG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class RG extends ID{constructor(){super(...arguments),NO(this,"columnStartOffset",0),NO(this,"columnEndOffset",0)}finalize(e){var n;super.finalize(e);const{overrideFn:r,totalColumns:i,startPositions:o}=e;if(this.startColumn!==null&&typeof r=="function"){const s=this.startColumn,a=this.endColumn;r(this),this.columnStartOffset=s-this.startColumn,this.columnEndOffset=this.endColumn-a}this.startColumn<0&&(this.startColumn=0),this.startPosition=(n=o[this.startColumn])!==null&&n!==void 0?n:null,i<this.endColumn&&(this.endColumn=i-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function DO(t,e,n){return(e=EG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function EG(t){var e=TG(t,"string");return typeof e=="symbol"?e:e+""}function TG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class _G extends PD{constructor(){super(...arguments),DO(this,"rowStartOffset",0),DO(this,"rowEndOffset",0)}finalize(e){var n;super.finalize(e);const{overrideFn:r,totalRows:i,startPositions:o}=e;if(this.startRow!==null&&typeof r=="function"){const s=this.startRow,a=this.endRow;r(this),this.rowStartOffset=s-this.startRow,this.rowEndOffset=this.endRow-a}this.startRow<0&&(this.startRow=0),this.startPosition=(n=o[this.startRow])!==null&&n!==void 0?n:null,i<this.endRow&&(this.endRow=i-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function kO(t,e,n){return(e=MG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function MG(t){var e=IG(t,"string");return typeof e=="symbol"?e:e+""}function IG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class OD{constructor(e){kO(this,"calculationTypes",[]),kO(this,"calculationResults",new Map),this.calculationTypes=e}_initialize(e){this.calculationTypes.forEach(n=>{let[r,i]=n;this.calculationResults.set(r,i),i.initialize(e)})}_process(e,n){this.calculationTypes.forEach(r=>{let[,i]=r;return i.process(e,n)})}_finalize(e){this.calculationTypes.forEach(n=>{let[,r]=n;return r.finalize(e)})}getResultsFor(e){return this.calculationResults.get(e)}}function ni(t,e,n){return(e=PG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function PG(t){var e=OG(t,"string");return typeof e=="symbol"?e:e+""}function OG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const ku=50;class xG extends OD{constructor(e){let{calculationTypes:n,viewportWidth:r,scrollOffset:i,totalColumns:o,columnWidthFn:s,overrideFn:a,inlineStartOffset:l}=e;super(n),ni(this,"viewportWidth",0),ni(this,"scrollOffset",0),ni(this,"zeroBasedScrollOffset",0),ni(this,"totalColumns",0),ni(this,"columnWidthFn",null),ni(this,"columnWidth",0),ni(this,"overrideFn",null),ni(this,"inlineStartOffset",0),ni(this,"totalCalculatedWidth",0),ni(this,"startPositions",[]),ni(this,"needReverse",!0),this.viewportWidth=r,this.scrollOffset=i,this.zeroBasedScrollOffset=Math.max(i,0),this.totalColumns=o,this.columnWidthFn=s,this.overrideFn=a,this.inlineStartOffset=l,this.calculate()}calculate(){this._initialize(this);for(let e=0;e<this.totalColumns;e++)if(this.columnWidth=this.getColumnWidth(e),this._process(e,this),this.startPositions.push(this.totalCalculatedWidth),this.totalCalculatedWidth+=this.columnWidth,this.totalCalculatedWidth>=this.zeroBasedScrollOffset+this.viewportWidth){this.needReverse=!1;break}this._finalize(this)}getColumnWidth(e){const n=this.columnWidthFn(e);return isNaN(n)?ku:n}}function Dr(t,e,n){return(e=AG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function AG(t){var e=HG(t,"string");return typeof e=="symbol"?e:e+""}function HG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class NG extends OD{constructor(e){let{calculationTypes:n,viewportHeight:r,scrollOffset:i,totalRows:o,defaultRowHeight:s,rowHeightFn:a,overrideFn:l,horizontalScrollbarHeight:u}=e;super(n),Dr(this,"viewportHeight",0),Dr(this,"scrollOffset",0),Dr(this,"zeroBasedScrollOffset",0),Dr(this,"totalRows",0),Dr(this,"rowHeightFn",null),Dr(this,"rowHeight",0),Dr(this,"overrideFn",null),Dr(this,"horizontalScrollbarHeight",0),Dr(this,"innerViewportHeight",0),Dr(this,"totalCalculatedHeight",0),Dr(this,"startPositions",[]),Dr(this,"needReverse",!0),this.defaultHeight=s,this.viewportHeight=r,this.scrollOffset=i,this.zeroBasedScrollOffset=Math.max(i,0),this.totalRows=o,this.rowHeightFn=a,this.overrideFn=l,this.horizontalScrollbarHeight=u??0,this.innerViewportHeight=this.zeroBasedScrollOffset+this.viewportHeight-this.horizontalScrollbarHeight,this.calculate()}calculate(){this._initialize(this);for(let e=0;e<this.totalRows;e++)if(this.rowHeight=this.getRowHeight(e),this._process(e,this),this.startPositions.push(this.totalCalculatedHeight),this.totalCalculatedHeight+=this.rowHeight,this.totalCalculatedHeight>=this.innerViewportHeight){this.needReverse=!1;break}this._finalize(this)}getRowHeight(e){const n=this.rowHeightFn(e);return isNaN(n)?this.defaultHeight:n}}function DG(t,e,n){kG(t,e),e.set(t,n)}function kG(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function LO(t,e,n){return(e=LG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LG(t){var e=$G(t,"string");return typeof e=="symbol"?e:e+""}function $G(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Pl(t,e){return t.get(xD(t,e))}function $O(t,e,n){return t.set(xD(t,e),n),n}function xD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var bo=new WeakMap;class ul{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;LO(this,"row",null),LO(this,"col",null),DG(this,bo,!1),$O(bo,this,r),typeof e<"u"&&typeof n<"u"&&(this.row=e,this.col=n)}isValid(e){const{countRows:n,countCols:r,countRowHeaders:i,countColHeaders:o}={countRows:0,countCols:0,countRowHeaders:0,countColHeaders:0,...e};return!(!Number.isInteger(this.row)||!Number.isInteger(this.col)||this.row<-o||this.col<-i||this.row>=n||this.col>=r)}isEqual(e){return e===this?!0:this.row===e.row&&this.col===e.col}isHeader(){return!this.isCell()}isCell(){return this.row>=0&&this.col>=0}isRtl(){return Pl(bo,this)}isSouthEastOf(e){return this.row>=e.row&&(Pl(bo,this)?this.col<=e.col:this.col>=e.col)}isNorthWestOf(e){return this.row<=e.row&&(Pl(bo,this)?this.col>=e.col:this.col<=e.col)}isSouthWestOf(e){return this.row>=e.row&&(Pl(bo,this)?this.col>=e.col:this.col<=e.col)}isNorthEastOf(e){return this.row<=e.row&&(Pl(bo,this)?this.col<=e.col:this.col>=e.col)}normalize(){return this.row=this.row===null?this.row:Math.max(this.row,0),this.col=this.col===null?this.col:Math.max(this.col,0),this}assign(e){return Number.isInteger(e==null?void 0:e.row)&&(this.row=e.row),Number.isInteger(e==null?void 0:e.col)&&(this.col=e.col),e instanceof ul&&$O(bo,this,e.isRtl()),this}clone(){return new ul(this.row,this.col,Pl(bo,this))}toObject(){return{row:this.row,col:this.col}}}function FG(t,e,n){VG(t,e),e.set(t,n)}function VG(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function YC(t,e,n){return(e=WG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function WG(t){var e=BG(t,"string");return typeof e=="symbol"?e:e+""}function BG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function kr(t,e){return t.get(AD(t,e))}function jG(t,e,n){return t.set(AD(t,e),n),n}function AD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Qn=new WeakMap;class bd{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;YC(this,"highlight",null),YC(this,"from",null),YC(this,"to",null),FG(this,Qn,!1),this.highlight=e.clone(),this.from=n.clone(),this.to=r.clone(),jG(Qn,this,i)}setHighlight(e){return this.highlight=e.clone(),this}setFrom(e){return this.from=e.clone(),this}setTo(e){return this.to=e.clone(),this}normalize(){return this.highlight.normalize(),this.from.normalize(),this.to.normalize(),this}isValid(e){return this.from.isValid(e)&&this.to.isValid(e)}isSingle(){return this.isSingleCell()||this.isSingleHeader()}isSingleCell(){return this.from.row>=0&&this.from.row===this.to.row&&this.from.col>=0&&this.from.col===this.to.col}isSingleHeader(){return(this.from.row<0||this.from.col<0)&&this.from.row===this.to.row&&this.from.col===this.to.col}isHeader(){return this.from.isHeader()&&this.to.isHeader()?!0:this.from.col<0&&this.to.col<0||this.from.row<0&&this.to.row<0}containsHeaders(){return this.from.isHeader()||this.to.isHeader()}getOuterHeight(){return Math.max(this.from.row,this.to.row)-Math.min(this.from.row,this.to.row)+1}getOuterWidth(){return Math.max(this.from.col,this.to.col)-Math.min(this.from.col,this.to.col)+1}getHeight(){if(this.from.row<0&&this.to.row<0)return 0;const e=Math.max(this.from.row,0),n=Math.max(this.to.row,0);return Math.max(e,n)-Math.min(e,n)+1}getWidth(){if(this.from.col<0&&this.to.col<0)return 0;const e=Math.max(this.from.col,0),n=Math.max(this.to.col,0);return Math.max(e,n)-Math.min(e,n)+1}getCellsCount(){return this.getWidth()*this.getHeight()}includes(e){const{row:n,col:r}=e,i=this.getOuterTopStartCorner(),o=this.getOuterBottomEndCorner();return i.row<=n&&o.row>=n&&i.col<=r&&o.col>=r}includesRange(e){return this.includes(e.getOuterTopStartCorner())&&this.includes(e.getOuterBottomEndCorner())}isEqual(e){return Math.min(this.from.row,this.to.row)===Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)===Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)===Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)===Math.max(e.from.col,e.to.col)}overlaps(e){return e.isSouthEastOf(this.getOuterTopLeftCorner())&&e.isNorthWestOf(this.getOuterBottomRightCorner())}isSouthEastOf(e){return this.getOuterTopLeftCorner().isSouthEastOf(e)||this.getOuterBottomRightCorner().isSouthEastOf(e)}isNorthWestOf(e){return this.getOuterTopLeftCorner().isNorthWestOf(e)||this.getOuterBottomRightCorner().isNorthWestOf(e)}isOverlappingHorizontally(e){return this.getOuterTopEndCorner().col>=e.getOuterTopStartCorner().col&&this.getOuterTopEndCorner().col<=e.getOuterTopEndCorner().col||this.getOuterTopStartCorner().col<=e.getOuterTopEndCorner().col&&this.getOuterTopStartCorner().col>=e.getOuterTopStartCorner().col}isOverlappingVertically(e){return this.getOuterBottomStartCorner().row>=e.getOuterTopRightCorner().row&&this.getOuterBottomStartCorner().row<=e.getOuterBottomStartCorner().row||this.getOuterTopEndCorner().row<=e.getOuterBottomStartCorner().row&&this.getOuterTopEndCorner().row>=e.getOuterTopRightCorner().row}expand(e){const n=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner();return e.row<n.row||e.col<n.col||e.row>r.row||e.col>r.col?(this.from=this._createCellCoords(Math.min(n.row,e.row),Math.min(n.col,e.col)),this.to=this._createCellCoords(Math.max(r.row,e.row),Math.max(r.col,e.col)),!0):!1}expandByRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(this.includesRange(e)||!this.overlaps(e))return!1;const r=this.getOuterTopStartCorner(),i=this.getOuterBottomEndCorner(),o=this.getDirection(),s=e.getOuterTopStartCorner(),a=e.getOuterBottomEndCorner(),l=Math.min(r.row,s.row),u=Math.min(r.col,s.col),c=Math.max(i.row,a.row),h=Math.max(i.col,a.col),d=this._createCellCoords(l,u),f=this._createCellCoords(c,h);return this.from=d,this.to=f,this.setDirection(o),n&&(this.highlight.row===this.getOuterBottomRightCorner().row&&this.getVerticalDirection()==="N-S"&&this.flipDirectionVertically(),this.highlight.col===this.getOuterTopRightCorner().col&&this.getHorizontalDirection()==="W-E"&&this.flipDirectionHorizontally()),!0}getDirection(){if(this.from.isNorthWestOf(this.to))return"NW-SE";if(this.from.isNorthEastOf(this.to))return"NE-SW";if(this.from.isSouthEastOf(this.to))return"SE-NW";if(this.from.isSouthWestOf(this.to))return"SW-NE"}setDirection(e){switch(e){case"NW-SE":[this.from,this.to]=[this.getOuterTopLeftCorner(),this.getOuterBottomRightCorner()];break;case"NE-SW":[this.from,this.to]=[this.getOuterTopRightCorner(),this.getOuterBottomLeftCorner()];break;case"SE-NW":[this.from,this.to]=[this.getOuterBottomRightCorner(),this.getOuterTopLeftCorner()];break;case"SW-NE":[this.from,this.to]=[this.getOuterBottomLeftCorner(),this.getOuterTopRightCorner()];break}}getVerticalDirection(){return["NE-SW","NW-SE"].indexOf(this.getDirection())>-1?"N-S":"S-N"}getHorizontalDirection(){return["NW-SE","SW-NE"].indexOf(this.getDirection())>-1?"W-E":"E-W"}flipDirectionVertically(){switch(this.getDirection()){case"NW-SE":this.setDirection("SW-NE");break;case"NE-SW":this.setDirection("SE-NW");break;case"SE-NW":this.setDirection("NE-SW");break;case"SW-NE":this.setDirection("NW-SE");break}}flipDirectionHorizontally(){switch(this.getDirection()){case"NW-SE":this.setDirection("NE-SW");break;case"NE-SW":this.setDirection("NW-SE");break;case"SE-NW":this.setDirection("SW-NE");break;case"SW-NE":this.setDirection("SE-NW");break}}getTopStartCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col)).normalize()}getTopLeftCorner(){return kr(Qn,this)?this.getTopEndCorner():this.getTopStartCorner()}getBottomEndCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col)).normalize()}getBottomRightCorner(){return kr(Qn,this)?this.getBottomStartCorner():this.getBottomEndCorner()}getTopEndCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col)).normalize()}getTopRightCorner(){return kr(Qn,this)?this.getTopStartCorner():this.getTopEndCorner()}getBottomStartCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col)).normalize()}getBottomLeftCorner(){return kr(Qn,this)?this.getBottomEndCorner():this.getBottomStartCorner()}getOuterTopStartCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))}getOuterTopLeftCorner(){return kr(Qn,this)?this.getOuterTopEndCorner():this.getOuterTopStartCorner()}getOuterBottomEndCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))}getOuterBottomRightCorner(){return kr(Qn,this)?this.getOuterBottomStartCorner():this.getOuterBottomEndCorner()}getOuterTopEndCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))}getOuterTopRightCorner(){return kr(Qn,this)?this.getOuterTopStartCorner():this.getOuterTopEndCorner()}getOuterBottomStartCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))}getOuterBottomLeftCorner(){return kr(Qn,this)?this.getOuterBottomEndCorner():this.getOuterBottomStartCorner()}isCorner(e){return e.isEqual(this.getOuterTopLeftCorner())||e.isEqual(this.getOuterTopRightCorner())||e.isEqual(this.getOuterBottomLeftCorner())||e.isEqual(this.getOuterBottomRightCorner())}getOppositeCorner(e){if(!(e instanceof ul))return!1;if(e.isEqual(this.getOuterBottomEndCorner()))return this.getOuterTopStartCorner();if(e.isEqual(this.getOuterTopStartCorner()))return this.getOuterBottomEndCorner();if(e.isEqual(this.getOuterTopEndCorner()))return this.getOuterBottomStartCorner();if(e.isEqual(this.getOuterBottomStartCorner()))return this.getOuterTopEndCorner()}getBordersSharedWith(e){if(!this.includesRange(e))return[];const n={top:Math.min(this.from.row,this.to.row),bottom:Math.max(this.from.row,this.to.row),left:Math.min(this.from.col,this.to.col),right:Math.max(this.from.col,this.to.col)},r={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},i=[];return n.top===r.top&&i.push("top"),n.right===r.right&&i.push(kr(Qn,this)?"left":"right"),n.bottom===r.bottom&&i.push("bottom"),n.left===r.left&&i.push(kr(Qn,this)?"right":"left"),i}getInner(){const e=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner(),r=[];for(let i=e.row;i<=n.row;i++)for(let o=e.col;o<=n.col;o++)!(this.from.row===i&&this.from.col===o)&&!(this.to.row===i&&this.to.col===o)&&r.push(this._createCellCoords(i,o));return r}getAll(){const e=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner(),r=[];for(let i=e.row;i<=n.row;i++)for(let o=e.col;o<=n.col;o++)e.row===i&&e.col===o?r.push(e):n.row===i&&n.col===o?r.push(n):r.push(this._createCellCoords(i,o));return r}forAll(e){const n=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner();for(let i=n.row;i<=r.row;i++)for(let o=n.col;o<=r.col;o++)if(e(i,o)===!1)return}clone(){return new bd(this.highlight,this.from,this.to,kr(Qn,this))}toObject(){return{from:this.from.toObject(),to:this.to.toObject()}}_createCellCoords(e,n){return new ul(e,n,kr(Qn,this))}}function Di(t,e,n){UG(t,e),e.set(t,n)}function UG(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function me(t,e){return t.get(HD(t,e))}function ds(t,e,n){return t.set(HD(t,e),n),n}function HD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Lr=new WeakMap,GC=new WeakMap,wn=new WeakMap,Ol=new WeakMap,qd=new WeakMap,ri=new WeakMap,qC=new WeakMap,bc=new WeakMap,aa=new WeakMap,ki=new WeakMap;let ND=class{constructor(e,n,r,i,o,s){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null;Di(this,Lr,void 0),Di(this,GC,void 0),Di(this,wn,void 0),Di(this,Ol,void 0),Di(this,qd,void 0),Di(this,ri,void 0),Di(this,qC,void 0),Di(this,bc,void 0),Di(this,aa,[null,null]),Di(this,ki,[null,null]),ds(Lr,this,r),ds(GC,this,n),ds(wn,this,o),ds(Ol,this,s),ds(qd,this,a),ds(ri,this,i),ds(qC,this,e),this.registerEvents()}registerEvents(){me(ri,this).addEventListener(me(wn,this).holder,"contextmenu",r=>this.onContextMenu(r)),me(ri,this).addEventListener(me(wn,this).TABLE,"mouseover",r=>this.onMouseOver(r)),me(ri,this).addEventListener(me(wn,this).TABLE,"mouseout",r=>this.onMouseOut(r));const e=()=>{me(ri,this).addEventListener(me(wn,this).holder,"touchstart",r=>this.onTouchStart(r)),me(ri,this).addEventListener(me(wn,this).holder,"touchend",r=>this.onTouchEnd(r)),this.momentumScrolling||(this.momentumScrolling={}),me(ri,this).addEventListener(me(wn,this).holder,"scroll",()=>{clearTimeout(this.momentumScrolling._timeout),this.momentumScrolling.ongoing||me(Lr,this).getSetting("onBeforeTouchScroll"),this.momentumScrolling.ongoing=!0,this.momentumScrolling._timeout=setTimeout(()=>{this.touchApplied||(this.momentumScrolling.ongoing=!1,me(Lr,this).getSetting("onAfterMomentumScroll"))},200)})},n=()=>{me(ri,this).addEventListener(me(wn,this).holder,"mouseup",r=>this.onMouseUp(r)),me(ri,this).addEventListener(me(wn,this).holder,"mousedown",r=>this.onMouseDown(r))};qo()?e():(hD()&&e(),n())}selectedCellWasTouched(e){const r=this.parentCell(e).coords;if(me(bc,this)&&r){const[i,o]=[r.row,me(bc,this).from.row],[s,a]=[r.col,me(bc,this).from.col];return i===o&&s===a}return!1}parentCell(e){const n={},r=me(wn,this).TABLE,i=Bd(e,["TD","TH"],r);return i?(n.coords=me(wn,this).getCoords(i),n.TD=i):ye(e,"wtBorder")&&ye(e,"current")?(n.coords=me(Ol,this).getFocusSelection().cellRange.highlight,n.TD=me(wn,this).getCell(n.coords)):ye(e,"wtBorder")&&ye(e,"area")&&me(Ol,this).getAreaSelection().cellRange&&(n.coords=me(Ol,this).getAreaSelection().cellRange.to,n.TD=me(wn,this).getCell(n.coords)),n}onMouseDown(e){const n=me(GC,this).rootDocument.activeElement,r=cD(Rz,e.target),i=e.target;if(!["TD","TH"].includes(n.nodeName)&&(i===n||r(0)===n||r(1)===n))return;const o=this.parentCell(i);ye(i,"corner")?me(Lr,this).getSetting("onCellCornerMouseDown",e,i):o.TD&&me(Lr,this).has("onCellMouseDown")&&this.callListener("onCellMouseDown",e,o.coords,o.TD),(e.button===0||this.touchApplied)&&o.TD&&(me(ki,this)[0]=o.TD,clearTimeout(me(aa,this)[0]),me(aa,this)[0]=setTimeout(()=>{me(ki,this)[0]=null},1e3))}onContextMenu(e){if(me(Lr,this).has("onCellContextMenu")){const n=this.parentCell(e.target);n.TD&&this.callListener("onCellContextMenu",e,n.coords,n.TD)}}onMouseOver(e){if(!me(Lr,this).has("onCellMouseOver"))return;const n=me(wn,this).TABLE,r=Bd(e.target,["TD","TH"],n),i=me(qd,this)||this;r&&r!==i.lastMouseOver&&rl(r,n)&&(i.lastMouseOver=r,this.callListener("onCellMouseOver",e,me(wn,this).getCoords(r),r))}onMouseOut(e){if(!me(Lr,this).has("onCellMouseOut"))return;const n=me(wn,this).TABLE,r=Bd(e.target,["TD","TH"],n),i=Bd(e.relatedTarget,["TD","TH"],n),o=me(qd,this)||this;r&&r!==i&&rl(r,n)&&(this.callListener("onCellMouseOut",e,me(wn,this).getCoords(r),r),i===null&&(o.lastMouseOver=null))}onMouseUp(e){const n=this.parentCell(e.target);n.TD&&me(Lr,this).has("onCellMouseUp")&&this.callListener("onCellMouseUp",e,n.coords,n.TD),!(e.button!==0&&!this.touchApplied)&&(n.TD===me(ki,this)[0]&&n.TD===me(ki,this)[1]?(ye(e.target,"corner")?this.callListener("onCellCornerDblClick",e,n.coords,n.TD):this.callListener("onCellDblClick",e,n.coords,n.TD),me(ki,this)[0]=null,me(ki,this)[1]=null):n.TD===me(ki,this)[0]&&(me(ki,this)[1]=n.TD,clearTimeout(me(aa,this)[1]),me(aa,this)[1]=setTimeout(()=>{me(ki,this)[1]=null},500)))}onTouchStart(e){ds(bc,this,me(Ol,this).getFocusSelection().cellRange),this.touchApplied=!0,this.onMouseDown(e)}onTouchEnd(e){var n;const r=e.target,i=(n=this.parentCell(r))===null||n===void 0?void 0:n.coords,o=ue(i)&&i.row>=0&&i.col>=0;if(e.cancelable&&o&&me(Lr,this).getSetting("isDataViewInstance")){const a=["A","BUTTON","INPUT"];fD()&&(Yz()||Gz())&&this.selectedCellWasTouched(r)&&!a.includes(r.tagName)?e.preventDefault():this.selectedCellWasTouched(r)||e.preventDefault()}this.onMouseUp(e),this.touchApplied=!1}callListener(e,n,r,i){const o=me(Lr,this).getSettingPure(e);o&&o(n,r,i,me(qC,this).call(this))}destroy(){clearTimeout(me(aa,this)[0]),clearTimeout(me(aa,this)[1]),me(ri,this).destroy()}};function KC(t,e,n){return(e=zG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zG(t){var e=YG(t,"string");return typeof e=="symbol"?e:e+""}function YG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class GG{constructor(e,n,r){KC(this,"offset",void 0),KC(this,"total",void 0),KC(this,"countTH",void 0),this.offset=e,this.total=n,this.countTH=r}offsetted(e){return e+this.offset}unOffsetted(e){return e-this.offset}renderedToSource(e){return this.offsetted(e)}sourceToRendered(e){return this.unOffsetted(e)}offsettedTH(e){return e-this.countTH}unOffsettedTH(e){return e+this.countTH}visibleRowHeadedColumnToSourceColumn(e){return this.renderedToSource(this.offsettedTH(e))}sourceColumnToVisibleRowHeadedColumn(e){return this.unOffsettedTH(this.sourceToRendered(e))}}function XC(t,e,n){return(e=qG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qG(t){var e=KG(t,"string");return typeof e=="symbol"?e:e+""}function KG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class XG{constructor(e,n,r){XC(this,"offset",void 0),XC(this,"total",void 0),XC(this,"countTH",void 0),this.offset=e,this.total=n,this.countTH=r}offsetted(e){return e+this.offset}unOffsetted(e){return e-this.offset}renderedToSource(e){return this.offsetted(e)}sourceToRendered(e){return this.unOffsetted(e)}offsettedTH(e){return e-this.countTH}unOffsettedTH(e){return e+this.countTH}visibleColHeadedRowToSourceRow(e){return this.renderedToSource(this.offsettedTH(e))}sourceRowToVisibleColHeadedRow(e){return this.unOffsettedTH(this.sourceToRendered(e))}}function Kd(t,e,n){return(e=ZG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ZG(t){var e=JG(t,"string");return typeof e=="symbol"?e:e+""}function JG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class QG{constructor(){Kd(this,"currentSize",0),Kd(this,"nextSize",0),Kd(this,"currentOffset",0),Kd(this,"nextOffset",0)}setSize(e){this.currentSize=this.nextSize,this.nextSize=e}setOffset(e){this.currentOffset=this.nextOffset,this.nextOffset=e}}const e2=0,FO=1,vb=2;function ZC(t,e,n){return(e=t2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function t2(t){var e=n2(t,"string");return typeof e=="symbol"?e:e+""}function n2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class r2{constructor(){ZC(this,"size",new QG),ZC(this,"workingSpace",e2),ZC(this,"sharedSize",null)}setSize(e){this.size.setSize(e)}setOffset(e){this.size.setOffset(e)}getViewSize(){return this.size}isShared(){return this.sharedSize!==null}isPlaceOn(e){return this.workingSpace===e}append(e){this.workingSpace=FO,e.workingSpace=vb,this.sharedSize=e.getViewSize()}prepend(e){this.workingSpace=vb,e.workingSpace=FO,this.sharedSize=e.getViewSize()}}var VO={},JC,WO;function i2(){if(WO)return JC;WO=1;var t=zm(),e=TypeError;return JC=function(n,r){if(!delete n[r])throw new e("Cannot delete property "+t(r)+" of "+t(n))},JC}var BO;function o2(){if(BO)return VO;BO=1;var t=vt(),e=Uu(),n=Yu(),r=N1(),i=i2(),o=D1(),s=[].unshift(0)!==1,a=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(u){return u instanceof TypeError}},l=s||!a();return t({target:"Array",proto:!0,arity:1,forced:l},{unshift:function(c){var h=e(this),d=n(h),f=arguments.length;if(f){o(d+f);for(var m=d;m--;){var C=m+f;m in h?h[C]=h[m]:i(h,C)}for(var y=0;y<f;y++)h[y]=arguments[y]}return r(h,d+f)}}),VO}o2();function s2(t,e,n){return(e=a2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a2(t){var e=l2(t,"string");return typeof e=="symbol"?e:e+""}function l2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class jO{constructor(e,n){s2(this,"order",[]),this.order=[...Array(n).keys()].map(r=>e+r)}get length(){return this.order.length}has(e){return this.order.indexOf(e)>-1}get(e){return e<this.order.length?this.order[e]:-1}remove(e){this.order.splice(this.order.indexOf(e),1)}prepend(e){return this.order.unshift(e),this.order.pop()}}function u2(t,e,n){return(e=c2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c2(t){var e=h2(t,"string");return typeof e=="symbol"?e:e+""}function h2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class d2{constructor(e){u2(this,"sizeSet",void 0),this.sizeSet=e}diff(){const{sizeSet:e}=this,{currentSize:n,nextSize:r}=e.getViewSize();let i=Math.max(r,n);if(i===0)return[];const{currentOffset:o,nextOffset:s}=e.getViewSize(),a=new jO(o,n),l=new jO(s,r),u=[];for(let c=0;c<i;c++){const h=a.get(c),d=l.get(c);if(d===-1)u.push(["remove",h]);else if(h===-1)!e.isShared()||e.isShared()&&e.isPlaceOn(vb)?u.push(["append",d]):u.push(["prepend",d]);else if(d>h)a.has(d)&&(a.remove(d),r<=a.length&&(i-=1)),u.push(["replace",d,h]);else if(d<h){const f=a.prepend(d);u.push(["insert_before",d,h,f])}else u.push(["none",d])}return u}}function xl(t,e,n){return(e=f2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f2(t){var e=g2(t,"string");return typeof e=="symbol"?e:e+""}function g2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class DD{constructor(e,n){xl(this,"rootNode",void 0),xl(this,"nodesPool",void 0),xl(this,"sizeSet",new r2),xl(this,"collectedNodes",[]),xl(this,"viewDiffer",new d2(this.sizeSet)),xl(this,"leads",[]),this.rootNode=e,this.nodesPool=n}setSize(e){return this.sizeSet.setSize(e),this}setOffset(e){return this.sizeSet.setOffset(e),this}isSharedViewSet(){return this.sizeSet.isShared()}getNode(e){return e<this.collectedNodes.length?this.collectedNodes[e]:null}getCurrentNode(){const e=this.collectedNodes.length;return e>0?this.collectedNodes[e-1]:null}applyCommand(e){const{rootNode:n}=this,[r,i,o,s]=e,a=this.nodesPool(i);switch(this.collectedNodes.push(a),r){case"prepend":n.insertBefore(a,n.firstChild);break;case"append":n.appendChild(a);break;case"insert_before":n.insertBefore(a,this.nodesPool(o)),n.removeChild(this.nodesPool(s));break;case"replace":n.replaceChild(a,this.nodesPool(o));break;case"remove":n.removeChild(a);break}}start(){this.collectedNodes.length=0,this.leads=this.viewDiffer.diff()}render(){this.leads.length>0&&this.applyCommand(this.leads.shift())}end(){for(;this.leads.length>0;)this.applyCommand(this.leads.shift())}}class kD extends DD{prependView(e){return this.sizeSet.prepend(e.sizeSet),e.sizeSet.append(this.sizeSet),this}appendView(e){return this.sizeSet.append(e.sizeSet),e.sizeSet.prepend(this.sizeSet),this}}function UO(t,e,n){return(e=m2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m2(t){var e=p2(t,"string");return typeof e=="symbol"?e:e+""}function p2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class w2{constructor(e){UO(this,"nodeType",void 0),UO(this,"pool",new Map),this.nodeType=e.toUpperCase()}setRootDocument(e){this.rootDocument=e}obtain(e,n){const i=typeof n=="number"?`${e}x${n}`:e.toString();if(this.pool.has(i))return this.pool.get(i);const o=this.rootDocument.createElement(this.nodeType);return this.pool.set(i,o),o}}function Rc(t,e,n){return(e=v2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function v2(t){var e=C2(t,"string");return typeof e=="symbol"?e:e+""}function C2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Rd{constructor(e,n){Rc(this,"nodesPool",null),Rc(this,"nodeType",void 0),Rc(this,"rootNode",void 0),Rc(this,"table",null),Rc(this,"renderedNodes",0),this.nodesPool=typeof e=="string"?new w2(e):null,this.nodeType=e,this.rootNode=n}setTable(e){this.nodesPool&&this.nodesPool.setRootDocument(e.rootDocument),this.table=e}adjust(){}render(){}}function zO(t,e,n){return(e=y2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y2(t){var e=S2(t,"string");return typeof e=="symbol"?e:e+""}function S2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class b2 extends Rd{constructor(){super("TH"),zO(this,"orderViews",new WeakMap),zO(this,"sourceRowIndex",0)}obtainOrderView(e){let n;return this.orderViews.has(e)?n=this.orderViews.get(e):(n=new kD(e,r=>this.nodesPool.obtain(this.sourceRowIndex,r)),this.orderViews.set(e,n)),n}render(){const{rowsToRender:e,rowHeaderFunctions:n,rowHeadersCount:r,rows:i,cells:o}=this.table;for(let s=0;s<e;s++){const a=this.table.renderedRowToSource(s),l=i.getRenderedNode(s);this.sourceRowIndex=a;const u=this.obtainOrderView(l),c=o.obtainOrderView(l);u.appendView(c).setSize(r).setOffset(0).start();for(let h=r-1;h>=0;h--){u.render();const d=u.getCurrentNode();d.className="",d.removeAttribute("style"),Zu(d,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&Re(d,[nz(),hz(),jR(h+1),Sl(-1)]),n[h](a,d,h)}u.end()}}}class R2 extends Rd{constructor(e){super(null,e)}adjust(){const{columnHeadersCount:e,rowHeadersCount:n}=this.table;let r=this.rootNode.firstChild;if(e){const{columnsToRender:i}=this.table,o=i+n;for(let a=0,l=e;a<l;a++){for(r=this.rootNode.childNodes[a],r||(r=this.table.rootDocument.createElement("tr"),this.rootNode.appendChild(r)),this.renderedNodes=r.childNodes.length;this.renderedNodes<o;)r.appendChild(this.table.rootDocument.createElement("th")),this.renderedNodes+=1;for(;this.renderedNodes>o;)r.removeChild(r.lastChild),this.renderedNodes-=1}const s=this.rootNode.childNodes.length;if(s>e)for(let a=e;a<s;a++)this.rootNode.removeChild(this.rootNode.lastChild)}else r&&rs(r)}render(){const{columnHeadersCount:e}=this.table;this.table.isAriaEnabled()&&Re(this.rootNode,[zN()]);for(let n=0;n<e;n+=1){const{columnHeaderFunctions:r,columnsToRender:i,rowHeadersCount:o}=this.table,s=this.rootNode.childNodes[n];this.table.isAriaEnabled()&&Re(s,[cb(),KN(n+1)]);for(let a=-1*o;a<i;a+=1){const l=this.table.renderedColumnToSource(a),u=s.childNodes[a+o];u.className="",u.removeAttribute("style"),Zu(u,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&Re(u,[jR(a+1+this.table.rowHeadersCount),Sl(-1),rz(),...a>=0?[cz()]:[cb()]]),r[n](l,u,n)}}}}let YO=!1;class E2 extends Rd{constructor(e){super(null,e)}adjust(){const{columnsToRender:e,rowHeadersCount:n}=this.table,r=e+n;for(;this.renderedNodes<r;)this.rootNode.appendChild(this.table.rootDocument.createElement("col")),this.renderedNodes+=1;for(;this.renderedNodes>r;)this.rootNode.removeChild(this.rootNode.lastChild),this.renderedNodes-=1}render(){this.adjust();const{columnsToRender:e,rowHeadersCount:n}=this.table;!YO&&e>1e3&&(YO=!0,tt(st`Performance tip: Handsontable rendered more than 1000 visible columns.\x20
58
- Consider limiting the number of rendered columns by specifying the table width and/or\x20
59
- turning off the "renderAllColumns" option.`));for(let i=0;i<n;i++){const o=this.table.renderedColumnToSource(i),s=this.table.columnUtils.getHeaderWidth(o);this.rootNode.childNodes[i].style.width=`${s}px`}for(let i=0;i<e;i++){const o=this.table.renderedColumnToSource(i),s=this.table.columnUtils.getWidth(o);this.rootNode.childNodes[i+n].style.width=`${s}px`}const r=this.rootNode.firstChild;r&&X(r,"rowHeader")}}function T2(t,e,n){return(e=_2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _2(t){var e=M2(t,"string");return typeof e=="symbol"?e:e+""}function M2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Al={rowEven:"ht__row_even",rowOdd:"ht__row_odd"};let GO=!1;class I2 extends Rd{constructor(e){super("TR",e),T2(this,"orderView",void 0),this.orderView=new DD(e,n=>this.nodesPool.obtain(n))}getRenderedNode(e){return this.orderView.getNode(e)}hasStaleContent(e){return this.orderView.hasStaleContent(e)}render(){const{rowsToRender:e}=this.table;!GO&&e>1e3&&(GO=!0,tt(st`Performance tip: Handsontable rendered more than 1000 visible rows.\x20
60
- Consider limiting the number of rendered rows by specifying the table height and/or\x20
61
- turning off the "renderAllRows" option.`)),this.table.isAriaEnabled()&&Re(this.rootNode,[zN()]),this.orderView.setSize(e).setOffset(this.table.renderedRowToSource(0)).start();for(let i=0;i<e;i++){this.orderView.render();const o=this.orderView.getCurrentNode(),s=this.table.renderedRowToSource(i);if(this.table.isAriaEnabled()){var n,r;Re(o,[cb(),KN(s+((n=(r=this.table.rowUtils)===null||r===void 0||(r=r.dataAccessObject)===null||r===void 0?void 0:r.columnHeaders.length)!==null&&n!==void 0?n:0)+1)])}(s+1)%2===0?ye(o,Al.rowEven)||(we(o,Al.rowOdd),X(o,Al.rowEven)):ye(o,Al.rowOdd)||(we(o,Al.rowEven),X(o,Al.rowOdd))}this.orderView.end()}}function qO(t,e,n){return(e=P2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function P2(t){var e=O2(t,"string");return typeof e=="symbol"?e:e+""}function O2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class x2 extends Rd{constructor(){super("TD"),qO(this,"orderViews",new WeakMap),qO(this,"sourceRowIndex",0)}obtainOrderView(e){let n;return this.orderViews.has(e)?n=this.orderViews.get(e):(n=new kD(e,r=>this.nodesPool.obtain(this.sourceRowIndex,r),this.nodeType),this.orderViews.set(e,n)),n}render(){const{rowsToRender:e,columnsToRender:n,rows:r,rowHeaders:i}=this.table;for(let a=0;a<e;a++){const l=this.table.renderedRowToSource(a),u=r.getRenderedNode(a);this.sourceRowIndex=l;const c=this.obtainOrderView(u),h=i.obtainOrderView(u);c.prependView(h).setSize(n).setOffset(0).start();for(let d=0;d<n;d++){c.render();const f=this.table.renderedColumnToSource(d),m=c.getCurrentNode();if(ye(m,"hide")||(m.className=""),m.removeAttribute("style"),m.removeAttribute("dir"),Zu(m,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.cellRenderer(l,f,m),this.table.isAriaEnabled()){var o,s;Re(m,[...m.hasAttribute("role")?[]:[tz()],Sl(-1),jR(f+((o=(s=this.table.rowUtils)===null||s===void 0||(s=s.dataAccessObject)===null||s===void 0?void 0:s.rowHeaders.length)!==null&&o!==void 0?o:0)+1)])}}c.end()}}}function nn(t,e,n){return(e=A2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function A2(t){var e=H2(t,"string");return typeof e=="symbol"?e:e+""}function H2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class N2{constructor(e){let{cellRenderer:n,stylesHandler:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};nn(this,"rootNode",void 0),nn(this,"rootDocument",void 0),nn(this,"rowHeaders",null),nn(this,"columnHeaders",null),nn(this,"colGroup",null),nn(this,"rows",null),nn(this,"cells",null),nn(this,"rowFilter",null),nn(this,"columnFilter",null),nn(this,"rowUtils",null),nn(this,"columnUtils",null),nn(this,"rowsToRender",0),nn(this,"columnsToRender",0),nn(this,"rowHeaderFunctions",[]),nn(this,"rowHeadersCount",0),nn(this,"columnHeaderFunctions",[]),nn(this,"columnHeadersCount",0),nn(this,"cellRenderer",void 0),nn(this,"activeOverlayName",void 0),nn(this,"stylesHandler",void 0),this.rootNode=e,this.rootDocument=this.rootNode.ownerDocument,this.cellRenderer=n,this.stylesHandler=r}setActiveOverlayName(e){this.activeOverlayName=e}setAxisUtils(e,n){this.rowUtils=e,this.columnUtils=n}setViewportSize(e,n){this.rowsToRender=e,this.columnsToRender=n}setFilters(e,n){this.rowFilter=e,this.columnFilter=n}setHeaderContentRenderers(e,n){this.rowHeaderFunctions=e,this.rowHeadersCount=e.length,this.columnHeaderFunctions=n,this.columnHeadersCount=n.length}setRenderers(){let{rowHeaders:e,columnHeaders:n,colGroup:r,rows:i,cells:o}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.setTable(this),n.setTable(this),r.setTable(this),i.setTable(this),o.setTable(this),this.rowHeaders=e,this.columnHeaders=n,this.colGroup=r,this.rows=i,this.cells=o}renderedRowToSource(e){return this.rowFilter.renderedToSource(e)}renderedColumnToSource(e){return this.columnFilter.renderedToSource(e)}isAriaEnabled(){return this.rowUtils.wtSettings.getSetting("ariaTags")}render(){this.colGroup.adjust(),this.columnHeaders.adjust(),this.rows.adjust(),this.rowHeaders.adjust(),this.columnHeaders.render(),this.rows.render(),this.rowHeaders.render(),this.cells.render(),this.columnUtils.calculateWidths(),this.colGroup.render();const{rowsToRender:e,rows:n}=this;for(let r=0;r<e;r++){const i=n.getRenderedNode(r),o=this.rowUtils;if(i.firstChild){const s=this.renderedRowToSource(r),a=o.getHeightByOverlayName(s,this.activeOverlayName),u=this.stylesHandler.areCellsBorderBox()?0:1;a?i.firstChild.style.height=`${a-u}px`:i.firstChild.style.height=""}}}}class D2{constructor(){let{TABLE:e,THEAD:n,COLGROUP:r,TBODY:i,rowUtils:o,columnUtils:s,cellRenderer:a,stylesHandler:l}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.renderer=new N2(e,{cellRenderer:a,stylesHandler:l}),this.renderer.setRenderers({rowHeaders:new b2,columnHeaders:new R2(n),colGroup:new E2(r),rows:new I2(i),cells:new x2}),this.renderer.setAxisUtils(o,s)}setActiveOverlayName(e){return this.renderer.setActiveOverlayName(e),this}setFilters(e,n){return this.renderer.setFilters(e,n),this}setViewportSize(e,n){return this.renderer.setViewportSize(e,n),this}setHeaderContentRenderers(e,n){return this.renderer.setHeaderContentRenderers(e,n),this}adjust(){this.renderer.adjust()}render(){this.renderer.render()}}function QC(t,e,n){return(e=k2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function k2(t){var e=L2(t,"string");return typeof e=="symbol"?e:e+""}function L2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class $2{constructor(e,n){QC(this,"dataAccessObject",void 0),QC(this,"wtSettings",void 0),QC(this,"headerWidths",new Map),this.dataAccessObject=e,this.wtSettings=n}getWidth(e){return this.wtSettings.getSetting("columnWidth",e)||this.wtSettings.getSetting("defaultColumnWidth")}getHeaderHeight(e){let n=this.dataAccessObject.stylesHandler.getDefaultRowHeight();const r=this.dataAccessObject.wtViewport.oversizedColumnHeaders[e];return r!==void 0&&(n=n?Math.max(n,r):r),n}getHeaderWidth(e){return this.headerWidths.get(this.dataAccessObject.wtTable.columnFilter.sourceToRendered(e))}calculateWidths(){const{wtSettings:e}=this;let n=e.getSetting("rowHeaderWidth");if(n=e.getSetting("onModifyRowHeaderWidth",n),n!=null){const r=e.getSetting("rowHeaders").length,i=e.getSetting("defaultColumnWidth");for(let o=0;o<r;o++){let s=Array.isArray(n)?n[o]:n;s=s??i,this.headerWidths.set(o,s)}}}}function KO(t,e,n){return(e=F2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function F2(t){var e=V2(t,"string");return typeof e=="symbol"?e:e+""}function V2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class W2{constructor(e,n){KO(this,"dataAccessObject",void 0),KO(this,"wtSettings",void 0),this.dataAccessObject=e,this.wtSettings=n}getHeight(e){let n=this.wtSettings.getSetting("rowHeight",e);const r=this.dataAccessObject.wtViewport.oversizedRows[e];return r!==void 0&&(n=n===void 0?r:Math.max(n,r)),n}getHeightByOverlayName(e,n){let r=this.wtSettings.getSetting("rowHeightByOverlayName",e,n);const i=this.dataAccessObject.wtViewport.oversizedRows[e];return i!==void 0&&(r=r===void 0?i:Math.max(r,i)),r}}function Li(t,e,n){return(e=B2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function B2(t){var e=j2(t,"string");return typeof e=="symbol"?e:e+""}function j2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Qu{constructor(e,n,r,i,o){Li(this,"wtSettings",null),Li(this,"domBindings",void 0),Li(this,"TBODY",null),Li(this,"THEAD",null),Li(this,"COLGROUP",null),Li(this,"hasTableHeight",!0),Li(this,"hasTableWidth",!0),Li(this,"isTableVisible",!1),Li(this,"tableOffset",0),Li(this,"holderOffset",0),this.domBindings=r,this.isMaster=o==="master",this.name=o,this.dataAccessObject=e,this.facadeGetter=n,this.wtSettings=i,this.instance=this.dataAccessObject.wot,this.wot=this.dataAccessObject.wot,this.TABLE=r.rootTable,QN(this.TABLE),this.spreader=this.createSpreader(this.TABLE),this.hider=this.createHider(this.spreader),this.holder=this.createHolder(this.hider),this.wtRootElement=this.holder.parentNode,this.isMaster&&this.alignOverlaysWithTrimmingContainer(),this.fixTableDomTree(),this.rowFilter=null,this.columnFilter=null,this.correctHeaderWidth=!1;const s=this.wtSettings.getSettingPure("rowHeaderWidth");this.wtSettings.update("rowHeaderWidth",()=>this._modifyRowHeaderWidth(s)),this.rowUtils=new W2(this.dataAccessObject,this.wtSettings),this.columnUtils=new $2(this.dataAccessObject,this.wtSettings),this.tableRenderer=new D2({TABLE:this.TABLE,THEAD:this.THEAD,COLGROUP:this.COLGROUP,TBODY:this.TBODY,rowUtils:this.rowUtils,columnUtils:this.columnUtils,cellRenderer:this.wtSettings.getSettingPure("cellRenderer"),stylesHandler:this.dataAccessObject.stylesHandler})}is(e){return this.name===e}fixTableDomTree(){const e=this.domBindings.rootDocument;this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=e.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=e.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=e.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD))}createSpreader(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!ye(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.className="wtSpreader",n&&n.insertBefore(r,e),r.appendChild(e)),r.style.position="relative",this.wtSettings.getSetting("ariaTags")&&Re(r,[Go()]),r}createHider(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!ye(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.className="wtHider",n&&n.insertBefore(r,e),r.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&Re(r,[Go()]),r}createHolder(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!ye(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.style.position="relative",r.className="wtHolder",Re(r,[Sl(-1)]),n&&n.insertBefore(r,e),this.isMaster&&(r.parentNode.className+="ht_master handsontable",r.parentNode.setAttribute("dir",this.wtSettings.getSettingPure("rtlMode")?"rtl":"ltr"),this.wtSettings.getSetting("ariaTags")&&Re(r.parentNode,[Go()])),r.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&Re(r,[Go()]),r}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:n}=this,{wtOverlays:r,wtViewport:i}=this.dataAccessObject,o=n.getSetting("totalRows"),s=n.getSetting("totalColumns"),a=n.getSetting("rowHeaders"),l=a.length,u=n.getSetting("columnHeaders"),c=u.length;let h=e;if(this.isMaster&&(r.beforeDraw(),this.holderOffset=Nn(this.holder),h=i.createCalculators(h),l&&!n.getSetting("fixedColumnsStart"))){const f=r.inlineStartOverlay.getScrollPosition(),m=this.correctHeaderWidth;this.correctHeaderWidth=f!==0,m!==this.correctHeaderWidth&&(h=!1)}if(h)this.isMaster&&r.refresh(!0);else{this.isMaster?this.tableOffset=Nn(this.TABLE):this.tableOffset=this.dataAccessObject.parentTableOffset;const f=Math.max(this.getFirstRenderedRow(),0),m=Math.max(this.getFirstRenderedColumn(),0);this.rowFilter=new XG(f,o,c),this.columnFilter=new GG(m,s,l);let C=!0;if(this.isMaster){this.alignOverlaysWithTrimmingContainer();const y={};this.wtSettings.getSetting("beforeDraw",!0,y),C=y.skipRender!==!0}C&&(this.tableRenderer.setHeaderContentRenderers(a,u),(this.is(ao)||this.is(zs))&&this.tableRenderer.setHeaderContentRenderers(a,[]),this.resetOversizedRows(),this.tableRenderer.setActiveOverlayName(this.name).setViewportSize(this.getRenderedRowsCount(),this.getRenderedColumnsCount()).setFilters(this.rowFilter,this.columnFilter).render(),this.isMaster&&this.markOversizedColumnHeaders(),this.adjustColumnHeaderHeights(),(this.isMaster||this.is(ao))&&this.markOversizedRows(),this.isMaster?(this.wtSettings.getSetting("externalRowCalculator")||i.createVisibleCalculators(),r.refresh(!1),r.applyToDOM(),this.wtSettings.getSetting("onDraw",!0)):this.is(ao)&&this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize())}let d=!1;return this.isMaster&&(d=r.topOverlay.resetFixedPosition(),r.bottomOverlay.clone&&(d=r.bottomOverlay.resetFixedPosition()||d),d=r.inlineStartOverlay.resetFixedPosition()||d,r.topInlineStartCornerOverlay&&r.topInlineStartCornerOverlay.resetFixedPosition(),r.bottomInlineStartCornerOverlay&&r.bottomInlineStartCornerOverlay.clone&&r.bottomInlineStartCornerOverlay.resetFixedPosition()),d?(r.refreshAll(),r.adjustElementsSize()):this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(h),this.isMaster&&r.afterDraw(),this.dataAccessObject.drawn=!0,this}markIfOversizedColumnHeader(e){const n=this.columnFilter.renderedToSource(e);let r=this.wtSettings.getSetting("columnHeaders").length;const i=this.dataAccessObject.stylesHandler.getDefaultRowHeight();let o,s,a;const l=this.wtSettings.getSetting("columnHeaderHeight")||[];for(;r;)r-=1,o=this.getColumnHeaderHeight(r),s=this.getColumnHeader(n,r),s&&(a=yh(s),(!o&&i<a||o<a)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]=a),Array.isArray(l)?l[r]!==null&&l[r]!==void 0&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]=l[r]):isNaN(l)||(this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]=l),this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]<(l[r]||l)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]=l[r]||l))}adjustColumnHeaderHeights(){const{wtSettings:e}=this,n=this.THEAD.childNodes,r=this.dataAccessObject.wtViewport.oversizedColumnHeaders,i=e.getSetting("columnHeaders");for(let o=0,s=i.length;o<s;o++)if(r[o]){if(!n[o]||n[o].childNodes.length===0)return;n[o].childNodes[0].style.height=`${r[o]}px`}}resetOversizedRows(){const{wtSettings:e}=this,{wtViewport:n}=this.dataAccessObject;if(!(!this.isMaster&&!this.is(ao))&&!e.getSetting("externalRowCalculator")){const r=this.getRenderedRowsCount();for(let i=0;i<r;i++){const o=this.rowFilter.renderedToSource(i);n.oversizedRows&&n.oversizedRows[o]&&(n.oversizedRows[o]=void 0)}}}getCell(e){let n=e.row,r=e.col;const i=this.wtSettings.getSetting("onModifyGetCellCoords",n,r,!this.isMaster,"render");if(i&&Array.isArray(i)&&([n,r]=i),this.isRowBeforeRenderedRows(n))return-1;if(this.isRowAfterRenderedRows(n))return-2;if(this.isColumnBeforeRenderedColumns(r))return-3;if(this.isColumnAfterRenderedColumns(r))return-4;const o=this.getRow(n);if(!o&&n>=0)throw new Error("TR was expected to be rendered but is not");const s=o.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(r)];if(!s&&r>=0)throw new Error("TD or TH was expected to be rendered but is not");return s}getRow(e){let n=null,r=null;if(e<0){var i;n=(i=this.rowFilter)===null||i===void 0?void 0:i.sourceRowToVisibleColHeadedRow(e),r=this.THEAD}else{var o;n=(o=this.rowFilter)===null||o===void 0?void 0:o.sourceToRendered(e),r=this.TBODY}return n!==void 0&&r!==void 0?r.childNodes.length<n+1?!1:r.childNodes[n]:!1}getColumnHeader(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.THEAD.childNodes[n];return r==null?void 0:r.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]}getColumnHeaders(e){const n=[],r=this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e);return this.THEAD.childNodes.forEach(i=>{const o=i.childNodes[r];o&&n.push(o)}),n}getRowHeader(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.wtSettings.getSetting("rowHeaders").length;if(n>=r)return;const i=this.rowFilter.sourceToRendered(e),o=i<0?this.rowFilter.sourceRowToVisibleColHeadedRow(e):i,a=(i<0?this.THEAD:this.TBODY).childNodes[o];return a==null?void 0:a.childNodes[n]}getRowHeaders(e){const n=[],r=this.wtSettings.getSetting("rowHeaders").length;for(let i=0;i<r;i++){const o=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)],s=o==null?void 0:o.childNodes[i];s&&n.push(s)}return n}getCoords(e){let n=e;if(n.nodeName!=="TD"&&n.nodeName!=="TH"&&(n=sl(n,["TD","TH"])),n===null)return null;const r=n.parentNode;if(!r)return null;const i=r.parentNode;let o=_z(r),s=n.cellIndex;oa(dl,n,this.wtRootElement)||oa(cl,n,this.wtRootElement)?i.nodeName==="THEAD"&&(o-=i.childNodes.length):oa(zs,n,this.wtRootElement)||oa(ao,n,this.wtRootElement)?o=this.wtSettings.getSetting("totalRows")-i.childNodes.length+o:i===this.THEAD?o=this.rowFilter.visibleColHeadedRowToSourceRow(o):this.rowFilter&&(o=this.rowFilter.renderedToSource(o)),oa(dl,n,this.wtRootElement)||oa(hl,n,this.wtRootElement)||oa(zs,n,this.wtRootElement)?s=this.columnFilter.offsettedTH(s):this.columnFilter&&(s=this.columnFilter.visibleRowHeadedColumnToSourceColumn(s));const a=this.wtSettings.getSetting("onModifyGetCoordsElement",o,s);return a&&Array.isArray(a)&&([o,s]=a),this.wot.createCellCoords(o,s)}markOversizedRows(){if(this.wtSettings.getSetting("externalRowCalculator"))return;let e=this.TBODY.childNodes.length;const n=e*this.dataAccessObject.stylesHandler.getDefaultRowHeight(),r=yh(this.TBODY)-1,i=this.wot.stylesHandler.areCellsBorderBox(),o=i?an:yh,s=i?0:1,a=i?1:0;let l,u,c,h,d;if(!(n===r&&!this.wtSettings.getSetting("fixedRowsBottom")))for(;e;){e-=1,c=this.rowFilter.renderedToSource(e),l=this.getRowHeight(c),h=this.getTrForRow(c),d=h.querySelector("th");const f=c===0?a:0;d?u=o(d):u=o(h)-s,(!l&&this.dataAccessObject.stylesHandler.getDefaultRowHeight()<u-f||l<u)&&(i||(u+=1),this.dataAccessObject.wtViewport.oversizedRows[c]=u)}}getTrForRow(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]}isColumnHeaderRendered(e){if(e>=0)return!1;const r=this.wtSettings.getSetting("rowHeaders").length;return Math.abs(e)<=r}isRowHeaderRendered(e){if(e>=0)return!1;const r=this.wtSettings.getSetting("columnHeaders").length;return Math.abs(e)<=r}isRowBeforeRenderedRows(e){const n=this.getFirstRenderedRow();return e<0&&n<=0?!this.isRowHeaderRendered(e):e<n}isRowAfterRenderedRows(e){return e>this.getLastRenderedRow()}isColumnBeforeRenderedColumns(e){const n=this.getFirstRenderedColumn();return e<0&&n<=0?!this.isColumnHeaderRendered(e):e<n}isColumnAfterRenderedColumns(e){return this.columnFilter&&e>this.getLastRenderedColumn()}isColumnAfterViewport(e){return this.columnFilter&&e>this.getLastVisibleColumn()}isRowAfterViewport(e){return this.rowFilter&&e>this.getLastVisibleRow()}isColumnBeforeViewport(e){return this.columnFilter&&this.columnFilter.sourceToRendered(e)<0&&e>=0}isLastRowFullyVisible(){return this.getLastVisibleRow()===this.getLastRenderedRow()}isLastColumnFullyVisible(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()}allRowsInViewport(){return this.wtSettings.getSetting("totalRows")===this.getVisibleRowsCount()}allColumnsInViewport(){return this.wtSettings.getSetting("totalColumns")===this.getVisibleColumnsCount()}getRowHeight(e){return this.rowUtils.getHeight(e)}getColumnHeaderHeight(e){return this.columnUtils.getHeaderHeight(e)}getColumnWidth(e){return this.columnUtils.getWidth(e)}hasDefinedSize(){return this.hasTableHeight&&this.hasTableWidth}getWidth(){return Xt(this.TABLE)}getHeight(){return an(this.TABLE)}getTotalWidth(){const e=Xt(this.hider);return e!==0?e:this.getWidth()}getTotalHeight(){const e=an(this.hider);return e!==0?e:this.getHeight()}isVisible(){return Du(this.TABLE)}_modifyRowHeaderWidth(e){let n=ut(e)?e():null;return Array.isArray(n)?(n=[...n],n[n.length-1]=this._correctRowHeaderWidth(n[n.length-1])):n=this._correctRowHeaderWidth(n),n}_correctRowHeaderWidth(e){let n=e;return typeof e!="number"&&(n=this.wtSettings.getSetting("defaultColumnWidth")),this.correctHeaderWidth&&(n+=1),n}}const U2="stickyRowsBottom",tE={getFirstRenderedRow(){const t=this.getRenderedRowsCount();return t===0?-1:this.wtSettings.getSetting("totalRows")-t},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.getRenderedRowsCount()===0?-1:this.wtSettings.getSetting("totalRows")-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){return Math.min(this.wtSettings.getSetting("totalRows"),this.wtSettings.getSetting("fixedRowsBottom"))},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return 0}};us(tE,"MIXIN_NAME",U2,{writable:!1,enumerable:!1});const z2="stickyColumnsStart",hp={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}};us(hp,"MIXIN_NAME",z2,{writable:!1,enumerable:!1});class nE extends Qu{constructor(e,n,r,i){super(e,n,r,i,zs)}}gt(nE,tE);gt(nE,hp);const cl="top",ao="bottom",hl="inline_start",dl="top_inline_start_corner",zs="bottom_inline_start_corner",LD=[cl,ao,hl,dl,zs],Y2=new Map([[cl,`ht_clone_${cl}`],[ao,`ht_clone_${ao}`],[hl,`ht_clone_${hl} ht_clone_left`],[dl,`ht_clone_${dl} ht_clone_top_left_corner`],[zs,`ht_clone_${zs} ht_clone_bottom_left_corner`]]);function G2(t,e){q2(t,e),e.add(t)}function q2(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function K2(t,e,n){return(e=X2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function X2(t){var e=Z2(t,"string");return typeof e=="symbol"?e:e+""}function Z2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Xd(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Ec=new WeakSet;class J2{constructor(e){G2(this,Ec),K2(this,"dataAccessObject",void 0),this.dataAccessObject=e}scrollViewport(e,n,r){if(e.col<0||e.row<0)return!1;const i=this.scrollViewportHorizontally(e.col,n),o=this.scrollViewportVertically(e.row,r);return i||o}scrollViewportHorizontally(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auto";const{drawn:r,totalColumns:i}=this.dataAccessObject;if(!r)return!1;const o=xr(n);if(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollHorizontally",e,o),!Number.isInteger(e)||e<0||e>i)return!1;n=o.value;const{fixedColumnsStart:s,inlineStartOverlay:a}=this.dataAccessObject,l=n==="auto";if(l&&e<s)return!1;const u=this.getFirstVisibleColumn(),c=this.getLastVisibleColumn();let h=!1;return(l&&(e<u||e>c)||!l)&&(h=a.scrollTo(e,l?e>=this.getLastPartiallyVisibleColumn():n==="end")),h}scrollViewportVertically(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auto";const{drawn:r,totalRows:i}=this.dataAccessObject;if(!r)return!1;const o=xr(n);if(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollVertically",e,o),!Number.isInteger(e)||e<0||e>i)return!1;n=o.value;const{fixedRowsBottom:s,fixedRowsTop:a,topOverlay:l}=this.dataAccessObject,u=n==="auto";if(u&&(e<a||e>i-s-1))return!1;const c=this.getFirstVisibleRow(),h=this.getLastVisibleRow();let d=!1;return(u&&(e<c||e>h)||!u)&&(d=l.scrollTo(e,u?e>=this.getLastPartiallyVisibleRow():n==="bottom")),d}getFirstVisibleRow(){return this.dataAccessObject.wtTable.getFirstVisibleRow()}getLastVisibleRow(){return Xd(Ec,this,ZO).call(this,this.dataAccessObject.wtTable.getLastVisibleRow())}getFirstPartiallyVisibleRow(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleRow()}getLastPartiallyVisibleRow(){return Xd(Ec,this,ZO).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleRow())}getFirstVisibleColumn(){return this.dataAccessObject.wtTable.getFirstVisibleColumn()}getLastVisibleColumn(){return Xd(Ec,this,XO).call(this,this.dataAccessObject.wtTable.getLastVisibleColumn())}getFirstPartiallyVisibleColumn(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleColumn()}getLastPartiallyVisibleColumn(){return Xd(Ec,this,XO).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleColumn())}}function XO(t){const{wtSettings:e,inlineStartOverlay:n,wtTable:r,wtViewport:i,totalColumns:o,rootWindow:s}=this.dataAccessObject;if(n.mainTableScrollableElement===s){const a=e.getSetting("rtlMode");let l=null;if(a){const c=r.TABLE.getBoundingClientRect(),d=this.dataAccessObject.rootWindow.document.documentElement.offsetWidth;l=Math.abs(c.right-d)}else l=Nn(r.wtRootElement).left;const u=Math.abs(tD(s,s));if(l>u){const c=nD(s);let h=i.getRowHeaderWidth();for(let d=1;d<=o;d++)if(h+=n.sumCellSizes(d-1,d),l+h-u>=c){t=d-2;break}}}return t}function ZO(t){const{topOverlay:e,wtTable:n,wtViewport:r,totalRows:i,rootWindow:o}=this.dataAccessObject;if(e.mainTableScrollableElement===o){const s=Nn(n.wtRootElement),a=YR(o,o);if(s.top>a){const l=yh(o);let u=r.getColumnHeaderHeight();for(let c=1;c<=i;c++)if(u+=e.sumCellSizes(c-1,c),s.top+u-a>=l){t=c-2;break}}}return t}function $r(t,e,n){return(e=Q2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Q2(t){var e=eq(t,"string");return typeof e=="symbol"?e:e+""}function eq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class rE{get eventManager(){return new _i(this)}constructor(e,n){$r(this,"wtTable",void 0),$r(this,"wtScroll",void 0),$r(this,"wtViewport",void 0),$r(this,"wtOverlays",void 0),$r(this,"selectionManager",void 0),$r(this,"wtEvent",void 0),$r(this,"guid",`wt_${BN()}`),$r(this,"drawInterrupted",!1),$r(this,"drawn",!1),$r(this,"activeOverlayName","master"),$r(this,"domBindings",void 0),$r(this,"wtSettings",void 0),this.domBindings={rootTable:e,rootDocument:e.ownerDocument,rootWindow:e.ownerDocument.defaultView},this.wtSettings=n,this.wtScroll=new J2(this.createScrollDao())}findOriginalHeaders(){const e=[];if(this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(let n=0,r=this.wtTable.THEAD.childNodes[0].childNodes.length;n<r;n++)e.push(this.wtTable.THEAD.childNodes[0].childNodes[n].innerHTML);this.wtSettings.getSetting("columnHeaders").length||this.wtSettings.update("columnHeaders",[function(n,r){al(r,e[n])}])}}createCellCoords(e,n){return new ul(e,n,this.wtSettings.getSetting("rtlMode"))}createCellRange(e,n,r){return new bd(e,n,r,this.wtSettings.getSetting("rtlMode"))}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.drawInterrupted=!1,!this.wtTable.isVisible()||Iz(this.wtTable.wtRootElement.parentNode)?this.drawInterrupted=!0:this.wtTable.draw(e),this}getCell(e){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1))return this.wtTable.getCell(e);const r=this.wtSettings.getSetting("totalRows"),i=this.wtSettings.getSetting("fixedRowsTop"),o=this.wtSettings.getSetting("fixedRowsBottom"),s=this.wtSettings.getSetting("fixedColumnsStart");if(e.row<i&&e.col<s)return this.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.getCell(e);if(e.row<i)return this.wtOverlays.topOverlay.clone.wtTable.getCell(e);if(e.col<s&&e.row>=r-o){if(this.wtOverlays.bottomInlineStartCornerOverlay&&this.wtOverlays.bottomInlineStartCornerOverlay.clone)return this.wtOverlays.bottomInlineStartCornerOverlay.clone.wtTable.getCell(e)}else{if(e.col<s)return this.wtOverlays.inlineStartOverlay.clone.wtTable.getCell(e);if(e.row<r&&e.row>=r-o&&this.wtOverlays.bottomOverlay&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)}scrollViewport(e,n,r){return this.wtScroll.scrollViewport(e,n,r)}scrollViewportHorizontally(e,n){return this.wtScroll.scrollViewportHorizontally(e,n)}scrollViewportVertically(e,n){return this.wtScroll.scrollViewportVertically(e,n)}getViewport(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]}destroy(){this.wtOverlays.destroy(),this.wtEvent.destroy()}createScrollDao(){const e=this;return{get drawn(){return e.drawn},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get wtTable(){return e.wtTable},get wtViewport(){return e.wtViewport},get wtSettings(){return e.wtSettings},get rootWindow(){return e.domBindings.rootWindow},get totalRows(){return e.wtSettings.getSetting("totalRows")},get totalColumns(){return e.wtSettings.getSetting("totalColumns")},get fixedRowsTop(){return e.wtSettings.getSetting("fixedRowsTop")},get fixedRowsBottom(){return e.wtSettings.getSetting("fixedRowsBottom")},get fixedColumnsStart(){return e.wtSettings.getSetting("fixedColumnsStart")}}}getTableDao(){const e=this;return{get wot(){return e},get parentTableOffset(){return e.cloneSource.wtTable.tableOffset},get cloneSource(){return e.cloneSource},get workspaceWidth(){return e.wtViewport.getWorkspaceWidth()},get wtViewport(){return e.wtViewport},get wtOverlays(){return e.wtOverlays},get selectionManager(){return e.selectionManager},get stylesHandler(){return e.stylesHandler},get drawn(){return e.drawn},set drawn(n){e.drawn=n},get wtTable(){return e.wtTable},get startColumnRendered(){return e.wtViewport.columnsRenderCalculator.startColumn},get startColumnVisible(){return e.wtViewport.columnsVisibleCalculator.startColumn},get startColumnPartiallyVisible(){return e.wtViewport.columnsPartiallyVisibleCalculator.startColumn},get endColumnRendered(){return e.wtViewport.columnsRenderCalculator.endColumn},get endColumnVisible(){return e.wtViewport.columnsVisibleCalculator.endColumn},get endColumnPartiallyVisible(){return e.wtViewport.columnsPartiallyVisibleCalculator.endColumn},get countColumnsRendered(){return e.wtViewport.columnsRenderCalculator.count},get countColumnsVisible(){return e.wtViewport.columnsVisibleCalculator.count},get startRowRendered(){return e.wtViewport.rowsRenderCalculator.startRow},get startRowVisible(){return e.wtViewport.rowsVisibleCalculator.startRow},get startRowPartiallyVisible(){return e.wtViewport.rowsPartiallyVisibleCalculator.startRow},get endRowRendered(){return e.wtViewport.rowsRenderCalculator.endRow},get endRowVisible(){return e.wtViewport.rowsVisibleCalculator.endRow},get endRowPartiallyVisible(){return e.wtViewport.rowsPartiallyVisibleCalculator.endRow},get countRowsRendered(){return e.wtViewport.rowsRenderCalculator.count},get countRowsVisible(){return e.wtViewport.rowsVisibleCalculator.count},get columnHeaders(){return e.wtSettings.getSetting("columnHeaders")},get rowHeaders(){return e.wtSettings.getSetting("rowHeaders")}}}}function JO(t,e,n){return(e=tq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tq(t){var e=nq(t,"string");return typeof e=="symbol"?e:e+""}function nq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class rq extends rE{constructor(e,n,r){super(e,n),JO(this,"cloneSource",void 0),JO(this,"cloneOverlay",void 0);const i=this.wtSettings.getSetting("facade",this);this.cloneSource=r.source,this.cloneOverlay=r.overlay,this.stylesHandler=r.stylesHandler,this.wtTable=this.cloneOverlay.createTable(this.getTableDao(),i,this.domBindings,this.wtSettings),this.wtViewport=r.viewport,this.selectionManager=r.selectionManager,this.wtEvent=new ND(i,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager,r.event),this.findOriginalHeaders()}}function iq(t,e,n){return(e=oq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oq(t){var e=sq(t,"string");return typeof e=="symbol"?e:e+""}function sq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Ed{constructor(e,n,r,i,o){iq(this,"wtSettings",null),us(this,"wot",e,{writable:!1}),this.domBindings=o,this.facadeGetter=n,this.wtSettings=i;const{TABLE:s,hider:a,spreader:l,holder:u,wtRootElement:c}=this.wot.wtTable;this.instance=this.wot,this.type=r,this.mainTableScrollableElement=null,this.TABLE=s,this.hider=a,this.spreader=l,this.holder=u,this.wtRootElement=c,this.trimmingContainer=zh(this.hider.parentNode.parentNode),this.needFullRender=this.shouldBeRendered(),this.clone=this.makeClone()}hasRenderingStateChanged(){return this.needFullRender!==this.shouldBeRendered()}updateStateOfRendering(e){e==="before"&&this.shouldBeRendered()?this.needFullRender=!0:e==="after"&&!this.shouldBeRendered()&&(this.needFullRender=!1)}shouldBeRendered(){return!0}updateTrimmingContainer(){this.trimmingContainer=zh(this.hider.parentNode.parentNode)}updateMainScrollableElement(){const{wtTable:e}=this.wot,{rootWindow:n}=this.domBindings;n.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=this.wot.wtTable.holder:this.mainTableScrollableElement=Zg(e.TABLE)}getRelativeCellPosition(e,n,r){if(this.clone.wtTable.holder.contains(e)===!1){tt(`The provided element is not a child of the ${this.type} overlay`);return}const i=this.mainTableScrollableElement===this.domBindings.rootWindow,o=r<this.wtSettings.getSetting("fixedColumnsStart"),s=n<this.wtSettings.getSetting("fixedRowsTop"),a=n>=this.wtSettings.getSetting("totalRows")-this.wtSettings.getSetting("fixedRowsBottom"),l=this.clone.wtTable.spreader,u={start:this.getRelativeStartPosition(l),top:l.offsetTop},c={start:this.getRelativeStartPosition(e),top:e.offsetTop};let h=null;return i?h=this.getRelativeCellPositionWithinWindow(s,o,c,u):h=this.getRelativeCellPositionWithinHolder(s,a,o,c,u),h}getRelativeStartPosition(e){return this.isRtl()?e.offsetParent.offsetWidth-e.offsetLeft-e.offsetWidth:e.offsetLeft}getRelativeCellPositionWithinWindow(e,n,r,i){const o=this.wot.wtTable.wtRootElement.getBoundingClientRect();let s=0,a=0;if(!n)s=i.start;else{let l=o.left;this.isRtl()&&(l=this.domBindings.rootWindow.innerWidth-(o.left+o.width+yn())),s=l<=0?-1*l:0}return e?a=this.clone.wtTable.TABLE.getBoundingClientRect().top-o.top:a=i.top,{start:r.start+s,top:r.top+a}}getRelativeCellPositionWithinHolder(e,n,r,i,o){const s={horizontal:this.wot.wtOverlays.inlineStartOverlay.getScrollPosition(),vertical:this.wot.wtOverlays.topOverlay.getScrollPosition()};let a=0,l=0;if(r||(a=s.horizontal-o.start),n){const u=this.wot.wtTable.wtRootElement.getBoundingClientRect();l=this.clone.wtTable.TABLE.getBoundingClientRect().top*-1+u.top}else e||(l=s.vertical-o.top);return{start:i.start-a,top:i.top-l}}makeClone(){if(LD.indexOf(this.type)===-1)throw new Error(`Clone type "${this.type}" is not supported.`);const{wtTable:e,wtSettings:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,o=r.createElement("div"),s=r.createElement("table"),a=e.wtRootElement.parentNode;o.className=`${Y2.get(this.type)} handsontable`,o.setAttribute("dir",this.isRtl()?"rtl":"ltr"),o.style.position="absolute",o.style.top=0,o.style.overflow="visible",this.isRtl()?o.style.right=0:o.style.left=0,n.getSetting("ariaTags")&&Re(o,[Go()]),s.className=e.TABLE.className,e.TABLE.getAttribute("role")&&s.setAttribute("role",e.TABLE.getAttribute("role")),o.appendChild(s),a.appendChild(o);const u=this.wtSettings.getSetting("preventOverflow");return u===!0||u==="horizontal"&&this.type===cl||u==="vertical"&&this.type===hl?this.mainTableScrollableElement=i:i.getComputedStyle(a).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=e.holder:this.mainTableScrollableElement=Zg(e.TABLE),new rq(s,this.wtSettings,{source:this.wot,overlay:this,viewport:this.wot.wtViewport,event:this.wot.wtEvent,selectionManager:this.wot.selectionManager,stylesHandler:this.wot.stylesHandler})}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.needFullRender){const n=this.clone.cloneSource;n.activeOverlayName=this.clone.wtTable.name,this.clone.draw(e),n.activeOverlayName="master"}}reset(){const e=this.clone.wtTable.holder,n=this.clone.wtTable.hider,r=e.style,i=n.style,o=e.parentNode.style;[r,i,o].forEach(s=>{s.width="",s.height=""})}isRtl(){return this.wtSettings.getSetting("rtlMode")}destroy(){this.clone.eventManager.destroy()}}class aq extends Ed{constructor(e,n,r,i,o,s){super(e,n,zs,r,i),this.bottomOverlay=o,this.inlineStartOverlay=s}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new nE(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")&&this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){const{wot:e}=this;if(this.updateTrimmingContainer(),!e.wtTable.holder.parentNode)return!1;const n=this.clone.wtTable.holder.parentNode;if(n.style.top="",this.trimmingContainer===this.domBindings.rootWindow){const o=this.inlineStartOverlay.getOverlayOffset(),s=this.bottomOverlay.getOverlayOffset();n.style[this.isRtl()?"right":"left"]=`${o}px`,n.style.bottom=`${s}px`}else sp(n),this.repositionOverlay();let r=an(this.clone.wtTable.TABLE);const i=Xt(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(r=0),n.style.height=`${r}px`,n.style.width=`${i}px`,!1}repositionOverlay(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let o=0;n.hasVerticalScroll()||(o+=n.getWorkspaceHeight()-e.getTotalHeight()),n.hasVerticalScroll()&&n.hasHorizontalScroll()&&(o+=yn(r)),i.style.bottom=`${o}px`}}const lq="calculatedColumns",dp={getFirstRenderedColumn(){const t=this.dataAccessObject.startColumnRendered;return t===null?-1:t},getFirstVisibleColumn(){const t=this.dataAccessObject.startColumnVisible;return t===null?-1:t},getFirstPartiallyVisibleColumn(){const t=this.dataAccessObject.startColumnPartiallyVisible;return t===null?-1:t},getLastRenderedColumn(){const t=this.dataAccessObject.endColumnRendered;return t===null?-1:t},getLastVisibleColumn(){const t=this.dataAccessObject.endColumnVisible;return t===null?-1:t},getLastPartiallyVisibleColumn(){const t=this.dataAccessObject.endColumnPartiallyVisible;return t===null?-1:t},getRenderedColumnsCount(){return this.dataAccessObject.countColumnsRendered},getVisibleColumnsCount(){return this.dataAccessObject.countColumnsVisible},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};us(dp,"MIXIN_NAME",lq,{writable:!1,enumerable:!1});class iE extends Qu{constructor(e,n,r,i){super(e,n,r,i,ao)}}gt(iE,tE);gt(iE,dp);function uq(t,e,n){return(e=cq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cq(t){var e=hq(t,"string");return typeof e=="symbol"?e:e+""}function hq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class dq extends Ed{constructor(e,n,r,i){super(e,n,ao,r,i),uq(this,"cachedFixedRowsBottom",-1),this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom")}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new iE(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.shouldBeRendered()||!this.wot.wtTable.holder.parentNode)return!1;const{rootWindow:e}=this.domBindings,n=this.clone.wtTable.holder.parentNode;n.style.top="";let r=0;const i=this.wtSettings.getSetting("preventOverflow");this.trimmingContainer===e&&(!i||i!=="vertical")?(r=this.getOverlayOffset(),n.style.bottom=`${r}px`):(r=this.getScrollPosition(),this.repositionOverlay());const o=this.adjustHeaderBordersPosition(r);return this.adjustElementsSize(),o}repositionOverlay(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let o=0;n.hasVerticalScroll()||(o+=n.getWorkspaceHeight()-e.getTotalHeight()),n.hasVerticalScroll()&&n.hasHorizontalScroll()&&(o+=yn(r)),i.style.bottom=`${o}px`}setScrollPosition(e){const{rootWindow:n}=this.domBindings,r=this.mainTableScrollableElement;let i=!1;if(r===n&&e!==n.scrollY){const o=n.scrollY;n.scrollTo(zR(n),top),i=o!==n.scrollY}else if(e!==r.scrollTop){const o=r.scrollTop;r.scrollTop=e,i=o!==r.scrollTop}return i}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,n){const{wtTable:r,stylesHandler:i}=this.wot,o=i.getDefaultRowHeight();let s=e,a=0;for(;s<n;){const l=r.getRowHeight(s);a+=l===void 0?o:l,s+=1}return a}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="horizontal"){let u=n.getWorkspaceWidth();n.hasVerticalScroll()&&(u-=yn(r)),u=Math.min(u,e.wtRootElement.scrollWidth),s.width=`${u}px`}else s.width="";this.clone.wtTable.holder.style.width=s.width;let l=an(this.clone.wtTable.TABLE);e.hasDefinedSize()||(l=0),s.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable;this.clone.wtTable.hider.style.width=this.hider.style.width,e.style.width=e.parentNode.style.width,e.style.height=e.parentNode.style.height}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");if(typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number")this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style.top="0";else throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){const e=this.isRtl()?"right":"left",{spreader:n}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?n.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:n.style[e]=""}scrollTo(e,n){let r=this.getTableParentOffset();const o=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder;let s=0;n&&o.offsetHeight!==o.clientHeight&&(s=yn(this.domBindings.rootDocument)),n?(r+=this.sumCellSizes(0,e+1),r-=this.wot.wtViewport.getViewportHeight(),r+=1):r+=this.sumCellSizes(this.wtSettings.getSetting("fixedRowsBottom"),e),r+=s,this.setScrollPosition(r)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return YR(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let r=0;if(this.trimmingContainer===e&&(!n||n!=="vertical")){const i=this.wot.wtTable.getTotalHeight(),o=this.clone.wtTable.getTotalHeight(),s=i-o,a=this.domBindings.rootDocument.documentElement.clientHeight;r=Math.max(this.getTableParentOffset()-this.getScrollPosition()-a+i,0),r>s&&(r=0)}return r}adjustHeaderBordersPosition(e){const n=this.wtSettings.getSetting("fixedRowsBottom"),r=this.cachedFixedRowsBottom!==n,i=this.wtSettings.getSetting("columnHeaders");let o=!1;if((r||n===0)&&i.length>0){const s=this.wot.wtTable.holder.parentNode,a=ye(s,"innerBorderBottom");this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom"),e||this.wtSettings.getSetting("totalRows")===0?(X(s,"innerBorderBottom"),o=!a):(we(s,"innerBorderBottom"),o=a)}return o}}const fq="calculatedRows",oE={getFirstRenderedRow(){const t=this.dataAccessObject.startRowRendered;return t===null?-1:t},getFirstVisibleRow(){const t=this.dataAccessObject.startRowVisible;return t===null?-1:t},getFirstPartiallyVisibleRow(){const t=this.dataAccessObject.startRowPartiallyVisible;return t===null?-1:t},getLastRenderedRow(){const t=this.dataAccessObject.endRowRendered;return t===null?-1:t},getLastVisibleRow(){const t=this.dataAccessObject.endRowVisible;return t===null?-1:t},getLastPartiallyVisibleRow(){const t=this.dataAccessObject.endRowPartiallyVisible;return t===null?-1:t},getRenderedRowsCount(){return this.dataAccessObject.countRowsRendered},getVisibleRowsCount(){return this.dataAccessObject.countRowsVisible},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};us(oE,"MIXIN_NAME",fq,{writable:!1,enumerable:!1});class sE extends Qu{constructor(e,n,r,i){super(e,n,r,i,hl)}}gt(sE,oE);gt(sE,hp);const gq="localHooks",En={_localHooks:Object.create(null),addLocalHook(t,e){return this._localHooks[t]||(this._localHooks[t]=[]),this._localHooks[t].push(e),this},runLocalHooks(t,e,n,r,i,o,s){if(this._localHooks[t]){const a=this._localHooks[t].length;for(let l=0;l<a;l++)hb(this._localHooks[t][l],this,e,n,r,i,o,s)}},clearLocalHooks(){return this._localHooks={},this}};us(En,"MIXIN_NAME",gq,{writable:!1,enumerable:!1});let $D=class{constructor(e,n){this.settings=e,this.cellRange=n||null}isEmpty(){return this.cellRange===null}add(e){return this.isEmpty()?this.cellRange=this.settings.createCellRange(e):this.cellRange.expand(e),this}replace(e,n){if(!this.isEmpty()){if(this.cellRange.from.isEqual(e))return this.cellRange.from=n,!0;if(this.cellRange.to.isEqual(e))return this.cellRange.to=n,!0}return!1}clear(){return this.cellRange=null,this}getCorners(){const e=this.cellRange.getOuterTopStartCorner(),n=this.cellRange.getOuterBottomEndCorner();return[e.row,e.col,n.row,n.col]}destroy(){this.runLocalHooks("destroy")}};gt($D,En);const FD="active-header",aE="header",lE="area",Sh="focus",mq="fill",pq="row",wq="column",vq="custom-selection",uE=t=>{const e=t.stylesHandler;if(e.isClassicTheme())return Object.freeze({width:6,height:6,borderWidth:1,borderStyle:"solid",borderColor:"#FFF"});const n=e.getCSSVariableValue("cell-autofill-size"),r=e.getCSSVariableValue("cell-autofill-border-width"),i=e.getCSSVariableValue("cell-autofill-border-color");return Object.freeze({width:n,height:n,borderWidth:r,borderStyle:"solid",borderColor:i})};var QO={},ex;function Cq(){if(ex)return QO;ex=1;var t=up();return t("flat"),QO}Cq();function yq(t,e){VD(t,e),e.add(t)}function tx(t,e,n){VD(t,e),e.set(t,n)}function VD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function kt(t,e){return t.get(bh(t,e))}function nx(t,e,n){return t.set(bh(t,e),n),n}function bh(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var ui=new WeakMap,On=new WeakMap,Zd=new WeakSet;class Sq{constructor(){yq(this,Zd),tx(this,ui,void 0),tx(this,On,void 0)}setActiveOverlay(e){return nx(On,this,e),this}setActiveSelection(e){return nx(ui,this,e),this}scan(){const e=kt(ui,this).settings.selectionType,n=new Set;return e==="active-header"?(this.scanColumnsInHeadersRange(r=>n.add(r)),this.scanRowsInHeadersRange(r=>n.add(r))):e==="area"?this.scanCellsRange(r=>n.add(r)):e==="focus"?(this.scanColumnsInHeadersRange(r=>n.add(r)),this.scanRowsInHeadersRange(r=>n.add(r)),this.scanCellsRange(r=>n.add(r))):e==="fill"?this.scanCellsRange(r=>n.add(r)):e==="header"?(this.scanColumnsInHeadersRange(r=>n.add(r)),this.scanRowsInHeadersRange(r=>n.add(r))):e==="row"?(this.scanRowsInHeadersRange(r=>n.add(r)),this.scanRowsInCellsRange(r=>n.add(r))):e==="column"&&(this.scanColumnsInHeadersRange(r=>n.add(r)),this.scanColumnsInCellsRange(r=>n.add(r))),n}scanColumnsInHeadersRange(e){const[n,r,i,o]=kt(ui,this).getCorners(),{wtTable:s}=kt(On,this),a=s.getRenderedColumnsCount(),l=s.getColumnHeadersCount();let u=0;for(let c=-s.getRowHeadersCount();c<a;c++){const h=s.columnFilter.renderedToSource(c);if(!(h<r||h>o)){for(let d=-l;d<0;d++){if(d<n||d>i)continue;const f=d+l;let m=s.getColumnHeader(h,f);const C=kt(On,this).getSetting("onBeforeHighlightingColumnHeader",h,f,{selectionType:kt(ui,this).settings.selectionType,columnCursor:u,selectionWidth:o-r+1});C!==null&&(C!==h&&(m=s.getColumnHeader(C,f)),e(m))}u+=1}}}scanRowsInHeadersRange(e){const[n,r,i,o]=kt(ui,this).getCorners(),{wtTable:s}=kt(On,this),a=s.getRenderedRowsCount(),l=s.getRowHeadersCount();let u=0;for(let c=-s.getColumnHeadersCount();c<a;c++){const h=s.rowFilter.renderedToSource(c);if(!(h<n||h>i)){for(let d=-l;d<0;d++){if(d<r||d>o)continue;const f=d+l;let m=s.getRowHeader(h,f);const C=kt(On,this).getSetting("onBeforeHighlightingRowHeader",h,f,{selectionType:kt(ui,this).settings.selectionType,rowCursor:u,selectionHeight:i-n+1});C!==null&&(C!==h&&(m=s.getRowHeader(C,f)),e(m))}u+=1}}}scanCellsRange(e){const{wtTable:n}=kt(On,this);bh(Zd,this,bq).call(this,(r,i)=>{const o=n.getCell(kt(On,this).createCellCoords(r,i)),s=kt(On,this).getSetting("onAfterDrawSelection",r,i,kt(ui,this).settings.layerLevel);typeof s=="string"&&X(o,s),e(o)})}scanRowsInCellsRange(e){const[n,,r]=kt(ui,this).getCorners(),{wtTable:i}=kt(On,this);bh(Zd,this,rx).call(this,(o,s)=>{if(o>=n&&o<=r){const a=i.getCell(kt(On,this).createCellCoords(o,s));e(a)}})}scanColumnsInCellsRange(e){const[,n,,r]=kt(ui,this).getCorners(),{wtTable:i}=kt(On,this);bh(Zd,this,rx).call(this,(o,s)=>{if(s>=n&&s<=r){const a=i.getCell(kt(On,this).createCellCoords(o,s));e(a)}})}}function bq(t){let[e,n,r,i]=kt(ui,this).getCorners();if(e<0&&r<0||n<0&&i<0)return;const{wtTable:o}=kt(On,this),s=e!==r||n!==i;if(n=Math.max(n,0),i=Math.max(i,0),e=Math.max(e,0),r=Math.max(r,0),s){if(n=Math.max(n,o.getFirstRenderedColumn()),i=Math.min(i,o.getLastRenderedColumn()),e=Math.max(e,o.getFirstRenderedRow()),r=Math.min(r,o.getLastRenderedRow()),i<n||r<e)return}else{const a=o.getCell(kt(On,this).createCellCoords(e,n));if(!ts(a))return}for(let a=e;a<=r;a+=1)for(let l=n;l<=i;l+=1)t(a,l)}function rx(t){const{wtTable:e}=kt(On,this),n=e.getRenderedRowsCount(),r=e.getRenderedColumnsCount();for(let i=0;i<n;i+=1){const o=e.rowFilter.renderedToSource(i);for(let s=0;s<r;s+=1)t(o,e.columnFilter.renderedToSource(s))}}class ix{constructor(e,n){n&&(this.eventManager=e.eventManager,this.instance=e,this.wot=e,this.settings=n,this.mouseDown=!1,this.main=null,this.top=null,this.bottom=null,this.start=null,this.end=null,this.topStyle=null,this.bottomStyle=null,this.startStyle=null,this.endStyle=null,this.cornerDefaultStyle=uE(this.instance),this.cornerCenterPointOffset=-Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),this.corner=null,this.cornerStyle=null,this.createBorders(n),this.registerListeners())}registerListeners(){const e=this.wot.rootDocument.body;this.eventManager.addEventListener(e,"mousedown",()=>this.onMouseDown()),this.eventManager.addEventListener(e,"mouseup",()=>this.onMouseUp());for(let n=0,r=this.main.childNodes.length;n<r;n++){const i=this.main.childNodes[n];this.eventManager.addEventListener(i,"mouseenter",o=>this.onMouseEnter(o,this.main.childNodes[n]))}}onMouseDown(){this.mouseDown=!0}onMouseUp(){this.mouseDown=!1}onMouseEnter(e,n){if(!this.mouseDown||!this.wot.getSetting("hideBorderOnMouseDownOver"))return;e.preventDefault(),Pi(e);const r=this,i=this.wot.rootDocument.body,o=n.getBoundingClientRect();n.style.display="none";function s(l){if(l.clientY<Math.floor(o.top)||l.clientY>Math.ceil(o.top+o.height)||l.clientX<Math.floor(o.left)||l.clientX>Math.ceil(o.left+o.width))return!0}function a(l){s(l)&&(r.eventManager.removeEventListener(i,"mousemove",a),n.style.display="block")}this.eventManager.addEventListener(i,"mousemove",a)}createBorders(e){const{rootDocument:n}=this.wot;this.main=n.createElement("div");const r=["top","start","bottom","end","corner"];let i=this.main.style;i.position="absolute",i.top=0,i.left=0;for(let a=0;a<5;a++){const l=r[a],u=n.createElement("div");u.className=`wtBorder ${this.settings.className||""}`,this.settings[l]&&this.settings[l].hide&&(u.className+=" hidden"),i=u.style,i.backgroundColor=this.settings[l]&&this.settings[l].color?this.settings[l].color:e.border.color,i.height=this.settings[l]&&this.settings[l].width?`${this.settings[l].width}px`:`${e.border.width}px`,i.width=this.settings[l]&&this.settings[l].width?`${this.settings[l].width}px`:`${e.border.width}px`,this.main.appendChild(u)}this.top=this.main.childNodes[0],this.start=this.main.childNodes[1],this.bottom=this.main.childNodes[2],this.end=this.main.childNodes[3],this.topStyle=this.top.style,this.startStyle=this.start.style,this.bottomStyle=this.bottom.style,this.endStyle=this.end.style,this.corner=this.main.childNodes[4],this.corner.className+=" corner",this.cornerStyle=this.corner.style,this.cornerStyle.width=`${this.cornerDefaultStyle.width}px`,this.cornerStyle.height=`${this.cornerDefaultStyle.height}px`,this.cornerStyle.border=[`${this.cornerDefaultStyle.borderWidth}px`,this.cornerDefaultStyle.borderStyle,this.cornerDefaultStyle.borderColor].join(" "),qo()&&this.instance.getSetting("isDataViewInstance")&&this.createMultipleSelectorHandles(),this.disappear();const{wtTable:o}=this.wot;let s=o.bordersHolder;s||(s=n.createElement("div"),s.className="htBorders",o.bordersHolder=s,o.spreader.appendChild(s)),s.appendChild(this.main)}createMultipleSelectorHandles(){const{rootDocument:e,stylesHandler:n}=this.wot,r=n.getCSSVariableValue("cell-mobile-handle-size"),i=n.getCSSVariableValue("cell-mobile-handle-border-radius"),o=n.getCSSVariableValue("cell-mobile-handle-background-color"),s=n.getCSSVariableValue("cell-mobile-handle-border-width"),a=n.getCSSVariableValue("cell-mobile-handle-border-color");this.selectionHandles={top:e.createElement("DIV"),topHitArea:e.createElement("DIV"),bottom:e.createElement("DIV"),bottomHitArea:e.createElement("DIV")};const l=10,u=40;this.selectionHandles.top.className="topSelectionHandle topLeftSelectionHandle",this.selectionHandles.topHitArea.className="topSelectionHandle-HitArea topLeftSelectionHandle-HitArea",this.selectionHandles.bottom.className="bottomSelectionHandle bottomRightSelectionHandle",this.selectionHandles.bottomHitArea.className="bottomSelectionHandle-HitArea bottomRightSelectionHandle-HitArea",this.selectionHandles.styles={top:this.selectionHandles.top.style,topHitArea:this.selectionHandles.topHitArea.style,bottom:this.selectionHandles.bottom.style,bottomHitArea:this.selectionHandles.bottomHitArea.style};const c={position:"absolute",height:`${u}px`,width:`${u}px`,"border-radius":`${parseInt(u/1.5,10)}px`};ke(c,(d,f)=>{this.selectionHandles.styles.bottomHitArea[f]=d,this.selectionHandles.styles.topHitArea[f]=d});const h=n.isClassicTheme()?{position:"absolute",height:`${l}px`,width:`${l}px`,"border-radius":`${parseInt(l/1.5,10)}px`,background:"#F5F5FF",border:"1px solid #4285c8"}:{position:"absolute",height:`${r}px`,width:`${r}px`,"border-radius":`${i}px`,background:`${o}`,border:`${s}px solid ${a}`};ke(h,(d,f)=>{this.selectionHandles.styles.bottom[f]=d,this.selectionHandles.styles.top[f]=d}),this.main.appendChild(this.selectionHandles.top),this.main.appendChild(this.selectionHandles.bottom),this.main.appendChild(this.selectionHandles.topHitArea),this.main.appendChild(this.selectionHandles.bottomHitArea)}isPartRange(e,n){const r=this.wot.selectionManager.getAreaSelection();return!!(r.cellRange&&(e!==r.cellRange.to.row||n!==r.cellRange.to.col))}updateMultipleSelectionHandlesPosition(e,n,r,i,o,s){const l=this.wot.wtSettings.getSetting("rtlMode")?"right":"left",{top:u,topHitArea:c,bottom:h,bottomHitArea:d}=this.selectionHandles.styles,f=parseInt(u.borderWidth,10),m=parseInt(u.width,10),C=parseInt(c.width,10),y=this.wot.wtTable.getWidth(),E=this.wot.wtTable.getHeight();u.top=`${parseInt(r-m-1,10)}px`,u[l]=`${parseInt(i-m-1,10)}px`,c.top=`${parseInt(r-C/4*3,10)}px`,c[l]=`${parseInt(i-C/4*3,10)}px`;const v=Math.min(parseInt(i+o,10),y-m-f*2),O=Math.min(parseInt(i+o-C/4,10),y-C-f*2);h[l]=`${v}px`,d[l]=`${O}px`;const x=Math.min(parseInt(r+s,10),E-m-f*2),F=Math.min(parseInt(r+s-C/4,10),E-C-f*2);h.top=`${x}px`,d.top=`${F}px`,this.settings.border.cornerVisible&&this.settings.border.cornerVisible()?(u.display="block",c.display="block",this.isPartRange(e,n)?(h.display="none",d.display="none"):(h.display="block",d.display="block")):(u.display="none",h.display="none",c.display="none",d.display="none"),e===this.wot.wtSettings.getSetting("fixedRowsTop")||n===this.wot.wtSettings.getSetting("fixedColumnsStart")?(u.zIndex="9999",c.zIndex="9999"):(u.zIndex="",c.zIndex="")}appear(e){if(this.disabled)return;let[n,r,i,o]=e;if(n<0&&i<0||r<0&&o<0){this.disappear();return}const{wtTable:s,rootDocument:a,rootWindow:l}=this.wot,u=n!==i||r!==o,c=s.getFirstRenderedRow(),h=s.getLastRenderedRow(),d=s.getFirstRenderedColumn(),f=s.getLastRenderedColumn();if(d<0&&f<0||c<0&&h<0){this.disappear();return}let m;if(u){if(r=Math.max(r,d),o=Math.min(o,f),n=Math.max(n,c),i=Math.min(i,h),o<r||i<n){this.disappear();return}m=s.getCell(this.wot.createCellCoords(n,r))}else if(m=s.getCell(this.wot.createCellCoords(n,r)),!ts(m)){this.disappear();return}const C=u?s.getCell(this.wot.createCellCoords(i,o)):m,y=Nn(m),E=u?Nn(C):y,v=Nn(s.TABLE),O=y.top,x=y.left,F=this.wot.wtSettings.getSetting("rtlMode");let I=0,_=0;if(F){const ve=Xt(s.TABLE),Oe=Xt(m),it=l.innerWidth-v.left-ve;_=x+Oe-E.left,I=l.innerWidth-x-Oe-it-1}else _=E.left+Xt(C)-x,I=x-v.left-1;if(this.isEntireColumnSelected(n,i)){const ve=n,Oe=this.getDimensionsFromHeader("columns",r,o,ve,v);let it=null;Oe&&([it,I,_]=Oe),it&&(m=it)}let q=O-v.top-1,G=E.top+an(C)-O;if(this.isEntireRowSelected(r,o)){const ve=r,Oe=this.getDimensionsFromHeader("rows",n,i,ve,v);let it=null;Oe&&([it,q,G]=Oe),it&&(m=it)}const U=l.getComputedStyle(m);parseInt(U.borderTopWidth,10)>0&&(q+=1,G=G>0?G-1:0),parseInt(U[F?"borderRightWidth":"borderLeftWidth"],10)>0&&(I+=1,_=_>0?_-1:0);const J=F?"right":"left";this.topStyle.top=`${q}px`,this.topStyle[J]=`${I}px`,this.topStyle.width=`${_}px`,this.topStyle.display="block",this.startStyle.top=`${q}px`,this.startStyle[J]=`${I}px`,this.startStyle.height=`${G}px`,this.startStyle.display="block";const te=Math.floor(this.settings.border.width/2);this.bottomStyle.top=`${q+G-te}px`,this.bottomStyle[J]=`${I}px`,this.bottomStyle.width=`${_}px`,this.bottomStyle.display="block",this.endStyle.top=`${q}px`,this.endStyle[J]=`${I+_-te}px`,this.endStyle.height=`${G+1}px`,this.endStyle.display="block";let le=this.settings.border.cornerVisible;le=typeof le=="function"?le(this.settings.layerLevel):le;const ne=this.wot.getSetting("onModifyGetCellCoords",i,o,!1,"render");let[se,Ge]=[i,o];if(ne&&Array.isArray(ne)&&([,,se,Ge]=ne),qo()||!le||this.isPartRange(se,Ge))this.cornerStyle.display="none";else{this.cornerStyle.top=`${q+G+this.cornerCenterPointOffset-this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle[J]=`${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 ve=zh(s.TABLE);const Oe=ve===l;Oe&&(ve=a.documentElement);const it=parseInt(this.cornerDefaultStyle.borderWidth,10)-1,Le=Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),P=Math.ceil(parseInt(this.cornerDefaultStyle.height,10)/2);if(o===this.wot.getSetting("totalColumns")-1){const g=Oe?C.getBoundingClientRect().left:C.offsetLeft;let w=!1,p=0;F?(p=g-parseInt(this.cornerDefaultStyle.width,10)/2,w=p<0):(p=g+Xt(C)+parseInt(this.cornerDefaultStyle.width,10)/2,w=p>=nD(ve)),w&&(this.cornerStyle[J]=`${Math.floor(I+_+this.cornerCenterPointOffset-Le-it)}px`,this.cornerStyle[F?"borderLeftWidth":"borderRightWidth"]=0)}if(i===this.wot.getSetting("totalRows")-1){const p=(Oe?C.getBoundingClientRect().top:C.offsetTop)+an(C)+parseInt(this.cornerDefaultStyle.height,10)/2>=yh(ve),T=this.wot.stylesHandler.isClassicTheme();if(p){const M=Math.floor(q+G+this.cornerCenterPointOffset-P-it);T?(this.cornerStyle.top=`${M}px`,this.cornerStyle.borderBottomWidth=0):this.cornerStyle.top=`${M-1}px`}}this.cornerStyle.display="block"}qo()&&this.instance.getSetting("isDataViewInstance")&&this.updateMultipleSelectionHandlesPosition(i,o,q,I,_,G)}isEntireColumnSelected(e,n){return e===this.wot.wtTable.getFirstRenderedRow()&&n===this.wot.wtTable.getLastRenderedRow()}isEntireRowSelected(e,n){return e===this.wot.wtTable.getFirstRenderedColumn()&&n===this.wot.wtTable.getLastRenderedColumn()}getDimensionsFromHeader(e,n,r,i,o){const{wtTable:s}=this.wot,a=s.wtRootElement.parentNode;let l=null,u=null,c=null,h=null,d=null,f=null,m=null,C=null;switch(e){case"rows":l=function(){return s.getRowHeader(...arguments)},u=function(){return an(...arguments)},c="ht__selection--rows",f="top";break;case"columns":l=function(){return s.getColumnHeader(...arguments)},u=function(){return Xt(...arguments)},c="ht__selection--columns",f="left";break}if(a.classList.contains(c)){const y=this.wot.getSetting("columnHeaders").length;if(m=l(n,y-i),C=l(r,y-i),!m||!C)return!1;const E=Nn(m),v=Nn(C);return m&&C&&(h=E[f]-o[f]-1,d=v[f]+u(C)-E[f]),[m,h,d]}return!1}changeBorderStyle(e,n){const r=this[e].style,i=n[e];!i||i.hide?X(this[e],"hidden"):(ye(this[e],"hidden")&&we(this[e],"hidden"),r.backgroundColor=i.color,(e==="top"||e==="bottom")&&(r.height=`${i.width}px`),(e==="start"||e==="end")&&(r.width=`${i.width}px`))}changeBorderToDefaultStyle(e){const n={width:1,color:"#000"},r=this[e].style;r.backgroundColor=n.color,r.width=`${n.width}px`,r.height=`${n.width}px`}toggleHiddenClass(e,n){this.changeBorderToDefaultStyle(e),n?X(this[e],"hidden"):we(this[e],"hidden")}disappear(){this.topStyle.display="none",this.bottomStyle.display="none",this.startStyle.display="none",this.endStyle.display="none",this.cornerStyle.display="none",qo()&&this.instance.getSetting("isDataViewInstance")&&(this.selectionHandles.styles.top.display="none",this.selectionHandles.styles.topHitArea.display="none",this.selectionHandles.styles.bottom.display="none",this.selectionHandles.styles.bottomHitArea.display="none")}destroy(){this.eventManager.destroyWithOwnEventsOnly(),this.main.parentNode.removeChild(this.main)}}function Rq(t,e){WD(t,e),e.add(t)}function Hl(t,e,n){WD(t,e),e.set(t,n)}function WD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function He(t,e){return t.get(cE(t,e))}function ox(t,e,n){return t.set(cE(t,e),n),n}function cE(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var xn=new WeakMap,ur=new WeakMap,ey=new WeakMap,hh=new WeakMap,ty=new WeakMap,la=new WeakMap,sx=new WeakSet;class Eq{constructor(e){Rq(this,sx),Hl(this,xn,void 0),Hl(this,ur,void 0),Hl(this,ey,new Sq),Hl(this,hh,new WeakMap),Hl(this,ty,new WeakSet),Hl(this,la,new Map),ox(ur,this,e)}setActiveOverlay(e){return ox(xn,this,e),He(ey,this).setActiveOverlay(He(xn,this)),He(hh,this).has(He(xn,this))||He(hh,this).set(He(xn,this),new Set),this}getFocusSelection(){return He(ur,this)!==null?He(ur,this).getFocus():null}getAreaSelection(){return He(ur,this)!==null?He(ur,this).createLayeredArea():null}getBorderInstance(e){if(!e.settings.border)return null;if(He(la,this).has(e)){const r=He(la,this).get(e);if(r.has(He(xn,this)))return r.get(He(xn,this));const i=new ix(He(xn,this),e.settings);return r.set(He(xn,this),i),i}const n=new ix(He(xn,this),e.settings);return He(la,this).set(e,new Map([[He(xn,this),n]])),n}getBorderInstances(e){var n,r;return Array.from((n=(r=He(la,this).get(e))===null||r===void 0?void 0:r.values())!==null&&n!==void 0?n:[])}destroyBorders(e){He(la,this).get(e).forEach(n=>n.destroy()),He(la,this).delete(e)}render(e){if(He(ur,this)===null)return;e&&cE(sx,this,Tq).call(this);const n=Array.from(He(ur,this)),r=new Map,i=new Map;for(let o=0;o<n.length;o++){const s=n[o],{className:a,headerAttributes:l,createLayers:u,selectionType:c}=s.settings;He(ty,this).has(s)||(He(ty,this).add(s),s.addLocalHook("destroy",()=>this.destroyBorders(s)));const h=this.getBorderInstance(s);if(s.isEmpty()){h==null||h.disappear();continue}a&&He(ey,this).setActiveSelection(s).scan().forEach(m=>{if(r.has(m)){const C=r.get(m);C.has(a)&&u===!0?C.set(a,C.get(a)+1):C.set(a,1)}else r.set(m,new Map([[a,1]]));l&&(i.has(m)||i.set(m,[]),m.nodeName==="TH"&&i.get(m).push(...l))});const d=s.getCorners();He(xn,this).getSetting("onBeforeDrawBorders",d,c),h==null||h.appear(d)}r.forEach((o,s)=>{var a;const l=Array.from(o).map(u=>{let[c,h]=u;return h===1?c:[c,...Array.from({length:h-1},(d,f)=>`${c}-${f+1}`)]}).flat();l.forEach(u=>He(hh,this).get(He(xn,this)).add(u)),X(s,l),s.nodeName==="TD"&&Array.isArray((a=He(ur,this).options)===null||a===void 0?void 0:a.cellAttributes)&&Re(s,He(ur,this).options.cellAttributes)}),Array.from(i.keys()).forEach(o=>{Re(o,[...i.get(o)])})}}function Tq(){const t=He(hh,this).get(He(xn,this)),e=He(xn,this).wtSettings.getSetting("onBeforeRemoveCellClassNames");if(Array.isArray(e))for(let n=0;n<e.length;n++)t.add(e[n]);t.forEach(n=>{var r,i;const o=He(xn,this).wtTable.TABLE.querySelectorAll(`.${n}`);let s=[];Array.isArray((r=He(ur,this).options)===null||r===void 0?void 0:r.cellAttributes)&&(s=He(ur,this).options.cellAttributes.map(a=>a[0])),Array.isArray((i=He(ur,this).options)===null||i===void 0?void 0:i.headerAttributes)&&(s=[...s,...He(ur,this).options.headerAttributes.map(a=>a[0])]);for(let a=0,l=o.length;a<l;a++)we(o[a],n),Zu(o[a],s)}),t.clear()}class _q extends Ed{constructor(e,n,r,i){super(e,n,hl,r,i)}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new sE(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){const{wtTable:e}=this.wot;if(!this.needFullRender||!this.shouldBeRendered()||!e.holder.parentNode)return!1;const{rootWindow:n}=this.domBindings,r=this.clone.wtTable.holder.parentNode,i=this.wtSettings.getSetting("preventOverflow");let o=0;this.trimmingContainer===n&&(!i||i!=="horizontal")?(o=this.getOverlayOffset()*(this.isRtl()?-1:1),GR(r,`${o}px`,"0px")):(o=this.getScrollPosition(),sp(r));const s=this.adjustHeaderBordersPosition(o);return this.adjustElementsSize(),s}setScrollPosition(e){const{rootWindow:n}=this.domBindings;let r=!1;this.isRtl()&&(e=-e);const i=this.mainTableScrollableElement;if(i===n&&e!==n.scrollX){const o=n.scrollX;n.scrollTo(e,eD(n)),r=o!==n.scrollX}else if(e!==i.scrollLeft){const o=i.scrollLeft;i.scrollLeft=e,r=o!==i.scrollLeft}return r}onScroll(){this.wtSettings.getSetting("onScrollVertically")}sumCellSizes(e,n){const r=this.wtSettings.getSetting("defaultColumnWidth");let i=e,o=0;for(;i<n;)o+=this.wot.wtTable.getColumnWidth(i)||r,i+=1;return o}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="vertical"){let u=n.getWorkspaceHeight();n.hasHorizontalScroll()&&(u-=yn(r)),u=Math.min(u,e.wtRootElement.scrollHeight),s.height=`${u}px`}else s.height="";this.clone.wtTable.holder.style.height=s.height;const l=Xt(this.clone.wtTable.TABLE);s.width=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,n=uE(this.wot),r=this.wot.selectionManager.getFocusSelection()?parseInt(n.width,10)/2:0;this.clone.wtTable.hider.style.height=this.hider.style.height,e.style.height=e.parentNode.style.height,e.style.width=`${parseInt(e.parentNode.style.width,10)+r}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalColumns"),n=this.isRtl()?"right":"left";if(typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number")this.spreader.style[n]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style[n]="0";else throw new Error("Incorrect value of the columnsRenderCalculator");this.isRtl()?this.spreader.style.left="":this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number"?this.clone.wtTable.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`:this.clone.wtTable.spreader.style.top=""}scrollTo(e,n){const{wtSettings:r}=this,i=r.getSetting("rowHeaders"),o=r.getSetting("fixedColumnsStart"),a=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder,l=o===0&&i.length>0&&!ye(a.parentNode,"innerBorderInlineStart")?1:0;let u=this.getTableParentOffset(),c=0;if(n){const h=this.wot.wtTable.getColumnWidth(e),d=this.wot.wtViewport.getViewportWidth();h>d&&(n=!1)}return n&&a.offsetWidth!==a.clientWidth&&(c=yn(this.domBindings.rootDocument)),n?(u+=this.sumCellSizes(0,e+1),u-=this.wot.wtViewport.getViewportWidth(),u+=l):u+=this.sumCellSizes(this.wtSettings.getSetting("fixedColumnsStart"),e),u+=c,Oz(this.mainTableScrollableElement)===u-l&&l>0&&this.wot.wtOverlays.expandHiderHorizontallyBy(l),this.setScrollPosition(u)}getTableParentOffset(){const e=this.wtSettings.getSetting("preventOverflow");let n=0;return!e&&this.trimmingContainer===this.domBindings.rootWindow&&(n=this.wot.wtTable.holderOffset.left),n}getScrollPosition(){return Math.abs(tD(this.mainTableScrollableElement,this.domBindings.rootWindow))}getOverlayOffset(){const{rootWindow:e}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let r=0;if(this.trimmingContainer===e&&(!n||n!=="horizontal")){this.isRtl()?r=Math.abs(Math.min(this.getTableParentOffset()-this.getScrollPosition(),0)):r=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0);const i=this.wot.wtTable.getTotalWidth(),o=this.clone.wtTable.getTotalWidth(),s=i-o;r>s&&(r=0)}return r}adjustHeaderBordersPosition(e){const{wtSettings:n}=this,r=this.wot.wtTable.holder.parentNode,i=n.getSetting("rowHeaders"),o=n.getSetting("fixedColumnsStart"),s=n.getSetting("totalRows"),a=n.getSetting("preventOverflow")==="vertical";s?we(r,"emptyRows"):X(r,"emptyRows");let l=!1;if(!a){if(o&&!i.length)X(r,"innerBorderLeft innerBorderInlineStart");else if(!o&&i.length){const u=ye(r,"innerBorderInlineStart");e?(X(r,"innerBorderLeft innerBorderInlineStart"),l=!u):(we(r,"innerBorderLeft innerBorderInlineStart"),l=u)}}return l}}const Mq="stickyRowsTop",hE={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}};us(hE,"MIXIN_NAME",Mq,{writable:!1,enumerable:!1});class dE extends Qu{constructor(e,n,r,i){super(e,n,r,i,dl)}}gt(dE,hE);gt(dE,hp);function ax(t,e,n){return(e=Iq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Iq(t){var e=Pq(t,"string");return typeof e=="symbol"?e:e+""}function Pq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Oq extends Ed{constructor(e,n,r,i,o,s){super(e,n,dl,r,i),ax(this,"topOverlay",void 0),ax(this,"inlineStartOverlay",void 0),this.topOverlay=o,this.inlineStartOverlay=s}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new dE(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderTopOverlay")&&this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){if(this.updateTrimmingContainer(),!this.wot.wtTable.holder.parentNode)return!1;const e=this.clone.wtTable.holder.parentNode;if(this.trimmingContainer===this.domBindings.rootWindow){const i=this.inlineStartOverlay.getOverlayOffset()*(this.isRtl()?-1:1),o=this.topOverlay.getOverlayOffset();GR(e,`${i}px`,`${o}px`)}else sp(e);let n=an(this.clone.wtTable.TABLE);const r=Xt(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(n=0),e.style.height=`${n}px`,e.style.width=`${r}px`,!1}}class fE extends Qu{constructor(e,n,r,i){super(e,n,r,i,cl)}}gt(fE,hE);gt(fE,dp);function xq(t,e,n){return(e=Aq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Aq(t){var e=Hq(t,"string");return typeof e=="symbol"?e:e+""}function Hq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Nq extends Ed{constructor(e,n,r,i){super(e,n,cl,r,i),xq(this,"cachedFixedRowsTop",-1),this.cachedFixedRowsTop=this.wtSettings.getSetting("fixedRowsTop")}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new fE(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderTopOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.shouldBeRendered()||!this.wot.wtTable.holder.parentNode)return!1;const e=this.clone.wtTable.holder.parentNode,{rootWindow:n}=this.domBindings,r=this.wtSettings.getSetting("preventOverflow");let i=0,o=!1;if(this.trimmingContainer===n&&(!r||r!=="vertical")){const{wtTable:a}=this.wot,l=a.hider.getBoundingClientRect(),u=Math.ceil(l.bottom),c=e.offsetHeight;o=u===c,i=this.getOverlayOffset(),GR(e,"0px",`${i}px`)}else i=this.getScrollPosition(),sp(e);const s=this.adjustHeaderBordersPosition(i,o);return this.adjustElementsSize(),s}setScrollPosition(e){const{rootWindow:n}=this.domBindings,r=this.mainTableScrollableElement;let i=!1;if(r===n&&e!==n.scrollY){const o=n.scrollY;n.scrollTo(zR(n),e),i=o!==n.scrollY}else if(e!==r.scrollTop){const o=r.scrollTop;r.scrollTop=e,i=o!==r.scrollTop}return i}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,n){const r=this.wot.stylesHandler.getDefaultRowHeight();let i=e,o=0;for(;i<n;){const s=this.wot.wtTable.getRowHeight(i);o+=s===void 0?r:s,i+=1}return o}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="horizontal"){let u=n.getWorkspaceWidth();n.hasVerticalScroll()&&(u-=yn(r)),u=Math.min(u,e.wtRootElement.scrollWidth),s.width=`${u}px`}else s.width="";this.clone.wtTable.holder.style.width=s.width;let l=an(this.clone.wtTable.TABLE);e.hasDefinedSize()||(l=0),s.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,n=uE(this.wot),r=this.wot.selectionManager.getFocusSelection()?parseInt(n.height,10)/2:0;this.clone.wtTable.hider.style.width=this.hider.style.width,e.style.width=e.parentNode.style.width,e.style.height=`${parseInt(e.parentNode.style.height,10)+r}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");if(typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number")this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style.top="0";else throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){const e=this.isRtl()?"right":"left",{spreader:n}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?n.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:n.style[e]=""}scrollTo(e,n){const{wot:r,wtSettings:i}=this,s=(r.cloneSource?r.cloneSource:r).wtTable.holder,a=i.getSetting("columnHeaders"),u=i.getSetting("fixedRowsTop")===0&&a.length>0&&!ye(s.parentNode,"innerBorderTop")?1:0;let c=this.getTableParentOffset(),h=0;if(n){const d=this.wot.wtTable.getRowHeight(e),f=this.wot.wtViewport.getViewportHeight();d>f&&(n=!1)}if(n&&s.offsetHeight!==s.clientHeight&&(h=yn(this.domBindings.rootDocument)),n){const d=i.getSetting("fixedRowsBottom"),f=i.getSetting("totalRows");c+=this.sumCellSizes(0,e+1),c-=r.wtViewport.getViewportHeight()-this.sumCellSizes(f-d,f),c+=1,c+=u}else c+=this.sumCellSizes(i.getSetting("fixedRowsTop"),e);return c+=h,Pz(this.mainTableScrollableElement)===c-u&&u>0&&this.wot.wtOverlays.expandHiderVerticallyBy(u),this.setScrollPosition(c)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return YR(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let r=0;if(this.trimmingContainer===e&&(!n||n!=="vertical")){const i=this.wot.wtTable.getTotalHeight(),o=this.clone.wtTable.getTotalHeight(),s=i-o;r=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0),r>s&&(r=0)}return r}adjustHeaderBordersPosition(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{wtSettings:r}=this,i=this.wot.wtTable.holder.parentNode,o=r.getSetting("totalColumns"),s=r.getSetting("preventOverflow")==="horizontal";o?we(i,"emptyColumns"):X(i,"emptyColumns");let a=!1;if(!n&&!s){const l=r.getSetting("fixedRowsTop"),u=this.cachedFixedRowsTop!==l,c=r.getSetting("columnHeaders");if((u||l===0)&&c.length>0){const h=ye(i,"innerBorderTop");this.cachedFixedRowsTop=r.getSetting("fixedRowsTop"),e||r.getSetting("totalRows")===0?(X(i,"innerBorderTop"),a=!h):(we(i,"innerBorderTop"),a=h)}}return a}}function Jd(t,e,n){Dq(t,e),e.set(t,n)}function Dq(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ro(t,e,n){return(e=kq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kq(t){var e=Lq(t,"string");return typeof e=="symbol"?e:e+""}function Lq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ua(t,e,n){return t.set(BD(t,e),n),n}function Eo(t,e){return t.get(BD(t,e))}function BD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Nl=new WeakMap,Qd=new WeakMap,Dl=new WeakMap,ef=new WeakMap;class $q{constructor(e,n,r,i,o,s){Ro(this,"wot",null),Jd(this,Nl,[]),Ro(this,"topOverlay",null),Ro(this,"bottomOverlay",null),Ro(this,"inlineStartOverlay",null),Ro(this,"topInlineStartCornerOverlay",null),Ro(this,"bottomInlineStartCornerOverlay",null),Ro(this,"browserLineHeight",void 0),Ro(this,"wtSettings",null),Jd(this,Qd,!1),Jd(this,Dl,0),Jd(this,ef,null),Ro(this,"resizeObserver",new ResizeObserver(c=>{Qg(()=>{!Array.isArray(c)||!c.length||(ua(Dl,this,Eo(Dl,this)+1),Eo(Dl,this)===100&&(tt("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()),Eo(ef,this)!==null&&clearTimeout(Eo(ef,this)),ua(ef,this,setTimeout(()=>{ua(Dl,this,0)},100)),this.wtSettings.getSetting("onContainerElementResize"))})})),this.wot=e,this.wtSettings=i,this.domBindings=r,this.facadeGetter=n,this.wtTable=s;const{rootDocument:a,rootWindow:l}=this.domBindings;this.instance=this.wot,this.eventManager=o,this.scrollbarSize=yn(a);const u=l.getComputedStyle(s.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden";this.scrollableElement=u?s.holder:Zg(s.TABLE),this.initOverlays(),this.destroyed=!1,this.keyPressed=!1,this.spreaderLastSize={width:null,height:null},this.verticalScrolling=!1,this.horizontalScrolling=!1,this.initBrowserLineHeight(),this.registerListeners(),this.lastScrollX=l.scrollX,this.lastScrollY=l.scrollY}getOverlays(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const n=[...Eo(Nl,this)];return e&&n.push(this.wtTable),n}initBrowserLineHeight(){const{rootWindow:e,rootDocument:n}=this.domBindings,r=e.getComputedStyle(n.body),i=parseInt(r.lineHeight,10),o=parseInt(r.fontSize,10)*1.2;this.browserLineHeight=i||o}initOverlays(){const e=[this.wot,this.facadeGetter,this.wtSettings,this.domBindings];this.topOverlay=new Nq(...e),this.bottomOverlay=new dq(...e),this.inlineStartOverlay=new _q(...e),this.topInlineStartCornerOverlay=new Oq(...e,this.topOverlay,this.inlineStartOverlay),this.bottomInlineStartCornerOverlay=new aq(...e,this.bottomOverlay,this.inlineStartOverlay),ua(Nl,this,[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay])}beforeDraw(){ua(Qd,this,Eo(Nl,this).reduce((e,n)=>n.hasRenderingStateChanged()||e,!1)),Eo(Nl,this).forEach(e=>e.updateStateOfRendering("before"))}afterDraw(){this.syncScrollWithMaster(),Eo(Nl,this).forEach(e=>{const n=e.hasRenderingStateChanged();e.updateStateOfRendering("after"),n&&!e.needFullRender&&e.reset()})}refreshAll(){if(this.wot.drawn){if(!this.wtTable.holder.parentNode){this.destroy();return}this.wot.draw(!0),this.verticalScrolling&&this.inlineStartOverlay.onScroll(),this.horizontalScrolling&&this.topOverlay.onScroll(),this.verticalScrolling=!1,this.horizontalScrolling=!1}}registerListeners(){const{rootDocument:e,rootWindow:n}=this.domBindings,{mainTableScrollableElement:r}=this.topOverlay,{mainTableScrollableElement:i}=this.inlineStartOverlay;this.eventManager.addEventListener(e.documentElement,"keydown",h=>this.onKeyDown(h)),this.eventManager.addEventListener(e.documentElement,"keyup",()=>this.onKeyUp()),this.eventManager.addEventListener(e,"visibilitychange",()=>this.onKeyUp()),this.eventManager.addEventListener(r,"scroll",h=>this.onTableScroll(h),{passive:!0}),r!==i&&this.eventManager.addEventListener(i,"scroll",h=>this.onTableScroll(h),{passive:!0});const o=n.devicePixelRatio&&n.devicePixelRatio>1,s=this.scrollableElement===n,a=this.wtSettings.getSetting("preventWheel"),l={passive:s};(a||o||!dD())&&this.eventManager.addEventListener(this.wtTable.wtRootElement,"wheel",h=>this.onCloneWheel(h,a),l),[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay].forEach(h=>{this.eventManager.addEventListener(h.clone.wtTable.holder,"wheel",d=>this.onCloneWheel(d,a),l)});let c;this.eventManager.addEventListener(n,"resize",()=>{Qg(()=>{clearTimeout(c),this.wtSettings.getSetting("onWindowResize"),c=setTimeout(()=>{ua(Dl,this,0)},200)})}),s||this.resizeObserver.observe(this.wtTable.wtRootElement.parentElement)}onTableScroll(e){const n=this.domBindings.rootWindow,r=this.inlineStartOverlay.mainTableScrollableElement,i=this.topOverlay.mainTableScrollableElement,o=e.target;this.keyPressed&&(i!==n&&o!==n&&!e.target.contains(i)||r!==n&&o!==n&&!e.target.contains(r))||this.syncScrollPositions(e)}onCloneWheel(e,n){const{rootWindow:r}=this.domBindings,i=this.inlineStartOverlay.mainTableScrollableElement,o=this.topOverlay.mainTableScrollableElement,s=e.target,a=o!==r&&s!==r&&!s.contains(o),l=i!==r&&s!==r&&!s.contains(i);if(this.keyPressed&&(a||l)||this.scrollableElement===r)return;const u=this.translateMouseWheelToScroll(e);(n||this.scrollableElement!==r&&u)&&e.preventDefault()}onKeyDown(e){this.keyPressed=Sd(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")}onKeyUp(){this.keyPressed=!1}translateMouseWheelToScroll(e){let n=isNaN(e.deltaY)?-1*e.wheelDeltaY:e.deltaY,r=isNaN(e.deltaX)?-1*e.wheelDeltaX:e.deltaX;e.deltaMode===1&&(r+=r*this.browserLineHeight,n+=n*this.browserLineHeight);const i=this.scrollVertically(n),o=this.scrollHorizontally(r);return i||o}scrollVertically(e){const n=this.scrollableElement.scrollTop;return this.scrollableElement.scrollTop+=e,n!==this.scrollableElement.scrollTop}scrollHorizontally(e){const n=this.scrollableElement.scrollLeft;return this.scrollableElement.scrollLeft+=e,n!==this.scrollableElement.scrollLeft}syncScrollPositions(){if(this.destroyed)return;const e=this.topOverlay.clone.wtTable.holder,n=this.inlineStartOverlay.clone.wtTable.holder;let r=this.scrollableElement.scrollLeft,i=this.scrollableElement.scrollTop;if(this.wot.wtViewport.isHorizontallyScrollableByWindow()&&(r=this.scrollableElement.scrollX),this.wot.wtViewport.isVerticallyScrollableByWindow()&&(i=this.scrollableElement.scrollY),this.horizontalScrolling=this.lastScrollX!==r,this.verticalScrolling=this.lastScrollY!==i,this.lastScrollX=r,this.lastScrollY=i,this.horizontalScrolling){e.scrollLeft=r;const o=this.bottomOverlay.needFullRender?this.bottomOverlay.clone.wtTable.holder:null;o&&(o.scrollLeft=r)}this.verticalScrolling&&(n.scrollTop=i),this.refreshAll()}syncScrollWithMaster(){if(!Eo(Qd,this))return;const e=this.topOverlay.mainTableScrollableElement,{scrollLeft:n,scrollTop:r}=e;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=n),this.bottomOverlay.needFullRender&&(this.bottomOverlay.clone.wtTable.holder.scrollLeft=n),this.inlineStartOverlay.needFullRender&&(this.inlineStartOverlay.clone.wtTable.holder.scrollTop=r),ua(Qd,this,!1)}updateMainScrollableElements(){this.eventManager.clearEvents(!0),this.inlineStartOverlay.updateMainScrollableElement(),this.topOverlay.updateMainScrollableElement(),this.bottomOverlay.needFullRender&&this.bottomOverlay.updateMainScrollableElement();const{wtTable:e}=this,{rootWindow:n}=this.domBindings;n.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden"?this.scrollableElement=e.holder:this.scrollableElement=Zg(e.TABLE),this.registerListeners()}destroy(){this.resizeObserver.disconnect(),this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.inlineStartOverlay.destroy(),this.topInlineStartCornerOverlay&&this.topInlineStartCornerOverlay.destroy(),this.bottomInlineStartCornerOverlay&&this.bottomInlineStartCornerOverlay.clone&&this.bottomInlineStartCornerOverlay.destroy(),this.destroyed=!0}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.updateLastSpreaderSize()&&this.adjustElementsSize(),this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.inlineStartOverlay.refresh(e),this.topOverlay.refresh(e),this.topInlineStartCornerOverlay&&this.topInlineStartCornerOverlay.refresh(e),this.bottomInlineStartCornerOverlay&&this.bottomInlineStartCornerOverlay.clone&&this.bottomInlineStartCornerOverlay.refresh(e)}updateLastSpreaderSize(){const e=this.wtTable.spreader,n=e.clientWidth,r=e.clientHeight,i=n!==this.spreaderLastSize.width||r!==this.spreaderLastSize.height;return i&&(this.spreaderLastSize.width=n,this.spreaderLastSize.height=r),i}adjustElementsSize(){const{wtViewport:e}=this.wot,{wtTable:n}=this,{rootWindow:r}=this.domBindings,i=this.scrollableElement===r,o=this.wtSettings.getSetting("totalColumns"),s=this.wtSettings.getSetting("totalRows"),a=e.getRowHeaderWidth(),u=e.getColumnHeaderHeight()+this.topOverlay.sumCellSizes(0,s)+1,c=a+this.inlineStartOverlay.sumCellSizes(0,o),d=n.hider.style,f=()=>i?!1:this.scrollableElement.scrollTop>Math.max(0,u-n.holder.clientHeight),m=()=>i?!1:this.scrollableElement.scrollLeft>Math.max(0,c-n.holder.clientWidth),C=f()?1:0,y=m()?1:0;d.width=`${c+y}px`,d.height=`${u+C}px`,this.topOverlay.adjustElementsSize(),this.inlineStartOverlay.adjustElementsSize(),this.bottomOverlay.adjustElementsSize()}expandHiderVerticallyBy(e){const{wtTable:n}=this;n.hider.style.height=`${parseInt(n.hider.style.height,10)+e}px`}expandHiderHorizontallyBy(e){const{wtTable:n}=this;n.hider.style.width=`${parseInt(n.hider.style.width,10)+e}px`}applyToDOM(){this.wtTable.isVisible()&&(this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.inlineStartOverlay.applyToDOM())}getParentOverlay(e){if(!e)return null;const n=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];let r=null;return H(n,i=>{i&&i.clone&&i.clone.wtTable.TABLE.contains(e)&&(r=i.clone)}),r}syncOverlayTableClassNames(){const e=this.wtTable.TABLE,n=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];H(n,r=>{r&&(r.clone.wtTable.TABLE.className=e.className)})}}function lx(t,e,n){return(e=Fq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fq(t){var e=Vq(t,"string");return typeof e=="symbol"?e:e+""}function Vq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Wq{constructor(e){lx(this,"settings",{}),lx(this,"defaults",Object.freeze(this.getDefaults())),ke(this.defaults,(n,r)=>{if(e[r]!==void 0)this.settings[r]=e[r];else{if(n===void 0)throw new Error(`A required setting "${r}" was not provided`);this.settings[r]=n}})}getDefaults(){return{facade:void 0,table:void 0,isDataViewInstance:!0,externalRowCalculator:!1,currentRowClassName:null,currentColumnClassName:null,preventOverflow(){return!1},preventWheel:!1,data:void 0,fixedColumnsStart:0,fixedRowsTop:0,fixedRowsBottom:0,shouldRenderInlineStartOverlay:()=>this.getSetting("fixedColumnsStart")>0||this.getSetting("rowHeaders").length>0,shouldRenderTopOverlay:()=>this.getSetting("fixedRowsTop")>0||this.getSetting("columnHeaders").length>0,shouldRenderBottomOverlay:()=>this.getSetting("fixedRowsBottom")>0,minSpareRows:0,rowHeaders(){return[]},columnHeaders(){return[]},totalRows:void 0,totalColumns:void 0,cellRenderer:(e,n,r)=>{const i=this.getSetting("data",e,n);al(r,i??"")},columnWidth(){},rowHeight(){},rowHeightByOverlayName(){},defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,viewportRowCalculatorOverride:null,viewportColumnCalculatorOverride:null,viewportRowRenderingThreshold:null,viewportColumnRenderingThreshold:null,onCellMouseDown:null,onCellContextMenu:null,onCellMouseOver:null,onCellMouseOut:null,onCellMouseUp:null,onCellDblClick:null,onCellCornerMouseDown:null,onCellCornerDblClick:null,beforeDraw:null,onDraw:null,onBeforeRemoveCellClassNames:null,onAfterDrawSelection:null,onBeforeDrawBorders:null,onBeforeViewportScrollHorizontally:e=>e,onBeforeViewportScrollVertically:e=>e,onScrollHorizontally:null,onScrollVertically:null,onBeforeTouchScroll:null,onAfterMomentumScroll:null,onModifyRowHeaderWidth:null,onModifyGetCellCoords:null,onModifyGetCoordsElement:null,onModifyGetCoords:null,onBeforeHighlightingRowHeader:e=>e,onBeforeHighlightingColumnHeader:e=>e,onWindowResize:null,onContainerElementResize:null,renderAllColumns:!1,renderAllRows:!1,groups:!1,rowHeaderWidth:null,columnHeaderHeight:null,headerClassName:null,rtlMode:!1,ariaTags:!0}}update(e,n){return n===void 0?ke(e,(r,i)=>{this.settings[i]=r}):this.settings[e]=n,this}getSetting(e,n,r,i,o){return typeof this.settings[e]=="function"?this.settings[e](n,r,i,o):n!==void 0&&Array.isArray(this.settings[e])?this.settings[e][n]:this.settings[e]}getSettingPure(e){return this.settings[e]}has(e){return!!this.settings[e]}}class gE extends Qu{constructor(e,n,r,i){super(e,n,r,i,"master")}alignOverlaysWithTrimmingContainer(){const e=zh(this.wtRootElement),{rootWindow:n}=this.domBindings;if(e===n)this.wtSettings.getSetting("preventOverflow")||(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible");else{const r=e.parentElement,i=Jg(e,"height",n),o=Jg(e,"overflow",n),s=this.holder.style,{scrollWidth:a,scrollHeight:l}=e;let u=e.offsetWidth,c=e.offsetHeight;if(r&&["auto","hidden","scroll"].includes(o)){const d=e.cloneNode(!1);d.style.overflow="auto",d.style.position="absolute",e.nextElementSibling?r.insertBefore(d,e.nextElementSibling):r.appendChild(d);const f=parseInt(n.getComputedStyle(d).height,10);r.removeChild(d),f===0&&(c=0)}c=Math.min(c,l),s.height=i==="auto"?"auto":`${c}px`,u=Math.min(u,a),s.width=`${u}px`,s.overflow="",this.hasTableHeight=s.height==="auto"?!0:c>0,this.hasTableWidth=u>0}this.isTableVisible=Du(this.TABLE)}markOversizedColumnHeaders(){const{wtSettings:e}=this,{wtViewport:n}=this.dataAccessObject,r="master",o=e.getSetting("columnHeaders").length;if(o&&!n.hasOversizedColumnHeadersMarked[r]){const a=e.getSetting("rowHeaders").length,l=this.getRenderedColumnsCount();for(let u=0;u<o;u++)for(let c=-1*a;c<l;c++)this.markIfOversizedColumnHeader(c);n.hasOversizedColumnHeadersMarked[r]=!0}}}gt(gE,oE);gt(gE,dp);class Bq{constructor(e,n,r,i,o){this.dataAccessObject=e,this.wot=e.wot,this.instance=this.wot,this.domBindings=n,this.wtSettings=r,this.wtTable=o,this.oversizedRows=[],this.oversizedColumnHeaders=[],this.hasOversizedColumnHeadersMarked={},this.clientHeight=0,this.rowHeaderWidth=NaN,this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,this.rowsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllRows")?new yG:new _G],["fullyVisible",()=>new cG],["partiallyVisible",()=>new PD]]),this.columnsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllColumns")?new wG:new RG],["fullyVisible",()=>new aG],["partiallyVisible",()=>new ID]]),this.eventManager=i,this.eventManager.addEventListener(this.domBindings.rootWindow,"resize",()=>{this.clientHeight=this.getWorkspaceHeight()})}getWorkspaceHeight(){const e=this.domBindings.rootDocument,n=this.dataAccessObject.topOverlayTrimmingContainer;let r=0;return n===this.domBindings.rootWindow?r=e.documentElement.clientHeight:r=an(n)>0&&n.clientHeight>0?n.clientHeight:1/0,r}getViewportHeight(){let e=this.getWorkspaceHeight();if(e===1/0)return e;const n=this.getColumnHeaderHeight();return n>0&&(e-=n),e}getWorkspaceWidth(){const{rootDocument:e,rootWindow:n}=this.domBindings,r=this.dataAccessObject.inlineStartOverlayTrimmingContainer;let i;if(r===n){const o=this.wtSettings.getSetting("totalColumns");i=this.wtTable.holder.offsetWidth,this.getRowHeaderWidth()+this.sumColumnWidths(0,o)>i&&(i=e.documentElement.clientWidth)}else i=r.clientWidth;return i}getViewportWidth(){const e=this.getWorkspaceWidth();if(e===1/0)return e;const n=this.getRowHeaderWidth();return n>0?e-n:e}hasVerticalScroll(){if(this.isVerticallyScrollableByWindow()){const o=this.domBindings.rootDocument.documentElement;return o.scrollHeight>o.clientHeight}const{holder:e,hider:n}=this.wtTable,r=e.clientHeight,i=n.offsetHeight;return r<i?!0:i>this.getWorkspaceHeight()}hasHorizontalScroll(){if(this.isVerticallyScrollableByWindow()){const o=this.domBindings.rootDocument.documentElement;return o.scrollWidth>o.clientWidth}const{holder:e,hider:n}=this.wtTable,r=e.clientWidth,i=n.offsetWidth;return r<i?!0:i>this.getWorkspaceWidth()}isVerticallyScrollableByWindow(){return this.dataAccessObject.topOverlayTrimmingContainer===this.domBindings.rootWindow}isHorizontallyScrollableByWindow(){return this.dataAccessObject.inlineStartOverlayTrimmingContainer===this.domBindings.rootWindow}sumColumnWidths(e,n){let r=0,i=e;for(;i<n;)r+=this.wtTable.getColumnWidth(i),i+=1;return r}getWorkspaceOffset(){return Nn(this.wtTable.holder)}getColumnHeaderHeight(){return this.wtSettings.getSetting("columnHeaders").length?isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=an(this.wtTable.THEAD)):this.columnHeaderHeight=0,this.columnHeaderHeight}getRowHeaderWidth(){const e=this.wtSettings.getSetting("rowHeaderWidth"),n=this.wtSettings.getSetting("rowHeaders");if(e){this.rowHeaderWidth=0;for(let r=0,i=n.length;r<i;r++)this.rowHeaderWidth+=e[r]||e}if(isNaN(this.rowHeaderWidth))if(n.length){let r=this.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(let i=0,o=n.length;i<o;i++)r?(this.rowHeaderWidth+=Xt(r),r=r.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0;return this.rowHeaderWidth=this.wtSettings.getSetting("onModifyRowHeaderWidth",this.rowHeaderWidth)||this.rowHeaderWidth,this.rowHeaderWidth}createRowsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["rendered","fullyVisible","partiallyVisible"];const{wtSettings:n,wtTable:r}=this;let i=this.getViewportHeight(),o,s;this.rowHeaderWidth=NaN;let a=this.dataAccessObject.topScrollPosition-this.dataAccessObject.topParentOffset;const l=n.getSetting("fixedRowsTop"),u=n.getSetting("fixedRowsBottom"),c=n.getSetting("totalRows");return l&&a>=0&&(s=this.dataAccessObject.topOverlay.sumCellSizes(0,l),a+=s,i-=s),u&&this.dataAccessObject.bottomOverlay.clone&&(s=this.dataAccessObject.bottomOverlay.sumCellSizes(c-u,c),i-=s),r.holder.clientHeight===r.holder.offsetHeight?o=0:o=yn(this.domBindings.rootDocument),new NG({calculationTypes:e.map(h=>[h,this.rowsCalculatorTypes.get(h)()]),viewportHeight:i,scrollOffset:a,totalRows:n.getSetting("totalRows"),defaultRowHeight:this.instance.stylesHandler.getDefaultRowHeight(),rowHeightFn:h=>r.getRowHeight(h),overrideFn:n.getSettingPure("viewportRowCalculatorOverride"),horizontalScrollbarHeight:o})}createColumnsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["rendered","fullyVisible","partiallyVisible"];const{wtSettings:n,wtTable:r}=this;let i=this.getViewportWidth(),o=Math.abs(this.dataAccessObject.inlineStartScrollPosition)-this.dataAccessObject.inlineStartParentOffset;this.columnHeaderHeight=NaN;const s=n.getSetting("fixedColumnsStart");if(s&&o>=0){const a=this.dataAccessObject.inlineStartOverlay.sumCellSizes(0,s);o+=a,i-=a}return r.holder.clientWidth!==r.holder.offsetWidth&&(i-=yn(this.domBindings.rootDocument)),new xG({calculationTypes:e.map(a=>[a,this.columnsCalculatorTypes.get(a)()]),viewportWidth:i,scrollOffset:o,totalColumns:n.getSetting("totalColumns"),columnWidthFn:a=>r.getColumnWidth(a),overrideFn:n.getSettingPure("viewportColumnCalculatorOverride"),inlineStartOffset:this.dataAccessObject.inlineStartParentOffset})}createCalculators(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:n}=this,r=this.createRowsCalculator(),i=this.createColumnsCalculator();if(e&&!n.getSetting("renderAllRows")){const o=r.getResultsFor("fullyVisible");e=this.areAllProposedVisibleRowsAlreadyRendered(o)}if(e&&!n.getSetting("renderAllColumns")){const o=i.getResultsFor("fullyVisible");e=this.areAllProposedVisibleColumnsAlreadyRendered(o)}return e||(this.rowsRenderCalculator=r.getResultsFor("rendered"),this.columnsRenderCalculator=i.getResultsFor("rendered")),this.rowsVisibleCalculator=r.getResultsFor("fullyVisible"),this.columnsVisibleCalculator=i.getResultsFor("fullyVisible"),this.rowsPartiallyVisibleCalculator=r.getResultsFor("partiallyVisible"),this.columnsPartiallyVisibleCalculator=i.getResultsFor("partiallyVisible"),e}createVisibleCalculators(){const e=this.createRowsCalculator(["fullyVisible","partiallyVisible"]),n=this.createColumnsCalculator(["fullyVisible","partiallyVisible"]);this.rowsVisibleCalculator=e.getResultsFor("fullyVisible"),this.columnsVisibleCalculator=n.getResultsFor("fullyVisible"),this.rowsPartiallyVisibleCalculator=e.getResultsFor("partiallyVisible"),this.columnsPartiallyVisibleCalculator=n.getResultsFor("partiallyVisible")}areAllProposedVisibleRowsAlreadyRendered(e){if(!this.rowsVisibleCalculator)return!1;let{startRow:n,endRow:r}=e;if(n===null&&r===null){if(!e.isVisibleInTrimmingContainer)return!0;n=this.rowsPartiallyVisibleCalculator.startRow,r=this.rowsPartiallyVisibleCalculator.endRow}const{startRow:i,endRow:o,rowStartOffset:s,rowEndOffset:a}=this.rowsRenderCalculator,l=this.wtSettings.getSetting("totalRows")-1,u=this.wtSettings.getSetting("viewportRowRenderingThreshold");return Number.isInteger(u)&&u>0?(n=Math.max(0,n-Math.min(s,u)),r=Math.min(l,r+Math.min(a,u))):u==="auto"&&(n=Math.max(0,n-Math.ceil(s/2)),r=Math.min(l,r+Math.ceil(a/2))),n<i||n===i&&n>0?!1:!(r>o||r===o&&r<l)}areAllProposedVisibleColumnsAlreadyRendered(e){if(!this.columnsVisibleCalculator)return!1;let{startColumn:n,endColumn:r}=e;if(n===null&&r===null){if(!e.isVisibleInTrimmingContainer)return!0;n=this.columnsPartiallyVisibleCalculator.startColumn,r=this.columnsPartiallyVisibleCalculator.endColumn}const{startColumn:i,endColumn:o,columnStartOffset:s,columnEndOffset:a}=this.columnsRenderCalculator,l=this.wtSettings.getSetting("totalColumns")-1,u=this.wtSettings.getSetting("viewportColumnRenderingThreshold");return Number.isInteger(u)&&u>0?(n=Math.max(0,n-Math.min(s,u)),r=Math.min(l,r+Math.min(a,u))):u==="auto"&&(n=Math.max(0,n-Math.ceil(s/2)),r=Math.min(l,r+Math.ceil(a/2))),n<i||n===i&&n>0?!1:!(r>o||r===o&&r<l)}resetHasOversizedColumnHeadersMarked(){ke(this.hasOversizedColumnHeadersMarked,(e,n,r)=>{r[n]=void 0})}}function jq(t,e){jD(t,e),e.add(t)}function ca(t,e,n){jD(t,e),e.set(t,n)}function jD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Tt(t,e){return t.get(vi(t,e))}function wi(t,e,n){return t.set(vi(t,e),n),n}function vi(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const ux=23;var Zi=new WeakMap,Uo=new WeakMap,mE=new WeakMap,Cb=new WeakMap,Ms=new WeakMap,dh=new WeakMap,Gh=new WeakMap,eo=new WeakSet;class Uq{constructor(e){jq(this,eo),ca(this,Zi,void 0),ca(this,Uo,void 0),ca(this,mE,void 0),ca(this,Cb,void 0),ca(this,Ms,!0),ca(this,dh,{}),ca(this,Gh,{}),wi(Uo,this,e.rootTable.parentElement.parentElement),wi(Cb,this,e.rootDocument)}isClassicTheme(){return Tt(Ms,this)}getCSSVariableValue(e){var n;if(Tt(Ms,this))return null;if(Tt(dh,this)[`--ht-${e}`])return Tt(dh,this)[`--ht-${e}`];const r=(n=vi(eo,this,qq).call(this,`--ht-${e}`))!==null&&n!==void 0?n:vi(eo,this,UD).call(this,`--ht-${e}`);if(r!==null)return Tt(dh,this)[`--ht-${e}`]=r,r}getStyleForTD(e){var n;return(n=Tt(Gh,this))===null||n===void 0?void 0:n.td[e]}getDefaultRowHeight(){if(Tt(Ms,this))return ux;const e=vi(eo,this,zq).call(this);return!e&&ye(Tt(Uo,this),"ht-wrapper")?(tt(`The "${Tt(Zi,this)}" theme is enabled, but its stylesheets are missing or not imported correctly. Import the correct CSS files in order to use that theme.`),wi(Ms,this,!0),this.useTheme(),ux):e}areCellsBorderBox(){return this.getStyleForTD("box-sizing")==="border-box"}useTheme(e){if(!e){vi(eo,this,cx).call(this),wi(Ms,this,!0),wi(Zi,this,e||void 0);return}e&&e!==Tt(Zi,this)&&(Tt(Zi,this)&&vi(eo,this,Kq).call(this),wi(Zi,this,e),wi(Ms,this,!1),vi(eo,this,Yq).call(this),vi(eo,this,cx).call(this))}getThemeName(){return Tt(Zi,this)}removeClassNames(){ye(Tt(Uo,this),Tt(Zi,this))&&we(Tt(Uo,this),Tt(Zi,this))}}function zq(){const t=this.getCSSVariableValue("line-height"),e=this.getCSSVariableValue("cell-vertical-padding"),n=Math.ceil(parseFloat(this.getStyleForTD("border-bottom-width")));return t===null||e===null||isNaN(n)?null:t+2*e+n}function Yq(){we(Tt(Uo,this),/ht-theme-.*/g),X(Tt(Uo,this),Tt(Zi,this))}function cx(){this.isClassicTheme()||wi(mE,this,getComputedStyle(Tt(Uo,this)));const t=vi(eo,this,Gq).call(this,["box-sizing","border-bottom-width"]);Tt(Gh,this).td={...Tt(Gh,this).td,"box-sizing":t["box-sizing"],"border-bottom-width":t["border-bottom-width"]}}function Gq(t){const e=Tt(Cb,this),n=Tt(Uo,this),r=e.createElement("table"),i=e.createElement("tbody"),o=e.createElement("tr"),s=e.createElement("tr"),a=e.createElement("td");s.appendChild(a),i.appendChild(o),i.appendChild(s),r.appendChild(i),n.appendChild(r);const l=getComputedStyle(a),u={};return t.forEach(c=>{u[c]=l.getPropertyValue(c)}),n.removeChild(r),u}function qq(t){const e=Math.ceil(parseFloat(vi(eo,this,UD).call(this,t)));return Number.isNaN(e)?null:e}function UD(t){const e=Tt(mE,this).getPropertyValue(t);return e===""?null:e}function Kq(){wi(Gh,this,{}),wi(dh,this,{}),wi(Ms,this,!0)}class Xq extends rE{constructor(e,n){super(e,new Wq(n)),this.stylesHandler=new Uq(this.domBindings);const r=this.wtSettings.getSetting("facade",this);this.wtTable=new gE(this.getTableDao(),r,this.domBindings,this.wtSettings),this.wtViewport=new Bq(this.getViewportDao(),this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.selectionManager=new Eq(this.wtSettings.getSetting("selections")),this.wtEvent=new ND(r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager),this.wtOverlays=new $q(this,r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.exportSettingsAsClassNames(),this.findOriginalHeaders()}exportSettingsAsClassNames(){const e={rowHeaders:"htRowHeaders",columnHeaders:"htColumnHeaders"},n=[],r=[];ke(e,(i,o)=>{this.wtSettings.getSetting(o).length&&r.push(i),n.push(i)}),we(this.wtTable.wtRootElement.parentNode,n),X(this.wtTable.wtRootElement.parentNode,r)}getOverlayByName(e){var n;if(!LD.includes(e))return null;const r=e.replace(/_([a-z])/g,i=>i[1].toUpperCase());return(n=this.wtOverlays[`${r}Overlay`])!==null&&n!==void 0?n:null}getViewportDao(){const e=this;return{get wot(){return e},get topOverlayTrimmingContainer(){return e.wtOverlays.topOverlay.trimmingContainer},get inlineStartOverlayTrimmingContainer(){return e.wtOverlays.inlineStartOverlay.trimmingContainer},get topScrollPosition(){return e.wtOverlays.topOverlay.getScrollPosition()},get topParentOffset(){return e.wtOverlays.topOverlay.getTableParentOffset()},get inlineStartScrollPosition(){return e.wtOverlays.inlineStartOverlay.getScrollPosition()},get inlineStartParentOffset(){return e.wtOverlays.inlineStartOverlay.getTableParentOffset()},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get bottomOverlay(){return e.wtOverlays.bottomOverlay}}}}class pE{constructor(e){e instanceof rE?this._wot=e:this._initFromSettings(e)}_initFromSettings(e){e.facade=n=>{const r=new pE(n);return()=>r},this._wot=new Xq(e.table,e)}get guid(){return this._wot.guid}get rootDocument(){return this._wot.domBindings.rootDocument}get rootWindow(){return this._wot.domBindings.rootWindow}get wtSettings(){return this._wot.wtSettings}get cloneSource(){return this._wot.cloneSource}get cloneOverlay(){return this._wot.cloneOverlay}get selectionManager(){return this._wot.selectionManager}get wtViewport(){return this._wot.wtViewport}get wtOverlays(){return this._wot.wtOverlays}get wtTable(){return this._wot.wtTable}get wtEvent(){return this._wot.wtEvent}get wtScroll(){return this._wot.wtScroll}get drawn(){return this._wot.drawn}set drawn(e){this._wot.drawn=e}get activeOverlayName(){return this._wot.activeOverlayName}get drawInterrupted(){return this._wot.drawInterrupted}set drawInterrupted(e){this._wot.drawInterrupted=e}get lastMouseOver(){return this._wot.lastMouseOver}set lastMouseOver(e){this._wot.lastMouseOver=e}get momentumScrolling(){return this._wot.momentumScrolling}set momentumScrolling(e){this._wot.momentumScrolling=e}get touchApplied(){return this._wot.touchApplied}set touchApplied(e){this._wot.touchApplied=e}get domBindings(){return this._wot.domBindings}get eventListeners(){return this._wot.eventListeners}set eventListeners(e){this._wot.eventListeners=e}get eventManager(){return this._wot.eventManager}get stylesHandler(){return this._wot.stylesHandler}createCellCoords(e,n){return this._wot.createCellCoords(e,n)}createCellRange(e,n,r){return this._wot.createCellRange(e,n,r)}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this._wot.draw(e),this}getCell(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this._wot.getCell(e,n)}scrollViewport(e,n,r){return this._wot.scrollViewport(e,n,r)}scrollViewportHorizontally(e,n){return this._wot.scrollViewportHorizontally(e,n)}scrollViewportVertically(e,n){return this._wot.scrollViewportVertically(e,n)}getViewport(){return this._wot.getViewport()}getOverlayName(){return this._wot.cloneOverlay?this._wot.cloneOverlay.type:"master"}getOverlayByName(e){return this._wot.getOverlayByName(e)}exportSettingsAsClassNames(){return this._wot.exportSettingsAsClassNames()}update(e,n){return this._wot.wtSettings.update(e,n),this}getSetting(e,n,r,i,o){return this._wot.wtSettings.getSetting(e,n,r,i,o)}hasSetting(e){return this._wot.wtSettings.hasSetting(e)}destroy(){this._wot.destroy()}}function hx(t){let{isShiftKey:e,isLeftClick:n,isRightClick:r,coords:i,selection:o,controller:s,cellCoordsFactory:a}=t;const l=o.isSelected()?o.getSelectedRange().current():null,u=o.isSelectedByCorner(),c=o.isSelectedByRowHeader();if(o.markSource("mouse"),e&&l)i.row>=0&&i.col>=0&&!s.cell?o.setRangeEnd(i):(u||c)&&i.row>=0&&i.col>=0&&!s.cell?o.setRangeEnd(a(i.row,i.col)):u&&i.row<0&&!s.column?o.setRangeEnd(a(l.to.row,i.col)):c&&i.col<0&&!s.row?o.setRangeEnd(a(i.row,l.to.col)):(!u&&!c&&i.col<0||u&&i.col<0)&&!s.row?o.selectRows(Math.max(l.from.row,0),i.row,i.col):(!u&&!c&&i.row<0||c&&i.row<0)&&!s.column&&o.selectColumns(Math.max(l.from.col,0),i.col,i.row);else{const h=!o.inInSelection(i),d=n||r&&h;i.row<0&&i.col>=0&&!s.column?d&&o.selectColumns(i.col,i.col,i.row):i.col<0&&i.row>=0&&!s.row?d&&o.selectRows(i.row,i.row,i.col):i.col>=0&&i.row>=0&&!s.cell?d&&o.setRangeStart(i):i.col<0&&i.row<0&&o.selectAll(!0,!0,{disableHeadersHighlight:!0,focusPosition:{row:0,col:0}})}o.markEndSource()}function Zq(t){let{isLeftClick:e,coords:n,selection:r,controller:i,cellCoordsFactory:o}=t;if(!e)return;const s=r.isSelectedByRowHeader(),a=r.isSelectedByColumnHeader(),l=r.tableProps.countCols(),u=r.tableProps.countRows();r.markSource("mouse"),a&&!i.column?r.setRangeEnd(o(u-1,n.col)):s&&!i.row?r.setRangeEnd(o(n.row,l-1)):i.cell||r.setRangeEnd(n),r.markEndSource()}const Jq=new Map([["mousedown",hx],["mouseover",Zq],["touchstart",hx]]);function dx(t,e){let{coords:n,selection:r,controller:i,cellCoordsFactory:o}=e;Jq.get(t.type)({coords:n,selection:r,controller:i,cellCoordsFactory:o,isShiftKey:t.shiftKey,isLeftClick:XR(t)||t.type==="touchstart",isRightClick:ll(t)})}const zD=new WeakMap,wE=Symbol("rootInstance");function Qq(t){zD.set(t,!0)}function eK(t){return t===wE}function Pg(t){return zD.has(t)}function tK(t,e){YD(t,e),e.add(t)}function fs(t,e,n){YD(t,e),e.set(t,n)}function YD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gs(t,e,n){return(e=nK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nK(t){var e=rK(t,"string");return typeof e=="symbol"?e:e+""}function rK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qt(t,e){return t.get(Ou(t,e))}function er(t,e,n){return t.set(Ou(t,e),n),n}function Ou(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var ny=new WeakMap,tf=new WeakMap,nf=new WeakMap,To=new WeakMap,ii=new WeakMap,ry=new WeakMap,iy=new WeakMap,kl=new WeakMap,fh=new WeakSet;class iK{constructor(e){tK(this,fh),gs(this,"hot",void 0),gs(this,"eventManager",void 0),gs(this,"settings",void 0),gs(this,"THEAD",void 0),gs(this,"TBODY",void 0),gs(this,"_wt",void 0),gs(this,"activeWt",void 0),fs(this,ny,0),fs(this,tf,0),gs(this,"postponedAdjustElementsSize",!1),fs(this,nf,!1),fs(this,To,void 0),fs(this,ii,void 0),fs(this,ry,0),fs(this,iy,0),fs(this,kl,null),this.hot=e,this.eventManager=new _i(this.hot),this.settings=this.hot.getSettings(),this.createElements(),this.registerEvents(),this.initializeWalkontable()}render(){if(!this.hot.isRenderSuspended()){const e=this.hot.forceFullRender;this.hot.runHooks("beforeRender",e),this.postponedAdjustElementsSize&&(this.postponedAdjustElementsSize=!1,this.adjustElementsSize()),this._wt.draw(!e),Ou(fh,this,sK).call(this),this.hot.runHooks("afterRender",e),this.hot.forceFullRender=!1}}adjustElementsSize(){this.hot.isRenderSuspended()?this.postponedAdjustElementsSize=!0:this._wt.wtOverlays.adjustElementsSize()}getCellAtCoords(e,n){const r=this._wt.getCell(e,n);return r<0?null:r}scrollViewport(e,n,r){return this._wt.scrollViewport(e,n,r)}scrollViewportHorizontally(e,n){return this._wt.scrollViewportHorizontally(e,n)}scrollViewportVertically(e,n){return this._wt.scrollViewportVertically(e,n)}createElements(){const{rootElement:e,rootDocument:n}=this.hot,r=e.getAttribute("style");r&&e.setAttribute("data-originalstyle",r),X(e,"handsontable"),er(ii,this,n.createElement("TABLE")),X(qt(ii,this),"htCore"),this.hot.getSettings().tableClassName&&X(qt(ii,this),this.hot.getSettings().tableClassName),this.settings.ariaTags&&(Re(qt(ii,this),[Go()]),Re(e,[ez(),qN(-1),ip(this.hot.countCols()),gz()])),this.THEAD=n.createElement("THEAD"),qt(ii,this).appendChild(this.THEAD),this.TBODY=n.createElement("TBODY"),qt(ii,this).appendChild(this.TBODY),this.hot.table=qt(ii,this),this.hot.container.insertBefore(qt(ii,this),this.hot.container.firstChild)}registerEvents(){const{rootElement:e,rootDocument:n,selection:r,rootWindow:i}=this.hot,o=n.documentElement;this.eventManager.addEventListener(e,"mousedown",a=>{er(nf,this,!0),this.isTextSelectionAllowed(a.target)||(YP(i),a.preventDefault(),i.focus())}),this.eventManager.addEventListener(e,"mouseup",()=>{er(nf,this,!1)}),this.eventManager.addEventListener(e,"mousemove",a=>{qt(nf,this)&&!this.isTextSelectionAllowed(a.target)&&(this.settings.fragmentSelection&&YP(i),a.preventDefault())}),this.eventManager.addEventListener(o,"keyup",a=>{r.isInProgress()&&!a.shiftKey&&r.finish()}),this.eventManager.addEventListener(o,"mouseup",a=>{r.isInProgress()&&XR(a)&&r.finish(),er(To,this,!1);const l=sD(n.activeElement);Ig(n.activeElement)&&!l||(l||!r.isSelected()&&!r.isSelectedByAnyHeader()&&!e.contains(a.target)&&!ll(a))&&this.hot.unlisten()}),this.eventManager.addEventListener(o,"contextmenu",a=>{r.isInProgress()&&ll(a)&&(r.finish(),er(To,this,!1))}),this.eventManager.addEventListener(o,"touchend",()=>{r.isInProgress()&&r.finish(),er(To,this,!1)}),this.eventManager.addEventListener(o,"mousedown",a=>{const l=a.target,u=a.x||a.clientX,c=a.y||a.clientY;let h=a.target;if(qt(To,this)||!e||!this.hot.view)return;const{holder:d}=this._wt.wtTable;if(h===d){const m=yn(n);if(n.elementFromPoint(u+m,c)!==d||n.elementFromPoint(u,c+m)!==d)return}else for(;h!==o;){if(h===null){if(a.isTargetWebComponent)break;return}if(h===e)return;h=h.parentNode}(typeof this.settings.outsideClickDeselects=="function"?this.settings.outsideClickDeselects(l):this.settings.outsideClickDeselects)?this.hot.deselectCell():this.hot.destroyEditor(!1,!1)});let s=Nu(i);for(;s!==null;)this.eventManager.addEventListener(s.document.documentElement,"click",()=>{this.hot.unlisten()}),s=Nu(s);this.eventManager.addEventListener(qt(ii,this),"selectstart",a=>{this.settings.fragmentSelection||Ig(a.target)||a.preventDefault()})}translateFromRenderableToVisualCoords(e){let{row:n,col:r}=e;return this.hot._createCellCoords(...this.translateFromRenderableToVisualIndex(n,r))}translateFromRenderableToVisualIndex(e,n){let r=e>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(e):e,i=n>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(n):n;return r===null&&(r=e),i===null&&(i=n),[r,i]}countRenderableIndexes(e,n){const r=Math.min(e.getNotTrimmedIndexesLength(),n),i=e.getNearestNotHiddenIndex(r-1,-1);return i===null?0:e.getRenderableFromVisualIndex(i)+1}countRenderableColumns(){return this.countRenderableIndexes(this.hot.columnIndexMapper,this.settings.maxCols)}countRenderableRows(){return this.countRenderableIndexes(this.hot.rowIndexMapper,this.settings.maxRows)}countNotHiddenRowIndexes(e,n){return this.countNotHiddenIndexes(e,n,this.hot.rowIndexMapper,this.countRenderableRows())}countNotHiddenColumnIndexes(e,n){return this.countNotHiddenIndexes(e,n,this.hot.columnIndexMapper,this.countRenderableColumns())}countNotHiddenIndexes(e,n,r,i){if(isNaN(e)||e<0)return 0;const o=r.getNearestNotHiddenIndex(e,n),s=r.getRenderableFromVisualIndex(o);if(!Number.isInteger(s))return 0;let a=0;return n<0?a=s+1:n>0&&(a=i-s),a}countNotHiddenFixedColumnsStart(){const e=this.hot.countCols(),n=Math.min(parseInt(this.settings.fixedColumnsStart,10),e)-1;return this.countNotHiddenColumnIndexes(n,-1)}countNotHiddenFixedRowsTop(){const e=this.hot.countRows(),n=Math.min(parseInt(this.settings.fixedRowsTop,10),e)-1;return this.countNotHiddenRowIndexes(n,-1)}countNotHiddenFixedRowsBottom(){const e=this.hot.countRows(),n=Math.max(e-parseInt(this.settings.fixedRowsBottom,10),0);return this.countNotHiddenRowIndexes(n,1)}countRenderableColumnsInRange(e,n){let r=0;for(let i=e;i<=n;i++)this.hot.columnIndexMapper.getRenderableFromVisualIndex(i)!==null&&(r+=1);return r}countRenderableRowsInRange(e,n){let r=0;for(let i=e;i<=n;i++)this.hot.rowIndexMapper.getRenderableFromVisualIndex(i)!==null&&(r+=1);return r}getStylesHandler(){return this._wt.stylesHandler}getDefaultRowHeight(){return this._wt.stylesHandler.getDefaultRowHeight()}addClassNameToLicenseElement(e){var n;const r=(n=this.hot.rootElement.parentNode)===null||n===void 0?void 0:n.querySelector(".hot-display-license-info");r&&X(r,e)}removeClassNameFromLicenseElement(e){var n;const r=(n=this.hot.rootElement.parentNode)===null||n===void 0?void 0:n.querySelector(".hot-display-license-info");r&&we(r,e)}isMainTableNotFullyCoveredByOverlays(){const e=this.countNotHiddenFixedRowsTop()+this.countNotHiddenFixedRowsBottom(),n=this.countNotHiddenFixedColumnsStart();return this.hot.countRenderedRows()>e&&this.hot.countRenderedCols()>n}initializeWalkontable(){const e={ariaTags:this.settings.ariaTags,rtlMode:this.hot.isRtl(),externalRowCalculator:this.hot.getPlugin("autoRowSize")&&this.hot.getPlugin("autoRowSize").isEnabled(),table:qt(ii,this),isDataViewInstance:()=>Pg(this.hot),preventOverflow:()=>this.settings.preventOverflow,preventWheel:()=>this.settings.preventWheel,viewportColumnRenderingThreshold:()=>this.settings.viewportColumnRenderingThreshold,viewportRowRenderingThreshold:()=>this.settings.viewportRowRenderingThreshold,data:(o,s)=>this.hot.getDataAtCell(...this.translateFromRenderableToVisualIndex(o,s)),totalRows:()=>this.countRenderableRows(),totalColumns:()=>this.countRenderableColumns(),fixedColumnsStart:()=>this.countNotHiddenFixedColumnsStart(),fixedRowsTop:()=>this.countNotHiddenFixedRowsTop(),fixedRowsBottom:()=>this.countNotHiddenFixedRowsBottom(),shouldRenderInlineStartOverlay:()=>this.settings.fixedColumnsStart>0||e.rowHeaders().length>0,shouldRenderTopOverlay:()=>this.settings.fixedRowsTop>0||e.columnHeaders().length>0,shouldRenderBottomOverlay:()=>this.settings.fixedRowsBottom>0,minSpareRows:()=>this.settings.minSpareRows,renderAllRows:this.settings.renderAllRows,renderAllColumns:this.settings.renderAllColumns,rowHeaders:()=>{const o=[];return this.hot.hasRowHeaders()&&o.push((s,a)=>{const l=s>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(s):s;this.appendRowHeader(l,a)}),this.hot.runHooks("afterGetRowHeaderRenderers",o),er(tf,this,o.length),this.hot.getSettings().ariaTags&&Ou(fh,this,GD).call(this)===this.hot.countCols()&&Ou(fh,this,oK).call(this,qt(tf,this)),o},columnHeaders:()=>{const o=[];return this.hot.hasColHeaders()&&o.push((s,a)=>{const l=s>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(s):s;this.appendColHeader(l,a)}),this.hot.runHooks("afterGetColumnHeaderRenderers",o),er(ny,this,o.length),o},columnWidth:o=>{const s=this.hot.columnIndexMapper.getVisualFromRenderableIndex(o);return this.hot.getColWidth(s===null?o:s)},rowHeight:o=>{const s=this.hot.rowIndexMapper.getVisualFromRenderableIndex(o);return this.hot.getRowHeight(s===null?o:s)},rowHeightByOverlayName:(o,s)=>{const a=this.hot.rowIndexMapper.getVisualFromRenderableIndex(o),l=a===null?o:a;return this.hot.runHooks("modifyRowHeightByOverlayName",this.hot.getRowHeight(l),l,s)},cellRenderer:(o,s,a)=>{const[l,u]=this.translateFromRenderableToVisualIndex(o,s),c=this.hot.runHooks("modifyGetCellCoords",l,u,!1,"meta");let h=l,d=u;Array.isArray(c)&&([h,d]=c);const f=this.hot.getCellMeta(h,d),m=this.hot.colToProp(d);let C=this.hot.getDataAtRowProp(h,m);this.hot.hasHook("beforeValueRender")&&(C=this.hot.runHooks("beforeValueRender",C,f)),this.hot.runHooks("beforeRenderer",a,l,u,m,C,f),this.hot.getCellRenderer(f)(this.hot,a,l,u,m,C,f),this.hot.runHooks("afterRenderer",a,l,u,m,C,f)},selections:this.hot.selection.highlight,hideBorderOnMouseDownOver:()=>this.settings.fragmentSelection,onWindowResize:()=>{this.hot&&!this.hot.isDestroyed&&this.hot.refreshDimensions()},onContainerElementResize:()=>{this.hot&&!this.hot.isDestroyed&&Du(this.hot.rootElement)&&this.hot.refreshDimensions()},onCellMouseDown:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s),c={row:!1,column:!1,cell:!1};this.hot.listen(),this.activeWt=l,er(To,this,!0),er(kl,this,{x:o.clientX,y:o.clientY}),this.hot.runHooks("beforeOnCellMouseDown",o,u,a,c),!Ga(o)&&(dx(o,{coords:u,selection:this.hot.selection,controller:c,cellCoordsFactory:(h,d)=>this.hot._createCellCoords(h,d)}),this.hot.runHooks("afterOnCellMouseDown",o,u,a),this.activeWt=this._wt)},onCellContextMenu:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,er(To,this,!1),this.hot.selection.isInProgress()&&this.hot.selection.finish(),this.hot.runHooks("beforeOnCellContextMenu",o,u,a),!Ga(o)&&(this.hot.runHooks("afterOnCellContextMenu",o,u,a),this.activeWt=this._wt)},onCellMouseOut:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseOut",o,u,a),!Ga(o)&&(this.hot.runHooks("afterOnCellMouseOut",o,u,a),this.activeWt=this._wt)},onCellMouseOver:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s),c={row:!1,column:!1,cell:!1};this.activeWt=l,this.hot.runHooks("beforeOnCellMouseOver",o,u,a,c),!Ga(o)&&(qt(To,this)&&(!qt(kl,this)||qt(kl,this).x!==o.clientX||qt(kl,this).y!==o.clientY)&&dx(o,{coords:u,selection:this.hot.selection,controller:c,cellCoordsFactory:(h,d)=>this.hot._createCellCoords(h,d)}),this.hot.runHooks("afterOnCellMouseOver",o,u,a),this.activeWt=this._wt,er(kl,this,null))},onCellMouseUp:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseUp",o,u,a),!(Ga(o)||this.hot.isDestroyed)&&(this.hot.runHooks("afterOnCellMouseUp",o,u,a),this.activeWt=this._wt)},onCellCornerMouseDown:o=>{o.preventDefault(),this.hot.runHooks("afterOnCellCornerMouseDown",o)},onCellCornerDblClick:o=>{o.preventDefault(),this.hot.runHooks("afterOnCellCornerDblClick",o)},beforeDraw:(o,s)=>this.beforeRender(o,s),onDraw:o=>this.afterRender(o),onBeforeViewportScrollVertically:(o,s)=>{const a=this.hot.rowIndexMapper,l=o<0;let u=o;return!l&&(u=a.getVisualFromRenderableIndex(o),u===null)?o:(u=this.hot.runHooks("beforeViewportScrollVertically",u,s),this.hot.runHooks("beforeViewportScroll"),l?u:a.getRenderableFromVisualIndex(u))},onBeforeViewportScrollHorizontally:(o,s)=>{const a=this.hot.columnIndexMapper,l=o<0;let u=o;return!l&&(u=a.getVisualFromRenderableIndex(o),u===null)?o:(u=this.hot.runHooks("beforeViewportScrollHorizontally",u,s),this.hot.runHooks("beforeViewportScroll"),l?u:a.getRenderableFromVisualIndex(u))},onScrollVertically:()=>{this.hot.runHooks("afterScrollVertically"),this.hot.runHooks("afterScroll")},onScrollHorizontally:()=>{this.hot.runHooks("afterScrollHorizontally"),this.hot.runHooks("afterScroll")},onBeforeRemoveCellClassNames:()=>this.hot.runHooks("beforeRemoveCellClassNames"),onBeforeHighlightingRowHeader:(o,s,a)=>{const l=this.hot.rowIndexMapper,u=o<0;let c=o;u||(c=l.getVisualFromRenderableIndex(o));const h=this.hot.runHooks("beforeHighlightingRowHeader",c,s,a);return u?h:l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(h,1))},onBeforeHighlightingColumnHeader:(o,s,a)=>{const l=this.hot.columnIndexMapper,u=o<0;let c=o;u||(c=l.getVisualFromRenderableIndex(o));const h=this.hot.runHooks("beforeHighlightingColumnHeader",c,s,a);return u?h:l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(h,1))},onAfterDrawSelection:(o,s,a)=>{let l;const[u,c]=this.translateFromRenderableToVisualIndex(o,s),h=this.hot.selection.getSelectedRange();if(h.size()>0){const f=h.peekByIndex(a??0);l=[f.from.row,f.from.col,f.to.row,f.to.col]}return this.hot.runHooks("afterDrawSelection",u,c,l,a)},onBeforeDrawBorders:(o,s)=>{const[a,l,u,c]=o,h=[this.hot.rowIndexMapper.getVisualFromRenderableIndex(a),this.hot.columnIndexMapper.getVisualFromRenderableIndex(l),this.hot.rowIndexMapper.getVisualFromRenderableIndex(u),this.hot.columnIndexMapper.getVisualFromRenderableIndex(c)];return this.hot.runHooks("beforeDrawBorders",h,s)},onBeforeTouchScroll:()=>this.hot.runHooks("beforeTouchScroll"),onAfterMomentumScroll:()=>this.hot.runHooks("afterMomentumScroll"),onModifyRowHeaderWidth:o=>this.hot.runHooks("modifyRowHeaderWidth",o),onModifyGetCellCoords:(o,s,a,l)=>{const u=this.hot.rowIndexMapper,c=this.hot.columnIndexMapper,h=s>=0?c.getVisualFromRenderableIndex(s):s,d=o>=0?u.getVisualFromRenderableIndex(o):o,f=this.hot.runHooks("modifyGetCellCoords",d,h,a,l);if(Array.isArray(f)){const[m,C,y,E]=f;return[m>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(m,1)):m,C>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(C,1)):C,y>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(y,-1)):y,E>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(E,-1)):E]}},onModifyGetCoordsElement:(o,s)=>{const a=this.hot.rowIndexMapper,l=this.hot.columnIndexMapper,u=s>=0?l.getVisualFromRenderableIndex(s):s,c=o>=0?a.getVisualFromRenderableIndex(o):o,h=this.hot.runHooks("modifyGetCoordsElement",c,u);if(Array.isArray(h)){const[d,f]=h;return[d>=0?a.getRenderableFromVisualIndex(a.getNearestNotHiddenIndex(d,1)):d,f>=0?l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(f,1)):f]}},viewportRowCalculatorOverride:o=>{let s=this.settings.viewportRowRenderingOffset;if(s==="auto"&&this.settings.fixedRowsTop&&(s=10),s>0||s==="auto"){const a=this.countRenderableRows(),l=o.startRow,u=o.endRow;if(typeof s=="number")o.startRow=Math.max(l-s,0),o.endRow=Math.min(u+s,a-1);else if(s==="auto"){const c=Math.max(1,Math.ceil(u/a*12));o.startRow=Math.max(l-c,0),o.endRow=Math.min(u+c,a-1)}}this.hot.runHooks("afterViewportRowCalculatorOverride",o)},viewportColumnCalculatorOverride:o=>{let s=this.settings.viewportColumnRenderingOffset;if(s==="auto"&&this.settings.fixedColumnsStart&&(s=10),s>0||s==="auto"){const a=this.countRenderableColumns(),l=o.startColumn,u=o.endColumn;if(typeof s=="number"&&(o.startColumn=Math.max(l-s,0),o.endColumn=Math.min(u+s,a-1)),s==="auto"){const c=Math.max(1,Math.ceil(u/a*6));o.startColumn=Math.max(l-c,0),o.endColumn=Math.min(u+c,a-1)}}this.hot.runHooks("afterViewportColumnCalculatorOverride",o)},rowHeaderWidth:()=>this.settings.rowHeaderWidth,columnHeaderHeight:()=>{const o=this.hot.runHooks("modifyColumnHeaderHeight");return this.settings.columnHeaderHeight||o}};this.hot.runHooks("beforeInitWalkontable",e),this._wt=new pE(e),this.activeWt=this._wt;const n=this._wt.wtTable.spreader,{width:r,height:i}=this.hot.rootElement.getBoundingClientRect();this.setLastSize(r,i),this.eventManager.addEventListener(n,"mousedown",o=>{o.target===n&&o.which===3&&o.stopPropagation()}),this.eventManager.addEventListener(n,"contextmenu",o=>{o.target===n&&o.which===3&&o.stopPropagation()}),this.eventManager.addEventListener(this.hot.rootDocument.documentElement,"click",()=>{this.settings.observeDOMVisibility&&this._wt.drawInterrupted&&this.hot.render()})}isTextSelectionAllowed(e){if(Ig(e))return!0;const n=rl(e,this._wt.wtTable.spreader);return!!(this.settings.fragmentSelection===!0&&n||this.settings.fragmentSelection==="cell"&&this.isSelectedOnlyCell()&&n||!this.settings.fragmentSelection&&this.isCellEdited()&&this.isSelectedOnlyCell())}isMouseDown(){return qt(To,this)}isSelectedOnlyCell(){var e,n;return(e=(n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingleCell())!==null&&e!==void 0?e:!1}isCellEdited(){const e=this.hot.getActiveEditor();return e&&e.isOpened()}beforeRender(e,n){e&&this.hot.runHooks("beforeViewRender",this.hot.forceFullRender,n)}afterRender(e){e&&this.hot.runHooks("afterViewRender",this.hot.forceFullRender)}appendRowHeader(e,n){if(n.firstChild){const r=n.firstChild;if(!ye(r,"relative")){rs(n),this.appendRowHeader(e,n);return}this.updateCellHeader(r.querySelector(".rowHeader"),e,this.hot.getRowHeader)}else{const{rootDocument:r,getRowHeader:i}=this.hot,o=r.createElement("div"),s=r.createElement("span");o.className="relative",s.className="rowHeader",this.updateCellHeader(s,e,i),o.appendChild(s),n.appendChild(o)}this.hot.runHooks("afterGetRowHeader",e,n)}appendColHeader(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hot.getColHeader,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;const o=()=>{const s=e>=0?this.hot.getColumnMeta(e).headerClassName:null;return s?s.split(" "):[]};if(n.firstChild){const s=n.firstChild;ye(s,"relative")?(this.updateCellHeader(s.querySelector(".colHeader"),e,r,i),s.className="",X(s,["relative",...o()])):(rs(n),this.appendColHeader(e,n,r,i))}else{const{rootDocument:s}=this.hot,a=s.createElement("div"),l=s.createElement("span"),u=o();a.classList.add("relative",...u),l.className="colHeader",this.settings.ariaTags&&(Re(a,...Go()),Re(l,...Go())),this.updateCellHeader(l,e,r,i),a.appendChild(l),n.appendChild(a)}this.hot.runHooks("afterGetColHeader",e,n,i)}updateCellHeader(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=n;const s=this._wt.wtOverlays.getParentOverlay(e)||this._wt;e.parentNode&&(ye(e,"colHeader")?o=s.wtTable.columnFilter.sourceToRendered(n):ye(e,"rowHeader")&&(o=s.wtTable.rowFilter.sourceToRendered(n))),o>-1?Ju(e,r(n,i)):(al(e," "),X(e,"cornerHeader"))}maximumVisibleElementWidth(e){const r=this._wt.wtViewport.getWorkspaceWidth()-e;return r>0?r:0}maximumVisibleElementHeight(e){const r=this._wt.wtViewport.getWorkspaceHeight()-e;return r>0?r:0}setLastSize(e,n){er(ry,this,e),er(iy,this,n)}getLastSize(){return{width:qt(ry,this),height:qt(iy,this)}}getFirstRenderedVisibleRow(){if(!this._wt.wtViewport.rowsRenderCalculator)return null;const e=this.hot.rowIndexMapper,n=e.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedRow());return e.getNearestNotHiddenIndex(n??0,1)}getLastRenderedVisibleRow(){if(!this._wt.wtViewport.rowsRenderCalculator)return null;const e=this.hot.rowIndexMapper,n=e.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedRow());return e.getNearestNotHiddenIndex(n??this.hot.countRows()-1,-1)}getFirstRenderedVisibleColumn(){if(!this._wt.wtViewport.columnsRenderCalculator)return null;const e=this.hot.columnIndexMapper,n=e.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedColumn());return e.getNearestNotHiddenIndex(n??0,1)}getLastRenderedVisibleColumn(){if(!this._wt.wtViewport.columnsRenderCalculator)return null;const e=this.hot.columnIndexMapper,n=e.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedColumn());return e.getNearestNotHiddenIndex(n??this.hot.countCols()-1,-1)}getFirstFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleRow())}getLastFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleRow())}getFirstFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleColumn())}getLastFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleColumn())}getFirstPartiallyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleRow())}getLastPartiallyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleRow())}getFirstPartiallyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleColumn())}getLastPartiallyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleColumn())}getColumnHeadersCount(){return qt(ny,this)}getRowHeadersCount(){return qt(tf,this)}getViewportWidth(){return this._wt.wtViewport.getViewportWidth()}getWorkspaceWidth(){return this._wt.wtViewport.getWorkspaceWidth()}getViewportHeight(){return this._wt.wtViewport.getViewportHeight()}getWorkspaceHeight(){return this._wt.wtViewport.getWorkspaceHeight()}getElementOverlayName(e){var n;return((n=this._wt.wtOverlays.getParentOverlay(e))!==null&&n!==void 0?n:this._wt).wtTable.name}getOverlayByName(e){return this._wt.getOverlayByName(e)}getActiveOverlayName(){return this._wt.activeOverlayName}isVisible(){return this._wt.wtTable.isVisible()}hasVerticalScroll(){return this._wt.wtViewport.hasVerticalScroll()}hasHorizontalScroll(){return this._wt.wtViewport.hasHorizontalScroll()}getTableWidth(){return this._wt.wtTable.getWidth()}getTableHeight(){return this._wt.wtTable.getHeight()}getTableOffset(){return this._wt.wtViewport.getWorkspaceOffset()}getRowHeaderWidth(){return this._wt.wtViewport.getRowHeaderWidth()}getColumnHeaderHeight(){return this._wt.wtViewport.getColumnHeaderHeight()}isVerticallyScrollableByWindow(){return this._wt.wtViewport.isVerticallyScrollableByWindow()}isHorizontallyScrollableByWindow(){return this._wt.wtViewport.isHorizontallyScrollableByWindow()}destroy(){this._wt.destroy(),this.eventManager.destroy()}}function GD(){return parseInt(this.hot.rootElement.getAttribute(ip()[0]),10)}function oK(t){const e=Ou(fh,this,GD).call(this)+t;Re(this.hot.rootElement,...ip(e))}function sK(){const t=this.hot.rootElement;this.hasVerticalScroll()?X(t,"htHasScrollY"):we(t,"htHasScrollY"),this.hasHorizontalScroll()?X(t,"htHasScrollX"):we(t,"htHasScrollX")}var fx={},gx={},mx;function aK(){if(mx)return gx;mx=1;var t=vt(),e=un(),n=Gu(),r=mr(),i=cn(),o=mo(),s=pr(),a=Js(),l=a("every",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{every:function(c){i(this);try{r(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;return!n(h,function(f,m){if(!c(f,d++))return m()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}}),gx}var px;function lK(){return px||(px=1,aK()),fx}lK();const uK="ABCDEFGHIJKLMNOPQRSTUVWXYZ",wx=uK.length;function cK(t){let e=t+1,n="",r;for(;e>0;)r=(e-1)%wx,n=String.fromCharCode(65+r)+n,e=parseInt((e-r)/wx,10);return n}function qD(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=t;const r=[];return(!Array.isArray(t)||!Array.isArray(t[0]))&&(n=[t]),n.forEach((i,o)=>{Array.isArray(i)?i.forEach((s,a)=>{r.push([o+e,a,s])}):Object.keys(i).forEach(s=>{r.push([o+e,s,i[s]])})}),r}function KD(t){let e=0;return Array.isArray(t)&&(t[0]&&Array.isArray(t[0])?e=t[0].length:t[0]&&De(t[0])&&(e=KR(t[0]))),e}function hK(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>Array.isArray(e)))}function dK(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>typeof e=="object"&&!Array.isArray(e)&&e!==null))}function Tc(t,e,n){return(e=fK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fK(t){var e=gK(t,"string");return typeof e=="symbol"?e:e+""}function gK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class mK{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];Tc(this,"hot",void 0),Tc(this,"data",void 0),Tc(this,"dataType","array"),Tc(this,"colToProp",()=>{}),Tc(this,"propToCol",()=>{}),this.hot=e,this.data=n}modifyRowData(e){let n;return this.hot.hasHook("modifyRowData")&&(n=this.hot.runHooks("modifyRowData",e)),n!==void 0&&!Number.isInteger(n)?n:this.data[e]}getData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return!this.data||this.data.length===0?this.data:this.getByRange(null,null,e)}setData(e){this.data=e}getAtColumn(e){const n=[];return H(this.data,(r,i)=>{const o=this.getAtCell(i,e);n.push(o)}),n}getAtRow(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const o=n===void 0&&r===void 0,{dataDotNotation:s}=this.hot.getSettings();let a=null,l=null;if(a=this.modifyRowData(e),Array.isArray(a))l=[],o?a.forEach((u,c)=>{l[c]=this.getAtPhysicalCell(e,c,a)}):fe(n,r,u=>{l[u-n]=this.getAtPhysicalCell(e,u,a)});else if(De(a)||ut(a))if(i?l=[]:l={},!o||i){const c=this.countFirstRowKeys()-1;fe(0,c,h=>{const d=this.colToProp(h);if(h>=(n||0)&&h<=(r||c)&&!Number.isInteger(d)){const f=this.getAtPhysicalCell(e,d,a);i?l.push(f):s?PC(l,d,f):l[d]=f}})}else ke(a,(u,c)=>{const h=this.getAtPhysicalCell(e,c,a);s?PC(l,c,h):l[c]=h});return l}setAtCell(e,n,r){if(!(e>=this.countRows()||n>=this.countFirstRowKeys())){if(this.hot.hasHook("modifySourceData")){const i=xr(r);this.hot.runHooks("modifySourceData",e,n,i,"set"),i.isTouched()&&(r=i.value)}["__proto__","constructor","prototype"].includes(e)||(Number.isInteger(n)?this.data[e][n]=r:PC(this.data[e],n,r))}}getAtPhysicalCell(e,n,r){let i=null;if(r)if(typeof n=="string"){const{dataDotNotation:o}=this.hot.getSettings();i=o?Wz(r,n):r[n]}else typeof n=="function"?i=n(r):i=r[n];if(this.hot.hasHook("modifySourceData")){const o=xr(i);this.hot.runHooks("modifySourceData",e,n,o,"get"),o.isTouched()&&(i=o.value)}return i}getAtCell(e,n){const r=this.modifyRowData(e);return this.getAtPhysicalCell(e,this.colToProp(n),r)}getByRange(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=!1,o=null,s=null,a=null,l=null;e===null||n===null?(i=!0,o=0,a=this.countRows()-1):(o=Math.min(e.row,n.row),s=Math.min(e.col,n.col),a=Math.max(e.row,n.row),l=Math.max(e.col,n.col));const u=[];return fe(o,a,c=>{u.push(i?this.getAtRow(c,void 0,void 0,r):this.getAtRow(c,s,l,r))}),u}countRows(){if(this.hot.hasHook("modifySourceLength")){const e=this.hot.runHooks("modifySourceLength");if(Number.isInteger(e))return e}return this.data.length}countFirstRowKeys(){return KD(this.data)}destroy(){this.data=null,this.hot=null}}var vx={},Cx={},yx;function pK(){if(yx)return Cx;yx=1;var t=vt(),e=un(),n=Gu(),r=mr(),i=cn(),o=mo(),s=pr(),a=Js(),l=a("some",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{some:function(c){i(this);try{r(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;return n(h,function(f,m){if(c(f,d++))return m()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}}),Cx}var Sx;function wK(){return Sx||(Sx=1,pK()),vx}wK();function bx(t,e,n){return(e=vK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vK(t){var e=CK(t,"string");return typeof e=="symbol"?e:e+""}function CK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Rl{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;bx(this,"indexedValues",[]),bx(this,"initValueOrFn",void 0),this.initValueOrFn=e}getValues(){return this.indexedValues}getValueAtIndex(e){const n=this.indexedValues;if(e<n.length)return n[e]}setValues(e){this.indexedValues=e.slice(),this.runLocalHooks("change")}setValueAtIndex(e,n){return e<this.indexedValues.length?(this.indexedValues[e]=n,this.runLocalHooks("change"),!0):!1}clear(){this.setDefaultValues()}getLength(){return this.getValues().length}setDefaultValues(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.indexedValues.length;this.indexedValues.length=0,ut(this.initValueOrFn)?fe(e-1,n=>this.indexedValues.push(this.initValueOrFn(n))):fe(e-1,()=>this.indexedValues.push(this.initValueOrFn)),this.runLocalHooks("change")}init(e){return this.setDefaultValues(e),this.runLocalHooks("init"),this}insert(){this.runLocalHooks("change")}remove(){this.runLocalHooks("change")}destroy(){this.clearLocalHooks(),this.indexedValues=null,this.initValueOrFn=null}}gt(Rl,En);function vE(t,e,n,r){const i=n.length?n[0]:void 0;return[...t.slice(0,i),...n.map((o,s)=>ut(r)?r(o,s):r),...i===void 0?[]:t.slice(i)]}function CE(t,e){return ol(t,(n,r)=>e.includes(r)===!1)}class ea extends Rl{insert(e,n){this.indexedValues=vE(this.indexedValues,e,n,this.initValueOrFn),super.insert(e,n)}remove(e){this.indexedValues=CE(this.indexedValues,e),super.remove(e)}}class fp extends ea{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getHiddenIndexes(){return wr(this.getValues(),(e,n,r)=>(n&&e.push(r),e),[])}}function yE(t,e,n){return[...t.slice(0,e),...n,...t.slice(e)]}function qh(t,e){return ol(t,n=>e.includes(n)===!1)}function SE(t,e){return ze(t,n=>n-e.filter(r=>r<n).length)}function bE(t,e){const n=e[0],r=e.length;return ze(t,i=>i>=n?i+r:i)}function yK(t,e,n){return(e=SK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function SK(t){var e=bK(t,"string");return typeof e=="symbol"?e:e+""}function bK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class gp extends Rl{constructor(){super(...arguments),yK(this,"orderOfIndexes",[])}getValues(){return this.orderOfIndexes.map(e=>this.indexedValues[e])}setValues(e){this.orderOfIndexes=[...Array(e.length).keys()],super.setValues(e)}setValueAtIndex(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.orderOfIndexes.length;return e<this.indexedValues.length?(this.indexedValues[e]=n,this.orderOfIndexes.includes(e)===!1&&this.orderOfIndexes.splice(r,0,e),this.runLocalHooks("change"),!0):!1}clearValue(e){this.orderOfIndexes=qh(this.orderOfIndexes,[e]),ut(this.initValueOrFn)?super.setValueAtIndex(e,this.initValueOrFn(e)):super.setValueAtIndex(e,this.initValueOrFn)}getLength(){return this.orderOfIndexes.length}setDefaultValues(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.indexedValues.length;this.orderOfIndexes.length=0,super.setDefaultValues(e)}insert(e,n){this.indexedValues=vE(this.indexedValues,e,n,this.initValueOrFn),this.orderOfIndexes=bE(this.orderOfIndexes,n),super.insert(e,n)}remove(e){this.indexedValues=CE(this.indexedValues,e),this.orderOfIndexes=qh(this.orderOfIndexes,e),this.orderOfIndexes=SE(this.orderOfIndexes,e),super.remove(e)}getEntries(){return this.orderOfIndexes.map(e=>[e,this.getValueAtIndex(e)])}}class Td extends ea{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getTrimmedIndexes(){return wr(this.getValues(),(e,n,r)=>(n&&e.push(r),e),[])}}const Rx=new Map([["indexesSequence",{getListWithInsertedItems:yE,getListWithRemovedItems:qh}],["physicallyIndexed",{getListWithInsertedItems:vE,getListWithRemovedItems:CE}]]),XD=t=>{if(Rx.has(t)===!1)throw new Error(`Alter strategy with ID '${t}' does not exist.`);return Rx.get(t)};class ZD extends Rl{constructor(){super(e=>e)}insert(e,n){const r=bE(this.indexedValues,n);this.indexedValues=yE(r,e,n),super.insert(e,n)}remove(e){const n=qh(this.indexedValues,e);this.indexedValues=SE(n,e),super.remove(e)}}const Ex=new Map([["hiding",fp],["index",Rl],["linkedPhysicalIndexToValue",gp],["physicalIndexToValue",ea],["trimming",Td]]);function RK(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!Ex.has(t))throw new Error(`The provided map type ("${t}") does not exist.`);return new(Ex.get(t))(e)}function EK(t,e,n){return(e=TK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function TK(t){var e=_K(t,"string");return typeof e=="symbol"?e:e+""}function _K(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class RE{constructor(){EK(this,"collection",new Map)}register(e,n){this.collection.has(e)===!1&&(this.collection.set(e,n),n.addLocalHook("change",()=>this.runLocalHooks("change",n)))}unregister(e){const n=this.collection.get(e);ue(n)&&(n.destroy(),this.collection.delete(e),this.runLocalHooks("change",n))}unregisterAll(){this.collection.forEach((e,n)=>this.unregister(n)),this.collection.clear()}get(e){return xt(e)?Array.from(this.collection.values()):this.collection.get(e)}getLength(){return this.collection.size}removeFromEvery(e){this.collection.forEach(n=>{n.remove(e)})}insertToEvery(e,n){this.collection.forEach(r=>{r.insert(e,n)})}initEvery(e){this.collection.forEach(n=>{n.init(e)})}}gt(RE,En);function oy(t,e,n){return(e=MK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function MK(t){var e=IK(t,"string");return typeof e=="symbol"?e:e+""}function IK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Tx extends RE{constructor(e,n){super(),oy(this,"mergedValuesCache",[]),oy(this,"aggregationFunction",void 0),oy(this,"fallbackValue",void 0),this.aggregationFunction=e,this.fallbackValue=n}getMergedValues(){if((arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0)return this.mergedValuesCache;if(this.getLength()===0)return[];const n=ze(this.get(),o=>o.getValues()),r=[],i=ue(n[0])&&n[0].length||0;for(let o=0;o<i;o+=1){const s=[];for(let a=0;a<this.getLength();a+=1)s.push(n[a][o]);r.push(s)}return ze(r,this.aggregationFunction)}getMergedValueAtIndex(e,n){const r=this.getMergedValues(n)[e];return ue(r)?r:this.fallbackValue}updateCache(){this.mergedValuesCache=this.getMergedValues(!1)}}function PK(t,e,n){OK(t,e),e.set(t,n)}function OK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xK(t,e,n){return t.set(JD(t,e),n),n}function AK(t,e){return t.get(JD(t,e))}function JD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var sy=new WeakMap;class QD{constructor(){PK(this,sy,[])}subscribe(e){return this.addLocalHook("change",e),this._write(AK(sy,this)),this}unsubscribe(){return this.runLocalHooks("unsubscribe"),this.clearLocalHooks(),this}_write(e){return e.length>0&&this.runLocalHooks("change",e),this}_writeInitialChanges(e){xK(sy,this,e)}}gt(QD,En);function _x(t,e){const n=[];let r=0,i=0;for(;r<t.length&&i<e.length;r++,i++)t[r]!==e[i]&&n.push({op:"replace",index:i,oldValue:t[r],newValue:e[i]});for(;r<e.length;r++)n.push({op:"insert",index:r,oldValue:void 0,newValue:e[r]});for(;i<t.length;i++)n.push({op:"remove",index:i,oldValue:t[i],newValue:void 0});return n}function _c(t,e,n){HK(t,e),e.set(t,n)}function HK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fr(t,e){return t.get(ek(t,e))}function rf(t,e,n){return t.set(ek(t,e),n),n}function ek(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var of=new WeakMap,Mc=new WeakMap,sf=new WeakMap,af=new WeakMap,lf=new WeakMap;class NK{constructor(){let{initialIndexValue:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_c(this,of,new Set),_c(this,Mc,[]),_c(this,sf,[]),_c(this,af,!1),_c(this,lf,!1),rf(lf,this,e??!1)}createObserver(){const e=new QD;return Fr(of,this).add(e),e.addLocalHook("unsubscribe",()=>{Fr(of,this).delete(e)}),e._writeInitialChanges(_x(Fr(Mc,this),Fr(sf,this))),e}emit(e){let n=Fr(sf,this);(!Fr(af,this)||Fr(Mc,this).length!==e.length)&&(e.length===0?e=new Array(n.length).fill(Fr(lf,this)):rf(Mc,this,new Array(e.length).fill(Fr(lf,this))),Fr(af,this)||(rf(af,this,!0),n=Fr(Mc,this)));const r=_x(n,e);Fr(of,this).forEach(i=>i._write(r)),rf(sf,this,e)}}function $n(t,e,n){return(e=DK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function DK(t){var e=kK(t,"string");return typeof e=="symbol"?e:e+""}function kK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class yb{constructor(){$n(this,"indexesSequence",new ZD),$n(this,"trimmingMapsCollection",new Tx(e=>e.some(n=>n===!0),!1)),$n(this,"hidingMapsCollection",new Tx(e=>e.some(n=>n===!0),!1)),$n(this,"variousMapsCollection",new RE),$n(this,"hidingChangesObservable",new NK({initialIndexValue:!1})),$n(this,"notTrimmedIndexesCache",[]),$n(this,"notHiddenIndexesCache",[]),$n(this,"isBatched",!1),$n(this,"indexesSequenceChanged",!1),$n(this,"indexesChangeSource",void 0),$n(this,"trimmedIndexesChanged",!1),$n(this,"hiddenIndexesChanged",!1),$n(this,"renderablePhysicalIndexesCache",[]),$n(this,"fromPhysicalToVisualIndexesCache",new Map),$n(this,"fromVisualToRenderableIndexesCache",new Map),this.indexesSequence.addLocalHook("change",()=>{this.indexesSequenceChanged=!0,this.updateCache(),this.runLocalHooks("indexesSequenceChange",this.indexesChangeSource),this.runLocalHooks("change",this.indexesSequence,null)}),this.trimmingMapsCollection.addLocalHook("change",e=>{this.trimmedIndexesChanged=!0,this.updateCache(),this.runLocalHooks("change",e,this.trimmingMapsCollection)}),this.hidingMapsCollection.addLocalHook("change",e=>{this.hiddenIndexesChanged=!0,this.updateCache(),this.runLocalHooks("change",e,this.hidingMapsCollection)}),this.variousMapsCollection.addLocalHook("change",e=>{this.runLocalHooks("change",e,this.variousMapsCollection)})}suspendOperations(){this.isBatched=!0}resumeOperations(){this.isBatched=!1,this.updateCache()}createChangesObserver(e){if(e!=="hiding")throw new Error(`Unsupported index map type "${e}".`);return this.hidingChangesObservable.createObserver()}createAndRegisterIndexMap(e,n,r){return this.registerMap(e,RK(n,r))}registerMap(e,n){if(this.trimmingMapsCollection.get(e)||this.hidingMapsCollection.get(e)||this.variousMapsCollection.get(e))throw Error(`Map with name "${e}" has been already registered.`);n instanceof Td?this.trimmingMapsCollection.register(e,n):n instanceof fp?this.hidingMapsCollection.register(e,n):this.variousMapsCollection.register(e,n);const r=this.getNumberOfIndexes();return r>0&&n.init(r),n}unregisterMap(e){this.trimmingMapsCollection.unregister(e),this.hidingMapsCollection.unregister(e),this.variousMapsCollection.unregister(e)}unregisterAll(){this.trimmingMapsCollection.unregisterAll(),this.hidingMapsCollection.unregisterAll(),this.variousMapsCollection.unregisterAll()}getPhysicalFromVisualIndex(e){const n=this.notTrimmedIndexesCache[e];return ue(n)?n:null}getPhysicalFromRenderableIndex(e){const n=this.renderablePhysicalIndexesCache[e];return ue(n)?n:null}getVisualFromPhysicalIndex(e){const n=this.fromPhysicalToVisualIndexesCache.get(e);return ue(n)?n:null}getVisualFromRenderableIndex(e){return this.getVisualFromPhysicalIndex(this.getPhysicalFromRenderableIndex(e))}getRenderableFromVisualIndex(e){const n=this.fromVisualToRenderableIndexesCache.get(e);return ue(n)?n:null}getNearestNotHiddenIndex(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(this.getPhysicalFromVisualIndex(e)===null)return null;if(this.fromVisualToRenderableIndexesCache.has(e))return e;const o=Array.from(this.fromVisualToRenderableIndexesCache.keys());let s=-1;return n>0?s=o.findIndex(a=>a>e):s=o.reverse().findIndex(a=>a<e),s===-1?r?this.getNearestNotHiddenIndex(e,-n,!1):null:o[s]}initToLength(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getNumberOfIndexes();this.notTrimmedIndexesCache=[...new Array(e).keys()],this.notHiddenIndexesCache=[...new Array(e).keys()],this.suspendOperations(),this.indexesChangeSource="init",this.indexesSequence.init(e),this.indexesChangeSource=void 0,this.trimmingMapsCollection.initEvery(e),this.resumeOperations(),this.suspendOperations(),this.hidingMapsCollection.initEvery(e),this.variousMapsCollection.initEvery(e),this.resumeOperations(),this.runLocalHooks("init")}fitToLength(e){const n=this.getNumberOfIndexes();if(e<n){const r=[...Array(this.getNumberOfIndexes()-e).keys()].map(i=>i+e);this.removeIndexes(r)}else this.insertIndexes(n,e-n)}getIndexesSequence(){return this.indexesSequence.getValues()}setIndexesSequence(e){this.indexesChangeSource===void 0&&(this.indexesChangeSource="update"),this.indexesSequence.setValues(e),this.indexesChangeSource==="update"&&(this.indexesChangeSource=void 0)}getNotTrimmedIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.notTrimmedIndexesCache:this.getIndexesSequence().filter(r=>this.isTrimmed(r)===!1)}getNotTrimmedIndexesLength(){return this.getNotTrimmedIndexes().length}getNotHiddenIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.notHiddenIndexesCache:this.getIndexesSequence().filter(r=>this.isHidden(r)===!1)}getNotHiddenIndexesLength(){return this.getNotHiddenIndexes().length}getRenderableIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.renderablePhysicalIndexesCache:this.getNotTrimmedIndexes().filter(r=>this.isHidden(r)===!1)}getRenderableIndexesLength(){return this.getRenderableIndexes().length}getNumberOfIndexes(){return this.getIndexesSequence().length}moveIndexes(e,n){typeof e=="number"&&(e=[e]);const r=ze(e,u=>this.getPhysicalFromVisualIndex(u)),i=this.getNotTrimmedIndexesLength(),o=e.length,s=qh(this.getIndexesSequence(),r),a=s.filter(u=>this.isTrimmed(u)===!1);let l=s.indexOf(a[a.length-1])+1;if(n+o<i){const u=a[n];l=s.indexOf(u)}this.indexesChangeSource="move",this.setIndexesSequence(yE(s,l,r)),this.indexesChangeSource=void 0}isTrimmed(e){return this.trimmingMapsCollection.getMergedValueAtIndex(e)}isHidden(e){return this.hidingMapsCollection.getMergedValueAtIndex(e)}insertIndexes(e,n){const r=this.getNotTrimmedIndexes()[e],i=ue(r)?r:this.getNumberOfIndexes(),o=this.getIndexesSequence().includes(r)?this.getIndexesSequence().indexOf(r):this.getNumberOfIndexes(),s=ze(new Array(n).fill(i),(a,l)=>a+l);this.suspendOperations(),this.indexesChangeSource="insert",this.indexesSequence.insert(o,s),this.indexesChangeSource=void 0,this.trimmingMapsCollection.insertToEvery(o,s),this.hidingMapsCollection.insertToEvery(o,s),this.variousMapsCollection.insertToEvery(o,s),this.resumeOperations()}removeIndexes(e){this.suspendOperations(),this.indexesChangeSource="remove",this.indexesSequence.remove(e),this.indexesChangeSource=void 0,this.trimmingMapsCollection.removeFromEvery(e),this.hidingMapsCollection.removeFromEvery(e),this.variousMapsCollection.removeFromEvery(e),this.resumeOperations()}updateCache(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const n=this.indexesSequenceChanged||this.trimmedIndexesChanged||this.hiddenIndexesChanged;(e===!0||this.isBatched===!1&&n===!0)&&(this.trimmingMapsCollection.updateCache(),this.hidingMapsCollection.updateCache(),this.notTrimmedIndexesCache=this.getNotTrimmedIndexes(!1),this.notHiddenIndexesCache=this.getNotHiddenIndexes(!1),this.renderablePhysicalIndexesCache=this.getRenderableIndexes(!1),this.cacheFromPhysicalToVisualIndexes(),this.cacheFromVisualToRenderableIndexes(),this.hiddenIndexesChanged&&this.hidingChangesObservable.emit(this.hidingMapsCollection.getMergedValues()),this.runLocalHooks("cacheUpdated",{indexesSequenceChanged:this.indexesSequenceChanged,trimmedIndexesChanged:this.trimmedIndexesChanged,hiddenIndexesChanged:this.hiddenIndexesChanged}),this.indexesSequenceChanged=!1,this.trimmedIndexesChanged=!1,this.hiddenIndexesChanged=!1)}cacheFromPhysicalToVisualIndexes(){const e=this.getNotTrimmedIndexesLength();this.fromPhysicalToVisualIndexesCache.clear();for(let n=0;n<e;n+=1){const r=this.getPhysicalFromVisualIndex(n);this.fromPhysicalToVisualIndexesCache.set(r,n)}}cacheFromVisualToRenderableIndexes(){const e=this.getRenderableIndexesLength();this.fromVisualToRenderableIndexesCache.clear();for(let n=0;n<e;n+=1){const r=this.getPhysicalFromRenderableIndex(n),i=this.getVisualFromPhysicalIndex(r);this.fromVisualToRenderableIndexesCache.set(i,n)}}}gt(yb,En);function LK(t,e){return ke(e,(n,r)=>{xt(t[r])&&(t[r]=n)}),t}function tk(t){const n=/^([a-zA-Z]{2})-([a-zA-Z]{2})$/.exec(t);return n?`${n[1].toLowerCase()}-${n[2].toUpperCase()}`:t}function nk(t){ue(t)&&ZR(st`Language with code "${t}" was not found. You should register particular language\x20
62
- before using it. Read more about this issue at: https://docs.handsontable.com/i18n/missing-language-code.`)}function $K(t,e){return Array.isArray(t)&&Number.isInteger(e)?t[e]:t}const{register:FK,getValues:VK}=Oi("phraseFormatters");function WK(t,e){FK(t,e)}function BK(){return VK()}WK("pluralize",$K);const rk="ContextMenu:items",Me=rk,EE=`${Me}.noItems`,TE=`${Me}.insertRowAbove`,_E=`${Me}.insertRowBelow`,ME=`${Me}.insertColumnOnTheLeft`,IE=`${Me}.insertColumnOnTheRight`,PE=`${Me}.removeRow`,OE=`${Me}.removeColumn`,xE=`${Me}.undo`,AE=`${Me}.redo`,rm=`${Me}.readOnly`,HE=`${Me}.clearColumn`,NE=`${Me}.copy`,DE=`${Me}.copyWithHeaders`,kE=`${Me}.copyWithGroupHeaders`,LE=`${Me}.copyHeadersOnly`,$E=`${Me}.cut`,FE=`${Me}.freezeColumn`,VE=`${Me}.unfreezeColumn`,WE=`${Me}.mergeCells`,BE=`${Me}.unmergeCells`,jE=`${Me}.addComment`,UE=`${Me}.editComment`,zE=`${Me}.removeComment`,YE=`${Me}.readOnlyComment`,GE=`${Me}.align`,qE=`${Me}.align.left`,KE=`${Me}.align.center`,XE=`${Me}.align.right`,ZE=`${Me}.align.justify`,JE=`${Me}.align.top`,QE=`${Me}.align.middle`,e0=`${Me}.align.bottom`,t0=`${Me}.borders`,n0=`${Me}.borders.top`,r0=`${Me}.borders.right`,i0=`${Me}.borders.bottom`,o0=`${Me}.borders.left`,s0=`${Me}.borders.remove`,a0=`${Me}.nestedHeaders.insertChildRow`,l0=`${Me}.nestedHeaders.detachFromParent`,u0=`${Me}.hideColumn`,c0=`${Me}.showColumn`,h0=`${Me}.hideRow`,d0=`${Me}.showRow`,Xn="Filters:",Vt=`${Xn}conditions`,mp=`${Vt}.none`,f0=`${Vt}.isEmpty`,g0=`${Vt}.isNotEmpty`,m0=`${Vt}.isEqualTo`,p0=`${Vt}.isNotEqualTo`,w0=`${Vt}.beginsWith`,v0=`${Vt}.endsWith`,C0=`${Vt}.contains`,y0=`${Vt}.doesNotContain`,jK=`${Vt}.byValue`,S0=`${Vt}.greaterThan`,b0=`${Vt}.greaterThanOrEqualTo`,R0=`${Vt}.lessThan`,E0=`${Vt}.lessThanOrEqualTo`,T0=`${Vt}.isBetween`,_0=`${Vt}.isNotBetween`,M0=`${Vt}.after`,I0=`${Vt}.before`,P0=`${Vt}.today`,O0=`${Vt}.tomorrow`,x0=`${Vt}.yesterday`,A0=`${Xn}labels.filterByCondition`,H0=`${Xn}labels.filterByValue`,N0=`${Xn}labels.conjunction`,pp=`${Xn}labels.disjunction`,im=`${Xn}values.blankCells`,D0=`${Xn}buttons.selectAll`,k0=`${Xn}buttons.clear`,L0=`${Xn}buttons.ok`,$0=`${Xn}buttons.cancel`,F0=`${Xn}buttons.placeholder.search`,V0=`${Xn}buttons.placeholder.value`,W0=`${Xn}buttons.placeholder.secondValue`,B0="CheckboxRenderer:",j0=`${B0}checked`,U0=`${B0}unchecked`,UK=Object.freeze(Object.defineProperty({__proto__:null,CHECKBOX_CHECKED:j0,CHECKBOX_RENDERER_NAMESPACE:B0,CHECKBOX_UNCHECKED:U0,CONTEXTMENU_ITEMS_ADD_COMMENT:jE,CONTEXTMENU_ITEMS_ALIGNMENT:GE,CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM:e0,CONTEXTMENU_ITEMS_ALIGNMENT_CENTER:KE,CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY:ZE,CONTEXTMENU_ITEMS_ALIGNMENT_LEFT:qE,CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE:QE,CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT:XE,CONTEXTMENU_ITEMS_ALIGNMENT_TOP:JE,CONTEXTMENU_ITEMS_BORDERS:t0,CONTEXTMENU_ITEMS_BORDERS_BOTTOM:i0,CONTEXTMENU_ITEMS_BORDERS_LEFT:o0,CONTEXTMENU_ITEMS_BORDERS_RIGHT:r0,CONTEXTMENU_ITEMS_BORDERS_TOP:n0,CONTEXTMENU_ITEMS_CLEAR_COLUMN:HE,CONTEXTMENU_ITEMS_COPY:NE,CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY:LE,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS:kE,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS:DE,CONTEXTMENU_ITEMS_CUT:$E,CONTEXTMENU_ITEMS_EDIT_COMMENT:UE,CONTEXTMENU_ITEMS_FREEZE_COLUMN:FE,CONTEXTMENU_ITEMS_HIDE_COLUMN:u0,CONTEXTMENU_ITEMS_HIDE_ROW:h0,CONTEXTMENU_ITEMS_INSERT_LEFT:ME,CONTEXTMENU_ITEMS_INSERT_RIGHT:IE,CONTEXTMENU_ITEMS_MERGE_CELLS:WE,CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD:l0,CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD:a0,CONTEXTMENU_ITEMS_NO_ITEMS:EE,CONTEXTMENU_ITEMS_READ_ONLY:rm,CONTEXTMENU_ITEMS_READ_ONLY_COMMENT:YE,CONTEXTMENU_ITEMS_REDO:AE,CONTEXTMENU_ITEMS_REMOVE_BORDERS:s0,CONTEXTMENU_ITEMS_REMOVE_COLUMN:OE,CONTEXTMENU_ITEMS_REMOVE_COMMENT:zE,CONTEXTMENU_ITEMS_REMOVE_ROW:PE,CONTEXTMENU_ITEMS_ROW_ABOVE:TE,CONTEXTMENU_ITEMS_ROW_BELOW:_E,CONTEXTMENU_ITEMS_SHOW_COLUMN:c0,CONTEXTMENU_ITEMS_SHOW_ROW:d0,CONTEXTMENU_ITEMS_UNDO:xE,CONTEXTMENU_ITEMS_UNFREEZE_COLUMN:VE,CONTEXTMENU_ITEMS_UNMERGE_CELLS:BE,CONTEXT_MENU_ITEMS_NAMESPACE:rk,FILTERS_BUTTONS_CANCEL:$0,FILTERS_BUTTONS_CLEAR:k0,FILTERS_BUTTONS_OK:L0,FILTERS_BUTTONS_PLACEHOLDER_SEARCH:F0,FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE:W0,FILTERS_BUTTONS_PLACEHOLDER_VALUE:V0,FILTERS_BUTTONS_SELECT_ALL:D0,FILTERS_CONDITIONS_AFTER:M0,FILTERS_CONDITIONS_BEFORE:I0,FILTERS_CONDITIONS_BEGINS_WITH:w0,FILTERS_CONDITIONS_BETWEEN:T0,FILTERS_CONDITIONS_BY_VALUE:jK,FILTERS_CONDITIONS_CONTAINS:C0,FILTERS_CONDITIONS_EMPTY:f0,FILTERS_CONDITIONS_ENDS_WITH:v0,FILTERS_CONDITIONS_EQUAL:m0,FILTERS_CONDITIONS_GREATER_THAN:S0,FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL:b0,FILTERS_CONDITIONS_LESS_THAN:R0,FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL:E0,FILTERS_CONDITIONS_NAMESPACE:Vt,FILTERS_CONDITIONS_NONE:mp,FILTERS_CONDITIONS_NOT_BETWEEN:_0,FILTERS_CONDITIONS_NOT_CONTAIN:y0,FILTERS_CONDITIONS_NOT_EMPTY:g0,FILTERS_CONDITIONS_NOT_EQUAL:p0,FILTERS_CONDITIONS_TODAY:P0,FILTERS_CONDITIONS_TOMORROW:O0,FILTERS_CONDITIONS_YESTERDAY:x0,FILTERS_DIVS_FILTER_BY_CONDITION:A0,FILTERS_DIVS_FILTER_BY_VALUE:H0,FILTERS_LABELS_CONJUNCTION:N0,FILTERS_LABELS_DISJUNCTION:pp,FILTERS_NAMESPACE:Xn,FILTERS_VALUES_BLANK_CELLS:im},Symbol.toStringTag,{value:"Module"}));/**
63
- * @preserve
64
- * Authors: Handsoncode
65
- * Last updated: Nov 15, 2017
66
- *
67
- * Description: Definition file for English - United States language-country.
68
- */const ik={languageCode:"en-US",[EE]:"No available options",[TE]:"Insert row above",[_E]:"Insert row below",[ME]:"Insert column left",[IE]:"Insert column right",[PE]:["Remove row","Remove rows"],[OE]:["Remove column","Remove columns"],[xE]:"Undo",[AE]:"Redo",[rm]:"Read only",[HE]:"Clear column",[GE]:"Alignment",[qE]:"Left",[KE]:"Center",[XE]:"Right",[ZE]:"Justify",[JE]:"Top",[QE]:"Middle",[e0]:"Bottom",[FE]:"Freeze column",[VE]:"Unfreeze column",[t0]:"Borders",[n0]:"Top",[r0]:"Right",[i0]:"Bottom",[o0]:"Left",[s0]:"Remove border(s)",[jE]:"Add comment",[UE]:"Edit comment",[zE]:"Delete comment",[YE]:"Read-only comment",[WE]:"Merge cells",[BE]:"Unmerge cells",[NE]:"Copy",[DE]:["Copy with header","Copy with headers"],[kE]:["Copy with group header","Copy with group headers"],[LE]:["Copy header only","Copy headers only"],[$E]:"Cut",[a0]:"Insert child row",[l0]:"Detach from parent",[u0]:["Hide column","Hide columns"],[c0]:["Show column","Show columns"],[h0]:["Hide row","Hide rows"],[d0]:["Show row","Show rows"],[mp]:"None",[f0]:"Is empty",[g0]:"Is not empty",[m0]:"Is equal to",[p0]:"Is not equal to",[w0]:"Begins with",[v0]:"Ends with",[C0]:"Contains",[y0]:"Does not contain",[S0]:"Greater than",[b0]:"Greater than or equal to",[R0]:"Less than",[E0]:"Less than or equal to",[T0]:"Is between",[_0]:"Is not between",[M0]:"After",[I0]:"Before",[P0]:"Today",[O0]:"Tomorrow",[x0]:"Yesterday",[im]:"Blank cells",[A0]:"Filter by condition",[H0]:"Filter by value",[N0]:"And",[pp]:"Or",[D0]:"Select all",[k0]:"Clear",[L0]:"OK",[$0]:"Cancel",[F0]:"Search",[V0]:"Value",[W0]:"Second value",[j0]:"Checked",[U0]:"Unchecked"},zK=UK,Sb=ik.languageCode,{register:YK,getItem:ok,hasItem:GK,getValues:qK}=Oi("languagesDictionaries");sk(ik);function sk(t,e){let n=t,r=e;return De(t)&&(r=t,n=r.languageCode),KK(n,r),YK(n,Kn(r)),Kn(r)}function KK(t,e){t!==Sb&&LK(e,ok(Sb))}function ak(t){return z0(t)?Kn(ok(t)):null}function z0(t){return GK(t)}function XK(){return qK()}function lk(t,e,n){const r=ak(t);if(r===null)return null;const i=r[e];if(xt(i))return null;const o=ZK(i,n);return Array.isArray(o)?o[0]:o}function ZK(t,e){let n=t;return H(BK(),r=>{n=r(t,e)}),n}function JK(t){let e=tk(t);return z0(e)||(e=Sb,nk(t)),e}function QK(t,e,n){return(e=e3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e3(t){var e=t3(t,"string");return typeof e=="symbol"?e:e+""}function t3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class cs extends $D{constructor(e,n){super(e,null),QK(this,"visualCellRange",null),this.visualCellRange=n||null,this.commit()}add(e){return this.visualCellRange===null?this.visualCellRange=this.settings.createCellRange(e):this.visualCellRange.expand(e),this}clear(){return this.visualCellRange=null,super.clear()}trimToVisibleCellsRangeOnly(e){let{from:n,to:r}=e,i=this.getNearestNotHiddenCoords(n,1),o=this.getNearestNotHiddenCoords(r,-1);return i===null||o===null?null:((i.row>o.row||i.col>o.col)&&(i=n,o=r),this.settings.createCellRange(i,i,o))}getNearestNotHiddenCoords(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:n;const i=this.getNearestNotHiddenIndex(this.settings.rowIndexMapper,e.row,n);if(i===null)return null;const o=this.getNearestNotHiddenIndex(this.settings.columnIndexMapper,e.col,r);return o===null?null:this.settings.createCellCoords(i,o)}getNearestNotHiddenIndex(e,n,r){return n<0?n:e.getNearestNotHiddenIndex(n,r)}commit(){if(this.visualCellRange===null)return this;const e=this.trimToVisibleCellsRangeOnly(this.visualCellRange);return e===null?this.cellRange=null:this.cellRange=this.createRenderableCellRange(e.from,e.to),this}syncWith(e){const n=e.from.clone().normalize(),r=e.getVerticalDirection()==="N-S"?1:-1,i=e.getHorizontalDirection()==="W-E"?1:-1,o=this.settings.visualToRenderableCoords(this.visualCellRange.highlight);let s=null;if((o===null||o.col===null||o.row===null)&&(s=this.getNearestNotHiddenCoords(n,r,i)),s!==null&&e.overlaps(s)){const a=e.highlight.clone();if(a.row>=0&&(a.row=s.row),a.col>=0&&(a.col=s.col),this.cellRange===null){const l=this.settings.visualToRenderableCoords(a);this.cellRange=this.settings.createCellRange(l)}e.setHighlight(a)}return this.settings.selectionType==="focus"&&o!==null&&s===null&&e.setHighlight(this.visualCellRange.highlight),this}getCorners(){const{from:e,to:n}=this.cellRange;return[Math.min(e.row,n.row),Math.min(e.col,n.col),Math.max(e.row,n.row),Math.max(e.col,n.col)]}getVisualCorners(){const e=this.settings.renderableToVisualCoords(this.cellRange.getTopStartCorner()),n=this.settings.renderableToVisualCoords(this.cellRange.getBottomEndCorner());return[e.row,e.col,n.row,n.col]}createRenderableCellRange(e,n){const r=this.settings.visualToRenderableCoords(e),i=this.settings.visualToRenderableCoords(n);return r.row===null||r.col===null||i.row===null||i.col===null?null:this.settings.createCellRange(r,r,i)}}function ay(t){let{activeHeaderClassName:e,...n}=t;return new cs({className:e,...n,selectionType:FD})}function n3(t){let{areaCornerVisible:e,...n}=t;return new cs({className:"area",createLayers:!0,border:{width:1,color:"#4b89ff",cornerVisible:e},...n,selectionType:lE})}function r3(t){let{...e}=t;return new cs({className:"highlight",...e,selectionType:lE})}function i3(t){let{columnClassName:e,...n}=t;return new cs({className:e,...n,selectionType:wq})}function o3(t){let{cellCornerVisible:e,...n}=t;return new cs({className:"current",headerAttributes:[UR()],border:{width:2,color:"#4b89ff",cornerVisible:e},...n,selectionType:Sh})}function s3(t){let{border:e,visualCellRange:n,...r}=t;return new cs({...e,...r,selectionType:vq},n)}function a3(t){let{...e}=t;return new cs({className:"fill",border:{width:1,color:"#ff0000"},...e,selectionType:mq})}function Mx(t){let{headerClassName:e,...n}=t;return new cs({className:e,...n,selectionType:aE})}function l3(t){let{rowClassName:e,...n}=t;return new cs({className:e,...n,selectionType:pq})}function u3(t,e){c3(t,e),e.add(t)}function c3(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function tr(t,e,n){return(e=h3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function h3(t){var e=d3(t,"string");return typeof e=="symbol"?e:e+""}function d3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function _o(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var $i=new WeakSet;class f3{constructor(e){u3(this,$i),tr(this,"options",void 0),tr(this,"layerLevel",0),tr(this,"focus",void 0),tr(this,"fill",void 0),tr(this,"layeredAreas",new Map),tr(this,"areas",new Map),tr(this,"rowHeaders",new Map),tr(this,"columnHeaders",new Map),tr(this,"activeRowHeaders",new Map),tr(this,"activeColumnHeaders",new Map),tr(this,"activeCornerHeaders",new Map),tr(this,"rowHighlights",new Map),tr(this,"columnHighlights",new Map),tr(this,"customSelections",[]),this.options=e,this.focus=o3(e),this.fill=a3(e)}isEnabledFor(e,n){let r=e;e===Sh&&(r="current");let i=this.options.disabledCellSelection(n.row,n.col);return typeof i=="string"&&(i=[i]),i===!1||Array.isArray(i)&&!i.includes(r)}useLayerLevel(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.layerLevel=e,this}getFocus(){return this.focus}getFill(){return this.fill}createLayeredArea(){return _o($i,this,Mo).call(this,this.layeredAreas,n3)}getLayeredAreas(){return[...this.layeredAreas.values()]}createArea(){return _o($i,this,Mo).call(this,this.areas,r3)}getAreas(){return[...this.areas.values()]}createRowHeader(){return _o($i,this,Mo).call(this,this.rowHeaders,Mx)}getRowHeaders(){return[...this.rowHeaders.values()]}createColumnHeader(){return _o($i,this,Mo).call(this,this.columnHeaders,Mx)}getColumnHeaders(){return[...this.columnHeaders.values()]}createActiveRowHeader(){return _o($i,this,Mo).call(this,this.activeRowHeaders,ay)}getActiveRowHeaders(){return[...this.activeRowHeaders.values()]}createActiveColumnHeader(){return _o($i,this,Mo).call(this,this.activeColumnHeaders,ay)}getActiveColumnHeaders(){return[...this.activeColumnHeaders.values()]}createActiveCornerHeader(){return _o($i,this,Mo).call(this,this.activeCornerHeaders,ay)}getActiveCornerHeaders(){return[...this.activeCornerHeaders.values()]}createRowHighlight(){return _o($i,this,Mo).call(this,this.rowHighlights,l3)}getRowHighlights(){return[...this.rowHighlights.values()]}createColumnHighlight(){return _o($i,this,Mo).call(this,this.columnHighlights,i3)}getColumnHighlights(){return[...this.columnHighlights.values()]}getCustomSelections(){return[...this.customSelections.values()]}addCustomSelection(e){this.customSelections.push(s3({...this.options,...e}))}clear(){this.focus.clear(),this.fill.clear(),H(this.areas.values(),e=>void e.clear()),H(this.layeredAreas.values(),e=>void e.clear()),H(this.rowHeaders.values(),e=>void e.clear()),H(this.columnHeaders.values(),e=>void e.clear()),H(this.activeRowHeaders.values(),e=>void e.clear()),H(this.activeColumnHeaders.values(),e=>void e.clear()),H(this.activeCornerHeaders.values(),e=>void e.clear()),H(this.rowHighlights.values(),e=>void e.clear()),H(this.columnHighlights.values(),e=>void e.clear())}[Symbol.iterator](){return[this.focus,this.fill,...this.areas.values(),...this.layeredAreas.values(),...this.rowHeaders.values(),...this.columnHeaders.values(),...this.activeRowHeaders.values(),...this.activeColumnHeaders.values(),...this.activeCornerHeaders.values(),...this.rowHighlights.values(),...this.columnHighlights.values(),...this.customSelections][Symbol.iterator]()}}function Mo(t,e){const n=this.layerLevel;if(t.has(n))return t.get(n);const r=e({layerLevel:n,...this.options});return t.set(n,r),r}function Ix(t,e,n){return(e=g3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function g3(t){var e=m3(t,"string");return typeof e=="symbol"?e:e+""}function m3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class p3{constructor(e){Ix(this,"ranges",[]),Ix(this,"createCellRange",void 0),this.createCellRange=e}isEmpty(){return this.size()===0}set(e){return this.clear(),this.ranges.push(this.createCellRange(e)),this}add(e){return this.ranges.push(this.createCellRange(e)),this}pop(){return this.ranges.pop(),this}current(){return this.peekByIndex(this.size()-1)}previous(){return this.peekByIndex(this.size()-2)}includes(e){return this.ranges.some(n=>n.includes(e))}clear(){return this.ranges.length=0,this}size(){return this.ranges.length}peekByIndex(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n;return e>=0&&e<this.size()&&(n=this.ranges[e]),n}[Symbol.iterator](){return this.ranges[Symbol.iterator]()}}function w3(t,e){uk(t,e),e.add(t)}function ly(t,e,n){uk(t,e),e.set(t,n)}function uk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ze(t,e){return t.get(rn(t,e))}function uf(t,e,n){return t.set(rn(t,e),n),n}function rn(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var cf=new WeakMap,yt=new WeakMap,Si=new WeakMap,fn=new WeakSet;class bb{constructor(e,n){w3(this,fn),ly(this,cf,void 0),ly(this,yt,void 0),ly(this,Si,{x:0,y:0}),uf(cf,this,e),uf(yt,this,n)}transformStart(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=Ze(yt,this).createCellCoords(e,n);let o=Ze(cf,this).current().highlight;const s=Ze(yt,this).visualToRenderableCoords(o);let a=0,l=0;if(this.runLocalHooks("beforeTransformStart",i),s.row!==null&&s.col!==null){const{width:u,height:c}=rn(fn,this,ck).call(this),{row:h,col:d}=rn(fn,this,Ox).call(this,o),f=Ze(yt,this).fixedRowsBottom(),m=Ze(yt,this).minSpareRows(),C=Ze(yt,this).minSpareCols(),y=Ze(yt,this).autoWrapRow(),E=Ze(yt,this).autoWrapCol(),v=Ze(yt,this).createCellCoords(h+i.row,d+i.col);if(v.row>=c){const F=xr(r&&m>0&&f===0),I=v.col+1,_=Ze(yt,this).createCellCoords(v.row-c,I>=u?I-u:I);this.runLocalHooks("beforeColumnWrap",F,rn(fn,this,Ll).call(this,_),I>=u),F.value?this.runLocalHooks("insertRowRequire",Ze(yt,this).countRenderableRows()):E&&v.assign(_)}else if(v.row<0){const F=xr(E),I=v.col-1,_=Ze(yt,this).createCellCoords(c+v.row,I<0?u+I:I);this.runLocalHooks("beforeColumnWrap",F,rn(fn,this,Ll).call(this,_),I<0),E&&v.assign(_)}if(v.col>=u){const F=xr(r&&C>0),I=v.row+1,_=Ze(yt,this).createCellCoords(I>=c?I-c:I,v.col-u);this.runLocalHooks("beforeRowWrap",F,rn(fn,this,Ll).call(this,_),I>=c),F.value?this.runLocalHooks("insertColRequire",Ze(yt,this).countRenderableColumns()):y&&v.assign(_)}else if(v.col<0){const F=xr(y),I=v.row-1,_=Ze(yt,this).createCellCoords(I<0?c+I:I,u+v.col);this.runLocalHooks("beforeRowWrap",F,rn(fn,this,Ll).call(this,_),I<0),y&&v.assign(_)}const{rowDir:O,colDir:x}=rn(fn,this,Px).call(this,v);a=O,l=x,o=rn(fn,this,Ll).call(this,v)}return this.runLocalHooks("afterTransformStart",o,a,l),o}transformEnd(e,n){const r=Ze(yt,this).createCellCoords(e,n),i=Ze(cf,this).current(),o=Ze(yt,this).visualToRenderableCoords(i.highlight),s=rn(fn,this,uy).call(this,i.to.row,i.from.row),a=rn(fn,this,cy).call(this,i.to.col,i.from.col),l=i.to.clone();let u=0,c=0;if(this.runLocalHooks("beforeTransformEnd",r),o.row!==null&&o.col!==null&&s!==null&&a!==null){const{row:h,col:d}=rn(fn,this,Ox).call(this,i.highlight),f=Ze(yt,this).createCellCoords(s+r.row,a+r.col),m=i.getTopStartCorner(),C=i.getTopEndCorner(),y=i.getBottomEndCorner();if(r.col<0&&a>=d&&f.col<d){const x=f.col-d;f.col=rn(fn,this,cy).call(this,m.col,C.col)+x}else if(r.col>0&&a<=d&&f.col>d){const x=rn(fn,this,cy).call(this,C.col,m.col),F=Math.max(f.col-x,1);f.col=x+F}if(r.row<0&&s>=h&&f.row<h){const x=f.row-h;f.row=rn(fn,this,uy).call(this,m.row,y.row)+x}else if(r.row>0&&s<=h&&f.row>h){const x=rn(fn,this,uy).call(this,y.row,m.row),F=Math.max(f.row-x,1);f.row=x+F}const{rowDir:E,colDir:v}=rn(fn,this,Px).call(this,f);u=E,c=v;const O=rn(fn,this,Ll).call(this,f);r.row===0&&r.col!==0?l.col=O.col:r.row!==0&&r.col===0?l.row=O.row:(l.row=O.row,l.col=O.col)}return this.runLocalHooks("afterTransformEnd",l,u,c),l}setOffsetSize(e){let{x:n,y:r}=e;uf(Si,this,{x:n,y:r})}resetOffsetSize(){uf(Si,this,{x:0,y:0})}}function Px(t){const{width:e,height:n}=rn(fn,this,ck).call(this);let r=0,i=0;return t.row<0?(r=-1,t.row=0):t.row>0&&t.row>=n&&(r=1,t.row=n-1),t.col<0?(i=-1,t.col=0):t.col>0&&t.col>=e&&(i=1,t.col=e-1),{rowDir:r,colDir:i}}function ck(){return{width:Ze(Si,this).x+Ze(yt,this).countRenderableColumns(),height:Ze(Si,this).y+Ze(yt,this).countRenderableRows()}}function uy(t,e){const n=Ze(yt,this).findFirstNonHiddenRenderableRow(t,e);return n===null?null:Ze(Si,this).y+n}function cy(t,e){const n=Ze(yt,this).findFirstNonHiddenRenderableColumn(t,e);return n===null?null:Ze(Si,this).x+n}function Ox(t){const{row:e,col:n}=Ze(yt,this).visualToRenderableCoords(t);if(e===null||n===null)throw new Error("Renderable coords are not visible.");return Ze(yt,this).createCellCoords(Ze(Si,this).y+e,Ze(Si,this).x+n)}function Ll(t){const e=t.clone();return e.col=t.col-Ze(Si,this).x,e.row=t.row-Ze(Si,this).y,Ze(yt,this).renderableToVisualCoords(e)}gt(bb,En);const wp=0,vp=1,hk=2,Y0=3,v3=[Y0,hk],C3=[["number"],["number","string"],["number","undefined"],["number","string","undefined"]],hy=Symbol("root"),xx=Symbol("child");function Lu(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hy;if(e!==hy&&e!==xx)throw new Error("The second argument is used internally only and cannot be overwritten.");const n=Array.isArray(t),r=e===hy;let i=wp;if(n){const o=t[0];t.length===0?i=vp:r&&o instanceof bd?i=Y0:r&&Array.isArray(o)?i=Lu(o,xx):t.length>=2&&t.length<=4&&!t.some((a,l)=>!C3[l].includes(typeof a))&&(i=hk)}return i}function Kh(t){let{createCellCoords:e,createCellRange:n,keepDirection:r=!1,propToCol:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!v3.includes(t))throw new Error("Unsupported selection ranges schema type was provided.");return function(o){const s=t===Y0;let a=s?o.from.row:o[0],l=s?o.from.col:o[1],u=s?o.to.row:o[2],c=s?o.to.col:o[3];if(typeof i=="function"&&(typeof l=="string"&&(l=i(l)),typeof c=="string"&&(c=i(c))),xt(u)&&(u=a),xt(c)&&(c=l),!r){const f=a,m=l,C=u,y=c;a=Math.min(f,C),l=Math.min(m,y),u=Math.max(f,C),c=Math.max(m,y)}const h=e(a,l),d=e(u,c);return n(h,h,d)}}function y3(t){const e=Lu(t.getSelected());if(e===wp||e===vp)return[];const n=Kh(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),r=new Set;H(t.getSelected(),s=>{const{from:a,to:l}=n(s),u=Math.max(a.col,0),c=l.col-u+1;H(Array.from(new Array(c),(h,d)=>u+d),h=>{r.has(h)||r.add(h)})});const i=Array.from(r).sort((s,a)=>s-a);return wr(i,(s,a,l,u)=>(l!==0&&a===u[l-1]+1?s[s.length-1][1]+=1:s.push([a,1]),s),[])}function S3(t){const e=Lu(t.getSelected());if(e===wp||e===vp)return[];const n=Kh(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),r=new Set;H(t.getSelected(),s=>{const{from:a,to:l}=n(s),u=Math.max(a.row,0),c=l.row-u+1;H(Array.from(new Array(c),(h,d)=>u+d),h=>{r.has(h)||r.add(h)})});const i=Array.from(r).sort((s,a)=>s-a);return wr(i,(s,a,l,u)=>(l!==0&&a===u[l-1]+1?s[s.length-1][1]+=1:s.push([a,1]),s),[])}function $l(t,e,n){b3(t,e),e.set(t,n)}function b3(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ha(t,e,n){return(e=R3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R3(t){var e=E3(t,"string");return typeof e=="symbol"?e:e+""}function E3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Rt(t,e){return t.get(dk(t,e))}function Fi(t,e,n){return t.set(dk(t,e),n),n}function dk(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Mn=new WeakMap,da=new WeakMap,hf=new WeakMap,Ic=new WeakMap,df=new WeakMap,Pc=new WeakMap;class fk{constructor(e,n){var r=this;ha(this,"settings",void 0),ha(this,"tableProps",void 0),ha(this,"inProgress",!1),ha(this,"selectedRange",new p3((i,o,s)=>this.tableProps.createCellRange(i,o,s))),ha(this,"highlight",void 0),$l(this,Mn,void 0),$l(this,da,void 0),ha(this,"selectedByRowHeader",new Set),ha(this,"selectedByColumnHeader",new Set),$l(this,hf,!1),$l(this,Ic,!1),$l(this,df,"unknown"),$l(this,Pc,-1),this.settings=e,this.tableProps=n,this.highlight=new f3({headerClassName:e.currentHeaderClassName,activeHeaderClassName:e.activeHeaderClassName,rowClassName:e.currentRowClassName,columnClassName:e.currentColClassName,cellAttributes:[UR()],rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,disabledCellSelection:(i,o)=>this.tableProps.isDisabledCellSelection(i,o),cellCornerVisible:function(){return r.isCellCornerVisible(...arguments)},areaCornerVisible:function(){return r.isAreaCornerVisible(...arguments)},visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),createCellCoords:(i,o)=>this.tableProps.createCellCoords(i,o),createCellRange:(i,o,s)=>this.tableProps.createCellRange(i,o,s)}),Fi(Mn,this,new bb(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>this.tableProps.countRenderableRows(),countRenderableColumns:()=>this.tableProps.countRenderableColumns(),visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),findFirstNonHiddenRenderableRow:function(){return r.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return r.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(i,o)=>this.tableProps.createCellCoords(i,o),fixedRowsBottom:()=>e.fixedRowsBottom,minSpareRows:()=>e.minSpareRows,minSpareCols:()=>e.minSpareCols,autoWrapRow:()=>e.autoWrapRow,autoWrapCol:()=>e.autoWrapCol})),Fi(da,this,new bb(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>{const i=this.selectedRange.current();return this.tableProps.countRenderableRowsInRange(0,i.getOuterBottomEndCorner().row)},countRenderableColumns:()=>{const i=this.selectedRange.current();return this.tableProps.countRenderableColumnsInRange(0,i.getOuterBottomEndCorner().col)},visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),findFirstNonHiddenRenderableRow:function(){return r.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return r.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(i,o)=>this.tableProps.createCellCoords(i,o),fixedRowsBottom:()=>0,minSpareRows:()=>0,minSpareCols:()=>0,autoWrapRow:()=>!0,autoWrapCol:()=>!0})),Rt(Mn,this).addLocalHook("beforeTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeModifyTransformStart",...o)}),Rt(Mn,this).addLocalHook("afterTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("afterModifyTransformStart",...o)}),Rt(Mn,this).addLocalHook("beforeTransformEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeModifyTransformEnd",...o)}),Rt(Mn,this).addLocalHook("afterTransformEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("afterModifyTransformEnd",...o)}),Rt(Mn,this).addLocalHook("insertRowRequire",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("insertRowRequire",...o)}),Rt(Mn,this).addLocalHook("insertColRequire",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("insertColRequire",...o)}),Rt(Mn,this).addLocalHook("beforeRowWrap",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeRowWrap",...o)}),Rt(Mn,this).addLocalHook("beforeColumnWrap",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeColumnWrap",...o)}),Rt(da,this).addLocalHook("beforeTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeModifyTransformFocus",...o)}),Rt(da,this).addLocalHook("afterTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("afterModifyTransformFocus",...o)})}getSelectedRange(){return this.selectedRange}markSource(e){Fi(df,this,e)}markEndSource(){Fi(df,this,"unknown")}getSelectionSource(){return Rt(df,this)}setExpectedLayers(e){Fi(Pc,this,e)}begin(){this.inProgress=!0}finish(){this.runLocalHooks("afterSelectionFinished",Array.from(this.selectedRange)),this.inProgress=!1,Fi(Pc,this,-1)}isInProgress(){return this.inProgress}setRangeStart(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e;const o=this.settings.selectionMode==="multiple",s=xt(n)?this.tableProps.getShortcutManager().isCtrlPressed():n,a=e.clone();Fi(hf,this,!1),this.runLocalHooks(`beforeSetRangeStart${r?"Only":""}`,a),(!o||o&&!s&&xt(n))&&this.selectedRange.clear(),this.selectedRange.add(a).current().setHighlight(i.clone()),this.getLayerLevel()===0&&(this.selectedByRowHeader.clear(),this.selectedByColumnHeader.clear()),r||this.setRangeEnd(e)}setRangeStartOnly(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e;this.setRangeStart(e,n,!0,r)}setRangeEnd(e){if(this.selectedRange.isEmpty())return;const n=e.clone(),r=this.tableProps.countRows(),i=this.tableProps.countCols(),o=this.selectedRange.current().clone().setTo(e).isSingleHeader();if((r>0||i>0)&&(r===0&&n.col<0&&!o||i===0&&n.row<0&&!o))return;this.runLocalHooks("beforeSetRangeEnd",n),this.begin();const s=this.selectedRange.current();if(this.settings.navigableHeaders||s.highlight.normalize(),this.settings.selectionMode==="single")s.setFrom(s.highlight),s.setTo(s.highlight);else{const l=s.getHorizontalDirection(),u=s.getVerticalDirection(),c=this.isMultiple();s.setTo(n),c&&(l!==s.getHorizontalDirection()||s.getWidth()===1&&!s.includes(s.highlight))&&s.from.assign({col:s.highlight.col}),c&&(u!==s.getVerticalDirection()||s.getHeight()===1&&!s.includes(s.highlight))&&s.from.assign({row:s.highlight.row})}r>0&&i>0&&(!this.settings.navigableHeaders||this.settings.navigableHeaders&&!s.isSingleHeader())&&s.to.normalize(),this.runLocalHooks("beforeHighlightSet"),this.setRangeFocus(this.selectedRange.current().highlight),this.applyAndCommit();const a=Rt(Pc,this)===-1||this.selectedRange.size()===Rt(Pc,this);this.runLocalHooks("afterSetRangeEnd",e,a)}applyAndCommit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.selectedRange.current(),n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLayerLevel();const r=this.tableProps.countRows(),i=this.tableProps.countCols();n<this.highlight.layerLevel&&(H(this.highlight.getAreas(),m=>void m.clear()),H(this.highlight.getLayeredAreas(),m=>void m.clear()),H(this.highlight.getRowHeaders(),m=>void m.clear()),H(this.highlight.getColumnHeaders(),m=>void m.clear()),H(this.highlight.getActiveRowHeaders(),m=>void m.clear()),H(this.highlight.getActiveColumnHeaders(),m=>void m.clear()),H(this.highlight.getActiveCornerHeaders(),m=>void m.clear()),H(this.highlight.getRowHighlights(),m=>void m.clear()),H(this.highlight.getColumnHighlights(),m=>void m.clear())),this.highlight.useLayerLevel(n);const o=this.highlight.createArea(),s=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),u=this.highlight.createActiveRowHeader(),c=this.highlight.createActiveColumnHeader(),h=this.highlight.createActiveCornerHeader(),d=this.highlight.createRowHighlight(),f=this.highlight.createColumnHighlight();if(o.clear(),s.clear(),a.clear(),l.clear(),u.clear(),c.clear(),h.clear(),d.clear(),f.clear(),this.highlight.isEnabledFor(lE,e.highlight)&&(this.isMultiple()||n>=1)&&(o.add(e.from).add(e.to).commit(),s.add(e.from).add(e.to).commit(),n===1)){const m=this.selectedRange.previous();this.highlight.useLayerLevel(n-1),this.highlight.createArea().add(m.from).commit().syncWith(m),this.highlight.createLayeredArea().add(m.from).commit().syncWith(m),this.highlight.useLayerLevel(n)}if(this.highlight.isEnabledFor(aE,e.highlight)){if(!e.isSingleHeader()){const y=this.tableProps.createCellCoords(Math.max(e.from.row,0),-1),E=this.tableProps.createCellCoords(e.to.row,-1),v=this.tableProps.createCellCoords(-1,Math.max(e.from.col,0)),O=this.tableProps.createCellCoords(-1,e.to.col);this.settings.selectionMode==="single"?(a.add(y).commit(),l.add(v).commit(),d.add(y).commit(),f.add(v).commit()):(a.add(y).add(E).commit(),l.add(v).add(O).commit(),d.add(y).add(E).commit(),f.add(v).add(O).commit())}const m=!Rt(Ic,this)&&this.isEntireRowSelected()&&(i>0&&i===e.getWidth()||i===0&&this.isSelectedByRowHeader()),C=!Rt(Ic,this)&&this.isEntireColumnSelected()&&(r>0&&r===e.getHeight()||r===0&&this.isSelectedByColumnHeader());m&&u.add(this.tableProps.createCellCoords(Math.max(e.from.row,0),Math.min(-this.tableProps.countRowHeaders(),-1))).add(this.tableProps.createCellCoords(Math.max(e.to.row,0),-1)).commit(),C&&c.add(this.tableProps.createCellCoords(Math.min(-this.tableProps.countColHeaders(),-1),Math.max(e.from.col,0))).add(this.tableProps.createCellCoords(-1,Math.max(e.to.col,0))).commit(),m&&C&&h.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(),-this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1,-1)).commit()}}setRangeFocus(e){if(this.selectedRange.isEmpty())return;const n=this.selectedRange.current();this.inProgress||this.runLocalHooks("beforeSetFocus",e);const r=this.highlight.getFocus();r.clear(),n.setHighlight(e),this.inProgress||this.runLocalHooks("beforeHighlightSet"),this.highlight.isEnabledFor(Sh,n.highlight)&&r.add(n.highlight).commit().syncWith(n),this.inProgress||(Fi(hf,this,!0),this.runLocalHooks("afterSetFocus",n.highlight))}transformStart(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.settings.navigableHeaders?Rt(Mn,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):Rt(Mn,this).resetOffsetSize(),this.setRangeStart(Rt(Mn,this).transformStart(e,n,r))}transformEnd(e,n){this.settings.navigableHeaders?Rt(Mn,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):Rt(Mn,this).resetOffsetSize(),this.setRangeEnd(Rt(Mn,this).transformEnd(e,n))}transformFocus(e,n){const r=this.selectedRange.current(),{row:i,col:o}=r.getOuterTopStartCorner(),s=this.tableProps.countRenderableColumnsInRange(0,o-1),a=this.tableProps.countRenderableRowsInRange(0,i-1);r.highlight.isHeader()?Rt(da,this).setOffsetSize({x:o<0?Math.abs(o):-s,y:i<0?Math.abs(i):-a}):Rt(da,this).setOffsetSize({x:o<0?0:-s,y:i<0?0:-a});const l=Rt(da,this).transformStart(e,n);this.setRangeFocus(l.normalize())}shiftRows(e,n){if(!this.isSelected())return;const r=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByColumnHeader()||r.getOuterTopStartCorner().row>=e){const{from:i,to:o,highlight:s}=r,a=this.tableProps.countRows(),l=this.isSelectedByRowHeader(),u=this.isSelectedByColumnHeader(),c=u?-1:0,h=u?0:n;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(qe(i.row+h,c,a-1),i.col),f=this.tableProps.createCellCoords(qe(o.row+n,c,a-1),o.col);this.markSource("shift"),s.row>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(qe(s.row+n,0,a-1),s.col)):this.setRangeStartOnly(d,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),u&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.markEndSource()}}shiftColumns(e,n){if(!this.isSelected())return;const r=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByRowHeader()||r.getOuterTopStartCorner().col>=e){const{from:i,to:o,highlight:s}=r,a=this.tableProps.countCols(),l=this.isSelectedByRowHeader(),u=this.isSelectedByColumnHeader(),c=l?-1:0,h=l?0:n;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(i.row,qe(i.col+h,c,a-1)),f=this.tableProps.createCellCoords(o.row,qe(o.col+n,c,a-1));this.markSource("shift"),s.col>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(s.row,qe(s.col+n,0,a-1))):this.setRangeStartOnly(d,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),u&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.markEndSource()}}getLayerLevel(){return this.selectedRange.size()-1}isSelected(){return!this.selectedRange.isEmpty()}isMultiple(){if(!this.isSelected())return!1;const e=xr(!this.selectedRange.current().isSingle());return this.runLocalHooks("afterIsMultipleSelection",e),e.value}isFocusSelectionChanged(){return this.isSelected()&&Rt(hf,this)}isSelectedByRowHeader(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();return!this.isSelectedByCorner(e)&&(e===-1?this.selectedByRowHeader.size>0:this.selectedByRowHeader.has(e))}isEntireRowSelected(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();const n=i=>{const{col:o}=i.getOuterTopStartCorner(),s=this.tableProps.countRowHeaders(),a=this.tableProps.countCols();return(s>0&&o<0||s===0)&&i.getWidth()===a};if(e===-1)return Array.from(this.selectedRange).some(i=>n(i));const r=this.selectedRange.peekByIndex(e);return r?n(r):!1}isSelectedByColumnHeader(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();return!this.isSelectedByCorner()&&(e===-1?this.selectedByColumnHeader.size>0:this.selectedByColumnHeader.has(e))}isEntireColumnSelected(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();const n=i=>{const{row:o}=i.getOuterTopStartCorner(),s=this.tableProps.countColHeaders(),a=this.tableProps.countRows();return(s>0&&o<0||s===0)&&i.getHeight()===a};if(e===-1)return Array.from(this.selectedRange).some(i=>n(i));const r=this.selectedRange.peekByIndex(e);return r?n(r):!1}isSelectedByAnyHeader(){return this.isSelectedByRowHeader(-1)||this.isSelectedByColumnHeader(-1)||this.isSelectedByCorner()}isSelectedByCorner(){return this.selectedByColumnHeader.has(this.getLayerLevel())&&this.selectedByRowHeader.has(this.getLayerLevel())}inInSelection(e){return this.selectedRange.includes(e)}isCellCornerVisible(){return this.settings.fillHandle&&!this.tableProps.isEditorOpened()&&!this.isMultiple()}isCellVisible(e){const n=this.tableProps.visualToRenderableCoords(e);return n.row!==null&&n.col!==null}isAreaCornerVisible(e){return Number.isInteger(e)&&e!==this.getLayerLevel()?!1:this.settings.fillHandle&&!this.tableProps.isEditorOpened()&&this.isMultiple()}clear(){this.selectedRange.clear(),this.highlight.clear()}deselect(){this.isSelected()&&(this.inProgress=!1,this.clear(),this.runLocalHooks("afterDeselect"))}selectAll(){var e;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{focusPosition:!1,disableHeadersHighlight:!1};const o=this.tableProps.countRows(),s=this.tableProps.countCols(),a=this.tableProps.countRowHeaders(),l=this.tableProps.countColHeaders(),u=r?-l:0,c=n?-a:0;if(u===0&&c===0&&(o===0||s===0))return;let h=(e=this.getSelectedRange().current())===null||e===void 0?void 0:e.highlight;const{focusPosition:d,disableHeadersHighlight:f}=i;Fi(Ic,this,f),d&&Number.isInteger(d==null?void 0:d.row)&&Number.isInteger(d==null?void 0:d.col)&&(h=this.tableProps.createCellCoords(qe(d.row,u,o-1),qe(d.col,c,s-1)));const m=this.tableProps.createCellCoords(u,c),C=this.tableProps.createCellCoords(o-1,s-1);this.clear(),this.setRangeStartOnly(m,void 0,h),c<0&&this.selectedByRowHeader.add(this.getLayerLevel()),u<0&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(C),this.finish(),Fi(Ic,this,!1)}selectCells(e){var n=this;const r=Lu(e);if(r===vp)return!1;if(r===wp)throw new Error(st`Unsupported format of the selection ranges was passed. To select cells pass\x20
69
- the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd,\x20
70
- columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);const i=Kh(r,{createCellCoords:function(){return n.tableProps.createCellCoords(...arguments)},createCellRange:function(){return n.tableProps.createCellRange(...arguments)},propToCol:l=>this.tableProps.propToCol(l),keepDirection:!0}),o=this.settings.navigableHeaders,s={countRows:this.tableProps.countRows(),countCols:this.tableProps.countCols(),countRowHeaders:o?this.tableProps.countRowHeaders():0,countColHeaders:o?this.tableProps.countColHeaders():0},a=!e.some(l=>{const u=i(l),c=u.isValid(s);return!(c&&!u.containsHeaders()||c&&u.containsHeaders()&&u.isSingleHeader())});return a&&(this.clear(),this.setExpectedLayers(e.length),H(e,l=>{const{from:u,to:c}=i(l);this.setRangeStartOnly(u.clone(),!1),this.setRangeEnd(c.clone())}),this.finish()),a}selectColumns(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const i=typeof e=="string"?this.tableProps.propToCol(e):e,o=typeof n=="string"?this.tableProps.propToCol(n):n,s=this.tableProps.countRows(),a=this.tableProps.countCols(),l=this.tableProps.countColHeaders(),u=l===0?0:-l,c=this.tableProps.createCellCoords(u,i),h=this.tableProps.createCellCoords(s-1,o),d=this.tableProps.createCellRange(c,c,h).isValid({countRows:s,countCols:a,countRowHeaders:0,countColHeaders:l});if(d){let f=0,m=0;Number.isInteger(r==null?void 0:r.row)&&Number.isInteger(r==null?void 0:r.col)?(f=qe(r.row,u,s-1),m=qe(r.col,Math.min(i,o),Math.max(i,o))):(f=qe(r,u,s-1),m=i);const C=this.tableProps.createCellCoords(f,m),y=l===0?0:qe(C.row,u,-1),E=s-1,v=this.tableProps.createCellCoords(y,i),O=this.tableProps.createCellCoords(E,o);this.runLocalHooks("beforeSelectColumns",v,O,C),v.row=y,O.row=E,this.setRangeStartOnly(v,void 0,C),this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(O),this.runLocalHooks("afterSelectColumns",v,O,C),this.finish()}return d}selectRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const i=this.tableProps.countRows(),o=this.tableProps.countCols(),s=this.tableProps.countRowHeaders(),a=s===0?0:-s,l=this.tableProps.createCellCoords(e,a),u=this.tableProps.createCellCoords(n,o-1),c=this.tableProps.createCellRange(l,l,u).isValid({countRows:i,countCols:o,countRowHeaders:s,countColHeaders:0});if(c){let h=0,d=0;Number.isInteger(r==null?void 0:r.row)&&Number.isInteger(r==null?void 0:r.col)?(h=qe(r.row,Math.min(e,n),Math.max(e,n)),d=qe(r.col,a,o-1)):(h=e,d=qe(r,a,o-1));const f=this.tableProps.createCellCoords(h,d),m=s===0?0:qe(f.col,a,-1),C=o-1,y=this.tableProps.createCellCoords(e,m),E=this.tableProps.createCellCoords(n,C);this.runLocalHooks("beforeSelectRows",y,E,f),y.col=m,E.col=C,this.setRangeStartOnly(y,void 0,f),this.selectedByRowHeader.add(this.getLayerLevel()),this.setRangeEnd(E),this.runLocalHooks("afterSelectRows",y,E,f),this.finish()}return c}refresh(){if(!this.isSelected())return;const e=this.tableProps.countRows(),n=this.tableProps.countCols();if(e===0||n===0){this.deselect();return}const r=this.selectedRange.peekByIndex(this.selectedRange.size()-1),{from:i,to:o,highlight:s}=r;this.clear(),s.assign({row:qe(s.row,-1/0,e-1),col:qe(s.col,-1/0,n-1)}),i.assign({row:qe(i.row,-1/0,e-1),col:qe(i.col,-1/0,n-1)}),o.assign({row:qe(o.row,0,e-1),col:qe(o.col,0,n-1)}),this.selectedRange.ranges.push(r),this.highlight.isEnabledFor(Sh,this.selectedRange.current().highlight)&&this.highlight.getFocus().add(s).commit().syncWith(r),this.applyAndCommit(r)}commit(){if(this.highlight.getCustomSelections().forEach(i=>{i.commit()}),!this.isSelected())return;const n=this.getLayerLevel(),r=this.selectedRange.current();this.highlight.isEnabledFor(Sh,r.highlight)&&this.highlight.getFocus().commit().syncWith(r);for(let i=0;i<this.selectedRange.size();i+=1){this.highlight.useLayerLevel(i);const o=this.highlight.createArea(),s=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),u=this.highlight.createActiveRowHeader(),c=this.highlight.createActiveColumnHeader(),h=this.highlight.createActiveCornerHeader(),d=this.highlight.createRowHighlight(),f=this.highlight.createColumnHighlight();o.commit(),s.commit(),a.commit(),l.commit(),u.commit(),c.commit(),h.commit(),d.commit(),f.commit()}this.highlight.useLayerLevel(n)}}gt(fk,En);const Ax=/^(\r\n|\n\r|\r|\n)/,T3=/^[^\t\r\n]+/,Hx=/^\t/;function _3(t){const e=[[""]];if(t.length===0)return e;let n=0,r=0,i;for(;t.length>0&&i!==t.length;)if(i=t.length,t.match(Hx))t=t.replace(Hx,""),n+=1,e[r][n]="";else if(t.match(Ax))t=t.replace(Ax,""),n=0,r+=1,e[r]=[""];else{let o="";if(t.startsWith('"')){let s=0,a=!0;for(;a;){const l=t.slice(0,1);l==='"'&&(s+=1),o+=l,t=t.slice(1),(t.length===0||t.match(/^[\t\r\n]/)&&s%2===0)&&(a=!1)}o=o.replace(/^"/,"").replace(/"$/,"").replace(/["]*/g,l=>new Array(Math.floor(l.length/2)).fill('"').join(""))}else{const s=t.match(T3);o=s?s[0]:"",t=t.slice(o.length)}e[r][n]=o}return e}function Rh(t){let e,n,r,i,o="",s;for(e=0,n=t.length;e<n;e+=1){for(i=t[e].length,r=0;r<i;r+=1)r>0&&(o+=" "),s=t[e][r],typeof s=="string"?s.indexOf(`
71
- `)>-1?o+=`"${s.replace(/"/g,'""')}"`:o+=s:s==null?o+="":o+=s;e!==n-1&&(o+=`
72
- `)}return o}function fa(t,e,n){return(e=M3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function M3(t){var e=I3(t,"string");return typeof e=="symbol"?e:e+""}function I3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Su{static get DESTINATION_RENDERER(){return 1}static get DESTINATION_CLIPBOARD_GENERATOR(){return 2}constructor(e,n,r){fa(this,"hot",void 0),fa(this,"metaManager",void 0),fa(this,"tableMeta",void 0),fa(this,"dataSource",void 0),fa(this,"duckSchema",void 0),fa(this,"colToPropCache",void 0),fa(this,"propToColCache",void 0),this.hot=e,this.metaManager=r,this.tableMeta=r.getTableMeta(),this.dataSource=n,this.refreshDuckSchema(),this.createMap()}createMap(){const e=this.getSchema();if(typeof e>"u")throw new Error("trying to create `columns` definition but you didn't provide `schema` nor `data`");const n=this.tableMeta.columns;let r;if(this.colToPropCache=[],this.propToColCache=new Map,n){let i=0,o=0,s=!1;if(typeof n=="function"){const a=KR(e);i=a>0?a:this.countFirstRowKeys(),s=!0}else{const a=this.tableMeta.maxCols;i=Math.min(a,n.length)}for(r=0;r<i;r++){const a=s?n(r):n[r];if(De(a)){if(typeof a.data<"u"){const l=s?o:r;this.colToPropCache[l]=a.data,this.propToColCache.set(a.data,l)}o+=1}}}else this.recursiveDuckColumns(e)}countFirstRowKeys(){return KD(this.dataSource)}recursiveDuckColumns(e,n,r){let i=n,o=r,s;return typeof i>"u"&&(i=0,o=""),typeof e=="object"&&!Array.isArray(e)&&ke(e,(a,l)=>{a===null?(s=o+l,this.colToPropCache.push(s),this.propToColCache.set(s,i),i+=1):i=this.recursiveDuckColumns(a,i,`${l}.`)}),i}colToProp(e){if(Number.isInteger(e)===!1)return e;const n=this.hot.toPhysicalColumn(e);return n===null?e:this.colToPropCache&&ue(this.colToPropCache[n])?this.colToPropCache[n]:n}propToCol(e){const n=this.propToColCache.get(e);if(ue(n))return this.hot.toVisualColumn(n);const r=this.hot.toVisualColumn(e);return r===null?e:r}getSchema(){const e=this.tableMeta.dataSchema;return e?typeof e=="function"?e():e:this.duckSchema}createDuckSchema(){return this.dataSource&&this.dataSource[0]?Yh(this.dataSource[0]):{}}refreshDuckSchema(){this.duckSchema=this.createDuckSchema()}createRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:r,mode:i="above"}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.hot.countSourceRows();let s=o,a=0,l=e;if((typeof l!="number"||l>=o)&&(l=o),l<this.hot.countRows()&&(s=this.hot.toPhysicalRow(l)),this.hot.runHooks("beforeCreateRow",l,n,r)===!1||s===null)return{delta:0};const c=this.tableMeta.maxRows,h=this.getSchema().length,d=[];for(;a<n&&o+a<c;){let m=null;this.hot.dataType==="array"?this.tableMeta.dataSchema?m=Kn(this.getSchema()):(m=[],fe(h-1,()=>m.push(null))):this.hot.dataType==="function"?m=this.tableMeta.dataSchema(l+a):(m={},lp(m,this.getSchema())),d.push(m),a+=1}this.hot.rowIndexMapper.insertIndexes(l,a),i==="below"&&(s=Math.min(s+1,o)),this.spliceData(s,0,d);const f=this.hot.toVisualRow(s);return this.hot.countSourceRows()===d.length&&this.hot.columnIndexMapper.initToLength(this.hot.getInitialColumnCount()),a>0&&(e==null?this.metaManager.createRow(null,a):r!=="auto"&&this.metaManager.createRow(s,n)),this.hot.runHooks("afterCreateRow",f,a,r),{delta:a,startPhysicalIndex:s}}createCol(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:r,mode:i="start"}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!this.hot.isColumnModificationAllowed())throw new Error("Cannot create new column. When data source in an object, you can only have as much columns as defined in first data row, data schema or in the 'columns' setting.If you want to be able to add new columns, you have to use array datasource.");const o=this.dataSource,s=this.tableMeta.maxCols,a=this.hot.countSourceCols();let l=e;if((typeof l!="number"||l>=a)&&(l=a),this.hot.runHooks("beforeCreateCol",l,n,r)===!1)return{delta:0};let c=a;l<this.hot.countCols()&&(c=this.hot.toPhysicalColumn(l));const h=this.hot.countSourceRows();let d=this.hot.countCols(),f=0,m=c;i==="end"&&(m=Math.min(m+1,a));const C=m;for(;f<n&&d<s;){if(typeof l!="number"||l>=d)if(h>0)for(let E=0;E<h;E+=1)typeof o[E]>"u"&&(o[E]=[]),o[E].push(null);else o.push([null]);else for(let E=0;E<h;E++)o[E].splice(m,0,null);f+=1,m+=1,d+=1}this.hot.columnIndexMapper.insertIndexes(l,f),f>0&&(e==null?this.metaManager.createColumn(null,f):r!=="auto"&&this.metaManager.createColumn(C,n));const y=this.hot.toVisualColumn(C);return this.hot.runHooks("afterCreateCol",y,f,r),this.refreshDuckSchema(),{delta:f,startPhysicalIndex:C}}removeRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0,i=Number.isInteger(e)?e:-n;const o=this.visualRowsToPhysical(i,n),s=this.hot.countSourceRows();if(i=(s+i)%s,this.hot.runHooks("beforeRemoveRow",i,o.length,o,r)===!1)return!1;const l=o.length;if(this.filterData(i,l,o),i<this.hot.countRows()){this.hot.rowIndexMapper.removeIndexes(o);const c=ue(this.tableMeta.columns)||ue(this.tableMeta.dataSchema)||this.tableMeta.colHeaders;this.hot.rowIndexMapper.getNotTrimmedIndexesLength()===0&&!c&&this.hot.columnIndexMapper.setIndexesSequence([])}return o.slice(0).sort((c,h)=>h-c).forEach(c=>{this.metaManager.removeRow(c,1)}),this.hot.runHooks("afterRemoveRow",i,l,o,r),!0}removeCol(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0;if(this.hot.dataType==="object"||this.tableMeta.columns)throw new Error("cannot remove column with object data source or columns option specified");let i=typeof e!="number"?-n:e;i=(this.hot.countCols()+i)%this.hot.countCols();const o=this.visualColumnsToPhysical(i,n),s=o.slice(0).sort((h,d)=>d-h);if(this.hot.runHooks("beforeRemoveCol",i,n,o,r)===!1)return!1;let l=!0;const u=s.length,c=this.dataSource;for(let h=0;h<u;h++)l&&o[0]!==o[h]-h&&(l=!1);if(l)for(let h=0,d=this.hot.countSourceRows();h<d;h++)c[h].splice(o[0],n),h===0&&this.metaManager.removeColumn(o[0],n);else for(let h=0,d=this.hot.countSourceRows();h<d;h++)for(let f=0;f<u;f++)c[h].splice(s[f],1),h===0&&this.metaManager.removeColumn(s[f],1);return i<this.hot.countCols()&&(this.hot.columnIndexMapper.removeIndexes(o),!this.tableMeta.rowHeaders&&this.hot.columnIndexMapper.getNotTrimmedIndexesLength()===0&&this.hot.rowIndexMapper.setIndexesSequence([])),this.hot.runHooks("afterRemoveCol",i,n,o,r),this.refreshDuckSchema(),!0}spliceCol(e,n,r){const i=this.hot.getDataAtCol(e),o=i.slice(n,n+r),s=i.slice(n+r);for(var a=arguments.length,l=new Array(a>3?a-3:0),u=3;u<a;u++)l[u-3]=arguments[u];kP(l,s);let c=0;for(;c<r;)l.push(null),c+=1;return GU(l),this.hot.populateFromArray(n,e,l,null,null,"spliceCol"),o}spliceRow(e,n,r){const i=this.hot.getSourceDataAtRow(e),o=i.slice(n,n+r),s=i.slice(n+r);for(var a=arguments.length,l=new Array(a>3?a-3:0),u=3;u<a;u++)l[u-3]=arguments[u];kP(l,s);let c=0;for(;c<r;)l.push(null),c+=1;return this.hot.populateFromArray(e,n,[l],null,null,"spliceRow"),o}spliceData(e,n,r){if(this.hot.runHooks("beforeDataSplice",e,n,r)!==!1){const o=[...this.dataSource.slice(0,e),...r,...this.dataSource.slice(e)];this.dataSource.length=0,o.forEach(s=>this.dataSource.push(s))}}filterData(e,n,r){let i=this.hot.runHooks("filterData",e,n,r);Array.isArray(i)===!1&&(i=this.dataSource.filter((o,s)=>r.indexOf(s)===-1)),this.dataSource.length=0,Array.prototype.push.apply(this.dataSource,i)}get(e,n){const r=this.hot.toPhysicalRow(e);let i=this.dataSource[r];const o=this.hot.runHooks("modifyRowData",r);i=isNaN(o)?o:i;const{dataDotNotation:s}=this.hot.getSettings();let a=null;if(i&&i.hasOwnProperty&&sn(i,n))a=i[n];else if(s&&typeof n=="string"&&n.indexOf(".")>-1){let l=i;if(!l)return null;const u=n.split(".");for(let c=0,h=u.length;c<h;c++)if(l=l[u[c]],typeof l>"u")return null;a=l}else typeof n=="function"&&(a=n(this.dataSource.slice(r,r+1)[0]));if(this.hot.hasHook("modifyData")){const l=xr(a);this.hot.runHooks("modifyData",r,this.propToCol(n),l,"get"),l.isTouched()&&(a=l.value)}return a}getCopyable(e,n){return this.hot.getCellMeta(e,this.propToCol(n)).copyable?this.get(e,n):""}set(e,n,r){const i=this.hot.toPhysicalRow(e);let o=r,s=this.dataSource[i];const a=this.hot.runHooks("modifyRowData",i);if(s=isNaN(a)?a:s,this.hot.hasHook("modifyData")){const u=xr(o);this.hot.runHooks("modifyData",i,this.propToCol(n),u,"set"),u.isTouched()&&(o=u.value)}const{dataDotNotation:l}=this.hot.getSettings();if(s&&s.hasOwnProperty&&sn(s,n))s[n]=o;else if(l&&typeof n=="string"&&n.indexOf(".")>-1){let u=s,c=0,h;const d=n.split(".");for(c=0,h=d.length-1;c<h;c++){if(d[c]==="__proto__"||d[c]==="constructor"||d[c]==="prototype")return;typeof u[d[c]]>"u"&&(u[d[c]]={}),u=u[d[c]]}u[d[c]]=o}else if(typeof n=="function")n(this.dataSource.slice(i,i+1)[0],o);else{if(n==="__proto__"||n==="constructor"||n==="prototype")return;s[n]=o}}visualRowsToPhysical(e,n){const r=this.hot.countSourceRows(),i=[];let o=(r+e)%r,s=n,a;for(;o<r&&s;)a=this.hot.toPhysicalRow(o),i.push(a),s-=1,o+=1;return i}visualColumnsToPhysical(e,n){const r=this.hot.countCols(),i=[];let o=(r+e)%r,s=n;for(;o<r&&s;){const a=this.hot.toPhysicalColumn(o);i.push(a),s-=1,o+=1}return i}clear(){for(let e=0;e<this.hot.countSourceRows();e++)for(let n=0;n<this.hot.countCols();n++)this.set(e,this.colToProp(n),"")}getLength(){const e=this.tableMeta.maxRows;let n;e<0||e===0?n=0:n=e||1/0;const r=this.hot.rowIndexMapper.getNotTrimmedIndexesLength();return Math.min(r,n)}getAll(){const e={row:0,col:0},n={row:Math.max(this.hot.countRows()-1,0),col:Math.max(this.hot.countCols()-1,0)};return e.row-n.row===0&&!this.hot.countSourceRows()?[]:this.getRange(e,n,Su.DESTINATION_RENDERER)}countCachedColumns(){return this.colToPropCache.length}getRange(e,n,r){const i=[];let o,s,a;const l=this.tableMeta.maxRows,u=this.tableMeta.maxCols;if(l===0||u===0)return[];const c=r===Su.DESTINATION_CLIPBOARD_GENERATOR?this.getCopyable:this.get,h=Math.min(Math.max(l-1,0),Math.max(e.row,n.row)),d=Math.min(Math.max(u-1,0),Math.max(e.col,n.col));for(o=Math.min(e.row,n.row);o<=h;o++){a=[];const f=o>=0?this.hot.toPhysicalRow(o):o;for(s=Math.min(e.col,n.col);s<=d&&f!==null;s++)a.push(c.call(this,o,this.colToProp(s)));f!==null&&i.push(a)}return i}getText(e,n){return Rh(this.getRange(e,n,Su.DESTINATION_RENDERER))}getCopyableText(e,n){return Rh(this.getRange(e,n,Su.DESTINATION_CLIPBOARD_GENERATOR))}destroy(){this.hot=null,this.metaManager=null,this.dataSource=null,this.duckSchema=null,this.colToPropCache.length=0,this.propToColCache.clear(),this.propToColCache=void 0}}const{register:P3,getItem:O3,hasItem:gk,getNames:oue,getValues:sue}=Oi("cellTypes");function x3(t){if(!gk(t))throw Error(`You declared cell type "${t}" as a string that is not mapped to a known object.
73
- Cell type must be an object or a string mapped to an object registered by
74
- "Handsontable.cellTypes.registerCellType" method`);return O3(t)}function ci(t,e){typeof t!="string"&&(e=t,t=e.CELL_TYPE);const{editor:n,renderer:r,validator:i}=e;n&&Er(t,n),r&&Vr(t,r),i&&fu(t,i),P3(t,e)}function A3(t,e){var n;return t==="CELL_TYPE"?!1:((n=e._automaticallyAssignedMetaProps)===null||n===void 0?void 0:n.has(t))||!sn(e,t)}function Cp(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;const r=typeof e.type=="string"?x3(e.type):e.type;if(t._automaticallyAssignedMetaProps&&ke(e,(o,s)=>void t._automaticallyAssignedMetaProps.delete(s)),!De(r))return;n===t&&!t._automaticallyAssignedMetaProps&&(t._automaticallyAssignedMetaProps=new Set);const i={};ke(r,(o,s)=>{if(A3(s,n)){var a;i[s]=o,(a=t._automaticallyAssignedMetaProps)===null||a===void 0||a.add(s)}}),ln(t,i)}function H3(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];function n(){}Vz(n,t);for(let r=0;r<e.length;r++)n.prototype[e[r]]=void 0;return n}function Og(t){return Number.isInteger(t)&&t>=0}function xg(t,e){if(!t())throw new Error(`Assertion failed: ${e}`)}function ff(t){return t==null}const mk=()=>({_automaticallyAssignedMetaProps:void 0,activeHeaderClassName:"ht__active_highlight",allowEmpty:!0,allowHtml:!1,allowInsertColumn:!0,allowInsertRow:!0,allowInvalid:!0,allowRemoveColumn:!0,allowRemoveRow:!0,ariaTags:!0,autoColumnSize:void 0,autoRowSize:void 0,autoWrapCol:!1,autoWrapRow:!1,bindRowsWithHeaders:void 0,cell:[],cells:void 0,checkedTemplate:void 0,className:void 0,colHeaders:null,collapsibleColumns:void 0,columnHeaderHeight:void 0,columns:void 0,columnSorting:void 0,columnSummary:void 0,colWidths:void 0,commentedCellClassName:"htCommentCell",comments:!1,contextMenu:void 0,copyable:!0,copyPaste:!0,correctFormat:!1,currentColClassName:void 0,currentHeaderClassName:"ht__highlight",currentRowClassName:void 0,customBorders:!1,data:void 0,dataDotNotation:!0,dataSchema:void 0,dateFormat:"DD/MM/YYYY",timeFormat:"h:mm:ss a",datePickerConfig:void 0,defaultDate:void 0,disableVisualSelection:!1,dragToScroll:!0,dropdownMenu:void 0,editor:void 0,enterBeginsEditing:!0,enterMoves:{col:0,row:1},fillHandle:{autoInsertRow:!1},filter:!0,filteringCaseSensitive:!1,filters:void 0,fixedColumnsLeft:0,fixedColumnsStart:0,fixedRowsBottom:0,fixedRowsTop:0,formulas:void 0,fragmentSelection:!1,headerClassName:void 0,height:void 0,hiddenColumns:void 0,hiddenRows:void 0,invalidCellClassName:"htInvalid",imeFastEdit:!1,isEmptyCol(t){let e,n,r;for(e=0,n=this.countRows();e<n;e++)if(r=this.getDataAtCell(e,t),Yt(r)===!1)return!1;return!0},isEmptyRow(t){let e,n,r,i;for(e=0,n=this.countCols();e<n;e++)if(r=this.getDataAtCell(t,e),Yt(r)===!1)return typeof r=="object"?(i=this.getCellMeta(t,e),qR(this.getSchema()[i.prop],r)):!1;return!0},label:void 0,language:"en-US",layoutDirection:"inherit",licenseKey:void 0,locale:"en-US",manualColumnFreeze:void 0,manualColumnMove:void 0,manualColumnResize:void 0,manualRowMove:void 0,manualRowResize:void 0,maxCols:1/0,maxRows:1/0,mergeCells:!1,minCols:0,minRows:0,minSpareCols:0,minSpareRows:0,multiColumnSorting:void 0,navigableHeaders:!1,tabNavigation:!0,nestedHeaders:void 0,nestedRows:void 0,noWordWrapClassName:"htNoWrap",numericFormat:void 0,observeDOMVisibility:!0,outsideClickDeselects:!0,persistentState:void 0,placeholder:void 0,placeholderCellClassName:"htPlaceholder",preventOverflow:!1,preventWheel:!1,readOnly:!1,readOnlyCellClassName:"htDimmed",renderAllRows:!1,renderAllColumns:!1,renderer:void 0,rowHeaders:void 0,rowHeaderWidth:void 0,rowHeights:void 0,search:!1,selectionMode:"multiple",selectOptions:void 0,skipColumnOnPaste:!1,skipRowOnPaste:!1,sortByRelevance:!0,source:void 0,startCols:5,startRows:5,stretchH:"none",strict:void 0,tableClassName:void 0,themeName:void 0,tabMoves:{row:0,col:1},title:void 0,trimDropdown:!0,trimRows:void 0,trimWhitespace:!0,type:"text",uncheckedTemplate:void 0,undo:!0,validator:void 0,viewportColumnRenderingOffset:"auto",viewportRowRenderingOffset:"auto",viewportColumnRenderingThreshold:0,viewportRowRenderingThreshold:0,visibleRows:10,width:void 0,wordWrap:!0});function Nx(t,e,n){return(e=N3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function N3(t){var e=D3(t,"string");return typeof e=="symbol"?e:e+""}function D3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function k3(){return class{}}class L3{constructor(e){Nx(this,"metaCtor",k3()),Nx(this,"meta",void 0),this.meta=this.metaCtor.prototype,ln(this.meta,mk()),this.meta.instance=e}getMetaConstructor(){return this.metaCtor}getMeta(){return this.meta}updateMeta(e){var n;ln(this.meta,e),Cp(this.meta,{...e,type:(n=e.type)!==null&&n!==void 0?n:this.meta.type},e)}}function $3(t,e,n){return(e=F3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function F3(t){var e=V3(t,"string");return typeof e=="symbol"?e:e+""}function V3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class W3{constructor(e){$3(this,"meta",void 0);const n=e.getMetaConstructor();this.meta=new n}getMeta(){return this.meta}updateMeta(e){ln(this.meta,e),Cp(this.meta,e,e)}}function gf(t,e,n){return(e=B3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function B3(t){var e=j3(t,"string");return typeof e=="symbol"?e:e+""}function j3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class om{constructor(e){gf(this,"valueFactory",void 0),gf(this,"data",[]),gf(this,"index",[]),gf(this,"holes",new Set),this.valueFactory=e}obtain(e){xg(()=>Og(e),"Expecting an unsigned number.");const n=this._getStorageIndexByKey(e);let r;if(n>=0)r=this.data[n],r===void 0&&(r=this.valueFactory(e),this.data[n]=r);else if(r=this.valueFactory(e),this.holes.size>0){const i=this.holes.values().next().value;this.holes.delete(i),this.data[i]=r,this.index[e]=i}else this.data.push(r),this.index[e]=this.data.length-1;return r}insert(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;xg(()=>Og(e)||ff(e),"Expecting an unsigned number or null/undefined argument.");const r=[],i=this.data.length;for(let s=0;s<n;s++)r.push(i+s),this.data.push(void 0);const o=ff(e)?this.index.length:e;this.index=[...this.index.slice(0,o),...r,...this.index.slice(o)]}remove(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;xg(()=>Og(e)||ff(e),"Expecting an unsigned number or null/undefined argument.");const r=this.index.splice(ff(e)?this.index.length-n:e,n);for(let i=0;i<r.length;i++){const o=r[i];typeof o=="number"&&this.holes.add(o)}}size(){return this.data.length-this.holes.size}values(){return this.data.filter((e,n)=>e!==void 0&&!this.holes.has(n))[Symbol.iterator]()}entries(){const e=[];for(let r=0;r<this.data.length;r++){const i=this._getKeyByStorageIndex(r);i!==-1&&this.data[r]!==void 0&&e.push([i,this.data[r]])}let n=0;return{next:()=>{if(n<e.length){const r=e[n];return n+=1,{value:r,done:!1}}return{done:!0}}}}clear(){this.data=[],this.index=[],this.holes.clear()}_getStorageIndexByKey(e){return this.index.length>e?this.index[e]:-1}_getKeyByStorageIndex(e){return this.index.indexOf(e)}[Symbol.iterator](){return this.entries()}}function Dx(t,e,n){return(e=U3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function U3(t){var e=z3(t,"string");return typeof e=="symbol"?e:e+""}function z3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Y3=["data","width"];class G3{constructor(e){Dx(this,"globalMeta",void 0),Dx(this,"metas",new om(()=>this._createMeta())),this.globalMeta=e,this.metas=new om(()=>this._createMeta())}updateMeta(e,n){const r=this.getMeta(e);ln(r,n),Cp(r,n)}createColumn(e,n){this.metas.insert(e,n)}removeColumn(e,n){this.metas.remove(e,n)}getMeta(e){return this.metas.obtain(e)}getMetaConstructor(e){return this.metas.obtain(e).constructor}clearCache(){this.metas.clear()}_createMeta(){return H3(this.globalMeta.getMetaConstructor(),Y3).prototype}}function kx(t,e,n){return(e=q3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function q3(t){var e=K3(t,"string");return typeof e=="symbol"?e:e+""}function K3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class X3{constructor(e){kx(this,"columnMeta",void 0),kx(this,"metas",new om(()=>this._createRow())),this.columnMeta=e}updateMeta(e,n,r){const i=this.getMeta(e,n);ln(i,r),Cp(i,r)}createRow(e,n){this.metas.insert(e,n)}createColumn(e,n){for(let r=0;r<this.metas.size();r++)this.metas.obtain(r).insert(e,n)}removeRow(e,n){this.metas.remove(e,n)}removeColumn(e,n){for(let r=0;r<this.metas.size();r++)this.metas.obtain(r).remove(e,n)}getMeta(e,n,r){const i=this.metas.obtain(e).obtain(n);return r===void 0?i:i[r]}setMeta(e,n,r,i){var o;const s=this.metas.obtain(e).obtain(n);(o=s._automaticallyAssignedMetaProps)===null||o===void 0||o.delete(r),s[r]=i}removeMeta(e,n,r){const i=this.metas.obtain(e).obtain(n);delete i[r]}getMetas(){const e=[],n=Array.from(this.metas.values());for(let r=0;r<n.length;r++)ue(n[r])&&e.push(...n[r].values());return e}getMetasAtRow(e){xg(()=>Og(e),"Expecting an unsigned number.");const n=new Map(this.metas);return n.has(e)?Array.from(n.get(e).values()):[]}clearCache(){this.metas.clear()}_createRow(){return new om(e=>this._createMeta(e))}_createMeta(e){const n=this.columnMeta.getMetaConstructor(e);return new n}}class pk{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];this.hot=e,this.globalMeta=new L3(e),this.tableMeta=new W3(this.globalMeta),this.columnMeta=new G3(this.globalMeta),this.cellMeta=new X3(this.columnMeta),r.forEach(i=>new i(this)),this.globalMeta.updateMeta(n)}getGlobalMeta(){return this.globalMeta.getMeta()}updateGlobalMeta(e){this.globalMeta.updateMeta(e)}getTableMeta(){return this.tableMeta.getMeta()}updateTableMeta(e){this.tableMeta.updateMeta(e)}getColumnMeta(e){return this.columnMeta.getMeta(e)}updateColumnMeta(e,n){this.columnMeta.updateMeta(e,n)}getCellMeta(e,n,r){const i=this.cellMeta.getMeta(e,n);return i.visualRow=r.visualRow,i.visualCol=r.visualColumn,i.row=e,i.col=n,r.skipMetaExtension||this.runLocalHooks("afterGetCellMeta",i),i}getCellMetaKeyValue(e,n,r){if(typeof r!="string")throw new Error("The passed cell meta object key is not a string");return this.cellMeta.getMeta(e,n,r)}setCellMeta(e,n,r,i){this.cellMeta.setMeta(e,n,r,i)}updateCellMeta(e,n,r){this.cellMeta.updateMeta(e,n,r)}removeCellMeta(e,n,r){this.cellMeta.removeMeta(e,n,r)}getCellsMeta(){return this.cellMeta.getMetas()}getCellsMetaAtRow(e){return this.cellMeta.getMetasAtRow(e)}createRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.createRow(e,n)}removeRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.removeRow(e,n)}createColumn(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.createColumn(e,n),this.columnMeta.createColumn(e,n)}removeColumn(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.removeColumn(e,n),this.columnMeta.removeColumn(e,n)}clearCellsCache(){this.cellMeta.clearCache()}clearCache(){this.cellMeta.clearCache(),this.columnMeta.clearCache()}}gt(pk,En);function Lx(t,e,n,r){const{hotInstance:i,dataMap:o,dataSource:s,internalSource:a,source:l,metaManager:u,firstRun:c}=r,h=Ti(a),d=i.getSettings();Array.isArray(d.dataSchema)?i.dataType="array":ut(d.dataSchema)?i.dataType="function":i.dataType="object",o&&o.destroy(),t=i.runHooks(`before${h}`,t,c,l);const f=new Su(i,t,u);if(e(f),typeof t=="object"&&t!==null)t.push&&t.splice||(t=[t]);else if(t===null){const m=f.getSchema();t=[];let C,y=0,E=0;for(y=0,E=d.startRows;y<E;y++)if((i.dataType==="object"||i.dataType==="function")&&d.dataSchema)C=Kn(m),t.push(C);else if(i.dataType==="array")C=Kn(m[0]),t.push(C);else{C=[];for(let v=0,O=d.startCols;v<O;v++)C.push(null);t.push(C)}}else throw new Error(`${a} only accepts array of objects or array of arrays (${typeof t} given)`);Array.isArray(t[0])&&(i.dataType="array"),d.data=t,f.dataSource=t,s.data=t,s.dataType=i.dataType,s.colToProp=f.colToProp.bind(f),s.propToCol=f.propToCol.bind(f),s.countCachedColumns=f.countCachedColumns.bind(f),n(f),i.runHooks(`after${h}`,t,c,l),c||(i.runHooks("afterChange",null,a),i.render()),i.getSettings().ariaTags&&Re(i.rootElement,[qN(-1),ip(i.countCols()+(i.view?i.countRowHeaders():0))])}function $x(t,e,n){return(e=Z3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Z3(t){var e=J3(t,"string");return typeof e=="symbol"?e:e+""}function J3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Q3{constructor(e){var n=this;$x(this,"metaManager",void 0),$x(this,"metaSyncMemo",new Map),this.metaManager=e,e.addLocalHook("afterGetCellMeta",function(){return n.extendCellMeta(...arguments)}),ie.getSingleton().add("beforeRender",r=>{r&&this.metaSyncMemo.clear()},this.metaManager.hot)}extendCellMeta(e){var n;const{row:r,col:i}=e;if((n=this.metaSyncMemo.get(r))!==null&&n!==void 0&&n.has(i))return;const{visualRow:o,visualCol:s}=e,a=this.metaManager.hot,l=a.colToProp(s);e.prop=l,a.runHooks("beforeGetCellMeta",o,s,e);const u=sn(e,"type")?e.type:null;let c=ut(e.cells)?e.cells(r,i,l):null;if(u)if(c){var h;c.type=(h=c.type)!==null&&h!==void 0?h:u}else c={type:u};c&&this.metaManager.updateCellMeta(r,i,c),a.runHooks("afterGetCellMeta",o,s,e),this.metaSyncMemo.has(r)||this.metaSyncMemo.set(r,new Set),this.metaSyncMemo.get(r).add(i)}}function eX(t,e,n){tX(t,e),e.set(t,n)}function tX(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function dy(t,e,n){return(e=nX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nX(t){var e=rX(t,"string");return typeof e=="symbol"?e:e+""}function rX(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function iX(t,e){return t.get(oX(t,e))}function oX(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Fx=new WeakMap;class sX{constructor(e){dy(this,"metaManager",void 0),dy(this,"usageTracker",new Set),dy(this,"propDescriptors",new Map([["ariaTags",{initOnly:!0}],["fixedColumnsLeft",{target:"fixedColumnsStart",onChange(n){if(this.metaManager.hot.isRtl()&&n==="fixedColumnsLeft")throw new Error("The `fixedColumnsLeft` is not supported for RTL. Please use option `fixedColumnsStart`.");if(this.usageTracker.has("fixedColumnsLeft")&&this.usageTracker.has("fixedColumnsStart"))throw new Error("The `fixedColumnsLeft` and `fixedColumnsStart` should not be used together. Please use only the option `fixedColumnsStart`.")}}],["layoutDirection",{initOnly:!0}],["renderAllColumns",{initOnly:!0}],["renderAllRows",{initOnly:!0}]])),eX(this,Fx,(n,r,i)=>{if(!i)throw new Error(`The \`${n}\` option can not be updated after the Handsontable is initialized.`)}),this.metaManager=e,this.extendMetaProps()}extendMetaProps(){this.propDescriptors.forEach((e,n)=>{const{initOnly:r,target:i,onChange:o}=e,s=typeof i=="string",a=s?i:n,l=`_${a}`;this.metaManager.globalMeta.meta[l]=this.metaManager.globalMeta.meta[a],o?(this.installPropWatcher(n,l,o),s&&this.installPropWatcher(i,l,o)):r&&(this.installPropWatcher(n,l,iX(Fx,this)),this.metaManager.globalMeta.meta._initOnlySettings||(this.metaManager.globalMeta.meta._initOnlySettings=[]),this.metaManager.globalMeta.meta._initOnlySettings.push(n))})}installPropWatcher(e,n,r){const i=this;Object.defineProperty(this.metaManager.globalMeta.meta,e,{get(){return this[n]},set(o){const s=!i.usageTracker.has(e);i.usageTracker.add(e),r.call(i,e,o,s),this[n]=o},enumerable:!0,configurable:!0})}}const wk="gridDefault",ta="editorManager.handlingEditor",aX={name:"editorCloseAndSave",callback(t){t._getEditorManager().closeEditorAndSaveChanges()}},lX="hooksRefRegisterer",vk={_hooksStorage:Object.create(null),addHook(t,e){return this._hooksStorage[t]||(this._hooksStorage[t]=[]),this.hot.addHook(t,e),this._hooksStorage[t].push(e),this},removeHooksByKey(t){H(this._hooksStorage[t]||[],e=>{this.hot.removeHook(t,e)})},clearHooks(){ke(this._hooksStorage,(t,e)=>this.removeHooksByKey(e)),this._hooksStorage={}}};us(vk,"MIXIN_NAME",lX,{writable:!1,enumerable:!1});function oi(t,e,n){return(e=uX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uX(t){var e=cX(t,"string");return typeof e=="symbol"?e:e+""}function cX(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const hX="base",Ut=Object.freeze({VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"});class ec{static get EDITOR_TYPE(){return hX}constructor(e){oi(this,"hot",void 0),oi(this,"state",Ut.VIRGIN),oi(this,"_opened",!1),oi(this,"_fullEditMode",!1),oi(this,"_closeCallback",null),oi(this,"TD",null),oi(this,"row",null),oi(this,"col",null),oi(this,"prop",null),oi(this,"originalValue",null),oi(this,"cellProperties",null),this.hot=e,this.init()}_fireCallbacks(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)}init(){}getValue(){throw Error("Editor getValue() method unimplemented")}setValue(){throw Error("Editor setValue() method unimplemented")}open(){throw Error("Editor open() method unimplemented")}close(){throw Error("Editor close() method unimplemented")}prepare(e,n,r,i,o,s){this.TD=i,this.row=e,this.col=n,this.prop=r,this.originalValue=o,this.cellProperties=s,this.state=this.isOpened()?this.state:Ut.VIRGIN}extend(){return class extends this.constructor{}}saveValue(e,n){let r,i,o,s;if(n){const l=this.hot.getSelectedLast();r=Math.max(Math.min(l[0],l[2]),0),i=Math.max(Math.min(l[1],l[3]),0),o=Math.max(l[0],l[2]),s=Math.max(l[1],l[3])}else[r,i,o,s]=[this.row,this.col,null,null];const a=this.hot.runHooks("modifyGetCellCoords",r,i,!1,"meta");Array.isArray(a)&&([r,i]=a),this.hot.populateFromArray(r,i,e,o,s,"edit")}beginEditing(e,n){if(this.state!==Ut.VIRGIN)return;const r=this.hot,i=r.rowIndexMapper.getRenderableFromVisualIndex(this.row),o=r.columnIndexMapper.getRenderableFromVisualIndex(this.col),s=()=>{if(this.state=Ut.EDITING,this.isInFullEditMode()){const l=typeof e=="string"?e:At(this.originalValue);this.setValue(l)}this.open(n),this._opened=!0,this.focus(),r.view.render(),r.runHooks("afterBeginEditing",this.row,this.col)};this.hot.addHookOnce("afterScroll",s),r.view.scrollViewport(r._createCellCoords(i,o))||(this.hot.removeHook("afterScroll",s),s())}finishEditing(e,n,r){let i;if(r){const o=this._closeCallback;this._closeCallback=s=>{o&&o(s),r(s),this.hot.view.render()}}if(!this.isWaiting()){if(this.state===Ut.VIRGIN){this.hot._registerTimeout(()=>{this._fireCallbacks(!0)});return}if(this.state===Ut.EDITING){if(e){this.cancelChanges(),this.hot.view.render();return}const o=this.getValue();this.cellProperties.trimWhitespace?i=[[typeof o=="string"?String.prototype.trim.call(o||""):o]]:i=[[o]],this.state=Ut.WAITING,this.saveValue(i,n),this.hot.getCellValidator(this.cellProperties)?this.hot.addHookOnce("postAfterValidate",s=>{this.state=Ut.FINISHED,this.discardEditor(s)}):(this.state=Ut.FINISHED,this.discardEditor(!0))}}}cancelChanges(){this.state=Ut.FINISHED,this.discardEditor()}discardEditor(e){this.state===Ut.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.hot.selectCell(this.row,this.col),this.focus(),this.state=Ut.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Ut.VIRGIN,this._fireCallbacks(!0),this.hot.getShortcutManager().setActiveContextName("grid")))}enableFullEditMode(){this._fullEditMode=!0}isInFullEditMode(){return this._fullEditMode}isOpened(){return this._opened}isWaiting(){return this.state===Ut.WAITING}getEditedCellRect(){var e;const n=this.getEditedCell();if(!n)return;const{wtOverlays:r,wtViewport:i}=this.hot.view._wt,o=this.hot.rootWindow,s=Nn(n),a=Xt(n),l=Nn(this.hot.rootElement),u=Xt(this.hot.rootElement),c=r.topOverlay.holder,h=r.inlineStartOverlay.holder,d=c!==o?c.scrollTop:0,f=h!==o?h.scrollLeft:0,m=o.innerWidth-l.left-u,{wtTable:C}=(e=r.getParentOverlay(n))!==null&&e!==void 0?e:this.hot.view._wt,y=C.name,E=["master","inline_start"].includes(y)?d:0,v=["master","top","bottom"].includes(y)?f:0,O=s.top===l.top?0:1;let x=s.top-l.top-O-E,F=0;this.hot.isRtl()?F=o.innerWidth-s.left-a-m-1+v:F=s.left-l.left-1-v,["top","top_inline_start_corner"].includes(y)&&(x+=r.topOverlay.getOverlayOffset()),["inline_start","top_inline_start_corner"].includes(y)&&(F+=Math.abs(r.inlineStartOverlay.getOverlayOffset()));const I=this.hot.hasColHeaders(),_=this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row),q=this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col),U=this.hot.rowIndexMapper.getRenderableIndexesLength()-this.hot.view._wt.getSetting("fixedRowsBottom");(I&&_<=0||_===U)&&(x+=1),q<=0&&(F+=1);const J=i.rowsRenderCalculator.startPosition,te=i.columnsRenderCalculator.startPosition,le=Math.abs(r.inlineStartOverlay.getScrollPosition()),ne=r.topOverlay.getScrollPosition(),se=yn(this.hot.rootDocument);let Ge=n.offsetTop;if(["inline_start","master"].includes(y)&&(Ge+=J-ne),["bottom","bottom_inline_start_corner"].includes(y)){const{wtViewport:z,wtTable:Y}=r.bottomOverlay.clone;Ge+=z.getWorkspaceHeight()-Y.getHeight()-se}let ve=n.offsetLeft;this.hot.isRtl()?(ve>=0?ve=C.getWidth()-n.offsetLeft:ve=Math.abs(ve),ve+=te-le-a):["top","master","bottom"].includes(y)&&(ve+=te-le);const Oe=o.getComputedStyle(this.TD),it=this.hot.isRtl()?"borderRightWidth":"borderLeftWidth",Le=parseInt(Oe[it],10)>0?0:1,P=parseInt(Oe.borderTopWidth,10)>0?0:1,g=Xt(n)+Le,w=an(n)+P,p=iD(c)?se:0,T=oD(h)?se:0,M=this.hot.view.maximumVisibleElementWidth(ve)-p+Le,V=Math.max(this.hot.view.maximumVisibleElementHeight(Ge)-T+P,this.hot.view.getDefaultRowHeight());return{top:x,start:F,height:w,maxHeight:V,width:g,maxWidth:M}}getEditedCellsLayerClass(){switch(this.checkEditorSection()){case"inline-start":return"ht_clone_left ht_clone_inline_start";case"bottom":return"ht_clone_bottom";case"bottom-inline-start-corner":return"ht_clone_bottom_left_corner ht_clone_bottom_inline_start_corner";case"top":return"ht_clone_top";case"top-inline-start-corner":return"ht_clone_top_left_corner ht_clone_top_inline_start_corner";default:return"ht_clone_master"}}getEditedCell(){return this.hot.getCell(this.row,this.col,!0)}checkEditorSection(){const e=this.hot.countRows();let n="";return this.row<this.hot.getSettings().fixedRowsTop?this.col<this.hot.getSettings().fixedColumnsStart?n="top-inline-start-corner":n="top":this.hot.getSettings().fixedRowsBottom&&this.row>=e-this.hot.getSettings().fixedRowsBottom?this.col<this.hot.getSettings().fixedColumnsStart?n="bottom-inline-start-corner":n="bottom":this.col<this.hot.getSettings().fixedColumnsStart&&(n="inline-start"),n}}gt(ec,vk);const dX={name:"editorCloseAndSaveByArrowKeys",callback(t,e,n){const r=t._getEditorManager(),i=r.getActiveEditor();i.isInFullEditMode()&&i.state===Ut.EDITING||(r.closeEditorAndSaveChanges(),t.getSelected()&&(n.includes("arrowdown")?t.selection.transformStart(1,0):n.includes("arrowup")?t.selection.transformStart(-1,0):n.includes("arrowleft")?t.selection.transformStart(0,-1*t.getDirectionFactor()):n.includes("arrowright")&&t.selection.transformStart(0,t.getDirectionFactor())),e.preventDefault())}},fX={name:"editorCloseAndSaveByEnter",callback(t,e){const n=t._getEditorManager();n.closeEditorAndSaveChanges(e.ctrlKey||e.metaKey),n.moveSelectionAfterEnter(e)}},gX={name:"editorCloseWithoutSaving",callback(t){const e=t._getEditorManager();e.closeEditorAndRestoreOriginalValue(t.getShortcutManager().isCtrlPressed()),e.activeEditor.focus()}},mX={name:"editorFastOpen",callback(t,e){const{highlight:n}=t.getSelectedRangeLast();n.isHeader()||t._getEditorManager().openEditor(null,e,!0)}},pX={name:"editorOpen",callback(t,e,n){const r=t._getEditorManager(),i=t.getSelectedRangeLast(),{highlight:o}=i;if(t.selection.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0){const s=t.getSettings(),a=typeof s.enterMoves=="function"?s.enterMoves(e):s.enterMoves;n.includes("shift")?t.selection.transformFocus(-a.row,-a.col):t.selection.transformFocus(a.row,a.col);return}o.isHeader()||(t.getSettings().enterBeginsEditing?r.cellProperties.readOnly?r.moveSelectionAfterEnter(e):r.openEditor(null,e,!0):r.moveSelectionAfterEnter(e),Pi(e))}};function wX(){return[aX,dX,fX,gX,mX,pX]}const vX={name:"extendCellsSelectionDown",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeLast();!e.isSelectedByColumnHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByRowHeader())&&(e.markSource("keyboard"),e.transformEnd(1,0),e.markEndSource())}},CX={name:"extendCellsSelectionDownByViewportHeight",callback(t){const{selection:e,rowIndexMapper:n}=t,{to:r}=t.getSelectedRangeLast(),i=Math.min(r.row+t.countVisibleRows(),t.countRows()-1),o=n.getNearestNotHiddenIndex(i,-1);if(o!==null){const s=t._createCellCoords(o,r.col),a=r.row-t.getFirstFullyVisibleRow(),l=Math.min(s.row-a,t.countRows()-1);e.markSource("keyboard"),e.setRangeEnd(s),e.markEndSource(),t.scrollViewportTo({row:l,verticalSnap:"top",horizontalSnap:"start"})}}},yX={name:"extendCellsSelectionLeft",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeLast();!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByColumnHeader())&&(e.markSource("keyboard"),e.transformEnd(0,-1*t.getDirectionFactor()),e.markEndSource())}},SX={name:"extendCellsSelectionRight",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeLast();!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByColumnHeader())&&(e.markSource("keyboard"),e.transformEnd(0,t.getDirectionFactor()),e.markEndSource())}},bX={name:"extendCellsSelectionToColumns",callback(t){const{selection:e}=t,{highlight:n,from:r,to:i}=t.getSelectedRangeLast();e.markSource("keyboard"),e.isSelectedByRowHeader()?e.selectAll(!0,!0):t.selectColumns(r.col,i.col,n),e.markEndSource()}},RX={name:"extendCellsSelectionToMostBottom",callback(t){const{selection:e,rowIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&e.isSelectedByRowHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(t.countRows()-1,-1),l=i.clone();l.row=r.row,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,o.col)),e.markEndSource()}}},EX={name:"extendCellsSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast();if(!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&r.isCell()){const s=n.getNearestNotHiddenIndex(t.countCols()-1,-1),a=i.clone();a.col=r.col,e.markSource("keyboard"),e.setRangeStart(a,void 0,!1,r.clone()),e.setRangeEnd(t._createCellCoords(o.row,s)),e.markEndSource()}}},TX={name:"extendCellsSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast();if(!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&r.isCell()){const s=parseInt(t.getSettings().fixedColumnsStart,10),a=n.getNearestNotHiddenIndex(s,1),l=i.clone();l.col=r.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},_X={name:"extendCellsSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&e.isSelectedByColumnHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]),l=i.clone();l.col=r.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},MX={name:"extendCellsSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&e.isSelectedByColumnHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]),l=i.clone();l.col=r.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},IX={name:"extendCellsSelectionToMostTop",callback(t){const{selection:e,rowIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&e.isSelectedByRowHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(0,1),l=i.clone();l.row=r.row,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,o.col)),e.markEndSource()}}},PX={name:"extendCellsSelectionToRows",callback(t){const{selection:e}=t,{highlight:n,from:r,to:i}=t.getSelectedRangeLast();e.markSource("keyboard"),e.isSelectedByColumnHeader()?e.selectAll(!0,!0):t.selectRows(r.row,i.row,n),e.markEndSource()}},OX={name:"extendCellsSelectionUp",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeLast();!e.isSelectedByColumnHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByRowHeader())&&(e.markSource("keyboard"),e.transformEnd(-1,0),e.markEndSource())}},xX={name:"extendCellsSelectionUpByViewportHeight",callback(t){const{selection:e,rowIndexMapper:n}=t,{to:r}=t.getSelectedRangeLast(),i=Math.max(r.row-t.countVisibleRows(),0),o=n.getNearestNotHiddenIndex(i,1);if(o!==null){const s=t._createCellCoords(o,r.col),a=r.row-t.getFirstFullyVisibleRow(),l=Math.max(s.row-a,0);e.markSource("keyboard"),e.setRangeEnd(s),e.markEndSource(),t.scrollViewportTo({row:l,verticalSnap:"top",horizontalSnap:"start"})}}};function AX(){return[vX,CX,yX,SX,bX,RX,EX,TX,_X,MX,IX,PX,OX,xX]}const HX={name:"moveCellSelectionDown",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.transformStart(1,0),e.markEndSource()}},NX={name:"moveCellSelectionDownByViewportHeight",callback(t){const{selection:e}=t,{navigableHeaders:n}=t.getSettings(),r=n?t.countColHeaders():0,{row:i}=t.getSelectedRangeLast().highlight;let o=t.countVisibleRows()+r;o=o===0?1:o,i===t.countRows()-1?o=1:i+o>t.countRows()&&(o=t.countRows()-i-1),e.markSource("keyboard"),e.transformStart(o,0),e.markEndSource(),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}},DX={name:"moveCellSelectionInlineEnd",callback(t,e){const{selection:n}=t,r=t.getSettings(),i=t.getSelectedRangeLast(),o=typeof r.tabMoves=="function"?r.tabMoves(e):r.tabMoves;n.markSource("keyboard"),n.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?n.transformFocus(-o.row,-o.col):n.transformStart(-o.row,-o.col),n.markEndSource()}},kX={name:"moveCellSelectionInlineStart",callback(t,e){const{selection:n}=t,r=t.getSettings(),i=t.getSelectedRangeLast(),o=typeof r.tabMoves=="function"?r.tabMoves(e):r.tabMoves;n.markSource("keyboard"),n.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?n.transformFocus(o.row,o.col):n.transformStart(o.row,o.col),n.markEndSource()}},LX={name:"moveCellSelectionLeft",callback(t){const{selection:e}=t;e.markSource("keyboard"),e.transformStart(0,-1*t.getDirectionFactor()),e.markEndSource()}},$X={name:"moveCellSelectionRight",callback(t){const{selection:e}=t;e.markSource("keyboard"),e.transformStart(0,t.getDirectionFactor()),e.markEndSource()}},FX={name:"moveCellSelectionToMostBottom",callback(t){const{selection:e}=t,{col:n}=t.getSelectedRangeLast().highlight;let r=t.rowIndexMapper.getNearestNotHiddenIndex(t.countRows()-1,-1);r===null&&(r=-1),e.setRangeStart(t._createCellCoords(r,n))}},VX={name:"moveCellSelectionToMostBottomInlineEnd",callback(t){const{selection:e,rowIndexMapper:n,columnIndexMapper:r}=t,i=parseInt(t.getSettings().fixedRowsBottom,10),o=n.getNearestNotHiddenIndex(t.countRows()-i-1,-1),s=r.getNearestNotHiddenIndex(t.countCols()-1,-1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(o,s)),e.markEndSource()}},WX={name:"moveCellSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:n}=t;e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(t.getSelectedRangeLast().highlight.row,n.getNearestNotHiddenIndex(t.countCols()-1,-1))),e.markEndSource()}},BX={name:"moveCellSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:n}=t,r=parseInt(t.getSettings().fixedColumnsStart,10),i=t.getSelectedRangeLast().highlight.row,o=n.getNearestNotHiddenIndex(r,1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(i,o)),e.markEndSource()}},jX={name:"moveCellSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:n}=t,r=t.getSelectedRangeLast().highlight.row;let i=n.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]);i===null&&(i=t.isRtl()?-1:-t.countRowHeaders()),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(r,i)),e.markEndSource()}},UX={name:"moveCellSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:n}=t,{row:r}=t.getSelectedRangeLast().highlight;let i=n.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]);i===null&&(i=t.isRtl()?-t.countRowHeaders():-1),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(r,i)),e.markEndSource()}},zX={name:"moveCellSelectionToMostTop",callback(t){const{selection:e}=t,{col:n}=t.getSelectedRangeLast().highlight;let r=t.rowIndexMapper.getNearestNotHiddenIndex(0,1);r===null&&(r=-t.countColHeaders()),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(r,n)),e.markEndSource()}},YX={name:"moveCellSelectionToMostTopInlineStart",callback(t){const{selection:e,rowIndexMapper:n,columnIndexMapper:r}=t,i=parseInt(t.getSettings().fixedRowsTop,10),o=parseInt(t.getSettings().fixedColumnsStart,10),s=n.getNearestNotHiddenIndex(i,1),a=r.getNearestNotHiddenIndex(o,1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(s,a)),e.markEndSource()}},GX={name:"moveCellSelectionUp",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.transformStart(-1,0),e.markEndSource()}},qX={name:"moveCellSelectionUpByViewportHight",callback(t){const{selection:e}=t,{navigableHeaders:n}=t.getSettings(),r=n?t.countColHeaders():0,{row:i}=t.getSelectedRangeLast().highlight;let o=t.countVisibleRows()+r;o=o===0?-1:-o,i===-r?o=-1:i+o<r&&(o=-(i+r)),e.markSource("keyboard"),e.transformStart(o,0),e.markEndSource(),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}};function KX(){return[HX,NX,DX,kX,LX,$X,FX,VX,WX,BX,jX,UX,zX,YX,GX,qX]}const XX={name:"emptySelectedCells",callback(t){t.emptySelectedCells(),t._getEditorManager().prepareEditor()}},ZX={name:"scrollToFocusedCell",callback(t){const{highlight:e}=t.getSelectedRangeLast(),n=t.getFirstFullyVisibleRow()-1,r=t.getFirstFullyVisibleColumn()-1,i=t.getLastFullyVisibleRow()+1,o=t.getLastFullyVisibleColumn()+1,s=t._createCellCoords(n,r),a=t._createCellCoords(i,o);if(!t._createCellRange(s,s,a).includes(e)&&(e.row>=0||e.col>=0)){const u={};if(e.col>=0){const c=Math.floor(t.countVisibleCols()/2);u.col=Math.max(e.col-c,0)}if(e.row>=0){const c=Math.floor(t.countVisibleRows()/2);u.row=Math.max(e.row-c,0)}t.scrollViewportTo({...u,verticalSnap:"top",horizontalSnap:"start"})}}},JX={name:"selectAllCells",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.selectAll(!0,!0,{disableHeadersHighlight:!0}),e.markEndSource()}},QX={name:"selectAllCellsAndHeaders",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.selectAll(!0,!0,{disableHeadersHighlight:!1}),e.markEndSource()}},e4={name:"populateSelectedCellsData",callback(t){const e=t.getSelectedRange(),{row:n,col:r}=e[e.length-1].highlight.normalize(),i=t.getDataAtCell(n,r),o=new Map;for(let s=0;s<e.length;s++)e[s].forAll((a,l)=>{if(a>=0&&l>=0&&(a!==n||l!==r)){const{readOnly:u}=t.getCellMeta(a,l);u||o.set(`${a}x${l}`,[a,l,i])}});t.setDataAtCell(Array.from(o.values()))}},t4=[...wX(),...AX(),...KX(),XX,ZX,JX,QX,e4];function Ck(t){const e={};return t4.forEach(n=>{let{name:r,callback:i}=n;e[r]=function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i(t,...s)}}),e}function n4(t){const e=t.getShortcutManager().addContext("editor"),n=Ck(t),r={group:ta};e.addShortcuts([{keys:[["Enter"],["Enter","Shift"]],callback:(i,o)=>n.editorCloseAndSaveByEnter(i,o)},{keys:[["Enter","Control/Meta"],["Enter","Control/Meta","Shift"]],captureCtrl:!0,callback:(i,o)=>n.editorCloseAndSaveByEnter(i,o)},{keys:[["Tab"],["Tab","Shift"],["PageDown"],["PageUp"]],forwardToContext:t.getShortcutManager().getContext("grid"),callback:(i,o)=>n.editorCloseAndSave(i,o)},{keys:[["ArrowDown"],["ArrowUp"],["ArrowLeft"],["ArrowRight"]],preventDefault:!1,callback:(i,o)=>n.editorCloseAndSaveByArrowKeys(i,o)},{keys:[["Escape"],["Escape","Control/Meta"]],callback:()=>n.editorCloseWithoutSaving()}],r)}function r4(t){const e=t.getShortcutManager().addContext("grid"),n=Ck(t),r={runOnlyIf:()=>{const{navigableHeaders:i}=t.getSettings();return ue(t.getSelected())&&(i||!i&&t.countRenderedRows()>0&&t.countRenderedCols()>0)},group:wk};e.addShortcuts([{keys:[["F2"]],callback:i=>n.editorFastOpen(i)},{keys:[["Enter"],["Enter","Shift"]],callback:(i,o)=>n.editorOpen(i,o)},{keys:[["Backspace"],["Delete"]],callback:()=>n.emptySelectedCells()}],{group:ta,runOnlyIf:()=>ue(t.getSelected())}),e.addShortcuts([{keys:[["Control/Meta","A"]],callback:()=>n.selectAllCells(),runOnlyIf:()=>{var i;return!((i=t.getSelectedRangeLast())!==null&&i!==void 0&&i.highlight.isHeader())}},{keys:[["Control/Meta","A"]],callback:()=>{},runOnlyIf:()=>{var i;return(i=t.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isHeader()},preventDefault:!0},{keys:[["Control/Meta","Shift","Space"]],callback:()=>n.selectAllCellsAndHeaders()},{keys:[["Control/Meta","Enter"]],callback:()=>n.populateSelectedCellsData(),runOnlyIf:()=>{var i,o;return!((i=t.getSelectedRangeLast())!==null&&i!==void 0&&i.highlight.isHeader())&&((o=t.getSelectedRangeLast())===null||o===void 0?void 0:o.getCellsCount())>1}},{keys:[["Control","Space"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToColumns()},{keys:[["Shift","Space"]],stopPropagation:!0,callback:()=>n.extendCellsSelectionToRows()},{keys:[["ArrowUp"]],callback:()=>n.moveCellSelectionUp()},{keys:[["ArrowUp","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostTop()},{keys:[["ArrowUp","Shift"]],callback:()=>n.extendCellsSelectionUp()},{keys:[["ArrowUp","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostTop(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByColumnHeader())},{keys:[["ArrowDown"]],callback:()=>n.moveCellSelectionDown()},{keys:[["ArrowDown","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostBottom()},{keys:[["ArrowDown","Shift"]],callback:()=>n.extendCellsSelectionDown()},{keys:[["ArrowDown","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostBottom(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByColumnHeader())},{keys:[["ArrowLeft"]],callback:()=>n.moveCellSelectionLeft()},{keys:[["ArrowLeft","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostLeft()},{keys:[["ArrowLeft","Shift"]],callback:()=>n.extendCellsSelectionLeft()},{keys:[["ArrowLeft","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostLeft(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByRowHeader())},{keys:[["ArrowRight"]],callback:()=>n.moveCellSelectionRight()},{keys:[["ArrowRight","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostRight()},{keys:[["ArrowRight","Shift"]],callback:()=>n.extendCellsSelectionRight()},{keys:[["ArrowRight","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostRight(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByRowHeader())},{keys:[["Home"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostInlineStart(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["Home","Shift"]],callback:()=>n.extendCellsSelectionToMostInlineStart()},{keys:[["Home","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostTopInlineStart(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostInlineEnd(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End","Shift"]],callback:()=>n.extendCellsSelectionToMostInlineEnd()},{keys:[["End","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostBottomInlineEnd(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["PageUp"]],callback:()=>n.moveCellSelectionUpByViewportHight()},{keys:[["PageUp","Shift"]],callback:()=>n.extendCellsSelectionUpByViewportHeight()},{keys:[["PageDown"]],callback:()=>n.moveCellSelectionDownByViewportHeight()},{keys:[["PageDown","Shift"]],callback:()=>n.extendCellsSelectionDownByViewportHeight()},{keys:[["Tab"]],preventDefault:!1,callback:i=>n.moveCellSelectionInlineStart(i)},{keys:[["Shift","Tab"]],preventDefault:!1,callback:i=>n.moveCellSelectionInlineEnd(i)},{keys:[["Control/Meta","Backspace"]],callback:()=>n.scrollToFocusedCell()}],r)}function i4(t){[r4,n4].forEach(e=>e(t))}function o4(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=t.rootElement,r=Vx(t),i=Vx(t);return r.addEventListener("focus",()=>e==null?void 0:e.onFocusFromTop()),i.addEventListener("focus",()=>e==null?void 0:e.onFocusFromBottom()),n.firstChild.before(r),n.lastChild.after(i),{activate(){t._registerTimeout(()=>{r.tabIndex=0,i.tabIndex=0},10)},deactivate(){t._registerTimeout(()=>{r.tabIndex=-1,i.tabIndex=-1},10)}}}function Vx(t){const n=t.rootDocument.createElement("input");return n.type="text",n.name="__htFocusCatcher",n.classList.add("htFocusCatcher"),t.getSettings().ariaTags&&Re(n,[Uh("Focus catcher")]),n}function s4(t){const e=a4(t);let n;const{activate:r,deactivate:i}=o4(t,{onFocusFromTop(){var h;const d=(h=e(n))!==null&&h!==void 0?h:Rb(t);d&&(t.runHooks("modifyFocusOnTabNavigation","from_above",d),t.selectCell(d.row,d.col)),t.listen()},onFocusFromBottom(){var h;const d=(h=e(n))!==null&&h!==void 0?h:Eb(t);d&&(t.runHooks("modifyFocusOnTabNavigation","from_below",d),t.selectCell(d.row,d.col)),t.listen()}}),o={wrapped:!1,flipped:!1};let s=!0,a=!1,l=!1;t.addHook("afterListen",()=>i()),t.addHook("afterUnlisten",()=>r()),t.addHook("afterSelection",(h,d,f,m,C)=>{if(a&&(o.wrapped&&o.flipped||l)&&(l=!1,C.value=!0),s){var y;n=(y=t.getSelectedRangeLast())===null||y===void 0?void 0:y.highlight}}),t.addHook("beforeRowWrap",(h,d,f)=>{o.wrapped=!0,o.flipped=f});function u(){o.wrapped=!1,o.flipped=!1,t.deselectCell(),t.unlisten()}const c={keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:wk,group:"focusCatcher"};t.getShortcutManager().getContext("grid").addShortcuts([{...c,callback:()=>{const{tabNavigation:h}=t.getSettings();a=!0,t.getSelectedRangeLast()&&!h&&(s=!1),h||(l=!0)},position:"before"},{...c,callback:h=>{const{tabNavigation:d,autoWrapRow:f}=t.getSettings();if(a=!1,s=!0,!d||!t.selection.isSelected()||f&&o.wrapped&&o.flipped||!f&&o.wrapped)return f&&o.wrapped&&o.flipped&&(n=h.shiftKey?Rb(t):Eb(t)),u(),!1;h.preventDefault()},position:"after"}])}function Rb(t){const{rowIndexMapper:e,columnIndexMapper:n}=t,{navigableHeaders:r}=t.getSettings();let i=r&&t.countColHeaders()>0?-t.countColHeaders():0,o=r&&t.countRowHeaders()>0?-t.countRowHeaders():0;return i===0&&(i=e.getVisualFromRenderableIndex(i)),o===0&&(o=n.getVisualFromRenderableIndex(o)),i===null||o===null?null:t._createCellCoords(i,o)}function Eb(t){var e,n;const{rowIndexMapper:r,columnIndexMapper:i}=t,{navigableHeaders:o}=t.getSettings();let s=r.getRenderableIndexesLength()-1,a=i.getRenderableIndexesLength()-1;if(s<0){if(!o||t.countColHeaders()===0)return null;s=-1}if(a<0){if(!o||t.countColHeaders()===0)return null;a=-1}return t._createCellCoords((e=r.getVisualFromRenderableIndex(s))!==null&&e!==void 0?e:s,(n=i.getVisualFromRenderableIndex(a))!==null&&n!==void 0?n:a)}function a4(t){return e=>{if(!e)return null;const n=Rb(t),r=Eb(t);return e.col<n.col&&(e.col=n.col),e.col>r.col&&(e.col=r.col),e.row<n.row&&(e.row=n.row),e.row>r.row&&(e.row=r.row),e}}function tc(t){ts(t)&&t.scrollIntoView({block:"nearest",inline:"nearest"})}function yp(t){const{selection:e,view:n}=t,r=t.getSelectedRangeLast(),i=e.getSelectionSource(),o=n.getFirstFullyVisibleColumn(),s=n.getLastFullyVisibleColumn(),a=r.getTopStartCorner().col,l=r.getBottomEndCorner().col,u=a<=o,c=l>=s,h=n.getFirstFullyVisibleRow(),d=n.getLastFullyVisibleRow(),f=r.getTopStartCorner().row,m=r.getBottomEndCorner().row,C=f<=h,y=m>=d;return{getComputedColumnTarget(E){return i==="mouse"||i==="keyboard"?E.col:u&&c?r.highlight.col:u?a:c?l:E.col},getComputedRowTarget(E){return i==="mouse"||i==="keyboard"?E.row:C&&y?r.highlight.row:C?f:y?m:E.row}}}function l4(t){return e=>{const n=yp(t).getComputedColumnTarget(e);t.scrollViewportTo({col:n},()=>{const r=!!t.getSettings().colHeaders;tc(t.getCell(r?-1:0,n,!0))})}}function u4(){return()=>{}}function c4(t){return e=>{t.scrollViewportTo(e.toObject(),()=>{const{row:n,col:r}=t.getSelectedRangeLast().highlight;tc(t.getCell(n,r,!0))})}}function h4(t){return e=>{const n=yp(t),r={row:n.getComputedRowTarget(e),col:n.getComputedColumnTarget(e)};t.scrollViewportTo(r,()=>{const{row:i,col:o}=r;tc(t.getCell(i,o,!0))})}}function d4(t){return e=>{const n=yp(t),r={row:n.getComputedRowTarget(e),col:n.getComputedColumnTarget(e)};t.scrollViewportTo(r,()=>{const{row:i,col:o}=r;tc(t.getCell(i,o,!0))})}}function f4(t){return e=>{const n=yp(t).getComputedRowTarget(e);t.scrollViewportTo({row:n},()=>{const r=!!t.getSettings().rowHeaders;tc(t.getCell(n,r?-1:0,!0))})}}function g4(t){return e=>{const n=t.selection.getSelectionSource(),{row:r,col:i}=e,o=()=>{tc(t.getCell(r,i,!0))};if(r<0&&i>=0)t.scrollViewportTo({col:i},o);else if(i<0&&r>=0)t.scrollViewportTo({row:r},o);else{if(n==="mouse"&&(i===t.view.getLastPartiallyVisibleColumn()||r===t.view.getLastPartiallyVisibleRow()))return;t.scrollViewportTo({row:r,col:i},o)}}}function m4(t){const{selection:e}=t;let n=!1,r=!1;return{resume(){r=!1},suspend(){r=!0},skipNextScrollCycle(){n=!0},scrollTo(i){var o;if(n||r){n=!1;return}let s;e.isFocusSelectionChanged()?s=c4(t):e.isSelectedByCorner()?s=u4():e.isSelectedByRowHeader()?s=f4(t):e.isSelectedByColumnHeader()?s=l4(t):e.getSelectedRange().size()===1&&e.isMultiple()?s=h4(t):e.getSelectedRange().size()===1&&!e.isMultiple()?s=g4(t):e.getSelectedRange().size()>1&&(s=d4(t)),(o=s)===null||o===void 0||o(i)}}}const Wx=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"]]),mf=t=>t.map(e=>{const n=e.toLowerCase();return Wx.has(n)?Wx.get(n):n}).sort().join("+"),p4=t=>t.split("+"),Bx=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"]]),fy=t=>{let{which:e,key:n}=t;if(Bx.has(e))return Bx.get(e);const r=String.fromCharCode(e).toLowerCase();return/^[a-z0-9]$/.test(r)?r:n.toLowerCase()},yk=Symbol("shortcut-context");function Sk(t){return De(t)&&t.__kindOf===yk}const w4=t=>{const e=cp({errorIdExists:l=>`The "${l}" shortcut is already registered in the "${t}" context.`}),n=function(){let{keys:l,callback:u,group:c,runOnlyIf:h=()=>!0,captureCtrl:d=!1,preventDefault:f=!0,stopPropagation:m=!1,relativeToGroup:C,position:y,forwardToContext:E}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(xt(c))throw new Error("You need to define the shortcut's group.");if(ut(u)===!1)throw new Error("The shortcut's callback needs to be a function.");if(Array.isArray(l)===!1)throw new Error(st`Pass the shortcut\'s keys as an array of arrays,\x20
75
- using the KeyboardEvent.key properties:\x20
76
- https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.`);const v={callback:u,group:c,runOnlyIf:h,captureCtrl:d,preventDefault:f,stopPropagation:m};ue(C)&&(v.relativeToGroup=C,v.position=y),Sk(E)&&(v.forwardToContext=E),l.forEach(O=>{const x=mf(O);if(e.hasItem(x)){const I=e.getItem(x);let _=I.findIndex(q=>q.group===C);_!==-1?y==="before"?_-=1:_+=1:_=I.length,I.splice(_,0,v)}else e.addItem(x,[v])})},r=function(l){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l.forEach(c=>{ke(u,(h,d)=>{Object.prototype.hasOwnProperty.call(c,d)===!1&&(c[d]=u[d])}),n(c)})},i=l=>{const u=mf(l);e.removeItem(u)};return{__kindOf:yk,addShortcut:n,addShortcuts:r,getShortcuts:l=>{const u=mf(l),c=e.getItem(u);return ue(c)?c.slice():[]},hasShortcut:l=>{const u=mf(l);return e.hasItem(u)},removeShortcutsByKeys:i,removeShortcutsByGroup:l=>{e.getItems().forEach(c=>{let[h,d]=c;const f=d.filter(m=>m.group!==l);f.length===0?i(p4(h)):(d.length=0,d.push(...f))})}}};function v4(){const t=new Set;return{press(e){t.add(e)},release(e){t.delete(e)},releaseAll(){t.clear()},isPressed(e){return t.has(e)}}}const C4=["meta","alt","shift","control"],Oc=v4(),xc=[];let pf=0;function y4(t,e,n,r,i){const o=f=>C4.includes(f),s=function(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const C=[];return f.altKey&&C.push("alt"),m&&(f.ctrlKey||f.metaKey)?C.push("control/meta"):(f.ctrlKey&&C.push("control"),f.metaKey&&C.push("meta")),f.shiftKey&&C.push("shift"),C},a=f=>{if(e(f)===!1||n(f)===!1||f.keyCode===229||typeof f.key!="string"||Ga(f))return;const C=fy(f);let y=[];o(C)||(y=s(f));const E=[C].concat(y);!i(f,E)&&(QP()&&y.includes("meta")||!QP()&&y.includes("control"))&&i(f,[C].concat(s(f,!0))),r(f)},l=f=>{if(typeof f.key=="string"){const m=fy(f);o(m)&&Oc.press(m)}},u=f=>{if(typeof f.key=="string"){const m=fy(f);o(m)&&Oc.release(m)}},c=()=>{Oc.releaseAll()};return{mount:()=>{let f=t;for(pf+=1;f;)pf===1&&(f.document.documentElement.addEventListener("keydown",l),xc.push({event:"keydown",listener:l}),f.document.documentElement.addEventListener("keyup",u),xc.push({event:"keyup",listener:u})),f.document.documentElement.addEventListener("keydown",a),f.document.documentElement.addEventListener("blur",c),f=Nu(f)},unmount:()=>{let f=t;for(pf-=1;f;){if(pf===0){for(let m=0;m<xc.length;m++){const{event:C,listener:y}=xc[m];f.document.documentElement.removeEventListener(C,y)}xc.length=0}f.document.documentElement.removeEventListener("keydown",a),f.document.documentElement.removeEventListener("blur",c),f=Nu(f)}},isPressed:f=>Oc.isPressed(f),releasePressedKeys:()=>Oc.releaseAll()}}const S4=t=>{let{ownerWindow:e,handleEvent:n,beforeKeyDown:r,afterKeyDown:i}=t;const o=cp({errorIdExists:m=>`The "${m}" context name is already registered.`});let s="grid";const a=m=>{const C=w4(m);return o.addItem(m,C),C},l=()=>s,u=m=>o.getItem(m),c=m=>{if(!o.hasItem(m))throw new Error(st`You've tried to activate the "${m}" shortcut context\x20
77
- that does not exist. Before activation, register the context using the "addContext" method.`);s=m};let h=!1;const d=function(m,C){let y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l();const E=Sk(y)?y:u(y);let v=!1;if(!E.hasShortcut(C))return v;const O=E.getShortcuts(C);for(let x=0;x<O.length;x++){const{callback:F,runOnlyIf:I,preventDefault:_,stopPropagation:q,captureCtrl:G,forwardToContext:U}=O[x];if(I(m)===!0){if(h=G,v=F(m,C)===!1,h=!1,_&&m.preventDefault(),q&&(Pi(m),m.stopPropagation()),v)break;U&&d(m,C,U)}}return v},f=y4(e,n,r,i,d);return f.mount(),{addContext:a,getActiveContextName:l,getContext:u,setActiveContextName:c,isCtrlPressed:()=>!h&&(f.isPressed("control")||f.isPressed("meta")),releasePressedKeys:()=>f.releasePressedKeys(),destroy:()=>f.unmount()}};function jx(t){const{classNames:e}=Tz(t,/ht-theme-[a-zA-Z0-9_-]+/);return e.pop()}let gy=null;const my=new Map;function bk(t,e){var n,r=this;let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this;const s=new _i(o);let a,l,u,c,h,d,f=!0;eK(i)&&Qq(this),this.rootElement=t,this.rootDocument=t.ownerDocument,this.rootWindow=this.rootDocument.defaultView,this.isDestroyed=!1,this.renderSuspendedCounter=0,this.executionSuspendedCounter=0;const m=(n=e==null?void 0:e.layoutDirection)!==null&&n!==void 0?n:"inherit",C=["rtl","ltr"].includes(m)?m:this.rootWindow.getComputedStyle(this.rootElement).direction;this.rootElement.setAttribute("dir",C),this.isRtl=function(){return C==="rtl"},this.isLtr=function(){return!o.isRtl()},this.getDirectionFactor=function(){return o.isLtr()?1:-1},e.language=JK(e.language);const y=Object.fromEntries(Object.entries(e).filter(g=>{let[w]=g;return!(ie.getSingleton().isRegistered(w)||ie.getSingleton().isDeprecated(w))})),E=new pk(o,y,[Q3,sX]),v=E.getTableMeta(),O=E.getGlobalMeta(),x=cp();this.container=this.rootDocument.createElement("div"),t.insertBefore(this.container,t.firstChild),Pg(this)&&(JU(e.licenseKey,t),X(t,"ht-wrapper")),this.guid=`ht_${BN()}`,my.set(this.guid,this),this.columnIndexMapper=new yb,this.rowIndexMapper=new yb,this.columnIndexMapper.addLocalHook("indexesSequenceChange",g=>{o.runHooks("afterColumnSequenceChange",g)}),this.rowIndexMapper.addLocalHook("indexesSequenceChange",g=>{o.runHooks("afterRowSequenceChange",g)}),s.addEventListener(this.rootDocument.documentElement,"compositionstart",g=>{o.runHooks("beforeCompositionStart",g)}),l=new mK(o),(!this.rootElement.id||this.rootElement.id.substring(0,3)==="ht_")&&(this.rootElement.id=this.guid);const F=g=>{const{row:w,col:p}=g;return o._createCellCoords(w>=0?o.rowIndexMapper.getRenderableFromVisualIndex(w):w,p>=0?o.columnIndexMapper.getRenderableFromVisualIndex(p):p)},I=g=>{const{row:w,col:p}=g;return o._createCellCoords(w>=0?o.rowIndexMapper.getVisualFromRenderableIndex(w):w,p>=0?o.columnIndexMapper.getVisualFromRenderableIndex(p):p)},_=(g,w)=>{const p=w>g?1:-1,T=Math.min(g,w),M=Math.max(g,w),V=o.rowIndexMapper.getNearestNotHiddenIndex(g,p);return V===null||p===1&&V>M||p===-1&&V<T?null:V>=0?o.rowIndexMapper.getRenderableFromVisualIndex(V):V},q=(g,w)=>{const p=w>g?1:-1,T=Math.min(g,w),M=Math.max(g,w),V=o.columnIndexMapper.getNearestNotHiddenIndex(g,p);return V===null||p===1&&V>M||p===-1&&V<T?null:V>=0?o.columnIndexMapper.getRenderableFromVisualIndex(V):V};let G=new fk(v,{rowIndexMapper:o.rowIndexMapper,columnIndexMapper:o.columnIndexMapper,countCols:()=>o.countCols(),countRows:()=>o.countRows(),propToCol:g=>a.propToCol(g),isEditorOpened:()=>o.getActiveEditor()?o.getActiveEditor().isOpened():!1,countRenderableColumns:()=>this.view.countRenderableColumns(),countRenderableRows:()=>this.view.countRenderableRows(),countRowHeaders:()=>this.countRowHeaders(),countColHeaders:()=>this.countColHeaders(),countRenderableRowsInRange:function(){return r.view.countRenderableRowsInRange(...arguments)},countRenderableColumnsInRange:function(){return r.view.countRenderableColumnsInRange(...arguments)},getShortcutManager:()=>o.getShortcutManager(),createCellCoords:(g,w)=>o._createCellCoords(g,w),createCellRange:(g,w,p)=>o._createCellRange(g,w,p),visualToRenderableCoords:F,renderableToVisualCoords:I,findFirstNonHiddenRenderableRow:_,findFirstNonHiddenRenderableColumn:q,isDisabledCellSelection:(g,w)=>g<0||w<0?o.getSettings().disableVisualSelection:o.getCellMeta(g,w).disableVisualSelection});this.selection=G;const U=g=>{let{hiddenIndexesChanged:w}=g;this.forceFullRender=!0,w&&this.selection.commit()};this.columnIndexMapper.addLocalHook("cacheUpdated",U),this.rowIndexMapper.addLocalHook("cacheUpdated",U),this.selection.addLocalHook("afterSetRangeEnd",(g,w)=>{const p=xr(!1),T=this.selection.getSelectedRange(),{from:M,to:V}=T.current(),z=T.size()-1;this.runHooks("afterSelection",M.row,M.col,V.row,V.col,p,z),this.runHooks("afterSelectionByProp",M.row,o.colToProp(M.col),V.row,o.colToProp(V.col),p,z),w&&(!p.isTouched()||p.isTouched()&&!p.value)&&d.scrollTo(g);const Y=G.isSelectedByRowHeader(),S=G.isSelectedByColumnHeader();Y&&S?X(this.rootElement,["ht__selection--rows","ht__selection--columns"]):Y?(we(this.rootElement,"ht__selection--columns"),X(this.rootElement,"ht__selection--rows")):S?(we(this.rootElement,"ht__selection--rows"),X(this.rootElement,"ht__selection--columns")):we(this.rootElement,["ht__selection--rows","ht__selection--columns"]),G.getSelectionSource()!=="shift"&&c.closeEditor(null),o.view.render(),c.prepareEditor()}),this.selection.addLocalHook("beforeSetFocus",g=>{this.runHooks("beforeSelectionFocusSet",g.row,g.col)}),this.selection.addLocalHook("afterSetFocus",g=>{const w=xr(!1);this.runHooks("afterSelectionFocusSet",g.row,g.col,w),(!w.isTouched()||w.isTouched()&&!w.value)&&d.scrollTo(g),c.closeEditor(),o.view.render(),c.prepareEditor()}),this.selection.addLocalHook("afterSelectionFinished",g=>{const w=g.length-1,{from:p,to:T}=g[w];this.runHooks("afterSelectionEnd",p.row,p.col,T.row,T.col,w),this.runHooks("afterSelectionEndByProp",p.row,o.colToProp(p.col),T.row,o.colToProp(T.col),w)}),this.selection.addLocalHook("afterIsMultipleSelection",g=>{const w=this.runHooks("afterIsMultipleSelection",g.value);g.value&&(g.value=w)}),this.selection.addLocalHook("afterDeselect",()=>{c.closeEditor(),o.view.render(),we(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this.runHooks("afterDeselect")}),this.selection.addLocalHook("beforeHighlightSet",()=>this.runHooks("beforeSelectionHighlightSet")).addLocalHook("beforeSetRangeStart",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeSetRangeStart",...w)}).addLocalHook("beforeSetRangeStartOnly",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeSetRangeStartOnly",...w)}).addLocalHook("beforeSetRangeEnd",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeSetRangeEnd",...w)}).addLocalHook("beforeSelectColumns",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeSelectColumns",...w)}).addLocalHook("afterSelectColumns",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("afterSelectColumns",...w)}).addLocalHook("beforeSelectRows",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeSelectRows",...w)}).addLocalHook("afterSelectRows",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("afterSelectRows",...w)}).addLocalHook("beforeModifyTransformStart",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("modifyTransformStart",...w)}).addLocalHook("afterModifyTransformStart",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("afterModifyTransformStart",...w)}).addLocalHook("beforeModifyTransformFocus",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("modifyTransformFocus",...w)}).addLocalHook("afterModifyTransformFocus",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("afterModifyTransformFocus",...w)}).addLocalHook("beforeModifyTransformEnd",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("modifyTransformEnd",...w)}).addLocalHook("afterModifyTransformEnd",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("afterModifyTransformEnd",...w)}).addLocalHook("beforeRowWrap",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeRowWrap",...w)}).addLocalHook("beforeColumnWrap",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeColumnWrap",...w)}).addLocalHook("insertRowRequire",g=>this.alter("insert_row_above",g,1,"auto")).addLocalHook("insertColRequire",g=>this.alter("insert_col_start",g,1,"auto")),u={alter(g,w){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,T=arguments.length>3?arguments[3]:void 0,M=arguments.length>4?arguments[4]:void 0;const V=z=>{if(z.length===0)return[];const Y=[...z];return Y.sort((R,b)=>{let[L]=R,[A]=b;return L===A?0:L>A?1:-1}),wr(Y,(R,b)=>{let[L,A]=b;const k=R[R.length-1],[j,N]=k,$=j+N;if(L<=$){const B=Math.max(A-($-L),0);k[1]+=B}else R.push([L,A]);return R},[Y[0]])};switch(g){case"insert_row_below":case"insert_row_above":const z=o.countSourceRows();if(v.maxRows===z)return;const Y=g==="insert_row_below"?"below":"above";w=w??(Y==="below"?z:0);const{delta:S,startPhysicalIndex:R}=a.createRow(w,p,{source:T,mode:Y});G.shiftRows(o.toVisualRow(R),S);break;case"insert_col_start":case"insert_col_end":const b=g==="insert_col_end"?"end":"start";w=w??(b==="end"?o.countSourceCols():0);const{delta:L,startPhysicalIndex:A}=a.createCol(w,p,{source:T,mode:b});if(L){if(Array.isArray(v.colHeaders)){const N=[o.toVisualColumn(A),0];N.length+=L,Array.prototype.splice.apply(v.colHeaders,N)}G.shiftColumns(o.toVisualColumn(A),L)}break;case"remove_row":const k=N=>{let $=0;H(N,B=>{let[W,K]=B;const ae=Yt(W)?o.countRows()-1:Math.max(W-$,0);if(Number.isInteger(W)&&(W=Math.max(W-$,0)),!a.removeRow(W,K,T))return;if(G.isSelected()){const{row:be}=o.getSelectedRangeLast().highlight;be>=W&&be<=W+K-1&&c.closeEditor(!0)}const Ie=o.countRows(),$e=v.fixedRowsTop;$e>=ae+1&&(v.fixedRowsTop-=Math.min(K,$e-ae));const Ue=v.fixedRowsBottom;Ue&&ae>=Ie-Ue&&(v.fixedRowsBottom-=Math.min(K,Ue)),Ie===0?G.deselect():T==="ContextMenu.removeRow"?G.refresh():G.shiftRows(W,-K),$+=K})};Array.isArray(w)?k(V(w)):k([[w,p]]);break;case"remove_col":const j=N=>{let $=0;H(N,B=>{let[W,K]=B;const ae=Yt(W)?o.countCols()-1:Math.max(W-$,0);let de=o.toPhysicalColumn(ae);if(Number.isInteger(W)&&(W=Math.max(W-$,0)),!a.removeCol(W,K,T))return;if(G.isSelected()){const{col:be}=o.getSelectedRangeLast().highlight;be>=W&&be<=W+K-1&&c.closeEditor(!0)}o.countCols()===0?G.deselect():T==="ContextMenu.removeColumn"?G.refresh():G.shiftColumns(W,-K);const Ue=v.fixedColumnsStart;Ue>=ae+1&&(v.fixedColumnsStart-=Math.min(K,Ue-ae)),Array.isArray(v.colHeaders)&&(typeof de>"u"&&(de=-1),v.colHeaders.splice(de,K)),$+=K})};Array.isArray(w)?j(V(w)):j([[w,p]]);break;default:throw new Error(`There is no such action "${g}"`)}M||u.adjustRowsAndCols(),o.view.render(),o.view.adjustElementsSize()},adjustRowsAndCols(){const g=v.minRows,w=v.minSpareRows,p=v.minCols,T=v.minSpareCols;if(g){const M=o.countRows();M<g&&a.createRow(M,g-M,{source:"auto"})}if(w){const M=o.countEmptyRows(!0);if(M<w){const V=w-M,z=Math.min(V,v.maxRows-o.countSourceRows());a.createRow(o.countRows(),z,{source:"auto"})}}{let M;(p||T)&&(M=o.countEmptyCols(!0));let V=o.countCols();if(p&&!v.columns&&V<p){const z=p-V;M+=z,a.createCol(V,z,{source:"auto"})}if(T&&!v.columns&&o.dataType==="array"&&M<T){V=o.countCols();const z=T-M,Y=Math.min(z,v.maxCols-V);a.createCol(V,Y,{source:"auto"})}}},populateFromArray(g,w,p,T,M){let V,z,Y,S;const R=[],b={},L=[],A=g.row,k=g.col;if(z=w.length,z===0)return!1;let j=0,N=0;switch(De(p)&&(j=p.col-k+1,N=p.row-A+1),M){case"shift_down":const $=_g(w),B=$.length,W=Math.max(B,j),K=o.getData().slice(A),ae=_g(K).slice(k,k+W);for(Y=0;Y<W;Y+=1)if(Y<B){for(V=0,z=$[Y].length;V<N-z;V+=1)$[Y].push($[Y][V%z]);Y<ae.length?L.push($[Y].concat(ae[Y])):L.push($[Y].concat(new Array(K.length).fill(null)))}else L.push($[Y%B].concat(ae[Y]));o.populateFromArray(A,k,_g(L));break;case"shift_right":const de=w.length,Ie=Math.max(de,N),$e=o.getData().slice(A).map(bt=>bt.slice(k));for(V=0;V<Ie;V+=1)if(V<de){for(Y=0,S=w[V].length;Y<j-S;Y+=1)w[V].push(w[V][Y%S]);if(V<$e.length)for(let bt=0;bt<$e[V].length;bt+=1)w[V].push($e[V][bt]);else w[V].push(...new Array($e[0].length).fill(null))}else w.push(w[V%z].slice(0,Ie).concat($e[V]));o.populateFromArray(A,k,w);break;case"overwrite":default:b.row=g.row,b.col=g.col;let Ue=0,be=0,Fe=!0,St;const xi=function(kn){let ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const mt=w[kn%w.length];return ht!==null?mt[ht%mt.length]:mt},Ai=w.length,Hi=p?p.row-g.row+1:0;for(p?z=Hi:z=Math.max(Ai,Hi),V=0;V<z&&!(p&&b.row>p.row&&Hi>Ai||!v.allowInsertRow&&b.row>o.countRows()-1||b.row>=v.maxRows);V++){const bt=V-Ue,kn=xi(bt).length,ht=p?p.col-g.col+1:0;if(p?S=ht:S=Math.max(kn,ht),b.col=g.col,St=o.getCellMeta(b.row,b.col),(T==="CopyPaste.paste"||T==="Autofill.fill")&&St.skipRowOnPaste){Ue+=1,b.row+=1,z+=1;continue}for(be=0,Y=0;Y<S&&!(p&&b.col>p.col&&ht>kn||!v.allowInsertColumn&&b.col>o.countCols()-1||b.col>=v.maxCols);Y++){if(St=o.getCellMeta(b.row,b.col),(T==="CopyPaste.paste"||T==="Autofill.fill")&&St.skipColumnOnPaste){be+=1,b.col+=1,S+=1;continue}if(St.readOnly&&T!=="UndoRedo.undo"){b.col+=1;continue}const mt=Y-be;let Be=xi(bt,mt),Zn=o.getDataAtCell(b.row,b.col);if(Be!==null&&typeof Be=="object")if(Array.isArray(Be)&&Zn===null&&(Zn=[]),Zn===null||typeof Zn!="object")Fe=!1;else{const kd=Yh(Array.isArray(Zn)?Zn:Zn[0]||Zn),na=Yh(Array.isArray(Be)?Be:Be[0]||Be);qR(kd,na)||Array.isArray(kd)&&Array.isArray(na)?Be=Kn(Be):Fe=!1}else Zn!==null&&typeof Zn=="object"&&(Fe=!1);Fe&&R.push([b.row,b.col,Be]),Fe=!0,b.col+=1}b.row+=1}o.setDataAtCell(R,null,null,T||"populateFromArray");break}}};function J(g){const w=tk(g);z0(w)?(o.runHooks("beforeLanguageChange",w),O.language=w,o.runHooks("afterLanguageChange",w)):nk(g)}function te(g,w){const p=g==="className"?o.rootElement:o.table;if(f)X(p,w);else{let T=[],M=[];O[g]&&(T=Array.isArray(O[g])?O[g]:$P(O[g])),w&&(M=Array.isArray(w)?w:$P(w));const V=LP(T,M),z=LP(M,T);V.length&&we(p,V),z.length&&X(p,z)}O[g]=w}this.init=function(){l.setData(v.data),o.runHooks("beforeInit"),(qo()||gD())&&X(o.rootElement,"mobile"),this.updateSettings(e,!0),this.view=new iK(this);const g=v.themeName||jx(o.rootElement);o.useTheme(g),o.view.addClassNameToLicenseElement(o.getCurrentThemeName()),c=gb.getInstance(o,v,G),d=m4(o),h=new TY(o),Pg(this)&&s4(o),o.runHooks("init"),this.render(),f&&o.rootElement.offsetParent===null&&Hz(o.rootElement,()=>{o.view._wt.wtOverlays.updateLastSpreaderSize(),o.render(),o.view.adjustElementsSize()}),typeof f=="object"&&(o.runHooks("afterChange",f[0],f[1]),f=!1),o.runHooks("afterInit")};function le(){let g=!1;return{validatorsInQueue:0,valid:!0,addValidatorToQueue(){this.validatorsInQueue+=1,g=!1},removeValidatorFormQueue(){this.validatorsInQueue=this.validatorsInQueue-1<0?0:this.validatorsInQueue-1,this.checkIfQueueIsEmpty()},onQueueEmpty(){},checkIfQueueIsEmpty(){this.validatorsInQueue===0&&g===!1&&(g=!0,this.onQueueEmpty(this.valid))}}}function ne(g){const w=g.replace(",",".");return isNaN(parseFloat(w))===!1?parseFloat(w):g}function se(g,w,p){if(!g.length){p();return}const T=o.getActiveEditor(),M=new le;let V=!0;M.onQueueEmpty=()=>{T&&V&&T.cancelChanges(),p()};for(let z=g.length-1;z>=0;z--){const[Y,S]=g[z],R=a.propToCol(S);let b;Number.isInteger(R)?b=o.getCellMeta(Y,R):b={...Object.getPrototypeOf(v),...v},o.getCellValidator(b)&&(M.addValidatorToQueue(),o.validateCell(g[z][3],b,(function(L,A){return function(k){if(typeof k!="boolean")throw new Error("Validation error: result is not boolean");k===!1&&A.allowInvalid===!1&&(V=!1,g.splice(L,1),A.valid=!0),M.removeValidatorFormQueue()}})(z,b),w))}M.checkIfQueueIsEmpty()}function Ge(g,w){for(let T=g.length-1;T>=0;T--){let M=!1;if(g[T]===null){g.splice(T,1);continue}if(!((g[T][2]===null||g[T][2]===void 0)&&(g[T][3]===null||g[T][3]===void 0))){if(v.allowInsertRow)for(;g[T][0]>o.countRows()-1;){const{delta:V}=a.createRow(void 0,void 0,{source:"auto"});if(V===0){M=!0;break}}if(o.dataType==="array"&&(!v.columns||v.columns.length===0)&&v.allowInsertColumn)for(;a.propToCol(g[T][1])>o.countCols()-1;){const{delta:V}=a.createCol(void 0,void 0,{source:"auto"});if(V===0){M=!0;break}}M||a.set(g[T][0],g[T][1],g[T][3])}}if(g.length>0){u.adjustRowsAndCols(),o.runHooks("beforeChangeRender",g,w),c.closeEditor(),o.render(),c.prepareEditor(),o.view.adjustElementsSize(),o.runHooks("afterChange",g,w||"edit");const T=o.getActiveEditor();T&&ue(T.refreshValue)&&T.refreshValue()}else o.render()}this._createCellCoords=function(g,w){return o.view._wt.createCellCoords(g,w)},this._createCellRange=function(g,w,p){return o.view._wt.createCellRange(g,w,p)},this.validateCell=function(g,w,p,T){let M=o.getCellValidator(w);function V(z){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)||w.hidden===!0){p(z);return}const S=w.visualCol,R=w.visualRow,b=o.getCell(R,S,!0);if(b&&b.nodeName!=="TH"){const L=o.rowIndexMapper.getRenderableFromVisualIndex(R),A=o.columnIndexMapper.getRenderableFromVisualIndex(S);o.view._wt.getSetting("cellRenderer",L,A,b)}p(z)}KU(M)&&(M=(function(z){return function(Y,S){S(z.test(Y))}})(M)),ut(M)?(g=o.runHooks("beforeValidate",g,w.visualRow,w.prop,T),o._registerImmediate(()=>{M.call(w,g,z=>{o&&(z=o.runHooks("afterValidate",z,g,w.visualRow,w.prop,T),w.valid=z,V(z),o.runHooks("postAfterValidate",z,g,w.visualRow,w.prop,T))})})):o._registerImmediate(()=>{w.valid=!0,V(w.valid,!1)})};function ve(g,w,p){return Array.isArray(g)?g:[[g,w,p]]}function Oe(g,w){const p=o.runHooks("beforeChange",g,w||"edit"),T=g.filter(V=>V!==null);if(p===!1||T.length===0){var M;return(M=o.getActiveEditor())===null||M===void 0||M.cancelChanges(),[]}for(let V=T.length-1;V>=0;V--){const[z,Y,,S]=T[V],R=a.propToCol(Y);let b;Number.isInteger(R)?b=o.getCellMeta(z,R):b={...Object.getPrototypeOf(v),...v};const{type:L,checkedTemplate:A,uncheckedTemplate:k}=b;if(L==="numeric"&&typeof S=="string"&&FY(S)&&(T[V][3]=ne(S)),L==="checkbox"){const j=At(S),N=j===At(A),$=j===At(k);(N||$)&&(T[V][3]=N?A:k)}}return T}this.setDataAtCell=function(g,w,p,T){const M=ve(g,w,p),V=[];let z=T,Y,S,R;for(Y=0,S=M.length;Y<S;Y++){if(typeof M[Y]!="object")throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if(typeof M[Y][1]!="number")throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");M[Y][1]>=this.countCols()?R=M[Y][1]:R=a.colToProp(M[Y][1]),V.push([M[Y][0],R,l.getAtCell(this.toPhysicalRow(M[Y][0]),M[Y][1]),M[Y][2]])}!z&&typeof g=="object"&&(z=w);const b=Oe(V,z);o.runHooks("afterSetDataAtCell",b,z),se(b,z,()=>{Ge(b,z)})},this.setDataAtRowProp=function(g,w,p,T){const M=ve(g,w,p),V=[];let z=T,Y,S;for(Y=0,S=M.length;Y<S;Y++)V.push([M[Y][0],M[Y][1],l.getAtCell(this.toPhysicalRow(M[Y][0]),M[Y][1]),M[Y][2]]);!z&&typeof g=="object"&&(z=w);const R=Oe(V,T);o.runHooks("afterSetDataAtRowProp",R,z),se(R,z,()=>{Ge(R,z)})},this.listen=function(){o&&!o.isListening()&&(my.forEach(g=>{o!==g&&g.unlisten()}),gy=o.guid,o.runHooks("afterListen"))},this.unlisten=function(){this.isListening()&&(gy=null,o.runHooks("afterUnlisten"))},this.isListening=function(){return gy===o.guid},this.destroyEditor=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;c.closeEditor(g),o.view.render(),w&&G.isSelected()&&c.prepareEditor()},this.populateFromArray=function(g,w,p,T,M,V,z){if(!(typeof p=="object"&&typeof p[0]=="object"))throw new Error("populateFromArray parameter `input` must be an array of arrays");const Y=typeof T=="number"?o._createCellCoords(T,M):null;return u.populateFromArray(o._createCellCoords(g,w),p,Y,V,z)},this.spliceCol=function(g,w,p){for(var T=arguments.length,M=new Array(T>3?T-3:0),V=3;V<T;V++)M[V-3]=arguments[V];return a.spliceCol(g,w,p,...M)},this.spliceRow=function(g,w,p){for(var T=arguments.length,M=new Array(T>3?T-3:0),V=3;V<T;V++)M[V-3]=arguments[V];return a.spliceRow(g,w,p,...M)},this.getSelected=function(){if(G.isSelected())return ze(G.getSelectedRange(),g=>{let{from:w,to:p}=g;return[w.row,w.col,p.row,p.col]})},this.getSelectedLast=function(){const g=this.getSelected();let w;return g&&g.length>0&&(w=g[g.length-1]),w},this.getSelectedRange=function(){if(G.isSelected())return Array.from(G.getSelectedRange())},this.getSelectedRangeLast=function(){const g=this.getSelectedRange();let w;return g&&g.length>0&&(w=g[g.length-1]),w},this.emptySelectedCells=function(g){if(!G.isSelected()||this.countRows()===0||this.countCols()===0)return;const w=[];H(G.getSelectedRange(),p=>{if(p.isSingleHeader())return;const T=p.getTopStartCorner(),M=p.getBottomEndCorner();fe(T.row,M.row,V=>{fe(T.col,M.col,z=>{this.getCellMeta(V,z).readOnly||w.push([V,z,null])})})}),w.length>0&&this.setDataAtCell(w,g)},this.isRenderSuspended=function(){return this.renderSuspendedCounter>0},this.suspendRender=function(){this.renderSuspendedCounter+=1},this.resumeRender=function(){const g=this.renderSuspendedCounter-1;this.renderSuspendedCounter=Math.max(g,0),!this.isRenderSuspended()&&g===this.renderSuspendedCounter&&o.view.render()},this.render=function(){this.view&&(this.forceFullRender=!0,this.isRenderSuspended()||o.view.render())},this.batchRender=function(g){this.suspendRender();const w=g();return this.resumeRender(),w},this.isExecutionSuspended=function(){return this.executionSuspendedCounter>0},this.suspendExecution=function(){this.executionSuspendedCounter+=1,this.columnIndexMapper.suspendOperations(),this.rowIndexMapper.suspendOperations()},this.resumeExecution=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const w=this.executionSuspendedCounter-1;this.executionSuspendedCounter=Math.max(w,0),(!this.isExecutionSuspended()&&w===this.executionSuspendedCounter||g)&&(this.columnIndexMapper.resumeOperations(),this.rowIndexMapper.resumeOperations())},this.batchExecution=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.suspendExecution();const p=g();return this.resumeExecution(w),p},this.batch=function(g){this.suspendRender(),this.suspendExecution();const w=g();return this.resumeExecution(),this.resumeRender(),w},this.refreshDimensions=function(){if(!o.view)return;const g=o.view,{width:w,height:p}=g.getLastSize(),{width:T,height:M}=o.rootElement.getBoundingClientRect(),V=T!==w||M!==p;o.runHooks("beforeRefreshDimensions",{width:w,height:p},{width:T,height:M},V)!==!1&&((V||g._wt.wtOverlays.scrollableElement===o.rootWindow)&&(g.setLastSize(T,M),o.render(),g.adjustElementsSize()),o.runHooks("afterRefreshDimensions",{width:w,height:p},{width:T,height:M},V))},this.updateData=function(g,w){Lx(g,p=>{a=p},p=>{a=p,o.columnIndexMapper.fitToLength(this.getInitialColumnCount()),o.rowIndexMapper.fitToLength(this.countSourceRows()),u.adjustRowsAndCols(),G.refresh()},{hotInstance:o,dataMap:a,dataSource:l,internalSource:"updateData",source:w,metaManager:E,firstRun:f})},this.loadData=function(g,w){Lx(g,p=>{a=p},()=>{E.clearCellsCache(),o.initIndexMappers(),u.adjustRowsAndCols(),G.refresh(),f&&(f=[null,"loadData"])},{hotInstance:o,dataMap:a,dataSource:l,internalSource:"loadData",source:w,metaManager:E,firstRun:f})},this.getInitialColumnCount=function(){const g=v.columns;let w=0;if(Array.isArray(g))w=g.length;else if(ut(g))if(o.dataType==="array"){const p=this.countSourceCols();for(let T=0;T<p;T+=1)g(T)&&(w+=1)}else(o.dataType==="object"||o.dataType==="function")&&(w=a.colToPropCache.length);else if(ue(v.dataSchema)){const p=a.getSchema();w=Array.isArray(p)?p.length:KR(p)}else w=this.countSourceCols();return w},this.initIndexMappers=function(){this.columnIndexMapper.initToLength(this.getInitialColumnCount()),this.rowIndexMapper.initToLength(this.countSourceRows())},this.getData=function(g,w,p,T){return xt(g)?a.getAll():a.getRange(o._createCellCoords(g,w),o._createCellCoords(p,T),a.DESTINATION_RENDERER)},this.getCopyableText=function(g,w,p,T){return a.getCopyableText(o._createCellCoords(g,w),o._createCellCoords(p,T))},this.getCopyableData=function(g,w){return a.getCopyable(g,a.colToProp(w))},this.getSchema=function(){return a.getSchema()},this.updateSettings=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const p=(f?o.loadData:o.updateData).bind(this);let T=!1,M,V;if(ue(g.rows))throw new Error('The "rows" setting is no longer supported. Do you mean startRows, minRows or maxRows?');if(ue(g.cols))throw new Error('The "cols" setting is no longer supported. Do you mean startCols, minCols or maxCols?');if(ue(g.ganttChart))throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');g.language&&J(g.language);for(M in g)if(!(M==="data"||M==="language"))if(M==="className")te("className",g.className);else if(M==="tableClassName"&&o.table)te("tableClassName",g.tableClassName),o.view._wt.wtOverlays.syncOverlayTableClassNames();else if(ie.getSingleton().isRegistered(M)||ie.getSingleton().isDeprecated(M)){const b=g[M];ut(b)?(ie.getSingleton().addAsFixed(M,b,o),v[M]=b):Array.isArray(b)&&(ie.getSingleton().add(M,b,o),v[M]=b)}else!w&&sn(g,M)&&(O[M]=g[M]);g.data===void 0&&v.data===void 0?p(null,"updateSettings"):g.data!==void 0?p(g.data,"updateSettings"):g.columns!==void 0&&(a.createMap(),o.initIndexMappers());const z=o.countCols(),Y=v.columns;if(Y&&ut(Y)&&(T=!0),(g.cell!==void 0||g.cells!==void 0||g.columns!==void 0)&&E.clearCache(),z>0)for(M=0,V=0;M<z;M++){if(Y){const b=T?Y(M):Y[V];b&&E.updateColumnMeta(V,b)}V+=1}ue(g.cell)&&ke(g.cell,b=>{o.setCellMetaObject(b.row,b.col,b)}),o.runHooks("afterCellMetaReset");let S=o.rootElement.style.height;S!==""&&(S=parseInt(o.rootElement.style.height,10));let R=g.height;if(ut(R)&&(R=R()),w&&o.rootElement.getAttribute("style")&&o.rootElement.setAttribute("data-initialstyle",o.rootElement.getAttribute("style")),R===null){const b=o.rootElement.getAttribute("data-initialstyle");b&&(b.indexOf("height")>-1||b.indexOf("overflow")>-1)?o.rootElement.setAttribute("style",b):(o.rootElement.style.height="",o.rootElement.style.overflow="")}else R!==void 0&&(o.rootElement.style.height=isNaN(R)?`${R}`:`${R}px`,o.rootElement.style.overflow="hidden");if(typeof g.width<"u"){let b=g.width;ut(b)&&(b=b()),o.rootElement.style.width=isNaN(b)?`${b}`:`${b}px`}if(!w){if(o.view){o.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked(),o.view._wt.exportSettingsAsClassNames();const b=o.getCurrentThemeName(),L=sn(g,"themeName");b&&L&&b!==g.themeName&&(o.view.getStylesHandler().removeClassNames(),o.view.removeClassNameFromLicenseElement(b));const A=L&&g.themeName||jx(o.rootElement);o.useTheme(A),o.view.addClassNameToLicenseElement(o.getCurrentThemeName())}o.runHooks("afterUpdateSettings",g)}u.adjustRowsAndCols(),o.view&&!f&&(o.render(),o.view._wt.wtOverlays.adjustElementsSize()),!w&&o.view&&(S===""||R===""||R===void 0)&&S!==R&&o.view._wt.wtOverlays.updateMainScrollableElements()},this.getValue=function(){const g=o.getSelectedLast();if(v.getValue){if(ut(v.getValue))return v.getValue.call(o);if(g)return o.getData()[g[0][0]][v.getValue]}else if(g)return o.getDataAtCell(g[0],g[1])},this.getSettings=function(){return v},this.clear=function(){this.selectAll(),this.emptySelectedCells()},this.alter=function(g,w,p,T,M){u.alter(g,w,p,T,M)},this.getCell=function(g,w){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,T=w,M=g;if(w>=0){if(this.columnIndexMapper.isHidden(this.toPhysicalColumn(w)))return null;T=this.columnIndexMapper.getRenderableFromVisualIndex(w)}if(g>=0){if(this.rowIndexMapper.isHidden(this.toPhysicalRow(g)))return null;M=this.rowIndexMapper.getRenderableFromVisualIndex(g)}return M===null||T===null||M===void 0||T===void 0?null:o.view.getCellAtCoords(o._createCellCoords(M,T),p)},this.getCoords=function(g){const w=this.view._wt.wtTable.getCoords(g);if(w===null)return null;const{row:p,col:T}=w;let M=p,V=T;return p>=0&&(M=this.rowIndexMapper.getVisualFromRenderableIndex(p)),T>=0&&(V=this.columnIndexMapper.getVisualFromRenderableIndex(T)),o._createCellCoords(M,V)},this.colToProp=function(g){return a.colToProp(g)},this.propToCol=function(g){return a.propToCol(g)},this.toVisualRow=g=>this.rowIndexMapper.getVisualFromPhysicalIndex(g),this.toVisualColumn=g=>this.columnIndexMapper.getVisualFromPhysicalIndex(g),this.toPhysicalRow=g=>this.rowIndexMapper.getPhysicalFromVisualIndex(g),this.toPhysicalColumn=g=>this.columnIndexMapper.getPhysicalFromVisualIndex(g),this.getDataAtCell=function(g,w){return a.get(g,a.colToProp(w))},this.getDataAtRowProp=function(g,w){return a.get(g,w)},this.getDataAtCol=function(g){const w=[],p=a.getRange(o._createCellCoords(0,g),o._createCellCoords(v.data.length-1,g),a.DESTINATION_RENDERER);for(let T=0;T<p.length;T+=1)for(let M=0;M<p[T].length;M+=1)w.push(p[T][M]);return w},this.getDataAtProp=function(g){const w=[],p=a.getRange(o._createCellCoords(0,a.propToCol(g)),o._createCellCoords(v.data.length-1,a.propToCol(g)),a.DESTINATION_RENDERER);for(let T=0;T<p.length;T+=1)for(let M=0;M<p[T].length;M+=1)w.push(p[T][M]);return w},this.getSourceData=function(g,w,p,T){let M;return g===void 0?M=l.getData():M=l.getByRange(o._createCellCoords(g,w),o._createCellCoords(p,T)),M},this.getSourceDataArray=function(g,w,p,T){let M;return g===void 0?M=l.getData(!0):M=l.getByRange(o._createCellCoords(g,w),o._createCellCoords(p,T),!0),M},this.getSourceDataAtCol=function(g){return l.getAtColumn(g)},this.setSourceDataAtCell=function(g,w,p,T){const M=ve(g,w,p),V=this.hasHook("afterSetSourceDataAtCell"),z=[];V&&H(M,S=>{let[R,b,L]=S;z.push([R,b,l.getAtCell(R,b),L])}),H(M,S=>{let[R,b,L]=S;l.setAtCell(R,b,L)}),V&&this.runHooks("afterSetSourceDataAtCell",z,T),this.render();const Y=o.getActiveEditor();Y&&ue(Y.refreshValue)&&Y.refreshValue()},this.getSourceDataAtRow=function(g){return l.getAtRow(g)},this.getSourceDataAtCell=function(g,w){return l.getAtCell(g,w)},this.getDataAtRow=function(g){return a.getRange(o._createCellCoords(g,0),o._createCellCoords(g,this.countCols()-1),a.DESTINATION_RENDERER)[0]||[]},this.getDataType=function(g,w,p,T){const M=g===void 0?[0,0,this.countRows(),this.countCols()]:[g,w,p,T],[V,z]=M;let[,,Y,S]=M,R=null,b=null;Y===void 0&&(Y=V),S===void 0&&(S=z);let L="mixed";return fe(Math.max(Math.min(V,Y),0),Math.max(V,Y),A=>{let k=!0;return fe(Math.max(Math.min(z,S),0),Math.max(z,S),j=>(b=this.getCellMeta(A,j).type,R?k=R===b:R=b,k)),L=k?b:"mixed",k}),L},this.removeCellMeta=function(g,w,p){const[T,M]=[this.toPhysicalRow(g),this.toPhysicalColumn(w)];let V=E.getCellMetaKeyValue(T,M,p);o.runHooks("beforeRemoveCellMeta",g,w,p,V)!==!1&&(E.removeCellMeta(T,M,p),o.runHooks("afterRemoveCellMeta",g,w,p,V)),V=null},this.spliceCellsMeta=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;for(var p=arguments.length,T=new Array(p>2?p-2:0),M=2;M<p;M++)T[M-2]=arguments[M];if(T.length>0&&!Array.isArray(T[0]))throw new Error("The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.");w>0&&E.removeRow(this.toPhysicalRow(g),w),T.length>0&&H(T.reverse(),V=>{E.createRow(this.toPhysicalRow(g)),H(V,(z,Y)=>this.setCellMetaObject(g,Y,z))}),o.render()},this.setCellMetaObject=function(g,w,p){typeof p=="object"&&ke(p,(T,M)=>{this.setCellMeta(g,w,M,T)})},this.setCellMeta=function(g,w,p,T){if(o.runHooks("beforeSetCellMeta",g,w,p,T)===!1)return;let V=g,z=w;g<this.countRows()&&(V=this.toPhysicalRow(g)),w<this.countCols()&&(z=this.toPhysicalColumn(w)),E.setCellMeta(V,z,p,T),o.runHooks("afterSetCellMeta",g,w,p,T)},this.getCellsMeta=function(){return E.getCellsMeta()},this.getCellMeta=function(g,w){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{skipMetaExtension:!1},T=this.toPhysicalRow(g),M=this.toPhysicalColumn(w);return T===null&&(T=g),M===null&&(M=w),E.getCellMeta(T,M,{visualRow:g,visualColumn:w,...p})},this.getColumnMeta=function(g){return E.getColumnMeta(this.toPhysicalColumn(g))},this.getCellMetaAtRow=function(g){return E.getCellsMetaAtRow(g)},this.isColumnModificationAllowed=function(){return!(o.dataType==="object"||v.columns)},this.getCellRenderer=function(g,w){const p=typeof g=="number"?o.getCellMeta(g,w).renderer:g.renderer;return typeof p=="string"?wb(p):xt(p)?wb("text"):p},this.getCellEditor=function(g,w){const p=typeof g=="number"?o.getCellMeta(g,w).editor:g.editor;return typeof p=="string"?fb(p):xt(p)?fb("text"):p},this.getCellValidator=function(g,w){const p=typeof g=="number"?o.getCellMeta(g,w).validator:g.validator;return typeof p=="string"?nG(p):p},this.validateCells=function(g){this._validateCells(g)},this.validateRows=function(g,w){if(!Array.isArray(g))throw new Error("validateRows parameter `rows` must be an array");this._validateCells(w,g)},this.validateColumns=function(g,w){if(!Array.isArray(g))throw new Error("validateColumns parameter `columns` must be an array");this._validateCells(w,void 0,g)},this._validateCells=function(g,w,p){const T=new le;g&&(T.onQueueEmpty=g);let M=o.countRows()-1;for(;M>=0;){if(w!==void 0&&w.indexOf(M)===-1){M-=1;continue}let V=o.countCols()-1;for(;V>=0;){if(p!==void 0&&p.indexOf(V)===-1){V-=1;continue}T.addValidatorToQueue(),o.validateCell(o.getDataAtCell(M,V),o.getCellMeta(M,V),z=>{if(typeof z!="boolean")throw new Error("Validation error: result is not boolean");z===!1&&(T.valid=!1),T.removeValidatorFormQueue()},"validateCells"),V-=1}M-=1}T.checkIfQueueIsEmpty()},this.getRowHeader=function(g){let w=v.rowHeaders,p=g;return p!==void 0&&(p=o.runHooks("modifyRowHeader",p)),p===void 0?(w=[],fe(o.countRows()-1,T=>{w.push(o.getRowHeader(T))})):Array.isArray(w)&&w[p]!==void 0?w=w[p]:ut(w)?w=w(p):w&&typeof w!="string"&&typeof w!="number"&&(w=p+1),w},this.hasRowHeaders=function(){return!!v.rowHeaders},this.hasColHeaders=function(){if(v.colHeaders!==void 0&&v.colHeaders!==null)return!!v.colHeaders;for(let g=0,w=o.countCols();g<w;g++)if(o.getColHeader(g))return!0;return!1},this.getColHeader=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1;const p=o.runHooks("modifyColHeader",g);if(p===void 0){const Y=[],S=o.countCols();for(let R=0;R<S;R++)Y.push(o.getColHeader(R));return Y}let T=v.colHeaders;const M=function(Y){const S=[],R=o.countCols();let b=0;for(;b<R;b++)ut(v.columns)&&v.columns(b)&&S.push(b);return S[Y]},V=o.toPhysicalColumn(p),z=M(V);return v.colHeaders===!1?T=null:v.columns&&ut(v.columns)&&v.columns(z)&&v.columns(z).title?T=v.columns(z).title:v.columns&&v.columns[V]&&v.columns[V].title?T=v.columns[V].title:Array.isArray(v.colHeaders)&&v.colHeaders[V]!==void 0?T=v.colHeaders[V]:ut(v.colHeaders)?T=v.colHeaders(V):v.colHeaders&&typeof v.colHeaders!="string"&&typeof v.colHeaders!="number"&&(T=cK(p)),T=o.runHooks("modifyColumnHeaderValue",T,g,w),T},this._getColWidthFromSettings=function(g){let w;if(g>=0&&(w=o.getCellMeta(0,g).width),(w===void 0||w===v.width)&&(w=v.colWidths),w!=null){switch(typeof w){case"object":w=w[g];break;case"function":w=w(g);break}typeof w=="string"&&(w=parseInt(w,10))}return w},this.getColWidth=function(g,w){let p=o._getColWidthFromSettings(g);return p=o.runHooks("modifyColWidth",p,g,w),p===void 0&&(p=ku),p},this._getRowHeightFromSettings=function(g){const w=this.view.getDefaultRowHeight();let p=v.rowHeights;if(p!=null){switch(typeof p){case"object":p=p[g];break;case"function":p=p(g);break}typeof p=="string"&&(p=parseInt(p,10))}return p!=null&&p<w?w:p},this.getRowHeight=function(g,w){let p=o._getRowHeightFromSettings(g);return p=o.runHooks("modifyRowHeight",p,g,w),p},this.countSourceRows=function(){return l.countRows()},this.countSourceCols=function(){return l.countFirstRowKeys()},this.countRows=function(){return a.getLength()},this.countCols=function(){const g=v.maxCols,w=this.columnIndexMapper.getNotTrimmedIndexesLength();return Math.min(g,w)},this.countRenderedRows=function(){return o.view._wt.drawn?o.view._wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return o.view._wt.drawn?o.view._wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return o.view._wt.drawn?o.view._wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return o.view._wt.drawn?o.view._wt.wtTable.getVisibleColumnsCount():-1},this.countRowHeaders=function(){return this.view.getRowHeadersCount()},this.countColHeaders=function(){return this.view.getColumnHeadersCount()},this.countEmptyRows=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=0;return IO(o.countRows()-1,p=>{if(o.isEmptyRow(p))w+=1;else if(g===!0)return!1}),w},this.countEmptyCols=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=0;return IO(o.countCols()-1,p=>{if(o.isEmptyCol(p))w+=1;else if(g===!0)return!1}),w},this.isEmptyRow=function(g){return v.isEmptyRow.call(o,g)},this.isEmptyCol=function(g){return v.isEmptyCol.call(o,g)},this.selectCell=function(g,w,p,T){let M=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,V=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;return xt(g)||xt(w)?!1:this.selectCells([[g,w,p,T]],M,V)},this.selectCells=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[[]],w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;w===!1&&d.suspend();const T=G.selectCells(g);return T&&p&&o.listen(),d.resume(),T},this.selectColumns=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g,p=arguments.length>2?arguments[2]:void 0;return G.selectColumns(g,w,p)},this.selectRows=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g,p=arguments.length>2?arguments[2]:void 0;return G.selectRows(g,w,p)},this.deselectCell=function(){G.deselect()},this.selectAll=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g,p=arguments.length>2?arguments[2]:void 0;d.skipNextScrollCycle(),G.selectAll(g,w,p)};const it=(g,w)=>g.getNearestNotHiddenIndex(w,1,!0);this.scrollViewportTo=function(g,w){if(typeof g=="number"){var p;g={row:arguments[0],col:arguments[1],verticalSnap:arguments[2]?"bottom":"top",horizontalSnap:arguments[3]?"end":"start",considerHiddenIndexes:(p=arguments[4])!==null&&p!==void 0?p:!0}}const{row:T,col:M,considerHiddenIndexes:V}=g??{};let z=T,Y=M;if(ut(w)&&this.addHookOnce("afterScroll",w),V===void 0||V){const L=Number.isInteger(T)&&T>=0,A=Number.isInteger(M)&&M>=0,k=L?it(this.rowIndexMapper,T):void 0,j=A?it(this.columnIndexMapper,M):void 0;if(k===null||j===null)return!1;z=L?o.rowIndexMapper.getRenderableFromVisualIndex(k):T,Y=A?o.columnIndexMapper.getRenderableFromVisualIndex(j):M}const S=Number.isInteger(z),R=Number.isInteger(Y);let b=!1;return S&&z>=0&&R&&Y>=0?b=o.view.scrollViewport(o._createCellCoords(z,Y),g.horizontalSnap,g.verticalSnap):S&&z>=0&&(R&&Y<0||!R)?b=o.view.scrollViewportVertically(z,g.verticalSnap):R&&Y>=0&&(S&&z<0||!S)&&(b=o.view.scrollViewportHorizontally(Y,g.horizontalSnap)),ut(w)&&(b?this.view.render():(this.removeHook("afterScroll",w),this._registerMicrotask(()=>w()))),b},this.scrollToFocusedCell=function(g){if(!this.selection.isSelected())return!1;ut(g)&&this.addHookOnce("afterScroll",g);const{highlight:w}=this.getSelectedRangeLast(),p=this.scrollViewportTo(w.toObject());return p?this.view.render():ut(g)&&(this.removeHook("afterScroll",g),this._registerMicrotask(()=>g())),p},this.destroy=function(){if(o._clearTimeouts(),o._clearImmediates(),o.view&&o.view.destroy(),l&&l.destroy(),l=null,this.getShortcutManager().destroy(),E.clearCache(),my.delete(this.guid),Pg(o)){const g=this.rootDocument.querySelector(".hot-display-license-info");g&&g.parentNode.removeChild(g)}rs(o.rootElement),s.destroy(),c&&c.destroy(),o.batchExecution(()=>{o.rowIndexMapper.unregisterAll(),o.columnIndexMapper.unregisterAll(),x.getItems().forEach(g=>{let[,w]=g;w.destroy()}),x.clear(),o.runHooks("afterDestroy")},!0),ie.getSingleton().destroy(o),ke(o,(g,w,p)=>{ut(g)?p[w]=Le(w):w!=="guid"&&(p[w]=null)}),o.isDestroyed=!0,a&&a.destroy(),a=null,u=null,G=null,c=null,o=null};function Le(g){return()=>{throw new Error(`The "${g}" method cannot be called because this Handsontable instance has been destroyed`)}}this.getActiveEditor=function(){return c.getActiveEditor()},this.getFirstRenderedVisibleRow=function(){return o.view.getFirstRenderedVisibleRow()},this.getLastRenderedVisibleRow=function(){return o.view.getLastRenderedVisibleRow()},this.getFirstRenderedVisibleColumn=function(){return o.view.getFirstRenderedVisibleColumn()},this.getLastRenderedVisibleColumn=function(){return o.view.getLastRenderedVisibleColumn()},this.getFirstFullyVisibleRow=function(){return o.view.getFirstFullyVisibleRow()},this.getLastFullyVisibleRow=function(){return o.view.getLastFullyVisibleRow()},this.getFirstFullyVisibleColumn=function(){return o.view.getFirstFullyVisibleColumn()},this.getLastFullyVisibleColumn=function(){return o.view.getLastFullyVisibleColumn()},this.getFirstPartiallyVisibleRow=function(){return o.view.getFirstPartiallyVisibleRow()},this.getLastPartiallyVisibleRow=function(){return o.view.getLastPartiallyVisibleRow()},this.getFirstPartiallyVisibleColumn=function(){return o.view.getFirstPartiallyVisibleColumn()},this.getLastPartiallyVisibleColumn=function(){return o.view.getLastPartiallyVisibleColumn()},this.getPlugin=function(g){return x.getItem(Ti(g))},this.getPluginName=function(g){return g===this.undoRedo?this.undoRedo.constructor.PLUGIN_KEY:x.getId(g)},this.getInstance=function(){return o},this.addHook=function(g,w,p){ie.getSingleton().add(g,w,o,p)},this.hasHook=function(g){return ie.getSingleton().has(g,o)||ie.getSingleton().has(g)},this.addHookOnce=function(g,w,p){ie.getSingleton().once(g,w,o,p)},this.removeHook=function(g,w){ie.getSingleton().remove(g,w,o)},this.runHooks=function(g,w,p,T,M,V,z){return ie.getSingleton().run(o,g,w,p,T,M,V,z)},this.getTranslatedPhrase=function(g,w){return lk(v.language,g,w)},this.toHTML=()=>_O(this),this.toTableElement=()=>{const g=this.rootDocument.createElement("div");return g.insertAdjacentHTML("afterbegin",_O(this)),g.firstElementChild},this.timeouts=[],this.useTheme=g=>{this.view.getStylesHandler().useTheme(g),this.runHooks("afterSetTheme",g,!!f)},this.getCurrentThemeName=()=>this.view.getStylesHandler().getThemeName(),this._registerTimeout=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=g;typeof p=="function"&&(p=setTimeout(p,w)),this.timeouts.push(p)},this._clearTimeouts=function(){H(this.timeouts,g=>{clearTimeout(g)})},this.immediates=[],this._registerImmediate=function(g){this.immediates.push(setImmediate(g))},this._clearImmediates=function(){H(this.immediates,g=>{clearImmediate(g)})},this._registerMicrotask=function(g){this.rootWindow.queueMicrotask(()=>{this.isDestroyed||g()})},this._getEditorManager=function(){return c};const P=S4({handleEvent(){return o.isListening()},beforeKeyDown:g=>this.runHooks("beforeKeyDown",g),afterKeyDown:g=>{this.isDestroyed||o.runHooks("afterDocumentKeyDown",g)},ownerWindow:this.rootWindow});this.addHook("beforeOnCellMouseDown",g=>{g.ctrlKey===!1&&g.metaKey===!1&&P.releasePressedKeys()}),this.getShortcutManager=function(){return P},this.getFocusManager=function(){return h},TD().forEach(g=>{const w=eE(g);x.addItem(g,new w(this))}),i4(o),P.setActiveContextName("grid"),ie.getSingleton().run(o,"construct")}function Ux(t,e,n){t.addEventListener(e,n,!1)}function zx(t,e,n){t.removeEventListener(e,n,!1)}function wf(t){return t.ownerDocument.defaultView.getComputedStyle(t)}function Rk(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300,textContent:h=>h.value,...e},r=t.body,i=t.createTextNode(""),o=t.createElement("span");let s;function a(){var h,d;i.textContent=n.textContent(s),o.style.position="absolute",o.style.fontSize=wf(s).fontSize,o.style.fontFamily=wf(s).fontFamily,o.style.whiteSpace="pre",r.appendChild(o);const f=parseInt(((h=wf(s))===null||h===void 0?void 0:h.paddingInlineStart)||0,10),m=parseInt(((d=wf(s))===null||d===void 0?void 0:d.paddingInlineEnd)||0,10),C=o.clientWidth+f+m+1;r.removeChild(o);const y=s.style;y.height=`${n.minHeight}px`,n.minWidth>C?y.width=`${n.minWidth}px`:C>n.maxWidth?y.width=`${n.maxWidth}px`:y.width=`${C}px`;const E=s.scrollHeight?s.scrollHeight-1:0;n.minHeight>E?y.height=`${n.minHeight}px`:n.maxHeight<E?(y.height=`${n.maxHeight}px`,y.overflowY="visible"):y.height=`${E}px`}function l(){t.defaultView.setTimeout(a,0)}function u(h){if(h&&h.minHeight)if(h.minHeight==="inherit")n.minHeight=s.clientHeight;else{const d=parseInt(h.minHeight,10);isNaN(d)||(n.minHeight=d)}if(h&&h.maxHeight)if(h.maxHeight==="inherit")n.maxHeight=s.clientHeight;else{const d=parseInt(h.maxHeight,10);isNaN(d)||(n.maxHeight=d)}if(h&&h.minWidth)if(h.minWidth==="inherit")n.minWidth=s.clientWidth;else{const d=parseInt(h.minWidth,10);isNaN(d)||(n.minWidth=d)}if(h&&h.maxWidth)if(h.maxWidth==="inherit")n.maxWidth=s.clientWidth;else{const d=parseInt(h.maxWidth,10);isNaN(d)||(n.maxWidth=d)}o.firstChild||(o.className="autoResize",o.style.display="inline-block",o.appendChild(i))}function c(h,d){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s=h,u(d),s.nodeName==="TEXTAREA"&&(s.style.resize="none",s.style.height=`${n.minHeight}px`,s.style.minWidth=`${n.minWidth}px`,s.style.maxWidth=`${n.maxWidth}px`,s.style.overflowY="hidden"),f&&(Ux(s,"input",a),Ux(s,"keydown",l)),a()}return{init:c,resize:a,unObserve(){zx(s,"input",a),zx(s,"keydown",l)}}}function Yx(t,e){const n=rD(e),r=e.value.split(`
78
- `);let i=n,o=0;for(let s=0;s<r.length;s++){const a=r[s];s!==0&&(o+=r[s-1].length+1);const l=o+a.length;if(t==="home"?i=o:t==="end"&&(i=l),n<=l)break}op(e,i)}function ga(t,e,n){return(e=b4(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function b4(t){var e=R4(t,"string");return typeof e=="symbol"?e:e+""}function R4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const E4="ht_editor_visible",vf="ht_editor_hidden",Gx="textEditor",T4="text";class El extends ec{static get EDITOR_TYPE(){return T4}constructor(e){super(e),ga(this,"eventManager",new _i(this)),ga(this,"autoResize",Rk(this.hot.rootDocument)),ga(this,"TEXTAREA",void 0),ga(this,"textareaStyle",void 0),ga(this,"TEXTAREA_PARENT",void 0),ga(this,"textareaParentStyle",void 0),ga(this,"layerClass",void 0),this.eventManager=new _i(this),this.createElements(),this.bindEvents(),this.hot.addHookOnce("afterDestroy",()=>this.destroy())}getValue(){return this.TEXTAREA.value}setValue(e){this.TEXTAREA.value=e}open(){this.refreshDimensions(),this.showEditableElement(),this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this.autoResize.unObserve(),Mg(this.hot.rootDocument.activeElement,this.hot.rootElement)&&this.hot.listen(),this.hideEditableElement(),this.unregisterShortcuts()}prepare(e,n,r,i,o,s){const a=this.state;if(super.prepare(e,n,r,i,o,s),!s.readOnly){this.refreshDimensions(!0);const{allowInvalid:l}=s;l&&!this.isOpened()&&(this.TEXTAREA.value=""),a!==Ut.FINISHED&&!this.isOpened()&&this.hideEditableElement()}}beginEditing(e,n){this.state===Ut.VIRGIN&&(this.TEXTAREA.value="",super.beginEditing(e,n))}focus(){this.TEXTAREA.select(),op(this.TEXTAREA,this.TEXTAREA.value.length)}createElements(){const{rootDocument:e}=this.hot;this.TEXTAREA=e.createElement("TEXTAREA"),Re(this.TEXTAREA,[["data-hot-input",""],Sl(-1)]),X(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.textareaStyle.overflowY="visible",this.TEXTAREA_PARENT=e.createElement("DIV"),X(this.TEXTAREA_PARENT,"handsontableInputHolder"),ye(this.TEXTAREA_PARENT,this.layerClass)&&we(this.TEXTAREA_PARENT,this.layerClass),X(this.TEXTAREA_PARENT,vf),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.hot.rootElement.appendChild(this.TEXTAREA_PARENT)}hideEditableElement(){qz()&&(this.textareaStyle.textIndent="-99999px"),this.textareaStyle.overflowY="visible",this.textareaParentStyle.opacity="0",this.textareaParentStyle.height="1px",we(this.TEXTAREA_PARENT,this.layerClass),X(this.TEXTAREA_PARENT,vf)}showEditableElement(){this.textareaParentStyle.height="",this.textareaParentStyle.overflow="",this.textareaParentStyle.position="",this.textareaParentStyle[this.hot.isRtl()?"left":"right"]="auto",this.textareaParentStyle.opacity="1",this.textareaStyle.textIndent="";const e=this.TEXTAREA_PARENT.childNodes;let n=!1;fe(e.length-1,r=>{const i=e[r];if(ye(i,"handsontableEditor"))return n=!0,!1}),ye(this.TEXTAREA_PARENT,vf)&&we(this.TEXTAREA_PARENT,vf),n?(this.layerClass=E4,X(this.TEXTAREA_PARENT,this.layerClass)):(this.layerClass=this.getEditedCellsLayerClass(),X(this.TEXTAREA_PARENT,this.layerClass))}refreshValue(){const e=this.hot.toPhysicalRow(this.row),n=this.hot.getSourceDataAtCell(e,this.col);this.originalValue=n,this.setValue(n),this.refreshDimensions()}refreshDimensions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.state!==Ut.EDITING&&!e)return;if(this.TD=this.getEditedCell(),!this.TD){e||this.close();return}const{top:n,start:r,width:i,maxWidth:o,height:s,maxHeight:a}=this.getEditedCellRect();this.textareaParentStyle.top=`${n}px`,this.textareaParentStyle[this.hot.isRtl()?"right":"left"]=`${r}px`,this.showEditableElement();const l=this.hot.rootWindow.getComputedStyle(this.TD);this.TEXTAREA.style.fontSize=l.fontSize,this.TEXTAREA.style.fontFamily=l.fontFamily,this.TEXTAREA.style.backgroundColor=this.TD.style.backgroundColor,this.autoResize.init(this.TEXTAREA,{minWidth:Math.min(i,o),minHeight:Math.min(s,a),maxWidth:o,maxHeight:a},!0)}bindEvents(){fD()&&this.eventManager.addEventListener(this.TEXTAREA,"focusout",()=>this.finishEditing(!1)),this.addHook("afterScrollHorizontally",()=>this.refreshDimensions()),this.addHook("afterScrollVertically",()=>this.refreshDimensions()),this.addHook("afterColumnResize",()=>{this.refreshDimensions(),this.state===Ut.EDITING&&this.focus()}),this.addHook("afterRowResize",()=>{this.refreshDimensions(),this.state===Ut.EDITING&&this.focus()})}allowKeyEventPropagation(){}destroy(){this.eventManager.destroy(),this.clearHooks()}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor"),r={runOnlyIf:()=>ue(this.hot.getSelected()),group:Gx},i=()=>{this.hot.rootDocument.execCommand("insertText",!1,`
79
- `)};n.addShortcuts([{keys:[["Control","Enter"]],callback:()=>(i(),!1),runOnlyIf:o=>!this.hot.selection.isMultiple()&&!o.altKey},{keys:[["Meta","Enter"]],callback:()=>(i(),!1),runOnlyIf:()=>!this.hot.selection.isMultiple()},{keys:[["Alt","Enter"]],callback:()=>(i(),!1)},{keys:[["Home"]],callback:(o,s)=>{let[a]=s;Yx(a,this.TEXTAREA)}},{keys:[["End"]],callback:(o,s)=>{let[a]=s;Yx(a,this.TEXTAREA)}}],r)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(Gx)}}const _4="base";function _d(t,e,n,r,i,o,s){const a=s.ariaTags,l=[],u=[],c=[],h=[];s.className&&X(e,s.className),s.readOnly?(l.push(s.readOnlyCellClassName),a&&h.push(UP())):a&&c.push(UP()[0]),s.valid===!1&&s.invalidCellClassName?(l.push(s.invalidCellClassName),a&&h.push(zP())):(u.push(s.invalidCellClassName),a&&c.push(zP()[0])),s.wordWrap===!1&&s.noWordWrapClassName&&l.push(s.noWordWrapClassName),!o&&s.placeholder&&l.push(s.placeholderCellClassName),we(e,u),X(e,l),Zu(e,c),Re(e,h)}_d.RENDERER_TYPE=_4;const M4="text";function hs(t,e,n,r,i,o,s){_d.apply(this,[t,e,n,r,i,o,s]);let a=o;!a&&s.placeholder&&(a=s.placeholder),a=At(a),s.trimWhitespace&&(a=a.trim()),al(e,a)}hs.RENDERER_TYPE=M4;const I4="text",Ek={CELL_TYPE:I4,editor:El,renderer:hs};ci(Ek);We.editors={BaseEditor:ec};function We(t,e){const n=new bk(t,e||{},wE);return n.init(),n}We.Core=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new bk(t,e,wE)};We.DefaultSettings=mk();We.hooks=ie.getSingleton();We.CellCoords=ul;We.CellRange=bd;We.packageName="handsontable";We.buildDate="24/04/2025 10:59:00";We.version="15.3.0";We.languages={dictionaryKeys:zK,getLanguageDictionary:ak,getLanguagesDictionaries:XK,registerLanguageDictionary:sk,getTranslatedPhrase:lk};function Tb(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function P4(t){if(Array.isArray(t))return Tb(t)}function O4(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Xh(t,e,n){return e=sm(e),L4(t,Tk()?Reflect.construct(e,n||[],sm(t).constructor):e.apply(t,n))}function $u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qx(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_k(r.key),r)}}function Fu(t,e,n){return e&&qx(t.prototype,e),n&&qx(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function x4(t,e,n){return(e=_k(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sm(t){return sm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},sm(t)}function Zh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_b(t,e)}function Tk(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Tk=function(){return!!t})()}function A4(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function H4(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
80
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kx(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function N4(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Kx(Object(n),!0).forEach(function(r){x4(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Kx(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function D4(t,e){if(t==null)return{};var n,r,i=k4(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function k4(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function L4(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return O4(t)}function _b(t,e){return _b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},_b(t,e)}function $4(t){return P4(t)||A4(t)||V4(t)||H4()}function F4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function _k(t){var e=F4(t,"string");return typeof e=="symbol"?e:e+""}function V4(t,e){if(t){if(typeof t=="string")return Tb(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tb(t,e):void 0}}var py=null,W4="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.",B4="The Handsontable instance bound to this component was destroyed and cannot be used properly.",am="global",j4="hot-wrapper-editor-container";function U4(){if(typeof console<"u"){var t;(t=console).warn.apply(t,arguments)}}function Mb(t,e){var n=Ot.Children.toArray(t),r=Ot.Children.count(t),i=null;return r!==0&&(r===1&&n[0].props[e]?i=n[0]:i=n.find(function(o){return o.props[e]!==void 0})),i||null}function Mk(t){return t?t.type.WrappedComponent?t.type.WrappedComponent:t.type:null}function Ik(t,e){if(typeof t>"u"||e===null)return null;var n=Ok(e.props,!1);return n.className="".concat(j4," ").concat(n.className),y1.createPortal(Ot.createElement("div",Object.assign({},n),e),t.body)}function Pk(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:am,r=Mb(t,"hot-editor"),i=Mk(r);return r?Ot.cloneElement(r,{emitEditorInstance:function(s,a){e.get(i)||e.set(i,new Map);var l=e.get(i);l.set(a??am,s)},editorColumnScope:n,isEditor:!0}):null}function z4(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:document,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;n||(n=document),py||(py=n.createDocumentFragment());var o=i??n.createElement("DIV");py.appendChild(o);var s=Ot.cloneElement(t,N4({key:"".concat(e.row,"-").concat(e.col)},e));return{portal:y1.createPortal(s,o,r),portalContainer:o}}function Ok(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return{id:t.id||(e?"hot-"+Math.random().toString(36).substring(5):void 0),className:t.className||"",style:t.style||{}}}function Y4(){return typeof window<"u"}var xk=(function(){function t(){$u(this,t)}return Fu(t,null,[{key:"getSettings",value:(function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.prevProps,o=i===void 0?{}:i,s=r.isInit,a=s===void 0?!1:s,l=r.initOnlySettingKeys,u=l===void 0?[]:l,c=function(y){return!a&&u.includes(y)?o[y]===n[y]:!1},h={};if(n.settings){var d=n.settings;for(var f in d)d.hasOwnProperty(f)&&!c(f)&&(h[f]=d[f])}for(var m in n)m!=="settings"&&m!=="children"&&!c(m)&&n.hasOwnProperty(m)&&(h[m]=n[m]);return h})}])})(),G4=(function(t){function e(){return $u(this,e),Xh(this,e,arguments)}return Zh(e,t),Fu(e,[{key:"getSettingsProps",value:(function(){var r=this;return this.internalProps=["_componentRendererColumns","_emitColumnSettings","_columnIndex","_getChildElementByType","_getRendererWrapper","_getEditorClass","_getEditorCache","_getOwnerDocument","hot-renderer","hot-editor","children"],Object.keys(this.props).filter(function(i){return!r.internalProps.includes(i)}).reduce(function(i,o){return i[o]=r.props[o],i},{})})},{key:"getLocalEditorElement",value:function(){return Pk(this.props.children,this.props._getEditorCache(),this.props._columnIndex)}},{key:"createColumnSettings",value:function(){var r=this.props._getChildElementByType(this.props.children,"hot-renderer"),i=this.getLocalEditorElement();this.columnSettings=xk.getSettings(this.getSettingsProps()),r!==null&&(this.columnSettings.renderer=this.props._getRendererWrapper(r),this.props._componentRendererColumns.set(this.props._columnIndex,!0)),i!==null&&(this.columnSettings.editor=this.props._getEditorClass(i,this.props._columnIndex))}},{key:"emitColumnSettings",value:function(){this.props._emitColumnSettings(this.columnSettings,this.props._columnIndex)}},{key:"componentDidMount",value:function(){this.createColumnSettings(),this.emitColumnSettings()}},{key:"componentDidUpdate",value:function(){this.createColumnSettings(),this.emitColumnSettings()}},{key:"render",value:function(){var r=this.props._getOwnerDocument(),i=Ik(r,this.getLocalEditorElement());return Ot.createElement(Ot.Fragment,null,i)}}])})(Ot.Component),q4=(function(t){function e(){var n;return $u(this,e),n=Xh(this,e,arguments),n.state={portals:[]},n}return Zh(e,t),Fu(e,[{key:"render",value:function(){return Ot.createElement(Ot.Fragment,null,this.state.portals)}}])})(Ot.Component),K4="15.3.0";function X4(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ak={exports:{}},wy,Xx;function Z4(){if(Xx)return wy;Xx=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return wy=t,wy}var vy,Zx;function J4(){if(Zx)return vy;Zx=1;var t=Z4();function e(){}function n(){}return n.resetWarningCache=e,vy=function(){function i(a,l,u,c,h,d){if(d!==t){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}i.isRequired=i;function o(){return i}var s={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:o,element:i,elementType:i,instanceOf:o,node:i,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:e};return s.PropTypes=s,s},vy}Ak.exports=J4()();var Q4=Ak.exports,Cy=X4(Q4),G0=(function(t){function e(){var n;return $u(this,e),n=Xh(this,e,arguments),n.id=null,n.__hotInstance=null,n.hotElementRef=null,n.columnSettings=[],n.renderersPortalManager=null,n.portalCache=new Map,n.portalContainerCache=new Map,n.renderedCellCache=new Map,n.editorCache=new Map,n.componentRendererColumns=new Map,n}return Zh(e,t),Fu(e,[{key:"hotInstance",get:(function(){return!this.__hotInstance||this.__hotInstance&&!this.__hotInstance.isDestroyed?this.__hotInstance:(console.warn(B4),null)}),set:(function(r){this.__hotInstance=r})},{key:"_isHotInstanceDestroyed",value:function(){return this.__hotInstance&&this.__hotInstance.isDestroyed}},{key:"getPortalContainerCache",value:function(){return this.portalContainerCache}},{key:"getRenderedCellCache",value:function(){return this.renderedCellCache}},{key:"getEditorCache",value:function(){return this.editorCache}},{key:"clearCache",value:function(){this.getRenderedCellCache().clear(),this.componentRendererColumns.clear()}},{key:"getOwnerDocument",value:function(){return Y4()?this.hotElementRef?this.hotElementRef.ownerDocument:document:null}},{key:"setHotElementRef",value:function(r){this.hotElementRef=r}},{key:"getRendererWrapper",value:function(r){var i=this;return function(s,a,l,u,c,h,d){var f=i.getRenderedCellCache(),m=i.getPortalContainerCache(),C="".concat(l,"-").concat(u),y=s.guid,E="".concat(y,"-").concat(C),v="".concat(C,"-").concat(y);if(f.has(C)&&(a.innerHTML=f.get(C).innerHTML),a&&!a.getAttribute("ghost-table")){for(var O=i.portalCache.get(v),x=m.get(E);a.firstChild;)a.removeChild(a.firstChild);if(O&&x)a.appendChild(x);else{var F=z4(r,{TD:a,row:l,col:u,prop:c,value:h,cellProperties:d,isRenderer:!0},a.ownerDocument,v,x),I=F.portal,_=F.portalContainer;m.set(E,_),a.appendChild(_),i.portalCache.set(v,I)}}return f.set(C,a),a}}},{key:"getEditorClass",value:function(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:am,s=Mk(r),a=(i=this.getEditorCache().get(s))===null||i===void 0?void 0:i.get(o);return this.makeEditorClass(a)}},{key:"makeEditorClass",value:function(r){var i=(function(o){function s(a){var l;return $u(this,s),l=Xh(this,s,[a]),r.hotCustomEditorInstance=l,l.editorComponent=r,l}return Zh(s,o),Fu(s,[{key:"focus",value:function(){}},{key:"getValue",value:function(){}},{key:"setValue",value:function(){}},{key:"open",value:function(){}},{key:"close",value:function(){}}])})(We.editors.BaseEditor);return Object.getOwnPropertyNames(We.editors.BaseEditor.prototype).forEach(function(o){o!=="constructor"&&(i.prototype[o]=function(){for(var s,a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];return(s=r[o]).call.apply(s,[r].concat(l))})}),i}},{key:"getGlobalRendererElement",value:function(){return Mb(this.props.children,"hot-renderer")}},{key:"getGlobalEditorElement",value:function(){return Pk(this.props.children,this.getEditorCache())}},{key:"createNewGlobalSettings",value:function(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=this._isHotInstanceDestroyed()?[]:((r=this.hotInstance)===null||r===void 0||(r=r.getSettings())===null||r===void 0?void 0:r._initOnlySettings)||[],a=xk.getSettings(this.props,{prevProps:o,isInit:i,initOnlySettingKeys:s}),l=this.getGlobalRendererElement(),u=this.getGlobalEditorElement();if(a.columns=this.columnSettings.length?this.columnSettings:a.columns,u)a.editor=this.getEditorClass(u,am);else{var c;this.props.editor||(c=this.props.settings)!==null&&c!==void 0&&c.editor?a.editor=this.props.editor||this.props.settings.editor:a.editor=fb("text")}if(l)a.renderer=this.getRendererWrapper(l),this.componentRendererColumns.set("global",!0);else{var h;this.props.renderer||(h=this.props.settings)!==null&&h!==void 0&&h.renderer?a.renderer=this.props.renderer||this.props.settings.renderer:a.renderer=wb("text")}return a}},{key:"displayAutoSizeWarning",value:function(r){var i,o;this.hotInstance&&((i=this.hotInstance.getPlugin("autoRowSize"))!==null&&i!==void 0&&i.enabled||(o=this.hotInstance.getPlugin("autoColumnSize"))!==null&&o!==void 0&&o.enabled)&&this.componentRendererColumns.size>0&&U4(W4)}},{key:"setHotColumnSettings",value:function(r,i){this.columnSettings[i]=r}},{key:"handsontableBeforeViewRender",value:function(){this.portalCache.clear(),this.getRenderedCellCache().clear()}},{key:"handsontableAfterViewRender",value:function(){this.renderersPortalManager.setState({portals:$4(this.portalCache.values())})}},{key:"updateHot",value:function(r){this.hotInstance&&this.hotInstance.updateSettings(r,!1)}},{key:"setRenderersPortalManagerRef",value:function(r){this.renderersPortalManager=r}},{key:"componentDidMount",value:function(){var r=this,i=this.createNewGlobalSettings(!0);this.hotInstance=new We.Core(this.hotElementRef,i),this.hotInstance.addHook("beforeViewRender",function(){return r.handsontableBeforeViewRender()}),this.hotInstance.addHook("afterViewRender",function(){return r.handsontableAfterViewRender()}),this.hotInstance.init(),this.displayAutoSizeWarning(i)}},{key:"componentDidUpdate",value:function(r){this.clearCache();var i=this.createNewGlobalSettings(!1,r);this.updateHot(i),this.displayAutoSizeWarning(i)}},{key:"componentWillUnmount",value:function(){this.clearCache(),this.hotInstance&&this.hotInstance.destroy()}},{key:"render",value:function(){var r=this,i=function(c){return c.type===G4},o=Ot.Children.toArray(this.props.children),s=o.filter(function(u){return i(u)}).map(function(u,c){return Ot.cloneElement(u,{_componentRendererColumns:r.componentRendererColumns,_emitColumnSettings:r.setHotColumnSettings.bind(r),_columnIndex:c,_getChildElementByType:Mb.bind(r),_getRendererWrapper:r.getRendererWrapper.bind(r),_getEditorClass:r.getEditorClass.bind(r),_getOwnerDocument:r.getOwnerDocument.bind(r),_getEditorCache:r.getEditorCache.bind(r),children:u.props.children})}),a=Ok(this.props),l=Ik(this.getOwnerDocument(),this.getGlobalEditorElement());return Ot.createElement(Ot.Fragment,null,Ot.createElement("div",Object.assign({ref:this.setHotElementRef.bind(this)},a),s),Ot.createElement(q4,{ref:this.setRenderersPortalManagerRef.bind(this)}),l)}}],[{key:"version",get:function(){return K4}}])})(Ot.Component);G0.propTypes={style:Cy.object,id:Cy.string,className:Cy.string};var e9=["children"],t9=Ot.forwardRef(function(t,e){var n,r=t.children,i=D4(t,e9),o=typeof Ot.useId=="function"?Ot.useId():void 0,s=(n=i.id)!==null&&n!==void 0?n:o;return Ot.createElement(G0,Object.assign({id:s},i,{ref:e}),r)});t9.version=G0.version;Ot.Component;const Jx="handsontableEditor",n9="handsontable";class q0 extends El{static get EDITOR_TYPE(){return n9}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(),op(this.TEXTAREA,0,this.TEXTAREA.value.length),this.htEditor.updateSettings({width:this.getWidth(),height:this.getHeight()}),this.refreshDimensions()}close(){this.htEditor&&(this.htEditor.rootElement.style.display="none"),this.removeHooksByKey("beforeKeyDown"),super.close()}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s);const a=this,l={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,autoWrapCol:!1,autoWrapRow:!1,ariaTags:!1,themeName:this.hot.getCurrentThemeName(),afterOnCellMouseDown(u,c){const h=this.getSourceData(c.row,c.col);h!==void 0&&a.setValue(h),a.hot.destroyEditor()},preventWheel:!0,layoutDirection:this.hot.isRtl()?"rtl":"ltr"};this.cellProperties.handsontable&&ln(l,s.handsontable),this.htOptions=l}beginEditing(e,n){const r=this.hot.getSettings().onBeginEditing;r&&r()===!1||super.beginEditing(e,n)}createElements(){super.createElements();const e=this.hot.rootDocument.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()}finishEditing(e,n,r){if(this.htEditor&&this.htEditor.isListening()&&this.hot.listen(),this.htEditor&&this.htEditor.getSelectedLast()){const i=this.htEditor.getValue();i!==void 0&&this.setValue(i)}super.finishEditing(e,n,r)}getHeight(){return this.htEditor.view.getTableHeight()+1}getWidth(){return this.htEditor.view.getTableWidth()}assignHooks(){this.hot.addHook("afterDestroy",()=>{var e;(e=this.htEditor)===null||e===void 0||e.destroy()}),this.hot.addHook("afterSetTheme",(e,n)=>{if(!n){var r;(r=this.htEditor)===null||r===void 0||r.useTheme(e)}})}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor");super.registerShortcuts();const r={group:Jx,relativeToGroup:ta,position:"before"},i=(o,s)=>{const a=this.htEditor;if(o!==void 0&&(o<0||a.flipped&&o>a.countRows()-1?a.deselectCell():a.selectCell(o,0),a.getData().length))return s.preventDefault(),Pi(s),this.hot.listen(),this.TEXTAREA.focus(),!1};n.addShortcuts([{keys:[["ArrowUp"]],callback:o=>{const s=this.htEditor;let a,l;return!s.getSelectedLast()&&s.flipped?a=s.countRows()-1:s.getSelectedLast()&&(s.flipped?(l=s.getSelectedLast()[0],a=Math.max(0,l-1)):(l=s.getSelectedLast()[0],a=l-1)),i(a,o)},preventDefault:!1},{keys:[["ArrowDown"]],callback:o=>{const s=this.htEditor;let a,l;if(!s.getSelectedLast()&&!s.flipped)a=0;else if(s.getSelectedLast()){if(s.flipped)a=s.getSelectedLast()[0]+1;else if(!s.flipped){const u=s.countRows()-1;l=s.getSelectedLast()[0],a=Math.min(u,l+1)}}return i(a,o)},preventDefault:!1}],r)}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(Jx)}}function r9(t,e){Hk(t,e),e.add(t)}function Qx(t,e,n){Hk(t,e),e.set(t,n)}function Hk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Cf(t,e,n){return(e=i9(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i9(t){var e=o9(t,"string");return typeof e=="symbol"?e:e+""}function o9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function yy(t,e){return t.get(Ib(t,e))}function Ib(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const s9="autocomplete";var Sy=new WeakMap,eA=new WeakMap,by=new WeakSet;class K0 extends q0{constructor(){super(...arguments),r9(this,by),Cf(this,"query",null),Cf(this,"strippedChoices",[]),Cf(this,"rawChoices",[]),Qx(this,Sy,this.hot.guid.slice(0,9)),Qx(this,eA,ap(()=>{this.focus()},100)),Cf(this,"sortByRelevance",function(e,n,r){const i=[],o=[],s=e.length;let a=n.length,l,u,c,h;if(s===0){for(c=0;c<a;c++)o.push(c);return o}for(c=0;c<a;c++){if(u=jP(At(n[c])),r)h=u.indexOf(e);else{const d=this.cellProperties.locale;h=u.toLocaleLowerCase(d).indexOf(e.toLocaleLowerCase(d))}h!==-1&&(l=u.length-h-s,i.push({baseIndex:c,index:h,charsLeft:l,value:u}))}for(i.sort((d,f)=>{if(f.index===-1)return-1;if(d.index===-1)return 1;if(d.index<f.index)return-1;if(f.index<d.index)return 1;if(d.index===f.index){if(d.charsLeft<f.charsLeft)return-1;if(d.charsLeft>f.charsLeft)return 1}return 0}),c=0,a=i.length;c<a;c++)o.push(i[c].baseIndex);return o})}static get EDITOR_TYPE(){return s9}getValue(){const e=this.rawChoices.find(n=>this.stripValueIfNeeded(n)===this.TEXTAREA.value);return ue(e)?e:this.TEXTAREA.value}createElements(){super.createElements(),X(this.htContainer,"autocompleteEditor"),X(this.htContainer,this.hot.rootWindow.navigator.platform.indexOf("Mac")===-1?"":"htMacScroll"),this.hot.getSettings().ariaTags&&Re(this.TEXTAREA,[dz(),az(),GN("listbox"),pz()])}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s),this.hot.getSettings().ariaTags&&Re(this.TEXTAREA,[Xr("false"),wz(`${yy(Sy,this)}-listbox-${e}-${n}`)])}open(){super.open();const e=this.cellProperties.trimDropdown===void 0?!0:this.cellProperties.trimDropdown,n=this.hot.getSettings().ariaTags,r=Array.isArray(this.cellProperties.source)?this.cellProperties.source:null,i=r==null?void 0:r.length,{row:o,col:s}=this;this.showEditableElement(),this.focus(),this.addHook("beforeKeyDown",a=>this.onBeforeKeyDown(a)),this.htEditor.addHook("afterScroll",yy(eA,this)),this.htEditor.updateSettings({colWidths:e?[Xt(this.TEXTAREA)-2]:void 0,autoColumnSize:!0,renderer:(a,l,u,c,h,d,f)=>{hs(a,l,u,c,h,d,f);const{filteringCaseSensitive:m,allowHtml:C,locale:y}=this.cellProperties,E=this.query;let v=At(d),O,x;v&&!C&&(O=m===!0?v.indexOf(E):v.toLocaleLowerCase(y).indexOf(E.toLocaleLowerCase(y)),O!==-1&&(x=v.substr(O,E.length),v=v.replace(x,`<strong>${x}</strong>`))),n&&Re(l,[lz(),...r?[Sz(i)]:[],...r?[bz(r.indexOf(d)+1)]:[],["id",`${this.htEditor.rootElement.id}_${u}-${c}`]]),l.innerHTML=v},afterSelectionEnd:(a,l)=>{if(n){const u=h=>{Re(h,[UR()]),Re(this.TEXTAREA,...vz(h.id))},c=this.htEditor.getCell(a,l,!0);c!==null?u(c):this.htEditor.addHookOnce("afterScrollVertically",()=>{const h=this.htEditor.getCell(a,l,!0);u(h)})}}}),n&&(Re(this.htEditor.view._wt.wtOverlays.wtTable.TABLE,...Go()),Re(this.htEditor.rootElement,[YN(),Cz("polite"),yz("text"),["id",`${yy(Sy,this)}-listbox-${o}-${s}`]]),Re(this.TEXTAREA,...Xr("true"))),this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)})}close(){this.removeHooksByKey("beforeKeyDown"),super.close(),this.hot.getSettings().ariaTags&&Re(this.TEXTAREA,[Xr("false")])}discardEditor(e){super.discardEditor(e),this.hot.view.render()}queryChoices(e){const n=this.cellProperties.source;this.query=e,typeof n=="function"?n.call(this.cellProperties,e,r=>{this.rawChoices=r,this.updateChoicesList(this.stripValuesIfNeeded(r))}):Array.isArray(n)?(this.rawChoices=n,this.updateChoicesList(this.stripValuesIfNeeded(n))):this.updateChoicesList([])}updateChoicesList(e){const n=rD(this.TEXTAREA),r=xz(this.TEXTAREA),i=this.cellProperties.sortByRelevance,o=this.cellProperties.filter;let s=null,a=null,l=e;i&&(s=this.sortByRelevance(this.stripValueIfNeeded(this.getValue()),l,this.cellProperties.filteringCaseSensitive));const u=Array.isArray(s)?s.length:0;if(o===!1)u&&(a=s[0]);else{const c=[];for(let h=0,d=l.length;h<d&&!(i&&u<=h);h++)u?c.push(l[s[h]]):c.push(l[h]);a=0,l=c}this.strippedChoices=l,l.length===0?this.htEditor.rootElement.style.display="none":this.htEditor.rootElement.style.display="",this.htEditor.loadData(_g([l])),l.length>0&&(this.updateDropdownDimensions(),this.flipDropdownIfNeeded(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(a)),this.hot.listen(),op(this.TEXTAREA,n,n===r?void 0:r)}flipDropdownIfNeeded(){const e=this.getEditedCellRect(),n=e.height;let r=e.top;if(this.hot.view.isVerticallyScrollableByWindow()){const a=this.hot.view.getTableOffset().top-this.hot.rootWindow.scrollY;r=Math.max(r+a,0)}const i=this.getHeight(),o=this.hot.view.getWorkspaceHeight()-r-n,s=i>o&&r>o+n;return s?this.flipDropdown(i):this.unflipDropdown(),this.limitDropdownIfNeeded(s?r:o,i),s}limitDropdownIfNeeded(e,n){if(n>e){let r=0,i=0,o=0,s=null;do o=this.htEditor.getRowHeight(i)||this.htEditor.view.getDefaultRowHeight(),r+=o,i+=1;while(r<e);s=r-o,this.htEditor.flipped&&(this.htEditor.rootElement.style.top=`${parseInt(this.htEditor.rootElement.style.top,10)+n-s}px`),this.setDropdownHeight(r-o)}}flipDropdown(e){const n=this.htEditor.rootElement.style;n.position="absolute",n.top=`${-e}px`,this.htEditor.flipped=!0}unflipDropdown(){const e=this.htEditor.rootElement.style;e.position="absolute",e.top="",this.htEditor.flipped=void 0}updateDropdownDimensions(){this.htEditor.updateSettings({width:this.getWidth(),height:this.getHeight()}),Ib(by,this,tA).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}setDropdownHeight(e){this.htEditor.updateSettings({height:e}),Ib(by,this,tA).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}highlightBestMatchingChoice(e){typeof e=="number"?this.htEditor.selectCell(e,0,void 0,void 0,void 0,!1):this.htEditor.deselectCell()}getHeight(){const e=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore")),n=parseInt(e.borderTopWidth,10)+parseInt(e.borderBottomWidth,10),r=Math.min(this.cellProperties.visibleRows,this.strippedChoices.length);return Array.from({length:r},(o,s)=>s).reduce((o,s)=>{const a=this.htEditor.getRowHeight(s)||this.htEditor.view.getDefaultRowHeight();return o+a},0)+n+1}getWidth(){const e=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore")),n=parseInt(e.borderInlineStartWidth,10)+parseInt(e.borderInlineEndWidth,10);return this.htEditor.getColWidth(0)+n}stripValueIfNeeded(e){return this.stripValuesIfNeeded([e])[0]}stripValuesIfNeeded(e){const{allowHtml:n}=this.cellProperties,r=ze(e,o=>At(o));return ze(r,o=>n?o:jP(o))}allowKeyEventPropagation(e){const n=this.htEditor.getSelectedRangeLast(),r={row:n?n.from.row:-1};let i=!1;return e===pe.ARROW_DOWN&&r.row>0&&r.row<this.htEditor.countRows()-1&&(i=!0),e===pe.ARROW_UP&&r.row>-1&&(i=!0),i}onBeforeKeyDown(e){if(Xz(e.keyCode)||e.keyCode===pe.BACKSPACE||e.keyCode===pe.DELETE||e.keyCode===pe.INSERT){let n=10;if(e.keyCode===pe.C&&(e.ctrlKey||e.metaKey))return;this.isOpened()||(n+=10),this.htEditor&&this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)},n)}}}function tA(){this.htEditor.view.hasVerticalScroll()&&this.htEditor.updateSettings({width:this.getWidth()+yn(this.hot.rootDocument)})}const a9="checkbox";class Nk extends ec{static get EDITOR_TYPE(){return a9}beginEditing(e,n){if(n&&n.type==="mouseup"&&n.target.nodeName==="TD"){const r=this.TD.querySelector('input[type="checkbox"]');ye(r,"htBadValue")||r.click()}}finishEditing(){}init(){}open(){}close(){}getValue(){}setValue(){}focus(){}}/*!
81
- * Pikaday
82
- *
83
- * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/Pikaday/Pikaday
84
- */const Fs=()=>window,Yr=()=>window.document,Pb=(t,e)=>window.setTimeout(t,e),Ji=function(t,e,n,r){t.addEventListener(e,n,!!r)},Io=function(t,e,n,r){t.removeEventListener(e,n,!!r)},l9=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},Rr=function(t,e){return(" "+t.className+" ").indexOf(" "+e+" ")!==-1},Ry=function(t,e){Rr(t,e)||(t.className=t.className===""?e:t.className+" "+e)},Ey=function(t,e){t.className=l9((" "+t.className+" ").replace(" "+e+" "," "))},X0=function(t){return/Array/.test(Object.prototype.toString.call(t))},Mr=function(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())},u9=function(t){let e=t.getDay();return e===0||e===6},c9=function(t){return t%4===0&&t%100!==0||t%400===0},nA=function(t,e){return[31,c9(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},yf=function(t){Mr(t)&&t.setHours(0,0,0,0)},Sf=function(t,e){return t.getTime()===e.getTime()},lm=function(t,e,n){let r,i;for(r in e)i=t[r]!==void 0,i&&typeof e[r]=="object"&&e[r]!==null&&e[r].nodeName===void 0?Mr(e[r])?n&&(t[r]=new Date(e[r].getTime())):X0(e[r])?n&&(t[r]=e[r].slice(0)):t[r]=lm({},e[r],n):(n||!i)&&(t[r]=e[r]);return t},rA=function(t,e,n){let r=Yr().createEvent("HTMLEvents");r.initEvent(e,!0,!1),r=lm(r,n),t.dispatchEvent(r)},iA=function(t){return t.month<0&&(t.year-=Math.ceil(Math.abs(t.month)/12),t.month+=12),t.month>11&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t},Vi={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},oA=function(t,e,n){for(e+=t.firstDay;e>=7;)e-=7;return n?t.i18n.weekdaysShort[e]:t.i18n.weekdays[e]},h9=function(t){let e=[],n="false";if(t.isEmpty)if(t.showDaysInNextAndPreviousMonths)e.push("is-outside-current-month"),t.enableSelectionDaysInNextAndPreviousMonths||e.push("is-selection-disabled");else return'<td class="is-empty"></td>';return t.isDisabled&&e.push("is-disabled"),t.isToday&&e.push("is-today"),t.isSelected&&(e.push("is-selected"),n="true"),t.hasEvent&&e.push("has-event"),t.isInRange&&e.push("is-inrange"),t.isStartRange&&e.push("is-startrange"),t.isEndRange&&e.push("is-endrange"),'<td data-day="'+t.day+'" class="'+e.join(" ")+'" aria-selected="'+n+'"><button class="pika-button pika-day" type="button" data-pika-year="'+t.year+'" data-pika-month="'+t.month+'" data-pika-day="'+t.day+'">'+t.day+"</button></td>"},d9=function(t,e){t.setHours(0,0,0,0);let n=t.getDate(),r=t.getDay(),i=e,o=i-1,s=7,a=function(d){return(d+s-1)%s};t.setDate(n+o-a(r));let l=new Date(t.getFullYear(),0,i),u=1440*60*1e3,c=(t.getTime()-l.getTime())/u;return 1+Math.round((c-o+a(l.getDay()))/s)},f9=function(t,e,n,r,i){let o=new Date(r,n,e);return'<td class="pika-week">'+(t.hasMoment?t.moment(o).isoWeek():d9(o,i))+"</td>"},g9=function(t,e,n,r){return'<tr class="pika-row'+(n?" pick-whole-week":"")+(r?" is-selected":"")+'">'+(e?t.reverse():t).join("")+"</tr>"},m9=function(t){return"<tbody>"+t.join("")+"</tbody>"},p9=function(t){let e,n=[];for(t.showWeekNumber&&n.push("<th></th>"),e=0;e<7;e++)n.push('<th scope="col"><abbr title="'+oA(t,e)+'">'+oA(t,e,!0)+"</abbr></th>");return"<thead><tr>"+(t.isRTL?n.reverse():n).join("")+"</tr></thead>"},w9=function(t,e,n,r,i,o){let s,a,l,u=t._o,c=n===u.minYear,h=n===u.maxYear,d='<div id="'+o+'" class="pika-title" role="heading" aria-live="polite">',f,m,C=!0,y=!0;for(l=[],s=0;s<12;s++)l.push('<option value="'+(n===i?s-e:12+s-e)+'"'+(s===r?' selected="selected"':"")+(c&&s<u.minMonth||h&&s>u.maxMonth?' disabled="disabled"':"")+">"+u.i18n.months[s]+"</option>");for(f='<div class="pika-label">'+u.i18n.months[r]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",X0(u.yearRange)?(s=u.yearRange[0],a=u.yearRange[1]+1):(s=n-u.yearRange,a=1+n+u.yearRange),l=[];s<a&&s<=u.maxYear;s++)s>=u.minYear&&l.push('<option value="'+s+'"'+(s===n?' selected="selected"':"")+">"+s+"</option>");return m='<div class="pika-label">'+n+u.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",u.showMonthAfterYear?d+=m+f:d+=f+m,c&&(r===0||u.minMonth>=r)&&(C=!1),h&&(r===11||u.maxMonth<=r)&&(y=!1),e===0&&(d+='<button class="pika-prev'+(C?"":" is-disabled")+'" type="button">'+u.i18n.previousMonth+"</button>"),e===t._o.numberOfMonths-1&&(d+='<button class="pika-next'+(y?"":" is-disabled")+'" type="button">'+u.i18n.nextMonth+"</button>"),d+="</div>"},v9=function(t,e,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+p9(t)+m9(e)+"</table>"};function Ob(t){let e=this,n=e.config(t);e._onMouseDown=function(i){if(!e._v)return;i=i||Fs().event;let o=i.target||i.srcElement;if(o)if(Rr(o,"is-disabled")||(Rr(o,"pika-button")&&!Rr(o,"is-empty")&&!Rr(o.parentNode,"is-disabled")?(e.setDate(new Date(o.getAttribute("data-pika-year"),o.getAttribute("data-pika-month"),o.getAttribute("data-pika-day"))),n.bound&&Pb(function(){e.hide(),n.blurFieldOnSelect&&n.field&&n.field.blur()},100)):Rr(o,"pika-prev")?e.prevMonth():Rr(o,"pika-next")&&e.nextMonth()),Rr(o,"pika-select"))e._c=!0;else if(i.preventDefault)i.preventDefault();else return i.returnValue=!1,!1},e._onChange=function(i){i=i||Fs().event;let o=i.target||i.srcElement;o&&(Rr(o,"pika-select-month")?e.gotoMonth(o.value):Rr(o,"pika-select-year")&&e.gotoYear(o.value))},e._onKeyChange=function(i){if(i=i||Fs().event,e.isVisible())switch(i.keyCode){case 13:case 27:n.field&&n.field.blur();break;case 37:e.adjustDate("subtract",1);break;case 38:e.adjustDate("subtract",7);break;case 39:e.adjustDate("add",1);break;case 40:e.adjustDate("add",7);break;case 8:case 46:e.setDate(null);break}},e._parseFieldValue=function(){if(n.parse)return n.parse(n.field.value,n.format);if(this.hasMoment){let i=this.moment(n.field.value,n.format,n.formatStrict);return i&&i.isValid()?i.toDate():null}else return new Date(Date.parse(n.field.value))},e._onInputChange=function(i){let o;i.firedBy!==e&&(o=e._parseFieldValue(),Mr(o)&&e.setDate(o),e._v||e.show())},e._onInputFocus=function(){e.show()},e._onInputClick=function(){e.show()},e._onInputBlur=function(){let i=Yr().activeElement;do if(Rr(i,"pika-single"))return;while(i=i.parentNode);e._c||(e._b=Pb(function(){e.hide()},50)),e._c=!1},e._onClick=function(i){i=i||Fs().event;let o=i.target||i.srcElement,s=o;if(o){!hasEventListeners&&Rr(o,"pika-select")&&(o.onchange||(o.setAttribute("onchange","return;"),Ji(o,"change",e._onChange)));do if(Rr(s,"pika-single")||s===n.trigger)return;while(s=s.parentNode);e._v&&o!==n.trigger&&s!==n.trigger&&e.hide()}},e.el=Yr().createElement("div"),e.el.className="pika-single"+(n.isRTL?" is-rtl":"")+(n.theme?" "+n.theme:""),Ji(e.el,"mousedown",e._onMouseDown,!0),Ji(e.el,"touchend",e._onMouseDown,!0),Ji(e.el,"change",e._onChange),n.keyboardInput&&Ji(Yr(),"keydown",e._onKeyChange),n.field&&(n.container?n.container.appendChild(e.el):n.bound?Yr().body.appendChild(e.el):n.field.parentNode.insertBefore(e.el,n.field.nextSibling),Ji(n.field,"change",e._onInputChange),n.defaultDate||(n.defaultDate=e._parseFieldValue(),n.setDefaultDate=!0));let r=n.defaultDate;Mr(r)?n.setDefaultDate?e.setDate(r,!0):e.gotoDate(r):e.gotoDate(new Date),n.bound?(this.hide(),e.el.className+=" is-bound",Ji(n.trigger,"click",e._onInputClick),Ji(n.trigger,"focus",e._onInputFocus),Ji(n.trigger,"blur",e._onInputBlur)):this.show()}Ob.prototype={config:function(t){this._o||(this._o=lm({},Vi,!0));let e=lm(this._o,t,!0);e.isRTL=!!e.isRTL,e.field=e.field&&e.field.nodeName?e.field:null,e.theme=typeof e.theme=="string"&&e.theme?e.theme:null,e.bound=!!(e.bound!==void 0?e.field&&e.bound:e.field),e.trigger=e.trigger&&e.trigger.nodeName?e.trigger:e.field,e.disableWeekends=!!e.disableWeekends,e.disableDayFn=typeof e.disableDayFn=="function"?e.disableDayFn:null;let n=parseInt(e.numberOfMonths,10)||1;if(e.numberOfMonths=n>4?4:n,Mr(e.minDate)||(e.minDate=!1),Mr(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),X0(e.yearRange)){let r=new Date().getFullYear()-10;e.yearRange[0]=parseInt(e.yearRange[0],10)||r,e.yearRange[1]=parseInt(e.yearRange[1],10)||r}else e.yearRange=Math.abs(parseInt(e.yearRange,10))||Vi.yearRange,e.yearRange>100&&(e.yearRange=100);return e},toString:function(t){return t=t||this._o.format,Mr(this._d)?this._o.toString?this._o.toString(this._d,t):this.hasMoment?this.moment(this._d).format(t):this._d.toDateString():""},getMoment:function(){return this.hasMoment?this.moment(this._d):null},setMoment:function(t,e){this.hasMoment&&this.moment.isMoment(t)&&this.setDate(t.toDate(),e)},useMoment:function(t){this.hasMoment=!0,this.moment=t},getDate:function(){return Mr(this._d)?new Date(this._d.getTime()):null},setDate:function(t,e){if(!t)return this._d=null,this._o.field&&(this._o.field.value="",rA(this._o.field,"change",{firedBy:this})),this.draw();if(typeof t=="string"&&(t=new Date(Date.parse(t))),!Mr(t))return;let n=this._o.minDate,r=this._o.maxDate;Mr(n)&&t<n?t=n:Mr(r)&&t>r&&(t=r),this._d=new Date(t.getTime()),yf(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),rA(this._o.field,"change",{firedBy:this})),!e&&typeof this._o.onSelect=="function"&&this._o.onSelect.call(this,this.getDate())},clear:function(){this.setDate(null)},gotoDate:function(t){let e=!0;if(Mr(t)){if(this.calendars){let n=new Date(this.calendars[0].year,this.calendars[0].month,1),r=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),i=t.getTime();r.setMonth(r.getMonth()+1),r.setDate(r.getDate()-1),e=i<n.getTime()||r.getTime()<i}e&&(this.calendars=[{month:t.getMonth(),year:t.getFullYear()}],this._o.mainCalendar==="right"&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(t,e){let n=this.getDate()||new Date,r=parseInt(e)*24*60*60*1e3,i;t==="add"?i=new Date(n.valueOf()+r):t==="subtract"&&(i=new Date(n.valueOf()-r)),this.setDate(i)},adjustCalendars:function(){this.calendars[0]=iA(this.calendars[0]);for(let t=1;t<this._o.numberOfMonths;t++)this.calendars[t]=iA({month:this.calendars[0].month+t,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())},setMinDate:function(t){t instanceof Date?(yf(t),this._o.minDate=t,this._o.minYear=t.getFullYear(),this._o.minMonth=t.getMonth()):(this._o.minDate=Vi.minDate,this._o.minYear=Vi.minYear,this._o.minMonth=Vi.minMonth,this._o.startRange=Vi.startRange),this.draw()},setMaxDate:function(t){t instanceof Date?(yf(t),this._o.maxDate=t,this._o.maxYear=t.getFullYear(),this._o.maxMonth=t.getMonth()):(this._o.maxDate=Vi.maxDate,this._o.maxYear=Vi.maxYear,this._o.maxMonth=Vi.maxMonth,this._o.endRange=Vi.endRange),this.draw()},setStartRange:function(t){this._o.startRange=t},setEndRange:function(t){this._o.endRange=t},draw:function(t){if(!this._v&&!t)return;let e=this._o,n=e.minYear,r=e.maxYear,i=e.minMonth,o=e.maxMonth,s="",a;this._y<=n&&(this._y=n,!isNaN(i)&&this._m<i&&(this._m=i)),this._y>=r&&(this._y=r,!isNaN(o)&&this._m>o&&(this._m=o));for(let l=0;l<e.numberOfMonths;l++)a="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2),s+='<div class="pika-lendar">'+w9(this,l,this.calendars[l].year,this.calendars[l].month,this.calendars[0].year,a)+this.render(this.calendars[l].year,this.calendars[l].month,a)+"</div>";this.el.innerHTML=s,e.bound&&e.field.type!=="hidden"&&Pb(function(){e.trigger.focus()},1),typeof this._o.onDraw=="function"&&this._o.onDraw(this),e.bound&&e.field.setAttribute("aria-label",e.ariaLabel)},adjustPosition:function(){let t,e,n,r,i,o,s,a,l,u,c;this._o.container||(this.el.style.position="absolute",t=this._o.trigger,e=this.el.offsetWidth,n=this.el.offsetHeight,r=Fs().innerWidth||Yr().documentElement.clientWidth,i=Fs().innerHeight||Yr().documentElement.clientHeight,o=Yr().body.scrollTop||Yr().documentElement.scrollTop,u=!0,c=!0,l=t.getBoundingClientRect(),s=l.left+Fs().pageXOffset,a=l.bottom+Fs().pageYOffset,(this._o.reposition&&s+e>r||this._o.position.indexOf("right")>-1&&s-e+t.offsetWidth>0)&&(s=s-e+t.offsetWidth,u=!1),(this._o.reposition&&a+n>i+o||this._o.position.indexOf("top")>-1&&a-n-t.offsetHeight>0)&&(a=a-n-t.offsetHeight,c=!1),s<0&&(s=0),a<0&&(a=0),this.el.style.left=s+"px",this.el.style.top=a+"px",Ry(this.el,u?"left-aligned":"right-aligned"),Ry(this.el,c?"bottom-aligned":"top-aligned"),Ey(this.el,u?"right-aligned":"left-aligned"),Ey(this.el,c?"top-aligned":"bottom-aligned"))},render:function(t,e,n){let r=this._o,i=new Date,o=nA(t,e),s=new Date(t,e,1).getDay(),a=[],l=[];yf(i),r.firstDay>0&&(s-=r.firstDay,s<0&&(s+=7));let u=e===0?11:e-1,c=e===11?0:e+1,h=e===0?t-1:t,d=e===11?t+1:t,f=nA(h,u),m=o+s,C=m;for(;C>7;)C-=7;m+=7-C;let y=!1;for(let E=0,v=0;E<m;E++){let O=new Date(t,e,1+(E-s)),x=Mr(this._d)?Sf(O,this._d):!1,F=Sf(O,i),I=r.events.indexOf(O.toDateString())!==-1,_=E<s||E>=o+s,q=1+(E-s),G=e,U=t,J=r.startRange&&Sf(r.startRange,O),te=r.endRange&&Sf(r.endRange,O),le=r.startRange&&r.endRange&&r.startRange<O&&O<r.endRange,ne=r.minDate&&O<r.minDate||r.maxDate&&O>r.maxDate||r.disableWeekends&&u9(O)||r.disableDayFn&&r.disableDayFn(O);_&&(E<s?(q=f+q,G=u,U=h):(q=q-o,G=c,U=d));let se={day:q,month:G,year:U,hasEvent:I,isSelected:x,isToday:F,isDisabled:ne,isEmpty:_,isStartRange:J,isEndRange:te,isInRange:le,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:r.enableSelectionDaysInNextAndPreviousMonths};r.pickWholeWeek&&x&&(y=!0),l.push(h9(se)),++v===7&&(r.showWeekNumber&&l.unshift(f9(this,E-s,e,t,r.firstWeekOfYearMinDays)),a.push(g9(l,r.isRTL,r.pickWholeWeek,y)),l=[],v=0,y=!1)}return v9(r,a,n)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),Ey(this.el,"is-hidden"),this._o.bound&&(Ji(Yr(),"click",this._onClick),this.adjustPosition()),typeof this._o.onOpen=="function"&&this._o.onOpen.call(this))},hide:function(){let t=this._v;t!==!1&&(this._o.bound&&Io(Yr(),"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),Ry(this.el,"is-hidden"),this._v=!1,t!==void 0&&typeof this._o.onClose=="function"&&this._o.onClose.call(this))},destroy:function(){let t=this._o;this.hide(),Io(this.el,"mousedown",this._onMouseDown,!0),Io(this.el,"touchend",this._onMouseDown,!0),Io(this.el,"change",this._onChange),t.keyboardInput&&Io(Yr(),"keydown",this._onKeyChange),t.field&&(Io(t.field,"change",this._onInputChange),t.bound&&(Io(t.trigger,"click",this._onInputClick),Io(t.trigger,"focus",this._onInputFocus),Io(t.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}};function C9(t,e){y9(t,e),e.add(t)}function y9(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function sA(t,e,n){return(e=S9(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function S9(t){var e=b9(t,"string");return typeof e=="symbol"?e:e+""}function b9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ty(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Dk="date",aA="dateEditor",R9="DD/MM/YYYY";var bf=new WeakSet;class kk extends El{constructor(){super(...arguments),C9(this,bf),sA(this,"parentDestroyed",!1),sA(this,"$datePicker",null)}static get EDITOR_TYPE(){return Dk}init(){if(typeof Z!="function")throw new Error("You need to include moment.js to your project.");if(typeof Ob!="function")throw new Error("You need to include Pikaday to your project.");super.init(),this.hot.addHook("afterDestroy",()=>{this.parentDestroyed=!0,this.destroyElements()}),this.hot.addHook("afterSetTheme",(e,n)=>{n||(we(this.datePicker,/ht-theme-.*/g),X(this.datePicker,e))})}createElements(){super.createElements(),this.datePicker=this.hot.rootDocument.createElement("DIV"),this.datePickerStyle=this.datePicker.style,this.datePickerStyle.position="absolute",this.datePickerStyle.top=0,this.datePickerStyle.left=0,this.datePickerStyle.zIndex=9999,this.datePicker.setAttribute("dir",this.hot.isRtl()?"rtl":"ltr"),X(this.datePicker,"htDatepickerHolder");const e=this.hot.getCurrentThemeName();we(this.datePicker,/ht-theme-.*/g),X(this.datePicker,e),this.hot.rootDocument.body.appendChild(this.datePicker),this.eventManager.addEventListener(this.datePicker,"mousedown",n=>{ye(n.target,"pika-day")&&this.hideDatepicker(),n.stopPropagation()})}destroyElements(){const e=this.datePicker.parentNode;this.$datePicker&&this.$datePicker.destroy(),e&&e.removeChild(this.datePicker)}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s)}open(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const r=this.hot.getShortcutManager().getContext("editor");this.showDatepicker(e),super.open(),r.addShortcuts([{keys:[["ArrowLeft"]],callback:()=>{this.$datePicker.adjustDate("subtract",1)}},{keys:[["ArrowRight"]],callback:()=>{this.$datePicker.adjustDate("add",1)}},{keys:[["ArrowUp"]],callback:()=>{this.$datePicker.adjustDate("subtract",7)}},{keys:[["ArrowDown"]],callback:()=>{this.$datePicker.adjustDate("add",7)}}],{group:aA})}close(){var e;this._opened=!1,(e=this.$datePicker)!==null&&e!==void 0&&e.destroy&&this.$datePicker.destroy(),this.hot._registerTimeout(()=>{const i=this.hot._getEditorManager();i.closeEditor(),this.hot.view.render(),i.prepareEditor()}),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(aA),super.close()}finishEditing(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.finishEditing(e,n)}showDatepicker(e){const n=Ty(bf,this,_y).call(this),r=this.hot.view.isMouseDown(),i=e?mD(e.keyCode):!1;let o;this.datePicker.style.display="block",this.$datePicker=new Ob(this.getDatePickerConfig()),typeof this.$datePicker.useMoment=="function"&&this.$datePicker.useMoment(Z),this.$datePicker._onInputFocus=function(){},this.originalValue?(o=this.originalValue,Z(o,n,!0).isValid()&&this.$datePicker.setMoment(Z(o,n),!0),this.getValue()!==this.originalValue&&this.setValue(this.originalValue),!i&&!r&&this.setValue("")):this.cellProperties.defaultDate?(o=this.cellProperties.defaultDate,Z(o,n,!0).isValid()&&this.$datePicker.setMoment(Z(o,n),!0),!i&&!r&&this.setValue("")):this.$datePicker.gotoToday()}hideDatepicker(){this.datePickerStyle.display="none",this.$datePicker.hide()}getDatePickerConfig(){var e;const n=this.TEXTAREA,r={};this.cellProperties&&this.cellProperties.datePickerConfig&&lp(r,this.cellProperties.datePickerConfig);const i=r.onSelect,o=r.onClose;return r.field=n,r.trigger=n,r.container=this.datePicker,r.bound=!1,r.keyboardInput=!1,r.format=(e=r.format)!==null&&e!==void 0?e:Ty(bf,this,_y).call(this),r.reposition=r.reposition||!1,r.isRTL=!1,r.onSelect=s=>{let a=s;isNaN(a.getTime())||(a=Z(a).format(Ty(bf,this,_y).call(this))),this.setValue(a),i&&i(),qo()&&this.hideDatepicker()},r.onClose=()=>{this.parentDestroyed||this.finishEditing(!1),o&&o()},r}refreshDimensions(e){var n;if(super.refreshDimensions(e),this.state!==Ut.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.hideDatepicker();return}const{rowIndexMapper:r,columnIndexMapper:i}=this.hot,{wtOverlays:o}=this.hot.view._wt,{wtTable:s}=(n=o.getParentOverlay(this.TD))!==null&&n!==void 0?n:this.hot.view._wt,a=r.getVisualFromRenderableIndex(s.getFirstPartiallyVisibleRow()),l=r.getVisualFromRenderableIndex(s.getLastPartiallyVisibleRow()),u=i.getVisualFromRenderableIndex(s.getFirstPartiallyVisibleColumn()),c=i.getVisualFromRenderableIndex(s.getLastPartiallyVisibleColumn());if(this.row>=a&&this.row<=l&&this.col>=u&&this.col<=c){const h=this.TD.getBoundingClientRect();this.datePickerStyle.top=`${this.hot.rootWindow.pageYOffset+h.top+an(this.TD)}px`;let d=this.hot.rootWindow.pageXOffset;this.hot.isRtl()?d+=h.right-Xt(this.datePicker):d+=h.left,this.datePickerStyle.left=`${d}px`}else this.hideDatepicker()}}function _y(){var t;return(t=this.cellProperties.dateFormat)!==null&&t!==void 0?t:R9}const E9="dropdown";class Lk extends K0{static get EDITOR_TYPE(){return E9}prepare(e,n,r,i,o,s){s.filter=!1,s.strict=!0,super.prepare(e,n,r,i,o,s)}}const T9="numeric";class $k extends El{static get EDITOR_TYPE(){return T9}}function _9(t,e,n){return(e=M9(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function M9(t){var e=I9(t,"string");return typeof e=="symbol"?e:e+""}function I9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const P9="password";class Fk extends El{constructor(){super(...arguments),_9(this,"autoResize",Rk(this.hot.rootDocument,{textContent:e=>"•".repeat(e.value.length)}))}static get EDITOR_TYPE(){return P9}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,rs(this.TEXTAREA_PARENT),this.TEXTAREA_PARENT.appendChild(this.TEXTAREA)}}const My="ht_editor_visible",lA="selectEditor",O9="select";class Vk extends ec{static get EDITOR_TYPE(){return O9}init(){this.selectWrapper=this.hot.rootDocument.createElement("div"),this.select=this.hot.rootDocument.createElement("select"),this.select.setAttribute("data-hot-input","true"),this.selectWrapper.style.display="none";const e=this.hot.rootDocument.createElement("DIV"),n=this.hot.getSettings().ariaTags;e.className="htAutocompleteArrow",n&&e.setAttribute(...bl()),e.appendChild(this.hot.rootDocument.createTextNode("▼")),X(this.selectWrapper,"htSelectEditor"),this.selectWrapper.appendChild(this.select),this.selectWrapper.insertBefore(e,this.selectWrapper.firstChild),this.hot.rootElement.appendChild(this.selectWrapper),this.registerHooks()}getValue(){return this.select.value}setValue(e){this.select.value=e}open(){this._opened=!0,this.refreshDimensions(),this.selectWrapper.style.display="",this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this._opened=!1,this.selectWrapper.style.display="none",ye(this.selectWrapper,My)&&we(this.selectWrapper,My),this.unregisterShortcuts(),this.clearHooks()}focus(){this.select.focus()}registerHooks(){this.addHook("afterScrollHorizontally",()=>this.refreshDimensions()),this.addHook("afterScrollVertically",()=>this.refreshDimensions()),this.addHook("afterColumnResize",()=>this.refreshDimensions()),this.addHook("afterRowResize",()=>this.refreshDimensions())}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s);const a=this.cellProperties.selectOptions;let l;typeof a=="function"?l=this.prepareOptions(a(this.row,this.col,this.prop)):l=this.prepareOptions(a),rs(this.select),ke(l,(u,c)=>{const h=this.hot.rootDocument.createElement("OPTION");h.value=c,Ju(h,u),this.select.appendChild(h)})}prepareOptions(e){let n={};if(Array.isArray(e))for(let r=0,i=e.length;r<i;r++)n[e[r]]=e[r];else typeof e=="object"&&(n=e);return n}refreshValue(){const e=this.hot.getSourceDataAtCell(this.row,this.prop);this.originalValue=e,this.setValue(e),this.refreshDimensions()}refreshDimensions(){if(this.state!==Ut.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.close();return}const{top:e,start:n,width:r,height:i}=this.getEditedCellRect(),o=this.selectWrapper.style;o.height=`${i}px`,o.width=`${r}px`,o.top=`${e}px`,o[this.hot.isRtl()?"right":"left"]=`${n}px`,o.margin="0px",X(this.selectWrapper,My)}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor"),r={group:lA};this.isInFullEditMode()&&n.addShortcuts([{keys:[["ArrowUp"]],callback:()=>{const i=this.select.selectedIndex-1;i>=0&&(this.select[i].selected=!0)}},{keys:[["ArrowDown"]],callback:()=>{const i=this.select.selectedIndex+1;i<=this.select.length-1&&(this.select[i].selected=!0)}}],r)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(lA)}}const x9="time";class Wk extends El{static get EDITOR_TYPE(){return x9}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s),this.TEXTAREA.dir="ltr"}}function A9(){Er(ec),Er(K0),Er(Nk),Er(kk),Er(Lk),Er(q0),Er($k),Er(Fk),Er(Vk),Er(El),Er(Wk)}const H9="html";function Z0(t,e,n,r,i,o,s){_d.apply(this,[t,e,n,r,i,o,s]),Ju(e,o??"",!1)}Z0.RENDERER_TYPE=H9;const N9="autocomplete";function nc(t,e,n,r,i,o,s){const{rootDocument:a}=t,l=s.allowHtml?Z0:hs,u=a.createElement("DIV"),c=t.getSettings().ariaTags;if(u.className="htAutocompleteArrow",c&&u.setAttribute(...bl()),u.appendChild(a.createTextNode("▼")),l.apply(this,[t,e,n,r,i,o,s]),e.firstChild||e.appendChild(a.createTextNode(" ")),e.insertBefore(u,e.firstChild),X(e,"htAutocomplete"),!t.acArrowListener){const h=new _i(t);t.acArrowListener=function(d){ye(d.target,"htAutocompleteArrow")&&t.view._wt.getSetting("onCellDblClick",null,t._createCellCoords(n,r),e)},h.addEventListener(t.rootElement,"mousedown",t.acArrowListener),t.addHookOnce("afterDestroy",()=>{h.destroy()})}}nc.RENDERER_TYPE=N9;const D9="dropdown";function J0(t,e,n,r,i,o,s){nc.apply(this,[t,e,n,r,i,o,s])}J0.RENDERER_TYPE=D9;const uA=new WeakMap,cA=new WeakMap,k9="htBadValue",Vu="data-row",Wu="data-col",L9="checkboxRenderer",Bk="checkbox";ie.getSingleton().add("modifyAutoColumnSizeSeed",function(t,e,n){const{label:r,type:i,row:o,column:s,prop:a}=e;if(i===Bk){if(r){const{value:l,property:u}=r;let c=n;if(l)c=typeof l=="function"?l(o,s,a,n):l;else if(u){const h=this.getDataAtRowProp(o,u);c=h!==null?h:n}t=c}return t}});function Q0(t,e,n,r,i,o,s){const{rootDocument:a}=t,l=t.getSettings().ariaTags;_d.apply(this,[t,e,n,r,i,o,s]),$9(t);let u=F9(a);const c=s.label;let h=!1;if(typeof s.checkedTemplate>"u"&&(s.checkedTemplate=!0),typeof s.uncheckedTemplate>"u"&&(s.uncheckedTemplate=!1),rs(e),o===s.checkedTemplate||At(o).toLocaleLowerCase(s.locale)===At(s.checkedTemplate).toLocaleLowerCase(s.locale)?u.checked=!0:o===s.uncheckedTemplate||At(o).toLocaleLowerCase(s.locale)===At(s.uncheckedTemplate).toLocaleLowerCase(s.locale)?u.checked=!1:Yt(o)?X(u,"noValue"):(u.style.display="none",X(u,k9),h=!0),Re(u,[[Vu,n],[Wu,r]]),l&&Re(u,[Uh(u.checked?t.getTranslatedPhrase(j0):t.getTranslatedPhrase(U0)),XN(u.checked),uz()]),!h&&c){let C="";if(c.value)C=typeof c.value=="function"?c.value.call(this,n,r,i,o):c.value;else if(c.property){const E=t.getDataAtRowProp(n,c.property);C=E!==null?E:""}const y=V9(a,C,c.separated!==!0);c.position==="before"?c.separated?(e.appendChild(y),e.appendChild(u)):(y.appendChild(u),u=y):(!c.position||c.position==="after")&&(c.separated?(e.appendChild(u),e.appendChild(y)):(y.insertBefore(u,y.firstChild),u=y))}(!c||c&&!c.separated)&&e.appendChild(u),h&&e.appendChild(a.createTextNode("#bad-value#")),uA.has(t)||(uA.set(t,!0),d());function d(){const y=t.getShortcutManager().getContext("grid"),E={group:L9,relativeToGroup:ta,position:"before"};y.addShortcuts([{keys:[["space"]],callback:()=>(f(),!m()),runOnlyIf:()=>{var v;return(v=t.getSelectedRangeLast())===null||v===void 0?void 0:v.highlight.isCell()}},{keys:[["enter"]],callback:()=>(f(),!m()),runOnlyIf:()=>{const v=t.getSelectedRangeLast();return t.getSettings().enterBeginsEditing&&(v==null?void 0:v.highlight.isCell())&&!t.selection.isMultiple()}},{keys:[["delete"],["backspace"]],callback:()=>(f(!0),!m()),runOnlyIf:()=>{var v;return(v=t.getSelectedRangeLast())===null||v===void 0?void 0:v.highlight.isCell()}}],E)}function f(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const y=t.getSelectedRange(),E=[],v=new Map;let O=[],x=0;if(y){for(let F=0;F<y.length;F++){const{row:I,col:_}=y[F].getTopStartCorner(),{row:q,col:G}=y[F].getBottomEndCorner();for(let U=I;U<=q;U+=1)for(let J=_;J<=G;J+=1){const te=t.getCellMeta(U,J);if(te.hidden)continue;const le={checkedTemplate:te.checkedTemplate,uncheckedTemplate:te.uncheckedTemplate};if(te.type!=="checkbox"){C===!0&&!te.readOnly&&(v.has(E.length)?v.set(E.length,[...v.get(E.length),[U,J,null]]):v.set(E.length,[[U,J,null]]));continue}if(te.readOnly===!0)continue;typeof te.checkedTemplate>"u"&&(te.checkedTemplate=!0),typeof te.uncheckedTemplate>"u"&&(te.uncheckedTemplate=!1);const ne=t.getDataAtCell(U,J);C===!1?[te.checkedTemplate,te.checkedTemplate.toString()].includes(ne)?O.push([U,J,te.uncheckedTemplate,le]):[te.uncheckedTemplate,te.uncheckedTemplate.toString(),null,void 0].includes(ne)&&O.push([U,J,te.checkedTemplate,le]):O.push([U,J,te.uncheckedTemplate,le]),x+=1}E.push(x),x=0}O.every(F=>{let[,,I]=F;return I===O[0][2]})?O=O.map(F=>{let[I,_,q]=F;return[I,_,q]}):O=O.map(F=>{let[I,_,,q]=F;return[I,_,q.checkedTemplate]}),O.length>0&&E.forEach((F,I)=>{let _=O.splice(0,F);v.size&&v.has(I)&&(_=[..._,...v.get(I)]),t.setDataAtCell(_)})}}function m(){const C=t.getSelectedRange();if(C){for(let y=0;y<C.length;y++){const E=C[y].getTopStartCorner(),v=C[y].getBottomEndCorner();for(let O=E.row;O<=v.row;O++)for(let x=E.col;x<=v.col;x++){if(t.getCellMeta(O,x).readOnly)continue;const I=t.getCell(O,x);if(ts(I)&&I.querySelectorAll("input[type=checkbox]").length>0)return!0}}return!1}}}Q0.RENDERER_TYPE=Bk;function $9(t){let e=cA.get(t);if(!e){const{rootElement:n}=t;e=new _i(t),e.addEventListener(n,"click",r=>B9(r,t)),e.addEventListener(n,"mouseup",r=>W9(r,t)),e.addEventListener(n,"change",r=>j9(r,t)),cA.set(t,e)}return e}function F9(t){const e=t.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("tabindex","-1"),e.cloneNode(!1)}function V9(t,e,n){const r=t.createElement("label");r.className=`htCheckboxRendererLabel ${n?"fullWidth":""}`;const i=t.createTextNode(e);if(n){const o=t.createElement("span");o.appendChild(i),r.appendChild(o)}else r.appendChild(i);return r.cloneNode(!0)}function W9(t,e){const{target:n}=t;eT(n)&&(!n.hasAttribute(Vu)||!n.hasAttribute(Wu)||setTimeout(e.listen,10))}function B9(t,e){const{target:n}=t;if(!eT(n)||!n.hasAttribute(Vu)||!n.hasAttribute(Wu))return;const r=parseInt(n.getAttribute(Vu),10),i=parseInt(n.getAttribute(Wu),10);e.getCellMeta(r,i).readOnly&&t.preventDefault()}function j9(t,e){const{target:n}=t;if(!eT(n)||!n.hasAttribute(Vu)||!n.hasAttribute(Wu))return;const r=parseInt(n.getAttribute(Vu),10),i=parseInt(n.getAttribute(Wu),10),o=e.getCellMeta(r,i);if(!o.readOnly){let s=null;t.target.checked?s=o.uncheckedTemplate===void 0?!0:o.checkedTemplate:s=o.uncheckedTemplate===void 0?!1:o.uncheckedTemplate,e.setDataAtCell(r,i,s)}}function eT(t){return t.tagName==="INPUT"&&t.getAttribute("type")==="checkbox"}const U9="handsontable";function tT(t,e,n,r,i,o,s){nc.apply(this,[t,e,n,r,i,o,s])}tT.RENDERER_TYPE=U9;var z9=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Y9(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}/*!
85
- * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
86
- *
87
- * Permission is hereby granted, free of charge, to any person obtaining a copy
88
- * of this software and associated documentation files (the "Software"), to deal
89
- * in the Software without restriction, including without limitation the rights
90
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
91
- * copies of the Software, and to permit persons to whom the Software is
92
- * furnished to do so, subject to the following conditions:
93
- *
94
- * The above copyright notice and this permission notice shall be included in
95
- * all copies or substantial portions of the Software.
96
- *
97
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
98
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
99
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
100
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
101
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
102
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
103
- * SOFTWARE.
104
- */var Iy,hA;function G9(){return hA||(hA=1,Iy={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(t){let e=t%10;return~~(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th"},bytes:{binarySuffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],decimalSuffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0,spaceSeparatedCurrency:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}),Iy}/*!
105
- * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
106
- *
107
- * Permission is hereby granted, free of charge, to any person obtaining a copy
108
- * of this software and associated documentation files (the "Software"), to deal
109
- * in the Software without restriction, including without limitation the rights
110
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
111
- * copies of the Software, and to permit persons to whom the Software is
112
- * furnished to do so, subject to the following conditions:
113
- *
114
- * The above copyright notice and this permission notice shall be included in
115
- * all copies or substantial portions of the Software.
116
- *
117
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
118
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
119
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
120
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
121
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
122
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
123
- * SOFTWARE.
124
- */var Py,dA;function jk(){if(dA)return Py;dA=1;const t=[{key:"ZiB",factor:Math.pow(1024,7)},{key:"ZB",factor:Math.pow(1e3,7)},{key:"YiB",factor:Math.pow(1024,8)},{key:"YB",factor:Math.pow(1e3,8)},{key:"TiB",factor:Math.pow(1024,4)},{key:"TB",factor:Math.pow(1e3,4)},{key:"PiB",factor:Math.pow(1024,5)},{key:"PB",factor:Math.pow(1e3,5)},{key:"MiB",factor:Math.pow(1024,2)},{key:"MB",factor:Math.pow(1e3,2)},{key:"KiB",factor:Math.pow(1024,1)},{key:"KB",factor:Math.pow(1e3,1)},{key:"GiB",factor:Math.pow(1024,3)},{key:"GB",factor:Math.pow(1e3,3)},{key:"EiB",factor:Math.pow(1024,6)},{key:"EB",factor:Math.pow(1e3,6)},{key:"B",factor:1}];function e(l){return l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function n(l,u,c,h,d,f,m){if(!isNaN(+l))return+l;let C="",y=l.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(y!==l)return-1*n(y,u,c,h,d,f);for(let I=0;I<t.length;I++){let _=t[I];if(C=l.replace(RegExp(`([0-9 ])(${_.key})$`),"$1"),C!==l)return n(C,u,c,h,d,f)*_.factor}if(C=l.replace("%",""),C!==l)return n(C,u,c,h,d,f)/100;let E=parseFloat(l);if(isNaN(E))return;let v=h(E);if(v&&v!=="."&&(C=l.replace(new RegExp(`${e(v)}$`),""),C!==l))return n(C,u,c,h,d,f);let O={};Object.keys(f).forEach(I=>{O[f[I]]=I});let x=Object.keys(O).sort().reverse(),F=x.length;for(let I=0;I<F;I++){let _=x[I],q=O[_];if(C=l.replace(_,""),C!==l){let G;switch(q){case"thousand":G=Math.pow(10,3);break;case"million":G=Math.pow(10,6);break;case"billion":G=Math.pow(10,9);break;case"trillion":G=Math.pow(10,12);break}return n(C,u,c,h,d,f)*G}}}function r(l,u,c){let h=l.replace(c,"");return h=h.replace(new RegExp(`([0-9])${e(u.thousands)}([0-9])`,"g"),"$1$2"),h=h.replace(u.decimal,"."),h}function i(l,u,c="",h,d,f,m){if(l==="")return;if(l===d)return 0;let C=r(l,u,c);return n(C,u,c,h,d,f)}function o(l,u){if(!(l.indexOf(":")&&u.thousands!==":"))return!1;let h=l.split(":");if(h.length!==3)return!1;let d=+h[0],f=+h[1],m=+h[2];return!isNaN(d)&&!isNaN(f)&&!isNaN(m)}function s(l){let u=l.split(":"),c=+u[0],h=+u[1];return+u[2]+60*h+3600*c}function a(l,u){const c=iT();let h=c.currentDelimiters(),d=c.currentCurrency().symbol,f=c.currentOrdinal(),m=c.getZeroFormat(),C=c.currentAbbreviations(),y;if(typeof l=="string")o(l,h)?y=s(l):y=i(l,h,d,f,m,C);else if(typeof l=="number")y=l;else return;if(y!==void 0)return y}return Py={unformat:a},Py}/*!
125
- * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
126
- *
127
- * Permission is hereby granted, free of charge, to any person obtaining a copy
128
- * of this software and associated documentation files (the "Software"), to deal
129
- * in the Software without restriction, including without limitation the rights
130
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
131
- * copies of the Software, and to permit persons to whom the Software is
132
- * furnished to do so, subject to the following conditions:
133
- *
134
- * The above copyright notice and this permission notice shall be included in
135
- * all copies or substantial portions of the Software.
136
- *
137
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
138
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
139
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
140
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
141
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
142
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
143
- * SOFTWARE.
144
- */var Oy,fA;function nT(){if(fA)return Oy;fA=1;let t=jk();const e=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,n=["currency","percent","byte","time","ordinal","number"],r=["trillion","billion","million","thousand"],i=["prefix","infix","postfix"],o=["sign","parenthesis"],s={type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},u={output:{type:"string",validValues:n},base:{type:"string",validValues:["decimal","binary","general"],restriction:(y,E)=>E.output==="byte",message:"`base` must be provided only when the output is `byte`",mandatory:y=>y.output==="byte"},characteristic:{type:"number",restriction:y=>y>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:r},average:"boolean",lowPrecision:{type:"boolean",restriction:(y,E)=>E.average===!0,message:"`lowPrecision` must be provided only when the option `average` is set"},currencyPosition:{type:"string",validValues:i},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:y=>y>=0,message:"value must be positive"},{restriction:(y,E)=>!E.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:y=>y>=0,message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",roundingFunction:"function",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",spaceSeparatedAbbreviation:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:o},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:(y,E)=>E.output==="percent",message:"`prefixSymbol` can be provided only when the output is `percent`"}},c={languageTag:{type:"string",mandatory:!0,restriction:y=>y.match(e),message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:s,spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",ordinal:{type:"function",mandatory:!0},bytes:{type:"object",children:{binarySuffixes:"object",decimalSuffixes:"object"}},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function h(y,E){let v=d(y),O=m(E);return v&&O}function d(y){return t.unformat(y)!==void 0}function f(y,E,v,O=!1){let x=Object.keys(y).map(F=>{if(!E[F])return console.error(`${v} Invalid key: ${F}`),!1;let I=y[F],_=E[F];if(typeof _=="string"&&(_={type:_}),_.type==="format"){if(!f(I,u,`[Validate ${F}]`,!0))return!1}else if(typeof I!==_.type)return console.error(`${v} ${F} type mismatched: "${_.type}" expected, "${typeof I}" provided`),!1;if(_.restrictions&&_.restrictions.length){let q=_.restrictions.length;for(let G=0;G<q;G++){let{restriction:U,message:J}=_.restrictions[G];if(!U(I,y))return console.error(`${v} ${F} invalid value: ${J}`),!1}}return _.restriction&&!_.restriction(I,y)?(console.error(`${v} ${F} invalid value: ${_.message}`),!1):_.validValues&&_.validValues.indexOf(I)===-1?(console.error(`${v} ${F} invalid value: must be among ${JSON.stringify(_.validValues)}, "${I}" provided`),!1):!(_.children&&!f(I,_.children,`[Validate ${F}]`))});return O||x.push(...Object.keys(E).map(F=>{let I=E[F];if(typeof I=="string"&&(I={type:I}),I.mandatory){let _=I.mandatory;if(typeof _=="function"&&(_=_(y)),_&&y[F]===void 0)return console.error(`${v} Missing mandatory key "${F}"`),!1}return!0})),x.reduce((F,I)=>F&&I,!0)}function m(y){return f(y,u,"[Validate format]")}function C(y){return f(y,c,"[Validate language]")}return Oy={validate:h,validateFormat:m,validateInput:d,validateLanguage:C},Oy}/*!
145
- * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
146
- *
147
- * Permission is hereby granted, free of charge, to any person obtaining a copy
148
- * of this software and associated documentation files (the "Software"), to deal
149
- * in the Software without restriction, including without limitation the rights
150
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
151
- * copies of the Software, and to permit persons to whom the Software is
152
- * furnished to do so, subject to the following conditions:
153
- *
154
- * The above copyright notice and this permission notice shall be included in
155
- * all copies or substantial portions of the Software.
156
- *
157
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
158
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
159
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
160
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
161
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
162
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
163
- * SOFTWARE.
164
- */function q9(t,e){let n=t.match(/^{([^}]*)}/);return n?(e.prefix=n[1],t.slice(n[0].length)):t}function K9(t,e){let n=t.match(/{([^}]*)}$/);return n?(e.postfix=n[1],t.slice(0,-n[0].length)):t}function X9(t,e){if(t.indexOf("$")!==-1){e.output="currency";return}if(t.indexOf("%")!==-1){e.output="percent";return}if(t.indexOf("bd")!==-1){e.output="byte",e.base="general";return}if(t.indexOf("b")!==-1){e.output="byte",e.base="binary";return}if(t.indexOf("d")!==-1){e.output="byte",e.base="decimal";return}if(t.indexOf(":")!==-1){e.output="time";return}t.indexOf("o")!==-1&&(e.output="ordinal")}function Z9(t,e){t.indexOf(",")!==-1&&(e.thousandSeparated=!0)}function J9(t,e){t.indexOf(" ")!==-1&&(e.spaceSeparated=!0,e.spaceSeparatedCurrency=!0,(e.average||e.forceAverage)&&(e.spaceSeparatedAbbreviation=!0))}function Q9(t,e){let n=t.match(/[1-9]+[0-9]*/);n&&(e.totalLength=+n[0])}function e6(t,e){let r=t.split(".")[0].match(/0+/);r&&(e.characteristic=r[0].length)}function t6(t,e){let n=t.split(".")[1];if(n){let r=n.match(/0+/);r&&(e.mantissa=r[0].length)}}function n6(t,e){const n=t.split(".")[1];n&&(e.trimMantissa=n.indexOf("[")!==-1)}function r6(t,e){t.indexOf("a")!==-1&&(e.average=!0)}function i6(t,e){t.indexOf("K")!==-1?e.forceAverage="thousand":t.indexOf("M")!==-1?e.forceAverage="million":t.indexOf("B")!==-1?e.forceAverage="billion":t.indexOf("T")!==-1&&(e.forceAverage="trillion")}function o6(t,e){t.match(/\[\.]/)?e.optionalMantissa=!0:t.match(/\./)&&(e.optionalMantissa=!1)}function s6(t,e){if(t.indexOf(".")!==-1){let n=t.split(".")[0];e.optionalCharacteristic=n.indexOf("0")===-1}}function a6(t,e){t.match(/^\+?\([^)]*\)$/)&&(e.negative="parenthesis"),t.match(/^\+?-/)&&(e.negative="sign")}function l6(t,e){t.match(/^\+/)&&(e.forceSign=!0)}function u6(t,e={}){return typeof t!="string"?t:(t=q9(t,e),t=K9(t,e),X9(t,e),Q9(t,e),e6(t,e),s6(t,e),r6(t,e),i6(t,e),t6(t,e),o6(t,e),n6(t,e),Z9(t,e),J9(t,e),a6(t,e),l6(t,e),e)}var rT={parseFormat:u6};/*!
165
- * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
166
- *
167
- * Permission is hereby granted, free of charge, to any person obtaining a copy
168
- * of this software and associated documentation files (the "Software"), to deal
169
- * in the Software without restriction, including without limitation the rights
170
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
171
- * copies of the Software, and to permit persons to whom the Software is
172
- * furnished to do so, subject to the following conditions:
173
- *
174
- * The above copyright notice and this permission notice shall be included in
175
- * all copies or substantial portions of the Software.
176
- *
177
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
178
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
179
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
180
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
181
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
182
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
183
- * SOFTWARE.
184
- */var xy,gA;function iT(){if(gA)return xy;gA=1;const t=G9(),e=nT(),n=rT;let r={},i,o={},s=null,a={};function l(c){i=c}function u(){return o[i]}return r.languages=()=>Object.assign({},o),r.currentLanguage=()=>i,r.currentBytes=()=>u().bytes||{},r.currentCurrency=()=>u().currency,r.currentAbbreviations=()=>u().abbreviations,r.currentDelimiters=()=>u().delimiters,r.currentOrdinal=()=>u().ordinal,r.currentDefaults=()=>Object.assign({},u().defaults,a),r.currentOrdinalDefaultFormat=()=>Object.assign({},r.currentDefaults(),u().ordinalFormat),r.currentByteDefaultFormat=()=>Object.assign({},r.currentDefaults(),u().byteFormat),r.currentPercentageDefaultFormat=()=>Object.assign({},r.currentDefaults(),u().percentageFormat),r.currentCurrencyDefaultFormat=()=>Object.assign({},r.currentDefaults(),u().currencyFormat),r.currentTimeDefaultFormat=()=>Object.assign({},r.currentDefaults(),u().timeFormat),r.setDefaults=c=>{c=n.parseFormat(c),e.validateFormat(c)&&(a=c)},r.getZeroFormat=()=>s,r.setZeroFormat=c=>s=typeof c=="string"?c:null,r.hasZeroFormat=()=>s!==null,r.languageData=c=>{if(c){if(o[c])return o[c];throw new Error(`Unknown tag "${c}"`)}return u()},r.registerLanguage=(c,h=!1)=>{if(!e.validateLanguage(c))throw new Error("Invalid language data");o[c.languageTag]=c,h&&l(c.languageTag)},r.setLanguage=(c,h=t.languageTag)=>{if(!o[c]){let d=c.split("-")[0],f=Object.keys(o).find(m=>m.split("-")[0]===d);if(!o[f]){l(h);return}l(f);return}l(c)},r.registerLanguage(t),i=t.languageTag,xy=r,xy}function c6(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}/*!
185
- * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
186
- *
187
- * Permission is hereby granted, free of charge, to any person obtaining a copy
188
- * of this software and associated documentation files (the "Software"), to deal
189
- * in the Software without restriction, including without limitation the rights
190
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
191
- * copies of the Software, and to permit persons to whom the Software is
192
- * furnished to do so, subject to the following conditions:
193
- *
194
- * The above copyright notice and this permission notice shall be included in
195
- * all copies or substantial portions of the Software.
196
- *
197
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
198
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
199
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
200
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
201
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
202
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
203
- * SOFTWARE.
204
- */function h6(t,e){t.forEach(n=>{let r;try{r=c6(`../languages/${n}`)}catch{console.error(`Unable to load "${n}". No matching language file found.`)}r&&e.registerLanguage(r)})}var d6=t=>({loadLanguagesInNode:e=>h6(e,t)}),Uk={exports:{}};(function(t){(function(e){var n,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,o=Math.floor,s="[BigNumber Error] ",a=s+"Number primitive has more than 15 significant digits: ",l=1e14,u=14,c=9007199254740991,h=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],d=1e7,f=1e9;function m(I){var _,q,G,U=p.prototype={constructor:p,toString:null,valueOf:null},J=new p(1),te=20,le=4,ne=-7,se=21,Ge=-1e7,ve=1e7,Oe=!1,it=1,Le=0,P={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},g="0123456789abcdefghijklmnopqrstuvwxyz",w=!0;function p(S,R){var b,L,A,k,j,N,$,B,W=this;if(!(W instanceof p))return new p(S,R);if(R==null){if(S&&S._isBigNumber===!0){W.s=S.s,!S.c||S.e>ve?W.c=W.e=null:S.e<Ge?W.c=[W.e=0]:(W.e=S.e,W.c=S.c.slice());return}if((N=typeof S=="number")&&S*0==0){if(W.s=1/S<0?(S=-S,-1):1,S===~~S){for(k=0,j=S;j>=10;j/=10,k++);k>ve?W.c=W.e=null:(W.e=k,W.c=[S]);return}B=String(S)}else{if(!r.test(B=String(S)))return G(W,B,N);W.s=B.charCodeAt(0)==45?(B=B.slice(1),-1):1}(k=B.indexOf("."))>-1&&(B=B.replace(".","")),(j=B.search(/e/i))>0?(k<0&&(k=j),k+=+B.slice(j+1),B=B.substring(0,j)):k<0&&(k=B.length)}else{if(v(R,2,g.length,"Base"),R==10&&w)return W=new p(S),z(W,te+W.e+1,le);if(B=String(S),N=typeof S=="number"){if(S*0!=0)return G(W,B,N,R);if(W.s=1/S<0?(B=B.slice(1),-1):1,p.DEBUG&&B.replace(/^0\.0*|\./,"").length>15)throw Error(a+S)}else W.s=B.charCodeAt(0)===45?(B=B.slice(1),-1):1;for(b=g.slice(0,R),k=j=0,$=B.length;j<$;j++)if(b.indexOf(L=B.charAt(j))<0){if(L=="."){if(j>k){k=$;continue}}else if(!A&&(B==B.toUpperCase()&&(B=B.toLowerCase())||B==B.toLowerCase()&&(B=B.toUpperCase()))){A=!0,j=-1,k=0;continue}return G(W,String(S),N,R)}N=!1,B=q(B,R,10,W.s),(k=B.indexOf("."))>-1?B=B.replace(".",""):k=B.length}for(j=0;B.charCodeAt(j)===48;j++);for($=B.length;B.charCodeAt(--$)===48;);if(B=B.slice(j,++$)){if($-=j,N&&p.DEBUG&&$>15&&(S>c||S!==o(S)))throw Error(a+W.s*S);if((k=k-j-1)>ve)W.c=W.e=null;else if(k<Ge)W.c=[W.e=0];else{if(W.e=k,W.c=[],j=(k+1)%u,k<0&&(j+=u),j<$){for(j&&W.c.push(+B.slice(0,j)),$-=u;j<$;)W.c.push(+B.slice(j,j+=u));j=u-(B=B.slice(j)).length}else j-=$;for(;j--;B+="0");W.c.push(+B)}}else W.c=[W.e=0]}p.clone=m,p.ROUND_UP=0,p.ROUND_DOWN=1,p.ROUND_CEIL=2,p.ROUND_FLOOR=3,p.ROUND_HALF_UP=4,p.ROUND_HALF_DOWN=5,p.ROUND_HALF_EVEN=6,p.ROUND_HALF_CEIL=7,p.ROUND_HALF_FLOOR=8,p.EUCLID=9,p.config=p.set=function(S){var R,b;if(S!=null)if(typeof S=="object"){if(S.hasOwnProperty(R="DECIMAL_PLACES")&&(b=S[R],v(b,0,f,R),te=b),S.hasOwnProperty(R="ROUNDING_MODE")&&(b=S[R],v(b,0,8,R),le=b),S.hasOwnProperty(R="EXPONENTIAL_AT")&&(b=S[R],b&&b.pop?(v(b[0],-f,0,R),v(b[1],0,f,R),ne=b[0],se=b[1]):(v(b,-f,f,R),ne=-(se=b<0?-b:b))),S.hasOwnProperty(R="RANGE"))if(b=S[R],b&&b.pop)v(b[0],-f,-1,R),v(b[1],1,f,R),Ge=b[0],ve=b[1];else if(v(b,-f,f,R),b)Ge=-(ve=b<0?-b:b);else throw Error(s+R+" cannot be zero: "+b);if(S.hasOwnProperty(R="CRYPTO"))if(b=S[R],b===!!b)if(b)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))Oe=b;else throw Oe=!b,Error(s+"crypto unavailable");else Oe=b;else throw Error(s+R+" not true or false: "+b);if(S.hasOwnProperty(R="MODULO_MODE")&&(b=S[R],v(b,0,9,R),it=b),S.hasOwnProperty(R="POW_PRECISION")&&(b=S[R],v(b,0,f,R),Le=b),S.hasOwnProperty(R="FORMAT"))if(b=S[R],typeof b=="object")P=b;else throw Error(s+R+" not an object: "+b);if(S.hasOwnProperty(R="ALPHABET"))if(b=S[R],typeof b=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(b))w=b.slice(0,10)=="0123456789",g=b;else throw Error(s+R+" invalid: "+b)}else throw Error(s+"Object expected: "+S);return{DECIMAL_PLACES:te,ROUNDING_MODE:le,EXPONENTIAL_AT:[ne,se],RANGE:[Ge,ve],CRYPTO:Oe,MODULO_MODE:it,POW_PRECISION:Le,FORMAT:P,ALPHABET:g}},p.isBigNumber=function(S){if(!S||S._isBigNumber!==!0)return!1;if(!p.DEBUG)return!0;var R,b,L=S.c,A=S.e,k=S.s;e:if({}.toString.call(L)=="[object Array]"){if((k===1||k===-1)&&A>=-f&&A<=f&&A===o(A)){if(L[0]===0){if(A===0&&L.length===1)return!0;break e}if(R=(A+1)%u,R<1&&(R+=u),String(L[0]).length==R){for(R=0;R<L.length;R++)if(b=L[R],b<0||b>=l||b!==o(b))break e;if(b!==0)return!0}}}else if(L===null&&A===null&&(k===null||k===1||k===-1))return!0;throw Error(s+"Invalid BigNumber: "+S)},p.maximum=p.max=function(){return M(arguments,-1)},p.minimum=p.min=function(){return M(arguments,1)},p.random=(function(){var S=9007199254740992,R=Math.random()*S&2097151?function(){return o(Math.random()*S)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(b){var L,A,k,j,N,$=0,B=[],W=new p(J);if(b==null?b=te:v(b,0,f),j=i(b/u),Oe)if(crypto.getRandomValues){for(L=crypto.getRandomValues(new Uint32Array(j*=2));$<j;)N=L[$]*131072+(L[$+1]>>>11),N>=9e15?(A=crypto.getRandomValues(new Uint32Array(2)),L[$]=A[0],L[$+1]=A[1]):(B.push(N%1e14),$+=2);$=j/2}else if(crypto.randomBytes){for(L=crypto.randomBytes(j*=7);$<j;)N=(L[$]&31)*281474976710656+L[$+1]*1099511627776+L[$+2]*4294967296+L[$+3]*16777216+(L[$+4]<<16)+(L[$+5]<<8)+L[$+6],N>=9e15?crypto.randomBytes(7).copy(L,$):(B.push(N%1e14),$+=7);$=j/7}else throw Oe=!1,Error(s+"crypto unavailable");if(!Oe)for(;$<j;)N=R(),N<9e15&&(B[$++]=N%1e14);for(j=B[--$],b%=u,j&&b&&(N=h[u-b],B[$]=o(j/N)*N);B[$]===0;B.pop(),$--);if($<0)B=[k=0];else{for(k=-1;B[0]===0;B.splice(0,1),k-=u);for($=1,N=B[0];N>=10;N/=10,$++);$<u&&(k-=u-$)}return W.e=k,W.c=B,W}})(),p.sum=function(){for(var S=1,R=arguments,b=new p(R[0]);S<R.length;)b=b.plus(R[S++]);return b},q=(function(){var S="0123456789";function R(b,L,A,k){for(var j,N=[0],$,B=0,W=b.length;B<W;){for($=N.length;$--;N[$]*=L);for(N[0]+=k.indexOf(b.charAt(B++)),j=0;j<N.length;j++)N[j]>A-1&&(N[j+1]==null&&(N[j+1]=0),N[j+1]+=N[j]/A|0,N[j]%=A)}return N.reverse()}return function(b,L,A,k,j){var N,$,B,W,K,ae,de,Ie,$e=b.indexOf("."),Ue=te,be=le;for($e>=0&&(W=Le,Le=0,b=b.replace(".",""),Ie=new p(L),ae=Ie.pow(b.length-$e),Le=W,Ie.c=R(F(y(ae.c),ae.e,"0"),10,A,S),Ie.e=Ie.c.length),de=R(b,L,A,j?(N=g,S):(N=S,g)),B=W=de.length;de[--W]==0;de.pop());if(!de[0])return N.charAt(0);if($e<0?--B:(ae.c=de,ae.e=B,ae.s=k,ae=_(ae,Ie,Ue,be,A),de=ae.c,K=ae.r,B=ae.e),$=B+Ue+1,$e=de[$],W=A/2,K=K||$<0||de[$+1]!=null,K=be<4?($e!=null||K)&&(be==0||be==(ae.s<0?3:2)):$e>W||$e==W&&(be==4||K||be==6&&de[$-1]&1||be==(ae.s<0?8:7)),$<1||!de[0])b=K?F(N.charAt(1),-Ue,N.charAt(0)):N.charAt(0);else{if(de.length=$,K)for(--A;++de[--$]>A;)de[$]=0,$||(++B,de=[1].concat(de));for(W=de.length;!de[--W];);for($e=0,b="";$e<=W;b+=N.charAt(de[$e++]));b=F(b,B,N.charAt(0))}return b}})(),_=(function(){function S(L,A,k){var j,N,$,B,W=0,K=L.length,ae=A%d,de=A/d|0;for(L=L.slice();K--;)$=L[K]%d,B=L[K]/d|0,j=de*$+B*ae,N=ae*$+j%d*d+W,W=(N/k|0)+(j/d|0)+de*B,L[K]=N%k;return W&&(L=[W].concat(L)),L}function R(L,A,k,j){var N,$;if(k!=j)$=k>j?1:-1;else for(N=$=0;N<k;N++)if(L[N]!=A[N]){$=L[N]>A[N]?1:-1;break}return $}function b(L,A,k,j){for(var N=0;k--;)L[k]-=N,N=L[k]<A[k]?1:0,L[k]=N*j+L[k]-A[k];for(;!L[0]&&L.length>1;L.splice(0,1));}return function(L,A,k,j,N){var $,B,W,K,ae,de,Ie,$e,Ue,be,Fe,St,xi,Ai,Hi,bt,kn,ht=L.s==A.s?1:-1,mt=L.c,Be=A.c;if(!mt||!mt[0]||!Be||!Be[0])return new p(!L.s||!A.s||(mt?Be&&mt[0]==Be[0]:!Be)?NaN:mt&&mt[0]==0||!Be?ht*0:ht/0);for($e=new p(ht),Ue=$e.c=[],B=L.e-A.e,ht=k+B+1,N||(N=l,B=C(L.e/u)-C(A.e/u),ht=ht/u|0),W=0;Be[W]==(mt[W]||0);W++);if(Be[W]>(mt[W]||0)&&B--,ht<0)Ue.push(1),K=!0;else{for(Ai=mt.length,bt=Be.length,W=0,ht+=2,ae=o(N/(Be[0]+1)),ae>1&&(Be=S(Be,ae,N),mt=S(mt,ae,N),bt=Be.length,Ai=mt.length),xi=bt,be=mt.slice(0,bt),Fe=be.length;Fe<bt;be[Fe++]=0);kn=Be.slice(),kn=[0].concat(kn),Hi=Be[0],Be[1]>=N/2&&Hi++;do{if(ae=0,$=R(Be,be,bt,Fe),$<0){if(St=be[0],bt!=Fe&&(St=St*N+(be[1]||0)),ae=o(St/Hi),ae>1)for(ae>=N&&(ae=N-1),de=S(Be,ae,N),Ie=de.length,Fe=be.length;R(de,be,Ie,Fe)==1;)ae--,b(de,bt<Ie?kn:Be,Ie,N),Ie=de.length,$=1;else ae==0&&($=ae=1),de=Be.slice(),Ie=de.length;if(Ie<Fe&&(de=[0].concat(de)),b(be,de,Fe,N),Fe=be.length,$==-1)for(;R(Be,be,bt,Fe)<1;)ae++,b(be,bt<Fe?kn:Be,Fe,N),Fe=be.length}else $===0&&(ae++,be=[0]);Ue[W++]=ae,be[0]?be[Fe++]=mt[xi]||0:(be=[mt[xi]],Fe=1)}while((xi++<Ai||be[0]!=null)&&ht--);K=be[0]!=null,Ue[0]||Ue.splice(0,1)}if(N==l){for(W=1,ht=Ue[0];ht>=10;ht/=10,W++);z($e,k+($e.e=W+B*u-1)+1,j,K)}else $e.e=B,$e.r=+K;return $e}})();function T(S,R,b,L){var A,k,j,N,$;if(b==null?b=le:v(b,0,8),!S.c)return S.toString();if(A=S.c[0],j=S.e,R==null)$=y(S.c),$=L==1||L==2&&(j<=ne||j>=se)?x($,j):F($,j,"0");else if(S=z(new p(S),R,b),k=S.e,$=y(S.c),N=$.length,L==1||L==2&&(R<=k||k<=ne)){for(;N<R;$+="0",N++);$=x($,k)}else if(R-=j,$=F($,k,"0"),k+1>N){if(--R>0)for($+=".";R--;$+="0");}else if(R+=k-N,R>0)for(k+1==N&&($+=".");R--;$+="0");return S.s<0&&A?"-"+$:$}function M(S,R){for(var b,L,A=1,k=new p(S[0]);A<S.length;A++)L=new p(S[A]),(!L.s||(b=E(k,L))===R||b===0&&k.s===R)&&(k=L);return k}function V(S,R,b){for(var L=1,A=R.length;!R[--A];R.pop());for(A=R[0];A>=10;A/=10,L++);return(b=L+b*u-1)>ve?S.c=S.e=null:b<Ge?S.c=[S.e=0]:(S.e=b,S.c=R),S}G=(function(){var S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,R=/^([^.]+)\.$/,b=/^\.([^.]+)$/,L=/^-?(Infinity|NaN)$/,A=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(k,j,N,$){var B,W=N?j:j.replace(A,"");if(L.test(W))k.s=isNaN(W)?null:W<0?-1:1;else{if(!N&&(W=W.replace(S,function(K,ae,de){return B=(de=de.toLowerCase())=="x"?16:de=="b"?2:8,!$||$==B?ae:K}),$&&(B=$,W=W.replace(R,"$1").replace(b,"0.$1")),j!=W))return new p(W,B);if(p.DEBUG)throw Error(s+"Not a"+($?" base "+$:"")+" number: "+j);k.s=null}k.c=k.e=null}})();function z(S,R,b,L){var A,k,j,N,$,B,W,K=S.c,ae=h;if(K){e:{for(A=1,N=K[0];N>=10;N/=10,A++);if(k=R-A,k<0)k+=u,j=R,$=K[B=0],W=o($/ae[A-j-1]%10);else if(B=i((k+1)/u),B>=K.length)if(L){for(;K.length<=B;K.push(0));$=W=0,A=1,k%=u,j=k-u+1}else break e;else{for($=N=K[B],A=1;N>=10;N/=10,A++);k%=u,j=k-u+A,W=j<0?0:o($/ae[A-j-1]%10)}if(L=L||R<0||K[B+1]!=null||(j<0?$:$%ae[A-j-1]),L=b<4?(W||L)&&(b==0||b==(S.s<0?3:2)):W>5||W==5&&(b==4||L||b==6&&(k>0?j>0?$/ae[A-j]:0:K[B-1])%10&1||b==(S.s<0?8:7)),R<1||!K[0])return K.length=0,L?(R-=S.e+1,K[0]=ae[(u-R%u)%u],S.e=-R||0):K[0]=S.e=0,S;if(k==0?(K.length=B,N=1,B--):(K.length=B+1,N=ae[u-k],K[B]=j>0?o($/ae[A-j]%ae[j])*N:0),L)for(;;)if(B==0){for(k=1,j=K[0];j>=10;j/=10,k++);for(j=K[0]+=N,N=1;j>=10;j/=10,N++);k!=N&&(S.e++,K[0]==l&&(K[0]=1));break}else{if(K[B]+=N,K[B]!=l)break;K[B--]=0,N=1}for(k=K.length;K[--k]===0;K.pop());}S.e>ve?S.c=S.e=null:S.e<Ge&&(S.c=[S.e=0])}return S}function Y(S){var R,b=S.e;return b===null?S.toString():(R=y(S.c),R=b<=ne||b>=se?x(R,b):F(R,b,"0"),S.s<0?"-"+R:R)}return U.absoluteValue=U.abs=function(){var S=new p(this);return S.s<0&&(S.s=1),S},U.comparedTo=function(S,R){return E(this,new p(S,R))},U.decimalPlaces=U.dp=function(S,R){var b,L,A,k=this;if(S!=null)return v(S,0,f),R==null?R=le:v(R,0,8),z(new p(k),S+k.e+1,R);if(!(b=k.c))return null;if(L=((A=b.length-1)-C(this.e/u))*u,A=b[A])for(;A%10==0;A/=10,L--);return L<0&&(L=0),L},U.dividedBy=U.div=function(S,R){return _(this,new p(S,R),te,le)},U.dividedToIntegerBy=U.idiv=function(S,R){return _(this,new p(S,R),0,1)},U.exponentiatedBy=U.pow=function(S,R){var b,L,A,k,j,N,$,B,W,K=this;if(S=new p(S),S.c&&!S.isInteger())throw Error(s+"Exponent not an integer: "+Y(S));if(R!=null&&(R=new p(R)),N=S.e>14,!K.c||!K.c[0]||K.c[0]==1&&!K.e&&K.c.length==1||!S.c||!S.c[0])return W=new p(Math.pow(+Y(K),N?S.s*(2-O(S)):+Y(S))),R?W.mod(R):W;if($=S.s<0,R){if(R.c?!R.c[0]:!R.s)return new p(NaN);L=!$&&K.isInteger()&&R.isInteger(),L&&(K=K.mod(R))}else{if(S.e>9&&(K.e>0||K.e<-1||(K.e==0?K.c[0]>1||N&&K.c[1]>=24e7:K.c[0]<8e13||N&&K.c[0]<=9999975e7)))return k=K.s<0&&O(S)?-0:0,K.e>-1&&(k=1/k),new p($?1/k:k);Le&&(k=i(Le/u+2))}for(N?(b=new p(.5),$&&(S.s=1),B=O(S)):(A=Math.abs(+Y(S)),B=A%2),W=new p(J);;){if(B){if(W=W.times(K),!W.c)break;k?W.c.length>k&&(W.c.length=k):L&&(W=W.mod(R))}if(A){if(A=o(A/2),A===0)break;B=A%2}else if(S=S.times(b),z(S,S.e+1,1),S.e>14)B=O(S);else{if(A=+Y(S),A===0)break;B=A%2}K=K.times(K),k?K.c&&K.c.length>k&&(K.c.length=k):L&&(K=K.mod(R))}return L?W:($&&(W=J.div(W)),R?W.mod(R):k?z(W,Le,le,j):W)},U.integerValue=function(S){var R=new p(this);return S==null?S=le:v(S,0,8),z(R,R.e+1,S)},U.isEqualTo=U.eq=function(S,R){return E(this,new p(S,R))===0},U.isFinite=function(){return!!this.c},U.isGreaterThan=U.gt=function(S,R){return E(this,new p(S,R))>0},U.isGreaterThanOrEqualTo=U.gte=function(S,R){return(R=E(this,new p(S,R)))===1||R===0},U.isInteger=function(){return!!this.c&&C(this.e/u)>this.c.length-2},U.isLessThan=U.lt=function(S,R){return E(this,new p(S,R))<0},U.isLessThanOrEqualTo=U.lte=function(S,R){return(R=E(this,new p(S,R)))===-1||R===0},U.isNaN=function(){return!this.s},U.isNegative=function(){return this.s<0},U.isPositive=function(){return this.s>0},U.isZero=function(){return!!this.c&&this.c[0]==0},U.minus=function(S,R){var b,L,A,k,j=this,N=j.s;if(S=new p(S,R),R=S.s,!N||!R)return new p(NaN);if(N!=R)return S.s=-R,j.plus(S);var $=j.e/u,B=S.e/u,W=j.c,K=S.c;if(!$||!B){if(!W||!K)return W?(S.s=-R,S):new p(K?j:NaN);if(!W[0]||!K[0])return K[0]?(S.s=-R,S):new p(W[0]?j:le==3?-0:0)}if($=C($),B=C(B),W=W.slice(),N=$-B){for((k=N<0)?(N=-N,A=W):(B=$,A=K),A.reverse(),R=N;R--;A.push(0));A.reverse()}else for(L=(k=(N=W.length)<(R=K.length))?N:R,N=R=0;R<L;R++)if(W[R]!=K[R]){k=W[R]<K[R];break}if(k&&(A=W,W=K,K=A,S.s=-S.s),R=(L=K.length)-(b=W.length),R>0)for(;R--;W[b++]=0);for(R=l-1;L>N;){if(W[--L]<K[L]){for(b=L;b&&!W[--b];W[b]=R);--W[b],W[L]+=l}W[L]-=K[L]}for(;W[0]==0;W.splice(0,1),--B);return W[0]?V(S,W,B):(S.s=le==3?-1:1,S.c=[S.e=0],S)},U.modulo=U.mod=function(S,R){var b,L,A=this;return S=new p(S,R),!A.c||!S.s||S.c&&!S.c[0]?new p(NaN):!S.c||A.c&&!A.c[0]?new p(A):(it==9?(L=S.s,S.s=1,b=_(A,S,0,3),S.s=L,b.s*=L):b=_(A,S,0,it),S=A.minus(b.times(S)),!S.c[0]&&it==1&&(S.s=A.s),S)},U.multipliedBy=U.times=function(S,R){var b,L,A,k,j,N,$,B,W,K,ae,de,Ie,$e,Ue,be=this,Fe=be.c,St=(S=new p(S,R)).c;if(!Fe||!St||!Fe[0]||!St[0])return!be.s||!S.s||Fe&&!Fe[0]&&!St||St&&!St[0]&&!Fe?S.c=S.e=S.s=null:(S.s*=be.s,!Fe||!St?S.c=S.e=null:(S.c=[0],S.e=0)),S;for(L=C(be.e/u)+C(S.e/u),S.s*=be.s,$=Fe.length,K=St.length,$<K&&(Ie=Fe,Fe=St,St=Ie,A=$,$=K,K=A),A=$+K,Ie=[];A--;Ie.push(0));for($e=l,Ue=d,A=K;--A>=0;){for(b=0,ae=St[A]%Ue,de=St[A]/Ue|0,j=$,k=A+j;k>A;)B=Fe[--j]%Ue,W=Fe[j]/Ue|0,N=de*B+W*ae,B=ae*B+N%Ue*Ue+Ie[k]+b,b=(B/$e|0)+(N/Ue|0)+de*W,Ie[k--]=B%$e;Ie[k]=b}return b?++L:Ie.splice(0,1),V(S,Ie,L)},U.negated=function(){var S=new p(this);return S.s=-S.s||null,S},U.plus=function(S,R){var b,L=this,A=L.s;if(S=new p(S,R),R=S.s,!A||!R)return new p(NaN);if(A!=R)return S.s=-R,L.minus(S);var k=L.e/u,j=S.e/u,N=L.c,$=S.c;if(!k||!j){if(!N||!$)return new p(A/0);if(!N[0]||!$[0])return $[0]?S:new p(N[0]?L:A*0)}if(k=C(k),j=C(j),N=N.slice(),A=k-j){for(A>0?(j=k,b=$):(A=-A,b=N),b.reverse();A--;b.push(0));b.reverse()}for(A=N.length,R=$.length,A-R<0&&(b=$,$=N,N=b,R=A),A=0;R;)A=(N[--R]=N[R]+$[R]+A)/l|0,N[R]=l===N[R]?0:N[R]%l;return A&&(N=[A].concat(N),++j),V(S,N,j)},U.precision=U.sd=function(S,R){var b,L,A,k=this;if(S!=null&&S!==!!S)return v(S,1,f),R==null?R=le:v(R,0,8),z(new p(k),S,R);if(!(b=k.c))return null;if(A=b.length-1,L=A*u+1,A=b[A]){for(;A%10==0;A/=10,L--);for(A=b[0];A>=10;A/=10,L++);}return S&&k.e+1>L&&(L=k.e+1),L},U.shiftedBy=function(S){return v(S,-c,c),this.times("1e"+S)},U.squareRoot=U.sqrt=function(){var S,R,b,L,A,k=this,j=k.c,N=k.s,$=k.e,B=te+4,W=new p("0.5");if(N!==1||!j||!j[0])return new p(!N||N<0&&(!j||j[0])?NaN:j?k:1/0);if(N=Math.sqrt(+Y(k)),N==0||N==1/0?(R=y(j),(R.length+$)%2==0&&(R+="0"),N=Math.sqrt(+R),$=C(($+1)/2)-($<0||$%2),N==1/0?R="5e"+$:(R=N.toExponential(),R=R.slice(0,R.indexOf("e")+1)+$),b=new p(R)):b=new p(N+""),b.c[0]){for($=b.e,N=$+B,N<3&&(N=0);;)if(A=b,b=W.times(A.plus(_(k,A,B,1))),y(A.c).slice(0,N)===(R=y(b.c)).slice(0,N))if(b.e<$&&--N,R=R.slice(N-3,N+1),R=="9999"||!L&&R=="4999"){if(!L&&(z(A,A.e+te+2,0),A.times(A).eq(k))){b=A;break}B+=4,N+=4,L=1}else{(!+R||!+R.slice(1)&&R.charAt(0)=="5")&&(z(b,b.e+te+2,1),S=!b.times(b).eq(k));break}}return z(b,b.e+te+1,le,S)},U.toExponential=function(S,R){return S!=null&&(v(S,0,f),S++),T(this,S,R,1)},U.toFixed=function(S,R){return S!=null&&(v(S,0,f),S=S+this.e+1),T(this,S,R)},U.toFormat=function(S,R,b){var L,A=this;if(b==null)S!=null&&R&&typeof R=="object"?(b=R,R=null):S&&typeof S=="object"?(b=S,S=R=null):b=P;else if(typeof b!="object")throw Error(s+"Argument not an object: "+b);if(L=A.toFixed(S,R),A.c){var k,j=L.split("."),N=+b.groupSize,$=+b.secondaryGroupSize,B=b.groupSeparator||"",W=j[0],K=j[1],ae=A.s<0,de=ae?W.slice(1):W,Ie=de.length;if($&&(k=N,N=$,$=k,Ie-=k),N>0&&Ie>0){for(k=Ie%N||N,W=de.substr(0,k);k<Ie;k+=N)W+=B+de.substr(k,N);$>0&&(W+=B+de.slice(k)),ae&&(W="-"+W)}L=K?W+(b.decimalSeparator||"")+(($=+b.fractionGroupSize)?K.replace(new RegExp("\\d{"+$+"}\\B","g"),"$&"+(b.fractionGroupSeparator||"")):K):W}return(b.prefix||"")+L+(b.suffix||"")},U.toFraction=function(S){var R,b,L,A,k,j,N,$,B,W,K,ae,de=this,Ie=de.c;if(S!=null&&(N=new p(S),!N.isInteger()&&(N.c||N.s!==1)||N.lt(J)))throw Error(s+"Argument "+(N.isInteger()?"out of range: ":"not an integer: ")+Y(N));if(!Ie)return new p(de);for(R=new p(J),B=b=new p(J),L=$=new p(J),ae=y(Ie),k=R.e=ae.length-de.e-1,R.c[0]=h[(j=k%u)<0?u+j:j],S=!S||N.comparedTo(R)>0?k>0?R:B:N,j=ve,ve=1/0,N=new p(ae),$.c[0]=0;W=_(N,R,0,1),A=b.plus(W.times(L)),A.comparedTo(S)!=1;)b=L,L=A,B=$.plus(W.times(A=B)),$=A,R=N.minus(W.times(A=R)),N=A;return A=_(S.minus(b),L,0,1),$=$.plus(A.times(B)),b=b.plus(A.times(L)),$.s=B.s=de.s,k=k*2,K=_(B,L,k,le).minus(de).abs().comparedTo(_($,b,k,le).minus(de).abs())<1?[B,L]:[$,b],ve=j,K},U.toNumber=function(){return+Y(this)},U.toPrecision=function(S,R){return S!=null&&v(S,1,f),T(this,S,R,2)},U.toString=function(S){var R,b=this,L=b.s,A=b.e;return A===null?L?(R="Infinity",L<0&&(R="-"+R)):R="NaN":(S==null?R=A<=ne||A>=se?x(y(b.c),A):F(y(b.c),A,"0"):S===10&&w?(b=z(new p(b),te+A+1,le),R=F(y(b.c),b.e,"0")):(v(S,2,g.length,"Base"),R=q(F(y(b.c),A,"0"),10,S,L,!0)),L<0&&b.c[0]&&(R="-"+R)),R},U.valueOf=U.toJSON=function(){return Y(this)},U._isBigNumber=!0,I!=null&&p.set(I),p}function C(I){var _=I|0;return I>0||I===_?_:_-1}function y(I){for(var _,q,G=1,U=I.length,J=I[0]+"";G<U;){for(_=I[G++]+"",q=u-_.length;q--;_="0"+_);J+=_}for(U=J.length;J.charCodeAt(--U)===48;);return J.slice(0,U+1||1)}function E(I,_){var q,G,U=I.c,J=_.c,te=I.s,le=_.s,ne=I.e,se=_.e;if(!te||!le)return null;if(q=U&&!U[0],G=J&&!J[0],q||G)return q?G?0:-le:te;if(te!=le)return te;if(q=te<0,G=ne==se,!U||!J)return G?0:!U^q?1:-1;if(!G)return ne>se^q?1:-1;for(le=(ne=U.length)<(se=J.length)?ne:se,te=0;te<le;te++)if(U[te]!=J[te])return U[te]>J[te]^q?1:-1;return ne==se?0:ne>se^q?1:-1}function v(I,_,q,G){if(I<_||I>q||I!==o(I))throw Error(s+(G||"Argument")+(typeof I=="number"?I<_||I>q?" out of range: ":" not an integer: ":" not a primitive number: ")+String(I))}function O(I){var _=I.c.length-1;return C(I.e/u)==_&&I.c[_]%2!=0}function x(I,_){return(I.length>1?I.charAt(0)+"."+I.slice(1):I)+(_<0?"e":"e+")+_}function F(I,_,q){var G,U;if(_<0){for(U=q+".";++_;U+=q);I=U+I}else if(G=I.length,++_>G){for(U=q,_-=G;--_;U+=q);I+=U}else _<G&&(I=I.slice(0,_)+"."+I.slice(_));return I}n=m(),n.default=n.BigNumber=n,t.exports?t.exports=n:(e||(e=typeof self<"u"&&self?self:window),e.BigNumber=n)})(z9)})(Uk);var zk=Uk.exports;/*!
205
- * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
206
- *
207
- * Permission is hereby granted, free of charge, to any person obtaining a copy
208
- * of this software and associated documentation files (the "Software"), to deal
209
- * in the Software without restriction, including without limitation the rights
210
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
211
- * copies of the Software, and to permit persons to whom the Software is
212
- * furnished to do so, subject to the following conditions:
213
- *
214
- * The above copyright notice and this permission notice shall be included in
215
- * all copies or substantial portions of the Software.
216
- *
217
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
218
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
219
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
220
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
221
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
222
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
223
- * SOFTWARE.
224
- */const fi=iT(),f6=nT(),g6=rT,m6=zk,bn={trillion:Math.pow(10,12),billion:Math.pow(10,9),million:Math.pow(10,6),thousand:Math.pow(10,3)},Md={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:Yk,decimalSuffixes:um}=fi.currentBytes(),oT={general:{scale:1024,suffixes:um},binary:{scale:1024,suffixes:Yk},decimal:{scale:1e3,suffixes:um}};function p6(t,e={},n){if(typeof e=="string"&&(e=g6.parseFormat(e)),!f6.validateFormat(e))return"ERROR: invalid format";let i=e.prefix||"",o=e.postfix||"",s=w6(t,e,n);return s=k6(s,i),s=L6(s,o),s}function w6(t,e,n){switch(e.output){case"currency":return e=gu(e,fi.currentCurrencyDefaultFormat()),T6(t,e,fi);case"percent":return e=gu(e,fi.currentPercentageDefaultFormat()),E6(t,e,fi,n);case"byte":return e=gu(e,fi.currentByteDefaultFormat()),S6(t,e,fi,n);case"time":return e=gu(e,fi.currentTimeDefaultFormat()),R6(t);case"ordinal":return e=gu(e,fi.currentOrdinalDefaultFormat()),b6(t,e,fi);case"number":default:return Id({instance:t,providedFormat:e})}}function v6(t){let e=oT.decimal;return Sp(t._value,e.suffixes,e.scale).suffix}function C6(t){let e=oT.binary;return Sp(t._value,e.suffixes,e.scale).suffix}function y6(t){let e=oT.general;return Sp(t._value,e.suffixes,e.scale).suffix}function Sp(t,e,n){let r=e[0],i=Math.abs(t);if(i>=n){for(let o=1;o<e.length;++o){let s=Math.pow(n,o),a=Math.pow(n,o+1);if(i>=s&&i<a){r=e[o],t=t/s;break}}r===e[0]&&(t=t/Math.pow(n,e.length-1),r=e[e.length-1])}return{value:t,suffix:r}}function S6(t,e,n,r){let i=e.base||"binary",o=Object.assign({},Md,e);const{binarySuffixes:s,decimalSuffixes:a}=n.currentBytes();let u={general:{scale:1024,suffixes:a||um,marker:"bd"},binary:{scale:1024,suffixes:s||Yk,marker:"b"},decimal:{scale:1e3,suffixes:a||um,marker:"d"}}[i],{value:c,suffix:h}=Sp(t._value,u.suffixes,u.scale);return`${Id({instance:r(c),providedFormat:e,state:n,defaults:n.currentByteDefaultFormat()})}${o.spaceSeparated?" ":""}${h}`}function b6(t,e,n){let r=n.currentOrdinal(),i=Object.assign({},Md,e),o=Id({instance:t,providedFormat:e,state:n}),s=r(t._value);return`${o}${i.spaceSeparated?" ":""}${s}`}function R6(t){let e=Math.floor(t._value/60/60),n=Math.floor((t._value-e*60*60)/60),r=Math.round(t._value-e*60*60-n*60);return`${e}:${n<10?"0":""}${n}:${r<10?"0":""}${r}`}function E6(t,e,n,r){let i=e.prefixSymbol,o=Id({instance:r(t._value*100),providedFormat:e,state:n}),s=Object.assign({},Md,e);return i?`%${s.spaceSeparated?" ":""}${o}`:`${o}${s.spaceSeparated?" ":""}%`}function T6(t,e,n){const r=n.currentCurrency();let i=Object.assign({},e),o=Object.assign({},Md,i),s,a="",l=!!o.totalLength||!!o.forceAverage||o.average,u=i.currencyPosition||r.position,c=i.currencySymbol||r.symbol;const h=o.spaceSeparatedCurrency!==void 0?o.spaceSeparatedCurrency:o.spaceSeparated;i.lowPrecision===void 0&&(i.lowPrecision=!1),h&&(a=" "),u==="infix"&&(s=a+c+a);let d=Id({instance:t,providedFormat:i,state:n,decimalSeparator:s});return u==="prefix"&&(t._value<0&&o.negative==="sign"?d=`-${a}${c}${d.slice(1)}`:t._value>0&&o.forceSign?d=`+${a}${c}${d.slice(1)}`:d=c+a+d),(!u||u==="postfix")&&(a=!o.spaceSeparatedAbbreviation&&l?"":a,d=d+a+c),d}function _6({value:t,forceAverage:e,lowPrecision:n=!0,abbreviations:r,spaceSeparated:i=!1,totalLength:o=0,roundingFunction:s=Math.round}){let a="",l=Math.abs(t),u=-1;if(e&&r[e]&&bn[e]?(a=r[e],t=t/bn[e]):l>=bn.trillion||n&&s(l/bn.trillion)===1?(a=r.trillion,t=t/bn.trillion):l<bn.trillion&&l>=bn.billion||n&&s(l/bn.billion)===1?(a=r.billion,t=t/bn.billion):l<bn.billion&&l>=bn.million||n&&s(l/bn.million)===1?(a=r.million,t=t/bn.million):(l<bn.million&&l>=bn.thousand||n&&s(l/bn.thousand)===1)&&(a=r.thousand,t=t/bn.thousand),a&&(a=(i?" ":"")+a),o){let h=t<0,d=t.toString().split(".")[0],f=h?d.length-1:d.length;u=Math.max(o-f,0)}return{value:t,abbreviation:a,mantissaPrecision:u}}function M6({value:t,characteristicPrecision:e}){let[n,r]=t.toExponential().split("e"),i=+n;if(!e)return{value:i,abbreviation:`e${r}`};let o=1;return o<e&&(i=i*Math.pow(10,e-o),r=+r-(e-o),r=r>=0?`+${r}`:r),{value:i,abbreviation:`e${r}`}}function Rf(t){let e="";for(let n=0;n<t;n++)e+="0";return e}function I6(t,e){let n=t.toString(),[r,i]=n.split("e"),[o,s=""]=r.split(".");if(+i>0)n=o+s+Rf(i-s.length);else{let a=".";+o<0?a=`-0${a}`:a=`0${a}`;let l=(Rf(-i-1)+Math.abs(o)+s).substr(0,e);l.length<e&&(l+=Rf(e-l.length)),n=a+l}return+i>0&&e>0&&(n+=`.${Rf(e)}`),n}function P6(t,e,n=Math.round){return t.toString().indexOf("e")!==-1?I6(t,e):new m6(n(+`${t}e+${e}`)/Math.pow(10,e)).toFixed(e)}function O6(t,e,n,r,i,o){if(r===-1)return t;let s=P6(e,r,o),[a,l=""]=s.toString().split(".");if(l.match(/^0+$/)&&(n||i))return a;let u=l.match(/0+$/);return i&&u?`${a}.${l.toString().slice(0,u.index)}`:s.toString()}function x6(t,e,n,r){let i=t,[o,s]=i.toString().split(".");if(o.match(/^-?0$/)&&n)return s?`${o.replace("0","")}.${s}`:o.replace("0","");const a=e<0&&o.indexOf("-")===0;if(a&&(o=o.slice(1),i=i.slice(1)),o.length<r){let l=r-o.length;for(let u=0;u<l;u++)i=`0${i}`}return a&&(i=`-${i}`),i.toString()}function A6(t,e){let n=[],r=0;for(let i=t;i>0;i--)r===e&&(n.unshift(i),r=0),r++;return n}function H6(t,e,n,r,i){let o=r.currentDelimiters(),s=o.thousands;i=i||o.decimal;let a=o.thousandsSize||3,l=t.toString(),u=l.split(".")[0],c=l.split(".")[1];const h=e<0&&u.indexOf("-")===0;return n&&(h&&(u=u.slice(1)),A6(u.length,a).forEach((f,m)=>{u=u.slice(0,f+m)+s+u.slice(f+m)}),h&&(u=`-${u}`)),c?l=u+i+c:l=u,l}function N6(t,e){return t+e}function D6(t,e,n){return e===0?t:+t==0?t.replace("-",""):e>0?`+${t}`:n==="sign"?t:`(${t.replace("-","")})`}function k6(t,e){return e+t}function L6(t,e){return t+e}function Id({instance:t,providedFormat:e,state:n=fi,decimalSeparator:r,defaults:i=n.currentDefaults()}){let o=t._value;if(o===0&&n.hasZeroFormat())return n.getZeroFormat();if(!isFinite(o))return o.toString();let s=Object.assign({},Md,i,e),a=s.totalLength,l=a?0:s.characteristic,u=s.optionalCharacteristic,c=s.forceAverage,h=s.lowPrecision,d=!!a||!!c||s.average,f=a?-1:d&&e.mantissa===void 0?0:s.mantissa,m=a?!1:e.optionalMantissa===void 0?f===-1:s.optionalMantissa,C=s.trimMantissa,y=s.thousandSeparated,E=s.spaceSeparated,v=s.negative,O=s.forceSign,x=s.exponential,F=s.roundingFunction,I="";if(d){let q=_6({value:o,forceAverage:c,lowPrecision:h,abbreviations:n.currentAbbreviations(),spaceSeparated:E,roundingFunction:F,totalLength:a});o=q.value,I+=q.abbreviation,a&&(f=q.mantissaPrecision)}if(x){let q=M6({value:o,characteristicPrecision:l});o=q.value,I=q.abbreviation+I}let _=O6(o.toString(),o,m,f,C,F);return _=x6(_,o,u,l),_=H6(_,o,y,n,r),(d||x)&&(_=N6(_,I)),(O||o<0)&&(_=D6(_,o,v)),_}function gu(t,e){if(!t)return e;let n=Object.keys(t);return n.length===1&&n[0]==="output"?e:t}var $6=t=>({format:(...e)=>p6(...e,t),getByteUnit:(...e)=>y6(...e,t),getBinaryByteUnit:(...e)=>C6(...e,t),getDecimalByteUnit:(...e)=>v6(...e,t),formatOrDefault:gu});/*!
225
- * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
226
- *
227
- * Permission is hereby granted, free of charge, to any person obtaining a copy
228
- * of this software and associated documentation files (the "Software"), to deal
229
- * in the Software without restriction, including without limitation the rights
230
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
231
- * copies of the Software, and to permit persons to whom the Software is
232
- * furnished to do so, subject to the following conditions:
233
- *
234
- * The above copyright notice and this permission notice shall be included in
235
- * all copies or substantial portions of the Software.
236
- *
237
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
238
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
239
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
240
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
241
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
242
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
243
- * SOFTWARE.
244
- */const is=zk;function F6(t,e,n){let r=new is(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new is(i),t._value=r.plus(i).toNumber(),t}function Gk(t,e,n){let r=new is(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new is(i),t._value=r.minus(i).toNumber(),t}function V6(t,e,n){let r=new is(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new is(i),t._value=r.times(i).toNumber(),t}function W6(t,e,n){let r=new is(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new is(i),t._value=r.dividedBy(i).toNumber(),t}function B6(t,e,n){let r=e;return n.isNumbro(e)&&(r=e._value),t._value=r,t}function j6(t,e,n){let r=n(t._value);return Gk(r,e,n),Math.abs(r._value)}var U6=t=>({add:(e,n)=>F6(e,n,t),subtract:(e,n)=>Gk(e,n,t),multiply:(e,n)=>V6(e,n,t),divide:(e,n)=>W6(e,n,t),set:(e,n)=>B6(e,n,t),difference:(e,n)=>j6(e,n,t),BigNumber:is});/*!
245
- * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
246
- *
247
- * Permission is hereby granted, free of charge, to any person obtaining a copy
248
- * of this software and associated documentation files (the "Software"), to deal
249
- * in the Software without restriction, including without limitation the rights
250
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
251
- * copies of the Software, and to permit persons to whom the Software is
252
- * furnished to do so, subject to the following conditions:
253
- *
254
- * The above copyright notice and this permission notice shall be included in
255
- * all copies or substantial portions of the Software.
256
- *
257
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
258
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
259
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
260
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
261
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
262
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
263
- * SOFTWARE.
264
- */const z6="2.5.0",vo=iT(),Y6=nT(),G6=d6(Gt),q6=jk();let ma=$6(Gt),Ua=U6(Gt);const K6=rT;class qk{constructor(e){this._value=e}clone(){return Gt(this._value)}format(e={}){return ma.format(this,e)}formatCurrency(e){return typeof e=="string"&&(e=K6.parseFormat(e)),e=ma.formatOrDefault(e,vo.currentCurrencyDefaultFormat()),e.output="currency",ma.format(this,e)}formatTime(e={}){return e.output="time",ma.format(this,e)}binaryByteUnits(){return ma.getBinaryByteUnit(this)}decimalByteUnits(){return ma.getDecimalByteUnit(this)}byteUnits(){return ma.getByteUnit(this)}difference(e){return Ua.difference(this,e)}add(e){return Ua.add(this,e)}subtract(e){return Ua.subtract(this,e)}multiply(e){return Ua.multiply(this,e)}divide(e){return Ua.divide(this,e)}set(e){return Ua.set(this,Kk(e))}value(){return this._value}valueOf(){return this._value}}function Kk(t){let e=t;return Gt.isNumbro(t)?e=t._value:typeof t=="string"?e=Gt.unformat(t):isNaN(t)&&(e=NaN),e}function Gt(t){return new qk(Kk(t))}Gt.version=z6;Gt.isNumbro=function(t){return t instanceof qk};Gt.language=vo.currentLanguage;Gt.registerLanguage=vo.registerLanguage;Gt.setLanguage=vo.setLanguage;Gt.languages=vo.languages;Gt.languageData=vo.languageData;Gt.zeroFormat=vo.setZeroFormat;Gt.defaultFormat=vo.currentDefaults;Gt.setDefaults=vo.setDefaults;Gt.defaultCurrencyFormat=vo.currentCurrencyDefaultFormat;Gt.validate=Y6.validate;Gt.loadLanguagesInNode=G6.loadLanguagesInNode;Gt.unformat=q6.unformat;Gt.BigNumber=Ua.BigNumber;var X6=Gt,pa=Y9(X6);const Z6="numeric";function Xk(t,e){if(Yn(t)){const n=e.numericFormat,r=n&&n.culture||"-",i=n&&n.pattern;if(typeof r<"u"&&!pa.languages()[r]){const o=r.replace("-",""),s=pa.allLanguages?pa.allLanguages[r]:pa[o];s&&pa.registerLanguage(s)}pa.setLanguage(r),t=pa(t).format(i||"0")}return t}function sT(t,e,n,r,i,o,s){let a=o;if(Yn(a)){let u=[];if(Array.isArray(s.className))u=s.className;else{var l;const c=(l=s.className)!==null&&l!==void 0?l:"";c.length&&(u=c.split(" "))}a=Xk(a,s),u.indexOf("htLeft")<0&&u.indexOf("htCenter")<0&&u.indexOf("htRight")<0&&u.indexOf("htJustify")<0&&u.push("htRight"),u.indexOf("htNumeric")<0&&u.push("htNumeric"),s.className=u.join(" "),e.dir="ltr"}hs(t,e,n,r,i,a,s)}sT.RENDERER_TYPE=Z6;const J6="password";function aT(t,e,n,r,i,o,s){hs.apply(this,[t,e,n,r,i,o,s]);const a=s.hashLength||e.innerHTML.length,l=s.hashSymbol||"*";let u="";fe(a-1,()=>{u+=l}),Ju(e,u)}aT.RENDERER_TYPE=J6;const Q6="select";function lT(t,e,n,r,i,o,s){hs.apply(this,[t,e,n,r,i,o,s])}lT.RENDERER_TYPE=Q6;const e8="time";function uT(t,e,n,r,i,o,s){hs.apply(this,[t,e,n,r,i,o,s]),e.dir="ltr"}uT.RENDERER_TYPE=e8;function t8(){Vr(nc),Vr(_d),Vr(Q0),Vr(J0),Vr(tT),Vr(Z0),Vr(sT),Vr(aT),Vr(lT),Vr(hs),Vr(uT)}const n8="autocomplete";function bp(t,e){let n=t;if(n==null&&(n=""),this.allowEmpty&&n===""){e(!0);return}this.strict&&this.source?typeof this.source=="function"?this.source(n,mA(n,e)):mA(n,e)(this.source):e(!0)}bp.VALIDATOR_TYPE=n8;function mA(t,e){const n=t;return function(r){let i=!1;for(let o=0,s=r.length;o<s;o++)if(n===r[o]){i=!0;break}e(i)}}function r8(t){const e=new Date(t);return isNaN(new Date(`${t}T00:00`).getDate())?e:new Date(e.getTime()+e.getTimezoneOffset()*6e4)}const i8="date";function cT(t,e){const n=CD(Dk,this.instance);let r=t,i=!0;r==null&&(r="");let o=Z(r,this.dateFormat||n.defaultDateFormat,!0).isValid(),s=Z(new Date(r)).isValid()||o;if(this.allowEmpty&&r===""&&(s=!0,o=!0),s||(i=!1),!s&&o&&(i=!0),s&&!o)if(this.correctFormat===!0){const a=o8(r,this.dateFormat);this.instance.setDataAtCell(this.visualRow,this.visualCol,a,"dateValidator"),i=!0}else i=!1;e(i)}cT.VALIDATOR_TYPE=i8;function o8(t,e){const n=Z(r8(t)),r=Z(t,e),i=t.search(/[A-Za-z]/g)>-1;let o;return n.isValid()&&n.format("x")===r.format("x")||!r.isValid()||i?o=n:o=r,o.format(e)}const s8="dropdown";function hT(t,e){bp.apply(this,[t,e])}hT.VALIDATOR_TYPE=s8;const a8="numeric";function dT(t,e){let n=t;n==null&&(n=""),this.allowEmpty&&n===""?e(!0):e(n===""?!1:Yn(t))}dT.VALIDATOR_TYPE=a8;const l8=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"],u8="time";function fT(t,e){const n=this.timeFormat||"h:mm:ss a";let r=!0,i=t;i===null&&(i=""),i=/^\d{3,}$/.test(i)?parseInt(i,10):i;const o=/^\d{1,2}$/.test(i);o&&(i+=":00");const s=Z(i,l8,!0).isValid()?Z(i):Z(i,n);let a=s.isValid(),l=Z(i,n,!0).isValid()&&!o;if(this.allowEmpty&&i===""&&(a=!0,l=!0),a||(r=!1),!a&&l&&(r=!0),a&&!l)if(this.correctFormat===!0){const u=s.format(n);this.instance.setDataAtCell(this.visualRow,this.visualCol,u,"timeValidator"),r=!0}else r=!1;e(r)}fT.VALIDATOR_TYPE=u8;function c8(){fu(bp),fu(hT),fu(cT),fu(dT),fu(fT)}const h8="autocomplete",d8={CELL_TYPE:h8,editor:K0,renderer:nc,validator:bp},f8="checkbox",g8={CELL_TYPE:f8,editor:Nk,renderer:Q0},m8="date";function Zk(t,e,n,r,i,o,s){nc.apply(this,[t,e,n,r,i,o,s])}Zk.RENDERER_TYPE=m8;const p8="date",w8={CELL_TYPE:p8,editor:kk,renderer:Zk,validator:cT},v8="dropdown",C8={CELL_TYPE:v8,editor:Lk,renderer:J0,validator:hT,filter:!1,strict:!0},y8="handsontable",S8={CELL_TYPE:y8,editor:q0,renderer:tT},b8="numeric",R8={CELL_TYPE:b8,editor:$k,renderer:sT,validator:dT,dataType:"number"},E8="password",T8={CELL_TYPE:E8,editor:Fk,renderer:aT,copyable:!1},_8="select",M8={CELL_TYPE:_8,editor:Vk,renderer:lT},I8="time",P8={CELL_TYPE:I8,editor:Wk,renderer:uT,validator:fT};function O8(){ci(d8),ci(g8),ci(w8),ci(C8),ci(S8),ci(R8),ci(T8),ci(M8),ci(Ek),ci(P8)}function x8(t,e){Jk(t,e),e.add(t)}function A8(t,e,n){Jk(t,e),e.set(t,n)}function Jk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fl(t,e,n){return(e=H8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function H8(t){var e=N8(t,"string");return typeof e=="symbol"?e:e+""}function N8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Vl(t,e){return t.get(Qk(t,e))}function Qk(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const pA=new Map([["plugin",KY],["cell-type",gk],["editor",vD],["renderer",_D],["validator",MD]]),eL=Symbol("mainSetting"),D8="base",Ef=[];let wa=null;var va=new WeakMap,wA=new WeakSet;class et{static get PLUGIN_KEY(){return D8}static get SETTING_KEYS(){return[this.PLUGIN_KEY]}static get DEFAULT_SETTINGS(){return{}}constructor(e){x8(this,wA),Fl(this,"eventManager",new _i(this)),Fl(this,"pluginName",null),Fl(this,"pluginsInitializedCallbacks",[]),Fl(this,"isPluginsReady",!1),Fl(this,"enabled",!1),Fl(this,"initialized",!1),A8(this,va,{}),us(this,"hot",e,{writable:!1}),wa=null,this.hot.addHook("afterPluginsInitialized",()=>this.onAfterPluginsInitialized()),this.hot.addHook("afterUpdateSettings",n=>this.onUpdateSettings(n)),this.hot.addHook("beforeInit",()=>this.init())}init(){this.pluginName=this.hot.getPluginName(this);const e=this.constructor.PLUGIN_DEPS,n=Array.isArray(e)?e:[];if(n.length>0){const i=[];if(n.forEach(o=>{const[s,a]=o.split(":");if(!pA.has(s))throw new Error(`Unknown plugin dependency type "${s}" was found.`);pA.get(s)(a)||i.push(` - ${a} (${s})`)}),i.length>0){const o=[`The ${this.pluginName} plugin requires the following modules:
265
- `,`${i.join(`
266
- `)}
267
- `].join("");Ef.push(o)}}if(wa||(wa=TD()),wa.indexOf(this.pluginName)>=0&&wa.splice(wa.indexOf(this.pluginName),1),this.hot.addHookOnce("afterPluginsInitialized",()=>{this.isEnabled&&this.isEnabled()&&this.enablePlugin()}),wa.length===0){if(Ef.length>0){const i=[`${Ef.join(`
268
- `)}
269
- `,"You have to import and register them manually."].join("");throw Ef.length=0,new Error(i)}this.hot.runHooks("afterPluginsInitialized")}this.initialized=!0}enablePlugin(){this.enabled=!0}disablePlugin(){var e;(e=this.eventManager)===null||e===void 0||e.clear(),this.clearHooks(),this.enabled=!1}getSetting(e){const n=this.hot.getSettings()[this.constructor.PLUGIN_KEY];if(e===void 0)return n;const r=this.constructor.DEFAULT_SETTINGS;if((Array.isArray(n)||De(n))&&r[eL]===e){var i;return Array.isArray(n)?n:(i=n[e])!==null&&i!==void 0?i:r[e]}if(De(n)){var o;return(o=n[e])!==null&&o!==void 0?o:r[e]}return r[e]}addHook(e,n,r){Vl(va,this)[e]=Vl(va,this)[e]||[];const i=Vl(va,this)[e];this.hot.addHook(e,n,r),i.push(n),Vl(va,this)[e]=i}removeHooks(e){H(Vl(va,this)[e]||[],n=>{this.hot.removeHook(e,n)})}clearHooks(){const e=Vl(va,this);ke(e,(n,r)=>this.removeHooks(r)),e.length=0}callOnPluginsReady(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)}onAfterPluginsInitialized(){H(this.pluginsInitializedCallbacks,e=>e()),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0}onUpdateSettings(e){const n=Qk(wA,this,k8).call(this,e);this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&n&&this.updatePlugin(e))}updatePlugin(){}destroy(){var e;(e=this.eventManager)===null||e===void 0||e.destroy(),this.clearHooks(),ke(this,(n,r)=>{r!=="hot"&&(this[r]=null)}),delete this.t,delete this.hot}}function k8(t){if(!t)return!1;const e=this.constructor.SETTING_KEYS;if(typeof e=="boolean")return e;for(let n=0;n<e.length;n++)if(t[e[n]]!==void 0)return!0;return!1}function Ca(t,e,n){return(e=L8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function L8(t){var e=$8(t,"string");return typeof e=="symbol"?e:e+""}function $8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}let tL=class{constructor(e){Ca(this,"hot",null),Ca(this,"container",null),Ca(this,"injected",!1),Ca(this,"rows",[]),Ca(this,"columns",[]),Ca(this,"samples",null),Ca(this,"settings",{useHeaders:!0}),this.hot=e}addRow(e,n){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));const r={row:e};this.rows.push(r),this.samples=n,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol(e)),this.table.tr.appendChild(this.createRow(e)),e===0&&X(this.table.table,"htGhostTableFirstRow"),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}addColumnHeadersRow(e){const n=this.hot.getColHeader(0);if(n!=null){const r={row:-1};this.rows.push(r),this.container=this.createContainer(this.hot.rootElement.className),this.samples=e,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.appendColumnHeadersRow(),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}}addColumn(e,n){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));const r={col:e};this.columns.push(r),this.samples=n,this.table=this.createTable(this.hot.table.className),this.getSetting("useHeaders")&&this.hot.getColHeader(e)!==null&&this.hot.view.appendColHeader(e,this.table.th,void 0,-1),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}getHeights(e){this.injected||this.injectTable(),H(this.rows,n=>{const{height:r}=n.table.getBoundingClientRect();e(n.row,Math.ceil(r))})}getWidths(e){this.injected||this.injectTable(),H(this.columns,n=>{const{width:r}=n.table.getBoundingClientRect();e(n.col,Math.ceil(r))})}setSettings(e){this.settings=e}setSetting(e,n){this.settings||(this.settings={}),this.settings[e]=n}getSettings(){return this.settings}getSetting(e){return this.settings?this.settings[e]:null}createColGroupsCol(e){const n=this.hot.rootDocument.createDocumentFragment();return this.hot.hasRowHeaders()&&n.appendChild(this.createColElement(-1,-1)),this.samples.forEach(r=>{H(r.strings,i=>{n.appendChild(this.createColElement(i.col,e))})}),n}createRow(e){const{rootDocument:n}=this.hot,r=n.createDocumentFragment(),i=n.createElement("th");return this.hot.hasRowHeaders()&&(this.hot.view.appendRowHeader(e,i),r.appendChild(i)),this.samples.forEach(o=>{H(o.strings,s=>{const a=s.col,l=this.hot.getCellMeta(e,a),u=this.hot.getCellRenderer(l),c=n.createElement("td");c.setAttribute("ghost-table",1),u(this.hot,c,e,a,this.hot.colToProp(a),s.value,l),r.appendChild(c)})}),r}appendColumnHeadersRow(){const{rootDocument:e}=this.hot,n=e.createDocumentFragment(),r=[];if(this.hot.hasRowHeaders()){const i=e.createElement("th");r.push([-1,i]),n.appendChild(i)}this.samples.forEach(i=>{H(i.strings,o=>{const s=o.col,a=e.createElement("th");r.push([s,a]),n.appendChild(a)})}),this.table.tHead.appendChild(n),H(r,i=>{const[o,s]=i;this.hot.view.appendColHeader(o,s)})}createCol(e){const{rootDocument:n}=this.hot,r=n.createDocumentFragment();return this.samples.forEach(i=>{H(i.strings,o=>{const s=o.row,a=this.hot.getCellMeta(s,e),l=this.hot.getCellRenderer(a),u=n.createElement("td"),c=n.createElement("tr");u.setAttribute("ghost-table",1),l(this.hot,u,s,e,this.hot.colToProp(e),o.value,a),c.appendChild(u),r.appendChild(c)})}),r}clean(){this.rows.length=0,this.rows[-1]=void 0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()}injectTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)}removeTable(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)}createColElement(e,n){const r=this.hot.rootDocument.createElement("col");let i=0;n>=0&&e>=0&&(i=this.hot.getCellMeta(n,e).colspan);let o=this.hot.getColWidth(e);if(i>1)for(let s=e+1;s<e+i;s++)o+=this.hot.getColWidth(s);return r.style.width=`${o}px`,r}createTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{rootDocument:n}=this.hot,r=n.createDocumentFragment(),i=n.createElement("table"),o=n.createElement("thead"),s=n.createElement("tbody"),a=n.createElement("colgroup"),l=n.createElement("tr"),u=n.createElement("th");return this.isVertical()&&i.appendChild(a),this.isHorizontal()&&(l.appendChild(u),o.appendChild(l),i.style.tableLayout="auto",i.style.width="auto"),i.appendChild(o),this.isVertical()&&s.appendChild(l),i.appendChild(s),X(i,e),r.appendChild(i),{fragment:r,table:i,tHead:o,tBody:s,colGroup:a,tr:l,th:u}}createContainer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{rootDocument:n}=this.hot,r=n.createDocumentFragment(),i=n.createElement("div"),o=`htGhostTable htAutoSize ${e.trim()}`;return X(i,o),r.appendChild(i),{fragment:r,container:i}}isVertical(){return!!(this.rows.length&&!this.columns.length)}isHorizontal(){return!!(this.columns.length&&!this.rows.length)}};function Tf(t,e,n){return(e=F8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function F8(t){var e=V8(t,"string");return typeof e=="symbol"?e:e+""}function V8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Rp{static get SAMPLE_COUNT(){return 3}constructor(e){Tf(this,"samples",null),Tf(this,"dataFactory",null),Tf(this,"customSampleCount",null),Tf(this,"allowDuplicates",!1),this.dataFactory=e}getSampleCount(){return this.customSampleCount?this.customSampleCount:Rp.SAMPLE_COUNT}setSampleCount(e){this.customSampleCount=e}setAllowDuplicates(e){this.allowDuplicates=e}generateRowSamples(e,n){return this.generateSamples("row",n,e)}generateColumnSamples(e,n){return this.generateSamples("col",n,e)}generateSamples(e,n,r){const i=new Map,{from:o,to:s}=typeof r=="number"?{from:r,to:r}:r;return fe(o,s,a=>{const l=this.generateSample(e,n,a);i.set(a,l)}),i}generateSample(e,n,r){if(e!=="row"&&e!=="col")throw new Error("Unsupported sample type");const i=new Map,o=e==="row"?"col":"row",s=[];return fe(n.from,n.to,a=>{const l=e==="row"?this.dataFactory(r,a):this.dataFactory(a,r);if(l===!1)return;const{value:u,bundleSeed:c}=l,h=typeof c=="string"&&c.length>0;let d;h?d=c:De(u)?d=`${Object.keys(u).length}`:Array.isArray(u)?d=`${u.length}`:d=`${At(u).length}`,i.has(d)||i.set(d,{needed:this.getSampleCount(),strings:[]});const f=i.get(d);f.needed&&(!(s.indexOf(u)>-1)||this.allowDuplicates||h)&&(f.strings.push({value:u,[o]:a}),s.push(u),f.needed-=1)}),i}}function W8(t,e){nL(t,e),e.add(t)}function Ay(t,e,n){nL(t,e),e.set(t,n)}function nL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ac(t,e,n){return(e=B8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function B8(t){var e=j8(t,"string");return typeof e=="symbol"?e:e+""}function j8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Vs(t,e){return t.get(hr(t,e))}function cm(t,e,n){return t.set(hr(t,e),n),n}function hr(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}ie.getSingleton().register("modifyAutoColumnSizeSeed");const Hy="autoColumnSize",U8=10,z8="autoColumnSize";var gT=new WeakMap,mu=new WeakMap,Bu=new WeakMap,Tr=new WeakSet;class Eh extends et{static get PLUGIN_KEY(){return Hy}static get PLUGIN_PRIORITY(){return U8}static get SETTING_KEYS(){return!0}static get DEFAULT_SETTINGS(){return{useHeaders:!0,samplingRatio:null,allowSampleDuplicates:!1}}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 50}constructor(e){super(e),W8(this,Tr),Ac(this,"ghostTable",new tL(this.hot)),Ac(this,"samplesGenerator",new Rp((n,r)=>{const i=this.hot.toPhysicalRow(n),o=this.hot.toPhysicalColumn(r);if(this.hot.rowIndexMapper.isHidden(i)||this.hot.columnIndexMapper.isHidden(o))return!1;const s=this.hot.getCellMeta(n,r);let a="";s.spanned||(a=this.hot.getDataAtCell(n,r));let l="";return this.hot.hasHook("modifyAutoColumnSizeSeed")&&(l=this.hot.runHooks("modifyAutoColumnSizeSeed",l,s,a)),{value:a,bundleSeed:l}})),Ac(this,"inProgress",!1),Ac(this,"measuredColumns",0),Ac(this,"columnWidthsMap",new ea),Ay(this,gT,!1),Ay(this,mu,[]),Ay(this,Bu,[]),this.hot.columnIndexMapper.registerMap(z8,this.columnWidthsMap),this.addHook("beforeColumnResize",(n,r,i)=>hr(Tr,this,vA).call(this,n,r,i))}isEnabled(){return this.hot.getSettings()[Hy]!==!1&&!this.hot.getSettings().colWidths}enablePlugin(){var e=this;if(this.enabled)return;this.ghostTable.setSetting("useHeaders",this.getSetting("useHeaders")),this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));const n=this.getSetting("samplingRatio");n&&!isNaN(n)&&this.samplesGenerator.setSampleCount(parseInt(n,10)),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return hr(Tr,e,q8).call(e,...i)}),this.addHook("beforeChangeRender",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return hr(Tr,e,K8).call(e,...i)}),this.addHook("afterFormulasValuesUpdate",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return hr(Tr,e,Z8).call(e,...i)}),this.addHook("beforeRender",()=>hr(Tr,this,G8).call(this)),this.addHook("modifyColWidth",(r,i)=>this.getColumnWidth(i,r)),this.addHook("init",()=>hr(Tr,this,X8).call(this)),super.enablePlugin()}updatePlugin(){cm(Bu,this,this.findColumnsWhereHeaderWasChanged()),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.addHook("beforeColumnResize",(e,n,r)=>hr(Tr,this,vA).call(this,e,n,r))}calculateVisibleColumnsWidth(){if(!this.hot.countRows())return;const e=this.getFirstVisibleColumn(),n=this.getLastVisibleColumn();if(e===-1||n===-1)return;const r=this.hot.forceFullRender;this.calculateColumnsWidth({from:e,to:n},void 0,r)}calculateColumnsWidth(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countCols()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countRows()-1},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,o=typeof n=="number"?{from:n,to:n}:n;fe(i.from,i.to,s=>{let a=this.hot.toPhysicalColumn(s);a===null&&(a=s),(r||this.columnWidthsMap.getValueAtIndex(a)===null&&!this.hot._getColWidthFromSettings(a))&&hr(Tr,this,rL).call(this,s,o)}),this.ghostTable.columns.length&&(hr(Tr,this,iL).call(this),this.measuredColumns=i.to+1,this.ghostTable.clean())}calculateAllColumnsWidth(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countRows()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0;const i=this.hot.countCols()-1;let o=null;this.inProgress=!0;const s=()=>{if(!this.hot){em(o),this.inProgress=!1;return}this.calculateColumnsWidth({from:r,to:Math.min(r+Eh.CALCULATION_STEP,i)},e,n),r=r+Eh.CALCULATION_STEP+1,r<i?o=Qg(s):(em(o),this.inProgress=!1,this.hot.view.adjustElementsSize())},a=this.getSyncCalculationLimit();a>=0&&(this.calculateColumnsWidth({from:0,to:a},e,n),r=a+1),r<i?s():this.inProgress=!1}recalculateAllColumnsWidth(){this.hot.view.isVisible()&&this.calculateAllColumnsWidth({from:0,to:this.hot.countRows()-1},!0)}getSyncCalculationLimit(){const e=this.hot.getSettings()[Hy];let n=Eh.SYNC_CALCULATION_LIMIT;const r=this.hot.countCols()-1;return De(e)&&(n=e.syncLimit,jN(n)?n=bD(r,n):n>>=0),Math.min(n,r)}getColumnWidth(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=n;return i===void 0&&(i=this.columnWidthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e)),r&&typeof i=="number"&&(i=Math.max(i,ku))),i}getFirstVisibleColumn(){var e;return(e=this.hot.getFirstRenderedVisibleColumn())!==null&&e!==void 0?e:-1}getLastVisibleColumn(){var e;return(e=this.hot.getLastRenderedVisibleColumn())!==null&&e!==void 0?e:-1}findColumnsWhereHeaderWasChanged(){return this.hot.getColHeader().reduce((r,i,o)=>{const s=Vs(mu,this).length;return(s-1<o||Vs(mu,this)[o]!==i)&&r.push(this.hot.toVisualColumn(o)),s-1<o?Vs(mu,this).push(i):Vs(mu,this)[o]=i,r},[])}clearCache(e){Array.isArray(e)?this.hot.batchExecution(()=>{e.forEach(n=>{this.columnWidthsMap.setValueAtIndex(n,null)})},!0):this.columnWidthsMap.clear()}isNeedRecalculate(){return!!this.columnWidthsMap.getValues().slice(0,this.measuredColumns).filter(e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function Y8(t){const e={from:0,to:this.hot.countRows()-1};t.forEach(n=>{const r=this.hot.toPhysicalColumn(n);r!==null&&(this.hot._getColWidthFromSettings(r)||hr(Tr,this,rL).call(this,n,e))}),this.ghostTable.columns.length&&(hr(Tr,this,iL).call(this),this.ghostTable.clean())}function rL(t,e){this.samplesGenerator.generateColumnSamples(t,e).forEach((r,i)=>this.ghostTable.addColumn(i,r))}function iL(){this.hot.batchExecution(()=>{this.ghostTable.getWidths((t,e)=>{const n=this.hot.toPhysicalColumn(t);this.columnWidthsMap.setValueAtIndex(n,e)})},!0)}function G8(){this.calculateVisibleColumnsWidth(),this.inProgress||(hr(Tr,this,Y8).call(this,Vs(Bu,this)),cm(Bu,this,[]))}function q8(t,e){e||this.recalculateAllColumnsWidth()}function K8(t){const e=t.reduce((n,r)=>{let[,i]=r;const o=this.hot.propToCol(i);return Number.isInteger(o)&&n.indexOf(o)===-1&&n.push(o),n},[]);Vs(Bu,this).push(...e)}function vA(t,e,n){let r=t;return n&&(this.calculateColumnsWidth(e,void 0,!0),r=this.getColumnWidth(e,void 0,!1)),r}function X8(){cm(mu,this,this.hot.getColHeader()),this.recalculateAllColumnsWidth(),cm(gT,this,!0)}function Z8(t){if(!Vs(gT,this))return;const e=t.reduce((n,r)=>{var i;const o=(i=r.address)===null||i===void 0?void 0:i.col;if(Number.isInteger(o)){const s=this.hot.toVisualColumn(o);n.indexOf(s)===-1&&n.push(s)}return n},[]);Vs(Bu,this).push(...e)}const Za={horizontal:"horizontal",vertical:"vertical"};function J8(t,e,n){let r,i,o;return e[0]===t[0]&&e[1]<t[1]?(o="left",r=n(e[0],e[1]),i=n(e[2],t[1]-1)):e[2]===t[2]&&e[0]===t[0]&&e[3]>t[3]?(o="right",r=n(e[0],t[3]+1),i=n(e[2],e[3])):e[0]<t[0]&&e[1]===t[1]?(o="up",r=n(e[0],e[1]),i=n(t[0]-1,e[3])):e[2]>t[2]&&e[1]===t[1]&&(o="down",r=n(t[2]+1,e[1]),i=n(e[2],e[3])),r&&r.normalize(),i&&i.normalize(),{directionOfDrag:o,startOfDragCoords:r,endOfDragCoords:i}}function Q8(t){const e={};return t===!0?(e.directions=Object.keys(Za),e.autoInsertRow=!0):De(t)?(ue(t.autoInsertRow)?t.direction===Za.horizontal?e.autoInsertRow=!1:e.autoInsertRow=t.autoInsertRow:e.autoInsertRow=!1,ue(t.direction)?e.directions=[t.direction]:e.directions=Object.keys(Za)):typeof t=="string"?(e.directions=[t],e.autoInsertRow=!0):(e.directions=[],e.autoInsertRow=!1),e}function e7(t,e){t7(t,e),e.add(t)}function t7(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Wl(t,e,n){return(e=n7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n7(t){var e=r7(t,"string");return typeof e=="symbol"?e:e+""}function r7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Hc(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}ie.getSingleton().register("modifyAutofillRange");ie.getSingleton().register("beforeAutofill");ie.getSingleton().register("afterAutofill");const CA="autofill",i7=20,o7=["fillHandle"],s7="insert_row_below",a7=200;var Bl=new WeakSet;class l7 extends et{constructor(){super(...arguments),e7(this,Bl),Wl(this,"addingStarted",!1),Wl(this,"mouseDownOnCellCorner",!1),Wl(this,"mouseDragOutside",!1),Wl(this,"handleDraggedCells",0),Wl(this,"directions",[]),Wl(this,"autoInsertRow",!1)}static get PLUGIN_KEY(){return CA}static get PLUGIN_PRIORITY(){return i7}static get SETTING_KEYS(){return[CA,...o7]}isEnabled(){return this.hot.getSettings().fillHandle}enablePlugin(){this.enabled||(this.mapSettings(),this.registerEvents(),this.addHook("afterOnCellCornerMouseDown",e=>Hc(Bl,this,c7).call(this,e)),this.addHook("afterOnCellCornerDblClick",e=>Hc(Bl,this,u7).call(this,e)),this.addHook("beforeOnCellMouseOver",(e,n)=>Hc(Bl,this,h7).call(this,n)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.clearMappedSettings(),super.disablePlugin()}getSelectionData(){const e=this.hot.getSelectedRangeLast(),{row:n,col:r}=e.getTopStartCorner(),{row:i,col:o}=e.getBottomEndCorner(),s=this.hot.runHooks("modifyCopyableRange",[{startRow:n,startCol:r,endRow:i,endCol:o}]),a=[],l=[],u=[];return H(s,c=>{for(let h=c.startRow;h<=c.endRow;h+=1)a.indexOf(h)===-1&&a.push(h);for(let h=c.startCol;h<=c.endCol;h+=1)l.indexOf(h)===-1&&l.push(h)}),H(a,c=>{const h=[];H(l,d=>{h.push(this.hot.getCopyableData(c,d))}),u.push(h)}),u}fillIn(){if(this.hot.selection.highlight.getFill().isEmpty())return!1;const[e,n,r,i]=this.hot.selection.highlight.getFill().getVisualCorners(),o=this.hot.getSelectedRangeLast(),s=o.getTopStartCorner(),a=o.getBottomEndCorner();this.resetSelectionOfDraggedArea();const l=[s.row,s.col,a.row,a.col],u=this.hot.runHooks("modifyAutofillRange",[Math.min(s.row,e),Math.min(s.col,n),Math.max(a.row,r),Math.max(a.col,i)],l),{directionOfDrag:c,startOfDragCoords:h,endOfDragCoords:d}=J8(l,u,(f,m)=>this.hot._createCellCoords(f,m));if(h&&h.row>-1&&h.col>-1){const f=this.getSelectionData(),m=o.clone(),C=this.hot._createCellRange(h,h,d),y=this.hot.runHooks("beforeAutofill",f,m,C,c);if(y===!1)return this.hot.selection.highlight.getFill().clear(),this.hot.render(),!1;let E=y;const v=y;if(["up","left"].indexOf(c)>-1&&!(v.length===1&&v[0].length===0))if(E=[],c==="up"){const O=d.row-h.row+1,x=O%v.length;for(let F=0;F<O;F++)E.push(v[(F+(v.length-x))%v.length])}else{const O=d.col-h.col+1,x=O%v[0].length;for(let F=0;F<v.length;F++){E.push([]);for(let I=0;I<O;I++)E[F].push(v[F][(I+(v[F].length-x))%v[F].length])}}this.hot.populateFromArray(h.row,h.col,E,d.row,d.col,`${this.pluginName}.fill`,null),this.setSelection(u),this.hot.runHooks("afterAutofill",E,m,C,c),this.hot.render()}else this.hot.view.render();return!0}reduceSelectionAreaIfNeeded(e){return e.row<0&&(e.row=0),e.col<0&&(e.col=0),e}getCoordsOfDragAndDropBorders(e){const n=this.hot.getSelectedRangeLast(),r=n.getBottomEndCorner();let i=e;if(this.directions.includes(Za.vertical)&&this.directions.includes(Za.horizontal)){const o=n.getTopStartCorner();(r.col<=e.col||o.col>=e.col)&&(i=this.hot._createCellCoords(r.row,e.col)),(r.row<e.row||o.row>e.row)&&(i=this.hot._createCellCoords(e.row,r.col))}else if(this.directions.includes(Za.vertical))i=this.hot._createCellCoords(e.row,r.col);else if(this.directions.includes(Za.horizontal))i=this.hot._createCellCoords(r.row,e.col);else return;return this.reduceSelectionAreaIfNeeded(i)}showBorder(e){const n=this.getCoordsOfDragAndDropBorders(e);n&&this.redrawBorders(n)}addRow(){this.hot._registerTimeout(()=>{this.hot.alter(s7,void 0,1,`${this.pluginName}.fill`),this.addingStarted=!1},a7)}addNewRowIfNeeded(){if(!this.hot.selection.highlight.getFill().isEmpty()&&this.addingStarted===!1&&this.autoInsertRow){const e=this.hot.getSelectedLast(),n=this.hot.selection.highlight.getFill().getVisualCorners(),r=this.hot.countRows();e[2]<r-1&&n[2]===r-1&&(this.addingStarted=!0,this.addRow())}}getIndexOfLastAdjacentFilledInRow(e){const n=this.hot.getData(),r=this.hot.countRows();let i;for(let o=e[2]+1;o<r;o++){for(let l=e[1];l<=e[3];l++){const u=n[o][l];if(!Yt(u))return-1}const s=n[o][e[1]-1],a=n[o][e[3]+1];(!Yt(s)||!Yt(a))&&(i=o)}return i}addSelectionFromStartAreaToSpecificRowIndex(e,n){this.hot.selection.highlight.getFill().clear().add(this.hot._createCellCoords(e[0],e[1])).add(this.hot._createCellCoords(n,e[3])).commit()}setSelection(e){this.hot.selectCell(...ze(e,n=>Math.max(n,0)),!1,!1)}selectAdjacent(){const e=this.hot.getSelectedLast(),n=this.getIndexOfLastAdjacentFilledInRow(e);return n===-1||n===void 0?!1:(this.addSelectionFromStartAreaToSpecificRowIndex(e,n),!0)}resetSelectionOfDraggedArea(){this.handleDraggedCells=0,this.hot.selection.highlight.getFill().clear()}redrawBorders(e){this.hot.selection.highlight.getFill().clear().add(this.hot.getSelectedRangeLast().from).add(this.hot.getSelectedRangeLast().to).add(e).commit(),this.hot.view.render()}getIfMouseWasDraggedOutside(e){const{documentElement:n}=this.hot.rootDocument,r=Nn(this.hot.table).top-(this.hot.rootWindow.pageYOffset||n.scrollTop)+an(this.hot.table),i=Nn(this.hot.table).left-(this.hot.rootWindow.pageXOffset||n.scrollLeft)+Xt(this.hot.table);return e.clientY>r&&e.clientX<=i}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mouseup",()=>Hc(Bl,this,d7).call(this)),this.eventManager.addEventListener(e,"mousemove",n=>Hc(Bl,this,f7).call(this,n))}clearMappedSettings(){this.directions.length=0,this.autoInsertRow=!1}mapSettings(){const e=Q8(this.hot.getSettings().fillHandle);this.directions=e.directions,this.autoInsertRow=e.autoInsertRow}destroy(){super.destroy()}}function u7(){this.selectAdjacent()&&this.fillIn()}function c7(){this.handleDraggedCells=1,this.mouseDownOnCellCorner=!0}function h7(t){this.mouseDownOnCellCorner&&!this.hot.view.isMouseDown()&&this.handleDraggedCells&&(this.handleDraggedCells+=1,this.showBorder(t),this.addNewRowIfNeeded())}function d7(){this.handleDraggedCells&&(this.handleDraggedCells>1&&this.fillIn(),this.handleDraggedCells=0,this.mouseDownOnCellCorner=!1)}function f7(t){const e=this.getIfMouseWasDraggedOutside(t);this.addingStarted===!1&&this.handleDraggedCells>0&&e?(this.mouseDragOutside=!0,this.addingStarted=!0):this.mouseDragOutside=!1,this.mouseDragOutside&&this.autoInsertRow&&this.addRow()}function g7(t,e){oL(t,e),e.add(t)}function yA(t,e,n){oL(t,e),e.set(t,n)}function oL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jl(t,e,n){return(e=m7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m7(t){var e=p7(t,"string");return typeof e=="symbol"?e:e+""}function p7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function sL(t,e,n){return t.set(io(t,e),n),n}function hm(t,e){return t.get(io(t,e))}function io(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Ny="autoRowSize",w7=40,v7="autoRowSize";var Jh=new WeakMap,mT=new WeakMap,Do=new WeakSet;class Th extends et{static get PLUGIN_KEY(){return Ny}static get PLUGIN_PRIORITY(){return w7}static get SETTING_KEYS(){return!0}static get DEFAULT_SETTINGS(){return{useHeaders:!0,samplingRatio:null,allowSampleDuplicates:!1}}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 500}constructor(e){super(e),g7(this,Do),jl(this,"headerHeight",null),jl(this,"ghostTable",new tL(this.hot)),jl(this,"samplesGenerator",new Rp((n,r)=>{const i=this.hot.toPhysicalRow(n),o=this.hot.toPhysicalColumn(r);if(this.hot.rowIndexMapper.isHidden(i)||this.hot.columnIndexMapper.isHidden(o)||n>=0&&r>=0&&this.hot.getCellMeta(n,r).hidden)return!1;let s;return n>=0?s=this.hot.getDataAtCell(n,r):n===-1&&(s=this.hot.getColHeader(r)),{value:s}})),jl(this,"inProgress",!1),jl(this,"measuredRows",0),jl(this,"rowHeightsMap",new ea),yA(this,Jh,[]),yA(this,mT,!1),this.hot.rowIndexMapper.registerMap(v7,this.rowHeightsMap),this.addHook("beforeRowResize",(n,r,i)=>io(Do,this,SA).call(this,n,r,i))}isEnabled(){const e=this.hot.getSettings()[Ny];return e===!0||De(e)}enablePlugin(){var e=this;if(this.enabled)return;this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));const n=this.getSetting("samplingRatio");n&&!isNaN(n)&&this.samplesGenerator.setSampleCount(parseInt(n,10)),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return io(Do,e,S7).call(e,...i)}),this.addHook("beforeChangeRender",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return io(Do,e,b7).call(e,...i)}),this.addHook("beforeColumnResize",()=>this.recalculateAllRowsHeight()),this.addHook("afterFormulasValuesUpdate",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return io(Do,e,E7).call(e,...i)}),this.addHook("beforeRender",()=>io(Do,this,y7).call(this)),this.addHook("modifyRowHeight",(r,i)=>this.getRowHeight(i,r)),this.addHook("init",()=>io(Do,this,R7).call(this)),this.addHook("modifyColumnHeaderHeight",()=>this.getColumnHeaderHeight()),super.enablePlugin()}disablePlugin(){this.headerHeight=null,super.disablePlugin(),this.addHook("beforeRowResize",(e,n,r)=>io(Do,this,SA).call(this,e,n,r))}calculateVisibleRowsHeight(){if(!this.hot.countCols())return;const e=this.getFirstVisibleRow(),n=this.getLastVisibleRow();if(e===-1||n===-1)return;const r=this.hot.forceFullRender;this.calculateRowsHeight({from:e,to:n},void 0,r)}calculateRowsHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countRows()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countCols()-1},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,o=typeof n=="number"?{from:n,to:n}:n;if(this.hot.getColHeader(0)!==null){const s=this.samplesGenerator.generateRowSamples(-1,o);this.ghostTable.addColumnHeadersRow(s.get(-1))}fe(i.from,i.to,s=>{let a=this.hot.toPhysicalRow(s);a===null&&(a=s),(r||this.rowHeightsMap.getValueAtIndex(a)===null)&&this.samplesGenerator.generateRowSamples(s,o).forEach((u,c)=>this.ghostTable.addRow(c,u))}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((s,a)=>{s<0?this.headerHeight=a:this.rowHeightsMap.setValueAtIndex(this.hot.toPhysicalRow(s),a)})},!0),this.measuredRows=i.to+1,this.ghostTable.clean())}calculateAllRowsHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countCols()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0;const i=this.hot.countRows()-1;let o=null;this.inProgress=!0;const s=()=>{if(!this.hot){em(o),this.inProgress=!1;return}this.calculateRowsHeight({from:r,to:Math.min(r+Th.CALCULATION_STEP,i)},e,n),r=r+Th.CALCULATION_STEP+1,r<i?o=Qg(s):(em(o),this.inProgress=!1,this.hot.view.adjustElementsSize())},a=this.getSyncCalculationLimit();a>=0&&(this.calculateRowsHeight({from:0,to:a},e,n),r=a+1),r<i?s():(this.inProgress=!1,this.hot.view.adjustElementsSize())}recalculateAllRowsHeight(){this.hot.view.isVisible()&&this.calculateAllRowsHeight({from:0,to:this.hot.countCols()-1},!0)}getSyncCalculationLimit(){const e=this.hot.getSettings()[Ny];let n=Th.SYNC_CALCULATION_LIMIT;const r=this.hot.countRows()-1;return De(e)&&(n=e.syncLimit,jN(n)?n=bD(r,n):n>>=0),Math.min(n,r)}getRowHeight(e,n){const r=e<0?this.headerHeight:this.rowHeightsMap.getValueAtIndex(this.hot.toPhysicalRow(e));let i=n;return r!==null&&r>(n||0)&&(i=r),i}getColumnHeaderHeight(){return this.headerHeight}getFirstVisibleRow(){var e;return(e=this.hot.getFirstRenderedVisibleRow())!==null&&e!==void 0?e:-1}getLastVisibleRow(){var e;return(e=this.hot.getLastRenderedVisibleRow())!==null&&e!==void 0?e:-1}clearCache(e){this.headerHeight=null,Array.isArray(e)?this.hot.batchExecution(()=>{e.forEach(n=>{this.rowHeightsMap.setValueAtIndex(n,null)})},!0):this.rowHeightsMap.clear()}clearCacheByRange(e){const{from:n,to:r}=typeof e=="number"?{from:e,to:e}:e;this.hot.batchExecution(()=>{fe(Math.min(n,r),Math.max(n,r),i=>{this.rowHeightsMap.setValueAtIndex(i,null)})},!0)}isNeedRecalculate(){return!!this.rowHeightsMap.getValues().slice(0,this.measuredRows).filter(e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function C7(t){const e={from:0,to:this.hot.countCols()-1};t.forEach(n=>{this.samplesGenerator.generateRowSamples(n,e).forEach((i,o)=>this.ghostTable.addRow(o,i))}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((n,r)=>{const i=this.hot.toPhysicalRow(n);this.rowHeightsMap.setValueAtIndex(i,r)})},!0),this.ghostTable.clean())}function y7(){this.calculateVisibleRowsHeight(),this.inProgress||(io(Do,this,C7).call(this,hm(Jh,this)),sL(Jh,this,[]))}function SA(t,e,n){let r=t;return n&&(this.calculateRowsHeight(e,void 0,!0),r=this.getRowHeight(e)),r}function S7(t,e){e||this.recalculateAllRowsHeight()}function b7(t){const e=t.reduce((n,r)=>{let[i]=r;return n.indexOf(i)===-1&&n.push(i),n},[]);hm(Jh,this).push(...e)}function R7(){this.recalculateAllRowsHeight(),sL(mT,this,!0)}function E7(t){if(!hm(mT,this))return;const e=t.reduce((n,r)=>{var i;const o=(i=r.address)===null||i===void 0?void 0:i.row;if(Number.isInteger(o)){const s=this.hot.toVisualRow(o);n.indexOf(s)===-1&&n.push(s)}return n},[]);hm(Jh,this).push(...e)}const{getListWithInsertedItems:T7,getListWithRemovedItems:_7}=XD("physicallyIndexed");class M7 extends Rl{constructor(){super(e=>e)}insert(e,n){const r=bE(this.indexedValues,n);this.indexedValues=T7(r,e,n,this.initValueOrFn),super.insert(e,n)}remove(e){const n=_7(this.indexedValues,e);this.indexedValues=SE(n,e),super.remove(e)}}const{getListWithInsertedItems:I7,getListWithRemovedItems:P7}=XD("physicallyIndexed");class O7 extends Rl{constructor(){super(e=>e)}insert(e,n){this.indexedValues=I7(this.indexedValues,e,n,(r,i)=>this.getNextValue(i)),super.insert(e,n)}remove(e){this.indexedValues=P7(this.indexedValues,e),super.remove(e)}getNextValue(e){return Math.max(...this.getValues())+1+e}}function x7(t,e){A7(t,e),e.add(t)}function A7(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function H7(t,e,n){return(e=N7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function N7(t){var e=D7(t,"string");return typeof e=="symbol"?e:e+""}function D7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function k7(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const bA="bindRowsWithHeaders",L7=210,$7="loose",RA=new Map([["loose",M7],["strict",O7]]);var EA=new WeakSet;class F7 extends et{constructor(){super(...arguments),x7(this,EA),H7(this,"headerIndexes",null)}static get PLUGIN_KEY(){return bA}static get PLUGIN_PRIORITY(){return L7}isEnabled(){return!!this.hot.getSettings()[bA]}enablePlugin(){var e;if(this.enabled)return;const n=(e=RA.get(this.getSetting()))!==null&&e!==void 0?e:RA.get($7);this.headerIndexes=this.hot.rowIndexMapper.registerMap("bindRowsWithHeaders",new n),this.addHook("modifyRowHeader",r=>k7(EA,this,V7).call(this,r)),super.enablePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("bindRowsWithHeaders"),super.disablePlugin()}destroy(){super.destroy()}}function V7(t){return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(t))}function W7(t,e){aL(t,e),e.add(t)}function B7(t,e,n){aL(t,e),e.set(t,n)}function aL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function TA(t,e,n){return(e=j7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function j7(t){var e=U7(t,"string");return typeof e=="symbol"?e:e+""}function U7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function _A(t,e){return t.get(bu(t,e))}function Dy(t,e,n){return t.set(bu(t,e),n),n}function bu(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Ag="collapsibleColumns",z7=290,Y7=["nestedHeaders"],xu="collapsibleIndicator",MA=Ag,IA=new Map([["collapse",{hideColumn:!0,beforeHook:"beforeColumnCollapse",afterHook:"afterColumnCollapse"}],["expand",{hideColumn:!1,beforeHook:"beforeColumnExpand",afterHook:"afterColumnExpand"}]]);var Ul=new WeakMap,Nc=new WeakSet;class G7 extends et{constructor(){super(...arguments),W7(this,Nc),TA(this,"nestedHeadersPlugin",null),TA(this,"headerStateManager",null),B7(this,Ul,null)}static get PLUGIN_KEY(){return Ag}static get PLUGIN_PRIORITY(){return z7}static get PLUGIN_DEPS(){return["plugin:NestedHeaders"]}static get SETTING_KEYS(){return[Ag,...Y7]}isEnabled(){return!!this.hot.getSettings()[Ag]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:n}=this.hot.getSettings();n||tt("You need to configure the Nested Headers plugin in order to use collapsible headers."),Dy(Ul,this,this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding")),this.nestedHeadersPlugin=this.hot.getPlugin("nestedHeaders"),this.headerStateManager=this.nestedHeadersPlugin.getStateManager(),this.addHook("init",()=>bu(Nc,this,X7).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return bu(Nc,e,Z7).call(e,...i)}),this.addHook("afterGetColHeader",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return bu(Nc,e,q7).call(e,...i)}),this.addHook("beforeOnCellMouseDown",(r,i,o)=>bu(Nc,this,K7).call(this,r,i,o)),this.registerShortcuts(),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(this.hot.view){if(!this.nestedHeadersPlugin.detectedOverlappedHeaders){const{collapsibleColumns:e}=this.hot.getSettings();typeof e=="boolean"?this.headerStateManager.mapState(n=>({collapsible:n.origColspan>1})):Array.isArray(e)&&(this.headerStateManager.mapState(()=>({collapsible:!1})),this.headerStateManager.mergeStateWith(e))}super.updatePlugin()}}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),Dy(Ul,this,null),this.nestedHeadersPlugin=null,this.unregisterShortcuts(),this.clearButtons(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{var e;const{row:n,col:r}=this.hot.getSelectedRangeLast().highlight,{collapsible:i,isCollapsed:o,columnIndex:s}=(e=this.headerStateManager.getHeaderTreeNodeData(n,r))!==null&&e!==void 0?e:{};if(i)return o?this.expandSection({row:n,col:s}):this.collapseSection({row:n,col:s}),!1},runOnlyIf:()=>{var e,n;return((e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.isSingle())&&((n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.highlight.isHeader())},group:MA,relativeToGroup:ta,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(MA)}clearButtons(){if(!this.hot.view)return;const e=this.hot.view._wt.getSetting("columnHeaders").length,n=this.hot.view._wt.wtTable.THEAD,r=this.hot.view._wt.wtOverlays.topOverlay.clone.wtTable.THEAD,i=this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay?this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null,o=function(s){s&&s.parentNode.removeChild(s)};fe(0,e-1,s=>{const a=n.childNodes[s],l=r.childNodes[s],u=i?i.childNodes[s]:null;fe(0,a.childNodes.length-1,c=>{let h=a.childNodes[c].querySelector(`.${xu}`);o(h),l&&l.childNodes[c]&&(h=l.childNodes[c].querySelector(`.${xu}`),o(h)),i&&u&&u.childNodes[c]&&(h=u.childNodes[c].querySelector(`.${xu}`),o(h))})})}expandSection(e){this.toggleCollapsibleSection([e],"expand")}collapseSection(e){this.toggleCollapsibleSection([e],"collapse")}toggleAllCollapsibleSections(e){const n=this.headerStateManager.mapNodes(r=>{const{collapsible:i,origColspan:o,headerLevel:s,columnIndex:a,isCollapsed:l}=r;if(i===!0&&o>1&&(l&&e==="expand"||!l&&e==="collapse"))return{row:this.headerStateManager.levelToRowCoords(s),col:a}});this.toggleCollapsibleSection(n,e)}collapseAll(){this.toggleAllCollapsibleSections("collapse")}expandAll(){this.toggleAllCollapsibleSections("expand")}toggleCollapsibleSection(e,n){if(!IA.has(n))throw new Error(`Unsupported action is passed (${n}).`);if(!Array.isArray(e))return;const r=ol(e,f=>{let{row:m}=f;return m<0});let i=r.length>0;H(r,f=>{var m;let{row:C,col:y}=f;const{collapsible:E,isCollapsed:v}=(m=this.headerStateManager.getHeaderSettings(C,y))!==null&&m!==void 0?m:{};if(!E||v&&n==="collapse"||!v&&n==="expand")return i=!1,!1});const o=[],s=[];i&&H(r,f=>{let{row:m,col:C}=f;const{colspanCompensation:y,affectedColumns:E,rollbackModification:v}=this.headerStateManager.triggerNodeModification(n,m,C);y>0&&(s.push(...E),o.push(v))});const a=this.getCollapsedColumns();let l=[];n==="collapse"?l=qU([...a,...s]):n==="expand"&&(l=ol(a,f=>!s.includes(f)));const u=IA.get(n);if(this.hot.runHooks(u.beforeHook,a,l,i)===!1){H(o,f=>{f()});return}this.hot.batchExecution(()=>{H(s,f=>{_A(Ul,this).setValueAtIndex(this.hot.toPhysicalColumn(f),u.hideColumn)})},!0);const h=this.getCollapsedColumns().length!==a.length,d=this.hot.getSelectedRangeLast();if(n==="collapse"&&h&&d){const{row:f,col:m}=d.highlight;if((this.hot.rowIndexMapper.isHidden(f)||this.hot.columnIndexMapper.isHidden(m))&&s.includes(m)){const y=f>=0?this.hot.rowIndexMapper.getNearestNotHiddenIndex(f,1,!0):f,E=m>=0?this.hot.columnIndexMapper.getNearestNotHiddenIndex(m,1,!0):m;y!==null&&E!==null&&this.hot.selectCell(y,E)}}this.hot.runHooks(u.afterHook,a,l,i,h),this.hot.render(),this.hot.view.adjustElementsSize()}getCollapsedColumns(){return _A(Ul,this).getHiddenIndexes()}destroy(){Dy(Ul,this,null),super.destroy()}}function q7(t,e,n){var r;const{collapsible:i,origColspan:o,isCollapsed:s}=(r=this.headerStateManager.getHeaderSettings(n,t))!==null&&r!==void 0?r:{},a=i&&o>1&&t>=this.hot.getSettings().fixedColumnsStart,l=this.hot.getSettings().ariaTags;let u=e.querySelector(`.${xu}`);if(Zu(e,[Xr("")[0]]),a)u||(u=this.hot.rootDocument.createElement("div"),X(u,xu),e.querySelector("div:first-child").appendChild(u)),we(u,["collapsed","expanded"]),s?(X(u,"collapsed"),al(u,"+"),l&&Re(e,...Xr(!1))):(X(u,"expanded"),al(u,"-"),l&&Re(e,...Xr(!0))),l&&Re(u,...bl());else{var c;(c=u)===null||c===void 0||c.remove()}}function K7(t,e){ye(t.target,xu)&&(ye(t.target,"expanded")?(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"collapse")):ye(t.target,"collapsed")&&(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"expand")),Pi(t))}function X7(){this.updatePlugin()}function Z7(t,e){e||this.updatePlugin()}function ya(t,e,n){return(e=J7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function J7(t){var e=Q7(t,"string");return typeof e=="symbol"?e:e+""}function Q7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const e5=["sortEmptyCells","indicator","headerAction","compareFunctionFactory"],t5=!1,n5=!0,r5=!0;class i5{constructor(e,n){ya(this,"hot",void 0),ya(this,"sortingStates",new gp),ya(this,"sortEmptyCells",t5),ya(this,"indicator",n5),ya(this,"headerAction",r5),ya(this,"compareFunctionFactory",void 0),ya(this,"mapName",void 0),this.hot=e,this.mapName=n,this.hot.columnIndexMapper.registerMap(n,this.sortingStates)}updateAllColumnsProperties(e){De(e)&&ke(e,(n,r)=>{e5.includes(r)&&(this[r]=n)})}getAllColumnsProperties(){const e={sortEmptyCells:this.sortEmptyCells,indicator:this.indicator,headerAction:this.headerAction};return typeof this.compareFunctionFactory=="function"&&(e.compareFunctionFactory=this.compareFunctionFactory),e}getSortOrderOfColumn(e){var n;return(n=this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))===null||n===void 0?void 0:n.sortOrder}getIndexOfColumnInSortQueue(e){return e=this.hot.toPhysicalColumn(e),this.sortingStates.getEntries().findIndex(n=>{let[r]=n;return r===e})}getNumberOfSortedColumns(){return this.sortingStates.getLength()}isListOfSortedColumnsEmpty(){return this.getNumberOfSortedColumns()===0}isColumnSorted(e){return De(this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))}getSortStates(){return this.sortingStates===null?[]:this.sortingStates.getEntries().map(n=>{let[r,i]=n;return{column:this.hot.toVisualColumn(r),...i}})}getColumnSortState(e){const n=this.getSortOrderOfColumn(e);if(ue(n))return{column:e,sortOrder:n}}setSortStates(e){this.sortingStates.clear();for(let n=0;n<e.length;n+=1)this.sortingStates.setValueAtIndex(this.hot.toPhysicalColumn(e[n].column),{sortOrder:e[n].sortOrder})}destroy(){this.hot.columnIndexMapper.unregisterMap(this.mapName),this.sortingStates=null}}function lL(t,e,n){const r=e.locale;return function(i,o){const{sortEmptyCells:s}=n;return typeof i=="string"&&(i=i.toLocaleLowerCase(r)),typeof o=="string"&&(o=o.toLocaleLowerCase(r)),i===o?co:Yt(i)?Yt(o)?co:s&&t==="asc"?$t:Ft:Yt(o)?s&&t==="asc"?Ft:$t:isNaN(i)&&!isNaN(o)?t==="asc"?Ft:$t:!isNaN(i)&&isNaN(o)||(isNaN(i)||isNaN(o)||(i=parseFloat(i),o=parseFloat(o)),i<o)?t==="asc"?$t:Ft:i>o?t==="asc"?Ft:$t:co}}const uL="default";function o5(t,e,n){return function(r,i){const o=parseFloat(r),s=parseFloat(i),{sortEmptyCells:a}=n;if(o===s||isNaN(o)&&isNaN(s))return co;if(a){if(Yt(r))return t==="asc"?$t:Ft;if(Yt(i))return t==="asc"?Ft:$t}return isNaN(o)?Ft:isNaN(s)?$t:o<s?t==="asc"?$t:Ft:o>s?t==="asc"?Ft:$t:co}}const s5="numeric";function a5(t,e,n){const r=e.checkedTemplate,i=e.uncheckedTemplate,{sortEmptyCells:o}=n;return function(s,a){const l=Yt(s),u=Yt(a),c=l?i:s,h=u?i:a,d=c===i||c===r,f=h===i||h===r;if(o===!1){if(l&&u===!1)return Ft;if(l===!1&&u)return $t}return d===!1&&f?t==="asc"?$t:Ft:d&&f===!1?t==="asc"?Ft:$t:d===!1&&f===!1?lL(t,e,n)(s,a):c===i&&h===r?t==="asc"?$t:Ft:c===r&&h===i?t==="asc"?Ft:$t:co}}const l5="checkbox";function u5(t,e,n){return mL(t,e.dateFormat,n)}const c5="date";function h5(t,e,n){return mL(t,e.timeFormat,n)}const d5="time",{register:Pd,getItem:PA,hasItem:f5}=Oi("sorting.compareFunctionFactory"),{register:cL,getItem:g5}=Oi("sorting.mainSortComparator");function hL(t){return f5(t)?PA(t):PA(uL)}Pd(l5,a5);Pd(c5,u5);Pd(uL,lL);Pd(s5,o5);Pd(d5,h5);const co=0,$t=-1,Ft=1;function m5(t,e){const n=g5(e);for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];t.sort(n(...i))}const dm="asc",fm="desc",dL="colHeader";function p5(t){if(De(t)===!1)return!1;const{column:e,sortOrder:n}=t;return Number.isInteger(e)&&[dm,fm].includes(n)}function w5(t){if(t.some(n=>p5(n)===!1))return!1;const e=t.map(n=>{let{column:r}=n;return r});return new Set(e).size===e.length}function OA(t){if(t!==fm)return t===dm?fm:dm}function fL(t){return t.querySelector(`.${dL}`)}function gL(t,e){if(t<0||!e.parentNode)return!1;const n=e.parentNode.parentNode.childNodes;return Array.from(n).indexOf(e.parentNode)-n.length===-1}function pT(t,e,n){return t===-1&&e>=0&&ll(n)===!1}function mL(t,e,n){return function(r,i){const{sortEmptyCells:o}=n;if(r===i)return co;if(Yt(r))return Yt(i)?co:o&&t==="asc"?$t:Ft;if(Yt(i))return o&&t==="asc"?Ft:$t;const s=Z(r,e),a=Z(i,e);return s.isValid()?a.isValid()?a.isAfter(s)?t==="asc"?$t:Ft:a.isBefore(s)?t==="asc"?Ft:$t:co:$t:Ft}}function v5(t,e){tt(st`Plugins \`columnSorting\` and \`multiColumnSorting\` should not be enabled simultaneously.\x20
270
- Only \`${t}\` will work. The \`${e}\` plugin will remain disabled.`)}const C5="ascending",y5="descending",pL="indicatorDisabled",wL="columnSorting",vL="sortAction",CL=new Map([[dm,C5],[fm,y5]]);function S5(t,e,n,r){const i=[wL];if(r&&i.push(vL),n===!1)return i.push(pL),i;const o=t.getSortOrderOfColumn(e);return ue(o)&&i.push(CL.get(o)),i}function b5(){return Array.from(CL.values()).concat(vL,pL,wL)}function R5(t,e){return function(n,r){const[,...i]=n,[,...o]=r;return(function(a){const l=t[a],u=e[a],c=i[a],h=o[a],d=u.columnSorting;return(d.compareFunctionFactory?d.compareFunctionFactory:hL(u.type))(l,u,d)(c,h)})(0)}}function E5(t,e){T5(t,e),e.add(t)}function T5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _f(t,e,n){return(e=_5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _5(t){var e=M5(t,"string");return typeof e=="symbol"?e:e+""}function M5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pu(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const gm="columnSorting",I5=50,mm="append",P5="replace",xA=gm;cL(gm,R5);ie.getSingleton().register("beforeColumnSort");ie.getSingleton().register("afterColumnSort");const Dc=new WeakMap;var za=new WeakSet;class yL extends et{constructor(){super(...arguments),E5(this,za),_f(this,"columnStatesManager",null),_f(this,"columnMetaCache",null),_f(this,"pluginKey",gm),_f(this,"indexesSequenceCache",null)}static get PLUGIN_KEY(){return gm}static get PLUGIN_PRIORITY(){return I5}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){var e=this;if(Dc.has(this.hot)&&Dc.get(this.hot)!==this.pluginKey){this.hot.updateSettings({[this.pluginKey]:!1}),v5(Dc.get(this.hot),this.pluginKey);return}this.enabled||(Dc.set(this.hot,this.pluginKey),this.columnStatesManager=new i5(this.hot,`${this.pluginKey}.sortingStates`),this.columnMetaCache=new ea(n=>{let r=this.hot.toVisualColumn(n);return r===null&&(r=n),this.getMergedPluginSettings(r)}),this.hot.columnIndexMapper.registerMap(`${this.pluginKey}.columnMeta`,this.columnMetaCache),this.addHook("afterGetColHeader",(n,r)=>pu(za,this,O5).call(this,n,r)),this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pu(za,e,A5).call(e,...r)}),this.addHook("afterOnCellMouseDown",(n,r)=>this.onAfterOnCellMouseDown(n,r)),this.addHook("afterInit",()=>pu(za,this,xb).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pu(za,e,x5).call(e,...r)}),this.hot.view&&pu(za,this,xb).call(this),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){const e=(n,r)=>{const i=fL(r);gL(n,r)===!1||i===null||this.updateHeaderClasses(i)};Dc.delete(this.hot),this.hot.addHook("afterGetColHeader",e),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("afterGetColHeader",e)}),this.hot.batchExecution(()=>{this.indexesSequenceCache!==null&&(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginKey),this.indexesSequenceCache=null)},!0),this.hot.columnIndexMapper.unregisterMap(`${this.pluginKey}.columnMeta`),this.columnStatesManager.destroy(),this.columnMetaCache=null,this.columnStatesManager=null,this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();return this.sort(this.getColumnNextConfig(e.col)),!1},runOnlyIf:()=>{var e,n;const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r&&((n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingle())&&this.hot.selection.isCellVisible(r)&&r.row===-1&&r.col>=0},relativeToGroup:ta,position:"before",group:xA})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(xA)}sort(e){const n=this.getSortConfig(),r=this.getNormalizedSortConfigs(e),i=this.areValidSortConfigs(r);this.hot.runHooks("beforeColumnSort",n,r,i)!==!1&&(n.length===0&&this.indexesSequenceCache===null&&(this.indexesSequenceCache=this.hot.rowIndexMapper.registerMap(this.pluginKey,new ZD),this.indexesSequenceCache.setValues(this.hot.rowIndexMapper.getIndexesSequence())),i&&(this.columnStatesManager.setSortStates(r),this.sortByPresetSortStates(r),this.saveAllSortSettings(r)),this.hot.runHooks("afterColumnSort",n,i?r:n,i),i&&this.hot.render())}clearSort(){this.sort([])}isSorted(){return this.enabled&&!this.columnStatesManager.isListOfSortedColumnsEmpty()}getSortConfig(e){return ue(e)?this.columnStatesManager.getColumnSortState(e):this.columnStatesManager.getSortStates()}setSortConfig(e){const n=this.getNormalizedSortConfigs(e);this.areValidSortConfigs(n)&&this.columnStatesManager.setSortStates(n)}getNormalizedSortConfigs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Array.isArray(e)?e.slice(0,1):[e]}areValidSortConfigs(e){const n=this.hot.countCols();return w5(e)&&e.every(r=>{let{column:i}=r;return i<=n&&i>=0})}saveAllSortSettings(e){const n=this.columnStatesManager.getAllColumnsProperties(),r=i=>{let{column:o,...s}=i;return{column:this.hot.toPhysicalColumn(o),...s}};n.initialConfig=ze(e,r),this.hot.runHooks("persistentStateSave","columnSorting",n)}getAllSavedSortSettings(){const e={};this.hot.runHooks("persistentStateLoad","columnSorting",e);const n=e.value,r=i=>{let{column:o,...s}=i;return{column:this.hot.toVisualColumn(o),...s}};return ue(n)&&Array.isArray(n.initialConfig)&&(n.initialConfig=ze(n.initialConfig,r)),n}getColumnNextConfig(e){const n=this.columnStatesManager.getSortOrderOfColumn(e);if(ue(n)){const i=OA(n);return ue(i)?{column:e,sortOrder:i}:void 0}const r=this.hot.countCols();if(Number.isInteger(e)&&e>=0&&e<r)return{column:e,sortOrder:OA()}}getNextSortConfig(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mm;const r=this.columnStatesManager.getIndexOfColumnInSortQueue(e),i=r!==-1,o=this.getSortConfig(),s=this.getColumnNextConfig(e);if(i){if(xt(s))return[...o.slice(0,r),...o.slice(r+1)];if(n===mm)return[...o.slice(0,r),...o.slice(r+1),s];if(n===P5)return[...o.slice(0,r),s,...o.slice(r+1)]}return ue(s)?o.concat(s):o}getPluginColumnConfig(e){if(De(e)){const n=e[this.pluginKey];if(De(n))return n}return{}}getMergedPluginSettings(e){const n=this.hot.getSettings()[this.pluginKey],r=this.columnStatesManager.getAllColumnsProperties(),i=this.hot.getCellMeta(0,e),o=Object.getPrototypeOf(i);return Array.isArray(o.columns)?Object.assign(r,n,this.getPluginColumnConfig(o.columns[e])):ut(o.columns)?Object.assign(r,n,this.getPluginColumnConfig(o.columns(e))):Object.assign(r,n)}getFirstCellSettings(e){const n=this.hot.getCellMeta(0,e),r=Object.create(n);return r[this.pluginKey]=this.columnMetaCache.getValueAtIndex(this.hot.toPhysicalColumn(e)),r}getNumberOfRowsToSort(e){const n=this.hot.getSettings();return n.maxRows<=e?n.maxRows:e-n.minSpareRows}sortByPresetSortStates(e){if(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),e.length===0)return;const n=[],r=this.hot.countRows(),i=u=>ze(e,c=>this.hot.getDataAtCell(u,c.column));for(let u=0;u<this.getNumberOfRowsToSort(r);u+=1)n.push([this.hot.toPhysicalRow(u)].concat(i(u)));const o=ze(n,u=>u[0]);m5(n,this.pluginKey,ze(e,u=>u.sortOrder),ze(e,u=>this.getFirstCellSettings(u.column)));for(let u=n.length;u<r;u+=1)n.push([u].concat(i(u)));const s=ze(n,u=>u[0]),a=new Map(ze(o,(u,c)=>[u,s[c]])),l=ze(this.hot.rowIndexMapper.getIndexesSequence(),u=>a.has(u)?a.get(u):u);this.hot.rowIndexMapper.setIndexesSequence(l)}sortBySettings(e){if(De(e)){this.columnStatesManager.updateAllColumnsProperties(e);const n=e.initialConfig;(Array.isArray(n)||De(n))&&this.sort(n)}else this.hot.render()}updateHeaderClasses(e){if(we(e,b5()),this.enabled!==!1){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];X(e,S5(...r))}}onUpdateSettings(e){super.onUpdateSettings(e),this.columnMetaCache!==null&&this.columnMetaCache.init(this.hot.columnIndexMapper.getNumberOfIndexes()),ue(e[this.pluginKey])&&this.sortBySettings(e[this.pluginKey])}wasClickableHeaderClicked(e,n){return this.getFirstCellSettings(n)[this.pluginKey].headerAction&&ye(e.target,dL)}onAfterOnCellMouseDown(e,n){if(pT(n.row,n.col,e)!==!1&&this.wasClickableHeaderClicked(e,n.col)){this.hot.getShortcutManager().isCtrlPressed()&&(this.hot.deselectCell(),this.hot.selectColumns(n.col));const r=this.hot.getActiveEditor(),i=this.getColumnNextConfig(n.col);r!=null&&r.isOpened()&&this.hot.getCellValidator(r.row,r.col)?this.hot.addHookOnce("postAfterValidate",()=>{this.sort(i)}):this.sort(i)}}destroy(){var e;(e=this.columnStatesManager)===null||e===void 0||e.destroy(),super.destroy()}}function xb(){const t=this.getAllSavedSortSettings();if(De(t))this.sortBySettings(t);else{const e=this.hot.getSettings()[this.pluginKey];this.sortBySettings(e)}}function O5(t,e){const n=fL(e);if(gL(t,e)===!1||n===null)return;const r=this.getFirstCellSettings(t)[this.pluginKey],i=r.indicator,o=r.headerAction;if(this.updateHeaderClasses(n,this.columnStatesManager,t,i,o),this.hot.getSettings().ariaTags){const s=this.columnStatesManager.getSortOrderOfColumn(t);Re(e,...mz(s?`${s}ending`:"none"))}}function x5(t){t===!0&&this.hot.view&&pu(za,this,xb).call(this)}function A5(t,e,n,r){pT(e.row,e.col,t)!==!1&&this.wasClickableHeaderClicked(t,e.col)&&this.hot.getShortcutManager().isCtrlPressed()&&(r.column=!0)}function Sa(t,e,n){return(e=H5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function H5(t){var e=N5(t,"string");return typeof e=="symbol"?e:e+""}function N5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class D5{constructor(e,n){Sa(this,"plugin",void 0),Sa(this,"hot",void 0),Sa(this,"endpoints",[]),Sa(this,"settings",void 0),Sa(this,"settingsType","array"),Sa(this,"currentEndpoint",null),Sa(this,"cellsToSetCache",[]),this.plugin=e,this.hot=this.plugin.hot,this.settings=n}initEndpoints(){this.endpoints=this.parseSettings(),this.refreshAllEndpoints()}getEndpoint(e){return this.settingsType==="function"?this.fillMissingEndpointData(this.settings)[e]:this.endpoints[e]}getAllEndpoints(){return this.settingsType==="function"?this.fillMissingEndpointData(this.settings):this.endpoints}fillMissingEndpointData(e){return this.parseSettings(e.call(this))}parseSettings(e){const n=[];let r=e;if(!r&&typeof this.settings=="function"){this.settingsType="function";return}return r||(r=this.settings),H(r,i=>{const o={};this.assignSetting(i,o,"ranges",[[0,this.hot.countRows()-1]]),this.assignSetting(i,o,"reversedRowCoords",!1),this.assignSetting(i,o,"destinationRow",new Error(`
271
- You must provide a destination row for the Column Summary plugin in order to work properly!
272
- `)),this.assignSetting(i,o,"destinationColumn",new Error(`
273
- You must provide a destination column for the Column Summary plugin in order to work properly!
274
- `)),this.assignSetting(i,o,"sourceColumn",i.destinationColumn),this.assignSetting(i,o,"type","sum"),this.assignSetting(i,o,"forceNumeric",!1),this.assignSetting(i,o,"suppressDataTypeErrors",!0),this.assignSetting(i,o,"customFunction",null),this.assignSetting(i,o,"readOnly",!0),this.assignSetting(i,o,"roundFloat",!1),n.push(o)}),n}assignSetting(e,n,r,i){if(r==="ranges"&&e[r]===void 0){n[r]=i;return}else if(r==="ranges"&&e[r].length===0)return;if(e[r]===void 0){if(i instanceof Error)throw i;n[r]=i}else r==="destinationRow"&&n.reversedRowCoords?n[r]=this.hot.countRows()-e[r]-1:n[r]=e[r]}resetSetupBeforeStructureAlteration(e,n,r){if(this.settingsType!=="function")return;const i=e.indexOf("row")>-1?"row":"col",o=this.getAllEndpoints();H(o,s=>{i==="row"&&s.destinationRow>=n&&(e==="insert_row"?s.alterRowOffset=r:e==="remove_row"&&(s.alterRowOffset=-1*r)),i==="col"&&s.destinationColumn>=n&&(e==="insert_col"?s.alterColumnOffset=r:e==="remove_col"&&(s.alterColumnOffset=-1*r))}),this.resetAllEndpoints(o,!1)}resetSetupAfterStructureAlteration(e,n,r,i,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;if(this.settingsType==="function"){const d=()=>(this.hot.removeHook("beforeViewRender",d),this.refreshAllEndpoints());this.hot.addHookOnce("beforeViewRender",d);return}const a=e.indexOf("row")>-1?"row":"col",l=e.indexOf("remove")>-1?-1:1,u=this.getAllEndpoints(),c=e.indexOf("move_row")===0,h=n;H(u,d=>{a==="row"&&d.destinationRow>=h&&(d.alterRowOffset=l*r),a==="col"&&d.destinationColumn>=h&&(d.alterColumnOffset=l*r)}),this.resetAllEndpoints(u,!c),c?H(u,d=>{this.extendEndpointRanges(d,h,i[0],i.length),this.recreatePhysicalRanges(d),this.clearOffsetInformation(d)}):H(u,d=>{this.shiftEndpointCoordinates(d,h)}),s&&this.refreshAllEndpoints()}clearOffsetInformation(e){e.alterRowOffset=void 0,e.alterColumnOffset=void 0}extendEndpointRanges(e,n,r,i){H(e.ranges,o=>{o[1]&&(n>=o[0]&&n<=o[1]?r>o[1]?o[1]+=i:r<o[0]&&(o[0]-=i):r>=o[0]&&r<=o[1]&&(o[1]-=i,n<=o[0]&&(o[0]+=1,o[1]+=1)))})}recreatePhysicalRanges(e){const n=e.ranges,r=[],i=[];H(n,o=>{const s=[];if(o[1])for(let a=o[0];a<=o[1];a++)s.push(this.hot.toPhysicalRow(a));else s.push(this.hot.toPhysicalRow(o[0]));i.push(s)}),H(i,o=>{let s=[];H(o,(a,l)=>{l===0?s.push(a):o[l]!==o[l-1]+1&&(s.push(o[l-1]),r.push(s),s=[],s.push(a)),l===o.length-1&&(s.push(a),r.push(s))})}),e.ranges=r}shiftEndpointCoordinates(e,n){e.alterRowOffset&&e.alterRowOffset!==0?(e.destinationRow+=e.alterRowOffset||0,H(e.ranges,r=>{H(r,(i,o)=>{i>=n&&(r[o]+=e.alterRowOffset||0)})})):e.alterColumnOffset&&e.alterColumnOffset!==0&&(e.destinationColumn+=e.alterColumnOffset||0,e.sourceColumn+=e.alterColumnOffset||0)}resetAllEndpoints(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getAllEndpoints(),n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;e.some(i=>{const o=i.alterRowOffset||0,s=i.alterColumnOffset||0;return i.destinationRow+o>=this.hot.countRows()||i.destinationColumn+s>=this.hot.countCols()})||(this.cellsToSetCache=[],H(e,i=>{this.resetEndpointValue(i,n)}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[])}refreshAllEndpoints(){this.cellsToSetCache=[],H(this.getAllEndpoints(),e=>{this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e,"init")}),this.currentEndpoint=null,this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshChangedEndpoints(e){const n=[];this.cellsToSetCache=[],H(e,(r,i,o)=>{`${r[2]||""}`!=`${r[3]}`&&H(this.getAllEndpoints(),(s,a)=>{this.hot.propToCol(o[i][1])===s.sourceColumn&&n.indexOf(a)===-1&&n.push(a)})}),H(n,r=>{this.refreshEndpoint(this.getEndpoint(r))}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshCellMetas(){this.endpoints.forEach(e=>{const n=this.hot.toVisualRow(e.destinationRow);if(n!==null){const r=this.hot.getCellMeta(n,e.destinationColumn);r.readOnly=e.readOnly,r.className="columnSummaryResult"}})}refreshEndpoint(e){this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e),this.currentEndpoint=null}resetEndpointValue(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const r=e.alterRowOffset||0,i=e.alterColumnOffset||0;this.cellsToSetCache.push([this.hot.toVisualRow(e.destinationRow+(n?r:0)),this.hot.toVisualColumn(e.destinationColumn+(n?i:0)),""])}setEndpointValue(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=this.hot.toVisualRow(e.destinationRow);if(e.destinationRow>=this.hot.countRows()||e.destinationColumn>=this.hot.countCols()){this.throwOutOfBoundsWarning();return}const o=this.hot.toVisualRow(e.destinationRow);if(o!==null){const s=this.hot.getCellMeta(o,e.destinationColumn);(n==="init"||s.readOnly!==e.readOnly)&&(s.readOnly=e.readOnly,s.className="columnSummaryResult")}if((e.roundFloat===!0||Number.isInteger(e.roundFloat))&&!isNaN(e.result)){const s=e.roundFloat;let a=0;Number.isInteger(s)&&(a=Math.min(Math.max(0,s),100)),e.result=e.result.toFixed(a)}r?this.hot.setDataAtCell(i,e.destinationColumn,e.result,"ColumnSummary.set"):this.cellsToSetCache.push([i,e.destinationColumn,e.result]),e.alterRowOffset=void 0,e.alterColumnOffset=void 0}throwOutOfBoundsWarning(){tt("One of the Column Summary plugins' destination points you provided is beyond the table boundaries!")}}function ky(t){return t==null||isNaN(t)}function k5(t,e){L5(t,e),e.add(t)}function L5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $5(t,e,n){return(e=F5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function F5(t){var e=V5(t,"string");return typeof e=="symbol"?e:e+""}function V5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Mf(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Ly="columnSummary",W5=220;var kc=new WeakSet;class B5 extends et{constructor(){super(...arguments),k5(this,kc),$5(this,"endpoints",null)}static get PLUGIN_KEY(){return Ly}static get PLUGIN_PRIORITY(){return W5}isEnabled(){return!!this.hot.getSettings()[Ly]}enablePlugin(){var e=this;this.enabled||(this.settings=this.hot.getSettings()[Ly],this.endpoints=new D5(this,this.settings),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Mf(kc,e,j5).call(e,...r)}),this.addHook("afterChange",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Mf(kc,e,z5).call(e,...r)}),this.addHook("afterUpdateSettings",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Mf(kc,e,U5).call(e,...r)}),this.addHook("beforeCreateRow",(n,r,i)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_row",n,r,null,i)),this.addHook("beforeCreateCol",(n,r,i)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_col",n,r,null,i)),this.addHook("beforeRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.endpoints.resetSetupBeforeStructureAlteration("remove_row",...r)}),this.addHook("beforeRemoveCol",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.endpoints.resetSetupBeforeStructureAlteration("remove_col",...r)}),this.addHook("afterCreateRow",(n,r,i)=>this.endpoints.resetSetupAfterStructureAlteration("insert_row",n,r,null,i)),this.addHook("afterCreateCol",(n,r,i)=>this.endpoints.resetSetupAfterStructureAlteration("insert_col",n,r,null,i)),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.endpoints.resetSetupAfterStructureAlteration("remove_row",...r)}),this.addHook("afterRemoveCol",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.endpoints.resetSetupAfterStructureAlteration("remove_col",...r)}),this.addHook("afterRowMove",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Mf(kc,e,Y5).call(e,...r)}),super.enablePlugin())}disablePlugin(){this.endpoints=null,this.settings=null,this.currentEndpoint=null,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.endpoints.initEndpoints(),super.updatePlugin()}calculate(e){switch(e.type.toLowerCase()){case"sum":e.result=this.calculateSum(e);break;case"min":e.result=this.calculateMinMax(e,e.type);break;case"max":e.result=this.calculateMinMax(e,e.type);break;case"count":e.result=this.countEntries(e);break;case"average":e.result=this.calculateAverage(e);break;case"custom":e.result=e.customFunction.call(this,e);break}}calculateSum(e){let n=0;return ke(e.ranges,r=>{n+=this.getPartialSum(r,e.sourceColumn)}),n}getPartialSum(e,n){let r=0,i=e[1]||e[0],o=null,s=0;do{if(o=this.getCellValue(i,n),o=ky(o)?null:o,o!==null){const a=(`${o}`.split(".")[1]||[]).length||1;a>s&&(s=a)}r+=o||0,i-=1}while(i>=e[0]);return Math.round(r*10**s)/10**s}calculateMinMax(e,n){let r=null;return ke(e.ranges,i=>{const o=this.getPartialMinMax(i,e.sourceColumn,n);if(r===null&&o!==null&&(r=o),o!==null)switch(n){case"min":r=Math.min(r,o);break;case"max":r=Math.max(r,o);break}}),r===null?"Not enough data":r}getPartialMinMax(e,n,r){let i=null,o=e[1]||e[0],s;do{if(s=this.getCellValue(o,n),s=ky(s)?null:s,i===null)i=s;else if(s!==null)switch(r){case"min":i=Math.min(i,s);break;case"max":i=Math.max(i,s);break}o-=1}while(o>=e[0]);return i}countEmpty(e,n){let r,i=0,o=e[1]||e[0];do r=this.getCellValue(o,n),r=ky(r)?null:r,r===null&&(i+=1),o-=1;while(o>=e[0]);return i}countEntries(e){let n=0;const r=e.ranges;return ke(r,i=>{const o=i[1]===void 0?1:i[1]-i[0]+1,s=this.countEmpty(i,e.sourceColumn);n+=o,n-=s}),n}calculateAverage(e){const n=this.calculateSum(e),r=this.countEntries(e);return n/r}getCellValue(e,n){const r=this.hot.toVisualRow(e),i=this.hot.toVisualColumn(n);let o=this.hot.getSourceDataAtCell(e,n),s="";if(r!==null&&i!==null&&(s=this.hot.getCellMeta(r,i).className||""),s.indexOf("columnSummaryResult")>-1)return null;if(this.endpoints.currentEndpoint.forceNumeric&&(typeof o=="string"&&(o=o.replace(/,/,".")),o=parseFloat(o)),isNaN(o)&&!this.endpoints.currentEndpoint.suppressDataTypeErrors)throw new Error(st`ColumnSummary plugin: cell at (${e}, ${n}) is not in a\x20
275
- numeric format. Cannot do the calculation.`);return o}}function j5(){this.endpoints.initEndpoints()}function U5(t){t.columns!==void 0&&this.endpoints.refreshCellMetas()}function z5(t,e){t&&e!=="ColumnSummary.reset"&&e!=="ColumnSummary.set"&&e!=="loadData"&&this.endpoints.refreshChangedEndpoints(t)}function Y5(t,e){this.endpoints.resetSetupBeforeStructureAlteration("move_row",t[0],t.length,t,this.pluginName),this.endpoints.resetSetupAfterStructureAlteration("move_row",e,t.length,t,this.pluginName)}function G5(t,e){SL(t,e),e.add(t)}function $y(t,e,n){SL(t,e),e.set(t,n)}function SL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wu(t,e){return t.get(wT(t,e))}function Ab(t,e,n){return t.set(wT(t,e),n),n}function wT(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var pm=new WeakMap,If=new WeakMap,Pf=new WeakMap,AA=new WeakSet;class bL{constructor(){G5(this,AA),$y(this,pm,!0),$y(this,If,null),$y(this,Pf,new ResizeObserver(e=>wT(AA,this,q5).call(this,e)))}setObservedElement(e){Ab(If,this,e)}unobserve(){wu(Pf,this).unobserve(wu(If,this))}observe(){Ab(pm,this,!0),wu(Pf,this).observe(wu(If,this))}destroy(){wu(Pf,this).disconnect()}}function q5(t){if(wu(pm,this)||!Array.isArray(t)||!t.length){Ab(pm,this,!1);return}t.forEach(e=>{let{borderBoxSize:n}=e;const{inlineSize:r,blockSize:i}=n[0];this.runLocalHooks("resize",r,i)})}gt(bL,En);function ba(t,e,n){K5(t,e),e.set(t,n)}function K5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function dt(t,e){return t.get(RL(t,e))}function Po(t,e,n){return t.set(RL(t,e),n),n}function RL(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Ra=new WeakMap,Fy=new WeakMap,Oo=new WeakMap,ms=new WeakMap,ps=new WeakMap,Of=new WeakMap,zl=new WeakMap;class Ja{static get CLASS_EDITOR_CONTAINER(){return"htCommentsContainer"}static get CLASS_EDITOR(){return"htComments"}static get CLASS_INPUT(){return"htCommentTextArea"}static get CLASS_CELL(){return"htCommentCell"}constructor(e,n){var r=this;ba(this,Ra,void 0),ba(this,Fy,!1),ba(this,Oo,null),ba(this,ms,void 0),ba(this,ps,void 0),ba(this,Of,!0),ba(this,zl,new bL),Po(Ra,this,e),Po(Fy,this,n),Po(ms,this,this.createEditor()),Po(ps,this,dt(ms,this).style),dt(zl,this).setObservedElement(this.getInputElement()),dt(zl,this).addLocalHook("resize",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("resize",...o)}),this.hide()}setPosition(e,n){dt(ps,this).left=`${e}px`,dt(ps,this).top=`${n}px`}setSize(e,n){if(e&&n){const r=this.getInputElement();r.style.width=`${e}px`,r.style.height=`${n}px`}}getSize(){return{width:Xt(this.getInputElement()),height:an(this.getInputElement())}}observeSize(){dt(zl,this).observe()}resetSize(){const e=this.getInputElement();e.style.width="",e.style.height=""}setReadOnlyState(e){const n=this.getInputElement();n.readOnly=e}show(){dt(ps,this).display="block",Po(Of,this,!1)}hide(){dt(zl,this).unobserve(),dt(Of,this)||(dt(ps,this).display="none"),Po(Of,this,!0)}isVisible(){return dt(ps,this).display==="block"}setValue(){const n=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"")||"";this.getInputElement().value=n}getValue(){return this.getInputElement().value}isFocused(){return dt(Ra,this).activeElement===this.getInputElement()}focus(){this.getInputElement().focus()}createEditor(){const e=dt(Ra,this).createElement("div"),n=dt(Ra,this).createElement("textarea");return e.style.display="none",Po(Oo,this,dt(Ra,this).createElement("div")),dt(Oo,this).setAttribute("dir",dt(Fy,this)?"rtl":"ltr"),X(dt(Oo,this),Ja.CLASS_EDITOR_CONTAINER),dt(Ra,this).body.appendChild(dt(Oo,this)),X(e,Ja.CLASS_EDITOR),X(n,Ja.CLASS_INPUT),n.setAttribute("data-hot-input",!0),e.appendChild(n),dt(Oo,this).appendChild(e),e}getInputElement(){return dt(ms,this).querySelector(`.${Ja.CLASS_INPUT}`)}getEditorElement(){return dt(ms,this)}destroy(){const e=dt(Oo,this)?dt(Oo,this).parentNode:null;dt(ms,this).parentNode.removeChild(dt(ms,this)),Po(ms,this,null),Po(ps,this,null),dt(zl,this).destroy(),e&&e.removeChild(dt(Oo,this))}}gt(Ja,En);function Vy(t,e,n){return(e=X5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function X5(t){var e=Z5(t,"string");return typeof e=="symbol"?e:e+""}function Z5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const J5=250,Q5=250;class EL{constructor(e){Vy(this,"wasLastActionShow",!0),Vy(this,"showDebounced",null),Vy(this,"hidingTimer",null),this.updateDelay(e)}hide(){this.wasLastActionShow=!1,this.hidingTimer=setTimeout(()=>{this.wasLastActionShow===!1&&this.runLocalHooks("hide")},Q5)}show(e){this.wasLastActionShow=!0,this.showDebounced(e)}cancelHiding(){this.wasLastActionShow=!0,clearTimeout(this.hidingTimer),this.hidingTimer=null}updateDelay(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:J5;this.showDebounced=ap(n=>{this.wasLastActionShow&&this.runLocalHooks("show",n.from.row,n.from.col)},e)}destroy(){this.clearLocalHooks()}}gt(EL,En);function eZ(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ","")} ${e}`}function tZ(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ","")} ${e}`}function Ea(t,e){const n={};return H(t,r=>{r.forAll((i,o)=>{i>=0&&o>=0&&(n[i]||(n[i]=[]),n[i][o]=e(i,o))})}),n}function Is(t,e,n,r,i){H(t,o=>{o.forAll((s,a)=>{s>=0&&a>=0&&nZ(s,a,e,n,r,i)})})}function nZ(t,e,n,r,i,o){const s=i(t,e);let a=r;s.className&&(n==="vertical"?a=eZ(s.className,r):a=tZ(s.className,r)),o(t,e,"className",a)}function TL(t){return`<span class="selected">✓</span>${t}`}function Hg(t,e){let n=!1;return Array.isArray(t)&&H(t,r=>(r.forAll((i,o)=>{if(i>=0&&o>=0&&e(i,o))return n=!0,!1}),n)),n}function Ep(t,e){const n={top:0,left:0};if(e!==t.ownerDocument){const{frameElement:r}=e.defaultView,{top:i,left:o}=r.getBoundingClientRect();n.top=i,n.left=o}return n}const Ne="---------";function rZ(){return{name:Ne}}const jr="alignment";function iZ(){return{key:jr,name(){return this.getTranslatedPhrase(GE)},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const t=this.getSelectedRangeLast();return!t||t.isSingleHeader()?!0:!(this.getSelectedRange()&&!this.selection.isSelectedByCorner())},submenu:{items:[{key:`${jr}:left`,name(){return this.getTranslatedPhrase(qE)},callback(){const t=this.getSelectedRange(),e=Ea(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",e,t,n,r),Is(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${jr}:center`,name(){return this.getTranslatedPhrase(KE)},callback(){const t=this.getSelectedRange(),e=Ea(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",e,t,n,r),Is(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${jr}:right`,name(){return this.getTranslatedPhrase(XE)},callback(){const t=this.getSelectedRange(),e=Ea(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htRight";this.runHooks("beforeCellAlignment",e,t,n,r),Is(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${jr}:justify`,name(){return this.getTranslatedPhrase(ZE)},callback(){const t=this.getSelectedRange(),e=Ea(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",e,t,n,r),Is(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{name:Ne},{key:`${jr}:top`,name(){return this.getTranslatedPhrase(JE)},callback(){const t=this.getSelectedRange(),e=Ea(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htTop";this.runHooks("beforeCellAlignment",e,t,n,r),Is(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${jr}:middle`,name(){return this.getTranslatedPhrase(QE)},callback(){const t=this.getSelectedRange(),e=Ea(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",e,t,n,r),Is(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${jr}:bottom`,name(){return this.getTranslatedPhrase(e0)},callback(){const t=this.getSelectedRange(),e=Ea(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htBottom";this.runHooks("beforeCellAlignment",e,t,n,r),Is(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1}]}}}const Tp="clear_column";function oZ(){return{key:Tp,name(){return this.getTranslatedPhrase(HE)},callback(t,e){const n=e[0].start.col,r=e[0].end.col;this.countRows()&&this.populateFromArray(0,n,[[null]],Math.max(e[0].start.row,e[0].end.row),r,"ContextMenu.clearColumn")},disabled(){const t=this.getSelectedRangeLast();if(!t||t.isSingleHeader()&&t.highlight.col<0||!this.selection.isSelectedByColumnHeader())return!0;let e=!1;return t.forAll((n,r)=>{if(n<0||r<0)return!0;const{readOnly:i}=this.getCellMeta(n,r);return i?!0:(e=!0,!1)}),!e}}}const Od="col_left";function sZ(){return{key:Od,name(){return this.getTranslatedPhrase(ME)},callback(){const t=this.getSelectedRangeLast().getTopLeftCorner(),e=this.isRtl()?"insert_col_end":"insert_col_start";this.alter(e,t.col,1,"ContextMenu.columnLeft")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeLast();return!t||this.selection.isSelectedByRowHeader()||t.isSingleHeader()&&t.highlight.col<0||this.countSourceCols()>=this.getSettings().maxCols?!0:this.selection.isSelectedByCorner()?this.countCols()===0:!1},hidden(){return!this.getSettings().allowInsertColumn}}}const xd="col_right";function aZ(){return{key:xd,name(){return this.getTranslatedPhrase(IE)},callback(){const t=this.getSelectedRangeLast().getTopRightCorner(),e=this.isRtl()?"insert_col_start":"insert_col_end";this.alter(e,t.col,1,"ContextMenu.columnRight")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeLast();return!!(!t||this.selection.isSelectedByRowHeader()||t.isSingleHeader()&&t.highlight.col<0||this.countSourceCols()>=this.getSettings().maxCols)},hidden(){return!this.getSettings().allowInsertColumn}}}const Ad="make_read_only";function lZ(){return{key:Ad,checkable:!0,ariaChecked(){return Hg(this.getSelectedRange(),(e,n)=>this.getCellMeta(e,n).readOnly)},ariaLabel(){return this.getTranslatedPhrase(rm)},name(){let t=this.getTranslatedPhrase(rm);return Hg(this.getSelectedRange(),(n,r)=>this.getCellMeta(n,r).readOnly)&&(t=TL(t)),t},callback(){const t=this.getSelectedRange(),e=Hg(t,(n,r)=>this.getCellMeta(n,r).readOnly);H(t,n=>{n.forAll((r,i)=>{r>=0&&i>=0&&this.setCellMeta(r,i,"readOnly",!e)})}),this.render()},disabled(){const t=this.getSelectedRangeLast();return!!(!t||t.isSingleHeader()||this.selection.isSelectedByCorner()||this.countRows()===0||this.countCols()===0||!this.getSelectedRange()||this.getSelectedRange().length===0)}}}const _p="redo";function uZ(){return{key:_p,name(){return this.getTranslatedPhrase(AE)},callback(){this.getPlugin("undoRedo").redo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isRedoAvailable()}}}const Hd="remove_col";function cZ(){return{key:Hd,name(){const t=this.getSelected();let e=0;if(t)if(t.length>1)e=1;else{const[,n,,r]=t[0];n-r!==0&&(e=1)}return this.getTranslatedPhrase(OE,e)},callback(){this.alter("remove_col",y3(this),null,"ContextMenu.removeColumn")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeLast();if(!t||t.isSingleHeader()&&t.highlight.col<0)return!0;const e=this.countCols();return this.selection.isSelectedByCorner()?e===0:this.selection.isSelectedByRowHeader()||e===0},hidden(){return!this.getSettings().allowRemoveColumn}}}const Mp="remove_row";function hZ(){return{key:Mp,name(){const t=this.getSelected();let e=0;if(t)if(t.length>1)e=1;else{const[n,,r]=t[0];n-r!==0&&(e=1)}return this.getTranslatedPhrase(PE,e)},callback(){this.alter("remove_row",S3(this),1,"ContextMenu.removeRow")},disabled(){const t=this.getSelectedRangeLast();if(!t||t.isSingleHeader()&&t.highlight.row<0)return!0;const e=this.countRows();return this.selection.isSelectedByCorner()?e===0:this.selection.isSelectedByColumnHeader()||e===0},hidden(){return!this.getSettings().allowRemoveRow}}}const Ip="row_above";function dZ(){return{key:Ip,name(){return this.getTranslatedPhrase(TE)},callback(){const t=this.getSelectedRangeLast().getTopLeftCorner();this.alter("insert_row_above",t.row,1,"ContextMenu.rowAbove")},disabled(){const t=this.getSelectedRangeLast();return!t||this.selection.isSelectedByColumnHeader()||t.isSingleHeader()&&t.highlight.row<0||this.countSourceRows()>=this.getSettings().maxRows?!0:this.selection.isSelectedByCorner()?this.countRows()===0:!1},hidden(){return!this.getSettings().allowInsertRow}}}const Pp="row_below";function fZ(){return{key:Pp,name(){return this.getTranslatedPhrase(_E)},callback(){const t=this.getSelectedRangeLast().getBottomRightCorner();this.alter("insert_row_below",t.row,1,"ContextMenu.rowBelow")},disabled(){const t=this.getSelectedRangeLast();return!!(!t||this.selection.isSelectedByColumnHeader()||t.isSingleHeader()&&t.highlight.row<0||this.countSourceRows()>=this.getSettings().maxRows)},hidden(){return!this.getSettings().allowInsertRow}}}const Qh="no_items";function gZ(){return{key:Qh,name(){return this.getTranslatedPhrase(EE)},disabled:!0,isCommand:!1}}const Op="undo";function mZ(){return{key:Op,name(){return this.getTranslatedPhrase(xE)},callback(){this.getPlugin("undoRedo").undo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isUndoAvailable()}}}const pZ=[Ip,Pp,Od,xd,Tp,Mp,Hd,Op,_p,Ad,jr,Ne,Qh],wZ={[Ne]:rZ,[Qh]:gZ,[Ip]:dZ,[Pp]:fZ,[Od]:sZ,[xd]:aZ,[Tp]:oZ,[Mp]:hZ,[Hd]:cZ,[Op]:mZ,[_p]:uZ,[Ad]:lZ,[jr]:iZ};function _L(){const t={};return ke(wZ,(e,n)=>{t[n]=e()}),t}function vZ(t){return{key:"commentsAddEdit",name(){var e;const n=(e=this.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n!=null&&n.isCell()&&t.getCommentAtCell(n.row,n.col)?this.getTranslatedPhrase(UE):this.getTranslatedPhrase(jE)},callback(){const e=this.getSelectedRangeLast();t.setRange(e),t.show(),t.focusEditor()},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function CZ(t){return{key:"commentsRemove",name(){return this.getTranslatedPhrase(zE)},callback(){this.getSelectedRangeLast().forAll((n,r)=>{n>=0&&r>=0&&t.removeCommentAtCell(n,r,!1)}),this.render()},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function yZ(t){return{key:"commentsReadOnly",name(){const e=this.getTranslatedPhrase(YE);return Hg(this.getSelectedRange(),(r,i)=>t.getCommentMeta(r,i,Ng))?TL(e):e},callback(){this.getSelectedRangeLast().forAll((n,r)=>{if(n>=0&&r>=0){const i=!!t.getCommentMeta(n,r,Ng);t.updateCommentMeta(n,r,{[Ng]:!i})}})},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||!t.getCommentAtCell(e.highlight.row,e.highlight.col)||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function SZ(t,e){ML(t,e),e.add(t)}function Yl(t,e,n){ML(t,e),e.set(t,n)}function ML(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bZ(t,e,n){return(e=RZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function RZ(t){var e=EZ(t,"string");return typeof e=="symbol"?e:e+""}function EZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ws(t,e,n){return t.set(sr(t,e),n),n}function xe(t,e){return t.get(sr(t,e))}function sr(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const wm="comments",TZ=60,Vo="comment",gh="value",IL="style",Ng="readOnly",Lc=wm,Hb=`plugin:${wm}`;var lt=new WeakMap,to=new WeakMap,xp=new WeakMap,Dg=new WeakMap,Nb=new WeakMap,vm=new WeakMap,vr=new WeakSet;class _Z extends et{constructor(){super(...arguments),SZ(this,vr),bZ(this,"range",{}),Yl(this,lt,null),Yl(this,to,null),Yl(this,xp,!1),Yl(this,Dg,!1),Yl(this,Nb,null),Yl(this,vm,"")}static get PLUGIN_KEY(){return wm}static get PLUGIN_PRIORITY(){return TZ}static get DEFAULT_SETTINGS(){return{displayDelay:250}}isEnabled(){return!!this.hot.getSettings()[wm]}enablePlugin(){var e=this;this.enabled||(xe(lt,this)||(Ws(lt,this,new Ja(this.hot.rootDocument,this.hot.isRtl())),xe(lt,this).addLocalHook("resize",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return sr(vr,e,NZ).call(e,...r)})),xe(to,this)||Ws(to,this,new EL(this.getSetting("displayDelay"))),this.addHook("afterContextMenuDefaultOptions",n=>this.addToContextMenu(n)),this.addHook("afterRenderer",(n,r,i,o,s,a)=>sr(vr,this,xZ).call(this,n,a)),this.addHook("afterScroll",()=>sr(vr,this,DZ).call(this)),this.addHook("afterBeginEditing",()=>this.hide()),this.addHook("afterDocumentKeyDown",n=>sr(vr,this,HA).call(this,n)),this.addHook("beforeCompositionStart",n=>sr(vr,this,HA).call(this,n)),this.addHook("afterSetTheme",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return sr(vr,e,kZ).call(e,...r)}),xe(to,this).addLocalHook("hide",()=>this.hide()),xe(to,this).addLocalHook("show",(n,r)=>this.showAtCell(n,r)),this.registerShortcuts(),this.registerListeners(),super.enablePlugin())}updatePlugin(){xe(to,this).updateDelay(this.getSetting("displayDelay")),super.updatePlugin()}disablePlugin(){this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager(),n=e.getContext("grid"),r=e.addContext(Hb);n.addShortcut({keys:[["Control","Alt","M"]],callback:()=>{const i=this.hot.getSelectedRangeLast();Ws(Dg,this,!0),this.hot.scrollToFocusedCell(()=>{this.setRange(i),this.show(),this.focusEditor(),e.setActiveContextName(Hb),this.hot._registerTimeout(()=>{Ws(Dg,this,!1)})})},stopPropagation:!0,runOnlyIf:()=>{var i;return(i=this.hot.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isCell()},group:Lc}),r.addShortcut({keys:[["Escape"]],callback:()=>{xe(lt,this).setValue(xe(vm,this)),this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>xe(lt,this).isVisible()&&xe(lt,this).isFocused(),group:Lc}),r.addShortcut({keys:[["Control/Meta","Enter"]],callback:()=>{this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>xe(lt,this).isVisible()&&xe(lt,this).isFocused(),group:Lc}),r.addShortcut({keys:[["Shift","Tab"],["Tab"]],forwardToContext:e.getContext("grid"),callback:()=>{xe(lt,this).setValue(xe(lt,this).getValue()),this.hide(),e.setActiveContextName("grid")},group:Lc})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(Lc)}registerListeners(){const{rootDocument:e}=this.hot,n=this.getEditorInputElement();this.eventManager.addEventListener(e,"mouseover",r=>sr(vr,this,PZ).call(this,r)),this.eventManager.addEventListener(e,"mousedown",r=>sr(vr,this,MZ).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>sr(vr,this,OZ).call(this)),this.eventManager.addEventListener(n,"focus",()=>sr(vr,this,HZ).call(this)),this.eventManager.addEventListener(n,"blur",()=>sr(vr,this,AZ).call(this)),this.eventManager.addEventListener(this.getEditorInputElement(),"mousedown",r=>sr(vr,this,IZ).call(this,r))}setRange(e){this.range=e}clearRange(){this.range={}}targetIsCellWithComment(e){const n=sl(e.target,"TD","TBODY");return!!(n&&ye(n,"htCommentCell")&&sl(n,[this.hot.rootElement]))}targetIsCommentTextArea(e){return this.getEditorInputElement()===e.target}setComment(e){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const n=xe(lt,this).getValue();let r="";e!=null?r=e:n!=null&&(r=n);const i=this.range.from.row,o=this.range.from.col;this.updateCommentMeta(i,o,{[gh]:r}),this.hot.render()}setCommentAtCell(e,n,r){this.setRange({from:this.hot._createCellCoords(e,n)}),this.setComment(r)}removeComment(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');this.hot.setCellMeta(this.range.from.row,this.range.from.col,Vo),e&&this.hot.render(),this.hide()}removeCommentAtCell(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;this.setRange({from:this.hot._createCellCoords(e,n)}),this.removeComment(r)}getComment(){const e=this.range.from.row,n=this.range.from.col;return this.getCommentMeta(e,n,gh)}getCommentAtCell(e,n){return this.getCommentMeta(e,n,gh)}show(){var e;if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const{from:{row:n,col:r}}=this.range;if(n<0||n>this.hot.countSourceRows()-1||r<0||r>this.hot.countSourceCols()-1)return!1;const i=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return xe(to,this).cancelHiding(),xe(lt,this).setValue((e=i[Vo]?i[Vo][gh]:null)!==null&&e!==void 0?e:""),xe(lt,this).show(),this.refreshEditor(!0),!0}showAtCell(e,n){return this.setRange({from:this.hot._createCellCoords(e,n)}),this.show()}hide(){xe(lt,this).hide()}refreshEditor(){if(!(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&(!this.range.from||!xe(lt,this).isVisible()))return;const{rowIndexMapper:n,columnIndexMapper:r}=this.hot,{row:i,col:o}=this.range.from;let s=n.getRenderableFromVisualIndex(i),a=r.getRenderableFromVisualIndex(o);const l=s===null;xe(lt,this).setPosition(0,0),s===null&&(s=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(i,-1))),a===null&&(a=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(o,-1)));const u=s===null,c=a===null;s=s??0,a=a??0;const{rootWindow:h,view:{_wt:d}}=this.hot,{wtTable:f}=d,m=d.getCell({row:s,col:a},!0),C=this.getCommentMeta(i,o,IL);C?xe(lt,this).setSize(C.width,C.height):xe(lt,this).resetSize();const y=c?0:f.getColumnWidth(a),E=l&&!u?an(m):0,{left:v,top:O,width:x,height:F}=m.getBoundingClientRect(),{width:I,height:_}=xe(lt,this).getSize(),{innerWidth:q,innerHeight:G}=this.hot.rootWindow,U=this.hot.rootDocument.documentElement,J=yn(this.hot.rootDocument),te=iD(this.hot.rootWindow)?J:0,le=oD(this.hot.rootWindow)?J:0;let ne=v+h.scrollX+y,se=O+h.scrollY+E;this.hot.isRtl()&&(ne-=I+y),this.hot.isLtr()&&v+x+I>q-te?ne=v+h.scrollX-I-1:this.hot.isRtl()&&ne<-(U.scrollWidth-U.clientWidth)&&(ne=v+h.scrollX+y+1),O+_>G-le&&(se-=_-F+1),xe(lt,this).setPosition(ne,se),xe(lt,this).setReadOnlyState(this.getCommentMeta(i,o,Ng)),xe(lt,this).observeSize()}focusEditor(){xe(lt,this).focus()}updateCommentMeta(e,n,r){const i=this.hot.getCellMeta(e,n)[Vo];let o;i?(o=Kn(i),lp(o,r)):o=r,this.hot.setCellMeta(e,n,Vo,o)}getCommentMeta(e,n,r){const i=this.hot.getCellMeta(e,n);if(i[Vo])return i[Vo][r]}addToContextMenu(e){e.items.push({name:Ne},vZ(this),CZ(this),yZ(this))}getEditorInputElement(){return xe(lt,this).getInputElement()}destroy(){var e,n;(e=xe(lt,this))===null||e===void 0||e.destroy(),(n=xe(to,this))===null||n===void 0||n.destroy(),super.destroy()}}function MZ(t){if(!(!this.hot.view||!this.hot.view._wt)&&!xe(xp,this)&&!this.targetIsCommentTextArea(t)){const e=sl(t.target,"TD","TBODY");let n=null;e&&(n=this.hot.getCoords(e)),(!e||this.range.from&&n&&(this.range.from.row!==n.row||this.range.from.col!==n.col))&&this.hide()}}function IZ(t){t.stopPropagation()}function PZ(t){const{rootDocument:e}=this.hot;if(!(xe(xp,this)||xe(lt,this).isFocused()||ye(t.target,"wtBorder")||xe(Nb,this)===t.target||!xe(lt,this)))if(Ws(Nb,this,e.elementFromPoint(t.clientX,t.clientY)),this.targetIsCellWithComment(t)){const n=this.hot._createCellRange(this.hot.getCoords(t.target));xe(to,this).show(n)}else rl(t.target,e)&&!this.targetIsCommentTextArea(t)&&xe(to,this).hide()}function OZ(){Ws(xp,this,!1)}function xZ(t,e){e[Vo]&&e[Vo][gh]&&X(t,e.commentedCellClassName)}function AZ(){Ws(vm,this,""),this.hot.getShortcutManager().setActiveContextName("grid"),this.setComment()}function HZ(){Ws(vm,this,this.getComment()),this.hot.listen(),this.hot.getShortcutManager().setActiveContextName(Hb)}function NZ(t,e){this.updateCommentMeta(this.range.from.row,this.range.from.col,{[IL]:{width:t,height:e}})}function HA(t){xe(lt,this).isFocused()&&Pi(t)}function DZ(){xe(Dg,this)||this.hide()}function kZ(){const t=xe(lt,this).getEditorElement();we(t,/ht-theme-.*/g),X(t,this.hot.getCurrentThemeName())}function Wy(t,e,n){return(e=LZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LZ(t){var e=$Z(t,"string");return typeof e=="symbol"?e:e+""}function $Z(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class PL{constructor(e){Wy(this,"hot",void 0),Wy(this,"commands",{}),Wy(this,"commonCallback",null),this.hot=e}registerCommand(e,n){this.commands[e]=n}setCommonCallback(e){this.commonCallback=e}execute(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];const o=e.split(":"),s=o[0],a=o.length===2?o[1]:null;let l=this.commands[s];if(!l)throw new Error(`Menu command '${s}' not exists.`);if(a&&l.submenu&&(l=FZ(a,l.submenu.items)),l.disabled===!0||typeof l.disabled=="function"&&l.disabled.call(this.hot)===!0||sn(l,"submenu"))return;const u=[];typeof l.callback=="function"&&u.push(l.callback),typeof this.commonCallback=="function"&&u.push(this.commonCallback),r.unshift(o.join(":")),H(u,c=>c.apply(this.hot,r))}}function FZ(t,e){let n;return H(e,r=>{const i=r.key?r.key.split(":"):null;if(Array.isArray(i)&&i[1]===t)return n=r,!1}),n}function By(t,e,n){return(e=VZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function VZ(t){var e=WZ(t,"string");return typeof e=="symbol"?e:e+""}function WZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class OL{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;By(this,"hot",void 0),By(this,"predefinedItems",_L()),By(this,"defaultOrderPattern",void 0),this.hot=e,this.defaultOrderPattern=n}setPredefinedItems(e){const n={};this.defaultOrderPattern.length=0,ke(e,(r,i)=>{let o="";r.name===Ne?(n[Ne]=r,o=Ne):isNaN(parseInt(i,10))?(r.key=r.key===void 0?i:r.key,n[i]=r,o=r.key):(n[r.key]=r,o=r.key),this.defaultOrderPattern.push(o)}),this.predefinedItems=n}getItems(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return BZ(e,this.defaultOrderPattern,this.predefinedItems)}}function BZ(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=[];let i=t;return i&&i.items?i=i.items:Array.isArray(i)||(i=e),De(i)?ke(i,(o,s)=>{let a=n[typeof o=="string"?o:s];a||(a=o),De(o)?ln(a,o):typeof a=="string"&&(a={name:a}),a.key===void 0&&(a.key=s),r.push(a)}):H(i,(o,s)=>{let a=n[o];!a&&pZ.indexOf(o)>=0||(a||(a={name:o,key:`${s}`}),De(o)&&ln(a,o),a.key===void 0&&(a.key=s),r.push(a))}),r}function ws(t,e,n){return(e=jZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jZ(t){var e=UZ(t,"string");return typeof e=="symbol"?e:e+""}function UZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class zZ{constructor(e,n){ws(this,"top",void 0),ws(this,"topRelative",void 0),ws(this,"left",void 0),ws(this,"leftRelative",void 0),ws(this,"scrollTop",void 0),ws(this,"scrollLeft",void 0),ws(this,"cellHeight",void 0),ws(this,"cellWidth",void 0);const r=n.scrollY,i=n.scrollX;let o,s,a,l,u,c;this.rootWindow=n,this.type=this.getSourceType(e),this.type==="literal"?(o=parseInt(e.top,10),a=parseInt(e.left,10),u=e.height||0,c=e.width||0,s=o,l=a,o+=r,a+=i):this.type==="event"&&(o=parseInt(e.pageY,10),a=parseInt(e.pageX,10),u=e.target.clientHeight,c=e.target.clientWidth,s=o-r,l=a-i),this.top=o,this.topRelative=s,this.left=a,this.leftRelative=l,this.scrollTop=r,this.scrollLeft=i,this.cellHeight=u,this.cellWidth=c}getSourceType(e){let n="literal";return e instanceof Event&&(n="event"),n}fitsAbove(e){return this.topRelative>=e.offsetHeight}fitsBelow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rootWindow.innerHeight;return this.topRelative+e.offsetHeight<=n}fitsOnRight(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rootWindow.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=n}fitsOnLeft(e){return this.leftRelative>=e.offsetWidth}}function $c(t,e,n){YZ(t,e),e.set(t,n)}function YZ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Pe(t,e){return t.get(xL(t,e))}function xf(t,e,n){return t.set(xL(t,e),n),n}function xL(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Fn=new WeakMap,nr=new WeakMap,rr=new WeakMap,jy=new WeakMap,Gl=new WeakMap;class GZ{constructor(e){$c(this,Fn,void 0),$c(this,nr,void 0),$c(this,rr,void 0),$c(this,jy,!1),$c(this,Gl,{above:0,below:0,left:0,right:0}),xf(jy,this,e)}setOffset(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Pe(Gl,this)[e]=n,this}setElement(e){return xf(Fn,this,e),this}setParentElement(e){return xf(nr,this,e),this}updatePosition(e){xf(rr,this,new zZ(e,Pe(Fn,this).ownerDocument.defaultView)),Pe(jy,this)?(Pe(rr,this).fitsBelow(Pe(Fn,this))?this.setPositionBelowCursor():Pe(rr,this).fitsAbove(Pe(Fn,this))?this.setPositionAboveCursor():this.setPositionBelowCursor(),this.updateHorizontalPosition()):(this.setPositionBelowCursor(),this.setPositionOnRightOfCursor())}updateHorizontalPosition(){Pe(Fn,this).dir==="rtl"?Pe(rr,this).fitsOnLeft(Pe(Fn,this))?this.setPositionOnLeftOfCursor():this.setPositionOnRightOfCursor():Pe(rr,this).fitsOnRight(Pe(Fn,this))?this.setPositionOnRightOfCursor():this.setPositionOnLeftOfCursor()}setPositionAboveCursor(){let e=Pe(Gl,this).above+Pe(rr,this).top-Pe(Fn,this).offsetHeight;if(Pe(nr,this)){const r=Pe(nr,this).ownerDocument.defaultView.getComputedStyle(Pe(nr,this).querySelector(".ht_master")),i=Number.parseInt(r.paddingTop,10),o=Number.parseInt(r.borderTop,10);e=Pe(rr,this).top+Pe(rr,this).cellHeight-Pe(Fn,this).scrollHeight+i+o}Pe(Fn,this).style.top=`${e}px`}setPositionBelowCursor(){let e=Pe(Gl,this).below+Pe(rr,this).top+1;if(Pe(nr,this)){const r=Pe(nr,this).ownerDocument.defaultView.getComputedStyle(Pe(nr,this).querySelector(".ht_master")),i=Number.parseInt(r.paddingTop,10),o=Number.parseInt(r.borderTop,10);e=Pe(rr,this).top-i-o-1}Pe(Fn,this).style.top=`${e}px`}setPositionOnRightOfCursor(){let e=Pe(rr,this).left;if(Pe(nr,this)){const n=Pe(nr,this).ownerDocument.defaultView,r=Number.parseInt(n.getComputedStyle(Pe(nr,this).querySelector(".htCore")).borderRightWidth,10);e+=Pe(rr,this).cellWidth+r}else e+=Pe(Gl,this).right;Pe(Fn,this).style.left=`${e}px`}setPositionOnLeftOfCursor(){let e=Pe(Gl,this).left+Pe(rr,this).left-Pe(Fn,this).offsetWidth;if(Pe(nr,this)){const n=Pe(nr,this).ownerDocument.defaultView,r=Number.parseInt(n.getComputedStyle(Pe(nr,this).querySelector(".htCore")).borderLeftWidth,10);e-=r}Pe(Fn,this).style.left=`${e}px`}}function AL(t){let{initialPage:e=-1,size:n=()=>0,onItemSelect:r=()=>{},onClear:i=()=>{}}=t;const o=new Set;let s=qe(e,-1,m()-1);function a(y,E){const v=m()-1;return y<0&&(y=v),y>v&&(y=0),o.has(y)?-1:(o.add(y),r(y,!1)===!1&&(y=a(E===1?++y:--y,E)),y)}function l(y){y>-1&&y<m()&&r(y,!0)!==!1&&(s=y)}function u(){return s}function c(){m()>0&&(o.clear(),s=a(0,1))}function h(){m()>0&&(o.clear(),s=a(m()-1,-1))}function d(){m()>0&&(o.clear(),s=a(++s,1))}function f(){m()>0&&(o.clear(),s=a(--s,-1))}function m(){return Math.max(n(),0)}function C(){o.clear(),s=e,i()}return{setCurrentPage:l,getCurrentPage:u,toFirstItem:c,toLastItem:h,toNextItem:d,toPreviousItem:f,getSize:m,clear:C}}function qZ(t){return ze(t,e=>({start:e.getTopStartCorner(),end:e.getBottomEndCorner()}))}function Db(t){return sn(t,"submenu")}function kb(t){return new RegExp(Ne,"i").test(t.name)}function kg(t,e){return t.disabled===!0||typeof t.disabled=="function"&&t.disabled.call(e)===!0}function NA(t){return sn(t,"disableSelection")}function KZ(t){return ye(t,"htSeparator")}function XZ(t){return ye(t,"htSubmenu")}function ZZ(t){return ye(t,"htDisabled")}function JZ(t){return ye(t,"htSelectionDisabled")}function QZ(t,e){return!t.hidden||!(typeof t.hidden=="function"&&t.hidden.call(e))}function HL(t,e){const n=t.slice(0);for(let r=0;r<n.length&&n[r].name===e;)n.shift();return n}function eJ(t,e){let n=t.slice(0);return n.reverse(),n=HL(n,e),n.reverse(),n}function tJ(t){const e=[];return H(t,(n,r)=>{r>0?e[e.length-1].name!==n.name&&e.push(n):e.push(n)}),e}function nJ(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ne,n=t.slice(0);return n=HL(n,e),n=eJ(n,e),n=tJ(n),n}function rJ(t){return t.checkable===!0}function iJ(t){return AL({size:()=>t.countRows(),onItemSelect(e,n){const r=t.getCell(e,0);if(!r||KZ(r)||ZZ(r)||JZ(r))return!1;t.selectCell(e,0,...n?[e,0,!1,!1]:[])},onClear(){t.deselectCell()}})}function oJ(t){const{hot:e,hotMenu:n}=t;return[{keys:[["Control/Meta","A"]],forwardToContext:e.getShortcutManager().getContext("grid"),callback:()=>t.close(!0)},{keys:[["Tab"],["Shift","Tab"]],callback:(r,i)=>{const o=e.getSettings(),s=typeof o.tabMoves=="function"?o.tabMoves(r):o.tabMoves;i.includes("shift")?e.selection.transformStart(-s.row,-s.col):e.selection.transformStart(s.row,s.col),t.close(!0)}},{keys:[["Escape"]],callback:()=>t.close()},{keys:[["ArrowDown"]],callback:()=>t.getNavigator().toNextItem()},{keys:[["ArrowUp"]],callback:()=>t.getNavigator().toPreviousItem()},{keys:[[e.isRtl()?"ArrowLeft":"ArrowRight"]],callback:()=>{const r=n.getSelectedLast();if(r){const i=t.openSubMenu(r[0]);i&&i.getNavigator().toFirstItem()}}},{keys:[[e.isRtl()?"ArrowRight":"ArrowLeft"]],callback:()=>{n.getSelectedLast()&&t.isSubMenu()&&(t.close(),t.isSubMenu()&&t.parentMenu.hotMenu.listen())}},{keys:[["Control/Meta","ArrowUp"],["Home"]],callback:()=>t.getNavigator().toFirstItem()},{keys:[["Control/Meta","ArrowDown"],["End"]],callback:()=>t.getNavigator().toLastItem()},{keys:[["Enter"],["Space"]],callback:r=>{const i=n.getSelectedLast();i&&(n.getSourceDataAtRow(i[0]).submenu?t.openSubMenu(i[0]).getNavigator().toFirstItem():(t.executeCommand(r),t.close(!0)))}},{keys:[["PageUp"]],callback:()=>{n.getSelectedLast()?n.selection.transformStart(-n.countVisibleRows(),0):t.getNavigator().toFirstItem()}},{keys:[["PageDown"]],callback:()=>{n.getSelectedLast()?n.selection.transformStart(n.countVisibleRows(),0):t.getNavigator().toLastItem()}}]}const NL="menu",DA=NL;function sJ(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=[];r(oJ(t)),e.forEach(u=>{let{shortcuts:c,contextName:h}=u;i(c,h)});function r(u,c){a(c).addShortcuts(u,{group:NL})}function i(u,c){const h=a(c);u.forEach(d=>{let{keys:f}=d;f.forEach(m=>h.removeShortcutsByKeys(m))}),n.push({shortcuts:u,contextName:c}),r(u,c)}function o(){return[...n]}function s(u){return u?`${DA}:${u}`:DA}function a(u){var c;const h=t.hotMenu.getShortcutManager(),d=s(u);return(c=h.getContext(d))!==null&&c!==void 0?c:h.addContext(d)}function l(u){t.hotMenu.getShortcutManager().setActiveContextName(s(u))}return{addCustomShortcuts:i,getCustomShortcuts:o,getContext:a,listen:l}}function aJ(t){return(e,n,r,i,o,s)=>{const a=e.getSourceDataAtRow(r),l=t.rootDocument.createElement("div"),u=typeof s=="function"?s.call(t):s,c=typeof a.ariaLabel=="function"?a.ariaLabel.call(t):a.ariaLabel,h=typeof a.ariaChecked=="function"?a.ariaChecked.call(t):a.ariaChecked;if(rs(n),X(l,"htItemWrapper"),t.getSettings().ariaTags){const d=!kg(a,t)&&!NA(a)&&!kb(a);Re(n,[...rJ(a)?[sz(),Uh(c),XN(h)]:[oz(),Uh(u)],...d?[Sl(-1)]:[],...kg(a,t)?[fz()]:[],...Db(a)?[Xr(!1)]:[]])}n.className="",n.appendChild(l),kb(a)?X(n,"htSeparator"):typeof a.renderer=="function"?(X(n,"htCustomMenuRenderer"),n.appendChild(a.renderer(e,l,r,i,o,u))):Ju(l,u),kg(a,t)?X(n,"htDisabled"):NA(a)?X(n,"htSelectionDisabled"):Db(a)&&X(n,"htSubmenu")}}function Uy(t,e,n){lJ(t,e),e.set(t,n)}function lJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Wi(t,e,n){return(e=uJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uJ(t){var e=cJ(t,"string");return typeof e=="symbol"?e:e+""}function cJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function zy(t,e,n){return t.set(DL(t,e),n),n}function Ta(t,e){return t.get(DL(t,e))}function DL(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const kA=215;var Fc=new WeakMap,Af=new WeakMap,Hf=new WeakMap;class rc{get tableBorderWidth(){return Ta(Hf,this)===void 0&&this.hotMenu&&zy(Hf,this,parseInt(this.hotMenu.rootWindow.getComputedStyle(this.hotMenu.view._wt.wtTable.TABLE).borderWidth,10)),Ta(Hf,this)}constructor(e,n){var r=this;Wi(this,"hot",void 0),Wi(this,"options",void 0),Wi(this,"eventManager",new _i(this)),Wi(this,"container",void 0),Wi(this,"positioner",void 0),Wi(this,"hotMenu",null),Wi(this,"hotSubMenus",{}),Wi(this,"parentMenu",void 0),Wi(this,"menuItems",null),Wi(this,"origOutsideClickDeselects",null),Uy(this,Fc,void 0),Uy(this,Af,void 0),Uy(this,Hf,void 0),this.hot=e,this.options=n||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1,minWidth:kA,container:this.hot.rootDocument.documentElement},this.container=this.createContainer(this.options.name),this.positioner=new GZ(this.options.keepInViewport),this.parentMenu=this.options.parent||null,this.registerEvents(),this.isSubMenu()&&this.addLocalHook("afterSelectionChange",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.parentMenu.runLocalHooks("afterSelectionChange",...o)}),this.hot.addHook("afterSetTheme",(i,o)=>{if(!o){var s;(s=this.hotMenu)===null||s===void 0||s.useTheme(i)}})}registerEvents(){let e=this.hot.rootWindow;for(;e;)this.eventManager.addEventListener(e.document,"mousedown",n=>this.onDocumentMouseDown(n)),this.eventManager.addEventListener(e.document,"touchstart",n=>this.onDocumentMouseDown(n)),this.eventManager.addEventListener(e.document,"contextmenu",n=>this.onDocumentContextMenu(n)),e=Nu(e)}setMenuItems(e){this.menuItems=e}getNavigator(){return Ta(Fc,this)}getKeyboardShortcutsCtrl(){return Ta(Af,this)}getSelectedItem(){return this.hasSelectedItem()?this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelectedLast()[0]):null}hasSelectedItem(){return Array.isArray(this.hotMenu.getSelectedLast())}isSubMenu(){return this.parentMenu!==null}open(){this.runLocalHooks("beforeOpen"),this.container.removeAttribute("style"),this.container.style.display="block";const e=ap(a=>this.openSubMenu(a),300),n=this.options.minWidth||kA;let r=!1,i=ol(this.menuItems,a=>(a.key===Qh&&(r=!0),QZ(a,this.hot)));if(i.length<1&&!r)i.push(_L()[Qh]);else if(i.length===0)return;i=nJ(i,Ne);let o=!1;const s={data:i,colHeaders:!1,autoColumnSize:!0,autoWrapRow:!1,modifyColWidth(a){return ue(a)&&a<n?n:a},autoRowSize:!1,readOnly:!0,editor:!1,copyPaste:!1,hiddenRows:!0,maxCols:1,columns:[{data:"name",renderer:aJ(this.hot)}],renderAllRows:!0,fragmentSelection:!1,outsideClickDeselects:!1,disableVisualSelection:"area",layoutDirection:this.hot.isRtl()?"rtl":"ltr",ariaTags:!1,themeName:this.hot.getCurrentThemeName(),beforeRefreshDimensions:()=>!1,beforeOnCellMouseOver:(a,l)=>{Ta(Fc,this).setCurrentPage(l.row)},afterOnCellMouseOver:(a,l)=>{this.isAllSubMenusClosed()?e(l.row):this.openSubMenu(l.row)},afterOnCellContextMenu:a=>{a.preventDefault(),JP()&&o&&this.hasSelectedItem()&&this.close(!0)},afterSelection:(a,l,u,c,h)=>{this.hotMenu.view.isMouseDown()&&(h.value=!0),this.runLocalHooks("afterSelectionChange",this.getSelectedItem())},beforeOnCellMouseUp:a=>{this.hasSelectedItem()&&(o=!this.isCommandPassive(this.getSelectedItem()),this.executeCommand(a))},afterOnCellMouseUp:a=>{(!JP()||!ll(a))&&o&&this.hasSelectedItem()&&(qo()||gD()?this.hot._registerTimeout(()=>this.close(!0),325):this.close(!0))},afterUnlisten:()=>{!this.hasSelectedItem()&&this.isOpened()&&this.hotMenu.listen()}};this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new this.hot.constructor(this.container,s),this.hotMenu.addHook("afterInit",()=>this.onAfterInit()),this.hotMenu.init(),zy(Fc,this,iJ(this.hotMenu)),zy(Af,this,sJ(this)),Ta(Af,this).listen(),this.focus(),this.isSubMenu()&&this.addLocalHook("afterOpen",()=>this.parentMenu.runLocalHooks("afterSubmenuOpen",this)),this.runLocalHooks("afterOpen",this)}close(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.isOpened()){if(e&&this.isSubMenu())this.parentMenu.close();else if(Ta(Fc,this).clear(),this.closeAllSubMenus(),this.container.style.display="none",this.hotMenu.destroy(),this.hotMenu=null,this.hot.getSettings().outsideClickDeselects=this.origOutsideClickDeselects,this.runLocalHooks("afterClose"),this.isSubMenu()){if(this.hot.getSettings().ariaTags){const n=this.parentMenu.hotMenu.getSelectedLast();if(n){const r=this.parentMenu.hotMenu.getCell(n[0],0);Re(r,[Xr(!1)])}}this.parentMenu.hotMenu.listen()}}}openSubMenu(e){if(!this.hotMenu)return!1;const n=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!n||!XZ(n))return!1;const r=this.hotMenu.getSourceDataAtRow(e),i=new rc(this.hot,{parent:this,name:r.name,className:this.options.className,keepInViewport:!0,container:this.options.container});return i.setMenuItems(r.submenu.items),i.open(),i.setPosition(n.getBoundingClientRect()),this.hotSubMenus[r.key]=i,this.hot.getSettings().ariaTags&&Re(n,[Xr(!0)]),i}closeSubMenu(e){const n=this.hotMenu.getSourceDataAtRow(e),r=this.hotSubMenus[n.key];if(r){r.destroy(),delete this.hotSubMenus[n.key];const i=this.hotMenu.getCell(e,0);this.hot.getSettings().ariaTags&&Re(i,[Xr(!1)])}}closeAllSubMenus(){H(this.hotMenu.getData(),(e,n)=>this.closeSubMenu(n))}isAllSubMenusClosed(){return Object.keys(this.hotSubMenus).length===0}focus(){this.isOpened()&&(this.hotMenu.rootElement.focus({preventScroll:!0}),this.getKeyboardShortcutsCtrl().listen(),this.hotMenu.listen())}destroy(){const e=this.container.parentNode;this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy(),e&&e.removeChild(this.container)}isOpened(){return this.hotMenu!==null}executeCommand(e){if(!this.isOpened()||!this.hasSelectedItem())return;const n=this.getSelectedItem();if(this.runLocalHooks("select",n,e),this.isCommandPassive(n))return;const r=this.hot.getSelectedRange(),i=r?qZ(r):[];this.runLocalHooks("executeCommand",n.key,i,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",n.key,i,e)}isCommandPassive(e){return e.isCommand===!1||kb(e)||kg(e,this.hot)||Db(e)}setOffset(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.positioner.setOffset(e,n)}setPosition(e){this.isSubMenu()&&this.positioner.setParentElement(this.parentMenu.container),this.positioner.setElement(this.container).updatePosition(e)}updateMenuDimensions(){const e=this.hotMenu.view.getStylesHandler(),{wtTable:n}=this.hotMenu.view._wt,r=this.hotMenu.getSettings().data,i=n.hider.style,o=n.holder.style,s=parseInt(i.width,10),a=wr(r,(l,u,c)=>{const d=this.hotMenu.getCell(c,0)?an(this.hotMenu.getCell(c,0)):0;return l+(u.name===Ne?1:d)},0);e.isClassicTheme()?(o.width=`${s+3}px`,o.height=`${a+3}px`):(o.width=`${s}px`,o.height=`${a}px`),i.height=o.height}createContainer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const n=this.options.container.ownerDocument;let r=e,i;return r&&(ut(r)&&(r=r.call(this.hot),r===null||xt(r)?r="":r=r.toString()),r=r.replace(/[^A-Za-z0-9]/g,"_"),r=`${this.options.className}Sub_${r}`,i=n.querySelector(`.${this.options.className}.${r}`)),i||(i=n.createElement("div"),X(i,`htMenu handsontable ${this.options.className}`),r&&X(i,r),this.options.container.appendChild(i)),i}onAfterInit(){this.updateMenuDimensions(),this.hot.getSettings().ariaTags&&Re(this.hotMenu.rootElement,[iz(),Sl(-1)])}onDocumentMouseDown(e){this.isOpened()&&(this.options.standalone&&this.hotMenu&&!rl(e.target,this.hotMenu.rootElement)?this.close(!0):(this.isAllSubMenusClosed()||this.isSubMenu())&&!rl(e.target,".htMenu")&&this.close(!0))}onDocumentContextMenu(e){this.isOpened()&&ye(e.target,"htCore")&&rl(e.target,this.hotMenu.rootElement)&&e.preventDefault()}}gt(rc,En);function hJ(t,e){dJ(t,e),e.add(t)}function dJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Yy(t,e,n){return(e=fJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fJ(t){var e=gJ(t,"string");return typeof e=="symbol"?e:e+""}function gJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Nf(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const mh="contextMenu",mJ=70,LA=mh;ie.getSingleton().register("afterContextMenuDefaultOptions");ie.getSingleton().register("beforeContextMenuShow");ie.getSingleton().register("afterContextMenuShow");ie.getSingleton().register("afterContextMenuHide");ie.getSingleton().register("afterContextMenuExecute");var Vc=new WeakSet;class Ap extends et{constructor(){super(...arguments),hJ(this,Vc),Yy(this,"commandExecutor",new PL(this.hot)),Yy(this,"itemsFactory",null),Yy(this,"menu",null)}static get PLUGIN_KEY(){return mh}static get PLUGIN_PRIORITY(){return mJ}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Ip,Pp,Ne,Od,xd,Ne,Mp,Hd,Ne,Op,_p,Ne,Ad,Ne,jr]}isEnabled(){return!!this.hot.getSettings()[mh]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[mh];typeof n.callback=="function"&&this.commandExecutor.setCommonCallback(n.callback),this.menu=new rc(this.hot,{className:"htContextMenu",keepInViewport:!0,container:n.uiContainer||this.hot.rootDocument.body}),this.menu.addLocalHook("beforeOpen",()=>Nf(Vc,this,wJ).call(this)),this.menu.addLocalHook("afterOpen",()=>Nf(Vc,this,vJ).call(this)),this.menu.addLocalHook("afterClose",()=>Nf(Vc,this,CJ).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return e.executeCommand.call(e,...i)}),this.addHook("afterOnCellContextMenu",r=>Nf(Vc,this,pJ).call(this,r)),this.registerShortcuts(),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.close(),this.menu&&(this.menu.destroy(),this.menu=null),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control/Meta","Shift","Backslash"],["Shift","F10"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();this.hot.scrollToFocusedCell();const n=this.hot.getCell(e.row,e.col,!0).getBoundingClientRect(),r=Ep(this.menu.container,this.hot.rootDocument);this.open({left:n.left+r.left,top:n.top+r.top-1+n.height},{left:n.width,above:-n.height}),this.menu.getNavigator().toFirstItem()},runOnlyIf:()=>{var e;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n&&this.hot.selection.isCellVisible(n)&&!this.menu.isOpened()},group:LA})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(LA)}open(e){var n;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{above:0,below:0,left:0,right:0};if((n=this.menu)!==null&&n!==void 0&&n.isOpened())return;this.prepareMenuItems(),this.menu.open();const i=this.menu.tableBorderWidth>0;ke(r,(o,s)=>{const a=["below","right"].includes(s)?o+1:o-1;this.menu.setOffset(s,i?o:a)}),this.menu.setPosition(e)}close(){var e;(e=this.menu)===null||e===void 0||e.close(),this.itemsFactory=null}executeCommand(e){this.itemsFactory===null&&this.prepareMenuItems();for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.commandExecutor.execute(e,...r)}prepareMenuItems(){this.itemsFactory=new OL(this.hot,Ap.DEFAULT_ITEMS);const e=this.hot.getSettings()[mh],n={items:this.itemsFactory.getItems(e)};this.hot.runHooks("afterContextMenuDefaultOptions",n),this.itemsFactory.setPredefinedItems(n.items);const r=this.itemsFactory.getItems(e);this.hot.runHooks("beforeContextMenuSetItems",r),this.menu.setMenuItems(r),H(r,i=>this.commandExecutor.registerCommand(i.key,i))}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function pJ(t){const e=this.hot.getSettings(),n=e.rowHeaders,r=e.colHeaders;function i(a){return a.nodeName==="TD"||a.parentNode.nodeName==="TD"}const o=t.target;if(this.close(),ye(o,"handsontableInput")||(t.preventDefault(),t.stopPropagation(),!(n||r)&&!i(o)&&!(ye(o,"current")&&ye(o,"wtBorder"))))return;const s=Ep(this.menu.container,this.hot.rootDocument);this.open({top:t.clientY+s.top,left:t.clientX+s.left})}function wJ(){this.hot.runHooks("beforeContextMenuShow",this)}function vJ(){this.hot.runHooks("afterContextMenuShow",this)}function CJ(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)}Ap.SEPARATOR={name:Ne};function yJ(t){return{key:"copy",name(){return this.getTranslatedPhrase(NE)},callback(){t.copyCellsOnly()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function SJ(t){return{key:"copy_column_headers_only",name(){const e=this.getSelectedRangeLast(),n=e?qe(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(LE,n)},callback(){t.copyColumnHeadersOnly()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function bJ(t){return{key:"copy_with_column_group_headers",name(){const e=this.getSelectedRangeLast(),n=e?qe(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(kE,n)},callback(){t.copyWithAllColumnHeaders()},disabled(){if(!this.hasColHeaders()||!this.getSettings().nestedHeaders)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function RJ(t){return{key:"copy_with_column_headers",name(){const e=this.getSelectedRangeLast(),n=e?qe(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(DE,n)},callback(){t.copyWithColumnHeaders()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function EJ(t){return{key:"cut",name(){return this.getTranslatedPhrase($E)},callback(){t.cut()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}class TJ{constructor(){this.data={}}setData(e,n){this.data[e]=n}getData(e){return this.data[e]||void 0}}class _J{constructor(){this.clipboardData=new TJ}preventDefault(){}composedPath(){return[]}}function MJ(t,e){kL(t,e),e.add(t)}function ql(t,e,n){kL(t,e),e.set(t,n)}function kL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Bn(t,e){return t.get(Ru(t,e))}function Kl(t,e,n){return t.set(Ru(t,e),n),n}function Ru(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var vs=new WeakMap,Gy=new WeakMap,Wc=new WeakMap,Lb=new WeakMap,$b=new WeakMap,Bc=new WeakMap,jc=new WeakSet;class IJ{constructor(e){let{countRows:n,countColumns:r,rowsLimit:i,columnsLimit:o,countColumnHeaders:s}=e;MJ(this,jc),ql(this,vs,void 0),ql(this,Gy,void 0),ql(this,Wc,void 0),ql(this,Lb,void 0),ql(this,$b,void 0),ql(this,Bc,void 0),Kl(Gy,this,n),Kl(Wc,this,r),Kl(Lb,this,i),Kl($b,this,o),Kl(Bc,this,s)}setSelectedRange(e){Kl(vs,this,e)}getCellsRange(){if(Bn(Gy,this).call(this)===0||Bn(Wc,this).call(this)===0)return null;const{row:e,col:n}=Bn(vs,this).getTopStartCorner(),{row:r,col:i}=Bn(vs,this).getBottomEndCorner(),o=Ru(jc,this,PJ).call(this,e,r),s=Ru(jc,this,qy).call(this,n,i);return{isRangeTrimmed:r!==o||i!==s,startRow:e,startCol:n,endRow:o,endCol:s}}getMostBottomColumnHeadersRange(){if(Bn(Wc,this).call(this)===0||Bn(Bc,this).call(this)===0)return null;const{col:e}=Bn(vs,this).getTopStartCorner(),{col:n}=Bn(vs,this).getBottomEndCorner(),r=Ru(jc,this,qy).call(this,e,n);return{isRangeTrimmed:n!==r,startRow:-1,startCol:e,endRow:-1,endCol:r}}getAllColumnHeadersRange(){if(Bn(Wc,this).call(this)===0||Bn(Bc,this).call(this)===0)return null;const{col:e}=Bn(vs,this).getTopStartCorner(),{col:n}=Bn(vs,this).getBottomEndCorner(),r=Ru(jc,this,qy).call(this,e,n);return{isRangeTrimmed:n!==r,startRow:-Bn(Bc,this).call(this),startCol:e,endRow:-1,endCol:r}}}function qy(t,e){return Math.min(e,Math.max(t+Bn($b,this).call(this)-1,t))}function PJ(t,e){return Math.min(e,Math.max(t+Bn(Lb,this).call(this)-1,t))}function LL(t){const e=[],n=[];return H(t,r=>{const i=Math.min(r.startRow,r.endRow),o=Math.max(r.startRow,r.endRow);fe(i,o,l=>{e.indexOf(l)===-1&&e.push(l)});const s=Math.min(r.startCol,r.endCol),a=Math.max(r.startCol,r.endCol);fe(s,a,l=>{n.indexOf(l)===-1&&n.push(l)})}),{rows:e,columns:n}}function OJ(t,e){$L(t,e),e.add(t)}function Cs(t,e,n){$L(t,e),e.set(t,n)}function $L(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Uc(t,e,n){return(e=xJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xJ(t){var e=AJ(t,"string");return typeof e=="symbol"?e:e+""}function AJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cr(t,e){return t.get(dr(t,e))}function hi(t,e,n){return t.set(dr(t,e),n),n}function dr(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}ie.getSingleton().register("afterCopyLimit");ie.getSingleton().register("modifyCopyableRange");ie.getSingleton().register("beforeCut");ie.getSingleton().register("afterCut");ie.getSingleton().register("beforePaste");ie.getSingleton().register("afterPaste");ie.getSingleton().register("beforeCopy");ie.getSingleton().register("afterCopy");const Ky="copyPaste",HJ=80,NJ=["fragmentSelection"],$A=['<meta name="generator" content="Handsontable"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join("");var Fb=new WeakMap,Vb=new WeakMap,Wb=new WeakMap,Xl=new WeakMap,Df=new WeakMap,kf=new WeakMap,Zl=new WeakMap,Cm=new WeakMap,_r=new WeakSet;class DJ extends et{constructor(){super(...arguments),OJ(this,_r),Uc(this,"columnsLimit",1/0),Uc(this,"rowsLimit",1/0),Uc(this,"pasteMode","overwrite"),Uc(this,"uiContainer",this.hot.rootDocument.body),Cs(this,Fb,!1),Cs(this,Vb,!1),Cs(this,Wb,!1),Cs(this,Xl,"cells-only"),Cs(this,Df,!1),Cs(this,kf,!1),Cs(this,Zl,new IJ({countRows:()=>this.hot.countRows(),countColumns:()=>this.hot.countCols(),rowsLimit:()=>this.rowsLimit,columnsLimit:()=>this.columnsLimit,countColumnHeaders:()=>this.hot.view.getColumnHeadersCount()})),Cs(this,Cm,!1),Uc(this,"copyableRanges",[])}static get PLUGIN_KEY(){return Ky}static get SETTING_KEYS(){return[Ky,...NJ]}static get PLUGIN_PRIORITY(){return HJ}static get DEFAULT_SETTINGS(){return{pasteMode:"overwrite",rowsLimit:1/0,columnsLimit:1/0,copyColumnHeaders:!1,copyColumnGroupHeaders:!1,copyColumnHeadersOnly:!1}}isEnabled(){return!!this.hot.getSettings()[Ky]}enablePlugin(){var e,n,r=this;this.enabled||(this.pasteMode=(e=this.getSetting("pasteMode"))!==null&&e!==void 0?e:this.pasteMode,this.rowsLimit=isNaN(this.getSetting("rowsLimit"))?this.rowsLimit:this.getSetting("rowsLimit"),this.columnsLimit=isNaN(this.getSetting("columnsLimit"))?this.columnsLimit:this.getSetting("columnsLimit"),hi(Fb,this,this.getSetting("copyColumnHeaders")),hi(Vb,this,this.getSetting("copyColumnGroupHeaders")),hi(Wb,this,this.getSetting("copyColumnHeadersOnly")),this.uiContainer=(n=this.getSetting("uiContainer"))!==null&&n!==void 0?n:this.uiContainer,this.addHook("afterContextMenuDefaultOptions",i=>dr(_r,this,$J).call(this,i)),this.addHook("afterSelection",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return dr(_r,r,FJ).call(r,...o)}),this.addHook("afterSelectionEnd",()=>dr(_r,this,VJ).call(this)),this.eventManager.addEventListener(this.hot.rootDocument,"copy",function(){return r.onCopy(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"cut",function(){return r.onCut(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"paste",function(){return r.onPaste(...arguments)}),tm()&&(this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseenter",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return dr(_r,r,WJ).call(r,...o)}),this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseleave",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return dr(_r,r,BJ).call(r,...o)}),this.addHook("afterSelection",()=>dr(_r,this,jJ).call(this))),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin()}copy(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"cells-only";hi(Xl,this,e),hi(Df,this,!0),dr(_r,this,FA).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(){hi(kf,this,!0),dr(_r,this,FA).call(this,"cut")}getRangedCopyableData(e){return Rh(this.getRangedData(e))}getRangedData(e){const n=[],{rows:r,columns:i}=LL(e);return H(r,o=>{const s=[];H(i,a=>{o<0?s.push(this.hot.getColHeader(a,o)):s.push(this.hot.getCopyableData(o,a))}),n.push(s)}),n}paste(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;if(!e&&!n)return;const r=new _J;e&&r.clipboardData.setData("text/plain",e),n&&r.clipboardData.setData("text/html",n),this.onPaste(r)}setCopyableText(){const e=this.hot.getSelectedRangeLast();if(!e)return;if(e.isSingleHeader()){this.copyableRanges=[];return}cr(Zl,this).setSelectedRange(e);const n=new Map([["headers",null],["cells",null]]);cr(Xl,this)==="column-headers-only"?n.set("headers",cr(Zl,this).getMostBottomColumnHeadersRange()):(cr(Xl,this)==="with-column-headers"?n.set("headers",cr(Zl,this).getMostBottomColumnHeadersRange()):cr(Xl,this)==="with-column-group-headers"&&n.set("headers",cr(Zl,this).getAllColumnHeadersRange()),n.set("cells",cr(Zl,this).getCellsRange())),this.copyableRanges=Array.from(n.values()).filter(i=>i!==null).map(i=>{let{startRow:o,startCol:s,endRow:a,endCol:l}=i;return{startRow:o,startCol:s,endRow:a,endCol:l}}),this.copyableRanges=this.hot.runHooks("modifyCopyableRange",this.copyableRanges);const r=n.get("cells");if(r!==null&&r.isRangeTrimmed){const{startRow:i,startCol:o,endRow:s,endCol:a}=r;this.hot.runHooks("afterCopyLimit",s-i+1,a-o+1,this.rowsLimit,this.columnsLimit)}}isEditorOpened(){var e;return(e=this.hot.getActiveEditor())===null||e===void 0?void 0:e.isOpened()}populateValues(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.hot.getSelectedRangeLast();if(!e.length)return;const r=e.length,i=e[0].length,o=[],{row:s,col:a}=n.getTopStartCorner(),{row:l,col:u}=n.getBottomEndCorner();let c=s,h=a,d=s,f=a;for(;o.length<r||c<=l;){const{skipRowOnPaste:m,visualRow:C}=this.hot.getCellMeta(c,a);if(c=C+1,m===!0)continue;d=C,h=a;const y=[],E=o.length%r;for(;y.length<i||h<=u;){const{skipColumnOnPaste:v,visualCol:O}=this.hot.getCellMeta(s,h);if(h=O+1,v===!0)continue;f=O;const x=y.length%i;y.push(e[E][x])}o.push(y)}return hi(Cm,this,!0),this.hot.populateFromArray(s,a,o,void 0,void 0,"CopyPaste.paste",this.pasteMode),[s,a,d,f]}onCopy(e){const n=e.composedPath()[0],r=this.hot.getFocusManager().getRefocusElement(),i=n==null?void 0:n.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!cr(Df,this)||this.isEditorOpened()||ts(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!Mg(n,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),hi(Df,this,!1);const o=this.getRangedData(this.copyableRanges),s=dr(_r,this,kJ).call(this,this.copyableRanges);if(!!this.hot.runHooks("beforeCopy",o,this.copyableRanges,s)){const l=Rh(o);if(e&&e.clipboardData){const u=MO(o,this.hot.rootDocument);e.clipboardData.setData("text/plain",l),e.clipboardData.setData("text/html",[$A,u].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",l);this.hot.runHooks("afterCopy",o,this.copyableRanges,s)}hi(Xl,this,"cells-only")}onCut(e){const n=e.composedPath()[0],r=this.hot.getFocusManager().getRefocusElement(),i=n==null?void 0:n.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!cr(kf,this)||this.isEditorOpened()||ts(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!Mg(n,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),hi(kf,this,!1);const o=this.getRangedData(this.copyableRanges);if(!!this.hot.runHooks("beforeCut",o,this.copyableRanges)){const a=Rh(o);if(e&&e.clipboardData){const l=MO(o,this.hot.rootDocument);e.clipboardData.setData("text/plain",a),e.clipboardData.setData("text/html",[$A,l].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",a);this.hot.emptySelectedCells("CopyPaste.cut"),this.hot.runHooks("afterCut",o,this.copyableRanges)}}onPaste(e){const n=e.composedPath()[0],r=this.hot.getFocusManager().getRefocusElement(),i=n==null?void 0:n.hasAttribute("data-hot-input");if(!this.hot.isListening()||this.isEditorOpened()||!this.hot.getSelected()||ts(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!Mg(n,this.hot.rootElement)))return;e.preventDefault();let o;if(e&&typeof e.clipboardData<"u"){const c=BR(e.clipboardData.getData("text/html"),{ADD_TAGS:["meta"],ADD_ATTR:["content"],FORCE_BODY:!0});c&&/(<table)|(<TABLE)/g.test(c)?o=$Y(c,this.hot.rootDocument).data:o=e.clipboardData.getData("text/plain")}else typeof ClipboardEvent>"u"&&typeof this.hot.rootWindow.clipboardData<"u"&&(o=this.hot.rootWindow.clipboardData.getData("Text"));if(typeof o=="string"&&(o=_3(o)),o===void 0||o&&o.length===0||this.hot.runHooks("beforePaste",o,this.copyableRanges)===!1)return;const[s,a,l,u]=this.populateValues(o);this.hot.selectCell(s,a,Math.min(this.hot.countRows()-1,l),Math.min(this.hot.countCols()-1,u)),this.hot.runHooks("afterPaste",o,this.copyableRanges)}destroy(){super.destroy()}}function FA(t){if(tm()){const e=this.hot.getSelectedRangeLast();if(e){const{row:n,col:r}=e.highlight,i=this.hot.getCell(n,r,!0);i&&Nz(i,()=>{this.hot.rootDocument.execCommand(t)})}}else this.hot.rootDocument.execCommand(t)}function kJ(t){const{rows:e}=LL(t);let n=0;for(let r=0;r<e.length&&!(e[r]>=0);r++)n+=1;return{columnHeadersCount:n}}function LJ(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeLast();if(t){const{row:e,col:n}=t.highlight,r=this.hot.getCell(e,n,!0);r&&lD(r)}}}function FL(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeLast();if(t){const{row:e,col:n}=t.highlight,r=this.hot.getCell(e,n,!0);r!=null&&r.hasAttribute("contenteditable")&&uD(r)}}}function $J(t){t.items.push({name:"---------"},yJ(this)),cr(Fb,this)&&t.items.push(RJ(this)),cr(Vb,this)&&t.items.push(bJ(this)),cr(Wb,this)&&t.items.push(SJ(this)),t.items.push(EJ(this))}function FJ(t,e,n,r,i){cr(Cm,this)&&(i.value=!0),hi(Cm,this,!1)}function VJ(){this.isEditorOpened()||this.hot.getSettings().fragmentSelection||this.setCopyableText()}function WJ(){dr(_r,this,FL).call(this)}function BJ(){dr(_r,this,LJ).call(this)}function jJ(){dr(_r,this,FL).call(this)}function VL(t,e){return`border_row${t}col${e}`}function ph(){return{width:1,color:"#000"}}function Ko(){return{hide:!0}}function UJ(){return{width:1,color:"#000",cornerVisible:!1}}function Xy(t){if(ue(t.start)||ue(t.left)){var e;t.start=(e=t.start)!==null&&e!==void 0?e:t.left}if(ue(t.end)||ue(t.right)){var n;t.end=(n=t.end)!==null&&n!==void 0?n:t.right}return delete t.left,delete t.right,t}function zc(t){return ue(t.start)&&(t.left=t.start),ue(t.end)&&(t.right=t.end),t}function Zy(t,e){return{id:VL(t,e),border:UJ(),row:t,col:e,top:Ko(),bottom:Ko(),start:Ko(),end:Ko()}}function zJ(t,e){return sn(e,"border")&&e.border&&(t.border=e.border),sn(e,"top")&&ue(e.top)&&(e.top?(De(e.top)||(e.top=ph()),t.top=e.top):(e.top=Ko(),t.top=e.top)),sn(e,"bottom")&&ue(e.bottom)&&(e.bottom?(De(e.bottom)||(e.bottom=ph()),t.bottom=e.bottom):(e.bottom=Ko(),t.bottom=e.bottom)),sn(e,"start")&&ue(e.start)&&(e.start?(De(e.start)||(e.start=ph()),t.start=e.start):(e.start=Ko(),t.start=e.start)),sn(e,"end")&&ue(e.end)&&(e.end?(De(e.end)||(e.end=ph()),t.end=e.end):(e.end=Ko(),t.end=e.end)),t}function os(t,e){let n=!1;return H(t.getSelectedRange(),r=>{r.forAll((i,o)=>{if(i<0||o<0)return;const s=t.getCellMeta(i,o).borders;if(s)if(e){if(!sn(s[e],"hide")||s[e].hide===!1)return n=!0,!1}else return n=!0,!1})}),n}function Hp(t){return`<span class="selected">✓</span>${t}`}function YJ(t){return t.some(e=>ue(e.left)||ue(e.right))}function GJ(t){return t.some(e=>ue(e.start)||ue(e.end))}const qJ=new Map([["left","start"],["right","end"]]);function KJ(t){var e;return(e=qJ.get(t))!==null&&e!==void 0?e:t}function XJ(t){return{key:"borders:bottom",name(){let e=this.getTranslatedPhrase(i0);return os(this,"bottom")&&(e=Hp(e)),e},callback(e,n){const r=os(this,"bottom");t.prepareBorder(n,"bottom",r)}}}function ZJ(t){const e=t.hot.isRtl()?"end":"start";return{key:"borders:left",name(){let n=this.getTranslatedPhrase(o0);return os(this,e)&&(n=Hp(n)),n},callback(n,r){const i=os(this,e);t.prepareBorder(r,e,i)}}}function JJ(t){return{key:"borders:no_borders",name(){return this.getTranslatedPhrase(s0)},callback(e,n){t.prepareBorder(n,"noBorders")},disabled(){return!os(this)}}}function QJ(t){const e=t.hot.isRtl()?"start":"end";return{key:"borders:right",name(){let n=this.getTranslatedPhrase(r0);return os(this,e)&&(n=Hp(n)),n},callback(n,r){const i=os(this,e);t.prepareBorder(r,e,i)}}}function eQ(t){return{key:"borders:top",name(){let e=this.getTranslatedPhrase(n0);return os(this,"top")&&(e=Hp(e)),e},callback(e,n){const r=os(this,"top");t.prepareBorder(n,"top",r)}}}function tQ(t,e){nQ(t,e),e.add(t)}function nQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function rQ(t,e,n){return(e=iQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iQ(t){var e=oQ(t,"string");return typeof e=="symbol"?e:e+""}function oQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function VA(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Lg="customBorders",sQ=90;var Jy=new WeakSet;class aQ extends et{constructor(){super(...arguments),tQ(this,Jy),rQ(this,"savedBorders",[])}static get PLUGIN_KEY(){return Lg}static get PLUGIN_PRIORITY(){return sQ}isEnabled(){return!!this.hot.getSettings()[Lg]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>VA(Jy,this,lQ).call(this,e)),this.addHook("init",()=>VA(Jy,this,uQ).call(this)),super.enablePlugin())}disablePlugin(){this.hideBorders(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.changeBorderSettings(),super.updatePlugin()}setBorders(e,n){let r=["top","bottom","start","end"],i=null;n&&(this.checkSettingsCohesion([n]),r=Object.keys(n),i=Xy(n));const o=Lu(e),s=Kh(o,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)});H(e,a=>{s(a).forAll((l,u)=>{H(r,c=>{this.prepareBorderFromCustomAdded(l,u,i,KJ(c))})})}),this.hot.view.render()}getBorders(e){if(!Array.isArray(e))return this.savedBorders;const n=Lu(e),r=Kh(n,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)}),i=[];return H(e,o=>{r(o).forAll((s,a)=>{H(this.savedBorders,l=>{l.row===s&&l.col===a&&i.push(zc(l))})})}),i}clearBorders(e){e?this.setBorders(e):(H(this.savedBorders,n=>{this.clearBordersFromSelectionSettings(n.id),this.clearNullCellRange(),this.hot.removeCellMeta(n.row,n.col,"borders")}),this.savedBorders.length=0)}insertBorderIntoSettings(e,n){this.checkSavedBorders(e)||this.savedBorders.push(e);const i=this.hot._createCellRange(this.hot._createCellCoords(e.row,e.col));this.checkCustomSelections(e,i,n)||this.hot.selection.highlight.addCustomSelection({border:e,visualCellRange:i})}prepareBorderFromCustomAdded(e,n,r,i){const o=this.hot.countRows(),s=this.hot.countCols();if(e>=o||n>=s)return;let a=Zy(e,n);r&&(a=zJ(a,r),H(this.hot.selection.highlight.customSelections,l=>{if(a.id===l.settings.id)return Object.assign(l.settings,r),a.id=l.settings.id,a.top=l.settings.top,a.bottom=l.settings.bottom,a.start=l.settings.start,a.end=l.settings.end,!1})),this.hot.setCellMeta(e,n,"borders",zc(a)),this.insertBorderIntoSettings(a,i)}prepareBorderFromCustomAddedRange(e,n){const r=Math.min(e.to.row,this.hot.countRows()-1),i=Math.min(e.to.col,this.hot.countCols()-1);fe(e.from.row,r,o=>{fe(e.from.col,i,s=>{const a=Zy(o,s);let l=0;o===e.from.row&&sn(n,"top")&&(l+=1,a.top=n.top),o===e.to.row&&sn(n,"bottom")&&(l+=1,a.bottom=n.bottom),s===e.from.col&&sn(n,"start")&&(l+=1,a.start=n.start),s===e.to.col&&sn(n,"end")&&(l+=1,a.end=n.end),l>0&&(this.hot.setCellMeta(o,s,"borders",zc(a)),this.insertBorderIntoSettings(a))})})}removeAllBorders(e,n){const r=VL(e,n);this.spliceBorder(r),this.clearBordersFromSelectionSettings(r),this.clearNullCellRange(),this.hot.removeCellMeta(e,n,"borders")}setBorder(e,n,r,i){let o=this.hot.getCellMeta(e,n).borders;!o||o.border===void 0?o=Zy(e,n):o=Xy(o),i?(o[r]=Ko(),this.countHide(o)===4?this.removeAllBorders(e,n):(this.checkCustomSelectionsFromContextMenu(o,r,i)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,n,"borders",zc(o)))):(o[r]=ph(),this.checkCustomSelectionsFromContextMenu(o,r,i)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,n,"borders",zc(o)))}prepareBorder(e,n,r){H(e,i=>{let{start:o,end:s}=i;if(o.row===s.row&&o.col===s.col)n==="noBorders"?this.removeAllBorders(o.row,o.col):this.setBorder(o.row,o.col,n,r);else switch(n){case"noBorders":fe(o.col,s.col,a=>{fe(o.row,s.row,l=>{this.removeAllBorders(l,a)})});break;case"top":fe(o.col,s.col,a=>{this.setBorder(o.row,a,n,r)});break;case"bottom":fe(o.col,s.col,a=>{this.setBorder(s.row,a,n,r)});break;case"start":fe(o.row,s.row,a=>{this.setBorder(a,o.col,n,r)});break;case"end":fe(o.row,s.row,a=>{this.setBorder(a,s.col,n,r)});break}})}createCustomBorders(e){H(e,n=>{const r=Xy(n);n.range?this.prepareBorderFromCustomAddedRange(n.range,r):this.prepareBorderFromCustomAdded(n.row,n.col,r)})}countHide(e){const{top:n,bottom:r,start:i,end:o}=e;return wr([n,r,i,o],(a,l)=>{let u=a;return l&&l.hide&&(u+=1),u},0)}clearBordersFromSelectionSettings(e){const n=ze(this.hot.selection.highlight.customSelections,r=>r.settings.id).indexOf(e);n>-1&&this.hot.selection.highlight.customSelections[n].clear()}clearNullCellRange(){H(this.hot.selection.highlight.customSelections,(e,n)=>{if(e.cellRange===null)return this.hot.selection.highlight.customSelections[n].destroy(),this.hot.selection.highlight.customSelections.splice(n,1),!1})}hideBorders(){H(this.savedBorders,e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange()})}spliceBorder(e){const n=ze(this.savedBorders,r=>r.id).indexOf(e);n>-1&&this.savedBorders.splice(n,1)}checkSavedBorders(e){let n=!1;return this.countHide(e)===4?(this.spliceBorder(e.id),n=!0):H(this.savedBorders,(i,o)=>{if(e.id===i.id)return this.savedBorders[o]=e,n=!0,!1}),n}checkCustomSelectionsFromContextMenu(e,n,r){let i=!1;return H(this.hot.selection.highlight.customSelections,o=>{if(e.id===o.settings.id){const s=this.hot.view._wt.selectionManager.getBorderInstances(o);return H(s,a=>{a.toggleHiddenClass(n,r)}),i=!0,!1}}),i}checkCustomSelections(e,n,r){const i=this.countHide(e);let o=!1;return i===4?(this.removeAllBorders(e.row,e.col),o=!0):H(this.hot.selection.highlight.customSelections,s=>{if(e.id===s.settings.id){if(s.visualCellRange=n,s.commit(),r){const a=this.hot.view._wt.selectionManager.getBorderInstances(s);H(a,l=>{l.changeBorderStyle(r,e)})}return o=!0,!1}}),o}changeBorderSettings(){const e=this.hot.getSettings()[Lg];if(Array.isArray(e)){const n=Kn(e);this.checkSettingsCohesion(n),n.length||(this.savedBorders=n),this.createCustomBorders(n)}else e!==void 0&&this.createCustomBorders(this.savedBorders)}checkSettingsCohesion(e){const n=YJ(e),r=GJ(e);if(n&&r)throw new Error('The "left"/"right" and "start"/"end" options should not be used together. Please use only the option "start"/"end".');if(this.hot.isRtl()&&n)throw new Error('The "left"/"right" properties are not supported for RTL. Please use option "start"/"end".')}destroy(){super.destroy()}}function lQ(t){this.hot.getSettings()[Lg]&&t.items.push({name:"---------"},{key:"borders",name(){return this.getTranslatedPhrase(t0)},disabled(){const e=this.getSelectedRangeLast();return!e||e.isSingleHeader()?!0:this.selection.isSelectedByCorner()},submenu:{items:[eQ(this),QJ(this),XJ(this),ZJ(this),JJ(this)]}})}function uQ(){this.changeBorderSettings()}function cQ(t,e){hQ(t,e),e.add(t)}function hQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qy(t,e,n){return(e=dQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dQ(t){var e=fQ(t,"string");return typeof e=="symbol"?e:e+""}function fQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function WA(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const BA="dragToScroll",gQ=100;var eS=new WeakSet;class mQ extends et{constructor(){super(...arguments),cQ(this,eS),Qy(this,"boundaries",null),Qy(this,"callback",null),Qy(this,"listening",!1)}static get PLUGIN_KEY(){return BA}static get PLUGIN_PRIORITY(){return gQ}isEnabled(){return!!this.hot.getSettings()[BA]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",e=>WA(eS,this,jA).call(this,e)),this.addHook("afterOnCellCornerMouseDown",e=>WA(eS,this,jA).call(this,e)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.unregisterEvents(),super.disablePlugin()}setBoundaries(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{left:0,right:this.hot.rootWindow.innerWidth,top:0,bottom:this.hot.rootWindow.innerHeight};this.boundaries=e}setCallback(e){this.callback=e}check(e,n){let r=0,i=0;n<this.boundaries.top?i=n-this.boundaries.top:n>this.boundaries.bottom&&(i=n-this.boundaries.bottom),e<this.boundaries.left?r=e-this.boundaries.left:e>this.boundaries.right&&(r=e-this.boundaries.right),this.callback(r,i)}listen(){this.listening=!0}unlisten(){this.listening=!1}isListening(){return this.listening}registerEvents(){const{rootWindow:e}=this.hot;let n=e;for(;n;)this.eventManager.addEventListener(n.document,"contextmenu",()=>this.unlisten()),this.eventManager.addEventListener(n.document,"mouseup",()=>this.unlisten()),this.eventManager.addEventListener(n.document,"mousemove",r=>this.onMouseMove(r)),n=Nu(n)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){this.isListening()&&this.check(e.clientX,e.clientY)}destroy(){super.destroy()}}function jA(t){if(ll(t))return;const e=this.hot.view._wt.wtOverlays.topOverlay.mainTableScrollableElement;this.setBoundaries(e!==this.hot.rootWindow?e.getBoundingClientRect():void 0),this.setCallback((n,r)=>{var i,o;const s=(i=e.scrollLeft)!==null&&i!==void 0?i:e.scrollX,a=(o=e.scrollTop)!==null&&o!==void 0?o:e.scrollY;e.scroll(s+Math.sign(n)*50,a+Math.sign(r)*20)}),this.listen()}function pQ(t,e){WL(t,e),e.add(t)}function wQ(t,e,n){WL(t,e),e.set(t,n)}function WL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function tS(t,e,n){return(e=vQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vQ(t){var e=CQ(t,"string");return typeof e=="symbol"?e:e+""}function CQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function yQ(t,e){return t.get(Ur(t,e))}function BL(t,e,n){return t.set(Ur(t,e),n),n}function Ur(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}ie.getSingleton().register("afterDropdownMenuDefaultOptions");ie.getSingleton().register("beforeDropdownMenuShow");ie.getSingleton().register("afterDropdownMenuShow");ie.getSingleton().register("afterDropdownMenuHide");ie.getSingleton().register("afterDropdownMenuExecute");const $g="dropdownMenu",SQ=230,ed="changeType",nS=$g;var Np=new WeakMap,gi=new WeakSet;class Dp extends et{static get PLUGIN_KEY(){return $g}static get PLUGIN_PRIORITY(){return SQ}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Od,xd,Ne,Hd,Ne,Tp,Ne,Ad,Ne,jr]}constructor(e){super(e),pQ(this,gi),tS(this,"commandExecutor",new PL(this.hot)),tS(this,"itemsFactory",null),tS(this,"menu",null),wQ(this,Np,!1),this.hot.addHook("afterGetColHeader",(n,r)=>Ur(gi,this,RQ).call(this,n,r))}isEnabled(){return this.hot.getSettings()[$g]}enablePlugin(){var e=this;if(this.enabled)return;this.itemsFactory=new OL(this.hot,Dp.DEFAULT_ITEMS),this.addHook("beforeOnCellMouseDown",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Ur(gi,e,PQ).call(e,...o)}),this.addHook("beforeViewportScrollHorizontally",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Ur(gi,e,IQ).call(e,...o)});const n=this.hot.getSettings()[$g],r={items:this.itemsFactory.getItems(n)};this.registerEvents(),typeof n.callback=="function"&&this.commandExecutor.setCommonCallback(n.callback),this.registerShortcuts(),super.enablePlugin(),this.callOnPluginsReady(()=>{this.hot.runHooks("afterDropdownMenuDefaultOptions",r),this.itemsFactory.setPredefinedItems(r.items);const i=this.itemsFactory.getItems(n);this.menu&&this.menu.destroy(),this.menu=new rc(this.hot,{className:"htDropdownMenu",keepInViewport:!0,container:n.uiContainer||this.hot.rootDocument.body}),this.hot.runHooks("beforeDropdownMenuSetItems",i),this.menu.setMenuItems(i),this.menu.addLocalHook("beforeOpen",()=>Ur(gi,this,EQ).call(this)),this.menu.addLocalHook("afterOpen",()=>Ur(gi,this,TQ).call(this)),this.menu.addLocalHook("afterSubmenuOpen",o=>Ur(gi,this,_Q).call(this,o)),this.menu.addLocalHook("afterClose",()=>Ur(gi,this,MQ).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return e.executeCommand.call(e,...s)}),H(i,o=>this.commandExecutor.registerCommand(o.key,o))})}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.close(),this.menu&&this.menu.destroy(),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager().getContext("grid"),n=()=>{const{highlight:r}=this.hot.getSelectedRangeLast();if((r.isHeader()&&r.row===-1||r.isCell())&&r.col>=0){this.hot.selectColumns(r.col,r.col,-1);const{from:i}=this.hot.getSelectedRangeLast(),o=Ep(this.menu.container,this.hot.rootDocument),s=this.hot.getCell(-1,i.col,!0).querySelector(`.${ed}`),a=s.getBoundingClientRect();this.open({left:a.left+o.left,top:a.top+s.offsetHeight+o.top},{left:a.width,right:0,above:0,below:3}),this.menu.getNavigator().toFirstItem()}};e.addShortcuts([{keys:[["Shift","Alt","ArrowDown"],["Control/Meta","Enter"]],callback:n,runOnlyIf:()=>{var r;const i=(r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.highlight;return i&&this.hot.selection.isCellVisible(i)&&i.isHeader()&&!this.menu.isOpened()},captureCtrl:!0,group:nS},{keys:[["Shift","Alt","ArrowDown"]],callback:n,runOnlyIf:()=>{var r;const i=(r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.highlight;return i&&this.hot.selection.isCellVisible(i)&&i.isCell()&&!this.menu.isOpened()},group:nS}])}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(nS)}registerEvents(){this.eventManager.addEventListener(this.hot.rootElement,"click",e=>Ur(gi,this,bQ).call(this,e))}open(e){var n;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{above:0,below:0,left:0,right:0};(n=this.menu)!==null&&n!==void 0&&n.isOpened()||(this.menu.open(),ke(r,(i,o)=>{this.menu.setOffset(o,i)}),this.menu.setPosition(e))}close(){var e;(e=this.menu)===null||e===void 0||e.close()}executeCommand(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.commandExecutor.execute(e,...r)}setListening(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.menu.isOpened()&&(e?this.menu.hotMenu.listen():this.menu.hotMenu.unlisten())}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function jL(t){t.getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Control/Meta","A"]],callback:()=>!1}])}function bQ(t){if(ye(t.target,ed)){const e=Ep(this.menu.container,this.hot.rootDocument),n=t.target.getBoundingClientRect();t.stopPropagation(),BL(Np,this,!1),this.open({left:n.left+e.left,top:n.top+t.target.offsetHeight+e.top},{left:n.width,right:0,above:0,below:3})}}function RQ(t,e){const n=e.parentNode;if(!n)return;const r=n.parentNode.childNodes,i=Array.prototype.indexOf.call(r,n);if(t<0||i!==r.length-1)return;const o=e.querySelector(`.${ed}`);if(this.enabled&&o)return;if(!this.enabled){o&&o.parentNode.removeChild(o);return}const s=this.hot.rootDocument.createElement("button");s.className=ed,s.type="button",s.tabIndex=-1,this.hot.getSettings().ariaTags&&(Re(s,[bl(),Uh(" ")]),Re(e,[GN("menu")])),s.onclick=function(){return!1},e.firstChild.insertBefore(s,e.firstChild.firstChild)}function EQ(){this.hot.runHooks("beforeDropdownMenuShow",this)}function TQ(){this.hot.runHooks("afterDropdownMenuShow",this),Ur(gi,this,jL).call(this,this.menu)}function _Q(t){Ur(gi,this,jL).call(this,t)}function MQ(){this.hot.listen(),this.hot.runHooks("afterDropdownMenuHide",this)}function IQ(t){return yQ(Np,this)?null:t}function PQ(t){ye(t.target,ed)&&BL(Np,this,!0)}Dp.SEPARATOR={name:Ne};function UA(t,e,n){return(e=OQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function OQ(t){var e=xQ(t,"string");return typeof e=="symbol"?e:e+""}function xQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class AQ{constructor(e){UA(this,"hot",void 0),UA(this,"options",{}),this.hot=e}setOptions(e){this.options=e}getData(){const{startRow:e,startCol:n,endRow:r,endCol:i}=this._getDataRange(),o=this.options,s=[];return fe(e,r,a=>{const l=[];!o.exportHiddenRows&&this._isHiddenRow(a)||(fe(n,i,u=>{!o.exportHiddenColumns&&this._isHiddenColumn(u)||l.push(this.hot.getDataAtCell(a,u))}),s.push(l))}),s}getRowHeaders(){const e=[];if(this.options.rowHeaders){const{startRow:n,endRow:r}=this._getDataRange(),i=this.hot.getRowHeader();fe(n,r,o=>{!this.options.exportHiddenRows&&this._isHiddenRow(o)||e.push(i[o])})}return e}getColumnHeaders(){const e=[];if(this.options.columnHeaders){const{startCol:n,endCol:r}=this._getDataRange(),i=this.hot.getColHeader();fe(n,r,o=>{!this.options.exportHiddenColumns&&this._isHiddenColumn(o)||e.push(i[o])})}return e}_getDataRange(){const e=this.hot.countCols()-1,n=this.hot.countRows()-1;let[r=0,i=0,o=n,s=e]=this.options.range;return r=Math.max(r,0),i=Math.max(i,0),o=Math.min(o,n),s=Math.min(s,e),{startRow:r,startCol:i,endRow:o,endCol:s}}_isHiddenRow(e){return this.hot.rowIndexMapper.isHidden(this.hot.toPhysicalRow(e))}_isHiddenColumn(e){return this.hot.columnIndexMapper.isHidden(this.hot.toPhysicalColumn(e))}}function zA(t,e,n){return(e=HQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function HQ(t){var e=NQ(t,"string");return typeof e=="symbol"?e:e+""}function NQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class vT{static get DEFAULT_OPTIONS(){return{mimeType:"text/plain",fileExtension:"txt",filename:"Handsontable [YYYY]-[MM]-[DD]",encoding:"utf-8",bom:!1,columnHeaders:!1,rowHeaders:!1,exportHiddenColumns:!1,exportHiddenRows:!1,range:[]}}constructor(e,n){zA(this,"dataProvider",void 0),zA(this,"options",void 0),this.dataProvider=e,this.options=this._mergeOptions(n),this.dataProvider.setOptions(this.options)}_mergeOptions(e){let n=fo(this.constructor.DEFAULT_OPTIONS);const r=new Date;return n=ln(fo(vT.DEFAULT_OPTIONS),n),n=ln(n,e),n.filename=UN(n.filename,{YYYY:r.getFullYear(),MM:`${r.getMonth()+1}`.padStart(2,"0"),DD:`${r.getDate()}`.padStart(2,"0")}),n}}function DQ(t,e){kQ(t,e),e.add(t)}function kQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function YA(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const UL="\r",LQ='"',$Q=`
276
- `,FQ="=",VQ="+",WQ="-",BQ="@",jQ=" ";var rS=new WeakSet;class UQ extends vT{constructor(){super(...arguments),DQ(this,rS)}static get DEFAULT_OPTIONS(){return{mimeType:"text/csv",fileExtension:"csv",bom:!0,columnDelimiter:",",rowDelimiter:`\r
277
- `,sanitizeValues:!1}}export(){const e=this.options,n=this.dataProvider.getData();let r=this.dataProvider.getColumnHeaders();const i=r.length>0,o=this.dataProvider.getRowHeaders(),s=o.length>0;let a=e.bom?"\uFEFF":"";return i&&(r=ze(r,l=>this._escapeCell(l,{force:!0,sanitizeValue:e.sanitizeValues})),s&&(a+=e.columnDelimiter),a+=r.join(e.columnDelimiter),a+=e.rowDelimiter),H(n,(l,u)=>{u>0&&(a+=e.rowDelimiter),s&&(a+=this._escapeCell(o[u],{sanitizeValue:e.sanitizeValues}),a+=e.columnDelimiter);const c=l.map(h=>this._escapeCell(h,{sanitizeValue:e.sanitizeValues})).join(e.columnDelimiter);a+=c}),a}_escapeCell(e){let{force:n=!1,sanitizeValue:r=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=At(e);return i===""||(r&&(n=!0),r instanceof RegExp?i=YA(rS,this,YQ).call(this,i,r):typeof r=="function"?i=r(i):r&&(i=YA(rS,this,zQ).call(this,i)),(n||i.indexOf(UL)>=0||i.indexOf(LQ)>=0||i.indexOf($Q)>=0||i.indexOf(this.options.columnDelimiter)>=0)&&(i=i.replace(new RegExp('"',"g"),'""'),i=`"${i}"`)),i}}function zQ(t){return t.startsWith(FQ)||t.startsWith(VQ)||t.startsWith(WQ)||t.startsWith(BQ)||t.startsWith(jQ)||t.startsWith(UL)?`'${t}`:t}function YQ(t,e){return e.test(t)?`'${t}`:t}const GQ="csv",Bb={[GQ]:UQ};function qQ(t,e,n){return typeof Bb[t]=="function"?new Bb[t](e,n):null}const KQ="exportFile",XQ=240;class ZQ extends et{static get PLUGIN_KEY(){return KQ}static get PLUGIN_PRIORITY(){return XQ}isEnabled(){return!0}exportAsString(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._createTypeFormatter(e,n).export()}exportAsBlob(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._createBlob(this._createTypeFormatter(e,n))}downloadFile(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{rootDocument:r,rootWindow:i}=this.hot,o=this._createTypeFormatter(e,n),s=this._createBlob(o),a=i.URL||i.webkitURL,l=r.createElement("a"),u=`${o.options.filename}.${o.options.fileExtension}`;if(l.download!==void 0){const c=a.createObjectURL(s);l.style.display="none",l.setAttribute("href",c),l.setAttribute("download",u),r.body.appendChild(l),l.dispatchEvent(new MouseEvent("click")),r.body.removeChild(l),setTimeout(()=>{a.revokeObjectURL(c)},100)}else navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob(s,u)}_createTypeFormatter(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Bb[e])throw new Error(`Export format type "${e}" is not supported.`);return qQ(e,new AQ(this.hot),n)}_createBlob(e){let n=null;return typeof Blob<"u"&&(n=new Blob([e.export()],{type:`${e.options.mimeType};charset=${e.options.encoding}`})),n}}function Jl(t,e,n){return(e=JQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function JQ(t){var e=QQ(t,"string");return typeof e=="symbol"?e:e+""}function QQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Nd{constructor(e,n){let{id:r,stateless:i=!0}=n;Jl(this,"hot",void 0),Jl(this,"id",void 0),Jl(this,"elements",[]),Jl(this,"hidden",!1),Jl(this,"stateId",""),Jl(this,"state",void 0),this.hot=e,this.id=r,this.stateId=`Filters.component.${this.id}`,this.state=i?null:this.hot.columnIndexMapper.registerMap(this.stateId,new gp)}getElements(){return this.elements}reset(){H(this.elements,e=>e.reset())}hide(){this.hidden=!0}show(){this.hidden=!1}isHidden(){return this.hot===null||this.hidden}restoreState(e){this.state&&this.setState(this.state.getValueAtIndex(e))}setState(){throw new Error("The state setting logic is not implemented")}saveState(e){this.state&&this.state.setValueAtIndex(e,this.getState())}getState(){throw new Error("The state gathering logic is not implemented")}destroy(){this.hot.columnIndexMapper.unregisterMap(this.stateId),this.clearLocalHooks(),H(this.elements,e=>e.destroy()),this.state=null,this.elements=null,this.hot=null}}gt(Nd,En);const td={};function qs(t,e){if(!td[t])throw Error(`Filter condition "${t}" does not exist.`);const{condition:n,descriptor:r}=td[t];let i=e;return r.inputValuesDecorator&&(i=r.inputValuesDecorator(i)),function(o){return n.apply(o.meta.instance,[].concat([o],[i]))}}function Qa(t){if(!td[t])throw Error(`Filter condition "${t}" does not exist.`);return td[t].descriptor}function en(t,e,n){n.key=t,td[t]={condition:e,descriptor:n}}const Cn="none";function eee(){return!0}en(Cn,eee,{name:mp,inputsCount:0,showOperators:!1});const _h="empty";function tee(t){return Yt(t.value)}en(_h,tee,{name:f0,inputsCount:0,showOperators:!0});const Fg="not_empty";function nee(t,e){return!qs(_h,e)(t)}en(Fg,nee,{name:g0,inputsCount:0,showOperators:!0});const Mh="eq";function ree(t,e){let[n]=e;return At(t.value).toLocaleLowerCase(t.meta.locale)===At(n)}en(Mh,ree,{name:m0,inputsCount:1,showOperators:!0});const Vg="neq";function iee(t,e){return!qs(Mh,e)(t)}en(Vg,iee,{name:p0,inputsCount:1,showOperators:!0});const zL="gt";function oee(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value>r}en(zL,oee,{name:S0,inputsCount:1,showOperators:!0});const YL="gte";function see(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value>=r}en(YL,see,{name:b0,inputsCount:1,showOperators:!0});const GL="lt";function aee(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value<r}en(GL,aee,{name:R0,inputsCount:1,showOperators:!0});const qL="lte";function lee(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value<=r}en(qL,lee,{name:E0,inputsCount:1,showOperators:!0});const CT="date_after";function uee(t,e){let[n]=e;const r=Z(t.value,t.meta.dateFormat),i=Z(n,t.meta.dateFormat);return!r.isValid()||!i.isValid()?!1:r.diff(i)>=0}en(CT,uee,{name:M0,inputsCount:1,showOperators:!0});const yT="date_before";function cee(t,e){let[n]=e;const r=Z(t.value,t.meta.dateFormat),i=Z(n,t.meta.dateFormat);return!r.isValid()||!i.isValid()?!1:r.diff(i)<=0}en(yT,cee,{name:I0,inputsCount:1,showOperators:!0});const ym="between";function hee(t,e){let[n,r]=e,i=n,o=r;if(t.meta.type==="numeric"){const s=parseFloat(i,10),a=parseFloat(o,10);i=Math.min(s,a),o=Math.max(s,a)}else if(t.meta.type==="date"){const s=qs(yT,[o]),a=qs(CT,[i]);return s(t)&&a(t)}return t.value>=i&&t.value<=o}en(ym,hee,{name:T0,inputsCount:2,showOperators:!0});const KL="not_between";function dee(t,e){return!qs(ym,e)(t)}en(KL,dee,{name:_0,inputsCount:2,showOperators:!0});const XL="begins_with";function fee(t,e){let[n]=e;return At(t.value).toLocaleLowerCase(t.meta.locale).startsWith(At(n))}en(XL,fee,{name:w0,inputsCount:1,showOperators:!0});const ZL="ends_with";function gee(t,e){let[n]=e;return At(t.value).toLocaleLowerCase(t.meta.locale).endsWith(At(n))}en(ZL,gee,{name:v0,inputsCount:1,showOperators:!0});const ST="contains";function mee(t,e){let[n]=e;return At(t.value).toLocaleLowerCase(t.meta.locale).indexOf(At(n))>=0}en(ST,mee,{name:C0,inputsCount:1,showOperators:!0});const JL="not_contains";function pee(t,e){return!qs(ST,e)(t)}en(JL,pee,{name:y0,inputsCount:1,showOperators:!0});const QL="date_tomorrow";function wee(t){const e=Z(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(Z().subtract(-1,"days").startOf("day"),"d"):!1}en(QL,wee,{name:O0,inputsCount:0});const e$="date_today";function vee(t){const e=Z(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(Z().startOf("day"),"d"):!1}en(e$,vee,{name:P0,inputsCount:0});const t$="date_yesterday";function Cee(t){const e=Z(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(Z().subtract(1,"days").startOf("day"),"d"):!1}en(t$,Cee,{name:x0,inputsCount:0});jz();function yee(t,e){let n=t;return n===""&&(n=`(${e})`),n}function Dd(t){const e=new Set(t);return function(n){return e.has(n)}}function bT(t){return t??""}function jb(t){return Array.from(new Set(t)).map(e=>bT(e)).sort((e,n)=>typeof e=="number"&&typeof n=="number"?e-n:e===n?0:e>n?1:-1)}function GA(t,e,n,r){const i=[],o=t===e;let s;return o||(s=Dd(e)),t.forEach(a=>{let l=!1;(o||s(a))&&(l=!0);const u={checked:l,value:a,visualValue:yee(a,n)};r&&r(u),i.push(u)}),i}const el="by_value";function See(t,e){let[n]=e;return n(t.value)}en(el,See,{name:"By value",inputsCount:0,inputValuesDecorator(t){let[e]=t;return[Dd(e)]},showOperators:!1});const nd={};function bee(t){if(!nd[t])throw Error(`Operation with id "${t}" does not exist.`);const e=nd[t].func;return function(n,r){return e(n,r)}}function Ree(t){return nd[t].name}function RT(t,e,n){nd[t]={name:e,func:n}}const Ys="conjunction",Eee=N0;function Tee(t,e){return t.every(n=>n.func(e))}RT(Ys,Eee,Tee);const Sm="disjunction",_ee=pp;function Mee(t,e){return t.some(n=>n.func(e))}RT(Sm,_ee,Mee);const ET="disjunctionWithExtraCondition",Iee=pp;function Pee(t,e){if(t.length<3)throw Error("Operation doesn't work on less then three conditions.");return t.slice(0,t.length-1).some(n=>n.func(e))&&t[t.length-1].func(e)}RT(ET,Iee,Pee);const Oee="numeric",n$="text",xee="date",qA={[Oee]:[Cn,Ne,_h,Fg,Ne,Mh,Vg,Ne,zL,YL,GL,qL,ym,KL],[n$]:[Cn,Ne,_h,Fg,Ne,Mh,Vg,Ne,XL,ZL,Ne,ST,JL],[xee]:[Cn,Ne,_h,Fg,Ne,Mh,Vg,Ne,yT,CT,ym,Ne,QL,e$,t$]};function Aee(t){const e=[];let n=t;return qA[n]||(n=n$),H(qA[n],r=>{let i;r===Ne?i={name:Ne}:i=fo(Qa(r)),e.push(i)}),e}function Yc(t,e,n){return(e=Hee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hee(t){var e=Nee(t,"string");return typeof e=="symbol"?e:e+""}function Nee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const iS="built",oS="building",KA=["click","input","keydown","keypress","keyup","focus","blur","change"];let bi=class r${static get DEFAULTS(){return fo({className:"",value:"",tagName:"div",children:[],wrapIt:!0})}constructor(e,n){Yc(this,"hot",void 0),Yc(this,"eventManager",new _i(this)),Yc(this,"options",void 0),Yc(this,"_element",void 0),Yc(this,"buildState",void 0),this.hot=e,this.options=ln(r$.DEFAULTS,n),this._element=this.hot.rootDocument.createElement(this.options.wrapIt?"div":this.options.tagName)}setValue(e){this.options.value=e,this.update()}getValue(){return this.options.value}get element(){return this.buildState===oS?this._element:this.buildState===iS?(this.update(),this._element):(this.buildState=oS,this.build(),this.buildState=iS,this._element)}isBuilt(){return this.buildState===iS}translateIfPossible(e){return typeof e=="string"&&e.startsWith(Xn)?this.hot.getTranslatedPhrase(e):e}build(){const e=(n,r)=>{this.eventManager.addEventListener(n,r,i=>this.runLocalHooks(r,i,this))};if(this.buildState||(this.buildState=oS),this._element.setAttribute("data-hot-input",!0),this.options.tabIndex!==void 0&&this._element.setAttribute("tabindex",this.options.tabIndex),this.options.role!==void 0&&this._element.setAttribute("role",this.options.role),this.options.className&&X(this._element,this.options.className),this.options.children.length)H(this.options.children,n=>this._element.appendChild(n.element));else if(this.options.wrapIt){const n=this.hot.rootDocument.createElement(this.options.tagName);n.setAttribute("data-hot-input",!0),ke(this.options,(r,i)=>{n[i]!==void 0&&i!=="className"&&i!=="tagName"&&i!=="children"&&(n[i]=this.translateIfPossible(r))}),this._element.appendChild(n),H(KA,r=>e(n,r))}else H(KA,n=>e(this._element,n))}update(){}reset(){this.options.value="",this.update()}show(){this.element.style.display=""}hide(){this.element.style.display="none"}focus(){}destroy(){this.eventManager.destroy(),this.eventManager=null,this.hot=null,this._element.parentNode&&this._element.parentNode.removeChild(this._element),this._element=null}};gt(bi,En);function Dee(t,e){i$(t,e),e.add(t)}function kee(t,e,n){i$(t,e),e.set(t,n)}function i$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Lf(t,e){return t.get(TT(t,e))}function Lee(t,e,n){return t.set(TT(t,e),n),n}function TT(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Ql=new WeakMap,XA=new WeakSet;class Gs extends bi{static get DEFAULTS(){return fo({placeholder:"",type:"text",tagName:"input",tabIndex:-1})}constructor(e,n){super(e,ln(Gs.DEFAULTS,n)),Dee(this,XA),kee(this,Ql,void 0),this.registerHooks()}registerHooks(){this.addLocalHook("keyup",e=>TT(XA,this,$ee).call(this,e))}build(){super.build();const e=this.hot.rootDocument.createElement("div");Lee(Ql,this,this._element.firstChild),X(this._element,"htUIInput"),X(e,"htUIInputIcon"),this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(Lf(Ql,this).type=this.options.type,Lf(Ql,this).placeholder=this.translateIfPossible(this.options.placeholder),Lf(Ql,this).value=this.translateIfPossible(this.options.value))}focus(){this.isBuilt()&&Lf(Ql,this).focus()}}function $ee(t){this.options.value=t.target.value}function Fee(t,e){o$(t,e),e.add(t)}function Gc(t,e,n){o$(t,e),e.set(t,n)}function o$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function eu(t,e,n){return t.set(Ih(t,e),n),n}function Ht(t,e){return t.get(Ih(t,e))}function Ih(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var dn=new WeakMap,$f=new WeakMap,Ff=new WeakMap,sS=new WeakMap,Vf=new WeakMap,Wf=new WeakSet;class rd extends bi{static get DEFAULTS(){return fo({className:"htUISelect",wrapIt:!1,tabIndex:-1})}constructor(e,n){super(e,ln(rd.DEFAULTS,n)),Fee(this,Wf),Gc(this,dn,null),Gc(this,$f,[]),Gc(this,Ff,void 0),Gc(this,sS,void 0),Gc(this,Vf,void 0),this.registerHooks()}getMenu(){return Ht(dn,this)}registerHooks(){this.addLocalHook("click",()=>Ih(Wf,this,Bee).call(this))}setItems(e){eu($f,this,this.translateNames(e)),Ht(dn,this)&&Ht(dn,this).setMenuItems(Ht($f,this))}translateNames(e){return H(e,n=>{n.name=this.translateIfPossible(n.name)}),e}build(){super.build(),eu(dn,this,new rc(this.hot,{className:"htSelectUI htFiltersConditionsMenu",keepInViewport:!1,standalone:!0,container:this.options.menuContainer})),Ht(dn,this).setMenuItems(Ht($f,this));const e=new bi(this.hot,{className:"htUISelectCaption"}),n=new bi(this.hot,{className:"htUISelectDropdown"});eu(Ff,this,e),eu(sS,this,e.element),eu(Vf,this,n),this.hot.getSettings().ariaTags&&(Re(n.element,[bl()]),Re(this._element,[YN()])),H([e,n],r=>this._element.appendChild(r.element)),Ht(dn,this).addLocalHook("select",r=>Ih(Wf,this,Vee).call(this,r)),Ht(dn,this).addLocalHook("afterClose",()=>Ih(Wf,this,Wee).call(this)),this.update()}update(){if(!this.isBuilt())return;let e;this.options.value?e=this.options.value.name:e=Ht(dn,this).hot.getTranslatedPhrase(mp),Ht(sS,this).textContent=e,super.update()}openOptions(){const e=this.element.getBoundingClientRect();Ht(dn,this)&&(Ht(dn,this).open(),Ht(dn,this).setPosition({left:this.hot.isLtr()?e.left-5:e.left-31,top:e.top-1,width:e.width,height:e.height}),Ht(dn,this).getNavigator().toFirstItem(),Ht(dn,this).getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:n=>{this.closeOptions(),this.runLocalHooks("tabKeydown",n)}},{keys:[["Control/Meta","A"]],callback:()=>!1}]))}closeOptions(){Ht(dn,this)&&Ht(dn,this).close()}focus(){this.isBuilt()&&this.element.focus()}destroy(){Ht(dn,this)&&(Ht(dn,this).destroy(),eu(dn,this,null)),Ht(Ff,this)&&Ht(Ff,this).destroy(),Ht(Vf,this)&&Ht(Vf,this).destroy(),super.destroy()}}function Vee(t){t.name!==Ne&&(this.options.value=t,this.update(),this.runLocalHooks("select",this.options.value))}function Wee(){this.runLocalHooks("afterClose")}function Bee(){this.openOptions()}function jee(t,e){Uee(t,e),e.add(t)}function Uee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ZA(t,e,n){return(e=zee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zee(t){var e=Yee(t,"string");return typeof e=="symbol"?e:e+""}function Yee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function JA(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var aS=new WeakSet;class Ub extends Nd{constructor(e,n){super(e,{id:n.id,stateless:!1}),jee(this,aS),ZA(this,"name",""),ZA(this,"addSeparator",!1),this.name=n.name,this.addSeparator=n.addSeparator,this.elements.push(new rd(this.hot,{menuContainer:n.menuContainer})),this.elements.push(new Gs(this.hot,{placeholder:V0})),this.elements.push(new Gs(this.hot,{placeholder:W0})),this.registerHooks()}registerHooks(){this.getSelectElement().addLocalHook("select",e=>JA(aS,this,Gee).call(this,e)).addLocalHook("afterClose",()=>this.runLocalHooks("afterClose")).addLocalHook("tabKeydown",e=>this.runLocalHooks("selectTabKeydown",e)),H(this.getInputElements(),e=>{e.addLocalHook("keydown",n=>JA(aS,this,qee).call(this,n))})}setState(e){if(this.reset(),!e)return;const n=fo(e.command);n.name.startsWith(Vt)&&(n.name=this.hot.getTranslatedPhrase(n.name)),this.getSelectElement().setValue(n),H(e.args,(r,i)=>{if(i>n.inputsCount-1)return!1;const o=this.getInputElement(i);o.setValue(r),o[n.inputsCount>i?"show":"hide"](),i||this.hot._registerTimeout(()=>o.focus(),10)})}getState(){const e=this.getSelectElement().getValue()||Qa(Cn),n=[];return H(this.getInputElements(),(r,i)=>{e.inputsCount>i&&n.push(r.getValue())}),{command:e,args:n}}updateState(e,n){const r=Qa(e?e.name:Cn);this.state.setValueAtIndex(n,{command:r,args:e?e.args:[]}),e||H(this.getInputElements(),i=>i.setValue(null))}getSelectElement(){return this.elements.filter(e=>e instanceof rd)[0]}getInputElement(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.getInputElements()[e]}getInputElements(){return this.elements.filter(e=>e instanceof Gs)}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,r,i,o,s)=>{X(n.parentNode,"htFiltersMenuCondition"),this.addSeparator&&X(n.parentNode,"border");const a=this.hot.rootDocument.createElement("div");return X(a,"htFiltersMenuLabel"),a.textContent=s,n.appendChild(a),n.parentElement.hasAttribute("ghost-table")||H(this.elements,l=>n.appendChild(l.element)),n}}}reset(){const e=this.hot.getPlugin("filters").getSelectedColumn();let n=[Qa(Cn)];if(e!==null){const{visualIndex:r}=e;n=Aee(this.hot.getDataType(0,r,this.hot.countRows(),r))}H(this.getInputElements(),r=>r.hide()),this.getSelectElement().setItems(n),super.reset(),this.getSelectElement().setValue(n[0])}}function Gee(t){H(this.getInputElements(),(e,n)=>{e[t.inputsCount>n?"show":"hide"](),n===0&&this.hot._registerTimeout(()=>e.focus(),10)}),this.runLocalHooks("change",t)}function qee(t){Sd(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),Pi(t))}function QA(t,e,n){Kee(t,e),e.set(t,n)}function Kee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qc(t,e){return t.get(s$(t,e))}function eH(t,e,n){return t.set(s$(t,e),n),n}function s$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var tu=new WeakMap,lS=new WeakMap;class bm extends bi{static get DEFAULTS(){return fo({type:"radio",tagName:"input",className:"htUIRadio",label:{}})}constructor(e,n){super(e,ln(bm.DEFAULTS,n)),QA(this,tu,void 0),QA(this,lS,void 0)}build(){super.build();const e=this.hot.rootDocument.createElement("label");e.textContent=this.translateIfPossible(this.options.label.textContent),e.htmlFor=this.translateIfPossible(this.options.label.htmlFor),eH(lS,this,e),eH(tu,this,this._element.firstChild),qc(tu,this).checked=this.options.checked,this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(qc(lS,this).textContent=this.translateIfPossible(this.options.label.textContent))}isChecked(){return this.isBuilt()?qc(tu,this).checked:!1}setChecked(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isBuilt()&&(qc(tu,this).checked=e)}focus(){this.isBuilt()&&qc(tu,this).focus()}}function Xee(t,e){Zee(t,e),e.add(t)}function Zee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Jee(t,e,n){return(e=Qee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qee(t){var e=ete(t,"string");return typeof e=="symbol"?e:e+""}function ete(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tte(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const tH=0;var nH=new WeakSet;class nte extends Nd{constructor(e,n){super(e,{id:n.id,stateless:!1}),Xee(this,nH),Jee(this,"name",""),this.name=n.name,this.buildOperatorsElement()}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n)=>(X(n.parentNode,"htFiltersMenuOperators"),H(this.elements,r=>n.appendChild(r.element)),n)}}buildOperatorsElement(){const e=[Ys,Sm];H(e,n=>{const r=new bm(this.hot,{name:"operator",label:{htmlFor:n,textContent:Ree(n)},value:n,checked:n===e[tH],id:n});r.addLocalHook("change",i=>tte(nH,this,rte).call(this,i)),this.elements.push(r)})}setChecked(e){if(this.elements.length<e)throw Error(st`Radio button with index ${e} doesn't exist.`);H(this.elements,(n,r)=>{n.setChecked(r===e)})}getActiveOperationId(){const e=this.elements.find(n=>n instanceof bm&&n.isChecked());return e?e.getValue():Ys}getState(){return this.getActiveOperationId()}setState(e){this.reset(),e&&this.getActiveOperationId()!==e&&H(this.elements,n=>{n.setChecked(n.getValue()===e)})}updateState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ys,n=arguments.length>1?arguments[1]:void 0,r=e;r===ET&&(r=Sm),this.state.setValueAtIndex(n,r)}reset(){this.setChecked(tH)}}function rte(t){this.setState(t.target.value)}function ite(t,e,n){ote(t,e),e.set(t,n)}function ote(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function uS(t,e){return t.get(a$(t,e))}function ste(t,e,n){return t.set(a$(t,e),n),n}function a$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Kc=new WeakMap;class id extends bi{static get DEFAULTS(){return fo({href:"#",tagName:"a",tabIndex:-1,role:"button"})}constructor(e,n){super(e,ln(id.DEFAULTS,n)),ite(this,Kc,void 0)}build(){super.build(),ste(Kc,this,this._element.firstChild)}update(){this.isBuilt()&&(uS(Kc,this).textContent=this.translateIfPossible(this.options.textContent))}focus(){this.isBuilt()&&uS(Kc,this).focus()}activate(){uS(Kc,this).click()}}function ate(t,e){l$(t,e),e.add(t)}function nu(t,e,n){l$(t,e),e.set(t,n)}function l$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _e(t,e){return t.get(Eu(t,e))}function si(t,e,n){return t.set(Eu(t,e),n),n}function Eu(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const rH="multipleSelect.itemBox";var mi=new WeakMap,jt=new WeakMap,cS=new WeakMap,xo=new WeakMap,ys=new WeakMap,Ss=new WeakMap,Xc=new WeakSet;class od extends bi{static get DEFAULTS(){return fo({className:"htUIMultipleSelect",value:[]})}constructor(e,n){super(e,ln(od.DEFAULTS,n)),ate(this,Xc),nu(this,mi,[]),nu(this,jt,void 0),nu(this,cS,void 0),nu(this,xo,void 0),nu(this,ys,void 0),nu(this,Ss,void 0),si(xo,this,new Gs(this.hot,{placeholder:F0,className:"htUIMultipleSelectSearch"})),si(ys,this,new id(this.hot,{textContent:D0,className:"htUISelectAll"})),si(Ss,this,new id(this.hot,{textContent:k0,className:"htUIClearAll"})),this.registerHooks()}getItemsBox(){return _e(jt,this)}registerHooks(){_e(xo,this).addLocalHook("keydown",e=>Eu(Xc,this,ute).call(this,e)),_e(xo,this).addLocalHook("input",e=>Eu(Xc,this,lte).call(this,e)),_e(ys,this).addLocalHook("click",e=>Eu(Xc,this,cte).call(this,e)),_e(Ss,this).addLocalHook("click",e=>Eu(Xc,this,hte).call(this,e))}setItems(e){var n;si(mi,this,e),(n=_e(jt,this))===null||n===void 0||n.loadData(_e(mi,this))}setLocale(e){si(cS,this,e)}getLocale(){return _e(cS,this)}getItems(){return[..._e(mi,this)]}getValue(){return fte(_e(mi,this))}getSearchInputElement(){return _e(xo,this)}getSelectAllElement(){return _e(ys,this)}getClearAllElement(){return _e(Ss,this)}isSelectedAllValues(){return _e(mi,this).length===this.getValue().length}build(){super.build();const{rootDocument:e}=this.hot,n=e.createElement("div"),r=new bi(this.hot,{className:"htUISelectionControls",children:[_e(ys,this),_e(Ss,this)]});this._element.appendChild(_e(xo,this).element),this._element.appendChild(r.element),this._element.appendChild(n);const i=o=>{var s;if(!this._element)return;(s=_e(jt,this))===null||s===void 0||s.destroy(),X(o,"htUIMultipleSelectHot"),si(jt,this,new this.hot.constructor(o,{data:_e(mi,this),columns:[{data:"checked",type:"checkbox",label:{property:"visualValue",position:"after"}}],beforeRenderer:(u,c,h,d,f,m)=>{u.title=m.instance.getDataAtRowProp(c,m.label.property)},afterListen:()=>{this.runLocalHooks("focus",this)},beforeOnCellMouseUp:()=>{_e(jt,this).listen()},modifyColWidth:u=>{const c=_e(jt,this).container.scrollWidth-yn(e);return u!==void 0&&u<c?c:u},maxCols:1,autoWrapCol:!0,height:110,copyPaste:!1,disableVisualSelection:"area",fillHandle:!1,fragmentSelection:"cell",tabMoves:{row:1,col:0},themeName:this.hot.getCurrentThemeName(),layoutDirection:this.hot.isRtl()?"rtl":"ltr"})),_e(jt,this).init(),this.hot.addHook("afterSetTheme",(u,c)=>{c||_e(jt,this).useTheme(u)});const l=_e(jt,this).getShortcutManager().getContext("grid");l.removeShortcutsByKeys(["Tab"]),l.removeShortcutsByKeys(["Shift","Tab"]),l.addShortcut({keys:[["Escape"]],callback:u=>{this.runLocalHooks("keydown",u,this)},group:rH}),l.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:u=>{_e(jt,this).deselectCell(),this.runLocalHooks("keydown",u,this),this.runLocalHooks("listTabKeydown",u,this)},group:rH})};i(n),this.hot._registerTimeout(()=>i(n),100)}focus(){this.isBuilt()&&_e(jt,this).listen()}reset(){_e(xo,this).reset(),_e(ys,this).reset(),_e(Ss,this).reset()}update(){this.isBuilt()&&(_e(jt,this).loadData(dte(_e(mi,this),this.options.value)),super.update())}destroy(){var e;(e=_e(jt,this))===null||e===void 0||e.destroy(),_e(xo,this).destroy(),_e(Ss,this).destroy(),_e(ys,this).destroy(),si(xo,this,null),si(Ss,this,null),si(ys,this,null),si(jt,this,null),si(mi,this,null),super.destroy()}}function lte(t){const e=t.target.value.toLocaleLowerCase(this.getLocale());let n;e===""?n=[..._e(mi,this)]:n=_e(mi,this).filter(r=>`${r.value}`.toLocaleLowerCase(this.getLocale()).indexOf(e)>=0),_e(jt,this).loadData(n)}function ute(t){this.runLocalHooks("keydown",t,this),cD(Sd,t.keyCode)("ARROW_DOWN")&&(t.preventDefault(),Pi(t),_e(jt,this).listen(),_e(jt,this).selectCell(0,0))}function cte(t){const e=[];t.preventDefault(),_e(jt,this).getSourceData().forEach((n,r)=>{n.checked=!0,e.push(qD(n,r)[0])}),_e(jt,this).setSourceDataAtCell(e)}function hte(t){const e=[];t.preventDefault(),_e(jt,this).getSourceData().forEach((n,r)=>{n.checked=!1,e.push(qD(n,r)[0])}),_e(jt,this).setSourceDataAtCell(e)}function dte(t,e){const n=Dd(e);return t.map(r=>(r.checked=n(r.value),r))}function fte(t){const e=[];return t.forEach(n=>{n.checked&&e.push(n.value)}),e}function gte(t,e){mte(t,e),e.add(t)}function mte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function pte(t,e,n){return(e=wte(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wte(t){var e=vte(t,"string");return typeof e=="symbol"?e:e+""}function vte(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Bf(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Zc=new WeakSet;class Cte extends Nd{constructor(e,n){super(e,{id:n.id,stateless:!1}),gte(this,Zc),pte(this,"name",""),this.name=n.name,this.elements.push(new od(this.hot)),this.registerHooks()}registerHooks(){this.getMultipleSelectElement().addLocalHook("keydown",e=>Bf(Zc,this,yte).call(this,e)).addLocalHook("listTabKeydown",e=>this.runLocalHooks("listTabKeydown",e)),this.hot.addHook("modifyFiltersMultiSelectValue",(e,n)=>Bf(Zc,this,Ste).call(this,e,n))}getElements(){const e=this.getMultipleSelectElement();return[e.getSearchInputElement(),e.getSelectAllElement(),e.getClearAllElement(),this.getMultipleSelectElement()]}setState(e){if(this.reset(),e&&e.command.key===el){const n=this.getMultipleSelectElement();n.setItems(e.itemsSnapshot),n.setValue(e.args[0]),n.setLocale(e.locale)}}getState(){const e=this.getMultipleSelectElement(),n=e.getItems();return{command:{key:e.isSelectedAllValues()||!n.length?Cn:el},args:[e.getValue()],itemsSnapshot:n}}updateState(e){const n=(r,i,o,s,a)=>{const[l]=ol(i,h=>h.name===el),u={},c=this.hot.getTranslatedPhrase(im);if(l){const h=s(r,a),d=ze(h,v=>v.value),f=new Map(h.map(v=>[v.value,this.hot.getCellMeta(v.meta.visualRow,v.meta.visualCol)])),m=jb(d);o&&(l.args[0]=o);const C=[],y=GA(m,l.args[0],c,v=>{v.checked&&C.push(v.value),Bf(Zc,this,iH).call(this,v,f)}),E=e.editedConditionStack.column;u.locale=this.hot.getCellMeta(0,E).locale,u.args=[C],u.command=Qa(el),u.itemsSnapshot=y}else u.args=[],u.command=Qa(Cn);this.state.setValueAtIndex(r,u)};n(e.editedConditionStack.column,e.editedConditionStack.conditions,e.conditionArgsChange,e.filteredRowsFactory),e.dependentConditionStacks.length&&n(e.dependentConditionStacks[0].column,e.dependentConditionStacks[0].conditions,e.conditionArgsChange,e.filteredRowsFactory,e.editedConditionStack)}getMultipleSelectElement(){return this.elements.filter(e=>e instanceof od)[0]}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,r,i,o,s)=>{X(n.parentNode,"htFiltersMenuValue");const a=this.hot.rootDocument.createElement("div");return X(a,"htFiltersMenuLabel"),a.textContent=s,n.appendChild(a),n.parentElement.hasAttribute("ghost-table")||H(this.elements,l=>n.appendChild(l.element)),n}}}reset(){const e=this.hot.getTranslatedPhrase(im),n=this._getColumnVisibleValues(),r=n.map(l=>l.value),i=new Map(n.map(l=>[l.value,l.meta])),o=jb(r),s=GA(o,o,e,l=>{Bf(Zc,this,iH).call(this,l,i)});this.getMultipleSelectElement().setItems(s),super.reset(),this.getMultipleSelectElement().setValue(o);const a=this.hot.getPlugin("filters").getSelectedColumn();a!==null&&this.getMultipleSelectElement().setLocale(this.hot.getCellMeta(0,a.visualIndex).locale)}_getColumnVisibleValues(){const e=this.hot.getPlugin("filters").getSelectedColumn();return e===null?[]:ze(this.hot.getDataAtCol(e.visualIndex),(n,r)=>({value:bT(n),meta:this.hot.getCellMeta(r,e.visualIndex)}))}}function yte(t){Sd(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),Pi(t))}function iH(t,e){this.hot.hasHook("modifyFiltersMultiSelectValue")&&(t.visualValue=this.hot.runHooks("modifyFiltersMultiSelectValue",t.visualValue,e.get(t.value)))}function Ste(t,e){switch(e.type){case"numeric":return Xk(t,e);default:return t}}var u$;function bte(t,e){Rte(t,e),e.add(t)}function Rte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ete(t,e,n){return(e=Tte(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tte(t){var e=_te(t,"string");return typeof e=="symbol"?e:e+""}function _te(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Mte(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var oH=new WeakSet;class sd extends Nd{static get BUTTON_OK(){return"ok"}static get BUTTON_CANCEL(){return"cancel"}constructor(e,n){super(e,{id:n.id,stateless:!0}),bte(this,oH),Ete(this,"name",""),this.name=n.name,this.elements.push(new Gs(this.hot,{type:"button",value:L0,className:"htUIButton htUIButtonOK",identifier:sd.BUTTON_OK})),this.elements.push(new Gs(this.hot,{type:"button",value:$0,className:"htUIButton htUIButtonCancel",identifier:sd.BUTTON_CANCEL})),this.registerHooks()}registerHooks(){H(this.elements,e=>{e.addLocalHook("click",(n,r)=>Mte(oH,this,Ite).call(this,n,r))})}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n)=>(X(n.parentNode,"htFiltersMenuActionBar"),H(this.elements,r=>n.appendChild(r.element)),n)}}accept(){this.runLocalHooks("accept")}cancel(){this.runLocalHooks("cancel")}}u$=sd;function Ite(t,e){e.options.identifier===u$.BUTTON_OK?this.accept():this.cancel()}function hS(t,e,n){return(e=Pte(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pte(t){var e=Ote(t,"string");return typeof e=="symbol"?e:e+""}function Ote(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const sH="ConditionCollection.filteringStates";class _T{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;hS(this,"hot",void 0),hS(this,"isMapRegistrable",void 0),hS(this,"filteringStates",new gp),this.hot=e,this.isMapRegistrable=n,this.isMapRegistrable===!0?this.hot.columnIndexMapper.registerMap(sH,this.filteringStates):this.filteringStates.init(this.hot.columnIndexMapper.getNumberOfIndexes())}isEmpty(){return this.getFilteredColumns().length===0}isMatch(e,n){var r;const i=this.filteringStates.getValueAtIndex(n),o=(r=i==null?void 0:i.conditions)!==null&&r!==void 0?r:[],s=i==null?void 0:i.operation;return this.isMatchInConditions(o,e,s)}isMatchInConditions(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ys;return e.length?bee(r)(e,n):!0}addCondition(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ys,i=arguments.length>3?arguments[3]:void 0;const o=this.hot.getCellMeta(0,e).locale,s=n.args.map(c=>typeof c=="string"?c.toLocaleLowerCase(o):c),a=n.name||n.command.key;this.runLocalHooks("beforeAdd",e);const l=this.getOperation(e);if(l){if(l!==r)throw Error(st`The column of index ${e} has been already applied with a \`${l}\`\x20
278
- filter operation. Use \`removeConditions\` to clear the current conditions and then add new ones.\x20
279
- Mind that you cannot mix different types of operations (for instance, if you use \`conjunction\`,\x20
280
- use it consequently for a particular column).`)}else if(xt(nd[r]))throw new Error(st`Unexpected operation named \`${r}\`. Possible ones are\x20
281
- \`disjunction\` and \`conjunction\`.`);const u=this.getConditions(e);u.length===0?this.filteringStates.setValueAtIndex(e,{operation:r,conditions:[{name:a,args:s,func:qs(a,s)}]},i):u.push({name:a,args:s,func:qs(a,s)}),this.runLocalHooks("afterAdd",e)}getConditions(e){var n,r;return(n=(r=this.filteringStates.getValueAtIndex(e))===null||r===void 0?void 0:r.conditions)!==null&&n!==void 0?n:[]}getOperation(e){var n;return(n=this.filteringStates.getValueAtIndex(e))===null||n===void 0?void 0:n.operation}getFilteredColumns(){return this.filteringStates.getEntries().map(e=>{let[n]=e;return n})}getColumnStackPosition(e){return this.getFilteredColumns().indexOf(e)}exportAllConditions(){return this.filteringStates.getEntries().reduce((e,n)=>{let[r,{operation:i,conditions:o}]=n;return e.push({column:r,operation:i,conditions:o.map(s=>{let{name:a,args:l}=s;return{name:a,args:[...l]}})}),e},[])}importAllConditions(e){this.clean(),e.forEach(n=>{n.conditions.forEach(r=>this.addCondition(n.column,r))})}removeConditions(e){this.runLocalHooks("beforeRemove",e),this.filteringStates.clearValue(e),this.runLocalHooks("afterRemove",e)}clean(){this.runLocalHooks("beforeClean"),this.filteringStates.clear(),this.runLocalHooks("afterClean")}hasConditions(e,n){const r=this.getConditions(e);return n?r.some(i=>i.name===n):r.length>0}destroy(){this.isMapRegistrable&&this.hot.columnIndexMapper.unregisterMap(sH),this.filteringStates=null,this.clearLocalHooks()}}gt(_T,En);function aH(t,e,n){return(e=xte(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xte(t){var e=Ate(t,"string");return typeof e=="symbol"?e:e+""}function Ate(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class c${constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>[];aH(this,"conditionCollection",void 0),aH(this,"columnDataFactory",void 0),this.conditionCollection=e,this.columnDataFactory=n}filter(){let e=[];return H(this.conditionCollection.getFilteredColumns(),(n,r)=>{let i=this.columnDataFactory(n);r&&(i=this._getIntersectData(i,e)),e=this.filterByColumn(n,i)}),e}filterByColumn(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=[];return H(n,i=>{i!==void 0&&this.conditionCollection.isMatch(i,e)&&r.push(i)}),r}_getIntersectData(e,n){const r=[];return H(n,i=>{const o=i.meta.visualRow;e[o]!==void 0&&(r[o]=e[o])}),r}}function Hte(t,e){Nte(t,e),e.add(t)}function Nte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _a(t,e,n){return(e=Dte(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dte(t){var e=kte(t,"string");return typeof e=="symbol"?e:e+""}function kte(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dS(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var jf=new WeakSet;class h${constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:()=>[];Hte(this,jf),_a(this,"hot",void 0),_a(this,"conditionCollection",void 0),_a(this,"columnDataFactory",void 0),_a(this,"changes",[]),_a(this,"grouping",!1),_a(this,"latestEditedColumnPosition",-1),_a(this,"latestOrderStack",[]),this.hot=e,this.conditionCollection=n,this.columnDataFactory=r,this.conditionCollection.addLocalHook("beforeRemove",i=>dS(jf,this,Lte).call(this,i)),this.conditionCollection.addLocalHook("afterRemove",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("afterAdd",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("beforeClean",()=>dS(jf,this,$te).call(this)),this.conditionCollection.addLocalHook("afterClean",()=>dS(jf,this,Fte).call(this))}groupChanges(){this.grouping=!0}flush(){this.grouping=!1,H(this.changes,e=>{this.updateStatesAtColumn(e)}),this.changes.length=0}updateStatesAtColumn(e,n){var r=this;if(this.grouping){this.changes.indexOf(e)===-1&&this.changes.push(e);return}const i=this.conditionCollection.exportAllConditions();let o=this.conditionCollection.getColumnStackPosition(e);o===-1&&(o=this.latestEditedColumnPosition);const s=i.slice(0,o),a=i.slice(o);a.length&&a[0].column===e&&a.shift();const l=Dz(function(c,h){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];const f=new _T(r.hot,!1),m=[].concat(c,d);f.importAllConditions(m);const C=r.columnDataFactory(h);let y;f.isEmpty()?y=C:y=new c$(f,v=>r.columnDataFactory(v)).filter(),y=ze(y,v=>v.meta.visualRow);const E=Dd(y);return f.destroy(),ol(C,v=>E(v.meta.visualRow))})(s),u=[].concat(this.conditionCollection.getConditions(e));this.runLocalHooks("update",{editedConditionStack:{column:e,conditions:u},dependentConditionStacks:a,filteredRowsFactory:l,conditionArgsChange:n})}destroy(){this.clearLocalHooks(),ke(this,(e,n)=>{this[n]=null})}}function Lte(t){this.latestEditedColumnPosition=this.conditionCollection.getColumnStackPosition(t)}function $te(){this.latestOrderStack=this.conditionCollection.getFilteredColumns()}function Fte(){H(this.latestOrderStack,t=>{this.updateStatesAtColumn(t)})}gt(h$,En);function Vte(t){return AL({initialPage:0,size:()=>t.length,onItemSelect:(n,r)=>{const i=t[n];if(i instanceof od)return r;if(i.element&&!Du(i.element))return!1;i.focus()}})}const Jc="filters";function Wte(t,e){let n=-1,r;const i=Vte(e),o=h=>()=>{r.isOpened()&&r.getKeyboardShortcutsCtrl().listen(Jc),i.setCurrentPage(e.indexOf(h))};e.forEach(h=>{h instanceof bi&&(h.addLocalHook("click",o(h)),h.addLocalHook("focus",o(h)),h.addLocalHook("afterClose",o(h)))}),l(t);function s(h){const d=r.getKeyboardShortcutsCtrl(),f=h.getKeyboardShortcutsCtrl();i.clear(),f.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],forwardToContext:d.getContext(Jc),callback:()=>{h.isSubMenu()&&h.close(),d.listen(Jc)}}]),!h.isSubMenu()&&d.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:m=>{const C=r.getNavigator();C.getCurrentPage()>-1&&(n=C.getCurrentPage()),C.clear(),m.shiftKey?i.toPreviousItem():i.toNextItem()}},{keys:[["Escape"]],callback:()=>{r.close()}},{keys:[["Enter"],["Space"]],preventDefault:!1,callback:m=>{const C=e[i.getCurrentPage()];C instanceof rd&&(C.openOptions(),m.preventDefault()),C instanceof id&&(C.activate(),m.preventDefault()),C instanceof bi||m.preventDefault()}}],Jc)}function a(){r.focus(),r.getKeyboardShortcutsCtrl().listen(Jc)}function l(h){h.addLocalHook("afterSelectionChange",d=>{d.key.startsWith("filter_")||i.clear()}),h.addLocalHook("afterSubmenuOpen",s),h.addLocalHook("afterOpen",s),r=h}function u(){return r}function c(){return n}return{...i,listen:a,setMenu:l,getMenu:u,getLastMenuPage:c}}function Bte(t,e){d$(t,e),e.add(t)}function fS(t,e,n){d$(t,e),e.set(t,n)}function d$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qc(t,e,n){return(e=jte(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jte(t){var e=Ute(t,"string");return typeof e=="symbol"?e:e+""}function Ute(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Wg(t,e,n){return t.set(ar(t,e),n),n}function zr(t,e){return t.get(ar(t,e))}function ar(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const zb="filters",zte=250,lH=zb;var ko=new WeakMap,Yb=new WeakMap,Ka=new WeakMap,Cr=new WeakSet;class Yte extends et{static get PLUGIN_KEY(){return zb}static get PLUGIN_PRIORITY(){return zte}static get PLUGIN_DEPS(){return["plugin:DropdownMenu","plugin:HiddenRows","cell-type:checkbox"]}constructor(e){var n;super(e),n=this,Bte(this,Cr),Qc(this,"dropdownMenuPlugin",null),Qc(this,"conditionCollection",null),Qc(this,"conditionUpdateObserver",null),Qc(this,"components",new Map([["filter_by_condition",null],["filter_operators",null],["filter_by_condition2",null],["filter_by_value",null],["filter_action_bar",null]])),Qc(this,"filtersRowsMap",null),fS(this,ko,void 0),fS(this,Yb,new WeakSet),fS(this,Ka,[]),this.hot.addHook("afterGetColHeader",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return ar(Cr,n,Qte).call(n,...i)})}isEnabled(){return!!this.hot.getSettings()[zb]}enablePlugin(){var e=this;if(this.enabled)return;this.filtersRowsMap=this.hot.rowIndexMapper.registerMap(this.pluginName,new Td),this.dropdownMenuPlugin=this.hot.getPlugin("dropdownMenu");const n=this.hot.getSettings().dropdownMenu,r=n&&n.uiContainer||this.hot.rootDocument.body,i=a=>(a.addLocalHook("accept",()=>ar(Cr,this,uH).call(this,"accept")),a.addLocalHook("cancel",()=>ar(Cr,this,uH).call(this,"cancel")),a.addLocalHook("change",l=>ar(Cr,this,Jte).call(this,a,l)),a),o=()=>`${this.hot.getTranslatedPhrase(A0)}:`,s=()=>`${this.hot.getTranslatedPhrase(H0)}:`;if(!this.components.get("filter_by_condition")){const a=new Ub(this.hot,{id:"filter_by_condition",name:o,addSeparator:!1,menuContainer:r});a.addLocalHook("afterClose",()=>ar(Cr,this,cH).call(this)),this.components.set("filter_by_condition",i(a))}if(this.components.get("filter_operators")||this.components.set("filter_operators",new nte(this.hot,{id:"filter_operators",name:"Operators"})),!this.components.get("filter_by_condition2")){const a=new Ub(this.hot,{id:"filter_by_condition2",name:"",addSeparator:!0,menuContainer:r});a.addLocalHook("afterClose",()=>ar(Cr,this,cH).call(this)),this.components.set("filter_by_condition2",i(a))}if(this.components.get("filter_by_value")||this.components.set("filter_by_value",i(new Cte(this.hot,{id:"filter_by_value",name:s}))),this.components.get("filter_action_bar")||this.components.set("filter_action_bar",i(new sd(this.hot,{id:"filter_action_bar",name:"Action bar"}))),this.conditionCollection||(this.conditionCollection=new _T(this.hot)),this.conditionUpdateObserver||(this.conditionUpdateObserver=new h$(this.hot,this.conditionCollection,a=>this.getDataMapAtColumn(a)),this.conditionUpdateObserver.addLocalHook("update",a=>ar(Cr,this,ene).call(this,a))),this.components.forEach(a=>a.show()),this.addHook("afterDropdownMenuDefaultOptions",function(){for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];return ar(Cr,e,Zte).call(e,...l)}),this.addHook("beforeDropdownMenuShow",()=>ar(Cr,this,Xte).call(this)),this.addHook("afterDropdownMenuShow",()=>ar(Cr,this,qte).call(this)),this.addHook("afterDropdownMenuHide",()=>ar(Cr,this,Kte).call(this)),this.addHook("afterChange",a=>ar(Cr,this,Gte).call(this,a)),this.hot.getSettings().dropdownMenu&&this.dropdownMenuPlugin&&(this.dropdownMenuPlugin.disablePlugin(),this.dropdownMenuPlugin.enablePlugin()),!zr(ko,this)&&this.dropdownMenuPlugin.enabled){const a=[{focus:()=>{const u=zr(ko,this).getMenu(),c=u.getNavigator(),h=zr(ko,this).getLastMenuPage();u.focus(),h>0?c.setCurrentPage(h):c.toFirstItem()}},...Array.from(this.components).map(u=>{let[,c]=u;return c.getElements()}).flat()];Wg(ko,this,Wte(this.dropdownMenuPlugin.menu,a));const l=u=>{zr(ko,this).listen(),u.preventDefault(),Sd(u.keyCode,"TAB")&&(u.shiftKey?zr(ko,this).toPreviousItem():zr(ko,this).toNextItem())};this.components.get("filter_by_value").addLocalHook("listTabKeydown",l),this.components.get("filter_by_condition").addLocalHook("selectTabKeydown",l)}this.registerShortcuts(),super.enablePlugin()}disablePlugin(){if(this.enabled){var e;(e=this.dropdownMenuPlugin)!==null&&e!==void 0&&e.enabled&&this.dropdownMenuPlugin.menu.clearLocalHooks(),this.components.forEach((n,r)=>{n.destroy(),this.components.set(r,null)}),this.conditionCollection.destroy(),this.conditionCollection=null,this.hot.rowIndexMapper.unregisterMap(this.pluginName)}this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Alt","A"]],stopPropagation:!0,callback:()=>{const e=this.hot.getSelected();this.clearConditions(),this.filter(),e&&this.hot.selectCells(e)},group:lH})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(lH)}addCondition(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Ys;const o=this.hot.toPhysicalColumn(e);this.conditionCollection.addCondition(o,{command:{key:n},args:r},i)}removeConditions(e){const n=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(n)}clearConditions(e){if(e===void 0)this.conditionCollection.clean();else{const n=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(n)}}importConditions(e){this.conditionCollection.importAllConditions(e)}exportConditions(){return this.conditionCollection.exportAllConditions()}filter(){const{navigableHeaders:e}=this.hot.getSettings(),n=this._createDataFilter(),r=!this.conditionCollection.isEmpty();let i=[];const o=this.exportConditions(),s=this.hot.runHooks("beforeFilter",o,zr(Ka,this));if(s!==!1&&r){const a=[];this.hot.batchExecution(()=>{this.filtersRowsMap.clear(),i=ze(n.filter(),u=>u.meta.visualRow);const l=Dd(i);fe(this.hot.countSourceRows()-1,u=>{l(u)||a.push(u)}),H(a,u=>{this.filtersRowsMap.setValueAtIndex(u,!0)})},!0),!e&&!i.length&&this.hot.deselectCell(),Wg(Ka,this,this.exportConditions())}else s!==!1&&!r?(Wg(Ka,this,this.exportConditions()),this.filtersRowsMap.clear()):this.importConditions(zr(Ka,this));this.hot.selection.isSelected()&&this.hot.selectCell(e?-1:0,this.hot.getSelectedRangeLast().highlight.col),s!==!1&&(this.hot.runHooks("afterFilter",o),this.hot.view.adjustElementsSize(),this.hot.render())}getSelectedColumn(){var e;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n?{visualIndex:n.col,physicalIndex:this.hot.toPhysicalColumn(n.col)}:null}getDataMapAtColumn(e){const n=this.hot.toVisualColumn(e),r=[];return H(this.hot.getSourceDataAtCol(n),(i,o)=>{var s;const{row:a,col:l,visualCol:u,visualRow:c,type:h,instance:d,dateFormat:f,locale:m}=this.hot.getCellMeta(o,n),C=(s=this.hot.getDataAtCell(this.hot.toVisualRow(o),n))!==null&&s!==void 0?s:i;r.push({meta:{row:a,col:l,visualCol:u,visualRow:c,type:h,instance:d,dateFormat:f,locale:m},value:bT(C)})}),r}updateValueComponentCondition(e){const n=this.hot.getDataAtCol(e),r=jb(n);this.conditionUpdateObserver.updateStatesAtColumn(e,r)}restoreComponents(e){var n;const r=(n=this.getSelectedColumn())===null||n===void 0?void 0:n.physicalIndex;e.forEach(i=>{i.isHidden()||i.restoreState(r)}),this.updateDependentComponentsVisibility()}getOperationBasedOnArguments(e,n,r,i){let o=e;return o===Sm&&n.command.key!==Cn&&r.command.key!==Cn&&i.command.key!==Cn?o=ET:i.command.key!==Cn&&(n.command.key===Cn||r.command.key===Cn)&&(o=Ys),o}setListeningDropdownMenu(){this.dropdownMenuPlugin&&this.dropdownMenuPlugin.setListening()}updateDependentComponentsVisibility(){const e=this.components.get("filter_by_condition"),{command:n}=e.getState(),r=[this.components.get("filter_by_condition2"),this.components.get("filter_operators")];n.showOperators?this.showComponents(...r):this.hideComponents(...r)}_createDataFilter(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.conditionCollection;return new c$(e,n=>this.getDataMapAtColumn(n))}getIndexesOfComponents(){const e=[];if(!this.dropdownMenuPlugin)return e;const n=this.dropdownMenuPlugin.menu;for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return H(i,s=>{H(n.menuItems,(a,l)=>{a.key===s.getMenuItemDescriptor().key&&e.push(l)})}),e}changeComponentsVisibility(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.dropdownMenuPlugin)return;const r=this.dropdownMenuPlugin.menu.hotMenu,i=r.getPlugin("hiddenRows");for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];const l=this.getIndexesOfComponents(...s);e?i.showRows(l):i.hideRows(l),r.render()}hideComponents(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.changeComponentsVisibility(!1,...n)}showComponents(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.changeComponentsVisibility(!0,...n)}destroy(){this.enabled&&(this.components.forEach((e,n)=>{e!==null&&(e.destroy(),this.components.set(n,null))}),this.conditionCollection.destroy(),this.conditionUpdateObserver.destroy(),this.hot.rowIndexMapper.unregisterMap(this.pluginName)),super.destroy()}}function Gte(t){t&&H(t,e=>{const[,n]=e,r=this.hot.propToCol(n);this.conditionCollection.hasConditions(r)&&this.updateValueComponentCondition(r)})}function qte(){const t=this.dropdownMenuPlugin.menu;this.restoreComponents(Array.from(this.components.values())),t.updateMenuDimensions()}function Kte(){this.components.get("filter_by_condition").getSelectElement().closeOptions(),this.components.get("filter_by_condition2").getSelectElement().closeOptions()}function Xte(){const t=this.dropdownMenuPlugin.menu;zr(Yb,this).has(t)||zr(ko,this).setMenu(t),zr(Yb,this).add(t)}function Zte(t){t.items.push({name:Ne}),this.components.forEach(e=>{t.items.push(e.getMenuItemDescriptor())})}function uH(t){var e;if(t==="accept"){const r=this.getSelectedColumn();if(r===null){var n;(n=this.dropdownMenuPlugin)===null||n===void 0||n.close();return}const{physicalIndex:i}=r,o=this.components.get("filter_by_condition").getState(),s=this.components.get("filter_by_condition2").getState(),a=this.components.get("filter_by_value").getState(),l=this.getOperationBasedOnArguments(this.components.get("filter_operators").getActiveOperationId(),o,s,a);this.conditionUpdateObserver.groupChanges();let u=this.conditionCollection.getColumnStackPosition(i);u===-1&&(u=void 0),this.conditionCollection.removeConditions(i),o.command.key!==Cn&&(this.conditionCollection.addCondition(i,o,l,u),s.command.key!==Cn&&this.conditionCollection.addCondition(i,s,l,u)),a.command.key!==Cn&&this.conditionCollection.addCondition(i,a,l,u),this.conditionUpdateObserver.flush(),this.components.forEach(c=>c.saveState(i)),this.filter()}(e=this.dropdownMenuPlugin)===null||e===void 0||e.close()}function Jte(t,e){const n=this.dropdownMenuPlugin.menu;this.updateDependentComponentsVisibility(),t.constructor===Ub&&!e.inputsCount&&this.setListeningDropdownMenu(),n.updateMenuDimensions()}function cH(){this.setListeningDropdownMenu()}function Qte(t,e,n){const r=this.hot.toPhysicalColumn(t);this.enabled&&this.conditionCollection.hasConditions(r)&&n===this.hot.view.getColumnHeadersCount()-1?X(e,"htFiltersActive"):we(e,"htFiltersActive")}function ene(t){var e;if(!((e=this.dropdownMenuPlugin)!==null&&e!==void 0&&e.enabled))return;const{editedConditionStack:{conditions:n,column:r},conditionArgsChange:i}=t;Array.isArray(i)&&Wg(Ka,this,zr(Ka,this).map(a=>(a.column===r&&n.length>0&&a.conditions.forEach(l=>{l.name==="by_value"&&(l.args=[[...i]])}),a)));const o=n.filter(a=>a.name===el),s=n.filter(a=>a.name!==el);if(o.length>=2||s.length>=3)tt(st`The filter conditions have been applied properly, but couldn’t be displayed visually.\x20
282
- The overall amount of conditions exceed the capability of the dropdown menu.\x20
283
- For more details see the documentation.`);else{const a=this.conditionCollection.getOperation(r);this.components.get("filter_by_condition").updateState(s[0],r),this.components.get("filter_by_condition2").updateState(s[1],r),this.components.get("filter_operators").updateState(a,r),this.components.get("filter_by_value").updateState(t)}}const f$="internal-use-in-handsontable",Gb={licenseKey:f$,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 g$(t){var e;return{maxColumns:t.maxColumns,maxRows:t.maxRows,language:(e=t[Hn])===null||e===void 0||(e=e.language)===null||e===void 0?void 0:e.langCode}}function m$(t){return Object.keys(t).reduce((e,n)=>(n!=="hyperformula"&&(e[n]=t[n]),e),{})}function tne(t){var e;const n=t[Hn],r=m$(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),i=g$(t);return{...Gb,...r,...i}}function nne(t){var e;const n=t[Hn],r=m$(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),i=g$(t);return{...r,...i}}function rne(t,e){return Object.keys(e).some(n=>e[n]!==void 0&&e[n]!==t[n])}function kp(){const t="engine_relationship",e=Oi(Hn);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function MT(){const t="shared_engine_usage",e=Oi(Hn);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function ine(t){const e=t.getSettings(),n=e[Hn],r=n==null?void 0:n.engine;if(n===!0||xt(r))return null;if(typeof r.hyperformula=="function"||typeof r=="function"){var i;return one((i=r.hyperformula)!==null&&i!==void 0?i:r,e,t)}else if(typeof r=="object"&&xt(r.hyperformula)){const o=kp(),s=MT().get(r);return o.has(r)||o.set(r,[]),o.get(r).push(t),s&&s.push(t.guid),r.getConfig().licenseKey||r.updateConfig({licenseKey:f$}),(r.getConfig().leapYear1900!==Gb.leapYear1900||qR(r.getConfig().nullDate,Gb.nullDate)===!1)&&tt(st`If you use HyperFormula with Handsontable, keep the default \`leapYear1900\` and \`nullDate\`
284
- settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates.`),r}return null}function one(t,e,n){const r=e[Hn],i=tne(e),o=kp(),s=MT();sne(t,r.functions),ane(t,r.language);const a=t.buildEmpty(i);return o.set(a,[n]),s.set(a,[n.guid]),lne(a,r.namedExpressions),a.on("sheetAdded",()=>{a.rebuildAndRecalculate()}),a.on("sheetRemoved",()=>{a.rebuildAndRecalculate()}),a}function hH(t){var e;const n=kp(),r=n.size===0?[]:Array.from((e=n.get(t))!==null&&e!==void 0?e:[]);return new Map(r.map(i=>[i.getPlugin("formulas").sheetId,i]))}function dH(t,e){if(t){const n=kp(),r=n.get(t),i=MT(),o=i.get(t);r&&r.includes(e)&&(r.splice(r.indexOf(e),1),r.length===0&&n.delete(t)),o&&o.includes(e.guid)&&(o.splice(o.indexOf(e.guid),1),o.length===0&&(i.delete(t),t.destroy()))}}function sne(t,e){e&&e.forEach(n=>{const{name:r,plugin:i,translations:o}=n;try{t.registerFunction(r,i,o)}catch(s){tt(s.message)}})}function ane(t,e){if(e){const{langCode:n}=e;try{t.registerLanguage(n,e)}catch(r){tt(r.message)}}}function lne(t,e){e&&(t.suspendEvaluation(),e.forEach(n=>{const{name:r,expression:i,scope:o,options:s}=n;try{t.addNamedExpression(r,i,o,s)}catch(a){tt(a.message)}}),t.resumeEvaluation())}function une(t,e){return(xt(e)||!t.doesSheetExist(e))&&(e=t.addSheet(e)),e}const p$="DD/MM/YYYY";function cne(t){return typeof t=="string"&&t.charAt(0)==="'"&&t.charAt(1)==="="}function hne(t){return cne(t)?t.substr(1):t}function dne(t){return typeof t=="string"&&t.startsWith("=")}function IT(t,e){return typeof t=="string"&&e==="date"}function w$(t,e){return Z(t,e,!0).isValid()}function v$(t,e){return Z(t,e,!0).format(p$)}function fne(t,e){return Z(t,p$,!0).format(e)}function C$(t,e){const r=new Date(Date.UTC(0,0,t+-1));return Z(r).format(e)}function gne(t,e,n){const r=Array.from(Array(n).keys()).filter(o=>t.includes(o)===!1);if(e===0){var i;return(i=r[e])!==null&&i!==void 0?i:0}return r[e-1]+1}function mne(t,e){const n=[];return t.forEach(r=>{const i={from:r,to:e};n.forEach(o=>{const s=o.from>o.to,a=o.to<=i.from;o.from>i.from&&a&&s&&(i.from+=1)}),i.from>=e&&(e+=1),n.push(i)}),n}function pne(t){return t.forEach((e,n)=>{t.slice(n+1).forEach(i=>{const o=i.from<i.to;i.from>e.from&&o&&(i.from-=1)})}),t}function PT(t,e,n){const r=mne(t,gne(t,e,n));return pne(r)}function Ma(t,e,n){wne(t,e),e.set(t,n)}function wne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Et(t,e){return t.get(y$(t,e))}function bs(t,e,n){return t.set(y$(t,e),n),n}function y$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var eh=new WeakMap,Rs=new WeakMap,yr=new WeakMap,Uf=new WeakMap,gS=new WeakMap,mS=new WeakMap,zf=new WeakMap;class fH{constructor(e,n,r){Ma(this,eh,void 0),Ma(this,Rs,void 0),Ma(this,yr,void 0),Ma(this,Uf,[]),Ma(this,gS,[]),Ma(this,mS,void 0),Ma(this,zf,[]),bs(eh,this,e),bs(Rs,this,n),bs(yr,this,r)}setRemovedHfIndexes(e){return bs(zf,this,e.map(n=>{const r=Et(Rs,this).getVisualFromPhysicalIndex(n);return this.getHfIndexFromVisualIndex(r)})),Et(zf,this)}getRemovedHfIndexes(){return Et(zf,this)}getHfIndexFromVisualIndex(e){const n=Et(Rs,this).getIndexesSequence(),r=Et(Rs,this).getNotTrimmedIndexes();return n.indexOf(r[e],e)}syncMoves(e){const r=`move${Ti(Et(eh,this))}s`;Et(yr,this).getEngine().batch(()=>{e.forEach(i=>{const o=i.from!==i.to,s=i.from+1!==i.to;o&&s&&Et(yr,this).getEngine()[r](Et(yr,this).getSheetId(),i.from,1,i.to)})})}storeMovesInformation(e,n,r){r!==!1&&(bs(gS,this,e.map(i=>this.getHfIndexFromVisualIndex(i))),bs(mS,this,this.getHfIndexFromVisualIndex(n)))}calculateAndSyncMoves(e,n){if(Et(yr,this).isPerformingUndoRedo()||e===!1||n===!1)return;const r=PT(Et(gS,this),Et(mS,this),Et(Rs,this).getNumberOfIndexes());Et(yr,this).getSheetId()===null?Et(yr,this).getPostponeAction(()=>this.syncMoves(r)):this.syncMoves(r)}getIndexesChangeSyncMethod(){const e=`set${Ti(Et(eh,this))}Order`;return n=>{if(Et(yr,this).isPerformingUndoRedo())return;const r=Et(Rs,this).getIndexesSequence();if(n==="update"&&r.length>0){const i=Et(Uf,this).map(l=>r.indexOf(l)),o=Et(yr,this).getEngine().getSheetDimensions(Et(yr,this).getSheetId());let s;Et(eh,this)==="row"?s=o.height:s=o.width;const a=i.length;for(let l=a;l<s;l+=1)i.push(l);Et(yr,this).getEngine()[e](Et(yr,this).getSheetId(),i)}bs(Uf,this,r)}}init(){bs(Uf,this,Et(Rs,this).getIndexesSequence())}}function Ia(t,e,n){vne(t,e),e.set(t,n)}function vne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ao(t,e){return t.get(S$(t,e))}function Pa(t,e,n){return t.set(S$(t,e),n),n}function S$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Yf=new WeakMap,Gf=new WeakMap,pS=new WeakMap,wS=new WeakMap,vS=new WeakMap,CS=new WeakMap,yS=new WeakMap;class Cne{constructor(e,n,r){Ia(this,Yf,void 0),Ia(this,Gf,void 0),Ia(this,pS,void 0),Ia(this,wS,!1),Ia(this,vS,!1),Ia(this,CS,null),Ia(this,yS,null),Pa(Yf,this,new fH("row",e,this)),Pa(Gf,this,new fH("column",n,this)),Pa(pS,this,r)}getForAxis(e){return e==="row"?Ao(Yf,this):Ao(Gf,this)}setPerformUndo(e){Pa(wS,this,e)}setPerformRedo(e){Pa(vS,this,e)}isPerformingUndoRedo(){return Ao(wS,this)||Ao(vS,this)}getSheetId(){return Ao(yS,this)}getEngine(){return Ao(CS,this)}getPostponeAction(){return Ao(pS,this)}setupSyncEndpoint(e,n){Pa(CS,this,e),Pa(yS,this,n),Ao(Yf,this).init(),Ao(Gf,this).init()}}function yne(t,e){b$(t,e),e.add(t)}function Oa(t,e,n){return(e=Sne(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Sne(t){var e=bne(t,"string");return typeof e=="symbol"?e:e+""}function bne(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function SS(t,e,n){b$(t,e),e.set(t,n)}function b$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ks(t,e,n){return t.set(Xe(t,e),n),n}function il(t,e){return t.get(Xe(t,e))}function Xe(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Hn="formulas",Rne=["maxRows","maxColumns","language"],Ene=260;ie.getSingleton().register("afterNamedExpressionAdded");ie.getSingleton().register("afterNamedExpressionRemoved");ie.getSingleton().register("afterSheetAdded");ie.getSingleton().register("afterSheetRemoved");ie.getSingleton().register("afterSheetRenamed");ie.getSingleton().register("afterFormulasValuesUpdate");const ic=t=>t==="UndoRedo.undo"||t==="UndoRedo.redo"||t==="auto";var ss=new WeakMap,Lp=new WeakMap,th=new WeakMap,Qe=new WeakSet;class Tne extends et{constructor(){var e;super(...arguments),e=this,yne(this,Qe),SS(this,ss,!1),SS(this,Lp,!1),SS(this,th,[["valuesUpdated",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Xe(Qe,e,Wne).call(e,...r)}],["namedExpressionAdded",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Xe(Qe,e,Bne).call(e,...r)}],["namedExpressionRemoved",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Xe(Qe,e,jne).call(e,...r)}],["sheetAdded",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Xe(Qe,e,Une).call(e,...r)}],["sheetRenamed",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Xe(Qe,e,zne).call(e,...r)}],["sheetRemoved",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Xe(Qe,e,Yne).call(e,...r)}]]),Oa(this,"staticRegister",Oi("formulas")),Oa(this,"engine",null),Oa(this,"sheetId",null),Oa(this,"sheetName",null),Oa(this,"indexSyncer",null),Oa(this,"rowAxisSyncer",null),Oa(this,"columnAxisSyncer",null)}static get PLUGIN_KEY(){return Hn}static get PLUGIN_PRIORITY(){return Ene}static get SETTING_KEYS(){return[Hn,...Rne]}isEnabled(){return!!this.hot.getSettings()[Hn]}enablePlugin(){var e,n=this;if(!this.enabled){if(this.engine=(e=ine(this.hot))!==null&&e!==void 0?e:this.engine,!this.engine){tt("Missing the required `engine` key in the Formulas settings. Please fill it with either an engine class or an engine instance.");return}if(this.sheetName!==null&&!this.engine.doesSheetExist(this.sheetName)){const r=this.addSheet(this.sheetName,this.hot.getSourceDataArray());r!==!1&&Xe(Qe,this,Ph).call(this,r)}this.addHook("beforeLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,gH).call(n,...i)}),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,mH).call(n,...i)}),this.addHook("beforeUpdateData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,gH).call(n,...i)}),this.addHook("afterUpdateData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,mH).call(n,...i)}),this.addHook("modifyData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,Pne).call(n,...i)}),this.addHook("modifySourceData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,One).call(n,...i)}),this.addHook("beforeValidate",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,_ne).call(n,...i)}),this.addHook("afterSetSourceDataAtCell",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,xne).call(n,...i)}),this.addHook("afterSetDataAtCell",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,pH).call(n,...i)}),this.addHook("afterSetDataAtRowProp",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,pH).call(n,...i)}),this.addHook("beforeCreateRow",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,Ane).call(n,...i)}),this.addHook("beforeCreateCol",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,Hne).call(n,...i)}),this.addHook("afterCreateRow",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,kne).call(n,...i)}),this.addHook("afterCreateCol",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,Lne).call(n,...i)}),this.addHook("beforeRemoveRow",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,Nne).call(n,...i)}),this.addHook("beforeRemoveCol",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,Dne).call(n,...i)}),this.addHook("afterRemoveRow",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,$ne).call(n,...i)}),this.addHook("afterRemoveCol",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,Fne).call(n,...i)}),this.indexSyncer=new Cne(this.hot.rowIndexMapper,this.hot.columnIndexMapper,r=>{this.hot.addHookOnce("init",()=>{r()})}),this.rowAxisSyncer=this.indexSyncer.getForAxis("row"),this.columnAxisSyncer=this.indexSyncer.getForAxis("column"),this.hot.addHook("afterRowSequenceChange",this.rowAxisSyncer.getIndexesChangeSyncMethod()),this.hot.addHook("afterColumnSequenceChange",this.columnAxisSyncer.getIndexesChangeSyncMethod()),this.hot.addHook("beforeRowMove",(r,i,o,s)=>{this.rowAxisSyncer.storeMovesInformation(r,i,s)}),this.hot.addHook("beforeColumnMove",(r,i,o,s)=>{this.columnAxisSyncer.storeMovesInformation(r,i,s)}),this.hot.addHook("afterRowMove",(r,i,o,s,a)=>{this.rowAxisSyncer.calculateAndSyncMoves(s,a)}),this.hot.addHook("afterColumnMove",(r,i,o,s,a)=>{this.columnAxisSyncer.calculateAndSyncMoves(s,a)}),this.hot.addHook("beforeColumnFreeze",(r,i)=>{this.columnAxisSyncer.storeMovesInformation([r],this.hot.getSettings().fixedColumnsStart,i)}),this.hot.addHook("afterColumnFreeze",(r,i)=>{this.columnAxisSyncer.calculateAndSyncMoves(i,i)}),this.hot.addHook("beforeColumnUnfreeze",(r,i)=>{this.columnAxisSyncer.storeMovesInformation([r],this.hot.getSettings().fixedColumnsStart-1,i)}),this.hot.addHook("afterColumnUnfreeze",(r,i)=>{this.columnAxisSyncer.calculateAndSyncMoves(i,i)}),this.addHook("afterCellMetaReset",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,Ine).call(n,...i)}),this.addHook("beforeUndo",()=>{this.indexSyncer.setPerformUndo(!0),this.engine.undo()}),this.addHook("beforeRedo",()=>{this.indexSyncer.setPerformRedo(!0),this.engine.redo()}),this.addHook("afterUndo",()=>{this.indexSyncer.setPerformUndo(!1)}),this.addHook("afterUndo",()=>{this.indexSyncer.setPerformRedo(!1)}),this.addHook("afterDetachChild",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,Vne).call(n,...i)}),this.addHook("beforeAutofill",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Xe(Qe,n,Mne).call(n,...i)}),il(th,this).forEach(r=>{let[i,o]=r;return this.engine.on(i,o)}),super.enablePlugin()}}disablePlugin(){il(th,this).forEach(e=>{let[n,r]=e;return this.engine.off(n,r)}),dH(this.engine,this.hot),this.engine=null,super.disablePlugin()}updatePlugin(e){const n=nne(this.hot.getSettings());rne(this.engine.getConfig(),n)&&this.engine.updateConfig(n);const r=this.hot.getSettings()[Hn];if(ue(r)&&ue(r.sheetName)&&r.sheetName!==this.sheetName&&this.switchSheet(r.sheetName),!e.data&&this.sheetName===null){const i=this.hot.getSettings()[Hn].sheetName;if(i&&this.engine.doesSheetExist(i))this.switchSheet(this.sheetName);else{const o=this.addSheet(i??void 0,this.hot.getSourceDataArray());Xe(Qe,this,Ph).call(this,o)}}super.updatePlugin(e)}destroy(){il(th,this).forEach(e=>{var n;let[r,i]=e;return(n=this.engine)===null||n===void 0?void 0:n.off(r,i)}),Ks(th,this,null),dH(this.engine,this.hot),this.engine=null,super.destroy()}addSheet(e,n){if(ue(n)&&!hK(n))return tt("The provided data should be an array of arrays."),!1;if(e!=null&&this.engine.doesSheetExist(e))return tt("Sheet with the provided name already exists."),!1;try{const r=this.engine.addSheet(e??void 0);return n&&this.engine.setSheetContent(this.engine.getSheetId(r),n),r}catch(r){return tt(r.message),!1}}switchSheet(e){if(!this.engine.doesSheetExist(e)){ZR(`The sheet named \`${e}\` does not exist, switch aborted.`);return}Xe(Qe,this,Ph).call(this,e);const n=this.engine.getSheetSerialized(this.sheetId);n.length>0&&this.hot.loadData(n,`${Ti(Hn)}.switchSheet`)}getCellType(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.sheetId;const i=this.hot.toPhysicalRow(e),o=this.hot.toPhysicalColumn(n);return i!==null&&o!==null?this.engine.getCellType({sheet:r,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n)}):"EMPTY"}isFormulaCellType(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.sheetId;return this.engine.doesCellHaveFormula({sheet:r,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n)})}renderDependentSheets(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=new Set;e.forEach(i=>{var o;const s=i==null||(o=i.address)===null||o===void 0?void 0:o.sheet;s!==void 0&&(r.has(s)||r.add(s))}),hH(this.engine).forEach((i,o)=>{if((n||o!==this.sheetId)&&r.has(o)){var s;i.render(),(s=i.view)===null||s===void 0||s.adjustElementsSize()}})}validateDependentCells(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=o=>{var s;const{row:a,col:l,sheet:u}=(s=o==null?void 0:o.address)!==null&&s!==void 0?s:{};return ue(u)?`${u}:${a}x${l}`:""},i=new Set(n.map(o=>r(o)));e.forEach(o=>{var s,a;const{row:l,col:u}=(s=o.address)!==null&&s!==void 0?s:{};if(ue(l)===!1||ue(u)===!1||l>=this.hot.countRows()||u>=this.hot.countCols())return;const c=o==null||(a=o.address)===null||a===void 0?void 0:a.sheet,h=r(o);if(c!==void 0&&!i.has(h)){const d=hH(this.engine).get(c);if(!d)return;d.validateCell(d.getDataAtCell(l,u),d.getCellMeta(l,u),()=>{})}})}syncChangeWithEngine(e,n,r){const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(i)){tt(`Not possible to set cell data at ${JSON.stringify(i)}`);return}const o=this.hot.getCellMeta(e,n);return IT(r,o.type)&&(w$(r,o.dateFormat)?r=v$(r,o.dateFormat):dne(r)===!1&&(r=`'${r}`)),this.engine.setCellContents(i,r)}}function Ph(t){this.sheetName=t,this.sheetId=this.engine.getSheetId(this.sheetName)}function _ne(t,e,n){const r=this.hot.propToCol(n);if(this.isFormulaCellType(e,r)){const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r),sheet:this.sheetId},o=this.hot.getCellMeta(e,r);let s=this.engine.getCellValue(i);return o.type==="date"&&Yn(s)&&(s=C$(s,o.dateFormat)),typeof s=="object"&&s!==null?s.value:s}return t}function Mne(t,e,n){const{row:r,col:i}=e.getTopStartCorner(),{row:o,col:s}=e.getBottomEndCorner(),{row:a,col:l}=n.getTopStartCorner(),{row:u,col:c}=n.getBottomEndCorner(),h={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(r),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(i),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(s),sheet:this.sheetId}},d={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(a),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(u),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(c),sheet:this.sheetId}};if(this.engine.isItPossibleToSetCellContents(d)===!1)return!1;const f=this.engine.getFillRangeData(h,d),{row:m,col:C}=h.start,{row:y,col:E}=h.end,v=y-m+1,O=E-C+1;for(let x=0;x<f.length;x+=1)for(let F=0;F<f[x].length;F+=1){const I=f[x][F],_=m+x%v,q=C+F%O,G=this.hot.getCellMeta(_,q);IT(I,G.type)&&(I.startsWith("'")?f[x][F]=I.slice(1):this.isFormulaCellType(_,q,this.sheetId)===!1&&(f[x][F]=fne(I,G.dateFormat)))}return f}function gH(t,e){(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"").includes(Ti(Hn))||Ks(Lp,this,xt(this.hot.getSettings().data))}function Ine(){if(il(Lp,this)){this.switchSheet(this.sheetName);return}const t=this.hot.getSourceDataArray();t.forEach((n,r)=>{n.forEach((i,o)=>{const s=this.hot.getCellMeta(r,o,{skipMetaExtension:!0}),a=s.dateFormat;IT(i,s.type)&&(w$(i,a)?t[r][o]=v$(i,a):i.startsWith("=")||(t[r][o]=`'${i}`))})}),Ks(ss,this,!0);const e=this.engine.setSheetContent(this.sheetId,t);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(e),Ks(ss,this,!1)}function mH(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(n.includes(Ti(Hn)))return;const r=une(this.engine,this.hot.getSettings()[Hn].sheetName);if(Xe(Qe,this,Ph).call(this,r),n!=="updateSettings")if(il(Lp,this))this.switchSheet(this.sheetName);else{const i=this.hot.getSourceDataArray();if(this.engine.isItPossibleToReplaceSheetContent(this.sheetId,i)){Ks(ss,this,!0);const o=this.engine.setSheetContent(this.sheetId,i);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(o),Ks(ss,this,!1)}}}function Pne(t,e,n,r){if(r!=="get"||il(ss,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(t);if(i===null||e===null)return;const o=this.getCellType(i,e);if(o==="VALUE"||o==="EMPTY"){n.value=hne(n.value);return}const s={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(e),sheet:this.sheetId};let a=this.engine.getCellValue(s);const l=this.hot.getCellMeta(i,e,{skipMetaExtension:!0});l.type==="date"&&Yn(a)&&(a=C$(a,l.dateFormat)),n.value=typeof a=="object"&&a!==null?a.value:a}function One(t,e,n,r){if(r!=="get"||il(ss,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(t),o=this.hot.propToCol(e);if(i===null||o===null)return;const s=this.getCellType(i,o);if(s==="VALUE"||s==="EMPTY")return;const a=this.engine.getSheetDimensions(this.engine.getSheetId(this.sheetName));if(a.width===0&&a.height===0)return;const l={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(o),sheet:this.sheetId};n.value=this.engine.getCellSerialized(l)}function pH(t,e){if(ic(e))return;const n=[],r=[],i=this.engine.batch(()=>{t.forEach(o=>{let[s,a,,l]=o;const u=this.hot.propToCol(a),c=this.hot.toPhysicalRow(s),h=this.hot.toPhysicalColumn(u),d={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(s),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(u),sheet:this.sheetId};c!==null&&h!==null?this.syncChangeWithEngine(s,u,l):n.push([s,u,l]),r.push({address:d})})});n.length&&this.hot.addHookOnce("afterChange",()=>{const o=this.engine.batch(()=>{n.forEach(s=>{let[a,l,u]=s;this.syncChangeWithEngine(a,l,u)})});this.renderDependentSheets(o,!0)}),this.renderDependentSheets(i),this.validateDependentCells(i,r)}function xne(t,e){if(ic(e))return;const n=[],r=[];t.forEach(i=>{let[o,s,,a]=i;const l=this.hot.propToCol(s);if(!Yn(l))return;const u={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(u)){tt(`Not possible to set source cell data at ${JSON.stringify(u)}`);return}r.push({address:u}),n.push(...this.engine.setCellContents(u,a))}),this.renderDependentSheets(n),this.validateDependentCells(n,r)}function Ane(t,e){let n=this.rowAxisSyncer.getHfIndexFromVisualIndex(t);if(t>=this.hot.countRows()&&(n=t),this.sheetId===null||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddRows(this.sheetId,[n,e]))return!1}function Hne(t,e){let n=this.columnAxisSyncer.getHfIndexFromVisualIndex(t);if(t>=this.hot.countCols()&&(n=t),this.sheetId===null||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddColumns(this.sheetId,[n,e]))return!1}function Nne(t,e,n){return this.rowAxisSyncer.setRemovedHfIndexes(n).every(o=>this.engine.isItPossibleToRemoveRows(this.sheetId,[o,1]))===!1?!1:void 0}function Dne(t,e,n){return this.columnAxisSyncer.setRemovedHfIndexes(n).every(o=>this.engine.isItPossibleToRemoveColumns(this.sheetId,[o,1]))===!1?!1:void 0}function kne(t,e,n){if(ic(n))return;const r=this.engine.addRows(this.sheetId,[this.rowAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(r)}function Lne(t,e,n){if(ic(n))return;const r=this.engine.addColumns(this.sheetId,[this.columnAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(r)}function $ne(t,e,n,r){if(ic(r))return;const i=this.rowAxisSyncer.getRemovedHfIndexes().sort((s,a)=>a-s),o=this.engine.batch(()=>{i.forEach(s=>{this.engine.removeRows(this.sheetId,[s,1])})});this.renderDependentSheets(o)}function Fne(t,e,n,r){if(ic(r))return;const i=this.columnAxisSyncer.getRemovedHfIndexes().sort((s,a)=>a-s),o=this.engine.batch(()=>{i.forEach(s=>{this.engine.removeColumns(this.sheetId,[s,1])})});this.renderDependentSheets(o)}function Vne(t,e,n){var r;Ks(ss,this,!0);const i=this.hot.getSourceDataArray(n,0,n+(((r=e.__children)===null||r===void 0?void 0:r.length)||0),this.hot.countSourceCols());Ks(ss,this,!1),i.forEach((o,s)=>{o.forEach((a,l)=>{this.engine.setCellContents({col:l,row:n+s,sheet:this.sheetId},[[a]])})})}function Wne(t){this.hot.runHooks("afterFormulasValuesUpdate",t)}function Bne(t,e){this.hot.runHooks("afterNamedExpressionAdded",t,e)}function jne(t,e){this.hot.runHooks("afterNamedExpressionRemoved",t,e)}function Une(t){this.hot.runHooks("afterSheetAdded",t)}function zne(t,e){Xe(Qe,this,Ph).call(this,e),this.hot.runHooks("afterSheetRenamed",t,e)}function Yne(t,e){this.hot.runHooks("afterSheetRemoved",t,e)}function Gne(t){return{key:"hidden_columns_hide",name(){const e=this.getSelectedLast();let n=0;if(Array.isArray(e)){const[,r,,i]=e;r-i!==0&&(n=1)}return this.getTranslatedPhrase(u0,n)},callback(){const{from:e,to:n}=this.getSelectedRangeLast(),r=Math.max(Math.min(e.col,n.col),0),i=Math.max(e.col,n.col),o=[];for(let l=r;l<=i;l+=1)o.push(l);t.hideColumns(o);const s=o[o.length-1],a=this.columnIndexMapper.getNearestNotHiddenIndex(s,1,!0);Number.isInteger(a)&&a>=0?this.selectColumns(a):this.deselectCell(),this.render(),this.view.adjustElementsSize()},disabled:!1,hidden(){return!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())}}}function qne(t){const e=[];return{key:"hidden_columns_show",name(){const n=e.length>1?1:0;return this.getTranslatedPhrase(c0,n)},callback(){var n,r;if(e.length===0)return;let i=e[0],o=e[e.length-1];i=(n=this.columnIndexMapper.getNearestNotHiddenIndex(i-1,-1))!==null&&n!==void 0?n:0,o=(r=this.columnIndexMapper.getNearestNotHiddenIndex(o+1,1))!==null&&r!==void 0?r:this.countCols()-1,t.showColumns(e),this.render(),this.view.adjustElementsSize(),o-i+1===this.countCols()||this.selectColumns(i,o)},disabled:!1,hidden(){const n=ze(t.getHiddenColumns(),h=>this.toPhysicalColumn(h));if(!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())||n.length<1)return!0;e.length=0;const r=this.getSelectedRangeLast(),i=r.getTopStartCorner().col,o=r.getBottomEndCorner().col,s=this.columnIndexMapper,a=s.getRenderableFromVisualIndex(i),l=s.getRenderableFromVisualIndex(o),u=s.getNotTrimmedIndexes(),c=[];if(i!==o){const h=o-i+1,d=l-a+1;if(h>d){const f=u.slice(i,o+1);c.push(...f.filter(m=>n.includes(m)))}}else if(a===0&&a<i)c.push(...u.slice(0,i));else if(a===null)c.push(...u.slice(0,this.countCols()));else{const h=this.countCols()-1,d=s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(h,-1));l===d&&h>o&&c.push(...u.slice(o+1))}return H(c,h=>{e.push(this.toVisualColumn(h))}),e.length===0}}}function Kne(t,e){R$(t,e),e.add(t)}function Xne(t,e,n){R$(t,e),e.set(t,n)}function R$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xa(t,e){return t.get(Os(t,e))}function wH(t,e,n){return t.set(Os(t,e),n),n}function Os(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}ie.getSingleton().register("beforeHideColumns");ie.getSingleton().register("afterHideColumns");ie.getSingleton().register("beforeUnhideColumns");ie.getSingleton().register("afterUnhideColumns");const vH="hiddenColumns",Zne=310;var Bi=new WeakMap,Aa=new WeakSet;class Jne extends et{constructor(){super(...arguments),Kne(this,Aa),Xne(this,Bi,null)}static get PLUGIN_KEY(){return vH}static get PLUGIN_PRIORITY(){return Zne}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,columns:[]}}isEnabled(){return!!this.hot.getSettings()[vH]}enablePlugin(){var e=this;this.enabled||(wH(Bi,this,new fp),xa(Bi,this).addLocalHook("init",()=>Os(Aa,this,ire).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,xa(Bi,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Os(Aa,e,rre).call(e,...r)}),this.addHook("afterGetCellMeta",(n,r,i)=>Os(Aa,this,ere).call(this,n,r,i)),this.addHook("modifyColWidth",(n,r)=>Os(Aa,this,Qne).call(this,n,r),2),this.addHook("afterGetColHeader",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Os(Aa,e,nre).call(e,...r)}),this.addHook("modifyCopyableRange",n=>Os(Aa,this,tre).call(this,n)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.columnIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showColumns(e){const n=this.getHiddenColumns(),r=this.isValidConfig(e);let i=n;const o=xa(Bi,this).getValues().slice(),s=e.length>0;if(r&&s){const l=e.map(u=>this.hot.toPhysicalColumn(u));H(l,u=>{o[u]=!1}),i=wr(o,(u,c,h)=>(c&&u.push(this.hot.toVisualColumn(h)),u),[])}this.hot.runHooks("beforeUnhideColumns",n,i,r&&s)!==!1&&(r&&s&&xa(Bi,this).setValues(o),this.hot.view.adjustElementsSize(),this.hot.runHooks("afterUnhideColumns",n,i,r&&s,r&&i.length<n.length))}showColumn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.showColumns(n)}hideColumns(e){const n=this.getHiddenColumns(),r=this.isValidConfig(e);let i=n;r&&(i=Array.from(new Set(n.concat(e)))),this.hot.runHooks("beforeHideColumns",n,i,r)!==!1&&(r&&this.hot.batchExecution(()=>{H(e,s=>{xa(Bi,this).setValueAtIndex(this.hot.toPhysicalColumn(s),!0)})},!0),this.hot.runHooks("afterHideColumns",n,i,r,r&&i.length>n.length))}hideColumn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.hideColumns(n)}getHiddenColumns(){return ze(xa(Bi,this).getHiddenIndexes(),e=>this.hot.toVisualColumn(e))}isHidden(e){return xa(Bi,this).getValueAtIndex(this.hot.toPhysicalColumn(e))||!1}isValidConfig(e){const n=this.hot.countCols();return Array.isArray(e)&&e.length>0?e.every(r=>Number.isInteger(r)&&r>=0&&r<n):!1}resetCellsMeta(){H(this.hot.getCellsMeta(),e=>{e.skipColumnOnPaste=!1})}destroy(){wH(Bi,this,null),super.destroy()}}function Qne(t,e){if(this.isHidden(e))return 0;if(this.getSetting("indicators")&&(this.isHidden(e+1)||this.isHidden(e-1))&&typeof t=="number"&&this.hot.hasColHeaders())return t+15}function ere(t,e,n){if(this.getSetting("copyPasteEnabled")===!1&&this.isHidden(e)&&(n.skipColumnOnPaste=!0),this.isHidden(e-1))n.className=n.className||"",n.className.indexOf("afterHiddenColumn")===-1&&(n.className+=" afterHiddenColumn");else if(n.className){const r=n.className.split(" ");if(r.length>0){const i=r.indexOf("afterHiddenColumn");i>-1&&r.splice(i,1),n.className=r.join(" ")}}}function tre(t){if(this.getSetting("copyPasteEnabled"))return t;const e=[],n=(r,i,o,s)=>{e.push({startRow:r,endRow:i,startCol:o,endCol:s})};return H(t,r=>{let i=!0,o=0;fe(r.startCol,r.endCol,s=>{this.isHidden(s)?(i||n(r.startRow,r.endRow,o,s-1),i=!0):(i&&(o=s),s===r.endCol&&n(r.startRow,r.endRow,o,s),i=!1)})}),e}function nre(t,e){if(!this.getSetting("indicators")||t<0)return;const n=[];t>=1&&this.isHidden(t-1)&&n.push("afterHiddenColumn"),t<this.hot.countCols()-1&&this.isHidden(t+1)&&n.push("beforeHiddenColumn"),X(e,n)}function rre(t){t.items.push({name:Ne},Gne(this),qne(this))}function ire(){const t=this.getSetting("columns");Array.isArray(t)&&this.hideColumns(t)}function ore(t){return{key:"hidden_rows_hide",name(){const e=this.getSelectedLast();let n=0;if(Array.isArray(e)){const[r,,i]=e;r-i!==0&&(n=1)}return this.getTranslatedPhrase(h0,n)},callback(){const{from:e,to:n}=this.getSelectedRangeLast(),r=Math.max(Math.min(e.row,n.row),0),i=Math.max(e.row,n.row),o=[];for(let l=r;l<=i;l+=1)o.push(l);t.hideRows(o);const s=o[o.length-1],a=this.rowIndexMapper.getNearestNotHiddenIndex(s,1,!0);Number.isInteger(a)&&a>=0?this.selectRows(a):this.deselectCell(),this.render(),this.view.adjustElementsSize()},disabled:!1,hidden(){return!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())}}}function sre(t){const e=[];return{key:"hidden_rows_show",name(){const n=e.length>1?1:0;return this.getTranslatedPhrase(d0,n)},callback(){var n,r;if(e.length===0)return;let i=e[0],o=e[e.length-1];i=(n=this.rowIndexMapper.getNearestNotHiddenIndex(i-1,-1))!==null&&n!==void 0?n:0,o=(r=this.rowIndexMapper.getNearestNotHiddenIndex(o+1,1))!==null&&r!==void 0?r:this.countRows()-1,t.showRows(e),this.render(),this.view.adjustElementsSize(),o-i+1===this.countRows()||this.selectRows(i,o)},disabled:!1,hidden(){const n=ze(t.getHiddenRows(),h=>this.toPhysicalRow(h));if(!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())||n.length<1)return!0;e.length=0;const r=this.getSelectedRangeLast(),i=r.getTopStartCorner().row,o=r.getBottomEndCorner().row,s=this.rowIndexMapper,a=s.getRenderableFromVisualIndex(i),l=s.getRenderableFromVisualIndex(o),u=s.getNotTrimmedIndexes(),c=[];if(i!==o){const h=o-i+1,d=l-a+1;if(h>d){const f=u.slice(i,o+1);c.push(...f.filter(m=>n.includes(m)))}}else if(a===0&&a<i)c.push(...u.slice(0,i));else if(a===null)c.push(...u.slice(0,this.countRows()));else{const h=this.countRows()-1,d=s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(h,-1));l===d&&h>o&&c.push(...u.slice(o+1))}return H(c,h=>{e.push(this.toVisualRow(h))}),e.length===0}}}function are(t,e){E$(t,e),e.add(t)}function lre(t,e,n){E$(t,e),e.set(t,n)}function E$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ha(t,e){return t.get(xs(t,e))}function CH(t,e,n){return t.set(xs(t,e),n),n}function xs(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}ie.getSingleton().register("beforeHideRows");ie.getSingleton().register("afterHideRows");ie.getSingleton().register("beforeUnhideRows");ie.getSingleton().register("afterUnhideRows");const yH="hiddenRows",ure=320;var ji=new WeakMap,Na=new WeakSet;class cre extends et{constructor(){super(...arguments),are(this,Na),lre(this,ji,null)}static get PLUGIN_KEY(){return yH}static get PLUGIN_PRIORITY(){return ure}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,rows:[]}}isEnabled(){return!!this.hot.getSettings()[yH]}enablePlugin(){var e=this;this.enabled||(CH(ji,this,new fp),Ha(ji,this).addLocalHook("init",()=>xs(Na,this,pre).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,Ha(ji,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return xs(Na,e,mre).call(e,...r)}),this.addHook("afterGetCellMeta",(n,r,i)=>xs(Na,this,dre).call(this,n,r,i)),this.addHook("modifyRowHeight",(n,r)=>xs(Na,this,hre).call(this,n,r)),this.addHook("afterGetRowHeader",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return xs(Na,e,gre).call(e,...r)}),this.addHook("modifyCopyableRange",n=>xs(Na,this,fre).call(this,n)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.rowIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showRows(e){const n=this.getHiddenRows(),r=this.isValidConfig(e);let i=n;const o=Ha(ji,this).getValues().slice(),s=e.length>0;if(r&&s){const l=e.map(u=>this.hot.toPhysicalRow(u));H(l,u=>{o[u]=!1}),i=wr(o,(u,c,h)=>(c&&u.push(this.hot.toVisualRow(h)),u),[])}this.hot.runHooks("beforeUnhideRows",n,i,r&&s)!==!1&&(r&&s&&Ha(ji,this).setValues(o),this.hot.runHooks("afterUnhideRows",n,i,r&&s,r&&i.length<n.length))}showRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.showRows(n)}hideRows(e){const n=this.getHiddenRows(),r=this.isValidConfig(e);let i=n;r&&(i=Array.from(new Set(n.concat(e)))),this.hot.runHooks("beforeHideRows",n,i,r)!==!1&&(r&&this.hot.batchExecution(()=>{H(e,s=>{Ha(ji,this).setValueAtIndex(this.hot.toPhysicalRow(s),!0)})},!0),this.hot.runHooks("afterHideRows",n,i,r,r&&i.length>n.length))}hideRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.hideRows(n)}getHiddenRows(){return ze(Ha(ji,this).getHiddenIndexes(),e=>this.hot.toVisualRow(e))}isHidden(e){return Ha(ji,this).getValueAtIndex(this.hot.toPhysicalRow(e))||!1}isValidConfig(e){const n=this.hot.countRows();return Array.isArray(e)&&e.length>0?e.every(r=>Number.isInteger(r)&&r>=0&&r<n):!1}resetCellsMeta(){H(this.hot.getCellsMeta(),e=>{e.skipRowOnPaste=!1})}destroy(){CH(ji,this,null),super.destroy()}}function hre(t,e){return this.isHidden(e)?0:t}function dre(t,e,n){if(this.getSetting("copyPasteEnabled")===!1&&this.isHidden(t)&&(n.skipRowOnPaste=!0),this.isHidden(t-1))n.className=n.className||"",n.className.indexOf("afterHiddenRow")===-1&&(n.className+=" afterHiddenRow");else if(n.className){const r=n.className.split(" ");if(r.length>0){const i=r.indexOf("afterHiddenRow");i>-1&&r.splice(i,1),n.className=r.join(" ")}}}function fre(t){if(this.getSetting("copyPasteEnabled"))return t;const e=[],n=(r,i,o,s)=>{e.push({startRow:r,endRow:i,startCol:o,endCol:s})};return H(t,r=>{let i=!0,o=0;fe(r.startRow,r.endRow,s=>{this.isHidden(s)?(i||n(o,s-1,r.startCol,r.endCol),i=!0):(i&&(o=s),s===r.endRow&&n(o,s,r.startCol,r.endCol),i=!1)})}),e}function gre(t,e){if(!this.getSetting("indicators")||t<0)return;const n=[];t>=1&&this.isHidden(t-1)&&n.push("afterHiddenRow"),t<this.hot.countRows()-1&&this.isHidden(t+1)&&n.push("beforeHiddenRow"),X(e,n)}function mre(t){t.items.push({name:Ne},ore(this),sre(this))}function pre(){const t=this.getSetting("rows");Array.isArray(t)&&this.hideRows(t)}function wre(t){return{key:"freeze_column",name(){return this.getTranslatedPhrase(FE)},callback(e,n){const[{start:{col:r}}]=n;t.freezeColumn(r),this.render(),this.view.adjustElementsSize()},hidden(){const e=this.getSelectedRange();let n=!1;return(e===void 0||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col<=this.getSettings().fixedColumnsStart-1)&&(n=!0),n}}}function vre(t){return{key:"unfreeze_column",name(){return this.getTranslatedPhrase(VE)},callback(e,n){const[{start:{col:r}}]=n;t.unfreezeColumn(r),this.render(),this.view.adjustElementsSize()},hidden(){const e=this.getSelectedRange();let n=!1;return(e===void 0||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col>=this.getSettings().fixedColumnsStart)&&(n=!0),n}}}function Cre(t,e){T$(t,e),e.add(t)}function yre(t,e,n){T$(t,e),e.set(t,n)}function T$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qb(t,e){return t.get(Rm(t,e))}function bS(t,e,n){return t.set(Rm(t,e),n),n}function Rm(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}ie.getSingleton().register("beforeColumnFreeze");ie.getSingleton().register("afterColumnFreeze");ie.getSingleton().register("beforeColumnUnfreeze");ie.getSingleton().register("afterColumnUnfreeze");const SH="manualColumnFreeze",Sre=110;var Ya=new WeakMap,RS=new WeakSet;class bre extends et{constructor(){super(...arguments),Cre(this,RS),yre(this,Ya,!1)}static get PLUGIN_KEY(){return SH}static get PLUGIN_PRIORITY(){return Sre}isEnabled(){return!!this.hot.getSettings()[SH]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>Rm(RS,this,Rre).call(this,e)),this.addHook("beforeColumnMove",(e,n)=>Rm(RS,this,Ere).call(this,e,n)),super.enablePlugin())}disablePlugin(){bS(Ya,this,!1),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}freezeColumn(e){const n=this.hot.getSettings(),r=n.fixedColumnsStart<this.hot.countCols()&&e>n.fixedColumnsStart-1;qb(Ya,this)||bS(Ya,this,!0),this.hot.runHooks("beforeColumnFreeze",e,r)!==!1&&(r&&(this.hot.columnIndexMapper.moveIndexes(e,n.fixedColumnsStart),n._fixedColumnsStart+=1),this.hot.runHooks("afterColumnFreeze",e,r))}unfreezeColumn(e){const n=this.hot.getSettings(),r=n.fixedColumnsStart>0&&e<=n.fixedColumnsStart-1;qb(Ya,this)||bS(Ya,this,!0),this.hot.runHooks("beforeColumnUnfreeze",e,r)!==!1&&(r&&(n._fixedColumnsStart-=1,this.hot.columnIndexMapper.moveIndexes(e,n.fixedColumnsStart)),this.hot.runHooks("afterColumnUnfreeze",e,r))}}function Rre(t){t.items.push({name:"---------"},wre(this),vre(this))}function Ere(t,e){if(qb(Ya,this)){const n=this.hot.getSettings().fixedColumnsStart;if(e<n||t.some(r=>r<n))return!1}}function qf(t,e,n){return(e=Tre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tre(t){var e=_re(t,"string");return typeof e=="symbol"?e:e+""}function _re(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const ES=0,bH=1,RH=2,ru="px";let _$=class{constructor(e){qf(this,"hot",void 0),qf(this,"_element",null),qf(this,"state",ES),qf(this,"inlineProperty",void 0),this.hot=e,this.inlineProperty=e.isRtl()?"right":"left"}appendTo(e){e.appendChild(this._element),this.state=RH}build(){this.state===ES&&(this._element=this.hot.rootDocument.createElement("div"),this.state=bH)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=ES}isAppended(){return this.state===RH}isBuilt(){return this.state>=bH}setPosition(e,n){Yn(e)&&(this._element.style.top=e+ru),Yn(n)&&(this._element.style[this.inlineProperty]=n+ru)}getPosition(){const e=this._element.style;return{top:e.top?parseInt(e.top,10):0,start:e[this.inlineProperty]?parseInt(e[this.inlineProperty],10):0}}setSize(e,n){Yn(e)&&(this._element.style.width=e+ru),Yn(n)&&(this._element.style.height=n+ru)}getSize(){return{width:this._element.style.width?parseInt(this._element.style.width,10):0,height:this._element.style.height?parseInt(this._element.style.height,10):0}}setOffset(e,n){Yn(e)&&(this._element.style.marginTop=e+ru),Yn(n)&&(this._element.style[`margin${Ti(this.inlineProperty)}`]=n+ru)}getOffset(){const e=this._element.style,n=`margin${Ti(this.inlineProperty)}`;return{top:e.marginTop?parseInt(e.marginTop,10):0,start:e[n]?parseInt(e[n],10):0}}};const Mre="ht__manualColumnMove--backlight";let Ire=class extends _${build(){super.build(),X(this._element,Mre)}};const Pre="ht__manualColumnMove--guideline";let Ore=class extends _${build(){super.build(),X(this._element,Pre)}};function xre(t,e){M$(t,e),e.add(t)}function ai(t,e,n){M$(t,e),e.set(t,n)}function M$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fr(t,e,n){return t.set(As(t,e),n),n}function he(t,e){return t.get(As(t,e))}function As(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}ie.getSingleton().register("beforeColumnMove");ie.getSingleton().register("afterColumnMove");const TS="manualColumnMove",Are=120,EH="ht__manualColumnMove",Em="show-ui",Kb="on-moving--columns",Xb="after-selection--columns";var Un=new WeakMap,Ns=new WeakMap,Xo=new WeakMap,Bg=new WeakMap,Bs=new WeakMap,jn=new WeakMap,Kf=new WeakMap,Wr=new WeakMap,vu=new WeakMap,Tm=new WeakMap,Oh=new WeakMap,Da=new WeakSet;class Hre extends et{constructor(){super(...arguments),xre(this,Da),ai(this,Un,new Ire(this.hot)),ai(this,Ns,new Ore(this.hot)),ai(this,Xo,[]),ai(this,Bg,0),ai(this,Bs,!1),ai(this,jn,{}),ai(this,Kf,void 0),ai(this,Wr,void 0),ai(this,vu,void 0),ai(this,Tm,void 0),ai(this,Oh,void 0)}static get PLUGIN_KEY(){return TS}static get PLUGIN_PRIORITY(){return Are}isEnabled(){return!!this.hot.getSettings()[TS]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return As(Da,e,Nre).call(e,...r)}),this.addHook("beforeOnCellMouseOver",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return As(Da,e,kre).call(e,...r)}),this.addHook("afterScrollVertically",()=>As(Da,this,$re).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return As(Da,e,Fre).call(e,...r)}),this.buildPluginUI(),this.registerEvents(),X(this.hot.rootElement,EH),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){we(this.hot.rootElement,EH),this.unregisterEvents(),he(Un,this).destroy(),he(Ns,this).destroy(),super.disablePlugin()}moveColumn(e,n){return this.moveColumns([e],n)}moveColumns(e,n){const r=he(Kf,this),i=this.isMovePossible(e,n),o=this.hot.runHooks("beforeColumnMove",e,n,r,i);if(fr(Kf,this,void 0),o===!1)return;i&&this.hot.columnIndexMapper.moveIndexes(e,n);const s=i&&this.isColumnOrderChanged(e,n);return this.hot.runHooks("afterColumnMove",e,n,r,i,s),s}dragColumn(e,n){return this.dragColumns([e],n)}dragColumns(e,n){const r=this.countFinalIndex(e,n);return fr(Kf,this,n),this.moveColumns(e,r)}isMovePossible(e,n){const r=this.hot.columnIndexMapper.getNotTrimmedIndexesLength(),i=e.length+n>r,o=n<0,s=e.some(l=>l<0),a=e.some(l=>l>=r);return!(i||o||s||a)}isColumnOrderChanged(e,n){return e.some((r,i)=>r-i!==n)}countFinalIndex(e,n){const r=wr(e,(i,o)=>(o<n&&(i+=1),i),0);return n-r}getColumnsWidth(e,n){const r=this.hot.columnIndexMapper;let i=0;for(let o=e;o<=n;o+=1){const s=r.getRenderableFromVisualIndex(o);o<0?i+=this.hot.view._wt.wtViewport.getRowHeaderWidth()||0:s!==null&&(i+=this.hot.view._wt.wtTable.getColumnWidth(s)||0)}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[TS];if(Array.isArray(e))this.moveColumns(e,0);else if(e!==void 0){const n=this.persistentStateLoad();n.length&&this.moveColumns(n,0)}}isFixedColumnsStart(e){return e<this.hot.getSettings().fixedColumnsStart}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualColumnMove",this.hot.columnIndexMapper.getIndexesSequence())}persistentStateLoad(){const e={};return this.hot.runHooks("persistentStateLoad","manualColumnMove",e),e.value?e.value:[]}prepareColumnsToMoving(e,n){const r=[];return fe(e,n,i=>{r.push(i)}),r}refreshPositions(){const e=this.hot.view.getFirstFullyVisibleColumn();this.isFixedColumnsStart(he(Wr,this))&&e>0&&this.hot.scrollViewportTo({col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(e-1,-1)});const n=this.hot.view._wt.wtTable,r=this.hot.view._wt.wtOverlays.scrollableElement,i=typeof r.scrollX=="number"?r.scrollX:r.scrollLeft;let o=this.hot.view.THEAD.offsetLeft+this.getColumnsWidth(0,he(Wr,this)-1);const s=n.hider.offsetWidth,a=n.TBODY.offsetLeft,l=he(Un,this).getOffset().start,u=he(Un,this).getSize().width;let c=0,h=0;if(this.hot.isRtl()){const m=this.hot.rootWindow,C=Xt(this.hot.rootElement),y=m.innerWidth-he(vu,this)-C;h=m.innerWidth-he(jn,this).eventPageX-y-(r.scrollX===void 0?i:0)}else h=he(jn,this).eventPageX-(he(vu,this)-(r.scrollX===void 0?i:0));if(he(Tm,this)&&(c=this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth),this.isFixedColumnsStart(he(Wr,this))&&(o+=i),o+=c,he(Wr,this)<0)he(Oh,this)>0?he(jn,this).col=0:he(jn,this).col=e>0?e-1:e;else if(he(jn,this).TD.offsetWidth/2+o<=h){const m=he(Wr,this)>=he(Bg,this)?he(Bg,this)-1:he(Wr,this);he(jn,this).col=m+1,o+=he(jn,this).TD.offsetWidth}else he(jn,this).col=he(Wr,this);let d=h,f=o;h+u+l>=s?d=s-u-l:h+l<a+c&&(d=a+c+Math.abs(l)),o>=s-1?f=s-1:f===0?f=1:r.scrollX!==void 0&&he(Wr,this)<he(Oh,this)&&(f-=he(vu,this)<=r.scrollX?he(vu,this):0),he(Un,this).setPosition(null,d),he(Ns,this).setPosition(null,f)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",n=>As(Da,this,Dre).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>As(Da,this,Lre).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){he(Un,this).build(),he(Ns,this).build()}destroy(){he(Un,this).destroy(),he(Ns,this).destroy(),super.destroy()}}function Nre(t,e,n,r){const i=this.hot.view._wt.wtTable,o=this.hot.selection.isSelectedByColumnHeader(),s=this.hot.getSelectedRangeLast(),a=ye(t.target,"sortAction");if(!s||!o||he(Bs,this)||t.button!==0||a){fr(Bs,this,!1),he(Xo,this).length=0,we(this.hot.rootElement,[Kb,Em]);return}const l=he(Ns,this).isBuilt()&&!he(Ns,this).isAppended(),u=he(Un,this).isBuilt()&&!he(Un,this).isAppended();l&&u&&(he(Ns,this).appendTo(i.hider),he(Un,this).appendTo(i.hider));const{from:c,to:h}=s,d=Math.min(c.col,h.col),f=Math.max(c.col,h.col);if(e.row<0&&e.col>=d&&e.col<=f){r.column=!0,fr(Bs,this,!0);const m=n.firstChild?Qz(t,n.firstChild).x:t.offsetX;he(jn,this).eventPageX=t.pageX,fr(Wr,this,e.col),he(jn,this).TD=n,he(jn,this).col=e.col,fr(Xo,this,this.prepareColumnsToMoving(d,f)),fr(Tm,this,!!this.hot.getSettings().rowHeaders),fr(Bg,this,this.hot.countCols()),fr(Oh,this,this.hot.getSettings().fixedColumnsStart),fr(vu,this,Nn(this.hot.rootElement).left);const C=he(Tm,this)?-1:0,y=i.holder.scrollTop+i.getColumnHeaderHeight(0)+1,E=e.col<he(Oh,this),v=this.hot.view._wt.wtOverlays.inlineStartOverlay.getOverlayOffset(),O=Math.abs(m-(this.hot.isRtl()?n.offsetWidth:0)),x=this.getColumnsWidth(d,e.col-1)+O,F=this.getColumnsWidth(C,d-1)+(E?v:0)+x;he(Un,this).setPosition(y,F),he(Un,this).setSize(this.getColumnsWidth(d,f),i.hider.offsetHeight-y),he(Un,this).setOffset(null,-x),X(this.hot.rootElement,Kb)}else we(this.hot.rootElement,Xb),fr(Bs,this,!1),he(Xo,this).length=0}function Dre(t){he(Bs,this)&&(he(jn,this).eventPageX=t.pageX,this.refreshPositions())}function kre(t,e,n,r){!this.hot.getSelectedRangeLast()||!he(Bs,this)||(he(Xo,this).indexOf(e.col)>-1?we(this.hot.rootElement,Em):X(this.hot.rootElement,Em),r.row=!0,r.column=!0,r.cell=!0,fr(Wr,this,e.col),he(jn,this).TD=n)}function Lre(){const t=he(jn,this).col,e=he(Xo,this).length;if(fr(Wr,this,void 0),fr(Bs,this,!1),we(this.hot.rootElement,[Kb,Em,Xb]),this.hot.selection.isSelectedByColumnHeader()&&X(this.hot.rootElement,Xb),e<1||t===void 0)return;const n=he(Xo,this)[0],r=this.hot.toPhysicalColumn(n),i=this.dragColumns(he(Xo,this),t);if(he(Xo,this).length=0,i===!0){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize();const o=this.hot.toVisualColumn(r),s=o+e-1;this.hot.selectColumns(o,s)}}function $re(){const t=this.hot.view._wt.wtTable,e=t.getColumnHeaderHeight(0)+1,n=t.holder.scrollTop,r=e+n;he(Un,this).setPosition(r),he(Un,this).setSize(null,t.hider.offsetHeight-r)}function Fre(){this.moveBySettingsOrLoad()}function Vre(t,e){I$(t,e),e.add(t)}function In(t,e,n){I$(t,e),e.set(t,n)}function I$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function zt(t,e,n){return t.set(pi(t,e),n),n}function oe(t,e){return t.get(pi(t,e))}function pi(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const _m="manualColumnResize",Wre=130,TH="manualColumnWidths";var Wo=new WeakMap,Xf=new WeakMap,Ir=new WeakMap,Mm=new WeakMap,lo=new WeakMap,Bre=new WeakMap,Au=new WeakMap,Zf=new WeakMap,or=new WeakMap,Lo=new WeakMap,fl=new WeakMap,Im=new WeakMap,xh=new WeakMap,Ah=new WeakMap,Or=new WeakMap,Hh=new WeakMap,Ui=new WeakSet;class jre extends et{static get PLUGIN_KEY(){return _m}static get PLUGIN_PRIORITY(){return Wre}constructor(e){super(e),Vre(this,Ui),In(this,Wo,null),In(this,Xf,null),In(this,Ir,[]),In(this,Mm,null),In(this,lo,null),In(this,Bre,null),In(this,Au,null),In(this,Zf,null),In(this,or,this.hot.rootDocument.createElement("DIV")),In(this,Lo,this.hot.rootDocument.createElement("DIV")),In(this,fl,null),In(this,Im,!1),In(this,xh,0),In(this,Ah,null),In(this,Or,void 0),In(this,Hh,void 0),X(oe(or,this),"manualColumnResizer"),X(oe(Lo,this),"manualColumnResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[_m]}enablePlugin(){var e=this;this.enabled||(zt(Or,this,new ea),oe(Or,this).addLocalHook("init",()=>pi(Ui,this,Ure).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,oe(Or,this)),this.addHook("modifyColWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pi(Ui,e,Xre).call(e,...r)},1),this.addHook("beforeStretchingColumnWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pi(Ui,e,Zre).call(e,...r)},1),this.addHook("beforeColumnResize",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pi(Ui,e,Jre).call(e,...r)}),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){zt(Hh,this,oe(Or,this).getValues()),this.hot.columnIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualColumnWidths(){this.hot.runHooks("persistentStateSave",TH,oe(Or,this).getValues())}loadManualColumnWidths(){const e={};return this.hot.runHooks("persistentStateLoad",TH,e),e.value}setManualSize(e,n){const r=Math.max(n,20),i=this.hot.toPhysicalColumn(e);return oe(Or,this).setValueAtIndex(i,r),r}clearManualSize(e){const n=this.hot.toPhysicalColumn(e);oe(Or,this).setValueAtIndex(n,null)}setupHandlePosition(e){if(!e.parentNode)return;zt(Wo,this,e);const{_wt:n}=this.hot.view,r=n.wtTable.getCoords(oe(Wo,this)),i=r.col;if(i<0)return;const o=an(oe(Wo,this)),s=oe(Wo,this).getBoundingClientRect(),a=i<n.getSetting("fixedColumnsStart");let l;a&&(l=n.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(oe(Wo,this),r.row,r.col)),l||(l=n.wtOverlays.topOverlay.getRelativeCellPosition(oe(Wo,this),r.row,r.col)),zt(Xf,this,this.hot.columnIndexMapper.getVisualFromRenderableIndex(i)),zt(Ir,this,[]);const u=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByColumnHeader();if(this.hot.selection.isSelected()&&u){const c=this.hot.getSelectedRange();H(c,h=>{const d=h.getTopStartCorner().col,f=h.getBottomEndCorner().col;fe(d,f,m=>{oe(Ir,this).includes(m)||oe(Ir,this).push(m)})})}oe(Ir,this).includes(oe(Xf,this))||zt(Ir,this,[oe(Xf,this)]),zt(Zf,this,l.start-6),zt(Au,this,parseInt(s.width,10)),oe(or,this).style.top=`${l.top}px`,oe(or,this).style[this.inlineDir]=`${oe(Zf,this)+oe(Au,this)}px`,oe(or,this).style.height=`${o}px`,this.hot.rootElement.appendChild(oe(or,this))}refreshHandlePosition(){oe(or,this).style[this.inlineDir]=`${oe(Zf,this)+oe(Mm,this)}px`}setupGuidePosition(){const e=parseInt(an(oe(or,this)),10),n=parseInt(oe(or,this).style.top,10)+e,r=this.hot.view.getTableHeight();X(oe(or,this),"active"),X(oe(Lo,this),"active"),oe(Lo,this).style.top=`${n}px`,this.refreshGuidePosition(),oe(Lo,this).style.height=`${r-e}px`,this.hot.rootElement.appendChild(oe(Lo,this))}refreshGuidePosition(){oe(Lo,this).style[this.inlineDir]=oe(or,this).style[this.inlineDir]}hideHandleAndGuide(){we(oe(or,this),"active"),we(oe(Lo,this),"active")}checkIfColumnHeader(e){const n=sl(e,["THEAD"],this.hot.rootElement),{topOverlay:r,topInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;return[r.clone.wtTable.THEAD,i.clone.wtTable.THEAD].includes(n)}getClosestTHParent(e){return e.tagName!=="TABLE"?e.tagName==="TH"?e:this.getClosestTHParent(e.parentNode):null}afterMouseDownTimeout(){const e=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},n=(r,i)=>{const o=this.hot.runHooks("beforeColumnResize",oe(lo,this),r,!0);o!==void 0&&zt(lo,this,o),this.setManualSize(r,oe(lo,this)),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",oe(lo,this),r,!0),i&&e()};oe(xh,this)>=2&&(oe(Ir,this).length>1?(H(oe(Ir,this),i=>{n(i)}),e()):H(oe(Ir,this),i=>{n(i,!0)})),zt(xh,this,0),zt(Ah,this,null)}bindEvents(){const{rootWindow:e,rootElement:n}=this.hot;this.eventManager.addEventListener(n,"mouseover",r=>pi(Ui,this,zre).call(this,r)),this.eventManager.addEventListener(n,"mousedown",r=>pi(Ui,this,Yre).call(this,r)),this.eventManager.addEventListener(e,"mousemove",r=>pi(Ui,this,Gre).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>pi(Ui,this,qre).call(this)),this.eventManager.addEventListener(oe(or,this),"contextmenu",()=>pi(Ui,this,Kre).call(this))}destroy(){super.destroy()}}function Ure(){const t=this.hot.getSettings()[_m],e=this.loadManualColumnWidths();typeof e<"u"?this.hot.batchExecution(()=>{e.forEach((n,r)=>{oe(Or,this).setValueAtIndex(r,n)})},!0):Array.isArray(t)?(this.hot.batchExecution(()=>{t.forEach((n,r)=>{oe(Or,this).setValueAtIndex(r,n)})},!0),zt(Hh,this,t)):t===!0&&Array.isArray(oe(Hh,this))&&this.hot.batchExecution(()=>{oe(Hh,this).forEach((n,r)=>{oe(Or,this).setValueAtIndex(r,n)})},!0)}function zre(t){if(!aD(t.target)&&oe(Im,this)!==!0&&this.checkIfColumnHeader(t.target)){const e=this.getClosestTHParent(t.target);if(!e)return;const n=e.getAttribute("colspan");e&&(n===null||n==="1")&&(oe(fl,this)||this.setupHandlePosition(e))}}function Yre(t){t.target.parentNode===this.hot.rootElement&&ye(t.target,"manualColumnResizer")&&(this.setupHandlePosition(oe(Wo,this)),this.setupGuidePosition(),zt(fl,this,!0),oe(Ah,this)===null&&(zt(Ah,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(oe(Ah,this))),zt(xh,this,oe(xh,this)+1),this.startX=t.pageX,zt(lo,this,oe(Au,this)))}function Gre(t){if(oe(fl,this)){const e=(t.pageX-this.startX)*this.hot.getDirectionFactor();zt(Mm,this,oe(Au,this)+e),H(oe(Ir,this),n=>{zt(lo,this,this.setManualSize(n,oe(Mm,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition()}}function qre(){const t=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},e=(n,r)=>{this.hot.runHooks("beforeColumnResize",oe(lo,this),n,!1),r&&t(),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",oe(lo,this),n,!1)};oe(fl,this)&&(this.hideHandleAndGuide(),zt(fl,this,!1),oe(lo,this)!==oe(Au,this)&&(oe(Ir,this).length>1?(H(oe(Ir,this),r=>{e(r)}),t()):H(oe(Ir,this),r=>{e(r,!0)})),this.setupHandlePosition(oe(Wo,this)))}function Kre(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(oe(or,this)),this.hot.rootElement.removeChild(oe(Lo,this)),zt(fl,this,!1),zt(Im,this,!0),this.hot._registerImmediate(()=>{zt(Im,this,!1)})}function Xre(t,e){let n=t;if(this.enabled){const r=this.hot.toPhysicalColumn(e),i=oe(Or,this).getValueAtIndex(r);this.hot.getSettings()[_m]&&i&&(n=i)}return n}function Zre(t,e){const n=oe(Or,this).getValueAtIndex(this.hot.toPhysicalColumn(e));return typeof n=="number"?n:t}function Jre(){this.hot.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked()}function _S(t,e,n){return(e=Qre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qre(t){var e=eie(t,"string");return typeof e=="symbol"?e:e+""}function eie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const MS=0,_H=1,MH=2,iu="px";let P$=class{constructor(e){_S(this,"hot",void 0),_S(this,"_element",null),_S(this,"state",MS),this.hot=e}appendTo(e){e.appendChild(this._element),this.state=MH}build(){this.state===MS&&(this._element=this.hot.rootDocument.createElement("div"),this.state=_H)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=MS}isAppended(){return this.state===MH}isBuilt(){return this.state>=_H}setPosition(e,n){e!==void 0&&(this._element.style.top=e+iu),n!==void 0&&(this._element.style.left=n+iu)}getPosition(){return{top:this._element.style.top?parseInt(this._element.style.top,10):0,left:this._element.style.left?parseInt(this._element.style.left,10):0}}setSize(e,n){e&&(this._element.style.width=e+iu),n&&(this._element.style.height=n+iu)}getSize(){return{width:this._element.style.width?parseInt(this._element.style.width,10):0,height:this._element.style.height?parseInt(this._element.style.height,10):0}}setOffset(e,n){e&&(this._element.style.marginTop=e+iu),n&&(this._element.style.marginLeft=n+iu)}getOffset(){return{top:this._element.style.marginTop?parseInt(this._element.style.marginTop,10):0,left:this._element.style.marginLeft?parseInt(this._element.style.marginLeft,10):0}}};const tie="ht__manualRowMove--backlight";class nie extends P${build(){super.build(),X(this._element,tie)}}const rie="ht__manualRowMove--guideline";class iie extends P${build(){super.build(),X(this._element,rie)}}function oie(t,e){O$(t,e),e.add(t)}function ou(t,e,n){O$(t,e),e.set(t,n)}function O$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function tl(t,e,n){return t.set(Hs(t,e),n),n}function Ee(t,e){return t.get(Hs(t,e))}function Hs(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}ie.getSingleton().register("beforeRowMove");ie.getSingleton().register("afterRowMove");const IS="manualRowMove",sie=140,IH="ht__manualRowMove",Pm="show-ui",Zb="on-moving--rows",Jb="after-selection--rows";var zn=new WeakMap,Ds=new WeakMap,Zo=new WeakMap,js=new WeakMap,gr=new WeakMap,Jf=new WeakMap,ka=new WeakSet;class aie extends et{constructor(){super(...arguments),oie(this,ka),ou(this,zn,new nie(this.hot)),ou(this,Ds,new iie(this.hot)),ou(this,Zo,[]),ou(this,js,void 0),ou(this,gr,{}),ou(this,Jf,void 0)}static get PLUGIN_KEY(){return IS}static get PLUGIN_PRIORITY(){return sie}isEnabled(){return!!this.hot.getSettings()[IS]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Hs(ka,e,lie).call(e,...r)}),this.addHook("beforeOnCellMouseOver",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Hs(ka,e,cie).call(e,...r)}),this.addHook("afterScrollHorizontally",()=>Hs(ka,this,die).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Hs(ka,e,fie).call(e,...r)}),this.buildPluginUI(),this.registerEvents(),X(this.hot.rootElement,IH),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){we(this.hot.rootElement,IH),this.unregisterEvents(),Ee(zn,this).destroy(),Ee(Ds,this).destroy(),super.disablePlugin()}moveRow(e,n){return this.moveRows([e],n)}moveRows(e,n){const r=Ee(Jf,this),i=this.isMovePossible(e,n),o=this.hot.runHooks("beforeRowMove",e,n,r,i);if(tl(Jf,this,void 0),o===!1)return;i&&this.hot.rowIndexMapper.moveIndexes(e,n);const s=i&&this.isRowOrderChanged(e,n);return this.hot.runHooks("afterRowMove",e,n,r,i,s),s}dragRow(e,n){return this.dragRows([e],n)}dragRows(e,n){const r=this.countFinalIndex(e,n);return tl(Jf,this,n),this.moveRows(e,r)}isMovePossible(e,n){const r=this.hot.rowIndexMapper.getNotTrimmedIndexesLength(),i=e.length+n>r,o=n<0,s=e.some(l=>l<0),a=e.some(l=>l>=r);return!(i||o||s||a)}isRowOrderChanged(e,n){return e.some((r,i)=>r-i!==n)}countFinalIndex(e,n){const r=wr(e,(i,o)=>(o<n&&(i+=1),i),0);return n-r}getRowsHeight(e,n){const r=this.hot.rowIndexMapper;let i=0;for(let o=e;o<=n;o++){const s=r.getRenderableFromVisualIndex(o);s!==null&&(i+=this.hot.view._wt.wtTable.getRowHeight(s)||this.hot.view.getDefaultRowHeight())}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[IS];if(Array.isArray(e))this.moveRows(e,0);else if(e!==void 0){const n=this.persistentStateLoad();n.length&&this.moveRows(n,0)}}isFixedRowTop(e){return e<this.hot.getSettings().fixedRowsTop}isFixedRowBottom(e){return e>this.hot.countRows()-1-this.hot.getSettings().fixedRowsBottom}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualRowMove",this.hot.rowIndexMapper.getIndexesSequence())}persistentStateLoad(){const e={};return this.hot.runHooks("persistentStateLoad","manualRowMove",e),e.value?e.value:[]}prepareRowsToMoving(){const e=this.hot.getSelectedRangeLast(),n=[];if(!e)return n;const{from:r,to:i}=e,o=Math.min(r.row,i.row),s=Math.max(r.row,i.row);return fe(o,s,a=>{n.push(a)}),n}refreshPositions(){const e=Ee(gr,this).coords,n=this.hot.getFirstFullyVisibleRow(),r=this.hot.getLastFullyVisibleRow(),i=this.hot.countRows();this.isFixedRowTop(e.row)&&n>0&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(n-1,-1)),this.isFixedRowBottom(e.row)&&r<i&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(r+1,1),void 0,!0);const o=this.hot.view._wt.wtTable,s=Ee(gr,this).TD,a=this.hot.rootElement,l=Nn(a),u=zh(a),c=o.holder.scrollTop,h=this.hot.rootWindow!==u?u.scrollTop:0,d=l.top-h,f=Ee(gr,this).eventPageY-d+c,m=o.hider.offsetHeight,C=o.TBODY.offsetTop,y=Ee(zn,this).getOffset().top,E=Ee(zn,this).getSize().height,v=s.offsetHeight/2,O=s.offsetHeight;let x=this.hot.view.THEAD.offsetHeight+this.getRowsHeight(0,e.row-1);const F=f>=x+v;this.isFixedRowTop(e.row)&&(x+=this.hot.view._wt.wtOverlays.topOverlay.getOverlayOffset()),e.row<0?Ee(gr,this).row=n>0?n-1:n:F?(Ee(gr,this).row=e.row+1,x+=e.row===0?O-1:O):Ee(gr,this).row=e.row;let I=f,_=x;f+E+y>=m?I=m-E-y:f+y<C&&(I=C+Math.abs(y)),x>=m-1&&(_=m-1),Ee(zn,this).setPosition(I),Ee(Ds,this).setPosition(_)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",n=>Hs(ka,this,uie).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>Hs(ka,this,hie).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){Ee(zn,this).build(),Ee(Ds,this).build()}destroy(){Ee(zn,this).destroy(),Ee(Ds,this).destroy(),super.destroy()}}function lie(t,e,n,r){const{wtTable:i,wtViewport:o}=this.hot.view._wt,s=this.hot.selection.isSelectedByRowHeader(),a=this.hot.getSelectedRangeLast();if(!a||!s||Ee(js,this)||t.button!==0){tl(js,this,!1),Ee(Zo,this).length=0,we(this.hot.rootElement,[Zb,Pm]);return}const l=Ee(Ds,this).isBuilt()&&!Ee(Ds,this).isAppended(),u=Ee(zn,this).isBuilt()&&!Ee(zn,this).isAppended();l&&u&&(Ee(Ds,this).appendTo(i.hider),Ee(zn,this).appendTo(i.hider));const{from:c,to:h}=a,d=Math.min(c.row,h.row),f=Math.max(c.row,h.row);if(e.col<0&&e.row>=d&&e.row<=f){r.row=!0,tl(js,this,!0),Ee(gr,this).eventPageY=t.pageY,Ee(gr,this).coords=e,Ee(gr,this).TD=n,tl(Zo,this,this.prepareRowsToMoving());const m=i.holder.scrollLeft+o.getRowHeaderWidth(),C=this.getRowsHeight(d,e.row-1)+(t.clientY-n.getBoundingClientRect().top);Ee(zn,this).setPosition(null,m),Ee(zn,this).setSize(i.hider.offsetWidth-m,this.getRowsHeight(d,f)),Ee(zn,this).setOffset(-C,null),X(this.hot.rootElement,Zb),this.refreshPositions()}else we(this.hot.rootElement,Jb),tl(js,this,!1),Ee(Zo,this).length=0}function uie(t){Ee(js,this)&&(Ee(gr,this).eventPageY=t.pageY,this.refreshPositions())}function cie(t,e,n,r){!this.hot.getSelectedRangeLast()||!Ee(js,this)||(Ee(Zo,this).indexOf(e.row)>-1?we(this.hot.rootElement,Pm):X(this.hot.rootElement,Pm),r.row=!0,r.column=!0,r.cell=!0,Ee(gr,this).coords=e,Ee(gr,this).TD=n)}function hie(){const t=Ee(gr,this).row,e=Ee(Zo,this).length;if(tl(js,this,!1),we(this.hot.rootElement,[Zb,Pm,Jb]),this.hot.selection.isSelectedByRowHeader()&&X(this.hot.rootElement,Jb),e<1||t===void 0)return;const n=Ee(Zo,this)[0],r=this.hot.toPhysicalRow(n),i=this.dragRows(Ee(Zo,this),t);if(Ee(Zo,this).length=0,i===!0){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize();const o=this.hot.toVisualRow(r),s=o+e-1;this.hot.selectRows(o,s)}}function die(){const t=this.hot.view._wt.wtTable,e=this.hot.view._wt.wtViewport.getRowHeaderWidth(),n=t.holder.scrollLeft,r=e+n;Ee(zn,this).setPosition(null,r),Ee(zn,this).setSize(t.hider.offsetWidth-r)}function fie(){this.moveBySettingsOrLoad()}function gie(t,e){x$(t,e),e.add(t)}function Pn(t,e,n){x$(t,e),e.set(t,n)}function x$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Lt(t,e,n){return t.set(Bo(t,e),n),n}function re(t,e){return t.get(Bo(t,e))}function Bo(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Om="manualRowResize",mie=30,PH="manualRowHeights";var no=new WeakMap,Qf=new WeakMap,Pr=new WeakMap,Nh=new WeakMap,ks=new WeakMap,OT=new WeakMap,Hu=new WeakMap,eg=new WeakMap,Wn=new WeakMap,Qi=new WeakMap,gl=new WeakMap,xm=new WeakMap,Dh=new WeakMap,kh=new WeakMap,Ci=new WeakMap,Lh=new WeakMap,Es=new WeakSet;class pie extends et{static get PLUGIN_KEY(){return Om}static get PLUGIN_PRIORITY(){return mie}constructor(e){super(e),gie(this,Es),Pn(this,no,null),Pn(this,Qf,null),Pn(this,Pr,[]),Pn(this,Nh,null),Pn(this,ks,null),Pn(this,OT,null),Pn(this,Hu,null),Pn(this,eg,null),Pn(this,Wn,this.hot.rootDocument.createElement("DIV")),Pn(this,Qi,this.hot.rootDocument.createElement("DIV")),Pn(this,gl,!1),Pn(this,xm,!1),Pn(this,Dh,0),Pn(this,kh,null),Pn(this,Ci,void 0),Pn(this,Lh,void 0),X(re(Wn,this),"manualRowResizer"),X(re(Qi,this),"manualRowResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[Om]}enablePlugin(){this.enabled||(Lt(Ci,this,new ea),re(Ci,this).addLocalHook("init",()=>Bo(Es,this,Rie).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,re(Ci,this)),this.addHook("modifyRowHeight",(e,n)=>Bo(Es,this,bie).call(this,e,n)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){Lt(Lh,this,re(Ci,this).getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualRowHeights(){this.hot.runHooks("persistentStateSave",PH,re(Ci,this).getValues())}loadManualRowHeights(){const e={};return this.hot.runHooks("persistentStateLoad",PH,e),e.value}setManualSize(e,n){const r=this.hot.toPhysicalRow(e),i=Math.max(n,this.hot.view.getDefaultRowHeight());return re(Ci,this).setValueAtIndex(r,i),i}getLastDesiredRowHeight(){return re(Nh,this)}setupHandlePosition(e){Lt(no,this,e);const{view:n}=this.hot,{_wt:r}=n,i=r.wtTable.getCoords(re(no,this)),o=i.row;if(o<0)return;const s=Xt(re(no,this)),a=re(no,this).getBoundingClientRect(),l=o<r.getSetting("fixedRowsTop"),u=o>=n.countNotHiddenRowIndexes(0,1)-r.getSetting("fixedRowsBottom");let c;l?c=r.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(re(no,this),i.row,i.col):u&&(c=r.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(re(no,this),i.row,i.col)),c||(c=r.wtOverlays.inlineStartOverlay.getRelativeCellPosition(re(no,this),i.row,i.col)),Lt(Qf,this,this.hot.rowIndexMapper.getVisualFromRenderableIndex(o)),Lt(Pr,this,[]);const h=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByRowHeader();if(this.hot.selection.isSelected()&&h){const d=this.hot.getSelectedRange();H(d,f=>{const m=f.getTopStartCorner().row,C=f.getBottomStartCorner().row;fe(m,C,y=>{re(Pr,this).includes(y)||re(Pr,this).push(y)})})}re(Pr,this).includes(re(Qf,this))||Lt(Pr,this,[re(Qf,this)]),Lt(eg,this,c.top-6),Lt(Hu,this,parseInt(a.height,10)),re(Wn,this).style.top=`${re(eg,this)+re(Hu,this)}px`,re(Wn,this).style[this.inlineDir]=`${c.start}px`,re(Wn,this).style.width=`${s}px`,this.hot.rootElement.appendChild(re(Wn,this))}refreshHandlePosition(){re(Wn,this).style.top=`${re(eg,this)+re(Nh,this)}px`}setupGuidePosition(){const e=parseInt(Xt(re(Wn,this)),10),n=parseInt(re(Wn,this).style[this.inlineDir],10)+e,r=this.hot.view.getTableWidth();X(re(Wn,this),"active"),X(re(Qi,this),"active"),re(Qi,this).style.top=re(Wn,this).style.top,re(Qi,this).style[this.inlineDir]=`${n}px`,re(Qi,this).style.width=`${r-e}px`,this.hot.rootElement.appendChild(re(Qi,this))}refreshGuidePosition(){re(Qi,this).style.top=re(Wn,this).style.top}hideHandleAndGuide(){we(re(Wn,this),"active"),we(re(Qi,this),"active")}checkIfRowHeader(e){const n=sl(e,["TBODY"],this.hot.rootElement),{inlineStartOverlay:r,topInlineStartCornerOverlay:i,bottomInlineStartCornerOverlay:o}=this.hot.view._wt.wtOverlays;return[r.clone.wtTable.TBODY,i.clone.wtTable.TBODY,o.clone.wtTable.TBODY].includes(n)}getClosestTHParent(e){return e.tagName!=="TABLE"?e.tagName==="TH"?e:this.getClosestTHParent(e.parentNode):null}getActualRowHeight(e){const n=this.hot.view._wt.wtTable.getRowHeight(e);return n!==void 0&&re(ks,this)<n?n:re(ks,this)}afterMouseDownTimeout(){const e=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},n=(r,i)=>{const o=this.hot.runHooks("beforeRowResize",this.getActualRowHeight(r),r,!0);o!==void 0&&Lt(ks,this,o),this.setManualSize(r,re(ks,this)),this.hot.runHooks("afterRowResize",this.getActualRowHeight(r),r,!0),i&&e()};re(Dh,this)>=2&&(re(Pr,this).length>1?(H(re(Pr,this),i=>{n(i)}),e()):H(re(Pr,this),i=>{n(i,!0)})),Lt(Dh,this,0),Lt(kh,this,null)}bindEvents(){const{rootElement:e,rootWindow:n}=this.hot;this.eventManager.addEventListener(e,"mouseover",r=>Bo(Es,this,wie).call(this,r)),this.eventManager.addEventListener(e,"mousedown",r=>Bo(Es,this,vie).call(this,r)),this.eventManager.addEventListener(n,"mousemove",r=>Bo(Es,this,Cie).call(this,r)),this.eventManager.addEventListener(n,"mouseup",()=>Bo(Es,this,yie).call(this)),this.eventManager.addEventListener(re(Wn,this),"contextmenu",()=>Bo(Es,this,Sie).call(this))}destroy(){super.destroy()}}function wie(t){if(!aD(t.target)&&re(xm,this)!==!0&&this.checkIfRowHeader(t.target)){const e=this.getClosestTHParent(t.target);e&&(re(gl,this)||this.setupHandlePosition(e))}}function vie(t){ye(t.target,"manualRowResizer")&&(this.setupHandlePosition(re(no,this)),this.setupGuidePosition(),Lt(gl,this,!0),re(kh,this)===null&&(Lt(kh,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(re(kh,this))),Lt(Dh,this,re(Dh,this)+1),Lt(OT,this,t.pageY),Lt(ks,this,re(Hu,this)))}function Cie(t){re(gl,this)&&(Lt(Nh,this,re(Hu,this)+(t.pageY-re(OT,this))),H(re(Pr,this),e=>{Lt(ks,this,this.setManualSize(e,re(Nh,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition())}function yie(){const t=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},e=(n,r)=>{this.hot.runHooks("beforeRowResize",this.getActualRowHeight(n),n,!1),r&&t(),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.getActualRowHeight(n),n,!1)};re(gl,this)&&(this.hideHandleAndGuide(),Lt(gl,this,!1),re(ks,this)!==re(Hu,this)&&(re(Pr,this).length>1?(H(re(Pr,this),r=>{e(r)}),t()):H(re(Pr,this),r=>{e(r,!0)})),this.setupHandlePosition(re(no,this)))}function Sie(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(re(Wn,this)),this.hot.rootElement.removeChild(re(Qi,this)),Lt(gl,this,!1),Lt(xm,this,!0),this.hot._registerImmediate(()=>{Lt(xm,this,!1)})}function bie(t,e){let n=t;if(this.enabled){const r=this.hot.toPhysicalRow(e),i=re(Ci,this).getValueAtIndex(r);this.hot.getSettings()[Om]&&i&&(n=i)}return n}function Rie(){const t=this.hot.getSettings()[Om],e=this.loadManualRowHeights();this.hot.batchExecution(()=>{typeof e<"u"?e.forEach((n,r)=>{re(Ci,this).setValueAtIndex(r,n)}):Array.isArray(t)?(t.forEach((n,r)=>{re(Ci,this).setValueAtIndex(r,n)}),Lt(Lh,this,t)):t===!0&&Array.isArray(re(Lh,this))&&re(Lh,this).forEach((n,r)=>{re(Ci,this).setValueAtIndex(r,n)})},!0)}var OH={},xH;function Eie(){if(xH)return OH;xH=1;var t=up();return t("flatMap"),OH}Eie();var AH={},HH={},PS,NH;function Tie(){if(NH)return PS;NH=1;var t=un(),e=cn(),n=mo(),r=gR();return PS=function(i,o){(!o||typeof i!="string")&&e(i);var s=r(i);return n(e(s!==void 0?t(s,i):i))},PS}var DH;function _ie(){if(DH)return HH;DH=1;var t=vt(),e=un(),n=mr(),r=cn(),i=mo(),o=Tie(),s=wR(),a=pr(),l=Xs(),u=vR(),c=Js();function h(){try{var y=Iterator.prototype.flatMap.call(new Map([[4,5]]).entries(),function(E){return E});y.next(),y.return()}catch{return!0}}var d=!l&&!u("flatMap",function(){}),f=!l&&!d&&c("flatMap",TypeError),m=l||d||f||h(),C=s(function(){for(var y=this.iterator,E=this.mapper,v,O;;){if(O=this.inner)try{if(v=r(e(O.next,O.iterator)),!v.done)return v.value;this.inner=null}catch(x){a(y,"throw",x)}if(v=r(e(this.next,y)),this.done=!!v.done)return;try{this.inner=o(E(v.value,this.counter++),!1)}catch(x){a(y,"throw",x)}}});return t({target:"Iterator",proto:!0,real:!0,forced:m},{flatMap:function(E){r(this);try{n(E)}catch(v){a(this,"throw",v)}return f?e(f,this,E):new C(i(this),{mapper:E,inner:null})}}),HH}var kH;function Mie(){return kH||(kH=1,_ie()),AH}Mie();function Iie(t,e,n){Pie(t,e),e.set(t,n)}function Pie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function La(t,e,n){return(e=Oie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Oie(t){var e=xie(t,"string");return typeof e=="symbol"?e:e+""}function xie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function LH(t,e){return t.get(A$(t,e))}function tg(t,e,n){return t.set(A$(t,e),n),n}function A$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var $a=new WeakMap;class ro{constructor(e,n,r,i,o,s){La(this,"row",void 0),La(this,"col",void 0),La(this,"rowspan",void 0),La(this,"colspan",void 0),La(this,"removed",!1),La(this,"cellCoordsFactory",void 0),La(this,"cellRangeFactory",void 0),Iie(this,$a,null),this.row=e,this.col=n,this.rowspan=r,this.colspan=i,this.cellCoordsFactory=o,this.cellRangeFactory=s}static NEGATIVE_VALUES_WARNING(e){let{row:n,col:r,rowspan:i,colspan:o}=e;return st`The merged cell declared with {row: ${n}, col: ${r},\x20
285
- rowspan: ${i}, colspan: ${o}} contains negative values, which is\x20
286
- not supported. It will not be added to the collection.`}static IS_OUT_OF_BOUNDS_WARNING(e){let{row:n,col:r}=e;return st`The merged cell declared at [${n}, ${r}] is positioned\x20
287
- (or positioned partially) outside of the table range. It was not added to the table, please fix your setup.`}static IS_SINGLE_CELL(e){let{row:n,col:r}=e;return st`The merged cell declared at [${n}, ${r}] has both "rowspan"\x20
288
- and "colspan" declared as "1", which makes it a single cell. It cannot be added to the collection.`}static ZERO_SPAN_WARNING(e){let{row:n,col:r}=e;return st`The merged cell declared at [${n}, ${r}] has "rowspan"\x20
289
- or "colspan" declared as "0", which is not supported. It cannot be added to the collection.`}static containsNegativeValues(e){let{row:n,col:r,rowspan:i,colspan:o}=e;return n<0||r<0||i<0||o<0}static isSingleCell(e){let{rowspan:n,colspan:r}=e;return r===1&&n===1}static containsZeroSpan(e){let{rowspan:n,colspan:r}=e;return r===0||n===0}static isOutOfBounds(e,n,r){return e.row<0||e.col<0||e.row>=n||e.row+e.rowspan-1>=n||e.col>=r||e.col+e.colspan-1>=r}normalize(e){const n=e.countRows(),r=e.countCols();this.row<0?this.row=0:this.row>n-1&&(this.row=n-1),this.col<0?this.col=0:this.col>r-1&&(this.col=r-1),this.row+this.rowspan>n-1&&(this.rowspan=n-this.row),this.col+this.colspan>r-1&&(this.colspan=r-this.col),tg($a,this,null)}includes(e,n){return this.row<=e&&this.col<=n&&this.row+this.rowspan-1>=e&&this.col+this.colspan-1>=n}includesHorizontally(e){return this.col<=e&&this.col+this.colspan-1>=e}includesVertically(e){return this.row<=e&&this.row+this.rowspan-1>=e}shift(e,n){const r=e[0]||e[1],i=n+Math.abs(e[0]||e[1])-1,o=e[0]?"colspan":"rowspan",s=e[0]?"col":"row",a=Math.min(n,i),l=Math.max(n,i),u=this[s],c=this[s]+this[o]-1;if(u>=n&&(this[s]+=r),r>0)n<=c&&n>u&&(this[o]+=r);else if(r<0){if(a<=u&&l>=c)return this.removed=!0,tg($a,this,null),!1;if(u>=a&&u<=l){const h=l-u+1,d=Math.abs(r)-h;this[s]-=d+r,this[o]-=h}else if(u<=a&&c>=l)this[o]+=r;else if(u<=a&&c>=a&&c<l){const h=c-a+1;this[o]-=h}}return tg($a,this,null),!0}isFarther(e,n){return e?n==="down"?e.row+e.rowspan-1<this.row+this.rowspan-1:n==="up"?e.row>this.row:n==="right"?e.col+e.colspan-1<this.col+this.colspan-1:n==="left"?e.col>this.col:null:!0}getLastRow(){return this.row+this.rowspan-1}getLastColumn(){return this.col+this.colspan-1}getRange(){return LH($a,this)||tg($a,this,this.cellRangeFactory(this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.getLastRow(),this.getLastColumn()))),LH($a,this)}}function Aie(t,e){Hie(t,e),e.add(t)}function Hie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ng(t,e,n){return(e=Nie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Nie(t){var e=Die(t,"string");return typeof e=="symbol"?e:e+""}function Die(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Fa(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Ts=new WeakSet;class Am{constructor(e){Aie(this,Ts),ng(this,"plugin",void 0),ng(this,"mergedCells",[]),ng(this,"mergedCellsMatrix",new Map),ng(this,"hot",void 0),this.plugin=e,this.hot=e.hot}static IS_OVERLAPPING_WARNING(e){let{row:n,col:r}=e;return st`The merged cell declared at [${n}, ${r}], overlaps\x20
290
- with the other declared merged cell. The overlapping merged cell was not added to the table, please\x20
291
- fix your setup.`}get(e,n){var r;return this.mergedCellsMatrix.has(e)&&(r=this.mergedCellsMatrix.get(e).get(n))!==null&&r!==void 0?r:!1}getByRange(e){const{row:n,col:r}=e.getTopStartCorner(),{row:i,col:o}=e.getBottomEndCorner(),s=this.mergedCells.length;let a=!1;for(let l=0;l<s;l++){const u=this.mergedCells[l],{row:c,col:h,rowspan:d,colspan:f}=u;if(c>=n&&c+d-1<=i&&h>=r&&h+f-1<=o){a=u;break}}return a}filterOverlappingMergeCells(e){const n=new Set;return this.mergedCells.forEach(i=>{const{row:o,col:s,colspan:a,rowspan:l}=i;for(let u=o;u<o+l;u++)for(let c=s;c<s+a;c++)n.add(`r${u},c${c}`)}),e.filter(i=>{const{row:o,col:s,colspan:a,rowspan:l}=i,u=new Set;let c=!1;for(let h=o;h<o+l;h++){for(let d=s;d<s+a;d++){const f=`r${h},c${d}`;if(n.has(f)){tt(Am.IS_OVERLAPPING_WARNING(i)),c=!0;break}u.add(f)}if(c)break}return c||n.add(...u),!c})}getWithinRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{row:r,col:i}=e.getTopStartCorner(),{row:o,col:s}=e.getBottomEndCorner(),a=[];for(let l=r;l<=o;l++)for(let u=i;u<=s;u++){const c=this.get(l,u);c&&(n||!n&&c.row===l&&c.col===u)&&a.push(c)}return a}add(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=e.row,i=e.col,o=e.rowspan,s=e.colspan,a=new ro(r,i,o,s,this.hot._createCellCoords,this.hot._createCellRange),l=this.get(r,i),u=n?!1:this.isOverlapping(a);return!l&&!u?(this.hot&&a.normalize(this.hot),this.mergedCells.push(a),Fa(Ts,this,$H).call(this,a),a):(u&&tt(Am.IS_OVERLAPPING_WARNING(a)),!1)}remove(e,n){const r=this.get(e,n),i=r?this.mergedCells.indexOf(r):-1;return r&&i!==-1?(this.mergedCells.splice(i,1),Fa(Ts,this,kie).call(this,r),r):!1}clear(){H(this.mergedCells,e=>{let{row:n,col:r,rowspan:i,colspan:o}=e;fe(n,n+i,s=>{fe(r,r+o,a=>{const l=this.hot.getCell(s,a);l&&(l.removeAttribute("rowspan"),l.removeAttribute("colspan"),l.style.display="")})})}),this.mergedCells.length=0,this.mergedCellsMatrix=new Map}isOverlapping(e){const n=e.getRange();for(let r=0;r<this.mergedCells.length;r++)if(this.mergedCells[r].getRange().overlaps(n))return!0;return!1}isFirstRenderableMergedCell(e,n){const r=this.get(e,n);if(!r)return!1;const{row:i,col:o,rowspan:s,colspan:a}=r,l=this.hot.view.getActiveOverlayName(),u=["top","top_inline_start_corner"].includes(l)?0:this.hot.getFirstRenderedVisibleRow(),c=["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(l)?0:this.hot.getFirstRenderedVisibleColumn(),h=qe(u,i,i+s-1),d=qe(c,o,o+a-1);return this.hot.rowIndexMapper.getNearestNotHiddenIndex(h,1)===e&&this.hot.columnIndexMapper.getNearestNotHiddenIndex(d,1)===n}getFirstRenderableCoords(e,n){const r=this.get(e,n);if(!r||this.isFirstRenderableMergedCell(e,n))return this.hot._createCellCoords(e,n);const i=this.hot.rowIndexMapper.getNearestNotHiddenIndex(r.row,1),o=this.hot.columnIndexMapper.getNearestNotHiddenIndex(r.col,1);return this.hot._createCellCoords(i,o)}getStartMostColumnIndex(e,n){const r=Fa(Ts,this,rg).call(this,e,"col",-1);let i=n;for(let o=0;o<r.length;o++)if(r[o]<=n){i=r[o];break}return i}getEndMostColumnIndex(e,n){const r=Fa(Ts,this,rg).call(this,e,"col",1);let i=n;for(let o=0;o<r.length;o++)if(r[o]>=n){i=r[o];break}return i}getTopMostRowIndex(e,n){const r=Fa(Ts,this,rg).call(this,e,"row",-1);let i=n;for(let o=0;o<r.length;o++)if(r[o]<=n){i=r[o];break}return i}getBottomMostRowIndex(e,n){const r=Fa(Ts,this,rg).call(this,e,"row",1);let i=n;for(let o=0;o<r.length;o++)if(r[o]>=n){i=r[o];break}return i}shiftCollections(e,n,r){const i=[0,0];switch(e){case"right":i[0]+=r;break;case"left":i[0]-=r;break;case"down":i[1]+=r;break;case"up":i[1]-=r;break}const o=[];this.mergedCells.forEach(s=>{s.shift(i,n),s.removed&&o.push(s)}),o.forEach(s=>{this.mergedCells.splice(this.mergedCells.indexOf(s),1)}),this.mergedCellsMatrix.clear(),this.mergedCells.forEach(s=>{Fa(Ts,this,$H).call(this,s)})}}function rg(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const r=new Map,i=n===1?t.getTopStartCorner():t.getBottomEndCorner(),o=n===1?t.getBottomEndCorner():t.getTopStartCorner();for(let s=i.row;n===1?s<=o.row:s>=o.row;s+=n)for(let a=i.col;n===1?a<=o.col:a>=o.col;a+=n){const l=e==="row"?s:a,u=this.get(s,a);let c=l;u&&(c=n===1?u[e]+u[`${e}span`]-1:u[e]),r.has(l)||r.set(l,new Set),r.get(l).add(c)}return Array.from(new Set(Array.from(r.entries()).filter(s=>{let[,a]=s;return a.size===1}).flatMap(s=>{let[,a]=s;return Array.from(a)})))}function $H(t){for(let e=t.row;e<t.row+t.rowspan;e++)for(let n=t.col;n<t.col+t.colspan;n++)this.mergedCellsMatrix.has(e)||this.mergedCellsMatrix.set(e,new Map),this.mergedCellsMatrix.get(e).set(n,t)}function kie(t){for(let e=t.row;e<t.row+t.rowspan;e++)for(let n=t.col;n<t.col+t.colspan;n++)this.mergedCellsMatrix.get(e).delete(n)}function OS(t,e,n){return(e=Lie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Lie(t){var e=$ie(t,"string");return typeof e=="symbol"?e:e+""}function $ie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Fie{constructor(e){OS(this,"plugin",void 0),OS(this,"mergedCellsCollection",void 0),OS(this,"currentFillData",null),this.plugin=e,this.mergedCellsCollection=this.plugin.mergedCellsCollection}getDirection(e,n){let r=null;return n[0]===e[0]&&n[1]===e[1]&&n[3]===e[3]?r="down":n[2]===e[2]&&n[1]===e[1]&&n[3]===e[3]?r="up":n[1]===e[1]&&n[2]===e[2]?r="right":r="left",r}snapDragArea(e,n,r,i){const o=n.slice(0),s=this.getAutofillSize(e,n,r),[a,l,u,c]=e,d=["up","down"].indexOf(r)>-1?u-a+1:c-l+1,f=Math.floor(s/d)*d,m=s-f,C=this.getFarthestCollection(e,n,r,i);if(C){if(r==="down"){const y=C.row+C.rowspan-a-m;o[2]+y>=this.plugin.hot.countRows()?o[2]-=m:o[2]+=m?y:0}else if(r==="right"){const y=C.col+C.colspan-l-m;o[3]+y>=this.plugin.hot.countCols()?o[3]-=m:o[3]+=m?y:0}else if(r==="up"){const y=u-m-C.row+1;o[0]+y<0?o[0]+=m:o[0]-=m?y:0}else if(r==="left"){const y=c-m-C.col+1;o[1]+y<0?o[1]+=m:o[1]-=m?y:0}}return this.updateCurrentFillCache({baseArea:e,dragDirection:r,foundMergedCells:i,fillSize:s,dragArea:o,cycleLength:d}),o}updateCurrentFillCache(e){this.currentFillData||(this.currentFillData={}),ln(this.currentFillData,e)}getAutofillSize(e,n,r){const[i,o,s,a]=e,[l,u,c,h]=n;switch(r){case"up":return i-l;case"down":return c-s;case"left":return o-u;case"right":return h-a;default:return null}}getDragArea(e,n,r){const[i,o,s,a]=e,[l,u,c,h]=n;switch(r){case"up":return[l,u,i-1,a];case"down":{const d=this.mergedCellsCollection.get(c,a),f=d?d.rowspan-1:0;return[s+1,o,c+f,a]}case"left":return[l,u,s,o-1];case"right":{const d=this.mergedCellsCollection.get(c,a),f=d?d.colspan-1:0;return[i,a+f,c,h]}default:return null}}getFarthestCollection(e,n,r,i){const[o,s,a,l]=e,u=["up","down"].indexOf(r)>-1,c=u?a:l,h=u?o:s,d=this.getAutofillSize(e,n,r),f=u?a-o+1:l-s+1,m=Math.floor(d/f)*f,C=d-m;let y=null,E=null,v=null;switch(r){case"up":y="includesVertically",v=c-C+1;break;case"left":y="includesHorizontally",v=c-C+1;break;case"down":y="includesVertically",v=h+C-1;break;case"right":y="includesHorizontally",v=h+C-1;break}return H(i,O=>{O[y](v)&&O.isFarther(E,r)&&(E=O)}),E}recreateAfterDataPopulation(e){if(!this.currentFillData)return;const n=this.getRangeFromChanges(e),r=this.currentFillData.foundMergedCells,i=this.currentFillData.dragDirection,o=(u,c)=>{switch(i){case"up":return u.row-c>=n.from.row;case"down":return u.row+u.rowspan-1+c<=n.to.row;case"left":return u.col-c>=n.from.column;case"right":return u.col+u.colspan-1+c<=n.to.column;default:return null}};let s=0,a=null,l=1;do for(let u=0;u<r.length;u+=1){if(a=r[u],s=l*this.currentFillData.cycleLength,o(a,s))switch(i){case"up":this.plugin.mergedCellsCollection.add({row:a.row-s,rowspan:a.rowspan,col:a.col,colspan:a.colspan},!0);break;case"down":this.plugin.mergedCellsCollection.add({row:a.row+s,rowspan:a.rowspan,col:a.col,colspan:a.colspan},!0);break;case"left":this.plugin.mergedCellsCollection.add({row:a.row,rowspan:a.rowspan,col:a.col-s,colspan:a.colspan},!0);break;case"right":this.plugin.mergedCellsCollection.add({row:a.row,rowspan:a.rowspan,col:a.col+s,colspan:a.colspan},!0);break}u===r.length-1&&(l+=1)}while(o(a,s));this.currentFillData=null,this.plugin.hot.render(),r.length>0&&this.plugin.ifChromeForceRepaint()}getRangeFromChanges(e){const n={min:null,max:null},r={min:null,max:null};return H(e,i=>{const o=i[0],s=this.plugin.hot.propToCol(i[1]);(n.min===null||o<n.min)&&(n.min=o),(n.max===null||o>n.max)&&(n.max=o),(r.min===null||s<r.min)&&(r.min=s),(r.max===null||s>r.max)&&(r.max=s)}),{from:{row:n.min,column:r.min},to:{row:n.max,column:r.max}}}dragAreaOverlapsCollections(e,n,r){const i=this.getDragArea(e,n,r),[o,s,a,l]=i,u=this.plugin.hot._createCellCoords(o,s),c=this.plugin.hot._createCellCoords(a,l),h=this.plugin.hot._createCellRange(u,u,c);if(this.mergedCellsCollection.getWithinRange(h,!0).length===0)return!1;const f=this.mergedCellsCollection.getWithinRange(h,!1);return f.length===0?!0:r==="up"||r==="down"?!f.every(m=>{let{colspan:C}=m;return C===h.getWidth()}):!f.every(m=>{let{rowspan:C}=m;return C===h.getHeight()})}}function xS(t,e,n){return(e=Vie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vie(t){var e=Wie(t,"string");return typeof e=="symbol"?e:e+""}function Wie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Bie{constructor(e){xS(this,"plugin",void 0),xS(this,"hot",void 0),xS(this,"fullySelectedMergedCellClassName","fullySelectedMergedCell"),this.plugin=e,this.hot=e.hot}getSelectedMergedCellClassName(e,n,r,i){const o=Math.min(r[0],r[2]),s=Math.min(r[1],r[3]),a=Math.max(r[0],r[2]),l=Math.max(r[1],r[3]);if(i===void 0||!this.plugin.mergedCellsCollection.isFirstRenderableMergedCell(e,n))return;const c=this.plugin.mergedCellsCollection.get(e,n);if(!c)return;const h=c.getLastRow(),d=c.getLastColumn();if(o<=c.row&&s<=c.col&&a>=h&&l>=d)return`${this.fullySelectedMergedCellClassName}-${i}`;if(this.isMergeCellFullySelected(c,this.plugin.hot.getSelectedRange()))return`${this.fullySelectedMergedCellClassName}-multiple`}isMergeCellFullySelected(e,n){const r=[];if(!n||!e)return!1;for(let i=0;i<e.rowspan;i+=1)for(let o=0;o<e.colspan;o+=1)r.push(this.hot._createCellCoords(e.row+i,e.col+o));for(let i=0;i<r.length;i+=1){const o=[];for(let s=0;s<n.length;s+=1)o[s]=n[s].includes(r[i]);if(!o.includes(!0))return!1}return!0}getSelectedMergedCellClassNameToRemove(){const e=[];for(let n=0;n<=7;n+=1)e.push(`${this.fullySelectedMergedCellClassName}-${n}`);return e.push(`${this.fullySelectedMergedCellClassName}-multiple`),e}}function jie(t){return{key:"mergeCells",name(){const e=this.getSelectedLast();if(e){const n=t.mergedCellsCollection.get(e[0],e[1]);if(n.row===e[0]&&n.col===e[1]&&n.row+n.rowspan-1===e[2]&&n.col+n.colspan-1===e[3])return this.getTranslatedPhrase(BE)}return this.getTranslatedPhrase(WE)},callback(){const e=this.getSelectedRangeLast();if(!e)return;e.setDirection(this.isRtl()?"NE-SW":"NW-SE");const{from:n,to:r}=e;t.toggleMerge(e),this.selectCell(n.row,n.col,r.row,r.col,!1)},disabled(){const e=this.getSelectedLast();return e?ro.isSingleCell({row:e[0],col:e[1],rowspan:e[2]-e[0]+1,colspan:e[3]-e[1]+1})||this.selection.isSelectedByCorner():!0},hidden:!1}}function $h(t,e,n){return(e=Uie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Uie(t){var e=zie(t,"string");return typeof e=="symbol"?e:e+""}function zie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class FH{constructor(e){$h(this,"data",void 0),$h(this,"next",null),$h(this,"prev",null),this.data=e}}class ig{constructor(){$h(this,"first",null),$h(this,"last",null)}push(e){const n=new FH(e);if(this.first===null)this.first=n,this.last=n;else{const r=this.last;this.last=n,n.prev=r,r.next=n}return n}unshift(e){const n=new FH(e);if(this.first===null)this.first=n,this.last=n;else{const r=this.first;this.first=n,n.next=r,r.prev=n}}inorder(e){let n=this.first;for(;n;){const r=e(n);if(n===this.last||r===!0)break;n=n.next}}remove(e){if(this.first===null)return!1;let n=this.first,r,i;for(;n;){if(n.data===e)return r=n.next,i=n.prev,r&&(r.prev=i),i&&(i.next=r),n===this.first&&(this.first=r),n===this.last&&(this.last=i),!0;n=n.next}return!1}hasCycle(){let e=this.first,n=this.first;for(;;){if(e===null||(e=e.next,e===null))return!1;if(e=e.next,n=n.next,e===n)return!0}}pop(){if(this.last===null)return null;const e=this.last;return this.last=this.last.prev,e}shift(){if(this.first===null)return null;const e=this.first;return this.first=this.first.next,e}recursiveReverse(){function e(r,i){i&&(e(i,i.next),i.next=r)}if(!this.first)return;e(this.first,this.first.next),this.first.next=null;const n=this.first;this.first=this.last,this.last=n}reverse(){if(!this.first||!this.first.next)return;let e=this.first.next,n=this.first,r;for(;e;)r=e.next,e.next=n,n.prev=e,n=e,e=r;this.first.next=null,this.last.prev=null,r=this.first,this.first=n,this.last=r}}function Yie(t,e){H$(t,e),e.add(t)}function Va(t,e,n){H$(t,e),e.set(t,n)}function H$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ot(t,e){return t.get(Hm(t,e))}function Sr(t,e,n){return t.set(Hm(t,e),n),n}function Hm(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var zi=new WeakMap,Yi=new WeakMap,Gi=new WeakMap,qi=new WeakMap,Qb=new WeakMap,og=new WeakMap,sg=new WeakMap,AS=new WeakSet;class Gie{constructor(e){let{mergedCellsGetter:n,rowIndexMapper:r,columnIndexMapper:i}=e;Yie(this,AS),Va(this,zi,new ig),Va(this,Yi,new ig),Va(this,Gi,null),Va(this,qi,null),Va(this,Qb,null),Va(this,og,null),Va(this,sg,null),Sr(Qb,this,n),Sr(og,this,r),Sr(sg,this,i)}getCurrentVerticalNode(){return ot(qi,this).data}getFirstVerticalNode(){return ot(Yi,this).first.data}getNextVerticalNode(){return ot(qi,this).next.data}getPrevVerticalNode(){return ot(qi,this).prev.data}getCurrentHorizontalNode(){return ot(Gi,this).data}getFirstHorizontalNode(){return ot(zi,this).first.data}getNextHorizontalNode(){return ot(Gi,this).next.data}getPrevHorizontalNode(){return ot(Gi,this).prev.data}setPrevNodeAsActive(){Sr(qi,this,ot(qi,this).prev),Sr(Gi,this,ot(Gi,this).prev)}setNextNodeAsActive(){Sr(qi,this,ot(qi,this).next),Sr(Gi,this,ot(Gi,this).next)}buildFocusOrder(e){const n=e.getTopStartCorner(),r=e.getBottomEndCorner(),i=new WeakSet;Sr(zi,this,new ig);for(let s=n.row;s<=r.row;s++)if(!ot(og,this).isHidden(s))for(let a=n.col;a<=r.col;a++){if(ot(sg,this).isHidden(a))continue;const l=Hm(AS,this,VH).call(this,e,ot(zi,this),i,s,a);l&&Sr(Gi,this,l)}ot(zi,this).first&&(ot(zi,this).first.prev=ot(zi,this).last,ot(zi,this).last.next=ot(zi,this).first);const o=new WeakSet;Sr(Yi,this,new ig);for(let s=n.col;s<=r.col;s++)if(!ot(sg,this).isHidden(s))for(let a=n.row;a<=r.row;a++){if(ot(og,this).isHidden(a))continue;const l=Hm(AS,this,VH).call(this,e,ot(Yi,this),o,a,s);l&&Sr(qi,this,l)}ot(Yi,this).first&&(ot(Yi,this).first.prev=ot(Yi,this).last,ot(Yi,this).last.next=ot(Yi,this).first)}setActiveNode(e,n){return ot(zi,this).inorder(r=>{const{rowStart:i,rowEnd:o,colStart:s,colEnd:a}=r.data;if(e>=i&&e<=o&&n>=s&&n<=a)return Sr(Gi,this,r),!1}),ot(Yi,this).inorder(r=>{const{rowStart:i,rowEnd:o,colStart:s,colEnd:a}=r.data;if(e>=i&&e<=o&&n>=s&&n<=a)return Sr(qi,this,r),!1}),this}}function VH(t,e,n,r,i){const o=t.getTopStartCorner(),s=t.getBottomEndCorner(),a=t.highlight.clone().normalize(),l=ot(Qb,this).call(this,r,i);if(l&&n.has(l))return null;const u={colStart:i,colEnd:i,rowStart:r,rowEnd:r};if(l){if(n.add(l),l.row<o.row||l.row+l.rowspan-1>s.row||l.col<o.col||l.col+l.colspan-1>s.col)return null;u.colStart=l.col,u.colEnd=l.col+l.colspan-1,u.rowStart=l.row,u.rowEnd=l.row+l.rowspan-1}const c=e.push(u);return r===a.row&&i===a.col||l&&a.row>=l.row&&a.row<=l.row+l.rowspan-1&&a.col>=l.col&&a.col<=l.col+l.colspan-1?c:null}function N$(t,e,n){const{view:r,rowIndexMapper:i}=t,o=r.getStylesHandler(),s=r.getDefaultRowHeight();let a=0;for(let u=e;u<e+n;u++)if(!i.isHidden(u)){var l;a+=(l=t.getRowHeight(u))!==null&&l!==void 0?l:s,u===0&&!o.isClassicTheme()&&(a+=1)}return a}function qie(t){const{hot:e}=t,{rowIndexMapper:n,columnIndexMapper:r}=e,i=new Map;function o(){}function s(a,l,u){const c=t.mergedCellsCollection.get(l,u);if(!De(c)){a.removeAttribute("rowspan"),a.removeAttribute("colspan"),tm()&&i.has(l)&&!e.getSettings().rowHeaders&&(a.style.height=`${i.get(l)}px`,i.delete(l)),a.style.display="";return}const{row:h,col:d,colspan:f,rowspan:m}=c,[C,y]=t.translateMergedCellToRenderable(h,m,d,f),E=t.getSetting("virtualized");if(tm()&&d===0&&!e.getSettings().rowHeaders){const U=N$(e,h,m);i.set(l,U/m)}const v=n.getRenderableFromVisualIndex(l),O=r.getRenderableFromVisualIndex(u),x=C-v+1,F=y-O+1;let I=n.getNearestNotHiddenIndex(h,1),_=r.getNearestNotHiddenIndex(d,1);if(E){const U=e.view.getActiveOverlayName();["top","top_inline_start_corner"].includes(U)||(I=Math.max(I,e.getFirstRenderedVisibleRow())),["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(U)||(_=Math.max(_,e.getFirstRenderedVisibleColumn()))}const q=Math.min(m,x),G=Math.min(f,F);I===l&&_===u?(a.setAttribute("rowspan",q),a.setAttribute("colspan",G)):(a.removeAttribute("rowspan"),a.removeAttribute("colspan"),a.style.display="none")}return{before:o,after:s}}function Kie(t,e){D$(t,e),e.add(t)}function ag(t,e,n){D$(t,e),e.set(t,n)}function D$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function HS(t,e,n){return(e=Xie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xie(t){var e=Zie(t,"string");return typeof e=="symbol"?e:e+""}function Zie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ad(t,e,n){return t.set(at(t,e),n),n}function wt(t,e){return t.get(at(t,e))}function at(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}ie.getSingleton().register("beforeMergeCells");ie.getSingleton().register("afterMergeCells");ie.getSingleton().register("beforeUnmergeCells");ie.getSingleton().register("afterUnmergeCells");const eR="mergeCells",Jie=150,WH=eR;var qr=new WeakMap,Kr=new WeakMap,uo=new WeakMap,BH=new WeakMap,ft=new WeakSet;class Qie extends et{constructor(){super(...arguments),Kie(this,ft),HS(this,"mergedCellsCollection",null),HS(this,"autofillCalculations",null),HS(this,"selectionCalculations",null),ag(this,qr,null),ag(this,Kr,{row:0,col:0}),ag(this,uo,new Gie({mergedCellsGetter:(e,n)=>this.mergedCellsCollection.get(e,n),rowIndexMapper:this.hot.rowIndexMapper,columnIndexMapper:this.hot.columnIndexMapper})),ag(this,BH,qie(this))}static get PLUGIN_KEY(){return eR}static get PLUGIN_PRIORITY(){return Jie}static get DEFAULT_SETTINGS(){return{[eL]:"cells",virtualized:!1,cells:[]}}isEnabled(){return!!this.hot.getSettings()[eR]}enablePlugin(){var e=this;this.enabled||(this.mergedCellsCollection=new Am(this),this.autofillCalculations=new Fie(this),this.selectionCalculations=new Bie(this),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,eoe).call(e,...r)}),this.addHook("modifyTransformFocus",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,noe).call(e,...r)}),this.addHook("modifyTransformStart",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,roe).call(e,...r)}),this.addHook("modifyTransformEnd",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,ioe).call(e,...r)}),this.addHook("beforeSelectionHighlightSet",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,ooe).call(e,...r)}),this.addHook("beforeSetRangeStart",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,UH).call(e,...r)}),this.addHook("beforeSetRangeStartOnly",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,UH).call(e,...r)}),this.addHook("beforeSelectionFocusSet",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,aoe).call(e,...r)}),this.addHook("afterSelectionFocusSet",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,loe).call(e,...r)}),this.addHook("afterSelectionEnd",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,uoe).call(e,...r)}),this.addHook("modifyGetCellCoords",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,jH).call(e,...r)}),this.addHook("modifyGetCoordsElement",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,jH).call(e,...r)}),this.addHook("afterIsMultipleSelection",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,toe).call(e,...r)}),this.addHook("afterRenderer",function(){return wt(BH,e).after(...arguments)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,soe).call(e,...r)}),this.addHook("afterGetCellMeta",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,coe).call(e,...r)}),this.addHook("afterViewportRowCalculatorOverride",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,hoe).call(e,...r)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,doe).call(e,...r)}),this.addHook("modifyAutofillRange",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,foe).call(e,...r)}),this.addHook("afterCreateCol",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,goe).call(e,...r)}),this.addHook("afterRemoveCol",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,moe).call(e,...r)}),this.addHook("afterCreateRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,poe).call(e,...r)}),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,woe).call(e,...r)}),this.addHook("afterChange",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,voe).call(e,...r)}),this.addHook("beforeDrawBorders",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,Coe).call(e,...r)}),this.addHook("afterDrawSelection",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,yoe).call(e,...r)}),this.addHook("beforeRemoveCellClassNames",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,Soe).call(e,...r)}),this.addHook("beforeBeginEditing",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,boe).call(e,...r)}),this.addHook("modifyRowHeightByOverlayName",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ft,e,Roe).call(e,...r)}),this.addHook("beforeUndoStackChange",(n,r)=>{if(r==="MergeCells")return!1}),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.clearCollections(),this.unregisterShortcuts(),this.hot.render(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.generateFromSettings(),super.updatePlugin()}ifChromeForceRepaint(){if(!dD())return;const e=[];let n=[];this.mergedCellsCollection.mergedCells.forEach(r=>{const{row:i,rowspan:o}=r;for(let s=i+1;s<i+o;s++)n.push(s)}),n=[...new Set(n)],n.forEach(r=>{const i=this.hot.rowIndexMapper.getRenderableFromVisualIndex(r);this.hot.view._wt.wtOverlays.getOverlays(!0).map(o=>(o==null?void 0:o.name)==="master"?o:o.clone.wtTable).forEach(o=>{const s=o.getRow(i);s&&(s.style.background=Jg(s,"backgroundColor").replace(")",", 0.99)"),e.push(s))})}),this.hot._registerTimeout(()=>{e.forEach(r=>{var i;r.style.background=(i=Jg(r,"backgroundColor"))===null||i===void 0?void 0:i.replace(", 0.99)",")")})},1)}validateSetting(e){return e?ro.containsNegativeValues(e)?(tt(ro.NEGATIVE_VALUES_WARNING(e)),!1):ro.isOutOfBounds(e,this.hot.countRows(),this.hot.countCols())?(tt(ro.IS_OUT_OF_BOUNDS_WARNING(e)),!1):ro.isSingleCell(e)?(tt(ro.IS_SINGLE_CELL(e)),!1):ro.containsZeroSpan(e)?(tt(ro.ZERO_SPAN_WARNING(e)),!1):!0:!1}generateFromSettings(){const e=this.getSetting("cells").filter(i=>this.validateSetting(i)),n=this.mergedCellsCollection.filterOverlappingMergeCells(e),r=[];n.forEach(i=>{const{row:o,col:s,rowspan:a,colspan:l}=i,u=this.hot._createCellCoords(o,s),c=this.hot._createCellCoords(o+a-1,s+l-1),h=this.hot._createCellRange(u,u,c);this.mergeRange(h,!0,!0);for(let d=o;d<o+a;d++)for(let f=s;f<s+l;f++)(d!==o||f!==s)&&r.push([d,f,null])}),r.length!==0&&this.hot.setDataAtCell(r,void 0,void 0,this.pluginName)}clearCollections(){this.mergedCellsCollection.clear()}canMergeRange(e){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)?!0:this.validateSetting(e)}mergeSelection(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;e.setDirection(this.hot.isRtl()?"NE-SW":"NW-SE");const{from:n,to:r}=e;this.unmergeRange(e,!0),this.mergeRange(e),this.hot.selectCell(n.row,n.col,r.row,r.col,!1)}unmergeSelection(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;const{from:n,to:r}=e;this.unmergeRange(e,!0),this.hot.selectCell(n.row,n.col,r.row,r.col,!1)}mergeRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=e.getTopStartCorner(),o=e.getBottomEndCorner(),s={row:i.row,col:i.col,rowspan:o.row-i.row+1,colspan:o.col-i.col+1},a=[];let l=null;return this.canMergeRange(s,n)?(this.hot.runHooks("beforeMergeCells",e,n),fe(0,s.rowspan-1,c=>{fe(0,s.colspan-1,h=>{let d=null;a[c]||(a[c]=[]),c===0&&h===0?d=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(s.row),this.hot.toPhysicalColumn(s.col)):this.hot.setCellMeta(s.row+c,s.col+h,"hidden",!0),a[c][h]=d})}),this.hot.setCellMeta(s.row,s.col,"spanned",!0),this.mergedCellsCollection.add(s,n)?(r?l=[s.row,s.col,a]:this.hot.populateFromArray(s.row,s.col,a,void 0,void 0,this.pluginName),n||this.ifChromeForceRepaint(),this.hot.runHooks("afterMergeCells",e,s,n),l):!0):!1}unmergeRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.mergedCellsCollection.getWithinRange(e);r.length!==0&&(this.hot.runHooks("beforeUnmergeCells",e,n),H(r,i=>{this.mergedCellsCollection.remove(i.row,i.col),fe(0,i.rowspan-1,o=>{fe(0,i.colspan-1,s=>{this.hot.removeCellMeta(i.row+o,i.col+s,"hidden"),this.hot.removeCellMeta(i.row+o,i.col+s,"copyable")})}),this.hot.removeCellMeta(i.row,i.col,"spanned")}),this.hot.runHooks("afterUnmergeCells",e,n),this.hot.render())}toggleMerge(e){const{from:n,to:r}=e.clone().normalize(),i=this.mergedCellsCollection.get(n.row,n.col);i.row===n.row&&i.col===n.col&&i.row+i.rowspan-1===r.row&&i.col+i.colspan-1===r.col?this.unmergeRange(e):this.mergeSelection(e)}merge(e,n,r,i){const o=this.hot._createCellCoords(e,n),s=this.hot._createCellCoords(r,i);this.mergeRange(this.hot._createCellRange(o,o,s))}unmerge(e,n,r,i){const o=this.hot._createCellCoords(e,n),s=this.hot._createCellCoords(r,i);this.unmergeRange(this.hot._createCellRange(o,o,s))}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control","m"]],callback:()=>{const r=this.hot.getSelectedRangeLast();r&&!r.isSingleHeader()&&(this.toggleMerge(r),this.hot.render())},runOnlyIf:r=>!r.altKey,group:WH})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(WH)}modifyViewportRowStart(e,n){const r=this.hot.rowIndexMapper,i=r.getVisualFromRenderableIndex(e.startRow);for(let o=0;o<n;o+=1){const s=this.mergedCellsCollection.get(i,o);if(De(s)){const a=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(s.row,1));if(a<e.startRow){e.startRow=a,this.modifyViewportRowStart(e,n);return}}}}modifyViewportRowEnd(e,n){const r=this.hot.rowIndexMapper,i=r.getVisualFromRenderableIndex(e.endRow);for(let o=0;o<n;o+=1){const s=this.mergedCellsCollection.get(i,o);if(De(s)){const a=s.row+s.rowspan-1,l=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(a,-1));if(l>e.endRow){e.endRow=l,this.modifyViewportRowEnd(e,n);return}}}}modifyViewportColumnStart(e,n){const r=this.hot.columnIndexMapper,i=r.getVisualFromRenderableIndex(e.startColumn);for(let o=0;o<n;o+=1){const s=this.mergedCellsCollection.get(o,i);if(De(s)){const a=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(s.col,1));if(a<e.startColumn){e.startColumn=a,this.modifyViewportColumnStart(e,n);return}}}}modifyViewportColumnEnd(e,n){const r=this.hot.columnIndexMapper,i=r.getVisualFromRenderableIndex(e.endColumn);for(let o=0;o<n;o+=1){const s=this.mergedCellsCollection.get(o,i);if(De(s)){const a=s.col+s.colspan-1,l=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(a,-1));if(l>e.endColumn){e.endColumn=l,this.modifyViewportColumnEnd(e,n);return}}}}translateMergedCellToRenderable(e,n,r,i){const{rowIndexMapper:o,columnIndexMapper:s}=this.hot;let a,l;n===0?a=o.getNearestNotHiddenIndex(e,1):a=o.getNearestNotHiddenIndex(e+n-1,-1),i===0?l=s.getNearestNotHiddenIndex(r,1):l=s.getNearestNotHiddenIndex(r+i-1,-1);const u=e>=0?o.getRenderableFromVisualIndex(a):e,c=r>=0?s.getRenderableFromVisualIndex(l):r;return[u,c]}}function eoe(){this.generateFromSettings(),this.hot.render()}function toe(t){if(t){const e=this.mergedCellsCollection.mergedCells,n=this.hot.getSelectedRangeLast(),r=n.getTopStartCorner(),i=n.getBottomEndCorner();for(let o=0;o<e.length;o+=1)if(r.row===e[o].row&&r.col===e[o].col&&i.row===e[o].row+e[o].rowspan-1&&i.col===e[o].col+e[o].colspan-1)return!1}return t}function noe(t){wt(Kr,this).row=t.row,wt(Kr,this).col=t.col}function roe(t){const e=this.hot.getSelectedRangeLast(),{highlight:n}=e,{columnIndexMapper:r,rowIndexMapper:i}=this.hot;wt(qr,this)&&(i.getRenderableFromVisualIndex(wt(qr,this).row)!==null&&(n.row=wt(qr,this).row),r.getRenderableFromVisualIndex(wt(qr,this).col)!==null&&(n.col=wt(qr,this).col),ad(qr,this,null));const o=this.mergedCellsCollection.get(n.row,n.col);if(!o)return;const s=o.col,a=o.col+o.colspan-1;if(t.col<0){const c=n.col>=s&&n.col<=a?s-1:a,h=r.getNearestNotHiddenIndex(c,-1);h===null?t.col=-this.hot.view.countRenderableColumnsInRange(0,n.col):t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(h,n.col)-1,1)}else if(t.col>0){const c=n.col>=s&&n.col<=a?a+1:s,h=r.getNearestNotHiddenIndex(c,1);h===null?t.col=this.hot.view.countRenderableColumnsInRange(n.col,this.hot.countCols()):t.col=Math.max(this.hot.view.countRenderableColumnsInRange(n.col,h)-1,1)}const l=o.row,u=o.row+o.rowspan-1;if(t.row<0){const c=n.row>=l&&n.row<=u?l-1:u,h=i.getNearestNotHiddenIndex(c,-1);h===null?t.row=-this.hot.view.countRenderableRowsInRange(0,n.row):t.row=-Math.max(this.hot.view.countRenderableRowsInRange(h,n.row)-1,1)}else if(t.row>0){const c=n.row>=l&&n.row<=u?u+1:l,h=i.getNearestNotHiddenIndex(c,1);h===null?t.row=this.hot.view.countRenderableRowsInRange(n.row,this.hot.countRows()):t.row=Math.max(this.hot.view.countRenderableRowsInRange(n.row,h)-1,1)}}function ioe(t){const e=this.hot.getSelectedRangeLast(),n=e.clone(),{to:r}=e,{columnIndexMapper:i,rowIndexMapper:o}=this.hot,s=(a,l)=>{n.expand(this.hot._createCellCoords(a,l));for(let u=0;u<this.mergedCellsCollection.mergedCells.length;u+=1)n.expandByRange(this.mergedCellsCollection.mergedCells[u].getRange())};if(t.col<0){let a=this.mergedCellsCollection.getStartMostColumnIndex(e,r.col)+t.col;s(r.row,a),e.getHorizontalDirection()==="E-W"&&n.getHorizontalDirection()==="E-W"&&(a=n.getTopStartCorner().col);const l=i.getNearestNotHiddenIndex(a,1);l!==null&&(t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(l,r.col)-1,1))}else if(t.col>0){let a=this.mergedCellsCollection.getEndMostColumnIndex(e,r.col)+t.col;s(r.row,a),e.getHorizontalDirection()==="W-E"&&n.getHorizontalDirection()==="W-E"&&(a=n.getBottomEndCorner().col);const l=i.getNearestNotHiddenIndex(a,-1);l!==null&&(t.col=Math.max(this.hot.view.countRenderableColumnsInRange(r.col,l)-1,1))}if(t.row<0){let a=this.mergedCellsCollection.getTopMostRowIndex(e,r.row)+t.row;s(a,r.col),e.getVerticalDirection()==="S-N"&&n.getVerticalDirection()==="S-N"&&(a=n.getTopStartCorner().row);const l=o.getNearestNotHiddenIndex(a,1);l!==null&&(t.row=-Math.max(this.hot.view.countRenderableRowsInRange(l,r.row)-1,1))}else if(t.row>0){let a=this.mergedCellsCollection.getBottomMostRowIndex(e,r.row)+t.row;s(a,r.col),e.getVerticalDirection()==="N-S"&&n.getVerticalDirection()==="N-S"&&(a=n.getBottomStartCorner().row);const l=o.getNearestNotHiddenIndex(a,-1);l!==null&&(t.row=Math.max(this.hot.view.countRenderableRowsInRange(r.row,l)-1,1))}}function ooe(){const t=this.hot.getSelectedRangeLast(),{highlight:e}=t;if(this.hot.selection.isSelectedByColumnHeader()||this.hot.selection.isSelectedByRowHeader()){ad(qr,this,e.clone());return}for(let r=0;r<this.mergedCellsCollection.mergedCells.length;r+=1)t.expandByRange(this.mergedCellsCollection.mergedCells[r].getRange(),!1);for(let r=0;r<this.mergedCellsCollection.mergedCells.length;r+=1)t.expandByRange(this.mergedCellsCollection.mergedCells[r].getRange(),!1);const n=this.mergedCellsCollection.get(e.row,e.col);ad(qr,this,e.clone()),n&&e.assign(n)}function jH(t,e,n,r){if(t<0||e<0)return;const i=this.mergedCellsCollection.get(t,e);if(!i)return;const{row:o,col:s,colspan:a,rowspan:l}=i,u=o,c=s,h=o+l-1,d=s+a-1;if(r==="render"&&this.getSetting("virtualized")){const f=this.hot.view.getActiveOverlayName(),m=["top","top_inline_start_corner"].includes(f)?0:this.hot.getFirstRenderedVisibleRow(),C=["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(f)?0:this.hot.getFirstRenderedVisibleColumn();return[qe(m,u,h),qe(C,c,d),qe(this.hot.getLastRenderedVisibleRow(),u,h),qe(this.hot.getLastRenderedVisibleColumn(),c,d)]}return[u,c,h,d]}function soe(t){t.items.push({name:"---------"},jie(this))}function UH(){ad(qr,this,null)}function aoe(){if(wt(qr,this).isCell())return;const t=this.hot.getSelectedRangeLast(),e=t.getVerticalDirection(),n=t.getHorizontalDirection(),r=wt(qr,this).clone().normalize();wt(uo,this).setActiveNode(r.row,r.col),wt(Kr,this).row>0||wt(Kr,this).col>0?wt(uo,this).setPrevNodeAsActive():(n==="E-W"&&wt(Kr,this).col<0||e==="S-N"&&wt(Kr,this).row<0)&&wt(uo,this).setNextNodeAsActive()}function loe(t,e){const n=this.hot.getSelectedRangeLast(),{columnIndexMapper:r,rowIndexMapper:i}=this.hot;let o=null,s=null;if(wt(Kr,this).col<0){const{rowEnd:a,colEnd:l}=wt(uo,this).getPrevHorizontalNode();s=r.getNearestNotHiddenIndex(l,-1),o=i.getNearestNotHiddenIndex(a,-1)}else if(wt(Kr,this).col>0){const{rowStart:a,colStart:l}=wt(uo,this).getNextHorizontalNode();s=r.getNearestNotHiddenIndex(l,1),o=i.getNearestNotHiddenIndex(a,1)}else if(wt(Kr,this).row<0){const{rowEnd:a,colEnd:l}=wt(uo,this).getPrevVerticalNode();s=r.getNearestNotHiddenIndex(l,-1),o=i.getNearestNotHiddenIndex(a,-1)}else if(wt(Kr,this).row>0){const{rowStart:a,colStart:l}=wt(uo,this).getNextVerticalNode();s=r.getNearestNotHiddenIndex(l,1),o=i.getNearestNotHiddenIndex(a,1)}if(o!==null||s!==null){const a=this.hot._createCellCoords(o,s),l=this.mergedCellsCollection.get(a.row,a.col),u=this.hot.selection.highlight.getFocus();t=a.row,e=a.col,l?n.highlight.assign({row:this.hot.rowIndexMapper.getNearestNotHiddenIndex(l.row,1),col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(l.col,1)}):n.highlight.assign(a),u.clear(),u.add(a).commit()}wt(uo,this).setActiveNode(t,e),ad(Kr,this,{row:0,col:0})}function uoe(){this.hot.getSelectedRangeLast().isHeader()||wt(uo,this).buildFocusOrder(this.hot.getSelectedRangeLast())}function coe(t,e,n){const r=this.mergedCellsCollection.get(t,e);r&&(r.row!==t||r.col!==e?n.copyable=!1:(n.rowspan=r.rowspan,n.colspan=r.colspan))}function hoe(t){if(this.getSetting("virtualized"))return;const e=this.hot.countCols();this.modifyViewportRowStart(t,e),this.modifyViewportRowEnd(t,e)}function doe(t){if(this.getSetting("virtualized"))return;const e=this.hot.countRows();this.modifyViewportColumnStart(t,e),this.modifyViewportColumnEnd(t,e)}function foe(t,e){const n=this.autofillCalculations.getDirection(e,t);if(this.autofillCalculations.dragAreaOverlapsCollections(e,t,n))return e;const r=this.hot._createCellCoords(e[0],e[1]),i=this.hot._createCellCoords(e[2],e[3]),o=this.hot._createCellRange(r,r,i),s=this.mergedCellsCollection.getWithinRange(o);return s.length===0?t:this.autofillCalculations.snapDragArea(e,t,n,s)}function goe(t,e){this.mergedCellsCollection.shiftCollections("right",t,e)}function moe(t,e){this.mergedCellsCollection.shiftCollections("left",t,e)}function poe(t,e,n){n!=="auto"&&this.mergedCellsCollection.shiftCollections("down",t,e)}function woe(t,e){this.mergedCellsCollection.shiftCollections("up",t,e)}function voe(t,e){e==="Autofill.fill"&&this.autofillCalculations.recreateAfterDataPopulation(t)}function Coe(t,e){if(e&&e==="area"){const n=this.hot.getSelectedRangeLast(),r=this.mergedCellsCollection.getWithinRange(n);H(r,i=>{n.getBottomEndCorner().row===i.getLastRow()&&n.getBottomEndCorner().col===i.getLastColumn()&&(t[2]=i.row,t[3]=i.col)})}}function yoe(t,e,n,r){if(n)return this.selectionCalculations.getSelectedMergedCellClassName(t,e,n,r)}function Soe(){return this.selectionCalculations.getSelectedMergedCellClassNameToRemove()}function boe(t,e,n,r){if(!(r instanceof MouseEvent))return;const i=this.hot.getSelectedRangeLast(),o=this.mergedCellsCollection.getByRange(i);if(!o)return;const s=this.hot._createCellCoords(o.row,o.col),a=this.hot._createCellCoords(o.row+o.rowspan-1,o.col+o.colspan-1);return this.hot.selection.getLayerLevel()===0&&i.isEqual(this.hot._createCellRange(s,s,a))}function Roe(t,e,n){if(this.hot.getSettings().rowHeaders||n==="bottom"||n==="bottom_inline_start_corner")return t;let r,i;if(n==="master")r=this.hot.getFirstRenderedVisibleColumn(),i=this.hot.getLastRenderedVisibleColumn();else{const d=this.hot.view.getOverlayByName(n);r=this.hot.columnIndexMapper.getVisualFromRenderableIndex(d.clone.wtTable.getFirstRenderedColumn()),i=this.hot.columnIndexMapper.getVisualFromRenderableIndex(d.clone.wtTable.getLastRenderedColumn())}if(!this.mergedCellsCollection.get(e,r))return t;const s=this.hot._createCellCoords(e,r),a=this.hot._createCellCoords(e,i),l=this.hot._createCellRange(s,s,a),u=this.mergedCellsCollection.getWithinRange(l,!0),c=u.reduce((d,f)=>{let{rowspan:m}=f;return Math.max(d,m)},1);let h=0;return u.length>1&&u[0].rowspan<c&&(h=c-u[0].rowspan),u.forEach(d=>{let{rowspan:f}=d,m=0;n==="top"||n==="top_inline_start_corner"?m=Math.min(c,this.hot.view.countNotHiddenFixedRowsTop()-e):m=f-h,t=Math.max(t??0,N$(this.hot,e,m))}),t}function Eoe(t,e){return function(n,r){const[,...i]=n,[,...o]=r;return(function s(a){const l=t[a],u=e[a],c=i[a],h=o[a],d=u.multiColumnSorting,m=(d.compareFunctionFactory?d.compareFunctionFactory:hL(u.type))(l,u,d)(c,h);if(m===co){const C=a+1;if(typeof e[C]<"u")return s(C)}return m})(0)}}const k$="sort";function Toe(t,e,n){const r=[];return n===!1||t.isColumnSorted(e)&&t.getNumberOfSortedColumns()>1&&r.push(`${k$}-${t.getIndexOfColumnInSortQueue(e)+1}`),r}function _oe(t){const e=t.className.split(" "),n=new RegExp(`^${k$}-[0-9]{1,2}$`);return e.filter(r=>n.test(r))}function Moe(t,e,n){return(e=Ioe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ioe(t){var e=Poe(t,"string");return typeof e=="symbol"?e:e+""}function Poe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Nm="multiColumnSorting",Ooe=170,zH=Nm;cL(Nm,Eoe);class xoe extends yL{constructor(){super(...arguments),Moe(this,"pluginKey",Nm)}static get PLUGIN_KEY(){return Nm}static get PLUGIN_PRIORITY(){return Ooe}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){super.enablePlugin()}disablePlugin(){super.disablePlugin()}registerShortcuts(){super.registerShortcuts(),this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Shift","Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();return e.row===-1&&e.col>=0&&this.sort(this.getNextSortConfig(e.col,mm)),!1},runOnlyIf:()=>{var e,n;const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r&&((n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingle())&&this.hot.selection.isCellVisible(r)&&r.isHeader()},relativeToGroup:ta,position:"before",group:zH})}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(zH)}sort(e){super.sort(e)}clearSort(){super.clearSort()}isSorted(){return super.isSorted()}getSortConfig(e){return super.getSortConfig(e)}setSortConfig(e){super.setSortConfig(e)}getNormalizedSortConfigs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Array.isArray(e)?e:[e]}updateHeaderClasses(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];super.updateHeaderClasses(e,...r),we(e,_oe(e)),this.enabled!==!1&&X(e,Toe(...r))}onAfterOnCellMouseDown(e,n){pT(n.row,n.col,e)!==!1&&this.wasClickableHeaderClicked(e,n.col)&&(this.hot.getShortcutManager().isCtrlPressed()?(this.hot.deselectCell(),this.hot.selectColumns(n.col),this.sort(this.getNextSortConfig(n.col,mm))):this.sort(this.getColumnNextConfig(n.col)))}}function YH(t,e,n){return(e=Aoe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Aoe(t){var e=Hoe(t,"string");return typeof e=="symbol"?e:e+""}function Hoe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Noe="multipleSelectionHandles",Doe=160;class koe extends et{constructor(){super(...arguments),YH(this,"dragged",[]),YH(this,"lastSetCell",null)}static get PLUGIN_KEY(){return Noe}static get PLUGIN_PRIORITY(){return Doe}isEnabled(){return qo()}enablePlugin(){this.enabled||(this.registerListeners(),super.enablePlugin())}registerListeners(){const e=this,{rootElement:n}=this.hot;function r(i){if(e.dragged.length===1)return e.dragged.splice(0,e.dragged.length),!0;const o=e.dragged.indexOf(i);if(o===-1)return!1;o===0?e.dragged=e.dragged.slice(0,1):o===1&&(e.dragged=e.dragged.slice(-1))}this.eventManager.addEventListener(n,"touchstart",i=>{let o;if(ye(i.target,"topSelectionHandle-HitArea"))return o=e.hot.getSelectedRangeLast(),e.dragged.push("top"),e.touchStartRange={width:o.getWidth(),height:o.getHeight(),direction:o.getDirection()},i.preventDefault(),!1;if(ye(i.target,"bottomSelectionHandle-HitArea"))return o=e.hot.getSelectedRangeLast(),e.dragged.push("bottom"),e.touchStartRange={width:o.getWidth(),height:o.getHeight(),direction:o.getDirection()},i.preventDefault(),!1}),this.eventManager.addEventListener(n,"touchend",i=>{if(ye(i.target,"topSelectionHandle-HitArea"))return r.call(e,"top"),e.touchStartRange=void 0,i.preventDefault(),!1;if(ye(i.target,"bottomSelectionHandle-HitArea"))return r.call(e,"bottom"),e.touchStartRange=void 0,i.preventDefault(),!1}),this.eventManager.addEventListener(n,"touchmove",i=>{const{rootDocument:o}=this.hot;let s,a,l,u,c,h;if(e.dragged.length===0)return;const d=o.elementFromPoint(i.touches[0].clientX,i.touches[0].clientY);!d||d===e.lastSetCell||((d.nodeName==="TD"||d.nodeName==="TH")&&(s=e.hot.getCoords(d),s.col===-1&&(s.col=0),a=e.hot.getSelectedRangeLast(),l=a.getWidth(),u=a.getHeight(),c=a.getDirection(),l===1&&u===1&&e.hot.selection.setRangeEnd(s),h=e.getCurrentRangeCoords(a,s,e.touchStartRange.direction,c,e.dragged[0]),h.start!==null&&e.hot.selection.setRangeStart(h.start),e.hot.selection.setRangeEnd(h.end),e.lastSetCell=d),i.preventDefault())})}getCurrentRangeCoords(e,n,r,i,o){const s=e.getTopStartCorner(),a=e.getBottomEndCorner(),l=e.getBottomStartCorner(),u=e.getTopEndCorner();let c={start:null,end:null};switch(r){case"NE-SW":switch(i){case"NE-SW":case"NW-SE":o==="top"?c={start:this.hot._createCellCoords(n.row,e.highlight.col),end:this.hot._createCellCoords(l.row,n.col)}:c={start:this.hot._createCellCoords(e.highlight.row,n.col),end:this.hot._createCellCoords(n.row,s.col)};break;case"SE-NW":o==="bottom"&&(c={start:this.hot._createCellCoords(a.row,n.col),end:this.hot._createCellCoords(n.row,s.col)});break}break;case"NW-SE":switch(i){case"NE-SW":o==="top"?c={start:n,end:l}:c.end=n;break;case"NW-SE":o==="top"?c={start:n,end:a}:c.end=n;break;case"SE-NW":o==="top"?c={start:n,end:s}:c.end=n;break;case"SW-NE":o==="top"?c={start:n,end:u}:c.end=n;break}break;case"SW-NE":switch(i){case"NW-SE":o==="bottom"?c={start:this.hot._createCellCoords(n.row,s.col),end:this.hot._createCellCoords(l.row,n.col)}:c={start:this.hot._createCellCoords(s.row,n.col),end:this.hot._createCellCoords(n.row,a.col)};break;case"SW-NE":o==="top"?c={start:this.hot._createCellCoords(e.highlight.row,n.col),end:this.hot._createCellCoords(n.row,a.col)}:c={start:this.hot._createCellCoords(n.row,s.col),end:this.hot._createCellCoords(s.row,n.col)};break;case"SE-NW":o==="bottom"?c={start:this.hot._createCellCoords(n.row,u.col),end:this.hot._createCellCoords(s.row,n.col)}:o==="top"&&(c={start:l,end:n});break}break;case"SE-NW":switch(i){case"NW-SE":case"NE-SW":case"SW-NE":o==="top"&&(c.end=n);break;case"SE-NW":o==="top"?c.end=n:c={start:n,end:s};break}break}return c}isDragged(){return this.dragged.length>0}}function tR(){let{label:t="",colspan:e=1,origColspan:n=1,collapsible:r=!1,crossHiddenColumns:i=[],isCollapsed:o=!1,isHidden:s=!1,isRoot:a=!1,isPlaceholder:l=!1,headerClassNames:u=[]}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{label:t,colspan:e,origColspan:n,collapsible:r,isCollapsed:o,crossHiddenColumns:i,isHidden:s,isRoot:a,isPlaceholder:l,headerClassNames:u}}function L$(){return{label:"",isPlaceholder:!0}}function Loe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0;const n=[];if(e===0)return n;H(t,i=>{const o=[];let s=0;n.push(o),H(i,a=>{const l=tR();if(De(a)){const{label:c,colspan:h,headerClassName:d}=a;l.label=At(c),typeof h=="number"&&h>1&&(l.colspan=h,l.origColspan=h),typeof d=="string"&&(l.headerClassNames=[...d.split(" ")])}else l.label=At(a);s+=l.origColspan;let u=!1;if(s>=e&&(l.colspan=l.origColspan-(s-e),l.origColspan=l.colspan,u=!0),o.push(l),l.colspan>1)for(let c=0;c<l.colspan-1;c++)o.push(L$());return!u})});const r=Math.max(...ze(n,i=>i.length));return H(n,i=>{if(i.length<r){const o=ze(new Array(r-i.length),()=>tR());i.splice(i.length,0,...o)}}),n}function NS(t,e,n){$oe(t,e),e.set(t,n)}function $oe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function li(t,e){return t.get($$(t,e))}function nh(t,e,n){return t.set($$(t,e),n),n}function $$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const GH=["label","collapsible"];var Ho=new WeakMap,Wa=new WeakMap,DS=new WeakMap;class Foe{constructor(){NS(this,Ho,[]),NS(this,Wa,0),NS(this,DS,1/0)}setColumnsLimit(e){nh(DS,this,e)}setData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];nh(Ho,this,Loe(e,li(DS,this))),nh(Wa,this,li(Ho,this).length)}getData(){return li(Ho,this)}mergeWith(e){H(e,n=>{let{row:r,col:i,...o}=n;const s=this.getHeaderSettings(r,i);s!==null&&ln(s,o,GH)})}map(e){H(li(Ho,this),n=>{H(n,r=>{const i=e({...r});De(i)&&ln(r,i,GH)})})}getHeaderSettings(e,n){var r;if(e>=li(Wa,this)||e<0)return null;const i=li(Ho,this)[e];return Array.isArray(i)===!1||n>=i.length?null:(r=i[n])!==null&&r!==void 0?r:null}getHeadersSettings(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const i=[];if(e>=li(Wa,this)||e<0)return i;const o=li(Ho,this)[e];let s=0;for(let a=n;a<o.length;a++){const l=o[a];if(l.isPlaceholder)throw new Error("The first column settings cannot overlap the other header layers");if(s+=l.colspan,i.push(l),l.colspan>1&&(a+=l.colspan-1),s===r)break;if(s>r)throw new Error("The last column settings cannot overlap the other header layers")}return i}getLayersCount(){return li(Wa,this)}getColumnsCount(){return li(Wa,this)>0?li(Ho,this)[0].length:0}clear(){nh(Ho,this,[]),nh(Wa,this,0)}}function kS(t,e,n){return(e=Voe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Voe(t){var e=Woe(t,"string");return typeof e=="symbol"?e:e+""}function Woe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const F$="DF-pre-order";function V$(t,e){let n=t.call(e,this);for(let r=0;r<this.childs.length;r++){if(n===!1)return!1;n=V$.call(this.childs[r],t,e)}return n}const Boe="DF-post-order";function W$(t,e){for(let n=0;n<this.childs.length;n++)if(W$.call(this.childs[n],t,e)===!1)return!1;return t.call(e,this)}const B$="BF";function joe(t,e){const n=[this];function r(){if(n.length===0)return;const i=n.shift();n.push(...i.childs),t.call(e,i)!==!1&&r()}r()}const Uoe=B$,qH=new Map([[F$,V$],[Boe,W$],[B$,joe]]);class Dm{constructor(e){kS(this,"data",{}),kS(this,"parent",null),kS(this,"childs",[]),this.data=e}addChild(e){e.parent=this,this.childs.push(e)}cloneTree(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this;const n=new Dm({...e.data});for(let r=0;r<e.childs.length;r++)n.addChild(this.cloneTree(e.childs[r]));return n}replaceTreeWith(e){this.data={...e.data},this.childs=[];for(let n=0;n<e.childs.length;n++)this.addChild(e.childs[n])}walkDown(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Uoe;if(!qH.has(n))throw new Error(`Traversal strategy "${n}" does not exist`);qH.get(n).call(this,e,this)}walkUp(e){const n=this,r=i=>{e.call(n,i)!==!1&&i.parent!==null&&r(i.parent)};r(this)}}function LS(t,e,n){zoe(t,e),e.set(t,n)}function zoe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Vn(t,e){return t.get(j$(t,e))}function Yoe(t,e,n){return t.set(j$(t,e),n),n}function j$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var su=new WeakMap,Ba=new WeakMap,au=new WeakMap;class Goe{constructor(e){LS(this,su,new Map),LS(this,Ba,new Map),LS(this,au,null),Yoe(au,this,e)}getRoots(){return Array.from(Vn(su,this).values())}getRootByColumn(e){let n;return Vn(Ba,this).has(e)&&(n=Vn(su,this).get(Vn(Ba,this).get(e))),n}getNode(e,n){const r=this.getRootByColumn(n);if(!r)return;const i=n-Vn(Ba,this).get(n);let o=0,s;return r.walkDown(a=>{const{data:{origColspan:l,headerLevel:u}}=a;if(e===u){if(i>=o&&i<=o+l-1)return s=a,s.data.isRoot=n===s.data.columnIndex,!1;o+=l}}),s}rebuildTreeIndex(){let e=0;Vn(Ba,this).clear(),H(Vn(su,this),n=>{let[,{data:{colspan:r}}]=n;for(let i=e;i<e+r;i++)Vn(Ba,this).set(i,e);e+=r})}buildTree(){this.clear();const e=Vn(au,this).getColumnsCount();let n=0;for(;n<e;){const r=Vn(au,this).getHeaderSettings(0,n),i=new Dm;Vn(su,this).set(n,i),this.buildLeaves(i,n,0,r.origColspan),n+=r.origColspan}this.rebuildTreeIndex()}buildLeaves(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;const o=Vn(au,this).getHeadersSettings(r,n,i);r+=1,H(o,s=>{const a={...s,headerLevel:r-1,columnIndex:n};let l;r===1?(e.data=a,l=e):(l=new Dm(a),e.addChild(l)),r<Vn(au,this).getLayersCount()&&this.buildLeaves(l,n,r,s.origColspan),n+=s.origColspan})}clear(){Vn(su,this).clear(),Vn(Ba,this).clear()}}function U$(t,e){t.walkDown(n=>{let{data:r,childs:i}=n;if(!r.isHidden&&(e(r.columnIndex),i.length===0))for(let o=1;o<r.colspan;o++)e(r.columnIndex+o)})}function km(t,e){let{childs:n}=t;if(n.length!==0)return n[0].data[e]}function Lm(t){return km(t,"origColspan")===t.data.origColspan}function xT(t){const{data:e,childs:n}=t;if(!e.isCollapsed||e.isHidden||e.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(Lm(t))return xT(n[0]);e.isCollapsed=!1;const i=n.slice(1),o=new Set;let s=0;if(i.length>0)H(i,a=>{a.replaceTreeWith(a.data.clonedTree),a.data.clonedTree=null;const l=a.data;s+=l.colspan,U$(a,u=>{o.add(u)})});else{const{colspan:a,origColspan:l,columnIndex:u}=e;s=l-a;for(let c=1;c<l;c++)o.add(u+c)}return t.walkUp(a=>{const{data:l}=a;l.colspan+=s,l.colspan>=l.origColspan?(l.colspan=l.origColspan,l.isCollapsed=!1):Lm(a)&&(l.isCollapsed=km(a,"isCollapsed"))}),{rollbackModification:()=>AT(t),affectedColumns:Array.from(o),colspanCompensation:s}}function AT(t){var e;const{data:n,childs:r}=t;if(n.isCollapsed||n.isHidden||n.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(Lm(t))return AT(r[0]);n.isCollapsed=!0;const o=r.slice(1),s=new Set;if(o.length>0)H(o,l=>{U$(l,u=>{s.add(u)}),l.data.clonedTree=l.cloneTree(),l.walkDown(u=>{let{data:c}=u;c.isHidden=!0})});else{const{origColspan:l,columnIndex:u}=n;for(let c=1;c<l;c++){const h=u+c;s.add(h)}}const a=n.colspan-((e=km(t,"colspan"))!==null&&e!==void 0?e:1);return t.walkUp(l=>{const{data:u}=l;u.colspan-=a,u.colspan<=1?(u.colspan=1,u.isCollapsed=!0):Lm(l)&&(u.isCollapsed=km(l,"isCollapsed"))}),{rollbackModification:()=>xT(t),affectedColumns:Array.from(s),colspanCompensation:a}}function qoe(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(st`The passed node is not the last node on the tree. Only for\x20
292
- the last node, the hide column modification can be applied.`);const{crossHiddenColumns:n}=t.data;if(n.includes(e))return;let r=!1;t.walkUp(i=>{const{data:{collapsible:o}}=i;if(o)return r=!0,!1}),!r&&t.walkUp(i=>{const{data:o}=i;o.crossHiddenColumns.push(e),o.colspan>1?o.colspan-=1:o.isHidden=!0})}function Koe(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(st`The passed node is not the last node on the tree. Only for\x20
293
- the last node, the show column modification can be applied.`);const{crossHiddenColumns:n}=t.data;if(!n.includes(e))return;let r=!1;t.walkUp(i=>{const{data:{collapsible:o}}=i;if(o)return r=!0,!1}),!r&&t.walkUp(i=>{const{data:o}=i;o.crossHiddenColumns.splice(o.crossHiddenColumns.indexOf(e),1),!o.isHidden&&o.colspan<o.origColspan&&(o.colspan+=1),o.isHidden=!1})}const KH=new Map([["collapse",AT],["expand",xT],["hide-column",qoe],["show-column",Koe]]);function Xoe(t,e,n){if(!KH.has(t))throw new Error(`The node modifier action ("${t}") does not exist.`);return KH.get(t)(e,n)}function lg(t){const e=[];return H(t,n=>{n.walkDown(r=>{const i=r.data,{origColspan:o,columnIndex:s,headerLevel:a,crossHiddenColumns:l}=i,u=Joe(e,a);let c=!1;for(let h=s;h<s+o;h++)if(l.includes(h)||c)u.push(L$());else{const f=Zoe(i);f.isRoot=!0,u.push(f),c=!0}})}),e}function Zoe(t){const{crossHiddenColumns:e,...n}=tR(t);return n}function Joe(t,e){let n;return Array.isArray(t[e])?n=t[e]:(n=[],t[e]=n),n}function $S(t,e,n){Qoe(t,e),e.set(t,n)}function Qoe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function rh(t,e,n){return t.set(z$(t,e),n),n}function Nt(t,e){return t.get(z$(t,e))}function z$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Ki=new WeakMap,ir=new WeakMap,ja=new WeakMap;class ese{constructor(){$S(this,Ki,new Foe),$S(this,ir,new Goe(Nt(Ki,this))),$S(this,ja,[[]])}setState(e){Nt(Ki,this).setData(e);let n=!1;try{Nt(ir,this).buildTree()}catch{Nt(ir,this).clear(),Nt(Ki,this).clear(),n=!0}return rh(ja,this,lg(Nt(ir,this).getRoots())),n}setColumnsLimit(e){Nt(Ki,this).setColumnsLimit(e)}mergeStateWith(e){const n=ze(e,r=>{let{row:i,...o}=r;return{row:i<0?this.rowCoordsToLevel(i):i,...o}});Nt(Ki,this).mergeWith(n),Nt(ir,this).buildTree(),rh(ja,this,lg(Nt(ir,this).getRoots()))}mapState(e){Nt(Ki,this).map(e),Nt(ir,this).buildTree(),rh(ja,this,lg(Nt(ir,this).getRoots()))}mapNodes(e){return wr(Nt(ir,this).getRoots(),(n,r)=>(r.walkDown(i=>{const o=e(i.data);o!==void 0&&n.push(o)}),n),[])}triggerNodeModification(e,n,r){n<0&&(n=this.rowCoordsToLevel(n));const i=Nt(ir,this).getNode(n,r);let o;return i&&(o=Xoe(e,i,r),rh(ja,this,lg(Nt(ir,this).getRoots()))),o}triggerColumnModification(e,n){return this.triggerNodeModification(e,-1,n)}rowCoordsToLevel(e){if(e>=0)return null;const n=e+Math.max(this.getLayersCount(),1);return n<0?null:n}levelToRowCoords(e){if(e<0)return null;const n=e-Math.max(this.getLayersCount(),1);return n>=0?null:n}getHeaderSettings(e,n){var r,i;return e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount()?null:(r=(i=Nt(ja,this)[e])===null||i===void 0?void 0:i[n])!==null&&r!==void 0?r:null}getHeaderTreeNodeData(e,n){const r=this.getHeaderTreeNode(e,n);return r?{...r.data}:null}getHeaderTreeNode(e,n){if(e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount())return null;const r=Nt(ir,this).getNode(e,n);return r||null}findTopMostEntireHeaderLevel(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;const r=n-e+1;let i=!1,o=null;for(let s=e;s<=n;s++){const a=Nt(ir,this).getRootByColumn(s);if(!a)break;i=!0,a.walkDown(l=>{const{columnIndex:u,headerLevel:c,origColspan:h,isHidden:d}=l.data;d||h<=r&&u>=e&&u+h-1<=n&&(o===null||c<o)&&(o=c)},F$)}return i&&o===null?-1:this.levelToRowCoords(o??0)}findLeftMostColumnIndex(e,n){var r;const{isRoot:i}=(r=this.getHeaderSettings(e,n))!==null&&r!==void 0?r:{isRoot:!0};if(i)return n;let o=n-1;for(;o>=0;){var s;const{isRoot:a}=(s=this.getHeaderSettings(e,o))!==null&&s!==void 0?s:{isRoot:!0};if(a)break;o-=1}return o}findRightMostColumnIndex(e,n){var r;const{isRoot:i,origColspan:o}=(r=this.getHeaderSettings(e,n))!==null&&r!==void 0?r:{isRoot:!0,origColspan:1};if(i)return n+o-1;let s=n+1;for(;s<this.getColumnsCount();){var a;const{isRoot:l}=(a=this.getHeaderSettings(e,s))!==null&&a!==void 0?a:{isRoot:!0};if(l)break;s+=1}return s-1}getLayersCount(){return Nt(Ki,this).getLayersCount()}getColumnsCount(){return Nt(Ki,this).getColumnsCount()}clear(){rh(ja,this,[]),Nt(Ki,this).clear(),Nt(ir,this).clear()}}function ih(t,e,n){return(e=tse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tse(t){var e=nse(t,"string");return typeof e=="symbol"?e:e+""}function nse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class rse{constructor(e,n){ih(this,"hot",void 0),ih(this,"nestedHeaderSettingsGetter",void 0),ih(this,"layersCount",0),ih(this,"container",void 0),ih(this,"widthsMap",void 0),this.hot=e,this.nestedHeaderSettingsGetter=n,this.widthsMap=this.hot.columnIndexMapper.createAndRegisterIndexMap("nestedHeaders.widthsMap","physicalIndexToValue")}setLayersCount(e){return this.layersCount=e,this}getWidth(e){return this.widthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e))}buildWidthsMap(){const e=this.hot.getCurrentThemeName();this.container=this.hot.rootDocument.createElement("div"),this.container.classList.add("handsontable","htGhostTable","htAutoSize"),e&&this.container.classList.add(e),this._buildGhostTable(this.container),this.hot.rootDocument.body.appendChild(this.container);const n=this.container.querySelectorAll("tr:last-of-type th"),r=n.length;this.widthsMap.clear();for(let i=0;i<r;i++){const o=this.hot.columnIndexMapper.getVisualFromRenderableIndex(i),s=this.hot.toPhysicalColumn(o);this.widthsMap.setValueAtIndex(s,n[i].offsetWidth)}this.container.parentNode.removeChild(this.container),this.container=null}_buildGhostTable(e){const{rootDocument:n,columnIndexMapper:r}=this.hot,i=n.createDocumentFragment(),o=n.createElement("table"),s=!!this.hot.getSettings().dropdownMenu,a=r.getRenderableIndexesLength();for(let l=0;l<this.layersCount;l++){const u=n.createElement("tr");for(let c=0;c<a;c++){let h=r.getVisualFromRenderableIndex(c);h===null&&(h=c);const d=n.createElement("th"),f=this.nestedHeaderSettingsGetter(l,h);if(f&&(!f.isPlaceholder||f.isHidden)){let m=f.label;s&&(m+='<button class="changeType"></button>'),Ju(d,m),d.colSpan=f.colspan,u.appendChild(d)}}o.appendChild(u)}i.appendChild(o),e.appendChild(i)}clear(){this.widthsMap.clear(),this.container=null}}function ise(t,e){Y$(t,e),e.add(t)}function XH(t,e,n){return(e=ose(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ose(t){var e=sse(t,"string");return typeof e=="symbol"?e:e+""}function sse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function oh(t,e,n){Y$(t,e),e.set(t,n)}function Y$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Jo(t,e,n){return t.set(Dt(t,e),n),n}function je(t,e){return t.get(Dt(t,e))}function Dt(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const ZH="nestedHeaders",ase=280;var ct=new WeakMap,_s=new WeakMap,Fh=new WeakMap,$p=new WeakMap,$m=new WeakMap,Wt=new WeakSet;class lse extends et{constructor(){super(...arguments),ise(this,Wt),oh(this,ct,new ese),oh(this,_s,null),oh(this,Fh,null),oh(this,$p,!1),oh(this,$m,null),XH(this,"ghostTable",new rse(this.hot,(e,n)=>this.getHeaderSettings(e,n))),XH(this,"detectedOverlappedHeaders",!1)}static get PLUGIN_KEY(){return ZH}static get PLUGIN_PRIORITY(){return ase}isEnabled(){return!!this.hot.getSettings()[ZH]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:n}=this.hot.getSettings();(!Array.isArray(n)||!Array.isArray(n[0]))&&tt(st`Your Nested Headers plugin configuration is invalid. The settings has to be\x20
294
- passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]`),this.addHook("init",()=>Dt(Wt,this,Ese).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Dt(Wt,e,Tse).call(e,...i)}),this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Dt(Wt,e,dse).call(e,...i)}),this.addHook("afterOnCellMouseDown",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Dt(Wt,e,fse).call(e,...i)}),this.addHook("beforeOnCellMouseOver",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Dt(Wt,e,gse).call(e,...i)}),this.addHook("beforeOnCellMouseUp",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Dt(Wt,e,mse).call(e,...i)}),this.addHook("beforeSelectionHighlightSet",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Dt(Wt,e,pse).call(e,...i)}),this.addHook("modifyTransformStart",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Dt(Wt,e,wse).call(e,...i)}),this.addHook("afterSelection",()=>Dt(Wt,this,ug).call(this)),this.addHook("afterSelectionFocusSet",()=>Dt(Wt,this,ug).call(this)),this.addHook("beforeViewportScrollHorizontally",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Dt(Wt,e,use).call(e,...i)}),this.addHook("afterGetColumnHeaderRenderers",r=>Dt(Wt,this,Cse).call(this,r)),this.addHook("modifyColWidth",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Dt(Wt,e,Sse).call(e,...i)}),this.addHook("modifyColumnHeaderValue",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Dt(Wt,e,bse).call(e,...i)}),this.addHook("beforeHighlightingColumnHeader",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Dt(Wt,e,cse).call(e,...i)}),this.addHook("beforeCopy",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Dt(Wt,e,hse).call(e,...i)}),this.addHook("beforeSelectColumns",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Dt(Wt,e,vse).call(e,...i)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Dt(Wt,e,yse).call(e,...i)}),this.addHook("modifyFocusedElement",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Dt(Wt,e,Rse).call(e,...i)}),this.hot.columnIndexMapper.addLocalHook("cacheUpdated",()=>Dt(Wt,this,ug).call(this)),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",()=>Dt(Wt,this,ug).call(this)),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(!this.hot.view)return;const{nestedHeaders:e}=this.hot.getSettings();je(ct,this).setColumnsLimit(this.hot.countCols()),Array.isArray(e)&&(this.detectedOverlappedHeaders=je(ct,this).setState(e)),this.detectedOverlappedHeaders&&tt(st`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20
295
- is currently not supported.`),this.enabled&&this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach((n,r)=>{const i=n===!0?"hide-column":"show-column";je(ct,this).triggerColumnModification(i,r)}),!je(_s,this)&&this.enabled&&Jo(_s,this,this.hot.columnIndexMapper.createChangesObserver("hiding").subscribe(n=>{n.forEach(r=>{let{op:i,index:o,newValue:s}=r;if(i==="replace"){const a=s===!0?"hide-column":"show-column";je(ct,this).triggerColumnModification(a,o)}}),this.ghostTable.buildWidthsMap()})),this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap(),super.updatePlugin()}disablePlugin(){this.clearColspans(),je(ct,this).clear(),je(_s,this).unsubscribe(),Jo(_s,this,null),this.ghostTable.clear(),super.disablePlugin()}getStateManager(){return je(ct,this)}getLayersCount(){return je(ct,this).getLayersCount()}getHeaderSettings(e,n){return je(ct,this).getHeaderSettings(e,n)}clearColspans(){if(!this.hot.view)return;const{_wt:e}=this.hot.view,n=e.getSetting("columnHeaders").length,r=e.wtTable.THEAD,i=e.wtOverlays.topOverlay.clone.wtTable.THEAD,o=e.wtOverlays.topInlineStartCornerOverlay?e.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null;for(let s=0;s<n;s++){const a=r.childNodes[s];if(!a)break;const l=i.childNodes[s],u=o?o.childNodes[s]:null;for(let c=0,h=a.childNodes.length;c<h;c++)a.childNodes[c].removeAttribute("colspan"),we(a.childNodes[c],"hiddenHeader"),l&&l.childNodes[c]&&(l.childNodes[c].removeAttribute("colspan"),we(l.childNodes[c],"hiddenHeader")),o&&u&&u.childNodes[c]&&(u.childNodes[c].removeAttribute("colspan"),we(u.childNodes[c],"hiddenHeader"))}}headerRendererFactory(e){var n=this;const r=this.hot.view._wt.getSetting("fixedColumnsStart");return(i,o)=>{var s;const{columnIndexMapper:a,view:l}=this.hot;let u=a.getVisualFromRenderableIndex(i);u===null&&(u=i),o.removeAttribute("colspan"),we(o,"hiddenHeader"),we(o,"hiddenHeaderText");const{colspan:c,isHidden:h,isPlaceholder:d,headerClassNames:f}=(s=je(ct,this).getHeaderSettings(e,u))!==null&&s!==void 0?s:{};if(d||h)X(o,"hiddenHeader");else if(c>1){var m,C,y;const{wtOverlays:E}=l._wt,v=(m=E.topInlineStartCornerOverlay)===null||m===void 0?void 0:m.clone.wtTable.THEAD.contains(o),O=(C=E.inlineStartOverlay)===null||C===void 0?void 0:C.clone.wtTable.THEAD.contains(o);((y=E.topOverlay)===null||y===void 0?void 0:y.clone.wtTable.THEAD.contains(o))&&u<r&&X(o,"hiddenHeaderText");const F=v||O?Math.min(c,r-i):c;F>1&&o.setAttribute("colspan",F)}if(this.hot.view.appendColHeader(u,o,function(){return n.getColumnHeaderValue(...arguments)},e),!d&&!h){const E=o.querySelector("div.relative");E&&f&&f.length>0&&(we(E,this.hot.getColumnMeta(u).headerClassName),X(E,f))}}}getColumnHeaderValue(e,n){var r;const{isHidden:i,isPlaceholder:o}=(r=je(ct,this).getHeaderSettings(n,e))!==null&&r!==void 0?r:{};return o||i?"":this.hot.getColHeader(e,n)}destroy(){Jo(ct,this,null),je(_s,this)!==null&&(je(_s,this).unsubscribe(),Jo(_s,this,null)),super.destroy()}_getHeaderTreeNodeDataByCoords(e){if(!(e.row>=0||e.col<0))return je(ct,this).getHeaderTreeNodeData(e.row,e.col)}}function ug(){var t;const e=(t=this.hot)===null||t===void 0?void 0:t.getSelectedRangeLast();if(!e)return;const{highlight:n}=e;if(n.isHeader()&&n.col>=0){const i=je(ct,this).findLeftMostColumnIndex(n.row,n.col),o=this.hot.selection.highlight.getFocus();o.visualCellRange.highlight.col=i,o.visualCellRange.from.col=i,o.visualCellRange.to.col=i,o.commit()}}function use(t,e){var n;const r=this.hot.getSelectedRangeLast();if(!r)return t;const{highlight:i}=r,{navigableHeaders:o}=this.hot.getSettings(),s=this.hot.selection.isSelectedByColumnHeader(),a=o?i.row:(n=je($m,this))===null||n===void 0?void 0:n.row,l=s?t:i.col,u=a<0&&l>=0;if(Jo($m,this,null),!u)return t;const c=this.hot.getFirstFullyVisibleColumn(),h=this.hot.getLastFullyVisibleColumn(),d=h-c+1,f=je(ct,this).findLeftMostColumnIndex(a,l),m=je(ct,this).findRightMostColumnIndex(a,l),C=m-f+1;if(f<c&&m>h)return f;if(s){let y=null;return f>=c&&m>h?C>d?(e.value="start",y=f):(e.value="end",y=m):f<c&&m<=h&&(C>d?(e.value="end",y=m):(e.value="start",y=f)),y}return f<=c?f:m}function cse(t,e,n){const r=je(ct,this).getHeaderTreeNodeData(e,t);if(!r)return t;const{columnCursor:i,selectionType:o,selectionWidth:s}=n,{isRoot:a,colspan:l}=je(ct,this).getHeaderSettings(e,t);if(o===aE){if(!a)return r.columnIndex}else if(o===FD&&(l>s-i||!a))return null;return t}function hse(t,e,n){let{columnHeadersCount:r}=n;if(r!==0)for(let o=0;o<e.length;o++){const{startRow:s,startCol:a,endRow:l,endCol:u}=e[o],c=l-s+1,h=a-u+1;if(s>=0||h===1)break;for(let d=a;d<=u;d++)for(let f=s;f<=l;f++){var i;const m=c+f,C=d-a;if(C===0)continue;((i=je(ct,this).getHeaderTreeNodeData(f,d))===null||i===void 0?void 0:i.isRoot)===!1&&(t[m][C]="")}}}function dse(t,e,n,r){this._getHeaderTreeNodeDataByCoords(e)&&(r.column=!0)}function fse(t,e){const n=this._getHeaderTreeNodeDataByCoords(e);if(!n)return;Jo(Fh,this,e.clone()),Jo($p,this,!0);const{selection:r}=this.hot,i=r.isSelected()?r.getSelectedRange().current():null,o=[],{columnIndex:s,origColspan:a}=n,l=!r.inInSelection(e);t.shiftKey&&i?e.col<i.from.col?o.push(i.getTopEndCorner().col,s,e.row):e.col>i.from.col?o.push(i.getTopStartCorner().col,s+a-1,e.row):o.push(s,s+a-1,e.row):(XR(t)||ll(t)&&l||Jz(t))&&o.push(s,s+a-1,e.row),r.selectColumns(...o)}function gse(t,e,n,r){if(!this.hot.view.isMouseDown()||r.column)return;const i=this._getHeaderTreeNodeDataByCoords(e);if(!i)return;const{columnIndex:o,origColspan:s}=i,a=this.hot.getSelectedRangeLast(),l=a.getTopStartCorner(),u=a.getBottomEndCorner(),{from:c}=a;r.column=!0,r.cell=!0;const h=[],d=qe(e.row,-1/0,-1);e.col<c.col?h.push(u.col,o,d):e.col>c.col?h.push(l.col,o+s-1,d):h.push(o,o+s-1,d),this.hot.selection.selectColumns(...h)}function mse(){Jo($p,this,!1)}function pse(){const{navigableHeaders:t}=this.hot.getSettings();if(!this.hot.view.isMouseDown()||!je($p,this)||!t)return;const e=this.hot.getSelectedRangeLast(),n=e.getTopStartCorner().col,r=e.getBottomEndCorner().col,{columnIndex:i,origColspan:o}=je(ct,this).getHeaderTreeNodeData(je(Fh,this).row,je(Fh,this).col);if(e.setHighlight(je(Fh,this)),o>e.getWidth()||i<n||i+o-1>r){const s=je(ct,this).findTopMostEntireHeaderLevel(qe(n,i,i+o-1),qe(r,i,i+o-1));e.highlight.row=s,e.highlight.col=e.from.col}}function wse(t){const{highlight:e}=this.hot.getSelectedRangeLast(),n=this.hot._createCellCoords(e.row+t.row,e.col+t.col);if(!(n.isHeader()&&n.col>=0))return;const i=je(ct,this).findLeftMostColumnIndex(n.row,n.col),o=je(ct,this).findRightMostColumnIndex(n.row,n.col);if(t.col<0){const s=e.col>=i&&e.col<=o?i-1:o,a=this.hot.columnIndexMapper.getNearestNotHiddenIndex(s,-1);a===null?t.col=-this.hot.view.countRenderableColumnsInRange(0,e.col):t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(a,e.col)-1,1)}else if(t.col>0){const s=e.col>=i&&e.col<=o?o+1:i,a=this.hot.columnIndexMapper.getNearestNotHiddenIndex(s,1);a===null?t.col=this.hot.view.countRenderableColumnsInRange(e.col,this.hot.countCols()):t.col=Math.max(this.hot.view.countRenderableColumnsInRange(e.col,a)-1,1)}}function vse(t,e,n){const r=t.row,i=this._getHeaderTreeNodeDataByCoords({row:r,col:t.col}),o=this._getHeaderTreeNodeDataByCoords({row:r,col:e.col});Jo($m,this,n.clone()),e.col<t.col?(i&&(t.col=i.columnIndex+i.origColspan-1),o&&(e.col=o.columnIndex)):e.col>=t.col&&(i&&(t.col=i.columnIndex),o&&(e.col=o.columnIndex+o.origColspan-1))}function Cse(t){if(je(ct,this).getLayersCount()>0){t.length=0;for(let e=0;e<je(ct,this).getLayersCount();e++)t.push(this.headerRendererFactory(e))}}function yse(t){const e=je(ct,this).getLayersCount();let n=t.startColumn,r=!!e;for(let i=0;i<e;i++){const o=je(ct,this).findLeftMostColumnIndex(i,t.startColumn),s=this.hot.columnIndexMapper.getRenderableFromVisualIndex(o);if(o>=0&&(r=!1),Yn(s)&&s<t.startColumn){n=s;break}}t.startColumn=r?je(ct,this).getHeaderTreeNodeData(0,n).columnIndex:n}function Sse(t,e){const n=this.ghostTable.getWidth(e);return t>n?t:n}function bse(t,e,n){var r;const{label:i}=(r=je(ct,this).getHeaderTreeNodeData(n,e))!==null&&r!==void 0?r:{label:""};return i}function Rse(t,e){if(t<0)return this.hot.getCell(t,je(ct,this).findLeftMostColumnIndex(t,e),!0)}function Ese(){this.updatePlugin()}function Tse(t,e){e||this.updatePlugin()}function sh(t,e,n){return(e=_se(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _se(t){var e=Mse(t,"string");return typeof e=="symbol"?e:e+""}function Mse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Ise{constructor(e,n){sh(this,"hot",void 0),sh(this,"data",null),sh(this,"plugin",void 0),sh(this,"parentReference",new WeakMap),sh(this,"cache",{levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap}),this.hot=n,this.plugin=e}setData(e){this.data=e}getData(){return this.data}getRawSourceData(){let e=null;return this.plugin.disableCoreAPIModifiers(),e=this.hot.getSourceData(),this.plugin.enableCoreAPIModifiers(),e}updateWithData(e){this.setData(e),this.rewriteCache()}rewriteCache(){this.cache={levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap},fe(0,this.data.length-1,e=>{this.cacheNode(this.data[e],0,null)})}cacheNode(e,n,r){this.cache.levels[n]||(this.cache.levels[n]=[],this.cache.levelCount+=1),this.cache.levels[n].push(e),this.cache.rows.push(e),this.cache.nodeInfo.set(e,{parent:r,row:this.cache.rows.length-1,level:n}),this.hasChildren(e)&&H(e.__children,i=>{this.cacheNode(i,n+1,e)})}getDataObject(e){return e==null?null:this.cache.rows[e]}readTreeNodes(e,n,r,i){let o=!1,s=n;if(isNaN(s)&&s.end)return s;let a=e;return a||(a={__children:this.data},o=!0,s-=1),r!=null&&s===r?{result:a,end:!0}:i!=null&&a===i?{result:s,end:!0}:(s+=1,a.__children&&H(a.__children,l=>{if(this.parentReference.set(l,o?null:a),s=this.readTreeNodes(l,s,r,i),isNaN(s)&&s.end)return!1}),s)}mockParent(){const e=this.mockNode();return e.__children=this.data,e}mockNode(){const e={};return ke(this.data[0],(n,r)=>{e[r]=null}),e}getRowIndex(e){return e==null?null:this.cache.nodeInfo.get(e).row}getRowIndexWithinParent(e){let n=null;isNaN(e)?n=e:n=this.getDataObject(e);const r=this.getRowParent(e);return r==null?this.data.indexOf(n):r.__children.indexOf(n)}countAllRows(){const e={__children:this.data};return this.countChildren(e)}countChildren(e){let n=0,r=e;return isNaN(r)||(r=this.getDataObject(r)),!r||!r.__children?0:(H(r.__children,i=>{n+=1,i.__children&&(n+=this.countChildren(i))}),n)}getRowParent(e){let n;return isNaN(e)?n=e:n=this.getDataObject(e),this.getRowObjectParent(n)}getRowObjectParent(e){return!e||typeof e!="object"?null:this.cache.nodeInfo.get(e).parent}getRowLevel(e){let n=null;return isNaN(e)?n=e:n=this.getDataObject(e),n?this.getRowObjectLevel(n):null}getRowObjectLevel(e){return e==null?null:this.cache.nodeInfo.get(e).level}hasChildren(e){let n=e;return isNaN(n)||(n=this.getDataObject(n)),!!(n.__children&&n.__children.length)}isChild(e){return this.getRowParent(e)!==null}getChild(e,n){var r;return((r=e.__children)===null||r===void 0?void 0:r[n])||null}isRowHighestLevel(e){return!this.isChild(e)}isParent(e){var n;let r=e;return isNaN(r)||(r=this.getDataObject(r)),r&&!!r.__children&&((n=r.__children)===null||n===void 0?void 0:n.length)!==0}addChild(e,n){let r=n;this.hot.runHooks("beforeAddChild",e,r);let i=null;e&&(i=this.getRowIndex(e)),this.hot.runHooks("beforeCreateRow",i+this.countChildren(e)+1,1);let o=e;e||(o=this.mockParent()),o.__children||(o.__children=[]),r||(r=this.mockNode()),o.__children.push(r),this.rewriteCache();const s=this.getRowIndex(r);this.hot.rowIndexMapper.insertIndexes(s,1),this.hot.runHooks("afterCreateRow",s,1),this.hot.runHooks("afterAddChild",e,r)}addChildAtIndex(e,n,r){let i=r,o;if(i||(i=this.mockNode()),this.hot.runHooks("beforeAddChild",e,i,n),e){const a=this.getRowIndex(e)+n+1;this.hot.runHooks("beforeCreateRow",a,1),e.__children.splice(n,null,i),this.rewriteCache(),this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(e),"__children",e.__children,"NestedRows.addChildAtIndex"),this.hot.rowIndexMapper.insertIndexes(a,1),this.plugin.enableCoreAPIModifiers(),this.hot.runHooks("afterCreateRow",a,1),o=a}else this.plugin.disableCoreAPIModifiers(),this.hot.alter("insert_row_above",n,1,"NestedRows.addChildAtIndex"),this.plugin.enableCoreAPIModifiers(),o=this.getRowIndex(this.data[n]);i=this.getDataObject(o),this.hot.runHooks("afterAddChild",e,i,n)}addSibling(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"below";const r=this.translateTrimmedRow(e),i=this.getRowParent(r),o=this.getRowIndexWithinParent(r);switch(n){case"below":this.addChildAtIndex(i,o+1,null);break;case"above":this.addChildAtIndex(i,o,null);break}}detachFromParent(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=null;const i=[];Array.isArray(e)?(fe(e[0],e[2],d=>{const f=this.translateTrimmedRow(d);i.push(this.getDataObject(f))}),fe(0,i.length-2,d=>{this.detachFromParent(i[d],!1)}),r=i[i.length-1]):r=e;const o=this.getRowIndex(r),s=this.countChildren(r),a=this.getRowIndexWithinParent(r),l=this.getRowParent(r),u=this.getRowParent(l),c=this.getRowIndex(u);let h=null;if(this.hot.runHooks("beforeDetachChild",l,r),a!=null){const d=Array.from(new Array(o+s+1).keys()).splice(-1*(s+1));if(this.hot.runHooks("beforeRemoveRow",o,s+1,d,this.plugin.pluginName),l.__children.splice(a,1),this.rewriteCache(),this.hot.runHooks("afterRemoveRow",o,s+1,d,this.plugin.pluginName),u){h=c+this.countChildren(u);const f=this.getChild(u,this.countChildren(u)-1),m=this.getRowIndex(f);this.hot.runHooks("beforeCreateRow",m+1,s+1,this.plugin.pluginName),u.__children.push(r)}else h=this.hot.countRows()+1,this.hot.runHooks("beforeCreateRow",h-2,s+1,this.plugin.pluginName),this.data.push(r)}this.rewriteCache(),this.hot.runHooks("afterCreateRow",h-2,s+1,this.plugin.pluginName),this.hot.runHooks("afterDetachChild",l,r,this.getRowIndex(r)),n&&this.hot.render()}filterData(e,n,r){const i=[];H(r,o=>{i.push(this.getDataObject(o))}),H(i,o=>{const s=this.getRowIndexWithinParent(o),a=this.getRowParent(o);a===null?this.data.splice(s,1):a.__children.splice(s,1)}),this.rewriteCache()}spliceData(e,n,r){const i=this.getDataObject(e-1);let o=null,s=e;i&&i.__children&&i.__children.length===0?(o=i,s=0):e<this.countAllRows()&&(o=this.getRowParent(e),s=this.getRowIndexWithinParent(e)),o?r?o.__children.splice(s,n,...r):o.__children.splice(s,n):r?this.data.splice(s,n,...r):this.data.splice(s,n),this.rewriteCache()}syncRowWithRawSource(e){let n=e,r=n;do r=this.getRowParent(r),r!==null&&(n=r);while(r!==null);this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(n),"__children",n.__children,"NestedRows.syncRowWithRawSource"),this.plugin.enableCoreAPIModifiers()}moveRow(e,n,r,i){const o=n===this.hot.countRows(),s=this.getRowParent(e),a=this.getRowIndexWithinParent(e),l=s.__children.slice(a,a+1),u=e>n;let c=o?this.getRowParent(n-1):this.getRowParent(n);c==null&&(c=this.getRowParent(n-1)),c==null&&(c=this.getDataObject(n-1)),c?c.__children||(c.__children=[]):(c=this.getDataObject(n),c.__children=[]);const h=o||r||i?c.__children.length:this.getRowIndexWithinParent(n),d=s===c;c.__children.splice(h,0,l[0]),s.__children.splice(a+(u&&d?1:0),1),this.syncRowWithRawSource(s),d||this.syncRowWithRawSource(c)}translateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.translateTrimmedRow(e):e}untranslateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.untranslateTrimmedRow(e):e}}function JH(t,e,n){return(e=Pse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pse(t){var e=Ose(t,"string");return typeof e=="symbol"?e:e+""}function Ose(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class HT{constructor(e,n){JH(this,"hot",void 0),JH(this,"plugin",void 0),this.hot=n,this.plugin=e}}class oo extends HT{static get CSS_CLASSES(){return{indicatorContainer:"ht_nestingLevels",parent:"ht_nestingParent",indicator:"ht_nestingLevel",emptyIndicator:"ht_nestingLevel_empty",button:"ht_nestingButton",expandButton:"ht_nestingExpand",collapseButton:"ht_nestingCollapse"}}constructor(e,n){super(e,n),this.dataManager=this.plugin.dataManager,this.collapsingUI=this.plugin.collapsingUI,this.rowHeaderWidthCache=null}appendLevelIndicators(e,n){const r=this.hot.toPhysicalRow(e),i=this.dataManager.getRowLevel(r),o=this.dataManager.getDataObject(r),s=n.getElementsByTagName("DIV")[0],a=s.querySelector("span.rowHeader"),l=s.querySelectorAll('[class^="ht_nesting"]'),u=this.hot.getSettings().ariaTags;if(H(l,c=>{c&&s.removeChild(c)}),X(n,oo.CSS_CLASSES.indicatorContainer),i){const{rootDocument:c}=this.hot,h=a.cloneNode(!0);s.innerHTML="",fe(0,i-1,()=>{const d=c.createElement("SPAN");X(d,oo.CSS_CLASSES.emptyIndicator),s.appendChild(d)}),s.appendChild(h)}if(this.dataManager.hasChildren(o)){const c=this.hot.rootDocument.createElement("DIV");u&&Re(c,[bl()]),X(n,oo.CSS_CLASSES.parent),this.collapsingUI.areChildrenCollapsed(r)?(X(c,`${oo.CSS_CLASSES.button} ${oo.CSS_CLASSES.expandButton}`),u&&Re(n,[Xr(!1)])):(X(c,`${oo.CSS_CLASSES.button} ${oo.CSS_CLASSES.collapseButton}`),u&&Re(n,[Xr(!0)])),s.appendChild(c)}}updateRowHeaderWidth(e){let n=e;n||(n=this.dataManager.cache.levelCount);const r=this.hot.view.getStylesHandler();let i=11;r.isClassicTheme()||(i=r.getCSSVariableValue("cell-horizontal-padding")*2),this.rowHeaderWidthCache=Math.max(50,i+10*n+25),this.hot.render()}}class xse extends HT{constructor(e,n){var r;super(e,n),r=this,this.dataManager=this.plugin.dataManager,this.collapsedRows=[],this.collapsedRowsStash={stash:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;r.lastCollapsedRows=r.collapsedRows.slice(0),r.expandMultipleChildren(r.lastCollapsedRows,i)},shiftStash:function(i,o){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;o==null&&(o=1/0),H(r.lastCollapsedRows,(a,l)=>{a>=i&&a<o&&(r.lastCollapsedRows[l]=a+s)})},applyStash:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;r.collapseMultipleChildren(r.lastCollapsedRows,i),r.lastCollapsedRows=void 0},trimStash:(i,o)=>{fe(i,i+o-1,s=>{const a=this.lastCollapsedRows.indexOf(s);a>-1&&this.lastCollapsedRows.splice(a,1)})}}}collapseChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];let o=null,s=null,a=null;return isNaN(e)?(o=e,s=this.dataManager.getRowIndex(o)):(o=this.dataManager.getDataObject(e),s=e),this.dataManager.hasChildren(o)&&H(o.__children,l=>{i.push(this.dataManager.getRowIndex(l))}),a=this.collapseRows(i,!0,!1),r&&this.trimRows(a),n&&this.renderAndAdjust(),this.collapsedRows.indexOf(s)===-1&&this.collapsedRows.push(s),a}collapseMultipleChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];H(e,o=>{i.push(...this.collapseChildren(o,!1,!1))}),r&&this.trimRows(i),n&&this.renderAndAdjust()}collapseRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.collapseRows([e],n)}collapseRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[];return H(e,o=>{i.push(o),n&&this.collapseChildRows(o,i)}),r&&this.trimRows(i),i}collapseChildRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this.dataManager.hasChildren(e)){const i=this.dataManager.getDataObject(e);H(i.__children,o=>{const s=this.dataManager.getRowIndex(o);n.push(s),this.collapseChildRows(s,n)})}r&&this.trimRows(n)}expandRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.expandRows([e],n)}expandRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[];return H(e,o=>{i.push(o),n&&this.expandChildRows(o,i)}),r&&this.untrimRows(i),i}expandChildRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this.dataManager.hasChildren(e)){const i=this.dataManager.getDataObject(e);H(i.__children,o=>{if(!this.isAnyParentCollapsed(o)){const s=this.dataManager.getRowIndex(o);n.push(s),this.expandChildRows(s,n)}})}r&&this.untrimRows(n)}expandChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];let o=null,s=null,a=null;return isNaN(e)?(o=e,s=this.dataManager.getRowIndex(e)):(o=this.dataManager.getDataObject(e),s=e),this.collapsedRows.splice(this.collapsedRows.indexOf(s),1),this.dataManager.hasChildren(o)&&H(o.__children,l=>{const u=this.dataManager.getRowIndex(l);i.push(u)}),a=this.expandRows(i,!0,!1),r&&this.untrimRows(a),n&&this.renderAndAdjust(),a}expandMultipleChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];H(e,o=>{i.push(...this.expandChildren(o,!1,!1))}),r&&this.untrimRows(i),n&&this.renderAndAdjust()}collapseAll(){const e=this.dataManager.getData(),n=[];H(e,r=>{this.dataManager.hasChildren(r)&&n.push(r)}),this.collapseMultipleChildren(n),this.renderAndAdjust()}expandAll(){const e=this.dataManager.getData(),n=[];H(e,r=>{this.dataManager.hasChildren(r)&&n.push(r)}),this.expandMultipleChildren(n),this.renderAndAdjust()}trimRows(e){this.hot.batchExecution(()=>{H(e,n=>{this.plugin.collapsedRowsMap.setValueAtIndex(n,!0)})},!0)}untrimRows(e){this.hot.batchExecution(()=>{H(e,n=>{this.plugin.collapsedRowsMap.setValueAtIndex(n,!1)})},!0)}areChildrenCollapsed(e){let n=isNaN(e)?e:this.dataManager.getDataObject(e),r=!0;return n===null&&(n={__children:this.dataManager.data}),this.dataManager.hasChildren(n)&&H(n.__children,i=>{const o=this.dataManager.getRowIndex(i);if(!this.plugin.collapsedRowsMap.getValueAtIndex(o))return r=!1,!1}),r}isAnyParentCollapsed(e){let n=e;for(;n!==null;){n=this.dataManager.getRowParent(n);const r=this.dataManager.getRowIndex(n);if(this.collapsedRows.indexOf(r)>-1)return!0}return!1}toggleState(e,n){if(n.col>=0)return;const r=this.translateTrimmedRow(n.row);ye(e.target,oo.CSS_CLASSES.button)&&(this.areChildrenCollapsed(r)?this.expandChildren(r):this.collapseChildren(r),Pi(e))}translateTrimmedRow(e){return this.hot.toPhysicalRow(e)}untranslateTrimmedRow(e){return this.hot.toVisualRow(e)}renderAndAdjust(){this.hot.render(),this.hot.view.adjustElementsSize()}}function Ase(t,e,n){Hse(t,e),e.set(t,n)}function Hse(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Nse(t,e,n){return(e=Dse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dse(t){var e=kse(t,"string");return typeof e=="symbol"?e:e+""}function kse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Lse(t,e){return t.get($se(t,e))}function $se(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var QH=new WeakMap;class Fse extends HT{constructor(){super(...arguments),Nse(this,"dataManager",this.plugin.dataManager),Ase(this,QH,{row_above:(e,n)=>{const r=n[n.length-1];this.dataManager.addSibling(r.start.row,"above")},row_below:(e,n)=>{const r=n[n.length-1];this.dataManager.addSibling(r.start.row,"below")}})}appendOptions(e){const n=[{key:"add_child",name(){return this.getTranslatedPhrase(a0)},callback:()=>{const r=this.dataManager.translateTrimmedRow(this.hot.getSelectedLast()[0]),i=this.dataManager.getDataObject(r);this.dataManager.addChild(i)},disabled:()=>{const r=this.hot.getSelectedLast();return!r||r[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{key:"detach_from_parent",name(){return this.getTranslatedPhrase(l0)},callback:()=>{this.dataManager.detachFromParent(this.hot.getSelectedLast())},disabled:()=>{const r=this.hot.getSelectedLast(),i=this.dataManager.translateTrimmedRow(r[0]);return!this.dataManager.getRowParent(i)||!r||r[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{name:"---------"}];return fe(0,e.items.length-1,r=>{if(r===0)return H(n,(i,o)=>{e.items.splice(r+o,0,i)}),!1}),this.modifyRowInsertingOptions(e)}modifyRowInsertingOptions(e){return fe(0,e.items.length-1,n=>{const r=Lse(QH,this)[e.items[n].key];r!=null&&(e.items[n].callback=r)}),e}}function cg(t,e,n){return(e=Vse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vse(t){var e=Wse(t,"string");return typeof e=="symbol"?e:e+""}function Wse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Bse{constructor(e){cg(this,"plugin",void 0),cg(this,"hot",void 0),cg(this,"dataManager",void 0),cg(this,"collapsingUI",void 0),this.plugin=e,this.hot=e.hot,this.dataManager=e.dataManager,this.collapsingUI=e.collapsingUI}onBeforeRowMove(e,n,r,i){if(this.displayAPICompatibilityWarning({rows:e,finalIndex:n,dropIndex:r,movePossible:i}))return!1;this.movedToCollapsed=!1;const s=r===this.hot.countRows(),a=s?this.hot.countSourceRows():this.dataManager.translateTrimmedRow(r);let l=!0;const u=e.map(m=>{if(!l)return!1;const C=this.dataManager.translateTrimmedRow(m);return l=this.shouldAllowMoving(C,a),C}),c=u.indexOf(a)===-1;if(!l||!c)return!1;const h=this.getBaseParent(u),d=this.getTargetParent(s,a),f=h===d;return this.movedToCollapsed=this.collapsingUI.areChildrenCollapsed(d),this.collapsingUI.collapsedRowsStash.stash(),this.shiftCollapsibleParentsLocations(u,a,f),this.moveRows(u,a,d),this.dataManager.rewriteCache(),this.moveCellsMeta(u,a),this.collapsingUI.collapsedRowsStash.applyStash(!1),this.hot.runHooks("afterRowMove",e,n,r,i,i&&this.isRowOrderChanged(e,n)),this.hot.render(),this.selectCells(e,r),!1}displayAPICompatibilityWarning(e){const{rows:n,finalIndex:r,dropIndex:i,movePossible:o}=e;let s=!1;return xt(i)&&(tt(st`Since version 8.0.0 of the Handsontable the 'moveRows' method isn't used for moving rows\x20
296
- when the NestedRows plugin is enabled. Please use the 'dragRows' method instead.`),this.hot.runHooks("afterRowMove",n,r,i,o,!1),s=!0),s}shouldAllowMoving(e,n){return!(this.dataManager.isParent(e)||this.dataManager.isRowHighestLevel(e)||e===n||n===0)}getBaseParent(e){return this.dataManager.getRowParent(e[0])}getTargetParent(e,n){let r=this.dataManager.getRowParent(e?n-1:n);return r==null&&(r=this.dataManager.getRowParent(n-1)),r}shiftCollapsibleParentsLocations(e,n,r){r||(Math.max(...e)<=n?this.collapsingUI.collapsedRowsStash.shiftStash(e[0],n,-1*e.length):this.collapsingUI.collapsedRowsStash.shiftStash(n,e[0],e.length))}moveRows(e,n,r){const i=n===this.dataManager.getRowIndex(r)+this.dataManager.countChildren(r)+1;this.hot.batchRender(()=>{e.forEach(o=>{this.dataManager.moveRow(o,n,this.movedToCollapsed,i)})})}moveCellsMeta(e,n){const r=[],i=Math.max(...e)<n;e.forEach(o=>{r.push(this.hot.getCellMetaAtRow(o))}),this.hot.spliceCellsMeta(e[0],e.length),this.hot.spliceCellsMeta(n-(i?r.length:0),0,...r)}selectCells(e,n){const r=e.length;let i=0,o=0;if(this.movedToCollapsed){let s=null;e[r-1]<n?s=this.dataManager.translateTrimmedRow(n-r):s=this.dataManager.translateTrimmedRow(n);const a=this.dataManager.getRowParent(s===null?this.hot.countSourceRows()-1:s-1),l=this.dataManager.getRowIndex(a);i=this.dataManager.untranslateTrimmedRow(l),o=i}else e[r-1]<n?(o=n-1,i=o-r+1):(i=n,o=i+r-1);this.hot.selectCells([[i,0,o,this.hot.countCols()-1]],!1)}isRowOrderChanged(e,n){return e.some((r,i)=>r-i!==n)}}function jse(t,e){G$(t,e),e.add(t)}function e1(t,e,n){G$(t,e),e.set(t,n)}function G$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function FS(t,e,n){return(e=Use(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Use(t){var e=zse(t,"string");return typeof e=="symbol"?e:e+""}function zse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jg(t,e){return t.get(gn(t,e))}function Fm(t,e,n){return t.set(gn(t,e),n),n}function gn(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Vm="nestedRows",Yse=300,t1=Vm,Gse="The Nested Rows plugin requires an Array of Objects as a dataset to be provided. The plugin has been disabled.";var Fp=new WeakMap,lu=new WeakMap,vn=new WeakSet;class qse extends et{constructor(){super(...arguments),jse(this,vn),FS(this,"dataManager",null),FS(this,"headersUI",null),FS(this,"collapsedRowsMap",null),e1(this,Fp,!1),e1(this,lu,!1)}static get PLUGIN_KEY(){return Vm}static get PLUGIN_PRIORITY(){return Yse}isEnabled(){return!!this.hot.getSettings()[Vm]}enablePlugin(){var e=this;this.enabled||(this.collapsedRowsMap=this.hot.rowIndexMapper.registerMap("nestedRows",new Td),this.dataManager=new Ise(this,this.hot),this.collapsingUI=new xse(this,this.hot),this.headersUI=new oo(this,this.hot),this.contextMenuUI=new Fse(this,this.hot),this.rowMoveController=new Bse(this),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return gn(vn,e,lae).call(e,...r)}),this.addHook("beforeViewRender",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return gn(vn,e,uae).call(e,...r)}),this.addHook("modifyRowData",function(){return e.onModifyRowData(...arguments)}),this.addHook("modifySourceLength",function(){return e.onModifySourceLength(...arguments)}),this.addHook("beforeDataSplice",function(){return e.onBeforeDataSplice(...arguments)}),this.addHook("filterData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return gn(vn,e,Zse).call(e,...r)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return gn(vn,e,Jse).call(e,...r)}),this.addHook("afterGetRowHeader",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return gn(vn,e,Qse).call(e,...r)}),this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return gn(vn,e,Xse).call(e,...r)}),this.addHook("beforeRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return gn(vn,e,nae).call(e,...r)}),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return gn(vn,e,tae).call(e,...r)}),this.addHook("beforeAddChild",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return gn(vn,e,rae).call(e,...r)}),this.addHook("afterAddChild",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return gn(vn,e,iae).call(e,...r)}),this.addHook("beforeDetachChild",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return gn(vn,e,oae).call(e,...r)}),this.addHook("afterDetachChild",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return gn(vn,e,sae).call(e,...r)}),this.addHook("modifyRowHeaderWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return gn(vn,e,eae).call(e,...r)}),this.addHook("afterCreateRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return gn(vn,e,aae).call(e,...r)}),this.addHook("beforeRowMove",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return gn(vn,e,Kse).call(e,...r)}),this.addHook("beforeLoadData",n=>gn(vn,this,n1).call(this,n)),this.addHook("beforeUpdateData",n=>gn(vn,this,n1).call(this,n)),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("nestedRows"),this.unregisterShortcuts(),super.disablePlugin()}updatePlugin(){this.disablePlugin();const e=this.dataManager.getData();this.enablePlugin(),this.dataManager.updateWithData(e),super.updatePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast(),n=this.collapsingUI.translateTrimmedRow(e.row);return this.collapsingUI.areChildrenCollapsed(n)?this.collapsingUI.expandChildren(n):this.collapsingUI.collapseChildren(n),!1},runOnlyIf:()=>{var e,n;const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r&&((n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingle())&&this.hot.selection.isCellVisible(r)&&r.col===-1&&r.row>=0},group:t1,relativeToGroup:ta,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(t1)}disableCoreAPIModifiers(){Fm(lu,this,!0)}enableCoreAPIModifiers(){Fm(lu,this,!1)}onModifyRowData(e){if(!jg(lu,this))return this.dataManager.getDataObject(e)}onModifySourceLength(){if(!jg(lu,this))return this.dataManager.countAllRows()}onBeforeDataSplice(e,n,r){return jg(lu,this)||this.dataManager.isRowHighestLevel(e)?!0:(this.dataManager.spliceData(e,n,r),!1)}destroy(){super.destroy()}}function Kse(t,e,n,r){return this.rowMoveController.onBeforeRowMove(t,e,n,r)}function Xse(t,e,n){this.collapsingUI.toggleState(t,e,n)}function Zse(t,e,n){return this.collapsingUI.collapsedRowsStash.stash(),this.collapsingUI.collapsedRowsStash.trimStash(n[0],e),this.collapsingUI.collapsedRowsStash.shiftStash(n[0],null,-1*e),this.dataManager.filterData(t,e,n),Fm(Fp,this,!0),this.dataManager.getData().slice()}function Jse(t){return this.contextMenuUI.appendOptions(t)}function Qse(t,e){this.headersUI.appendLevelIndicators(t,e)}function eae(t){return Math.max(this.headersUI.rowHeaderWidthCache,t)}function tae(t,e,n,r){r!==this.pluginName&&this.hot._registerTimeout(()=>{Fm(Fp,this,!1),this.headersUI.updateRowHeaderWidth(),this.collapsingUI.collapsedRowsStash.applyStash()})}function nae(t,e,n){const r=Array.from(n.reduce((i,o)=>{if(this.dataManager.isParent(o)){const s=this.dataManager.getDataObject(o).__children;return i.add(o),Array.isArray(s)&&s.forEach(a=>i.add(this.dataManager.getRowIndex(a))),i}return i.add(o)},new Set));n.length=0,n.push(...r)}function rae(){this.collapsingUI.collapsedRowsStash.stash()}function iae(t,e){this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(e)),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function oae(){this.collapsingUI.collapsedRowsStash.stash()}function sae(t,e,n){this.collapsingUI.collapsedRowsStash.shiftStash(n,null,-1),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function aae(){this.dataManager.rewriteCache()}function lae(){this.headersUI.updateRowHeaderWidth()}function uae(t,e){jg(Fp,this)&&(e.skipRender=!0)}function n1(t){if(!dK(t)){ZR(Gse),this.hot.getSettings()[Vm]=!1,this.disablePlugin();return}this.dataManager.setData(t),this.dataManager.rewriteCache()}function VS(t,e,n){return(e=cae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cae(t){var e=hae(t,"string");return typeof e=="symbol"?e:e+""}function hae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class dae{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;VS(this,"rootWindow",void 0),VS(this,"prefix",void 0),VS(this,"savedKeys",[]),this.rootWindow=n,this.prefix=e,this.loadSavedKeys()}saveValue(e,n){this.rootWindow.localStorage.setItem(`${this.prefix}_${e}`,JSON.stringify(n)),this.savedKeys.indexOf(e)===-1&&(this.savedKeys.push(e),this.saveSavedKeys())}loadValue(e,n){const r=typeof e>"u"?n:e,i=this.rootWindow.localStorage.getItem(`${this.prefix}_${r}`);return i===null?void 0:JSON.parse(i)}reset(e){this.rootWindow.localStorage.removeItem(`${this.prefix}_${e}`)}resetAll(){H(this.savedKeys,(e,n)=>{this.rootWindow.localStorage.removeItem(`${this.prefix}_${this.savedKeys[n]}`)}),this.clearSavedKeys()}loadSavedKeys(){const e=this.rootWindow.localStorage.getItem(`${this.prefix}__persistentStateKeys`),n=typeof e=="string"?JSON.parse(e):void 0;this.savedKeys=n||[]}saveSavedKeys(){this.rootWindow.localStorage.setItem(`${this.prefix}__persistentStateKeys`,JSON.stringify(this.savedKeys))}clearSavedKeys(){this.savedKeys.length=0,this.saveSavedKeys()}}function fae(t,e,n){return(e=gae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gae(t){var e=mae(t,"string");return typeof e=="symbol"?e:e+""}function mae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}ie.getSingleton().register("persistentStateSave");ie.getSingleton().register("persistentStateLoad");ie.getSingleton().register("persistentStateReset");const r1="persistentState",pae=0;class wae extends et{constructor(){super(...arguments),fae(this,"storage",void 0)}static get PLUGIN_KEY(){return r1}static get PLUGIN_PRIORITY(){return pae}isEnabled(){return!!this.hot.getSettings()[r1]}enablePlugin(){this.enabled||(this.storage||(this.storage=new dae(this.hot.rootElement.id,this.hot.rootWindow)),this.addHook("persistentStateSave",(e,n)=>this.saveValue(e,n)),this.addHook("persistentStateLoad",(e,n)=>this.loadValue(e,n)),this.addHook("persistentStateReset",()=>this.resetValue()),super.enablePlugin())}disablePlugin(){this.storage=void 0,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}loadValue(e,n){n.value=this.storage.loadValue(e)}saveValue(e,n){this.storage.saveValue(e,n)}resetValue(e){typeof e>"u"?this.storage.resetAll():this.storage.reset(e)}destroy(){super.destroy()}}function vae(t,e){Cae(t,e),e.add(t)}function Cae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function WS(t,e,n){return(e=yae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yae(t){var e=Sae(t,"string");return typeof e=="symbol"?e:e+""}function Sae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function i1(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const BS="search",bae=190,Rae="htSearchResult",Eae=function(t,e,n,r,i){t.getCellMeta(e,n).isSearchResult=i},Tae=function(t,e,n){return xt(t)||t===null||!t.toLocaleLowerCase||t.length===0||xt(e)||e===null?!1:e.toString().toLocaleLowerCase(n.locale).indexOf(t.toLocaleLowerCase(n.locale))!==-1};var jS=new WeakSet;class _ae extends et{constructor(){super(...arguments),vae(this,jS),WS(this,"callback",Eae),WS(this,"queryMethod",Tae),WS(this,"searchResultClass",Rae)}static get PLUGIN_KEY(){return BS}static get PLUGIN_PRIORITY(){return bae}isEnabled(){return this.hot.getSettings()[BS]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[BS];this.updatePluginSettings(n),this.addHook("beforeRenderer",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i1(jS,e,o1).call(e,...i)}),super.enablePlugin()}disablePlugin(){var e=this;const n=function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i1(jS,e,o1).call(e,...i)};this.hot.addHook("beforeRenderer",n),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("beforeRenderer",n)}),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}query(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getCallback(),r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.getQueryMethod();const i=this.hot.countRows(),o=this.hot.countCols(),s=[],a=this.hot;return fe(0,i-1,l=>{fe(0,o-1,u=>{const c=this.hot.getDataAtCell(l,u),h=this.hot.getCellMeta(l,u),d=h.search.callback||n,m=(h.search.queryMethod||r)(e,c,h);if(m){const C={row:l,col:u,data:c};s.push(C)}d&&d(a,l,u,c,m)})}),s}getCallback(){return this.callback}setCallback(e){this.callback=e}getQueryMethod(){return this.queryMethod}setQueryMethod(e){this.queryMethod=e}getSearchResultClass(){return this.searchResultClass}setSearchResultClass(e){this.searchResultClass=e}updatePluginSettings(e){De(e)&&(e.searchResultClass&&this.setSearchResultClass(e.searchResultClass),e.queryMethod&&this.setQueryMethod(e.queryMethod),e.callback&&this.setCallback(e.callback))}destroy(){super.destroy()}}function o1(t,e,n,r,i,o){const s=o.className||[];let a=[];typeof s=="string"?a=s.split(" "):a.push(...s),this.isEnabled()&&o.isSearchResult?a.includes(this.searchResultClass)||a.push(`${this.searchResultClass}`):a.includes(this.searchResultClass)&&a.splice(a.indexOf(this.searchResultClass),1),o.className=a.join(" ")}function hg(t,e,n){return(e=Mae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Mae(t){var e=Iae(t,"string");return typeof e=="symbol"?e:e+""}function Iae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class q${constructor(e){hg(this,"viewportWidth",void 0),hg(this,"overwriteColumnWidthFn",void 0),hg(this,"baseWidths",new Map),hg(this,"stretchedWidths",new Map),this.overwriteColumnWidthFn=e}prepare(e){let{viewportWidth:n}=e;this.viewportWidth=n,this.baseWidths.clear(),this.stretchedWidths.clear()}setColumnBaseWidth(e,n){this.baseWidths.set(e,n)}calculate(){}getWidths(){return Array.from(this.stretchedWidths)}}class Pae extends q${calculate(){const e=Array.from(this.baseWidths).reduce((h,d)=>{let[,f]=d;return h+f},0);if(this.viewportWidth-e<0){this.stretchedWidths.clear();return}const r=this.viewportWidth/e,i=[],o=[];let s=this.viewportWidth,a=0;if(this.baseWidths.forEach((h,d)=>{const f=Math.round(h*r),m=this.overwriteColumnWidthFn(f,d);f===m&&f>=ku?(i.push([d,m]),a+=m):f!==m&&(i.push([d,m]),o.push(d),s-=m)}),s<=ku){this.stretchedWidths.clear();return}const l=s/a;let u=-1,c=0;i.forEach((h,d)=>{let[f,m]=h,C=m;o.includes(f)||(C=Math.round(m*l)),this.stretchedWidths.set(f,C),u=f,d<i.length-1&&(c+=C)}),this.stretchedWidths.size>1&&this.stretchedWidths.set(u,Math.round(this.viewportWidth-c))}}function s1(t,e,n){Oae(t,e),e.set(t,n)}function Oae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function US(t,e){return t.get(K$(t,e))}function dg(t,e,n){return t.set(K$(t,e),n),n}function K$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var fg=new WeakMap,ah=new WeakMap;class xae extends q${constructor(){super(...arguments),s1(this,fg,0),s1(this,ah,-1)}prepare(e){super.prepare(e),dg(fg,this,0),dg(ah,this,-1)}setColumnBaseWidth(e,n){super.setColumnBaseWidth(e,n),dg(ah,this,e),dg(fg,this,n)}calculate(){if(US(ah,this)===-1)return;const e=Array.from(this.baseWidths).reduce((r,i)=>{let[,o]=i;return r+o},0),n=Math.max(this.viewportWidth-e+US(fg,this),0);this.stretchedWidths.set(US(ah,this),n)}}function Aae(t,e){X$(t,e),e.add(t)}function gg(t,e,n){X$(t,e),e.set(t,n)}function X$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Bt(t,e){return t.get(Tu(t,e))}function zS(t,e,n){return t.set(Tu(t,e),n),n}function Tu(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Hae="stretchColumns";var An=new WeakMap,uu=new WeakMap,YS=new WeakMap,mg=new WeakMap,lh=new WeakSet;class Nae{constructor(e){Aae(this,lh),gg(this,An,void 0),gg(this,uu,void 0),gg(this,YS,new Map([["all",new Pae(Tu(lh,this,a1).bind(this))],["last",new xae(Tu(lh,this,a1).bind(this))]])),gg(this,mg,"none"),zS(An,this,e),zS(uu,this,Bt(An,this).columnIndexMapper.createAndRegisterIndexMap(Hae,"physicalIndexToValue"))}useStrategy(e){zS(mg,this,Bt(YS,this).has(e)?e:"none")}refreshStretching(){if(Bt(mg,this)==="none"){Bt(uu,this).clear();return}Bt(An,this).batchExecution(()=>{Bt(uu,this).clear();const e=Bt(YS,this).get(Bt(mg,this));let r=Bt(An,this).view.getViewportWidth();Tu(lh,this,Dae).call(this)&&(r-=yn(Bt(An,this).rootDocument)),e.prepare({viewportWidth:r});for(let i=0;i<Bt(An,this).countCols();i++)Bt(An,this).columnIndexMapper.isHidden(Bt(An,this).toPhysicalColumn(i))||e.setColumnBaseWidth(i,Tu(lh,this,kae).call(this,i));e.calculate(),e.getWidths().forEach(i=>{let[o,s]=i;Bt(uu,this).setValueAtIndex(Bt(An,this).toPhysicalColumn(o),s)})},!0)}getStretchedWidth(e){return Bt(uu,this).getValueAtIndex(Bt(An,this).toPhysicalColumn(e))}}function Dae(){const{view:t}=Bt(An,this);if(t.isVerticallyScrollableByWindow())return!1;const e=t.getViewportHeight(),n=Bt(An,this).countRows(),r=t.getStylesHandler().getDefaultRowHeight();let i=0,o=!1;for(let a=0;a<n;a++){var s;if(i+=((s=Bt(An,this).getRowHeight(a))!==null&&s!==void 0?s:r)+(a===0?1:0),i>e){o=!0;break}}return o}function kae(t){var e;return(e=Bt(An,this).getColWidth(t,"StretchColumns"))!==null&&e!==void 0?e:ku}function a1(t,e){return Bt(An,this).runHooks("beforeStretchingColumnWidth",t,e)}function Lae(t,e){Z$(t,e),e.add(t)}function GS(t,e,n){Z$(t,e),e.set(t,n)}function Z$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qS(t,e,n){return t.set(Wm(t,e),n),n}function $o(t,e){return t.get(Wm(t,e))}function Wm(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const $ae="stretchColumns",Fae=155;var Cu=new WeakMap,pg=new WeakMap,uh=new WeakMap,KS=new WeakSet;class Vae extends et{constructor(){super(...arguments),Lae(this,KS),GS(this,Cu,new Nae(this.hot)),GS(this,pg,null),GS(this,uh,new ResizeObserver(e=>{requestAnimationFrame(()=>{var n;(n=this.hot)!==null&&n!==void 0&&n.view.isHorizontallyScrollableByWindow()&&e.forEach(r=>{let{contentRect:i}=r;$o(pg,this)!==null&&$o(pg,this)!==i.width&&(this.hot.refreshDimensions(),this.hot.view.adjustElementsSize()),qS(pg,this,i.width)})})}))}static get PLUGIN_KEY(){return $ae}static get PLUGIN_PRIORITY(){return Fae}static get SETTING_KEYS(){return!0}isEnabled(){return["all","last"].includes(this.hot.getSettings().stretchH)}enablePlugin(){var e=this;this.enabled||($o(Cu,this).useStrategy(this.hot.getSettings().stretchH),$o(uh,this).observe(this.hot.rootElement),this.addHook("beforeRender",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Wm(KS,e,Bae).call(e,...r)}),this.addHook("modifyColWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Wm(KS,e,Wae).call(e,...r)},10),super.enablePlugin())}updatePlugin(){$o(Cu,this).useStrategy(this.hot.getSettings().stretchH),super.updatePlugin()}disablePlugin(){super.disablePlugin(),$o(uh,this).unobserve(this.hot.rootElement)}getColumnWidth(e){return $o(Cu,this).getStretchedWidth(e)}destroy(){$o(uh,this).disconnect(),qS(uh,this,null),qS(Cu,this,null),super.destroy()}}function Wae(t,e,n){if(n===this.pluginName)return;const r=this.getColumnWidth(e);return typeof r=="number"?r:t}function Bae(t){t&&$o(Cu,this).refreshStretching()}function jae(t,e){Uae(t,e),e.add(t)}function Uae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wg(t,e,n){return(e=zae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zae(t){var e=Yae(t,"string");return typeof e=="symbol"?e:e+""}function Yae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function XS(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Gae="touchScroll",qae=200;var vg=new WeakSet;class Kae extends et{constructor(){super(...arguments),jae(this,vg),wg(this,"scrollbars",[]),wg(this,"clones",[]),wg(this,"lockedCollection",!1),wg(this,"freezeOverlays",!1)}static get PLUGIN_KEY(){return Gae}static get PLUGIN_PRIORITY(){return qae}static get SETTING_KEYS(){return!0}isEnabled(){return hD()}enablePlugin(){this.enabled||(this.addHook("afterViewRender",()=>XS(vg,this,Xae).call(this)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.lockedCollection=!1,super.updatePlugin()}disablePlugin(){super.disablePlugin()}registerEvents(){this.addHook("beforeTouchScroll",()=>XS(vg,this,Zae).call(this)),this.addHook("afterMomentumScroll",()=>XS(vg,this,Jae).call(this))}}function Xae(){if(this.lockedCollection)return;const{topOverlay:t,bottomOverlay:e,inlineStartOverlay:n,topInlineStartCornerOverlay:r,bottomInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;this.lockedCollection=!0,this.scrollbars.length=0,this.scrollbars.push(t),e.clone&&this.scrollbars.push(e),this.scrollbars.push(n),r&&this.scrollbars.push(r),i&&i.clone&&this.scrollbars.push(i),this.clones=[],t.needFullRender&&this.clones.push(t.clone.wtTable.holder.parentNode),e.needFullRender&&this.clones.push(e.clone.wtTable.holder.parentNode),n.needFullRender&&this.clones.push(n.clone.wtTable.holder.parentNode),r&&this.clones.push(r.clone.wtTable.holder.parentNode),i&&i.clone&&this.clones.push(i.clone.wtTable.holder.parentNode)}function Zae(){this.freezeOverlays=!0,H(this.clones,t=>{X(t,"hide-tween")})}function Jae(){this.freezeOverlays=!1,H(this.clones,t=>{we(t,"hide-tween"),X(t,"show-tween")}),this.hot._registerTimeout(()=>{H(this.clones,t=>{we(t,"show-tween")})},400),H(this.scrollbars,t=>{t.refresh(),t.resetFixedPosition()}),this.hot.view._wt.wtOverlays.syncScrollWithMaster()}function Qae(t,e){ele(t,e),e.add(t)}function ele(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function tle(t,e,n){return(e=nle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nle(t){var e=rle(t,"string");return typeof e=="symbol"?e:e+""}function rle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ile(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Ug="trimRows",ole=330;var l1=new WeakSet;class sle extends et{constructor(){super(...arguments),Qae(this,l1),tle(this,"trimmedRowsMap",null)}static get PLUGIN_KEY(){return Ug}static get PLUGIN_PRIORITY(){return ole}isEnabled(){return!!this.hot.getSettings()[Ug]}enablePlugin(){this.enabled||(this.trimmedRowsMap=this.hot.rowIndexMapper.registerMap("trimRows",new Td),this.trimmedRowsMap.addLocalHook("init",()=>ile(l1,this,ale).call(this)),super.enablePlugin())}updatePlugin(){const e=this.hot.getSettings()[Ug];Array.isArray(e)&&this.hot.batchExecution(()=>{this.trimmedRowsMap.clear(),H(e,n=>{this.trimmedRowsMap.setValueAtIndex(n,!0)})},!0),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("trimRows"),super.disablePlugin()}getTrimmedRows(){return this.trimmedRowsMap.getTrimmedIndexes()}trimRows(e){const n=this.getTrimmedRows(),r=this.isValidConfig(e);let i=n;r&&(i=Array.from(new Set(n.concat(e)))),this.hot.runHooks("beforeTrimRow",n,i,r)!==!1&&(r&&this.hot.batchExecution(()=>{H(e,s=>{this.trimmedRowsMap.setValueAtIndex(s,!0)})},!0),this.hot.runHooks("afterTrimRow",n,i,r,r&&i.length>n.length))}trimRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.trimRows(n)}untrimRows(e){const n=this.getTrimmedRows(),r=this.isValidConfig(e);let i=n;const o=this.trimmedRowsMap.getValues().slice(),s=e.length>0;r&&s&&(H(e,l=>{o[l]=!1}),i=wr(o,(l,u,c)=>(u&&l.push(c),l),[])),this.hot.runHooks("beforeUntrimRow",n,i,r&&s)!==!1&&(r&&s&&this.trimmedRowsMap.setValues(o),this.hot.runHooks("afterUntrimRow",n,i,r&&s,r&&i.length<n.length))}untrimRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.untrimRows(n)}isTrimmed(e){return this.trimmedRowsMap.getValueAtIndex(e)||!1}untrimAll(){this.untrimRows(this.getTrimmedRows())}isValidConfig(e){const n=this.hot.countSourceRows();return e.every(r=>Number.isInteger(r)&&r>=0&&r<n)}destroy(){super.destroy()}}function ale(){const t=this.hot.getSettings()[Ug];Array.isArray(t)&&this.hot.batchExecution(()=>{H(t,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0)}function lle(t,e,n){return(e=ule(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ule(t){var e=cle(t,"string");return typeof e=="symbol"?e:e+""}function cle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ti{constructor(e){lle(this,"actionType",""),this.actionType=e}undo(){throw new Error("Not implemented")}redo(){throw new Error("Not implemented")}}function Cg(t,e,n){return(e=hle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hle(t){var e=dle(t,"string");return typeof e=="symbol"?e:e+""}function dle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class NT extends ti{constructor(e){let{stateBefore:n,range:r,type:i,alignment:o}=e;super("cell_alignment"),Cg(this,"stateBefore",void 0),Cg(this,"range",void 0),Cg(this,"type",void 0),Cg(this,"alignment",void 0),this.stateBefore=n,this.range=r,this.type=i,this.alignment=o}static startRegisteringEvents(e,n){e.addHook("beforeCellAlignment",(r,i,o,s)=>{n.done(()=>new NT({stateBefore:r,range:i,type:o,alignment:s}))})}undo(e,n){H(this.range,r=>{r.forAll((i,o)=>{i>=0&&o>=0&&e.setCellMeta(i,o,"className",this.stateBefore[i][o]||" htLeft")})}),e.addHookOnce("afterViewRender",n),e.render()}redo(e,n){Is(this.range,this.type,this.alignment,(r,i)=>e.getCellMeta(r,i),(r,i,o,s)=>e.setCellMeta(r,i,o,s)),e.addHookOnce("afterViewRender",n),e.render()}}function u1(t,e,n){return(e=fle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fle(t){var e=gle(t,"string");return typeof e=="symbol"?e:e+""}function gle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class DT extends ti{constructor(e){let{columns:n,finalIndex:r}=e;super("col_move"),u1(this,"columns",void 0),u1(this,"finalColumnIndex",void 0),this.columns=n.slice(),this.finalColumnIndex=r}static startRegisteringEvents(e,n){e.addHook("beforeColumnMove",(r,i)=>{r!==!1&&n.done(()=>new DT({columns:r,finalIndex:i}))})}undo(e,n){const r=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",n),PT(this.columns,this.finalColumnIndex,e.columnIndexMapper.getNumberOfIndexes()).reverse().forEach(o=>{let{from:s,to:a}=o;s<a&&(a-=1),r.moveColumn(a,s)}),e.render(),e.deselectCell(),e.selectColumns(this.columns[0],this.columns[0]+this.columns.length-1)}redo(e,n){const r=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",n),r.moveColumns(this.columns.slice(),this.finalColumnIndex),e.render(),e.deselectCell(),e.selectColumns(this.finalColumnIndex,this.finalColumnIndex+this.columns.length-1)}}function c1(t,e,n){return(e=mle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mle(t){var e=ple(t,"string");return typeof e=="symbol"?e:e+""}function ple(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class kT extends ti{constructor(e){let{currentSortState:n,newSortState:r}=e;super("col_sort"),c1(this,"previousSortState",void 0),c1(this,"nextSortState",void 0),this.previousSortState=n,this.nextSortState=r}static startRegisteringEvents(e,n){e.addHook("beforeColumnSort",(r,i,o)=>{o&&n.done(()=>new kT({currentSortState:r,newSortState:i}))})}undo(e,n){const r=e.getPlugin("columnSorting"),i=e.getPlugin("multiColumnSorting"),o=i.isEnabled()?i:r;this.previousSortState.length?o.sort(this.previousSortState):o.clearSort(),n()}redo(e,n){const r=e.getPlugin("columnSorting"),i=e.getPlugin("multiColumnSorting");(i.isEnabled()?i:r).sort(this.nextSortState),n()}}function h1(t,e,n){return(e=wle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wle(t){var e=vle(t,"string");return typeof e=="symbol"?e:e+""}function vle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class LT extends ti{constructor(e){let{index:n,amount:r}=e;super("insert_col"),h1(this,"index",void 0),h1(this,"amount",void 0),this.index=n,this.amount=r}static startRegisteringEvents(e,n){e.addHook("afterCreateCol",(r,i,o)=>{n.done(()=>new LT({index:r,amount:i}),o)})}undo(e,n){e.addHookOnce("afterRemoveCol",n),e.alter("remove_col",this.index,this.amount,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterCreateCol",n),e.alter("insert_col_start",this.index,this.amount,"UndoRedo.redo")}}function d1(t,e,n){return(e=Cle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Cle(t){var e=yle(t,"string");return typeof e=="symbol"?e:e+""}function yle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class $T extends ti{constructor(e){let{index:n,amount:r}=e;super("insert_row"),d1(this,"index",void 0),d1(this,"amount",void 0),this.index=n,this.amount=r}static startRegisteringEvents(e,n){e.addHook("afterCreateRow",(r,i,o)=>{n.done(()=>new $T({index:r,amount:i}),o)})}undo(e,n){const r=e.countRows(),i=e.getSettings().minSpareRows;this.index>=r&&this.index-i<r&&(this.index-=i),e.addHookOnce("afterRemoveRow",n),e.alter("remove_row",this.index,this.amount,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterCreateRow",n),e.alter("insert_row_above",this.index,this.amount,"UndoRedo.redo")}}function yg(t,e,n){return(e=Sle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Sle(t){var e=ble(t,"string");return typeof e=="symbol"?e:e+""}function ble(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class FT extends ti{constructor(e){let{changes:n,selected:r,countCols:i,countRows:o}=e;super("change"),yg(this,"changes",void 0),yg(this,"selected",void 0),yg(this,"countCols",void 0),yg(this,"countRows",void 0),this.changes=n,this.selected=r,this.countCols=i,this.countRows=o}static startRegisteringEvents(e,n){e.addHook("beforeChange",function(r,i){const o=r&&r.length;if(!o||!r.find(l=>{const[,,u,c]=l;return u!==c}))return;const a=()=>{const l=r.reduce((c,h)=>(c.push([...h]),c),[]);l.forEach(c=>{c[1]=e.propToCol(c[1])});const u=o>1?this.getSelected():[[l[0][0],l[0][1]]];return new FT({changes:l,selected:u,countCols:e.countCols(),countRows:e.countRows()})};n.done(a,i)})}undo(e,n){const r=Kn(this.changes);for(let s=0,a=r.length;s<a;s++)r[s].splice(3,1);e.addHookOnce("afterChange",n),e.setDataAtCell(r,null,null,"UndoRedo.undo");const i=e.countRows()-this.countRows;i>0&&e.alter("remove_row",null,i,"UndoRedo.undo");const o=e.countCols()-this.countCols;o>0&&e.isColumnModificationAllowed()&&e.alter("remove_col",null,o,"UndoRedo.undo"),e.scrollToFocusedCell(),e.selectCells(this.selected,!1,!1)}redo(e,n){const r=Kn(this.changes);for(let i=0,o=r.length;i<o;i++)r[i].splice(2,1);e.addHookOnce("afterChange",n),e.setDataAtCell(r,null,null,"UndoRedo.redo"),this.selected&&e.selectCells(this.selected,!1,!1)}}function f1(t,e,n){return(e=Rle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rle(t){var e=Ele(t,"string");return typeof e=="symbol"?e:e+""}function Ele(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class VT extends ti{constructor(e){let{conditionsStack:n,previousConditionsStack:r}=e;super("filter"),f1(this,"conditionsStack",void 0),f1(this,"previousConditionsStack",void 0),this.conditionsStack=n,this.previousConditionsStack=r}static startRegisteringEvents(e,n){e.addHook("beforeFilter",(r,i)=>{n.done(()=>new VT({conditionsStack:r,previousConditionsStack:i}))})}undo(e,n){const r=e.getPlugin("filters");e.addHookOnce("afterViewRender",n),r.importConditions(this.previousConditionsStack),r.filter()}redo(e,n){const r=e.getPlugin("filters");e.addHookOnce("afterViewRender",n),r.importConditions(this.conditionsStack),r.filter()}}function Tle(t,e,n){return(e=_le(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _le(t){var e=Mle(t,"string");return typeof e=="symbol"?e:e+""}function Mle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class WT extends ti{constructor(e){let{data:n,cellRange:r}=e;super("merge_cells"),Tle(this,"cellRange",void 0),this.cellRange=r,this.data=n}static startRegisteringEvents(e,n){e.addHook("beforeMergeCells",(r,i)=>{if(i)return;const o=r.getTopStartCorner(),s=r.getBottomEndCorner(),a=e.getData(o.row,o.col,s.row,s.col);n.done(()=>new WT({data:a,cellRange:r}))})}undo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.unmergeRange(this.cellRange,!0);const i=this.cellRange.getTopStartCorner();e.populateFromArray(i.row,i.col,this.data,void 0,void 0,"MergeCells")}redo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.mergeRange(this.cellRange)}}function J$(t,e,n,r,i){const o=["visualRow","visualCol","row","col","prop"],s=o.length,a=[];return fe(r,i,l=>{fe(e,n,u=>{const c=t.getCellMeta(u,l);if(Object.keys(c).length!==s){const h=Object.fromEntries(Object.entries(c).filter(d=>{let[f]=d;return o.includes(f)===!1}));a.push([c.visualRow,c.visualCol,h])}})}),a}function No(t,e,n){return(e=Ile(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ile(t){var e=Ple(t,"string");return typeof e=="symbol"?e:e+""}function Ple(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class BT extends ti{constructor(e){let{index:n,indexes:r,data:i,amount:o,headers:s,columnPositions:a,rowPositions:l,fixedColumnsStart:u,removedCellMetas:c}=e;super("remove_col"),No(this,"index",void 0),No(this,"indexes",void 0),No(this,"data",void 0),No(this,"amount",void 0),No(this,"headers",void 0),No(this,"columnPositions",void 0),No(this,"rowPositions",void 0),No(this,"fixedColumnsStart",void 0),No(this,"removedCellMetas",void 0),this.index=n,this.indexes=r,this.data=i,this.amount=o,this.headers=s,this.columnPositions=a.slice(0),this.rowPositions=l.slice(0),this.fixedColumnsStart=u,this.removedCellMetas=c}static startRegisteringEvents(e,n){e.addHook("beforeRemoveCol",(r,i,o,s)=>{const a=()=>{const l=e.getSourceDataArray(),u=(e.countCols()+r)%e.countCols(),c=u+i-1,h=[],d=[],f=[];return fe(l.length-1,m=>{const C=[],y=l[m];fe(u,c,E=>{C.push(y[e.toPhysicalColumn(E)])}),h.push(C)}),fe(i-1,m=>{f.push(e.toPhysicalColumn(u+m))}),Array.isArray(e.getSettings().colHeaders)&&fe(i-1,m=>{d.push(e.getSettings().colHeaders[e.toPhysicalColumn(u+m)]||null)}),new BT({index:u,indexes:f,data:h,amount:i,headers:d,columnPositions:e.columnIndexMapper.getIndexesSequence(),rowPositions:e.rowIndexMapper.getIndexesSequence(),fixedColumnsStart:e.getSettings().fixedColumnsStart,removedCellMetas:J$(e,0,e.countRows(),u,c)})};n.done(a,s)})}undo(e,n){const r=e.getSettings();r.fixedColumnsStart=this.fixedColumnsStart;const i=this.indexes.slice(0).sort(),o=(c,h,d)=>d[this.indexes.indexOf(i[h])],s=this.data.length,a=[];for(let c=0;c<s;c++)a.push(ze(this.data[c],o));const l=ze(this.headers,o),u=[];e.columnIndexMapper.setIndexesSequence(this.columnPositions),e.alter("insert_col_start",e.toVisualColumn(this.indexes[0]),this.indexes.length,"UndoRedo.undo"),e.batchExecution(()=>{e.rowIndexMapper.setIndexesSequence(this.rowPositions),e.columnIndexMapper.setIndexesSequence(this.columnPositions)},!0),H(e.getSourceDataArray(),(c,h)=>{H(i,(d,f)=>{c[d]=a[h][f],u.push([h,d,c[d]])})}),typeof this.headers<"u"&&H(l,(c,h)=>{e.getSettings().colHeaders[i[h]]=c}),this.removedCellMetas.forEach(c=>{let[h,d,f]=c;e.setCellMetaObject(h,d,f)}),e.addHookOnce("afterViewRender",n),e.setSourceDataAtCell(u,null,null,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterRemoveCol",n),e.alter("remove_col",this.index,this.amount,"UndoRedo.redo")}}function cu(t,e,n){return(e=Ole(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ole(t){var e=xle(t,"string");return typeof e=="symbol"?e:e+""}function xle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class jT extends ti{constructor(e){let{index:n,data:r,fixedRowsBottom:i,fixedRowsTop:o,rowIndexesSequence:s,removedCellMetas:a}=e;super("remove_row"),cu(this,"index",void 0),cu(this,"data",void 0),cu(this,"fixedRowsBottom",void 0),cu(this,"fixedRowsTop",void 0),cu(this,"rowIndexesSequence",void 0),cu(this,"removedCellMetas",void 0),this.index=n,this.data=r,this.fixedRowsBottom=i,this.fixedRowsTop=o,this.rowIndexesSequence=s,this.removedCellMetas=a}static startRegisteringEvents(e,n){e.addHook("beforeRemoveRow",(r,i,o,s)=>{const a=()=>{const l=e.toPhysicalRow(r),u=l+i-1,c=Kn(e.getSourceData(l,0,l+i-1,e.countSourceCols()-1));return new jT({index:l,data:c,fixedRowsBottom:e.getSettings().fixedRowsBottom,fixedRowsTop:e.getSettings().fixedRowsTop,rowIndexesSequence:e.rowIndexMapper.getIndexesSequence(),removedCellMetas:J$(e,l,u,0,e.countCols()-1)})};n.done(a,s)})}undo(e,n){const r=e.getSettings(),i=[];r.fixedRowsBottom=this.fixedRowsBottom,r.fixedRowsTop=this.fixedRowsTop,this.data.forEach((o,s)=>{Object.keys(o).forEach(a=>{const l=parseInt(a,10);i.push([this.index+s,isNaN(l)?a:l,o[a]])})}),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence),e.alter("insert_row_above",e.toVisualRow(this.index),this.data.length,"UndoRedo.undo"),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence),this.removedCellMetas.forEach(o=>{let[s,a,l]=o;e.setCellMetaObject(s,a,l)}),e.addHookOnce("afterViewRender",n),e.setSourceDataAtCell(i,null,null,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterRemoveRow",n),e.alter("remove_row",e.toVisualRow(this.index),this.data.length,"UndoRedo.redo")}}function g1(t,e,n){return(e=Ale(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ale(t){var e=Hle(t,"string");return typeof e=="symbol"?e:e+""}function Hle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class UT extends ti{constructor(e){let{rows:n,finalIndex:r}=e;super("row_move"),g1(this,"rows",void 0),g1(this,"finalRowIndex",void 0),this.rows=n.slice(),this.finalRowIndex=r}static startRegisteringEvents(e,n){e.addHook("beforeRowMove",(r,i)=>{r!==!1&&n.done(()=>new UT({rows:r,finalIndex:i}))})}undo(e,n){const r=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",n),PT(this.rows,this.finalRowIndex,e.rowIndexMapper.getNumberOfIndexes()).reverse().forEach(o=>{let{from:s,to:a}=o;s<a&&(a-=1),r.moveRow(a,s)}),e.render(),e.deselectCell(),e.selectRows(this.rows[0],this.rows[0]+this.rows.length-1)}redo(e,n){const r=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",n),r.moveRows(this.rows.slice(),this.finalRowIndex),e.render(),e.deselectCell(),e.selectRows(this.finalRowIndex,this.finalRowIndex+this.rows.length-1)}}function Nle(t,e,n){return(e=Dle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dle(t){var e=kle(t,"string");return typeof e=="symbol"?e:e+""}function kle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class zT extends ti{constructor(e){let{cellRange:n}=e;super("unmerge_cells"),Nle(this,"cellRange",void 0),this.cellRange=n}static startRegisteringEvents(e,n){e.addHook("afterUnmergeCells",(r,i)=>{i||n.done(()=>new zT({cellRange:r}))})}undo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.mergeRange(this.cellRange,!0)}redo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.unmergeRange(this.cellRange,!0),e.render()}}function Lle(t,e){[NT,DT,kT,LT,$T,FT,VT,WT,BT,jT,UT,zT].forEach(n=>n.startRegisteringEvents(t,e))}function $le(t,e){Fle(t,e),e.add(t)}function Fle(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ZS(t,e,n){return(e=Vle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vle(t){var e=Wle(t,"string");return typeof e=="symbol"?e:e+""}function Wle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function JS(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const m1="undoRedo",Ble="undoRedo",jle=1e3;ie.getSingleton().register("beforeUndo");ie.getSingleton().register("afterUndo");ie.getSingleton().register("beforeRedo");ie.getSingleton().register("afterRedo");const p1=new Set;var Sg=new WeakSet;class Ule extends et{static get PLUGIN_KEY(){return Ble}static get PLUGIN_PRIORITY(){return jle}static get SETTING_KEYS(){return!0}constructor(e){super(e),$le(this,Sg),ZS(this,"doneActions",[]),ZS(this,"undoneActions",[]),ZS(this,"ignoreNewActions",!1),Lle(e,this)}isEnabled(){return!!this.hot.getSettings().undo}enablePlugin(){var e=this;this.enabled||(this.addHook("afterChange",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return JS(Sg,e,zle).call(e,...r)}),this.registerShortcuts(),JS(Sg,this,Yle).call(this),super.enablePlugin())}disablePlugin(){super.disablePlugin(),this.clear(),this.unregisterShortcuts(),JS(Sg,this,Gle).call(this)}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("grid"),i={runOnlyIf:o=>!o.altKey,group:m1};n.addShortcuts([{keys:[["Control/Meta","z"]],callback:()=>{this.undo()}},{keys:[["Control/Meta","y"],["Control/Meta","Shift","z"]],callback:()=>{this.redo()}}],i)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(m1)}done(e,n){if(this.ignoreNewActions||n==="UndoRedo.undo"||n==="UndoRedo.redo"||n==="auto")return;const i=this.doneActions.slice();if(this.hot.runHooks("beforeUndoStackChange",i,n)===!1)return;const s=e(),a=this.undoneActions.slice();this.doneActions.push(s),this.hot.runHooks("afterUndoStackChange",i,this.doneActions.slice()),this.hot.runHooks("beforeRedoStackChange",a),this.undoneActions.length=0,this.hot.runHooks("afterRedoStackChange",a,this.undoneActions.slice())}undo(){if(!this.isUndoAvailable())return;const e=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",e);const n=this.doneActions.pop();this.hot.runHooks("afterUndoStackChange",e,this.doneActions.slice());const r=Kn(n);if(this.hot.runHooks("beforeUndo",r)===!1)return;this.ignoreNewActions=!0;const o=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",o),n.undo(this.hot,()=>{this.ignoreNewActions=!1,this.undoneActions.push(n)}),this.hot.runHooks("afterRedoStackChange",o,this.undoneActions.slice()),this.hot.runHooks("afterUndo",r)}redo(){if(!this.isRedoAvailable())return;const e=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",e);const n=this.undoneActions.pop();this.hot.runHooks("afterRedoStackChange",e,this.undoneActions.slice());const r=Kn(n);if(this.hot.runHooks("beforeRedo",r)===!1)return;this.ignoreNewActions=!0;const o=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",o),n.redo(this.hot,()=>{this.ignoreNewActions=!1,this.doneActions.push(n)}),this.hot.runHooks("afterUndoStackChange",o,this.doneActions.slice()),this.hot.runHooks("afterRedo",r)}isUndoAvailable(){return this.doneActions.length>0}isRedoAvailable(){return this.undoneActions.length>0}clear(){this.doneActions.length=0,this.undoneActions.length=0}destroy(){this.clear(),this.doneActions=null,this.undoneActions=null,super.destroy()}}function zle(t,e){e==="loadData"&&this.clear()}function Yle(){const t=e=>{p1.has(e)||(tt(st`The "${e}" method is deprecated and it will be removed\x20
297
- from the Core API in the future. Please use the method from the UndoRedo plugin\x20
298
- (e.g. \`hotInstance.getPlugin("undoRedo").${e}()\`).`),p1.add(e))};this.hot.undo=()=>{t("undo"),this.undo()},this.hot.redo=()=>{t("redo"),this.redo()},this.hot.isUndoAvailable=()=>(t("isUndoAvailable"),this.isUndoAvailable()),this.hot.isRedoAvailable=()=>(t("isRedoAvailable"),this.isRedoAvailable()),this.hot.clearUndo=()=>{t("clear"),this.clear()},this.hot.undoRedo=this}function Gle(){delete this.hot.undo,delete this.hot.redo,delete this.hot.isUndoAvailable,delete this.hot.isRedoAvailable,delete this.hot.clearUndo,delete this.hot.undoRedo}function qle(){Ke(Eh),Ke(l7),Ke(Th),Ke(F7),Ke(G7),Ke(yL),Ke(B5),Ke(_Z),Ke(Ap),Ke(DJ),Ke(aQ),Ke(mQ),Ke(Dp),Ke(ZQ),Ke(Yte),Ke(Tne),Ke(Jne),Ke(cre),Ke(bre),Ke(Hre),Ke(jre),Ke(aie),Ke(pie),Ke(Qie),Ke(xoe),Ke(koe),Ke(lse),Ke(qse),Ke(wae),Ke(_ae),Ke(Vae),Ke(Kae),Ke(sle),Ke(Ule)}function gue(){A9(),t8(),c8(),O8(),qle()}export{s0 as $,b0 as A,S0 as B,y0 as C,C0 as D,v0 as E,W0 as F,w0 as G,p0 as H,m0 as I,g0 as J,f0 as K,mp as L,d0 as M,h0 as N,c0 as O,u0 as P,l0 as Q,Xle as R,a0 as S,$E as T,NE as U,BE as V,WE as W,YE as X,zE as Y,UE as Z,jE as _,uF as a,o0 as a0,i0 as a1,r0 as a2,n0 as a3,t0 as a4,VE as a5,FE as a6,e0 as a7,QE as a8,JE as a9,ZE as aa,XE as ab,KE as ac,qE as ad,GE as ae,HE as af,rm as ag,AE as ah,xE as ai,OE as aj,PE as ak,IE as al,ME as am,_E as an,TE as ao,LE as ap,kE as aq,DE as ar,U0 as as,j0 as at,EE as au,gue as av,sk as aw,t9 as ax,ik as ay,G4 as az,v1 as b,lF as c,y1 as d,Ot as e,V0 as f,F0 as g,$0 as h,L0 as i,k0 as j,D0 as k,pp as l,N0 as m,H0 as n,A0 as o,im as p,x0 as q,C1 as r,O0 as s,P0 as t,I0 as u,M0 as v,_0 as w,T0 as x,E0 as y,R0 as z};