@sankhyalabs/ezui 7.1.0-dev.11 → 7.1.0-dev.12

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 (242) hide show
  1. package/dist/cjs/ez-actions-button.cjs.entry.js +1 -1
  2. package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
  3. package/dist/cjs/ez-alert.cjs.entry.js +1 -1
  4. package/dist/cjs/ez-application.cjs.entry.js +1 -1
  5. package/dist/cjs/ez-avatar.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-badge.cjs.entry.js +1 -1
  7. package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-button.cjs.entry.js +1 -1
  9. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  10. package/dist/cjs/ez-card-item.cjs.entry.js +1 -1
  11. package/dist/cjs/ez-chart.cjs.entry.js +1 -1
  12. package/dist/cjs/ez-check.cjs.entry.js +1 -1
  13. package/dist/cjs/ez-chip.cjs.entry.js +1 -1
  14. package/dist/cjs/ez-classic-combo-box.cjs.entry.js +1 -1
  15. package/dist/cjs/ez-classic-input.cjs.entry.js +1 -1
  16. package/dist/cjs/ez-classic-text-area.cjs.entry.js +1 -1
  17. package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
  18. package/dist/cjs/ez-combo-box-list_4.cjs.entry.js +2 -2
  19. package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
  20. package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
  21. package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
  22. package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
  23. package/dist/cjs/ez-double-list.cjs.entry.js +1 -1
  24. package/dist/cjs/ez-dropdown.cjs.entry.js +1 -1
  25. package/dist/cjs/ez-empty-card.cjs.entry.js +1 -1
  26. package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
  27. package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
  28. package/dist/cjs/ez-form-view.cjs.entry.js +1 -1
  29. package/dist/cjs/ez-form.cjs.entry.js +2 -2
  30. package/dist/cjs/ez-grid-view.cjs.entry.js +1 -1
  31. package/dist/cjs/ez-grid.cjs.entry.js +6 -2
  32. package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
  33. package/dist/cjs/ez-icon.cjs.entry.js +1 -1
  34. package/dist/cjs/ez-link-builder_6.cjs.entry.js +1 -1
  35. package/dist/cjs/ez-list-item.cjs.entry.js +1 -1
  36. package/dist/cjs/ez-list.cjs.entry.js +1 -1
  37. package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
  38. package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
  39. package/dist/cjs/ez-modal.cjs.entry.js +1 -1
  40. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
  41. package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
  42. package/dist/cjs/ez-pagination.cjs.entry.js +1 -1
  43. package/dist/cjs/ez-popover-core.cjs.entry.js +1 -1
  44. package/dist/cjs/ez-popover-plus_3.cjs.entry.js +1 -1
  45. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  46. package/dist/cjs/ez-popup.cjs.entry.js +1 -1
  47. package/dist/cjs/ez-progress-bar.cjs.entry.js +1 -1
  48. package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
  49. package/dist/cjs/ez-rich-toolbar-item.cjs.entry.js +1 -1
  50. package/dist/cjs/ez-scroller_2.cjs.entry.js +1 -1
  51. package/dist/cjs/ez-search-plus.cjs.entry.js +1 -1
  52. package/dist/cjs/ez-search-result-list.cjs.entry.js +1 -1
  53. package/dist/cjs/ez-search.cjs.entry.js +1 -1
  54. package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
  55. package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
  56. package/dist/cjs/ez-sortable-list.cjs.entry.js +1 -1
  57. package/dist/cjs/ez-spinner.cjs.entry.js +1 -1
  58. package/dist/cjs/ez-split-button.cjs.entry.js +1 -1
  59. package/dist/cjs/ez-split-item.cjs.entry.js +1 -1
  60. package/dist/cjs/ez-split-panel.cjs.entry.js +1 -1
  61. package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
  62. package/dist/cjs/ez-tag-input.cjs.entry.js +1 -1
  63. package/dist/cjs/ez-tag.cjs.entry.js +1 -1
  64. package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
  65. package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
  66. package/dist/cjs/ez-tile-medium.cjs.entry.js +1 -1
  67. package/dist/cjs/ez-tile.cjs.entry.js +1 -1
  68. package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
  69. package/dist/cjs/ez-toast.cjs.entry.js +1 -1
  70. package/dist/cjs/ez-tooltip.cjs.entry.js +1 -1
  71. package/dist/cjs/ez-tree.cjs.entry.js +1 -1
  72. package/dist/cjs/ez-underface.cjs.entry.js +1 -1
  73. package/dist/cjs/ez-upload.cjs.entry.js +1 -1
  74. package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
  75. package/dist/cjs/ezui.cjs.js +1 -1
  76. package/dist/cjs/filter-column.cjs.entry.js +1 -1
  77. package/dist/cjs/{index-9e5554cb.js → index-a7b0c73d.js} +0 -3
  78. package/dist/cjs/loader.cjs.js +1 -1
  79. package/dist/cjs/{search-column-540f3925.js → search-column-8bfee733.js} +1 -1
  80. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +4 -0
  81. package/dist/custom-elements/index.js +4 -0
  82. package/dist/esm/ez-actions-button.entry.js +1 -1
  83. package/dist/esm/ez-alert-list.entry.js +1 -1
  84. package/dist/esm/ez-alert.entry.js +1 -1
  85. package/dist/esm/ez-application.entry.js +1 -1
  86. package/dist/esm/ez-avatar.entry.js +1 -1
  87. package/dist/esm/ez-badge.entry.js +1 -1
  88. package/dist/esm/ez-breadcrumb.entry.js +1 -1
  89. package/dist/esm/ez-button.entry.js +1 -1
  90. package/dist/esm/ez-calendar.entry.js +1 -1
  91. package/dist/esm/ez-card-item.entry.js +1 -1
  92. package/dist/esm/ez-chart.entry.js +1 -1
  93. package/dist/esm/ez-check.entry.js +1 -1
  94. package/dist/esm/ez-chip.entry.js +1 -1
  95. package/dist/esm/ez-classic-combo-box.entry.js +1 -1
  96. package/dist/esm/ez-classic-input.entry.js +1 -1
  97. package/dist/esm/ez-classic-text-area.entry.js +1 -1
  98. package/dist/esm/ez-collapsible-box.entry.js +1 -1
  99. package/dist/esm/ez-combo-box-list_4.entry.js +2 -2
  100. package/dist/esm/ez-combo-box.entry.js +1 -1
  101. package/dist/esm/ez-date-input.entry.js +1 -1
  102. package/dist/esm/ez-date-time-input.entry.js +1 -1
  103. package/dist/esm/ez-dialog.entry.js +1 -1
  104. package/dist/esm/ez-double-list.entry.js +1 -1
  105. package/dist/esm/ez-dropdown.entry.js +1 -1
  106. package/dist/esm/ez-empty-card.entry.js +1 -1
  107. package/dist/esm/ez-file-item.entry.js +1 -1
  108. package/dist/esm/ez-filter-input.entry.js +1 -1
  109. package/dist/esm/ez-form-view.entry.js +1 -1
  110. package/dist/esm/ez-form.entry.js +2 -2
  111. package/dist/esm/ez-grid-view.entry.js +1 -1
  112. package/dist/esm/ez-grid.entry.js +6 -2
  113. package/dist/esm/ez-guide-navigator.entry.js +1 -1
  114. package/dist/esm/ez-icon.entry.js +1 -1
  115. package/dist/esm/ez-link-builder_6.entry.js +1 -1
  116. package/dist/esm/ez-list-item.entry.js +1 -1
  117. package/dist/esm/ez-list.entry.js +1 -1
  118. package/dist/esm/ez-loading-bar.entry.js +1 -1
  119. package/dist/esm/ez-modal-container.entry.js +1 -1
  120. package/dist/esm/ez-modal.entry.js +1 -1
  121. package/dist/esm/ez-multi-selection-list.entry.js +1 -1
  122. package/dist/esm/ez-number-input.entry.js +1 -1
  123. package/dist/esm/ez-pagination.entry.js +1 -1
  124. package/dist/esm/ez-popover-core.entry.js +1 -1
  125. package/dist/esm/ez-popover-plus_3.entry.js +1 -1
  126. package/dist/esm/ez-popover.entry.js +1 -1
  127. package/dist/esm/ez-popup.entry.js +1 -1
  128. package/dist/esm/ez-progress-bar.entry.js +1 -1
  129. package/dist/esm/ez-radio-button.entry.js +1 -1
  130. package/dist/esm/ez-rich-toolbar-item.entry.js +1 -1
  131. package/dist/esm/ez-scroller_2.entry.js +1 -1
  132. package/dist/esm/ez-search-plus.entry.js +1 -1
  133. package/dist/esm/ez-search-result-list.entry.js +1 -1
  134. package/dist/esm/ez-search.entry.js +1 -1
  135. package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
  136. package/dist/esm/ez-skeleton.entry.js +1 -1
  137. package/dist/esm/ez-sortable-list.entry.js +1 -1
  138. package/dist/esm/ez-spinner.entry.js +1 -1
  139. package/dist/esm/ez-split-button.entry.js +1 -1
  140. package/dist/esm/ez-split-item.entry.js +1 -1
  141. package/dist/esm/ez-split-panel.entry.js +1 -1
  142. package/dist/esm/ez-tabselector.entry.js +1 -1
  143. package/dist/esm/ez-tag-input.entry.js +1 -1
  144. package/dist/esm/ez-tag.entry.js +1 -1
  145. package/dist/esm/ez-text-area.entry.js +1 -1
  146. package/dist/esm/ez-text-input.entry.js +1 -1
  147. package/dist/esm/ez-tile-medium.entry.js +1 -1
  148. package/dist/esm/ez-tile.entry.js +1 -1
  149. package/dist/esm/ez-time-input.entry.js +1 -1
  150. package/dist/esm/ez-toast.entry.js +1 -1
  151. package/dist/esm/ez-tooltip.entry.js +1 -1
  152. package/dist/esm/ez-tree.entry.js +1 -1
  153. package/dist/esm/ez-underface.entry.js +1 -1
  154. package/dist/esm/ez-upload.entry.js +1 -1
  155. package/dist/esm/ez-view-stack.entry.js +1 -1
  156. package/dist/esm/ezui.js +2 -2
  157. package/dist/esm/filter-column.entry.js +1 -1
  158. package/dist/esm/{index-5a720e56.js → index-baa5e267.js} +1 -3
  159. package/dist/esm/loader.js +2 -2
  160. package/dist/esm/{search-column-4e827a95.js → search-column-c00119ae.js} +1 -1
  161. package/dist/ezui/ezui.esm.js +1 -1
  162. package/dist/ezui/{p-5d1adf13.entry.js → p-0b333f09.entry.js} +1 -1
  163. package/dist/ezui/{p-1d846a77.entry.js → p-0c0eb410.entry.js} +1 -1
  164. package/dist/ezui/{p-cf4e2a35.entry.js → p-0e49c0ff.entry.js} +1 -1
  165. package/dist/ezui/{p-77e738d5.entry.js → p-124699e0.entry.js} +1 -1
  166. package/dist/ezui/{p-26077a43.entry.js → p-1266fe78.entry.js} +1 -1
  167. package/dist/ezui/{p-06ca9d9a.entry.js → p-1730ee24.entry.js} +1 -1
  168. package/dist/ezui/{p-3b5bafe4.entry.js → p-1adf7139.entry.js} +1 -1
  169. package/dist/ezui/{p-13949839.entry.js → p-1bfef8e5.entry.js} +1 -1
  170. package/dist/ezui/{p-4cc79a52.entry.js → p-1cde96f9.entry.js} +1 -1
  171. package/dist/ezui/{p-81461d2f.entry.js → p-1e7a8633.entry.js} +1 -1
  172. package/dist/ezui/{p-6b51c9cc.entry.js → p-1f50fa05.entry.js} +1 -1
  173. package/dist/ezui/{p-cf33bc48.entry.js → p-20c024f7.entry.js} +1 -1
  174. package/dist/ezui/{p-e4c7eb39.js → p-23a36bb6.js} +2 -2
  175. package/dist/ezui/{p-169d460d.entry.js → p-2528e988.entry.js} +1 -1
  176. package/dist/ezui/{p-06f1b8e4.entry.js → p-288631d1.entry.js} +1 -1
  177. package/dist/ezui/{p-bb7cf512.entry.js → p-294f54fe.entry.js} +1 -1
  178. package/dist/ezui/{p-3136f418.entry.js → p-2a70f094.entry.js} +1 -1
  179. package/dist/ezui/{p-b77a0ce4.entry.js → p-2ba2d792.entry.js} +1 -1
  180. package/dist/ezui/{p-2d803ee6.entry.js → p-3fe05d6b.entry.js} +1 -1
  181. package/dist/ezui/{p-f7ca8634.entry.js → p-411c0222.entry.js} +1 -1
  182. package/dist/ezui/{p-570cf58a.entry.js → p-48effc69.entry.js} +1 -1
  183. package/dist/ezui/{p-4a876b8b.entry.js → p-4d30b703.entry.js} +1 -1
  184. package/dist/ezui/{p-b5b33be8.entry.js → p-4e1df756.entry.js} +1 -1
  185. package/dist/ezui/{p-4296e9f9.js → p-4f0632b4.js} +1 -1
  186. package/dist/ezui/{p-8aa7d60b.entry.js → p-59092a66.entry.js} +1 -1
  187. package/dist/ezui/{p-78f18973.entry.js → p-59a98e31.entry.js} +1 -1
  188. package/dist/ezui/{p-129fea99.entry.js → p-5ab08b60.entry.js} +1 -1
  189. package/dist/ezui/{p-6fc26622.entry.js → p-5ed81457.entry.js} +1 -1
  190. package/dist/ezui/{p-c754774e.entry.js → p-6020f3d5.entry.js} +1 -1
  191. package/dist/ezui/{p-51e34317.entry.js → p-6369a0cd.entry.js} +1 -1
  192. package/dist/ezui/{p-b3530711.entry.js → p-6a9a20a0.entry.js} +1 -1
  193. package/dist/ezui/{p-0b531233.entry.js → p-6d596a5a.entry.js} +1 -1
  194. package/dist/ezui/{p-30513f10.entry.js → p-6f119d5f.entry.js} +1 -1
  195. package/dist/ezui/{p-1723f728.entry.js → p-6f77a359.entry.js} +1 -1
  196. package/dist/ezui/{p-e2eb894a.entry.js → p-79277e43.entry.js} +1 -1
  197. package/dist/ezui/{p-580f5fb8.entry.js → p-7b999377.entry.js} +1 -1
  198. package/dist/ezui/{p-e195eaad.entry.js → p-7f792043.entry.js} +1 -1
  199. package/dist/ezui/{p-0391f255.entry.js → p-7f8c1fce.entry.js} +1 -1
  200. package/dist/ezui/{p-b7c6ce20.entry.js → p-7fe97ef5.entry.js} +1 -1
  201. package/dist/ezui/{p-1d8ea7d2.entry.js → p-8bb3aeb0.entry.js} +1 -1
  202. package/dist/ezui/{p-53e773a4.entry.js → p-8dc267ff.entry.js} +1 -1
  203. package/dist/ezui/{p-82fa4b09.entry.js → p-8df1ca33.entry.js} +1 -1
  204. package/dist/ezui/{p-78e975b4.entry.js → p-91c9d50e.entry.js} +1 -1
  205. package/dist/ezui/{p-05e68ab3.entry.js → p-93e1c917.entry.js} +1 -1
  206. package/dist/ezui/{p-7fdf1f2b.entry.js → p-957d08cd.entry.js} +1 -1
  207. package/dist/ezui/{p-cb4f1ee9.entry.js → p-99fef4da.entry.js} +2 -2
  208. package/dist/ezui/{p-d3779449.entry.js → p-9b2e6438.entry.js} +1 -1
  209. package/dist/ezui/{p-c2b20f78.entry.js → p-9f5fa3f9.entry.js} +1 -1
  210. package/dist/ezui/{p-bc693db6.entry.js → p-a0bf1fc7.entry.js} +1 -1
  211. package/dist/ezui/{p-9bcfa689.entry.js → p-a3075f52.entry.js} +1 -1
  212. package/dist/ezui/{p-f26b97e9.entry.js → p-a3ada561.entry.js} +1 -1
  213. package/dist/ezui/{p-c73964f8.entry.js → p-a401041c.entry.js} +1 -1
  214. package/dist/ezui/{p-43106b79.entry.js → p-a7eab406.entry.js} +1 -1
  215. package/dist/ezui/{p-dfca5946.entry.js → p-a80b1287.entry.js} +1 -1
  216. package/dist/ezui/{p-cff2434d.entry.js → p-ae5f64cd.entry.js} +1 -1
  217. package/dist/ezui/{p-a48979a8.entry.js → p-ba7e908a.entry.js} +1 -1
  218. package/dist/ezui/p-bc2f844e.entry.js +1 -0
  219. package/dist/ezui/{p-b81d19c7.entry.js → p-c82acfc6.entry.js} +1 -1
  220. package/dist/ezui/{p-4a530109.entry.js → p-d0e6911e.entry.js} +1 -1
  221. package/dist/ezui/{p-c96e536d.entry.js → p-d2645bdf.entry.js} +1 -1
  222. package/dist/ezui/{p-a9432878.entry.js → p-d6742c1e.entry.js} +1 -1
  223. package/dist/ezui/{p-770cf2b8.entry.js → p-d6f50207.entry.js} +1 -1
  224. package/dist/ezui/p-d8cc640d.entry.js +1 -0
  225. package/dist/ezui/{p-5f4a66ec.entry.js → p-dee18824.entry.js} +1 -1
  226. package/dist/ezui/p-e03b2f19.entry.js +1 -0
  227. package/dist/ezui/{p-74f08ec9.entry.js → p-e27d7dc2.entry.js} +1 -1
  228. package/dist/ezui/{p-4815ddbf.entry.js → p-e46a4d06.entry.js} +1 -1
  229. package/dist/ezui/{p-000159dc.entry.js → p-e75c7a23.entry.js} +1 -1
  230. package/dist/ezui/{p-e9b409c1.entry.js → p-e7a7c594.entry.js} +1 -1
  231. package/dist/ezui/{p-4dc07e01.entry.js → p-e882635e.entry.js} +1 -1
  232. package/dist/ezui/{p-b21efe83.entry.js → p-e8c57463.entry.js} +1 -1
  233. package/dist/ezui/{p-a859ea2e.entry.js → p-e8c6c973.entry.js} +1 -1
  234. package/dist/ezui/{p-f17e7182.entry.js → p-e99cbb51.entry.js} +1 -1
  235. package/dist/ezui/{p-53412766.entry.js → p-eee3c7ff.entry.js} +1 -1
  236. package/dist/ezui/{p-35e3715c.entry.js → p-ef8bd3e8.entry.js} +1 -1
  237. package/dist/ezui/{p-44b39e81.entry.js → p-fa6732f2.entry.js} +1 -1
  238. package/dist/ezui/{p-231cf227.entry.js → p-ff4bde07.entry.js} +1 -1
  239. package/package.json +1 -1
  240. package/dist/ezui/p-14d6aeb8.entry.js +0 -1
  241. package/dist/ezui/p-3be7d8d8.entry.js +0 -1
  242. package/dist/ezui/p-6ec40dec.entry.js +0 -1
@@ -1,4 +1,4 @@
1
- import{h as t,r as i,c as n,H as e,g as r}from"./p-e4c7eb39.js";import{Action as o,DataUnit as s,ObjectUtils as u,UserInterface as h,HTMLBuilder as c,ApplicationContext as a,StringUtils as l,LockManager as f,LockManagerOperation as d,DataType as v,NumberUtils as p,MaskFormatter as g,SortMode as m,ElementIDUtils as b,ColumnFilterManager as w,DateUtils as y,ArrayUtils as C,FieldComparator as S,JSUtils as R,OverflowWatcher as O,OVERFLOWED_CLASS_NAME as A,KeyboardManager as j}from"@sankhyalabs/core";import{SelectionMode as _}from"@sankhyalabs/core/dist/dataunit/DataUnit";import{A as G}from"./p-5a11cf56.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{g as x,i as M}from"./p-641ee538.js";import{C as F,a as k}from"./p-30ffb9ed.js";import{b as P,R as D,D as I,S as E,f as T,c as z,a as N}from"./p-4296e9f9.js";import{D as L,E as B,P as H,a as W}from"./p-b1e45320.js";import{F as V}from"./p-dc628ed3.js";import{p as U}from"./p-bb409cba.js";import"./p-112455b1.js";
1
+ import{h as t,r as i,c as n,H as e,g as r}from"./p-23a36bb6.js";import{Action as o,DataUnit as s,ObjectUtils as u,UserInterface as h,HTMLBuilder as c,ApplicationContext as a,StringUtils as l,LockManager as f,LockManagerOperation as d,DataType as v,NumberUtils as p,MaskFormatter as g,SortMode as m,ElementIDUtils as b,ColumnFilterManager as w,DateUtils as y,ArrayUtils as C,FieldComparator as S,JSUtils as R,OverflowWatcher as O,OVERFLOWED_CLASS_NAME as A,KeyboardManager as j}from"@sankhyalabs/core";import{SelectionMode as _}from"@sankhyalabs/core/dist/dataunit/DataUnit";import{A as G}from"./p-5a11cf56.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{g as x,i as M}from"./p-641ee538.js";import{C as F,a as k}from"./p-30ffb9ed.js";import{b as P,R as D,D as I,S as E,f as T,c as z,a as N}from"./p-4f0632b4.js";import{D as L,E as B,P as H,a as W}from"./p-b1e45320.js";import{F as V}from"./p-dc628ed3.js";import{p as U}from"./p-bb409cba.js";import"./p-112455b1.js";
2
2
  /**
3
3
  * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue
4
4
  * @version v28.2.1
@@ -306,4 +306,4 @@ var ef,rf=function(){function t(t,i){this.active=!0,this.nodeIdsToColumns={},thi
306
306
  * @link https://www.ag-grid.com/
307
307
  * @license MIT
308
308
  */
309
- var Ep="undefined"==typeof global?{}:global;Ep.HTMLElement="undefined"==typeof HTMLElement?{}:HTMLElement,Ep.HTMLButtonElement="undefined"==typeof HTMLButtonElement?{}:HTMLButtonElement,Ep.HTMLSelectElement="undefined"==typeof HTMLSelectElement?{}:HTMLSelectElement,Ep.HTMLInputElement="undefined"==typeof HTMLInputElement?{}:HTMLInputElement,Ep.Node="undefined"==typeof Node?{}:Node,Ep.MouseEvent="undefined"==typeof MouseEvent?{}:MouseEvent;var Tp=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),zp=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Np=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.watermarkMessage=void 0,i}var n;return Tp(i,t),n=i,i.prototype.validateLicense=function(){if(Wr.missingOrEmpty(n.licenseKey))this.outputMissingLicenseKey();else if(n.licenseKey.length>32){var t=n.extractLicenseComponents(n.licenseKey),i=t.license,e=t.version,r=t.isTrial;t.md5===this.md5.md5(i)?Wr.exists(e)&&e?this.validateLicenseKeyForVersion(e,!!r,i):this.validateLegacyKey(i):this.outputInvalidLicenseKey()}else this.outputInvalidLicenseKey()},i.extractExpiry=function(t){var i=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt(n.decode(i),10))},i.extractLicenseComponents=function(t){var i=t.replace(/[\u200B-\u200D\uFEFF]/g,""),e=(i=i.replace(/\r?\n|\r/g,"")).length-32,r=i.substring(e),o=i.substring(0,e),s=function(t,i){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var e,r,o=n.call(t),s=[];try{for(;(void 0===i||i-- >0)&&!(e=o.next()).done;)s.push(e.value)}catch(t){r={error:t}}finally{try{e&&!e.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s}(n.extractBracketedInformation(i),2);return{md5:r,license:o,version:s[0],isTrial:s[1]}},i.prototype.getLicenseDetails=function(t){var i=n.extractLicenseComponents(t),e=i.license,r=i.version,o=i.isTrial,s=i.md5===this.md5.md5(e),u=null;return s&&(u=n.extractExpiry(e),s=!isNaN(u.getTime())),{licenseKey:t,valid:s,expiry:s?n.formatDate(u):null,version:r||"legacy",isTrial:o}},i.prototype.isDisplayWatermark=function(){return!Wr.missingOrEmpty(this.watermarkMessage)},i.prototype.getWatermarkMessage=function(){return this.watermarkMessage||""},i.formatDate=function(t){var i=t.getDate(),n=t.getMonth(),e=t.getFullYear();return i+" "+["January","February","March","April","May","June","July","August","September","October","November","December"][n]+" "+e},i.getGridReleaseDate=function(){return new Date(parseInt(n.decode(n.RELEASE_INFORMATION),10))},i.decode=function(t){for(var i,e,r,o,s,u,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="",a=0,l=t.replace(/[^A-Za-z0-9+/=]/g,"");a<l.length;)r=h.indexOf(l.charAt(a++)),i=(15&(o=h.indexOf(l.charAt(a++))))<<4|(s=h.indexOf(l.charAt(a++)))>>2,e=(3&s)<<6|(u=h.indexOf(l.charAt(a++))),c+=String.fromCharCode(r<<2|o>>4),64!=s&&(c+=String.fromCharCode(i)),64!=u&&(c+=String.fromCharCode(e));return n.utf8_decode(c)},i.utf8_decode=function(t){t=t.replace(/rn/g,"n");for(var i="",n=0;n<t.length;n++){var e=t.charCodeAt(n);e<128?i+=String.fromCharCode(e):e>127&&e<2048?(i+=String.fromCharCode(e>>6|192),i+=String.fromCharCode(63&e|128)):(i+=String.fromCharCode(e>>12|224),i+=String.fromCharCode(e>>6&63|128),i+=String.fromCharCode(63&e|128))}return i},i.setLicenseKey=function(t){n.licenseKey=t},i.extractBracketedInformation=function(t){var i=t.split("[").filter((function(t){return t.indexOf("]")>-1})).map((function(t){return t.split("]")[0]}));if(!i||0===i.length)return[null,null];var n=1===i.filter((function(t){return"TRIAL"===t})).length;return[i.filter((function(t){return 0===t.indexOf("v")})).map((function(t){return t.replace(/^v/,"")}))[0],n]},i.prototype.validateLicenseKeyForVersion=function(t,i,n){"2"===t&&(i?this.validateForTrial(n):this.validateLegacyKey(n))},i.prototype.validateLegacyKey=function(t){var i=n.getGridReleaseDate(),e=n.extractExpiry(t),r=!1,o=!1;if(isNaN(e.getTime())||(r=!0,o=i<e),r){if(!o){var s=n.formatDate(e),u=n.formatDate(i);this.outputIncompatibleVersion(s,u)}}else this.outputInvalidLicenseKey()},i.prototype.validateForTrial=function(t){var i=n.extractExpiry(t),e=new Date,r=!1,o=!1;if(isNaN(i.getTime())||(r=!0,o=i>e),r){if(!o){var s=n.formatDate(i);this.outputExpiredTrialKey(s)}}else this.outputInvalidLicenseKey()},i.prototype.outputInvalidLicenseKey=function(){console.error("*****************************************************************************************************************"),console.error("***************************************** AG Grid Enterprise License ********************************************"),console.error("********************************************* Invalid License ***************************************************"),console.error("* Your license for AG Grid Enterprise is not valid - please contact info@ag-grid.com to obtain a valid license. *"),console.error("*****************************************************************************************************************"),console.error("*****************************************************************************************************************"),this.watermarkMessage="Invalid License"},i.prototype.outputExpiredTrialKey=function(t){console.error("****************************************************************************************************************"),console.error("***************************************** AG Grid Enterprise License *******************************************"),console.error("***************************************** Trial Period Expired. *******************************************"),console.error("* Your license for AG Grid Enterprise expired on "+t+". *"),console.error("* Please email info@ag-grid.com to purchase a license. *"),console.error("****************************************************************************************************************"),console.error("****************************************************************************************************************"),this.watermarkMessage="Trial Period Expired"},i.prototype.outputMissingLicenseKey=function(){console.error("****************************************************************************************************************"),console.error("***************************************** AG Grid Enterprise License *******************************************"),console.error("****************************************** License Key Not Found ***********************************************"),console.error("* All AG Grid Enterprise features are unlocked. *"),console.error("* This is an evaluation only version, it is not licensed for development projects intended for production. *"),console.error("* If you want to hide the watermark, please email info@ag-grid.com for a trial license. *"),console.error("****************************************************************************************************************"),console.error("****************************************************************************************************************"),this.watermarkMessage="For Trial Use Only"},i.prototype.outputIncompatibleVersion=function(t,i){console.error("****************************************************************************************************************************"),console.error("****************************************************************************************************************************"),console.error("* AG Grid Enterprise License *"),console.error("* License not compatible with installed version of AG Grid Enterprise. *"),console.error("* *"),console.error("* Your AG Grid License entitles you to all versions of AG Grid that we release within the time covered by your license *"),console.error("* - typically we provide one year licenses which entitles you to all releases / updates of AG Grid within that year. *"),console.error("* Your license has an end (expiry) date which stops the license key working with versions of AG Grid released after the *"),console.error("* license end date. The license key that you have expires on "+t+", however the version of AG Grid you *"),console.error("* are trying to use was released on "+i+". *"),console.error("* *"),console.error("* Please contact info@ag-grid.com to renew your subscription to new versions and get a new license key to work with this *"),console.error("* version of AG Grid. *"),console.error("****************************************************************************************************************************"),console.error("****************************************************************************************************************************"),this.watermarkMessage="License Expired"},i.RELEASE_INFORMATION="MTY2NzI0NjAxNTYyNw==",zp([Dt("md5")],i.prototype,"md5",void 0),zp([Mt],i.prototype,"validateLicense",null),n=zp([Pt("licenseManager")],i)}(Ai),Lp=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Bp=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Hp=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.ieCompatibility=!1,i}return Lp(i,t),i.prototype.init=function(){this.ieCompatibility="5d41402abc4b2a76b9719d911017c592"!=this.md5("hello")},i.prototype.md5cycle=function(t,i){var n=t[0],e=t[1],r=t[2],o=t[3];n=this.ff(n,e,r,o,i[0],7,-680876936),o=this.ff(o,n,e,r,i[1],12,-389564586),r=this.ff(r,o,n,e,i[2],17,606105819),e=this.ff(e,r,o,n,i[3],22,-1044525330),n=this.ff(n,e,r,o,i[4],7,-176418897),o=this.ff(o,n,e,r,i[5],12,1200080426),r=this.ff(r,o,n,e,i[6],17,-1473231341),e=this.ff(e,r,o,n,i[7],22,-45705983),n=this.ff(n,e,r,o,i[8],7,1770035416),o=this.ff(o,n,e,r,i[9],12,-1958414417),r=this.ff(r,o,n,e,i[10],17,-42063),e=this.ff(e,r,o,n,i[11],22,-1990404162),n=this.ff(n,e,r,o,i[12],7,1804603682),o=this.ff(o,n,e,r,i[13],12,-40341101),r=this.ff(r,o,n,e,i[14],17,-1502002290),e=this.ff(e,r,o,n,i[15],22,1236535329),n=this.gg(n,e,r,o,i[1],5,-165796510),o=this.gg(o,n,e,r,i[6],9,-1069501632),r=this.gg(r,o,n,e,i[11],14,643717713),e=this.gg(e,r,o,n,i[0],20,-373897302),n=this.gg(n,e,r,o,i[5],5,-701558691),o=this.gg(o,n,e,r,i[10],9,38016083),r=this.gg(r,o,n,e,i[15],14,-660478335),e=this.gg(e,r,o,n,i[4],20,-405537848),n=this.gg(n,e,r,o,i[9],5,568446438),o=this.gg(o,n,e,r,i[14],9,-1019803690),r=this.gg(r,o,n,e,i[3],14,-187363961),e=this.gg(e,r,o,n,i[8],20,1163531501),n=this.gg(n,e,r,o,i[13],5,-1444681467),o=this.gg(o,n,e,r,i[2],9,-51403784),r=this.gg(r,o,n,e,i[7],14,1735328473),e=this.gg(e,r,o,n,i[12],20,-1926607734),n=this.hh(n,e,r,o,i[5],4,-378558),o=this.hh(o,n,e,r,i[8],11,-2022574463),r=this.hh(r,o,n,e,i[11],16,1839030562),e=this.hh(e,r,o,n,i[14],23,-35309556),n=this.hh(n,e,r,o,i[1],4,-1530992060),o=this.hh(o,n,e,r,i[4],11,1272893353),r=this.hh(r,o,n,e,i[7],16,-155497632),e=this.hh(e,r,o,n,i[10],23,-1094730640),n=this.hh(n,e,r,o,i[13],4,681279174),o=this.hh(o,n,e,r,i[0],11,-358537222),r=this.hh(r,o,n,e,i[3],16,-722521979),e=this.hh(e,r,o,n,i[6],23,76029189),n=this.hh(n,e,r,o,i[9],4,-640364487),o=this.hh(o,n,e,r,i[12],11,-421815835),r=this.hh(r,o,n,e,i[15],16,530742520),e=this.hh(e,r,o,n,i[2],23,-995338651),n=this.ii(n,e,r,o,i[0],6,-198630844),o=this.ii(o,n,e,r,i[7],10,1126891415),r=this.ii(r,o,n,e,i[14],15,-1416354905),e=this.ii(e,r,o,n,i[5],21,-57434055),n=this.ii(n,e,r,o,i[12],6,1700485571),o=this.ii(o,n,e,r,i[3],10,-1894986606),r=this.ii(r,o,n,e,i[10],15,-1051523),e=this.ii(e,r,o,n,i[1],21,-2054922799),n=this.ii(n,e,r,o,i[8],6,1873313359),o=this.ii(o,n,e,r,i[15],10,-30611744),r=this.ii(r,o,n,e,i[6],15,-1560198380),e=this.ii(e,r,o,n,i[13],21,1309151649),n=this.ii(n,e,r,o,i[4],6,-145523070),o=this.ii(o,n,e,r,i[11],10,-1120210379),r=this.ii(r,o,n,e,i[2],15,718787259),e=this.ii(e,r,o,n,i[9],21,-343485551),t[0]=this.add32(n,t[0]),t[1]=this.add32(e,t[1]),t[2]=this.add32(r,t[2]),t[3]=this.add32(o,t[3])},i.prototype.cmn=function(t,i,n,e,r,o){return i=this.add32(this.add32(i,t),this.add32(e,o)),this.add32(i<<r|i>>>32-r,n)},i.prototype.ff=function(t,i,n,e,r,o,s){return this.cmn(i&n|~i&e,t,i,r,o,s)},i.prototype.gg=function(t,i,n,e,r,o,s){return this.cmn(i&e|n&~e,t,i,r,o,s)},i.prototype.hh=function(t,i,n,e,r,o,s){return this.cmn(i^n^e,t,i,r,o,s)},i.prototype.ii=function(t,i,n,e,r,o,s){return this.cmn(n^(i|~e),t,i,r,o,s)},i.prototype.md51=function(t){var i,n=t.length,e=[1732584193,-271733879,-1732584194,271733878];for(i=64;i<=t.length;i+=64)this.md5cycle(e,this.md5blk(t.substring(i-64,i)));t=t.substring(i-64);var r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i<t.length;i++)r[i>>2]|=t.charCodeAt(i)<<(i%4<<3);if(r[i>>2]|=128<<(i%4<<3),i>55)for(this.md5cycle(e,r),i=0;i<16;i++)r[i]=0;return r[14]=8*n,this.md5cycle(e,r),e},i.prototype.md5blk=function(t){for(var i=[],n=0;n<64;n+=4)i[n>>2]=t.charCodeAt(n)+(t.charCodeAt(n+1)<<8)+(t.charCodeAt(n+2)<<16)+(t.charCodeAt(n+3)<<24);return i},i.prototype.rhex=function(t){for(var i="0123456789abcdef".split(""),n="",e=0;e<4;e++)n+=i[t>>8*e+4&15]+i[t>>8*e&15];return n},i.prototype.hex=function(t){for(var i=0;i<t.length;i++)t[i]=this.rhex(t[i]);return t.join("")},i.prototype.md5=function(t){return this.hex(this.md51(t))},i.prototype.add32=function(t,i){return this.ieCompatibility?this.add32Compat(t,i):this.add32Std(t,i)},i.prototype.add32Std=function(t,i){return t+i&4294967295},i.prototype.add32Compat=function(t,i){var n=(65535&t)+(65535&i);return(t>>16)+(i>>16)+(n>>16)<<16|65535&n},Bp([Ft],i.prototype,"init",null),Bp([Pt("md5")],i)}(Ai),Wp=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Vp=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Up=function(t){function i(){return t.call(this,'<div class="ag-watermark">\n <div ref="eLicenseTextRef" class="ag-watermark-text"></div>\n </div>')||this}return Wp(i,t),i.prototype.postConstruct=function(){var t=this,i=this.shouldDisplayWatermark();this.addOrRemoveCssClass("ag-hidden",!i),i&&(this.eLicenseTextRef.innerText=this.licenseManager.getWatermarkMessage(),window.setTimeout((function(){return t.addCssClass("ag-opacity-zero")}),0),window.setTimeout((function(){return t.addCssClass("ag-hidden")}),5e3))},i.prototype.shouldDisplayWatermark=function(){var t=(this.gridOptionsWrapper.getDocument().defaultView||window).location,i=t.hostname,n=void 0===i?"":i,e=t.pathname,r=this.licenseManager.isDisplayWatermark(),o=null!=n.match("^(?:127.0.0.1|localhost|(?:w+.)?ag-grid.com)$");return!!e&&-1!==e.indexOf("forceWatermark")||r&&!o},Vp([Dt("licenseManager")],i.prototype,"licenseManager",void 0),Vp([no("eLicenseTextRef")],i.prototype,"eLicenseTextRef",void 0),Vp([Ft],i.prototype,"postConstruct",null),i}(io),Kp={moduleName:Nt.EnterpriseCoreModule,beans:[Np,Hp],agStackComponents:[{componentName:"AgWatermark",componentClass:Up}]};class $p{constructor(t){this._controller=t}clearColumnFilter(t){var i;return null!==(i=t.filter((t=>!t.name.startsWith(L))))&&void 0!==i?i:[]}interceptAction(t){var i;return t.type===o.LOADING_DATA&&B!==t.payload.source&&s.CHANGING_PAGE_LOADING_SOURCE!==t.payload.source&&(t.payload.filters=void 0!==(null===(i=t.payload)||void 0===i?void 0:i.filters)?this.clearColumnFilter(t.payload.filters):t.payload.filters,this._controller.clearFilter()),t}}class qp{handleDataSaved(t){this._options&&this._options.onPaginationUpdate(this._dataUnit.getPaginationInfo()),this._controller.clearInvalidCells(),this.handleRefreshOrReload(t),this._controller.processContinuousInsert(),this._controller.showSelectionColumn()}handleEditionCanceled(t){this._options.enableGridInsert&&this._controller.processEditionCanceled(),this.handleRefreshOrReload(t),this._controller.showSelectionColumn()}handleSavingCanceled(t){var i,n,e,r;(null===(i=t.payload)||void 0===i?void 0:i.fields)&&(null===(n=t.payload)||void 0===n?void 0:n.recordId)&&this._controller.savingCanceled(null===(e=t.payload)||void 0===e?void 0:e.fields,null===(r=t.payload)||void 0===r?void 0:r.recordId)}handleDataChanged(t){this._options.enableGridInsert?this.updateGridRowNodes(this.createRecordIdList(t)):this.handleRefresh(t)}createRecordIdList(t){var i,n;return(null===(i=t.payload)||void 0===i?void 0:i.records)?null===(n=t.payload)||void 0===n?void 0:n.records:this._dataUnit.getSelectedRecord()?[this._dataUnit.getSelectedRecord().__record__id__]:[]}updateGridRowNodes(t){const i=null==t?void 0:t.map((t=>this.getRecordById(t)));this._controller.updateRows(i)}getRecordById(t){return this._dataUnit.records.find((i=>i.__record__id__===t))}handleRefreshOrReload(t){this._dataUnit.isWaitingToReload()?this.handleReload():this.handleRefresh(t)}handleReload(){this._dataUnit.setWaitingToReload(!1),this._dataUnit.gotoPage(0)}handleRefresh(t){this.isSilentChange(t)||this._controller.refresh(t.type===o.DATA_SAVED)}handleRecordsAdded(){this._options.enableGridInsert&&(this._controller.hideSelectionColumn(),this._controller.refresh(),this.focusOnNewRecord())}focusOnNewRecord(){setTimeout((()=>{this._controller.startEditionOnLastRow()}),1e3)}updateLoadedRecords(t){const i=t.payload;(null==i?void 0:i.length)>0&&i.forEach((t=>{this._controller.changeValues(t,[t.__record__id__])}))}handleFocusFirstRow(){this._options.autoFocus&&this._controller.setFocusFirstRow()}isSilentChange(t){var i,n;return!!(null==t?void 0:t.payload)&&(t.type===o.DATA_CHANGED?null===(i=Object.keys(null==t?void 0:t.payload))||void 0===i?void 0:i.some((i=>{var n;return i.startsWith("transient.")&&t.payload[i]||(null===(n=t.payload.records)||void 0===n?void 0:n.length)>0})):t.type===o.EDITION_CANCELED?!0===(null===(n=null==t?void 0:t.payload)||void 0===n?void 0:n.silent):void 0)}constructor(t,i,n,e){var r;this.RECORD_ARCHIVE="__RECORD_ARCHIVE__",this.duObserver=t=>{var i;switch(t.type){case o.METADATA_LOADED:this._controller.setColumnsDef(this.buildColumnDefs()),null===(i=this._resolveLoading)||void 0===i||i.call(this);break;case o.LOADING_DATA:this._waitingForLoad=!0,this._controller.refresh();break;case o.DATA_LOADED:this._waitingForLoad=!1,this.callbackGetRows(this._lastLoadingParams),this._options&&this._options.onPaginationChange(this._dataUnit.getPaginationInfo(),t.payload.selectFirstRecord),this.updateSelection(),this.handleFocusFirstRow();break;case o.PAGINATION_UPDATED:this._options&&this._options.onPaginationUpdate(this._dataUnit.getPaginationInfo());break;case o.RECORDS_ADDED:case o.RECORDS_COPIED:this.handleRecordsAdded();break;case o.DATA_SAVED:this.handleDataSaved(t);break;case o.EDITION_CANCELED:this.handleEditionCanceled(t);break;case o.DATA_CHANGED:case o.DATA_RESOLVED:this.handleDataChanged(t);break;case o.RECORDS_REMOVED:this.handleRefresh(t);break;case o.SELECTION_CHANGED:case o.NEXT_SELECTED:case o.PREVIOUS_SELECTED:this.updateSelection();break;case o.RECORD_LOADED:this.updateLoadedRecords(t);break;case o.SAVING_CANCELED:this.handleSavingCanceled(t)}};try{this._resolveLoading=e,this._dataUnit=t,this._controller=i,this._controller.setColumnsDef(this.buildColumnDefs()),this._options=n,this._dataUnit.subscribe(this.duObserver),this._dataUnit.addInterceptor(new $p(this._controller))}finally{this._dataUnit.metadata&&(null===(r=this._resolveLoading)||void 0===r||r.call(this))}}updateSelection(){const t=this._dataUnit.getSelectionInfo();t.isAllRecords()?this._controller.selectAll(!0):this._controller.selectRows(t.recordIds,!0)}setAutoFocus(t){this._options.autoFocus=t}setEnableGridInsert(t){this._options.enableGridInsert=t}getRows(t){this.needReload(t)?(this._lastLoadingParams=t,this._dataUnit.loadData(this.quickFilter,void 0,!0,B).then((()=>this.updateSelection()))):(this._lastLoadingParams=t,this._waitingForLoad||(this.callbackGetRows(t),this.updateSelection()))}needReload(t){return!!this._lastLoadingParams&&u.objectToString(t.request)!=u.objectToString(this._lastLoadingParams.request)}callbackGetRows(t){t&&t.success({rowData:this._dataUnit.records})}destroy(){this._dataUnit.unsubscribe(this.duObserver)}registryListeners(){var t,i;null===(t=this._dataUnit)||void 0===t||t.unsubscribe(this.duObserver),null===(i=this._dataUnit)||void 0===i||i.subscribe(this.duObserver)}getDescriptionField(t,i){const n=`${i}.${t}`;return this._dataUnit.metadata.fields.find((t=>t.name===n))}buildColumnDefs(){try{const t=this._controller.getGridConfig()||[],i=[];return this._dataUnit.metadata&&(this._dataUnit.metadata.fields.sort(((i,n)=>t.findIndex((t=>t.name===i.name))-t.findIndex((t=>t.name===n.name)))),this._dataUnit.metadata.fields.forEach((t=>{var n,e,r,o,s,u;if(!1!==t.visible&&t.name!==this.RECORD_ARCHIVE){const c=new Map,a=this._dataUnit.getField(t.name).properties;for(const t in a)c.set(t,a[t]);const l={label:t.label,name:t.name,userInterface:t.userInterface,options:null===(n=this._dataUnit.getField(t.name).properties)||void 0===n?void 0:n.options,props:c};if(i.push(l),t.userInterface===h.SEARCHPLUS&&(null===(e=t.properties)||void 0===e?void 0:e.DESCRIPTIONFIELD)){const n=this.getDescriptionField(null===(r=t.properties)||void 0===r?void 0:r.DESCRIPTIONFIELD,null===(o=t.properties)||void 0===o?void 0:o.ENTITYNAME);if(n)n.label=`${null===(s=t.properties)||void 0===s?void 0:s.DESCRIPTIONFIELDLABEL} (${null===(u=t.properties)||void 0===u?void 0:u.DESCRIPTIONENTITY})`;else{const n=this.buildDescriptionColumn(t);i.push(n),t.properties[H]=n.name}}}}))),i}catch(t){console.warn(t)}}buildDescriptionColumn(t){var i,n,e,r;const o=new Map;o.set(W,t.name);const s=`${null===(i=t.properties)||void 0===i?void 0:i.ENTITYNAME}.${null===(n=t.properties)||void 0===n?void 0:n.DESCRIPTIONFIELD}`;return this._dataUnit.addSourceFieldValue(s,t.name),{label:`${null===(e=t.properties)||void 0===e?void 0:e.DESCRIPTIONFIELDLABEL} (${null===(r=t.properties)||void 0===r?void 0:r.DESCRIPTIONENTITY})`,name:s,userInterface:h.SHORTTEXT,props:o}}}class Yp{init(t){var i;this.params=t,this.element=document.createElement("div"),this.element.classList.add("ag-cell-label-container"),this.element.setAttribute("title",null!==(i=this.params.tooltip)&&void 0!==i?i:""),this.element.innerHTML=`\n <div id='filter-column-${t.column.getColId()}-${t.context.dataUnit.dataUnitId}' class='ez-flex ez-flex--justify-between'>\n <i id='ez-grid-filter-icon' class='ez-icon-filter' style='color:#008561'></i> \n <i id='ez-grid-menu-icon' class='ez-icon-dots-vertical'></i> \n </div>\n <div id='ez-header-container' class='ez-flex ez-flex--justify-between ag-header-cell-text'>\n <span class='ag-header-cell-text'>${this.params.displayName}</span>\n <i id='ez-grid-sort-icon-descendente' class='ez-icon-ordem-descendente' style='display: none;font-weight: 100;margin-left: 4px;font-size: var(--text--large, 14px);align-self: center;'></i>\n <i id='ez-grid-sort-icon-ascendente' class='ez-icon-ordem-ascendente' style='display: none;font-weight: 100;margin-left: 4px;font-size: var(--text--large, 14px);align-self: center;'></i>\n </div>\n `,this.configMenuClick(),this.configSortClick(),this.configSortListener(),this.configFilterButton()}refresh(t){this.params=t,this.configFilterButton(),this.configSortIcon()}configFilterButton(){this.filterButton=this.element.querySelector("#ez-grid-filter-icon"),this.filterButton.style.display=this.params.hasFilter()?"flex":"none",this.onFilterButtonClickListener=this.onClickFilter.bind(this),this.filterButton.addEventListener("click",this.onFilterButtonClickListener)}onClickFilter(){var t;this.params.showColumnFilter(null===(t=this.filterButton)||void 0===t?void 0:t.getBoundingClientRect().left)}configSortIcon(){this.sortDownIcon.style.display=this.params.column.isSortDescending()?"flex":"none",this.sortUpIcon.style.display=this.params.column.isSortAscending()?"flex":"none"}configSortListener(){this.params.enableSorting&&(this.sortUpIcon=this.element.querySelector("#ez-grid-sort-icon-ascendente"),this.sortDownIcon=this.element.querySelector("#ez-grid-sort-icon-descendente"),this.onSortChangedListener=this.configSortIcon.bind(this),this.params.column.addEventListener("sortChanged",this.onSortChangedListener),this.configSortIcon())}onSortClick(t){this.params.progressSort(t.shiftKey)}configSortClick(){this.params.column.getColDef().sortable&&(this.headerContainer=this.element.querySelector("#ez-header-container"),this.onSortClickListener=this.onSortClick.bind(this),this.headerContainer.addEventListener("click",this.onSortClickListener))}onMenuClick(){this.params.showColumnMenu(this.menuButton)}configMenuClick(){this.menuButton=this.element.querySelector("#ez-grid-menu-icon"),this.onMenuClickListener=this.onMenuClick.bind(this),this.menuButton.addEventListener("click",this.onMenuClickListener)}getGui(){return this.element}destroy(){this.onMenuClickListener&&this.menuButton.removeEventListener("click",this.onMenuClickListener),this.onSortClickListener&&this.headerContainer.removeEventListener("click",this.onSortClickListener),this.onFilterButtonClickListener&&this.filterButton.removeEventListener("click",this.onFilterButtonClickListener),this.params.column.removeEventListener("sortChanged",this.onSortChangedListener),this.params.column.removeEventListener("applyFilterColumnOptions",this.onFilterAppliedListener)}}class Jp{constructor(){this.DEFAULT_COLOR="transparent",this._eGui=void 0}init(t){this.renderStatus(t)}refresh(t){return this.renderStatus(t),!1}destroy(){this._eGui=void 0}getGui(){return this._eGui}resolveColor(t,i){let n;if(t instanceof Function)n=t(i);else{const e=Object.keys(t)[0],r=t[e],o=i[e];n=null!=r&&null!=o&&r[o]}return n||this.DEFAULT_COLOR}renderStatus(t){const{data:i,statusResolver:n}=null!=t?t:{};if(null==n)return;const e=this.resolveColor(n,i);this._eGui=document.createElement("div"),this._eGui.innerHTML=`\n <span class="ez-grid__cell-status" style="background-color: ${e||""};"></span>\n `}}class Zp{updateCheckbox(){this.updatingValue=!0;try{const t=this.headerCheckStatusGetter();this.checkBox.indeterminate=null==t,this.checkBox.value=t}finally{this.updatingValue=!1}}init(t){t.context.selectionHeader=this;const i=t.context.headerCheckStatusSetter;this.headerCheckStatusGetter=t.context.headerCheckStatusGetter,this.element=document.createElement("div"),this.element.classList.add("ag-header__selection-checkbox"),this.checkBox=document.createElement("ez-check"),this.checkBox.style.setProperty("--ez-check--focus--background-color","transparent"),this.checkBox.style.setProperty("--ez-check--hover--background-color","transparent"),this.element.append(this.checkBox),this.updateCheckbox(),this.element.addEventListener("ezChange",(t=>{this.updatingValue||i(t.detail)}))}getGui(){return this.element}destroy(){this.element.remove(),this.element=null}refresh(t){return!1}}const Xp=(t,i,n,e)=>Object.assign(Object.assign({},P(t)),{eGridCell:i,dataUnit:n,editionManager:e}),Qp=({name:t,contextName:i})=>{const n=c.parseElement(`<ez-text-input\n class="ez-grid grid_editor"\n data-field-name=${t}\n data-context-name=${i}\n mode="slim"\n />`);return n.autoFocus=!0,n};function tg(t,i,n){const e=c.parseElement(`<ez-number-input\n class="ez-grid grid_editor"\n enabled=${!t}\n precision=${i}\n pretty-precision=${n}\n mode="slim"\n />`);return e.valueGetter=()=>e.getValueAsync(),e.autoFocus=!0,e}function ig(t){let i=t;for(;i;){const t=i.querySelector("[ref=eBodyViewport]");if(t)return t.getBoundingClientRect().bottom;i=i.parentElement}}const ng=new Map([[!0,{value:"S",label:"Sim"}],[!1,{value:"N",label:"Não"}]]),eg=({required:t,props:i,eGridCell:n})=>{const e=null==i?void 0:i.options;let r;if("string"==typeof e){const t=JSON.parse(e);r=Object.keys(t).map((i=>({value:i,label:t[i]})))}else r=e;const o=c.parseElement(`<ez-combo-box\n class="grid_editor"\n suppress-empty-option=${t}\n mode="slim"\n />`);return o.options=r,o.stopPropagateEnterKeyEvent=!0,o.listOptionsPosition={verticalPosition:29,bottomLimit:ig(n),hardPosition:!0},o.autoFocus=!0,o},rg=t=>{const i=eg(Object.assign(Object.assign({},t),{props:Object.assign(Object.assign({},t.props),{options:Array.from(ng.values())})}));return i.valueGetter=()=>{const t=i.value;if(null!=t)return"S"==t.value},i.valueSetter=t=>{null!=t&&(i.value=ng.get(t))},i},og=new Map;og.set(h.DATE,(()=>{const t=c.parseElement('<ez-date-input\n class="ez-grid grid_editor"\n mode="slim"\n data-is-fixed="true"\n />');return t.valueGetter=()=>t.getValueAsync(),t.autoFocus=!0,t})),og.set(h.TIME,(({readOnly:t})=>{const i=c.parseElement(`<ez-time-input\n class="ez-grid grid_editor"\n enabled=${!t}\n mode="slim"\n />`);return i.valueGetter=()=>{const t=i.value;return parseInt(t)<=2359?t:null},i.valueSetter=t=>{const n=parseInt(t)<=2359;return i.value=n?t:null},i})),og.set(h.DATETIME,(({readOnly:t})=>{const i=c.parseElement(`<ez-date-time-input\n class="ez-grid grid_editor"\n mode="slim"\n enabled=${!t}\n data-is-fixed="true"\n />`);return i.valueGetter=()=>i.getValueAsync(),i})),og.set(h.DECIMALNUMBER,(({readOnly:t,props:i})=>{var n,e;const r=Number(null!==(n=null==i?void 0:i.precision)&&void 0!==n?n:2);return tg(t,r,Number(null!==(e=null==i?void 0:i.prettyPrecision)&&void 0!==e?e:r))})),og.set(h.INTEGERNUMBER,(({readOnly:t})=>tg(t,0,0))),og.set(h.SWITCH,rg),og.set(h.CHECKBOX,rg),og.set(h.OPTIONSELECTOR,eg),og.set(h.LONGTEXT,(({eGridCell:t,editionManager:i})=>{const n=c.parseElement('<ez-text-area\n can-show-error="false"\n enable-resize="true"\n />');return n.addEventListener("keydown",(t=>function(t,i,n){if(function(t){return[t.key,t.code].includes("Enter")}(t)){if(t.ctrlKey)return i.appendTextToSelection("\n"),void t.preventDefault();n.navigateByEnterKey(t)}}(t,n,i))),function(t,i){const{width:n}=t.getBoundingClientRect();i.style.minWidth=(n>210?n:210)-12+"px",i.style.resize="both"}(t,n),n.isPopUp=!0,n.autoFocus=!0,n})),og.set(h.SEARCH,(({name:t,required:i,readOnly:n,eGridCell:e,dataUnit:r})=>{var o;const s=c.parseElement(`<ez-search\n class="ez-grid grid_editor"\n mode="slim"\n suppress-empty-option=${i}\n enabled=${!n}\n />`),u=a.getContextValue("__EZUI__SEARCH__OPTION__LOADER__"),h=r.getField(t);return s.optionLoader=i=>u(i,t,r),s.ensureClearButtonVisible=!0,s.suppressPreLoad=!0,s.listOptionsPosition={verticalPosition:29,bottomLimit:ig(e),hardPosition:!0},s.stopPropagateEnterKeyEvent=!0,s.ignoreLimitCharsToSearch=l.getBooleanValue(null===(o=null==h?void 0:h.properties)||void 0===o?void 0:o.ignoreLimitCharsToSearch),s.autoFocus=!0,s.valueGetter=()=>s.getValueAsync(),s})),og.set(h.SEARCHPLUS,(({name:t,required:i,readOnly:n,dataUnit:e})=>{const r=c.parseElement(`<ez-search-plus\n class="ez-grid grid_editor"\n mode="slim"\n suppress-empty-option=${i}\n enabled=${!n}\n hide-description-input=true\n />`),o=a.getContextValue("__EZUI__SEARCH__PLUS__OPTION__LOADER__");return r.optionLoader=i=>o(i,t,e),r.autoFocus=!0,r.valueGetter=()=>r.getValueAsync(),r}));class sg{init(t){this._rowData=t.data;const i=t.column.getColId(),n=t.context.dataUnit;this._fieldMetadata=Xp(n.getField(i),t.eGridCell,n,t.context.editionManager);const e=og.get(this._fieldMetadata.userInterface)||Qp;this._gui=e(this._fieldMetadata),null!=this._gui.valueSetter?this._gui.valueSetter(t.value):this._gui.value=t.value}getGui(){return this._gui}afterGuiAttached(){this.focusIn()}focusIn(){this._gui.focus(),this._gui.setFocus({selectText:!0})}getValue(){return null!=this._gui.valueGetter?this._gui.valueGetter():this._gui.value}setGuiValue(t){null!=this._gui.valueSetter?this._gui.valueSetter(t):this._gui.value=t}isPopup(){return this._gui.isPopUp}getFieldMetadata(){return this._fieldMetadata}getRecord(){return this._rowData}}class ug extends sg{init(t){var i,n;this._value=t.value,this._fieldName=t.column.getColId(),this._customEditorInstance=t.customEditorsInfo.customEditor,super.init(t),this._defaultGui=this.getDefaultGui();const e=super.getFieldMetadata();this._params={cellPossition:ig(t.eGridCell),eGridCell:t.eGridCell,value:t.value,charPress:t.charPress,currentEditor:this._defaultGui,name:this._fieldName,source:F.GRID,detailContext:t.customEditorsInfo.detailContext,setValue:t=>this.setValue(t),getValue:()=>this.getValue(),record:super.getRecord(),editorMetadata:{hidden:!1===(null===(i=e.props)||void 0===i?void 0:i.visible),label:e.label,userInterface:e.userInterface,props:e.props,optionLoader:e.optionLoader,options:(null===(n=e.props)||void 0===n?void 0:n.options)||{}}}}getDefaultGui(){const t=super.getGui();return t.value=this._value,t.onkeyup=t=>{this.setValue(t.target.value)},t}getGui(){const t=this._customEditorInstance.getEditorElement(this._params);return t?"string"==typeof t?c.parseElement(t):(this._customGui=t,t):this._defaultGui}setValue(t){this._value=t}getValue(){var t,i;return(null===(t=this._customGui)||void 0===t?void 0:t.getValue)?this._customGui.getValue():(null===(i=this._customGui)||void 0===i?void 0:i.hasAttribute("value"))?this._customGui.value:this._value}afterGuiAttached(){this.focusIn()}focusIn(){V.resolveFocus(this._customGui)}}class hg{init(t){const i=document.createElement("span");this._currentParams=t,i.textContent=t.value;const n=t.column.getColId(),e=t.context.dataUnit;this._fieldMetadata=Xp(e.getField(n),t.eGridCell,e,t.context.editionManager),this._gui=i}refresh(){try{return this._currentParams.refreshCell(),!0}catch(t){return!1}}getGui(){return this._gui}afterGuiAttached(){this.focusIn()}focusIn(){this._gui.focus(),this._gui.setFocus({selectText:!0})}getValue(){return this._currentParams.getValue()}isPopup(){return this._gui.isPopUp}getFieldMetadata(){return this._fieldMetadata}}class cg extends hg{init(t){var i,n;this._fieldName=t.column.getColId(),this._customRenderInstance=t.customRendersInfo.customRender,super.init(t);const e=super.getFieldMetadata();this._params={value:t.value,charPress:"",currentRender:super.getGui(),name:this._fieldName,source:k.GRID,getValue:()=>t.getValue(),detailContext:t.customRendersInfo.detailContext,renderMetadata:{hidden:!1===(null===(i=e.props)||void 0===i?void 0:i.visible),label:e.label,userInterface:e.userInterface,props:e.props,optionLoader:e.optionLoader,options:(null===(n=e.props)||void 0===n?void 0:n.options)||{}}}}getGui(){const t=this._customRenderInstance.getRenderElement(this._params);return t?"string"==typeof t?c.parseElement(t):t:super.getGui()}}class ag{constructor(t,i,n,e,r,o,s,u,h){this._inProgressChanges=[],this._dataUnit=t,this._recordValidationProcessor=new D(this._dataUnit,{getRequiredFields:()=>this.getRequiredFields(),markAsInvalid:(t,i)=>{this.pushInvalidCell(t,i)},getMessageForField:()=>null},n),this._useEnterLikeTab=i,this._editionIsDisabled=e,this._enableContinuousInsert=s,this._enableGridInsert=u,this._customEditors=r,this._customRenders=o,this._lockerId=h}configureGrid(t){return this._gridOptions=t,t.readOnlyEdit=!0,t.onCellEditRequest=t=>this.onCellEditRequest(t),t.onCellEditingStarted=async t=>{var i;this._dataUnit.hasNewRecord()?this.handleCellEditingStartedRowAdd(t):this._lastCellOpened=this._lastCellEdited={rowIndex:t.rowIndex,column:t.column,rowPinned:void 0},null===(i=this._currentEditLock)||void 0===i||i.call(this),this._currentEditLock=f.lock(this._lockerId,d.TASKBAR_CLICK)},t.onCellEditingStopped=()=>{var t;null===(t=this._currentEditLock)||void 0===t||t.call(this)},t.onCellKeyDown=t=>{t.event&&t.column&&this.onCellKeyDown(t)},t.isRowSelectable=t=>this.isSelectableRow(t),t.onCellFocused=()=>this.lockFocusWhenAddRow(),t}updateCurrentEditorGuiValue(t){const i=this._gridOptions.api.getCellEditorInstances();if(!i||!i.length)return;const n=i[0],e=n.getFieldMetadata();n.setGuiValue(t[e.name])}lockFocusWhenAddRow(){var t,i,n,e;const r=this._gridOptions.api,o=r.getFocusedCell(),s=null==o?void 0:o.rowIndex,u=null===(i=null===(t=this._dataUnit.getAddedRecords())||void 0===t?void 0:t[0])||void 0===i?void 0:i.__record__id__,h=r.getRowNode(u);if(!this._dataUnit.hasNewRecord()||s==(null==h?void 0:h.rowIndex))return;const c=null!==(e=null!==(n=this._lastCellOpened)&&void 0!==n?n:this._lastCellEdited)&&void 0!==e?e:this._lastCellClicked;(null==c?void 0:c.rowIndex)<(null==h?void 0:h.rowIndex)||(r.clearFocusedCell(),c&&null!=(null==h?void 0:h.rowIndex)&&(c.rowIndex=null==h?void 0:h.rowIndex,this.focusOnCell(c)))}handleCellEditingStartedRowAdd(t){var i,n,e,r,o;const s=null===(i=t.node)||void 0===i?void 0:i.id,u=null===(e=null===(n=this._dataUnit.getAddedRecords())||void 0===n?void 0:n[0])||void 0===e?void 0:e.__record__id__;if(s==u)return void(this._lastCellOpened=this._lastCellEdited={rowIndex:t.rowIndex,column:null==t?void 0:t.column,rowPinned:void 0});t.api.stopEditing();const h=null===(r=t.api.getRowNode(u))||void 0===r?void 0:r.rowIndex;this._lastCellOpened=this._lastCellEdited={rowIndex:h,column:null===(o=this._lastCellEdited)||void 0===o?void 0:o.column,rowPinned:void 0}}isSelectableRow(t){return!this._dataUnit.hasNewRecord()||!!this._dataUnit.isNewRecord(t.id)}canContinuousInsert(){var t;return this._enableContinuousInsert&&this._dataUnit.records.length-1===(null===(t=this._lastCellEdited)||void 0===t?void 0:t.rowIndex)}async proceedAutoSave(){var t;if(await new Promise((t=>setTimeout(t,100))),this._inProgressChanges.length&&await Promise.all(null===(t=this._inProgressChanges)||void 0===t?void 0:t.map((({promise:t})=>t))),!this._dataUnit.isDirty())return this.saveSuccess(),!0;if(null==this._dataUnit.getSelectedRecord())return!0;this.clearInvalidCells(!1);try{return await this._recordValidationProcessor.validate(!0),await this.saveDataUnit(),this.saveSuccess(),!0}catch(t){return this.saveFail(t),!1}}async saveDataUnit(){return await this._dataUnit.saveData(),!0}async recordValidate(){if(this._dataUnit.isDirty()){try{this.clearInvalidCells(!1),await this._recordValidationProcessor.validate(!1)}catch(t){}this._gridOptions.api.refreshCells({force:!0})}}navigateByEnterKey(t){const i=t.shiftKey;if(this._useEnterLikeTab)i?this._gridOptions.api.tabToPreviousCell(t):this._gridOptions.api.tabToNextCell(t);else{const t=this._gridOptions.api.getEditingCells()[0];if(t){let{rowIndex:n}=t;this.nextEditionRow(n,t.column,i)}}}getComponents(){return{ezCellEditor:sg}}verifyClickToEdition(t,i){var n,e;const r=null===(n=this._dataUnit.getSelectedRecord())||void 0===n?void 0:n.__record__id__;this._dataUnit.hasNewRecord()&&r&&(null===(e=t.getRowNode(r))||void 0===e?void 0:e.rowIndex)!=i.rowIndex||(this.isSecondClick(i)&&t.startEditingCell({rowIndex:i.rowIndex,colKey:i.column.getColId()}),this._lastCellClicked=i)}configureColumn(t){return t.cellEditor="ezCellEditor",0!=t.editable&&(t.editable=t=>this.canEdit(t)),t.suppressKeyboardEvent=t=>t.event.key===xr.ESCAPE&&t.editing?this._dataUnit.isDirty():t.event.key===xr.ENTER,t.cellEditorSelector=t=>{var i;if(null===(i=this._customEditors)||void 0===i?void 0:i.has(t.colDef.field)){const i=this._customEditors.get(t.colDef.field);return{component:ug,params:{customEditorsInfo:i}}}},t.cellRendererSelector=t=>{var i;if(null===(i=this._customRenders)||void 0===i?void 0:i.has(t.colDef.field)){const i=this._customRenders.get(t.colDef.field);return{component:cg,params:{customRendersInfo:i}}}},t}getRequiredFields(){const t=this.getFormRequiredFields();return this._gridOptions.columnApi.getAllDisplayedColumns().filter((i=>{const n=this._dataUnit.getField(i.getColId());return n&&n.required||t.includes(i.getColId())})).map((t=>t.getColId()))}getFormRequiredFields(){const t=[];return I.getDataBindersByDataUnit(this._dataUnit).forEach((i=>{t.push(...i.getFormRequiredFields())})),t}saveSuccess(){var t;this.focusOnCell(this._targetEditionCell),void 0!==(null===(t=this._targetEditionCell)||void 0===t?void 0:t.rowIndex)&&this._dataUnit.setSelectionByIndex([this._targetEditionCell.rowIndex]),this._lastCellEdited=void 0,this._targetEditionCell=void 0,this._isGridEdition=!1}saveFail(t){var i;if(this.focusOnCell(null!==(i=this._lastCellOpened)&&void 0!==i?i:this._lastCellEdited),this._isGridEdition=!1,t)throw t}focusOnCell(t){var i;if(null==t)return;const{rowIndex:n,column:e}=t;null===(i=this._gridOptions.api.getDisplayedRowAtIndex(n))||void 0===i||i.setSelected(!0,!0),this._gridOptions.api.clearRangeSelection(),this._gridOptions.api.addCellRange({rowStartIndex:n,rowEndIndex:n,columns:[e]}),this._gridOptions.api.startEditingCell({colKey:e.getColId(),rowIndex:n}),this._gridOptions.api.setFocusedCell(n,e.getColId());const r=this._gridOptions.api.getCellEditorInstances()[0];r&&r.focusIn()}onCellKeyDown(t){const i=t.event;switch(i.key){case xr.ENTER:this.processEnterKey(i,t);break;case xr.UP:this.editPreviousRow(t.api);break;case xr.DOWN:this.editNextRow(t.api)}}processEnterKey(t,i){i.api.getEditingCells()[0]?this.navigateByEnterKey(t):i.api.startEditingCell({colKey:i.column.getColId(),rowIndex:i.rowIndex})}nextEditionRow(t,i,n){if(n)(t-=1)<0&&(t=this._dataUnit.records.length-1);else{const i=t;(t+=1)>=this._dataUnit.records.length&&(t=this._enableGridInsert?i:0)}this._targetEditionCell=new lg(t,i,!0),this.finishEdition()}editPreviousRow(t){this.moveEditionVertically(t,-1)}editNextRow(t){this.moveEditionVertically(t,1)}moveEditionVertically(t,i){if(this._dataUnit.hasNewRecord()&&this._isGridEdition)return;const n=t.getEditingCells()[0];if(!n)return;const e=n.rowIndex+i;t.getDisplayedRowAtIndex(e)&&(this._targetEditionCell=new lg(e,n.column,i<0),this.finishEdition())}finishEdition(){this._gridOptions.api.stopEditing(),setTimeout((()=>{this.proceedAutoSave()}),0)}canEdit(t){return!this._editionIsDisabled()&&this.isColEditable(t.colDef.field)}isColEditable(t){const i=this._dataUnit.getField(t);return!(!i||this.isTypeFile(i)||i.readOnly)}isTypeFile(t){return t.userInterface===h.FILE}isSecondClick(t){return!!this._lastCellClicked&&this._lastCellClicked.column==t.column&&this._lastCellClicked.rowIndex==t.rowIndex}onCellEditRequest(t){var i;const n=t.newValue;if(t.oldValue!=n){if(n instanceof Promise){const i={promise:void 0,resolve:()=>{}};return i.promise=new Promise((t=>{i.resolve=t})),this._inProgressChanges.push(i),void this.handlePromiseValue(t,n)}this.updateCellValue(t,n)}else null===(i=this._currentEditLock)||void 0===i||i.call(this)}async handlePromiseValue(t,i){const n=t.colDef.field,e=this._dataUnit.getField(t.colDef.colId),r=(null==e?void 0:e.userInterface)===h.SEARCH?i:t.oldValue;t.node.setData(Object.assign(Object.assign({},t.data),{[n]:r}));const o=await i;return this.updateCellValue(t,o)}async updateCellValue(t,i){var n,e,r;const o=t.colDef.field,s=this._dataUnit.getField(o);""==i&&i!=this._dataUnit.getFieldValue(o)&&(null==s?void 0:s.userInterface)===h.SEARCH&&(i=this._dataUnit.getFieldValue(o));const u={[o]:i},c=null===(n=null==s?void 0:s.properties)||void 0===n?void 0:n[H];l.isEmpty(c)||(u[c]=null==i?void 0:i.label),t.node.setData(Object.assign(Object.assign({},t.data),{[o]:i})),null===(e=this._currentEditLock)||void 0===e||e.call(this),t.oldValue!==i&&(this._isGridEdition=!0,await this._dataUnit.setFieldValue(o,i,[t.data.__record__id__],{suppressCreateNewRecord:!0}),this._lastCellEdited={rowIndex:t.rowIndex,column:t.column,rowPinned:void 0}),null===(r=this._inProgressChanges)||void 0===r||r.forEach((({resolve:t})=>t(i)))}setCellEditors(t){var i;this._customEditors=t,null===(i=this._gridOptions)||void 0===i||i.api.stopEditing()}setCellRenders(t){this._customRenders=t}pushInvalidCell(t,i){this._invalidCells.push({field:t,recordId:i}),this._nextInvalidCell=this._invalidCells[0]}getInvalidCells(){return this._invalidCells}getNextInvalidCell(){return this._nextInvalidCell}async processContinuousInsert(){this.canContinuousInsert()&&this._dataUnit.addRecord()}clearInvalidCells(t){this._invalidCells=[],this._nextInvalidCell=void 0,t&&(this._isGridEdition=!1)}setEnableContinuousInsert(t){this._enableContinuousInsert=t}hasInvalidField(t,i){return!!this.hasInvalidCell()&&(this._nextInvalidCell=this._invalidCells[0],this._nextInvalidCell.field.name===t&&this._nextInvalidCell.recordId===i)}hasInvalidCell(){var t,i,n;const e=(null===(t=this._invalidCells)||void 0===t?void 0:t.length)>0,r=null===(i=this._invalidCells)||void 0===i?void 0:i.filter((()=>{})),o=null===(n=this._invalidCells)||void 0===n?void 0:n.filter((()=>{}));return!!(e&&r&&o)}}class lg{constructor(t,i,n){this.rowPinned=null,this.rowIndex=t,this.column=i,this.backwards=n}}var fg,dg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),vg=function(){return vg=Object.assign||function(t){for(var i,n=1,e=arguments.length;n<e;n++)for(var r in i=arguments[n])Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r]);return t},vg.apply(this,arguments)},pg=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},gg=function(t,i){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var e,r,o=n.call(t),s=[];try{for(;(void 0===i||i-- >0)&&!(e=o.next()).done;)s.push(e.value)}catch(t){r={error:t}}finally{try{e&&!e.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},mg=function(){for(var t=[],i=0;i<arguments.length;i++)t=t.concat(gg(arguments[i]));return t},bg=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.cellRanges=[],i.bodyScrollListener=i.onBodyScroll.bind(i),i.dragging=!1,i.intersectionRange=!1,i}return dg(i,t),i.prototype.init=function(){var t=this;this.addManagedListener(this.eventService,xi.EVENT_NEW_COLUMNS_LOADED,(function(){return t.onColumnsChanged()})),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_VISIBLE,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_VALUE_CHANGED,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PIVOT_MODE_CHANGED,(function(){return t.removeAllCellRanges()})),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_ROW_GROUP_CHANGED,(function(){return t.removeAllCellRanges()})),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PIVOT_CHANGED,(function(){return t.removeAllCellRanges()})),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_GROUP_OPENED,this.refreshLastRangeStart.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_MOVED,this.refreshLastRangeStart.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PINNED,this.refreshLastRangeStart.bind(this)),this.ctrlsService.whenReady((function(){var i=t.ctrlsService.getGridBodyCtrl();t.autoScrollService=new lh({scrollContainer:i.getBodyViewportElement(),scrollAxis:"xy",getVerticalPosition:function(){return i.getScrollFeature().getVScrollPosition().top},setVerticalPosition:function(t){return i.getScrollFeature().setVerticalScrollPosition(t)},getHorizontalPosition:function(){return i.getScrollFeature().getHScrollPosition().left},setHorizontalPosition:function(t){return i.getScrollFeature().setHorizontalScrollPosition(t)},shouldSkipVerticalScroll:function(){return t.gridOptionsWrapper.getDomLayout()!==Vt.DOM_LAYOUT_NORMAL},shouldSkipHorizontalScroll:function(){return i.getScrollFeature().isHorizontalScrollShowing()}})}))},i.prototype.onColumnsChanged=function(){var t=this;this.refreshLastRangeStart();var i=this.columnModel.getAllDisplayedColumns();this.cellRanges.forEach((function(n){var e=n.columns;n.columns=n.columns.filter((function(t){return t.isVisible()&&-1!==i.indexOf(t)})),!Wr.areEqual(e,n.columns)&&t.dispatchChangedEvent(!1,!0,n.id)}));var n=this.cellRanges.length;this.cellRanges=this.cellRanges.filter((function(t){return t.columns.length>0})),n>this.cellRanges.length&&this.dispatchChangedEvent(!1,!0)},i.prototype.refreshLastRangeStart=function(){var t=Wr.last(this.cellRanges);t&&this.refreshRangeStart(t)},i.prototype.isContiguousRange=function(t){var i=t.columns;if(!i.length)return!1;var n=this.columnModel.getAllDisplayedColumns(),e=i.map((function(t){return n.indexOf(t)})).sort((function(t,i){return t-i}));return Wr.last(e)-e[0]+1===i.length},i.prototype.getRangeStartRow=function(t){return t.startRow&&t.endRow?this.rowPositionUtils.before(t.startRow,t.endRow)?t.startRow:t.endRow:{rowIndex:0,rowPinned:this.pinnedRowModel.getPinnedTopRowCount()>0?Vt.PINNED_TOP:null}},i.prototype.getRangeEndRow=function(t){if(t.startRow&&t.endRow)return this.rowPositionUtils.before(t.startRow,t.endRow)?t.endRow:t.startRow;var i=this.pinnedRowModel.getPinnedBottomRowCount();return i>0?{rowIndex:i-1,rowPinned:Vt.PINNED_BOTTOM}:{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}},i.prototype.setRangeToCell=function(t,i){if(void 0===i&&(i=!1),this.gridOptionsWrapper.isEnableRangeSelection()){var n=this.calculateColumnsBetween(t.column,t.column);if(n){(this.gridOptionsWrapper.isSuppressMultiRangeSelection()||!i||Wr.missing(this.cellRanges))&&this.removeAllCellRanges(!0);var e={rowIndex:t.rowIndex,rowPinned:t.rowPinned};this.cellRanges.push({startRow:e,endRow:e,columns:n,startColumn:t.column}),this.setNewestRangeStartCell(t),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}}},i.prototype.extendLatestRangeToCell=function(t){if(!this.isEmpty()&&this.newestRangeStartCell){var i=Wr.last(this.cellRanges);this.updateRangeEnd(i,t)}},i.prototype.updateRangeEnd=function(t,i,n){void 0===n&&(n=!1);var e=this.calculateColumnsBetween(t.startColumn,i.column);e&&!this.isLastCellOfRange(t,i)&&(t.columns=e,t.endRow={rowIndex:i.rowIndex,rowPinned:i.rowPinned},n||this.dispatchChangedEvent(!0,!0,t.id))},i.prototype.refreshRangeStart=function(t){var i=t.startColumn,n=t.columns,e=function(i,n){var e=t.columns.filter((function(t){return t!==i}));i?(t.startColumn=i,t.columns=n?mg([i],e):mg(e,[i])):t.columns=e},r=this.getRangeEdgeColumns(t),o=r.left,s=r.right;i===n[0]&&i!==o?e(o,!0):i===Wr.last(n)&&i===s&&e(s,!1)},i.prototype.getRangeEdgeColumns=function(t){var i=this.columnModel.getAllDisplayedColumns(),n=t.columns.map((function(t){return i.indexOf(t)})).filter((function(t){return t>-1})).sort((function(t,i){return t-i}));return{left:i[n[0]],right:i[Wr.last(n)]}},i.prototype.extendLatestRangeInDirection=function(t){if(!this.isEmpty()&&this.newestRangeStartCell){var i=t.key,n=t.ctrlKey||t.metaKey,e=Wr.last(this.cellRanges),r=this.newestRangeStartCell,o=e.columns[0],s=Wr.last(e.columns),u=this.cellNavigationService.getNextCellToFocus(i,{column:r.column===o?s:o,rowIndex:e.endRow.rowIndex,rowPinned:e.endRow.rowPinned},n);if(u)return this.setCellRange({rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:u.rowIndex,rowEndPinned:u.rowPinned,columnStart:r.column,columnEnd:u.column}),u}},i.prototype.setCellRange=function(t){this.gridOptionsWrapper.isEnableRangeSelection()&&(this.removeAllCellRanges(!0),this.addCellRange(t))},i.prototype.setCellRanges=function(t){var i=this;Wr.shallowCompare(this.cellRanges,t)||(this.removeAllCellRanges(!0),t.forEach((function(t){t.columns&&t.startRow&&i.setNewestRangeStartCell({rowIndex:t.startRow.rowIndex,rowPinned:t.startRow.rowPinned,column:t.columns[0]}),i.cellRanges.push(t)})),this.dispatchChangedEvent(!1,!0))},i.prototype.setNewestRangeStartCell=function(t){this.newestRangeStartCell=t},i.prototype.clearCellRangeCellValues=function(t){var i=this;t||(t=this.cellRanges),t.forEach((function(t){i.forEachRowInRange(t,(function(n){var e=i.rowPositionUtils.getRowNode(n);if(e)for(var r=0;r<t.columns.length;r++){var o=i.columnModel.getGridColumn(t.columns[r]);if(!o||!o.isCellEditable(e))return;e.setDataValue(o,null,"rangeService")}}))}))},i.prototype.createCellRangeFromCellRangeParams=function(t){var i,n=this,e=!1;if(t.columns)i=t.columns.map((function(t){return n.columnModel.getColumnWithValidation(t)})).filter((function(t){return t}));else{var r=this.columnModel.getColumnWithValidation(t.columnStart),o=this.columnModel.getColumnWithValidation(t.columnEnd);if(!r||!o)return;(i=this.calculateColumnsBetween(r,o))&&i.length&&(e=i[0]!==r)}if(i)return{startRow:null!=t.rowStartIndex?{rowIndex:t.rowStartIndex,rowPinned:t.rowStartPinned||null}:void 0,endRow:null!=t.rowEndIndex?{rowIndex:t.rowEndIndex,rowPinned:t.rowEndPinned||null}:void 0,columns:i,startColumn:e?Wr.last(i):i[0]}},i.prototype.addCellRange=function(t){if(this.gridOptionsWrapper.isEnableRangeSelection()){var i=this.createCellRangeFromCellRangeParams(t);i&&(i.startRow&&this.setNewestRangeStartCell({rowIndex:i.startRow.rowIndex,rowPinned:i.startRow.rowPinned,column:i.startColumn}),this.cellRanges.push(i),this.dispatchChangedEvent(!1,!0,i.id))}},i.prototype.getCellRanges=function(){return this.cellRanges},i.prototype.isEmpty=function(){return 0===this.cellRanges.length},i.prototype.isMoreThanOneCell=function(){var t=this.cellRanges.length;if(0===t)return!1;if(t>1)return!0;var i=this.cellRanges[0],n=this.getRangeStartRow(i),e=this.getRangeEndRow(i);return n.rowPinned!==e.rowPinned||n.rowIndex!==e.rowIndex||1!==i.columns.length},i.prototype.areAllRangesAbleToMerge=function(){var t,i,n,e=this,r=new Map;if(this.cellRanges.length<=1)return!0;this.cellRanges.forEach((function(t){e.forEachRowInRange(t,(function(i){var n=(i.rowPinned||"normal")+"_"+i.rowIndex,e=r.get(n),o=t.columns.map((function(t){return t.getId()}));if(e){var s=o.filter((function(t){return-1===e.indexOf(t)}));e.push.apply(e,mg(s))}else r.set(n,o)}))}));try{for(var o=function(t){var i="function"==typeof Symbol&&Symbol.iterator,n=i&&t[i],e=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")}(r.values()),s=o.next();!s.done;s=o.next()){var u=s.value.sort().join();if(void 0!==n){if(n!==u)return!1}else n=u}}catch(i){t={error:i}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return!0},i.prototype.forEachRowInRange=function(t,i){for(var n=this.getRangeStartRow(t),e=this.getRangeEndRow(t),r=n;r&&(i(r),!this.rowPositionUtils.sameRow(r,e));)r=this.cellNavigationService.getRowBelow(r)},i.prototype.removeAllCellRanges=function(t){this.isEmpty()||(this.onDragStop(),this.cellRanges.length=0,t||this.dispatchChangedEvent(!1,!0))},i.prototype.onBodyScroll=function(){this.dragging&&this.lastMouseEvent&&this.onDragging(this.lastMouseEvent)},i.prototype.isCellInAnyRange=function(t){return this.getCellRangeCount(t)>0},i.prototype.isCellInSpecificRange=function(t,i){var n=null!==i.columns&&Wr.includes(i.columns,t.column),e=this.isRowInRange(t.rowIndex,t.rowPinned,i);return n&&e},i.prototype.isLastCellOfRange=function(t,i){var n=t.startRow,e=t.endRow,r=this.rowPositionUtils.before(n,e)?e:n,o=i.rowIndex===r.rowIndex&&i.rowPinned===r.rowPinned,s=t.columns[0],u=Wr.last(t.columns);return i.column===(t.startColumn===s?u:s)&&o},i.prototype.isBottomRightCell=function(t,i){var n=this.columnModel.getAllDisplayedColumns(),e=t.columns.map((function(t){return n.indexOf(t)})).sort((function(t,i){return t-i})),r=t.startRow,o=t.endRow,s=this.rowPositionUtils.before(r,o)?o:r,u=n.indexOf(i.column)===Wr.last(e),h=i.rowIndex===s.rowIndex&&Wr.makeNull(i.rowPinned)===Wr.makeNull(s.rowPinned);return u&&h},i.prototype.getCellRangeCount=function(t){var i=this;return this.isEmpty()?0:this.cellRanges.filter((function(n){return i.isCellInSpecificRange(t,n)})).length},i.prototype.isRowInRange=function(t,i,n){var e=this.getRangeStartRow(n),r=this.getRangeEndRow(n),o={rowIndex:t,rowPinned:i||null};if(o.rowIndex===e.rowIndex&&o.rowPinned==e.rowPinned||o.rowIndex===r.rowIndex&&o.rowPinned==r.rowPinned)return!0;var s=!this.rowPositionUtils.before(o,e),u=this.rowPositionUtils.before(o,r);return s&&u},i.prototype.getDraggingRange=function(){return this.draggingRange},i.prototype.onDragStart=function(t){if(this.gridOptionsWrapper.isEnableRangeSelection()){var i=t.shiftKey,n=t.ctrlKey||t.metaKey,e=!this.gridOptionsWrapper.isSuppressMultiRangeSelection()&&n,r=i&&Wr.existsAndNotEmpty(this.cellRanges);if(e||r&&!Wr.exists(Wr.last(this.cellRanges).type)||this.removeAllCellRanges(!0),this.cellHoverListener=this.addManagedListener(this.ctrlsService.getGridCtrl().getGui(),"mousemove",this.updateValuesOnMove.bind(this)),this.updateValuesOnMove(t),this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=t,this.intersectionRange=e&&this.getCellRangeCount(this.lastCellHovered)>1,r||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=Wr.last(this.cellRanges);else{var o={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned};this.draggingRange={startRow:o,endRow:o,columns:[this.lastCellHovered.column],startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsService.getGridBodyCtrl().addScrollEventListener(this.bodyScrollListener),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}}},i.prototype.intersectLastRange=function(t){var i=this;if(!(t&&this.dragging||this.gridOptionsWrapper.isSuppressMultiRangeSelection()||this.isEmpty())){var n=Wr.last(this.cellRanges),e=this.getRangeStartRow(n),r=this.getRangeEndRow(n),o=[];this.cellRanges.slice(0,-1).forEach((function(t){var s=i.getRangeStartRow(t),u=i.getRangeEndRow(t),h=t.columns,c=h.filter((function(t){return-1===n.columns.indexOf(t)}));if(c.length!==h.length)if(i.rowPositionUtils.before(r,s)||i.rowPositionUtils.before(u,e))o.push(t);else{var a=o.length;if(i.rowPositionUtils.before(s,e)){var l={columns:mg(h),startColumn:n.startColumn,startRow:vg({},s),endRow:i.cellNavigationService.getRowAbove(e)};o.push(l)}if(c.length>0){var f={columns:c,startColumn:Wr.includes(c,n.startColumn)?n.startColumn:c[0],startRow:i.rowPositionUtils.rowMax([vg({},e),vg({},s)]),endRow:i.rowPositionUtils.rowMin([vg({},r),vg({},u)])};o.push(f)}i.rowPositionUtils.before(r,u)&&o.push({columns:mg(h),startColumn:n.startColumn,startRow:i.cellNavigationService.getRowBelow(r),endRow:vg({},u)}),o.length-a==1&&(o[o.length-1].id=t.id)}else o.push(t)})),this.cellRanges=o,t&&this.dispatchChangedEvent(!1,!0)}},i.prototype.updateValuesOnMove=function(t){var i=this.mouseEventService.getCellPositionForEvent(t);this.cellHasChanged=!1,!i||this.lastCellHovered&&this.cellPositionUtils.equals(i,this.lastCellHovered)||(this.lastCellHovered&&(this.cellHasChanged=!0),this.lastCellHovered=i)},i.prototype.onDragging=function(t){var i=this;if(this.dragging&&t){this.lastMouseEvent=t;var n=this.lastCellHovered,e=function(t){return n&&n.rowPinned===t&&i.newestRangeStartCell.rowPinned===t},r=e("top")||e("bottom");if(this.autoScrollService.check(t,r),this.cellHasChanged){var o=this.calculateColumnsBetween(this.newestRangeStartCell.column,n.column);o&&(this.draggingRange.endRow={rowIndex:n.rowIndex,rowPinned:n.rowPinned},this.draggingRange.columns=o,this.dispatchChangedEvent(!1,!1,this.draggingRange.id))}}},i.prototype.onDragStop=function(){if(this.cellHoverListener&&(this.cellHoverListener(),this.cellHoverListener=void 0),this.dragging){var t=this.draggingRange.id;this.autoScrollService.ensureCleared(),this.ctrlsService.getGridBodyCtrl().removeScrollEventListener(this.bodyScrollListener),this.lastMouseEvent=null,this.dragging=!1,this.draggingRange=void 0,this.lastCellHovered=void 0,this.intersectionRange&&(this.intersectionRange=!1,this.intersectLastRange()),this.dispatchChangedEvent(!1,!0,t)}},i.prototype.dispatchChangedEvent=function(t,i,n){var e=Object.freeze({type:xi.EVENT_RANGE_SELECTION_CHANGED,started:t,finished:i,id:n});this.eventService.dispatchEvent(e)},i.prototype.calculateColumnsBetween=function(t,i){var n=this.columnModel.getAllDisplayedColumns(),e=t===i,r=n.indexOf(t);if(r<0)console.warn("AG Grid: column "+t.getId()+" is not visible");else{var o=e?r:n.indexOf(i);if(!(o<0)){if(e)return[t];for(var s=Math.min(r,o),u=s===r?o:r,h=[],c=s;c<=u;c++)h.push(n[c]);return h}console.warn("AG Grid: column "+i.getId()+" is not visible")}},pg([Dt("rowModel")],i.prototype,"rowModel",void 0),pg([Dt("columnModel")],i.prototype,"columnModel",void 0),pg([Dt("mouseEventService")],i.prototype,"mouseEventService",void 0),pg([Dt("cellNavigationService")],i.prototype,"cellNavigationService",void 0),pg([Dt("pinnedRowModel")],i.prototype,"pinnedRowModel",void 0),pg([Dt("rowPositionUtils")],i.prototype,"rowPositionUtils",void 0),pg([Dt("cellPositionUtils")],i.prototype,"cellPositionUtils",void 0),pg([Dt("ctrlsService")],i.prototype,"ctrlsService",void 0),pg([Ft],i.prototype,"init",null),pg([Pt("rangeService")],i)}(Ai),wg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),yg=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Cg=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.changedCalculatedValues=!1,i.dragging=!1,i.shouldDestroyOnEndDragging=!1,i}return wg(i,t),i.prototype.init=function(){var t=this;this.dragService.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragStart:this.onDragStart.bind(this),onDragging:function(i){t.dragging=!0,t.rangeService.autoScrollService.check(i),t.changedCalculatedValues&&(t.onDrag(i),t.changedCalculatedValues=!1)},onDragStop:function(i){t.dragging=!1,t.onDragEnd(i),t.clearValues(),t.rangeService.autoScrollService.ensureCleared(),document.body.classList.remove(t.getDraggingCssClass()),t.shouldDestroyOnEndDragging&&t.destroy()}}),this.addManagedListener(this.getGui(),"mousedown",this.preventRangeExtension.bind(this))},i.prototype.isDragging=function(){return this.dragging},i.prototype.getCellCtrl=function(){return this.cellCtrl},i.prototype.setCellCtrl=function(t){this.cellCtrl=t},i.prototype.getCellRange=function(){return this.cellRange},i.prototype.setCellRange=function(t){this.cellRange=t},i.prototype.getRangeStartRow=function(){return this.rangeStartRow},i.prototype.setRangeStartRow=function(t){this.rangeStartRow=t},i.prototype.getRangeEndRow=function(){return this.rangeEndRow},i.prototype.setRangeEndRow=function(t){this.rangeEndRow=t},i.prototype.getLastCellHovered=function(){return this.lastCellHovered},i.prototype.preventRangeExtension=function(t){t.preventDefault(),t.stopPropagation()},i.prototype.onDragStart=function(){this.cellHoverListener=this.addManagedListener(this.ctrlsService.getGridCtrl().getGui(),"mousemove",this.updateValuesOnMove.bind(this)),document.body.classList.add(this.getDraggingCssClass())},i.prototype.getDraggingCssClass=function(){return"ag-dragging-"+(this.type===wh.FILL?"fill":"range")+"-handle"},i.prototype.updateValuesOnMove=function(t){var i=this.mouseEventService.getCellPositionForEvent(t);!i||this.lastCellHovered&&this.cellPositionUtils.equals(i,this.lastCellHovered)||(this.lastCellHovered=i,this.changedCalculatedValues=!0)},i.prototype.getType=function(){return this.type},i.prototype.refresh=function(t){var i=this.getCellCtrl(),n=this.getGui(),e=Wr.last(this.rangeService.getCellRanges()),r=e.startRow,o=e.endRow;if(r&&o&&(this.rowPositionUtils.before(o,r)?(this.setRangeStartRow(o),this.setRangeEndRow(r)):(this.setRangeStartRow(r),this.setRangeEndRow(o))),i!==t||!Wr.isVisible(n)){this.setCellCtrl(t);var s=t.getComp().getParentOfValue();s&&s.appendChild(n)}this.setCellRange(e)},i.prototype.clearValues=function(){this.lastCellHovered=void 0,this.removeListeners()},i.prototype.removeListeners=function(){this.cellHoverListener&&(this.cellHoverListener(),this.cellHoverListener=void 0)},i.prototype.destroy=function(){if(!this.shouldDestroyOnEndDragging&&this.isDragging())return Wr.setDisplayed(this.getGui(),!1),void(this.shouldDestroyOnEndDragging=!0);this.shouldDestroyOnEndDragging=!1,t.prototype.destroy.call(this),this.removeListeners();var i=this.getGui();i.parentElement&&i.parentElement.removeChild(i)},yg([Dt("rowRenderer")],i.prototype,"rowRenderer",void 0),yg([Dt("dragService")],i.prototype,"dragService",void 0),yg([Dt("rangeService")],i.prototype,"rangeService",void 0),yg([Dt("mouseEventService")],i.prototype,"mouseEventService",void 0),yg([Dt("columnModel")],i.prototype,"columnModel",void 0),yg([Dt("cellNavigationService")],i.prototype,"cellNavigationService",void 0),yg([Dt("navigationService")],i.prototype,"navigationService",void 0),yg([Dt("rowPositionUtils")],i.prototype,"rowPositionUtils",void 0),yg([Dt("cellPositionUtils")],i.prototype,"cellPositionUtils",void 0),yg([Dt("ctrlsService")],i.prototype,"ctrlsService",void 0),yg([Ft],i.prototype,"init",null),i}(io),Sg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Rg=function(){return Rg=Object.assign||function(t){for(var i,n=1,e=arguments.length;n<e;n++)for(var r in i=arguments[n])Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r]);return t},Rg.apply(this,arguments)},Og=function(t,i){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var e,r,o=n.call(t),s=[];try{for(;(void 0===i||i-- >0)&&!(e=o.next()).done;)s.push(e.value)}catch(t){r={error:t}}finally{try{e&&!e.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},Ag=function(t){function i(){var n=t.call(this,i.TEMPLATE)||this;return n.markedCells=[],n.cellValues=[],n.isUp=!1,n.isLeft=!1,n.isReduce=!1,n.type=wh.FILL,n}return Sg(i,t),i.prototype.updateValuesOnMove=function(i){t.prototype.updateValuesOnMove.call(this,i),this.initialXY||(this.initialXY=this.mouseEventService.getNormalisedPosition(i));var n,e=this.initialXY,r=e.x,o=e.y,s=this.mouseEventService.getNormalisedPosition(i),u=s.y,h=Math.abs(r-s.x),c=Math.abs(o-u),a=this.gridOptionsWrapper.getFillHandleDirection();(n="xy"===a?h>c?"x":"y":a)!==this.dragAxis&&(this.dragAxis=n,this.changedCalculatedValues=!0)},i.prototype.onDrag=function(){if(!this.initialPosition){var t=this.getCellCtrl();if(!t)return;this.initialPosition=t.getCellPosition()}var i=this.getLastCellHovered();i&&this.markPathFrom(this.initialPosition,i)},i.prototype.onDragEnd=function(t){if(this.initialXY=null,this.markedCells.length){var i,n="x"===this.dragAxis,e=this.getCellRange(),r=e.columns.length,o=this.getRangeStartRow(),s=this.getRangeEndRow();if(this.isUp||this.isLeft){var u=n?o:this.lastCellMarked;i=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:u.rowIndex,rowStartPinned:u.rowPinned,columnStart:n?this.lastCellMarked.column:e.columns[0],rowEndIndex:s.rowIndex,rowEndPinned:s.rowPinned,columnEnd:e.columns[r-1]})}else i=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:o.rowIndex,rowStartPinned:o.rowPinned,columnStart:e.columns[0],rowEndIndex:n?s.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:n?s.rowPinned:this.lastCellMarked.rowPinned,columnEnd:n?this.lastCellMarked.column:e.columns[r-1]});i&&(this.raiseFillStartEvent(),this.handleValueChanged(e,i,t),this.rangeService.setCellRanges([i]),this.raiseFillEndEvent(e,i))}},i.prototype.raiseFillStartEvent=function(){this.eventService.dispatchEvent({type:xi.EVENT_FILL_START})},i.prototype.raiseFillEndEvent=function(t,i){this.eventService.dispatchEvent({type:xi.EVENT_FILL_END,initialRange:t,finalRange:i})},i.prototype.handleValueChanged=function(t,i,n){var e=this,r=this.rangeService.getRangeEndRow(t),o=this.rangeService.getRangeStartRow(t),s=this.rangeService.getRangeEndRow(i),u=this.rangeService.getRangeStartRow(i),h="y"===this.dragAxis;if(!this.isReduce||this.gridOptionsWrapper.isSuppressClearOnFillReduction()){var c=!0,a=[],l=[],f=0,d=function(){a.length=0,l.length=0,f=0},v=function(i,n){var l=e.isUp?r:o,f=!1;h&&(c=!0,d());for(var v=function(){var v=e.rowPositionUtils.getRowNode(l);if(!v)return"break";h&&i?p(a,i,v,(function(){return!e.rowPositionUtils.sameRow(l,e.isUp?o:r)})):n&&(c=!0,d(),n.forEach((function(i){return p(a,i,v,(function(){return i!==(e.isLeft?t.columns[0]:Wr.last(t.columns))}))}))),f=e.rowPositionUtils.sameRow(l,e.isUp?u:s),l=e.isUp?e.cellNavigationService.getRowAbove(l):e.cellNavigationService.getRowBelow(l)};!f&&l&&"break"!==v(););},p=function(t,i,r,o){var s,u=!1;if(c)s=e.getValueFromObject(e.valueService.getValue(i,r)),l.push(s),c=o();else{var h=e.processValues(n,t,l,i,r,f++),a=h.fromUserFunction;if(s=h.value,i.isCellEditable(r)){var d=e.getValueFromObject(e.valueService.getValue(i,r));a&&d===s?u=!0:r.setDataValue(i,s,"rangeService")}}u||t.push(s)};h?t.columns.forEach((function(t){v(t)})):(g=this.isLeft?function(){for(var t=[],i=0;i<arguments.length;i++)t=t.concat(Og(arguments[i]));return t}(i.columns).reverse():i.columns,v(void 0,g))}else{var g=h?t.columns:t.columns.filter((function(t){return i.columns.indexOf(t)<0})),m=h?this.cellNavigationService.getRowBelow(s):u;m&&this.clearCellsInRange(m,r,g)}},i.prototype.clearCellsInRange=function(t,i,n){this.rangeService.clearCellRangeCellValues([{startRow:t,endRow:i,columns:n,startColumn:n[0]}])},i.prototype.processValues=function(t,i,n,e,r,o){var s,u=this.gridOptionsWrapper.getFillOperation();if(s="y"===this.dragAxis?this.isUp?"up":"down":this.isLeft?"left":"right",u){var h=u({event:t,values:i,initialValues:n,currentIndex:o,currentCellValue:this.valueService.getValue(e,r),direction:s,column:e,rowNode:r});if(!1!==h)return{value:h,fromUserFunction:!0}}var c=i.map(this.getValueFromObject),a=!c.some((function(t){var i=parseFloat(t);return isNaN(i)||i.toString()!==t.toString()}));if(t.altKey||!a){if(a&&1===n.length){var l=this.isUp||this.isLeft?-1:1;return{value:parseFloat(Wr.last(c))+1*l,fromUserFunction:!1}}return{value:c[o%c.length],fromUserFunction:!1}}return{value:Wr.last(Wr.findLineByLeastSquares(c.map(Number))),fromUserFunction:!1}},i.prototype.getValueFromObject=function(t){return null!=t&&"object"==typeof t?t.toString():t},i.prototype.clearValues=function(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,t.prototype.clearValues.call(this)},i.prototype.clearMarkedPath=function(){this.markedCells.forEach((function(t){if(t.isAlive()){var i=t.getComp();i.addOrRemoveCssClass("ag-selection-fill-top",!1),i.addOrRemoveCssClass("ag-selection-fill-right",!1),i.addOrRemoveCssClass("ag-selection-fill-bottom",!1),i.addOrRemoveCssClass("ag-selection-fill-left",!1)}})),this.markedCells.length=0,this.isUp=!1,this.isLeft=!1,this.isReduce=!1},i.prototype.clearCellValues=function(){this.cellValues.length=0},i.prototype.markPathFrom=function(t,i){if(this.clearMarkedPath(),this.clearCellValues(),"y"===this.dragAxis){if(this.rowPositionUtils.sameRow(i,t))return;var n=this.rowPositionUtils.before(i,t),e=this.getRangeStartRow(),r=this.getRangeEndRow();n&&(i.rowPinned==e.rowPinned&&i.rowIndex>=e.rowIndex||e.rowPinned!=r.rowPinned&&i.rowPinned==r.rowPinned&&i.rowIndex<=r.rowIndex)?(this.reduceVertical(t,i),this.isReduce=!0):(this.extendVertical(t,i,n),this.isReduce=!1)}else{var o=t.column,s=i.column;if(o===s)return;var u=this.columnModel.getAllDisplayedColumns(),h=u.indexOf(o),c=u.indexOf(s);c<=h&&c>=u.indexOf(this.getCellRange().columns[0])?(this.reduceHorizontal(t,i),this.isReduce=!0):(this.extendHorizontal(t,i,c<h),this.isReduce=!1)}this.lastCellMarked=i},i.prototype.extendVertical=function(t,i,n){var e=this.navigationService,r=this.rangeService,o=t;do{for(var s=this.getCellRange(),u=s.columns.length,h=0;h<u;h++){var c=s.columns[h],a=Rg(Rg({},{rowIndex:o.rowIndex,rowPinned:o.rowPinned}),{column:c}),l=r.isCellInSpecificRange(a,s),f=this.rowPositionUtils.sameRow(o,t);if(n&&(this.isUp=!0),!f){var d=e.getCellByPosition(a);if(d){this.markedCells.push(d);var v=d.getComp();l||(v.addOrRemoveCssClass("ag-selection-fill-left",0===h),v.addOrRemoveCssClass("ag-selection-fill-right",h===u-1)),v.addOrRemoveCssClass(n?"ag-selection-fill-top":"ag-selection-fill-bottom",this.rowPositionUtils.sameRow(o,i))}}}if(this.rowPositionUtils.sameRow(o,i))break}while(o=n?this.cellNavigationService.getRowAbove(o):this.cellNavigationService.getRowBelow(o))},i.prototype.reduceVertical=function(t,i){var n=t;do{for(var e=this.getCellRange(),r=e.columns.length,o=this.rowPositionUtils.sameRow(n,i),s=0;s<r;s++){var u=Rg(Rg({},{rowIndex:n.rowIndex,rowPinned:n.rowPinned}),{column:e.columns[s]}),h=this.navigationService.getCellByPosition(u);h&&(this.markedCells.push(h),h.getComp().addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(n,i)))}if(o)break}while(n=this.cellNavigationService.getRowAbove(n))},i.prototype.extendHorizontal=function(t,i,n){var e=this,r=this.columnModel.getAllDisplayedColumns(),o=r.indexOf(n?i.column:t.column),s=r.indexOf(n?this.getCellRange().columns[0]:i.column),u=n?0:1,h=r.slice(o+u,s+u),c=this.getRangeStartRow(),a=this.getRangeEndRow();h.forEach((function(t){var i=c,r=!1;do{r=e.rowPositionUtils.sameRow(i,a);var o=e.navigationService.getCellByPosition({rowIndex:i.rowIndex,rowPinned:i.rowPinned,column:t});if(o){e.markedCells.push(o);var s=o.getComp();s.addOrRemoveCssClass("ag-selection-fill-top",e.rowPositionUtils.sameRow(i,c)),s.addOrRemoveCssClass("ag-selection-fill-bottom",e.rowPositionUtils.sameRow(i,a)),n?(e.isLeft=!0,s.addOrRemoveCssClass("ag-selection-fill-left",t===h[0])):s.addOrRemoveCssClass("ag-selection-fill-right",t===Wr.last(h))}i=e.cellNavigationService.getRowBelow(i)}while(!r)}))},i.prototype.reduceHorizontal=function(t,i){var n=this,e=this.columnModel.getAllDisplayedColumns(),r=e.indexOf(i.column),o=e.indexOf(t.column),s=e.slice(r,o),u=this.getRangeStartRow(),h=this.getRangeEndRow();s.forEach((function(t){var i=u,e=!1;do{e=n.rowPositionUtils.sameRow(i,h);var r=n.navigationService.getCellByPosition({rowIndex:i.rowIndex,rowPinned:i.rowPinned,column:t});r&&(n.markedCells.push(r),r.getComp().addOrRemoveCssClass("ag-selection-fill-right",t===s[0])),i=n.cellNavigationService.getRowBelow(i)}while(!e)}))},i.prototype.refresh=function(i){var n=this.rangeService.getCellRanges()[0];n.startRow&&n.endRow?t.prototype.refresh.call(this,i):this.destroy()},i.TEMPLATE='<div class="ag-fill-handle"></div>',function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);o>3&&s&&Object.defineProperty(i,n,s)}([Dt("valueService")],i.prototype,"valueService",void 0),i}(Cg),jg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),_g=function(){return _g=Object.assign||function(t){for(var i,n=1,e=arguments.length;n<e;n++)for(var r in i=arguments[n])Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r]);return t},_g.apply(this,arguments)},Gg=function(t){function i(){var n=t.call(this,i.TEMPLATE)||this;return n.type=wh.RANGE,n.rangeFixed=!1,n}return jg(i,t),i.prototype.onDrag=function(){var t=this.getLastCellHovered();if(t){var i=this.rangeService.getCellRanges(),n=Wr.last(i);this.rangeFixed||(this.fixRangeStartEnd(n),this.rangeFixed=!0),this.endPosition={rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:t.column},2===i.length&&i[0].type===yh.DIMENSION&&n.type===yh.VALUE&&!this.rowPositionUtils.sameRow(this.endPosition,this.rangeService.getRangeEndRow(n))&&this.rangeService.updateRangeEnd(i[0],_g(_g({},this.endPosition),{column:i[0].columns[0]}),!0),this.rangeService.extendLatestRangeToCell(this.endPosition)}},i.prototype.onDragEnd=function(){var t=Wr.last(this.rangeService.getCellRanges());this.fixRangeStartEnd(t),this.rangeFixed=!1},i.prototype.fixRangeStartEnd=function(t){var i=this.rangeService.getRangeStartRow(t),n=this.rangeService.getRangeEndRow(t),e=t.columns[0];t.startRow=i,t.endRow=n,t.startColumn=e},i.TEMPLATE='<div class="ag-range-handle"></div>',i}(Cg),xg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Mg=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return xg(i,t),i.prototype.createSelectionHandle=function(t){return this.createBean(t===wh.RANGE?new Gg:new Ag)},function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s}([Pt("selectionHandleFactory")],i)}(Ai),Fg={moduleName:Nt.RangeSelectionModule,beans:[bg,Mg],agStackComponents:[{componentName:"AgFillHandle",componentClass:Ag},{componentName:"AgRangeHandle",componentClass:Gg}],dependantModules:[Kp]},kg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Pg=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Dg=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.onRowHeightChanged_debounced=Wr.debounce(i.onRowHeightChanged.bind(i),100),i.pauseStoreUpdateListening=!1,i.started=!1,i}return kg(i,t),i.prototype.ensureRowHeightsValid=function(){return!1},i.prototype.start=function(){this.started=!0;var t=this.gridOptionsWrapper.getServerSideDatasource();t&&this.setDatasource(t)},i.prototype.destroyDatasource=function(){this.datasource&&(this.datasource.destroy&&this.datasource.destroy(),this.rowRenderer.datasourceChanged(),this.datasource=void 0)},i.prototype.addEventListeners=function(){this.addManagedListener(this.eventService,xi.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverything.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_STORE_UPDATED,this.onStoreUpdated.bind(this));var t=this.resetRootStore.bind(this);this.addManagedListener(this.eventService,xi.EVENT_COLUMN_VALUE_CHANGED,t),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PIVOT_CHANGED,t),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_ROW_GROUP_CHANGED,t),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PIVOT_MODE_CHANGED,t),this.verifyProps()},i.prototype.verifyProps=function(){null!=this.gridOptionsWrapper.getInitialGroupOrderComparator()&&Wr.doOnce((function(){return console.warn("AG Grid: initialGroupOrderComparator cannot be used with Server Side Row Model. If using Full Store, then provide the rows to the grid in the desired sort order. If using Infinite Scroll, then sorting is done on the server side, nothing to do with the client.")}),"SSRM.InitialGroupOrderComparator"),this.gridOptionsWrapper.isRowSelection()&&null==this.gridOptionsWrapper.getRowIdFunc()&&Wr.doOnce((function(){return console.warn("AG Grid: getRowId callback must be provided for Server Side Row Model selection to work correctly.")}),"SSRM.SelectionNeedsRowNodeIdFunc")},i.prototype.setDatasource=function(t){this.started&&(this.destroyDatasource(),this.datasource=t,this.resetRootStore())},i.prototype.isLastRowIndexKnown=function(){var t=this.getRootStore();return!!t&&t.isLastRowIndexKnown()},i.prototype.onColumnEverything=function(){if(!this.gridOptionsWrapper.isSuppressEnterpriseResetOnNewColumns())if(this.storeParams){var t=this.columnsToValueObjects(this.columnModel.getRowGroupColumns()),i=this.columnsToValueObjects(this.columnModel.getValueColumns()),n=this.columnsToValueObjects(this.columnModel.getPivotColumns()),e=!Wr.jsonEquals(this.storeParams.sortModel,this.sortController.getSortModel()),r=!Wr.jsonEquals(this.storeParams.rowGroupCols,t),o=!Wr.jsonEquals(this.storeParams.pivotCols,n),s=!Wr.jsonEquals(this.storeParams.valueCols,i);(e||r||o||s)&&this.resetRootStore()}else this.resetRootStore()},i.prototype.destroyRootStore=function(){this.rootNode&&this.rootNode.childStore&&(this.rootNode.childStore=this.destroyBean(this.rootNode.childStore),this.nodeManager.clear())},i.prototype.refreshAfterSort=function(t,i){this.storeParams&&(this.storeParams.sortModel=t);var n=this.getRootStore();n&&(n.refreshAfterSort(i),this.onStoreUpdated())},i.prototype.resetRootStore=function(){this.destroyRootStore(),this.rootNode=new Ws(this.beans),this.rootNode.group=!0,this.rootNode.level=-1,this.datasource&&(this.storeParams=this.createStoreParams(),this.rootNode.childStore=this.createBean(this.storeFactory.createStore(this.storeParams,this.rootNode)),this.updateRowIndexesAndBounds()),this.eventService.dispatchEvent({type:xi.EVENT_ROW_DATA_UPDATED}),this.dispatchModelUpdated(!0)},i.prototype.columnsToValueObjects=function(t){var i=this;return t.map((function(t){return{id:t.getId(),aggFunc:t.getAggFunc(),displayName:i.columnModel.getDisplayNameForColumn(t,"model"),field:t.getColDef().field}}))},i.prototype.createStoreParams=function(){var t=this.columnsToValueObjects(this.columnModel.getRowGroupColumns()),i=this.columnsToValueObjects(this.columnModel.getValueColumns()),n=this.columnsToValueObjects(this.columnModel.getPivotColumns()),e=this.gridOptionsWrapper.isDynamicRowHeight();return{valueCols:i,rowGroupCols:t,pivotCols:n,pivotMode:this.columnModel.isPivotMode(),filterModel:this.filterManager.getFilterModel(),sortModel:this.sortListener.extractSortModel(),datasource:this.datasource,lastAccessedSequence:new Vr,dynamicRowHeight:e}},i.prototype.getParams=function(){return this.storeParams},i.prototype.dispatchModelUpdated=function(t){void 0===t&&(t=!1),this.eventService.dispatchEvent({type:xi.EVENT_MODEL_UPDATED,animate:!t,keepRenderedRows:!t,newPage:!1,newData:!1})},i.prototype.onStoreUpdated=function(){this.pauseStoreUpdateListening||(this.updateRowIndexesAndBounds(),this.dispatchModelUpdated())},i.prototype.onRowHeightChangedDebounced=function(){this.onRowHeightChanged_debounced()},i.prototype.onRowHeightChanged=function(){this.updateRowIndexesAndBounds(),this.dispatchModelUpdated()},i.prototype.updateRowIndexesAndBounds=function(){var t=this.getRootStore();t&&t.setDisplayIndexes(new Vr,{value:0})},i.prototype.retryLoads=function(){var t=this.getRootStore();t&&(t.retryLoads(),this.onStoreUpdated())},i.prototype.getRow=function(t){var i=this.getRootStore();if(i)return i.getRowUsingDisplayIndex(t)},i.prototype.expandAll=function(t){this.pauseStoreUpdateListening=!0,this.forEachNode((function(i){i.group&&!i.stub&&i.setExpanded(t)})),this.pauseStoreUpdateListening=!1,this.onStoreUpdated()},i.prototype.refreshAfterFilter=function(t,i){this.storeParams&&(this.storeParams.filterModel=t);var n=this.getRootStore();n&&(n.refreshAfterFilter(i),this.onStoreUpdated())},i.prototype.getRootStore=function(){if(this.rootNode&&this.rootNode.childStore)return this.rootNode.childStore},i.prototype.getRowCount=function(){var t=this.getRootStore();return t?t.getDisplayIndexEnd():0},i.prototype.getTopLevelRowCount=function(){var t=this.getRootStore();return t?t.getRowCount():1},i.prototype.getTopLevelRowDisplayedIndex=function(t){var i=this.getRootStore();return i?i.getTopLevelRowDisplayedIndex(t):t},i.prototype.getRowBounds=function(t){var i=this.getRootStore();return i?i.getRowBounds(t):{rowTop:0,rowHeight:this.gridOptionsWrapper.getRowHeightAsNumber()}},i.prototype.getRowIndexAtPixel=function(t){var i=this.getRootStore();return t<=0||!i?0:i.getRowIndexAtPixel(t)},i.prototype.isEmpty=function(){return!1},i.prototype.isRowsToRender=function(){return null!=this.getRootStore()&&this.getRowCount()>0},i.prototype.getType=function(){return Vt.ROW_MODEL_TYPE_SERVER_SIDE},i.prototype.forEachNode=function(t){var i=this.getRootStore();i&&i.forEachNodeDeep(t)},i.prototype.forEachNodeAfterFilterAndSort=function(t){var i=this.getRootStore();i&&i.forEachNodeDeepAfterFilterAndSort(t)},i.prototype.executeOnStore=function(t,i){var n=this.getRootStore();if(n){var e=n.getChildStore(t);e&&i(e)}},i.prototype.refreshStore=function(t){void 0===t&&(t={}),this.executeOnStore(t.route?t.route:[],(function(i){return i.refreshStore(1==t.purge)}))},i.prototype.getStoreState=function(){var t=[],i=this.getRootStore();return i&&i.addStoreStates(t),t},i.prototype.getNodesInRangeForSelection=function(t,i){return Wr.exists(i)&&t.parent!==i.parent?[]:t.parent.childStore.getRowNodesInRange(i,t)},i.prototype.getRowNode=function(t){var i;return this.forEachNode((function(n){n.id===t&&(i=n),n.detailNode&&n.detailNode.id===t&&(i=n.detailNode)})),i},i.prototype.isRowPresent=function(t){return!!this.getRowNode(t.id)},Pg([Dt("columnModel")],i.prototype,"columnModel",void 0),Pg([Dt("filterManager")],i.prototype,"filterManager",void 0),Pg([Dt("sortController")],i.prototype,"sortController",void 0),Pg([Dt("rowRenderer")],i.prototype,"rowRenderer",void 0),Pg([Dt("ssrmSortService")],i.prototype,"sortListener",void 0),Pg([Dt("ssrmNodeManager")],i.prototype,"nodeManager",void 0),Pg([Dt("ssrmStoreFactory")],i.prototype,"storeFactory",void 0),Pg([Dt("beans")],i.prototype,"beans",void 0),Pg([kt],i.prototype,"destroyDatasource",null),Pg([Ft],i.prototype,"addEventListeners",null),Pg([kt],i.prototype,"destroyRootStore",null),Pg([Pt("rowModel")],i)}(Ai),Ig=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Eg=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Tg=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Ig(i,t),i.prototype.loadFromDatasource=function(t){var i=t.storeParams,n=t.parentBlock,e=t.parentNode.getGroupKeys();if(i.datasource){var r={successCallback:t.successCallback,success:t.success,failCallback:t.failCallback,fail:t.fail,request:{startRow:t.startRow,endRow:t.endRow,rowGroupCols:i.rowGroupCols,valueCols:i.valueCols,pivotCols:i.pivotCols,pivotMode:i.pivotMode,groupKeys:e,filterModel:i.filterModel,sortModel:i.sortModel},parentNode:t.parentNode,api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsWrapper.getContext()};window.setTimeout((function(){i.datasource&&n.isAlive()?i.datasource.getRows(r):t.failCallback()}),0)}},i.prototype.getChildStore=function(t,i,n){if(Wr.missingOrEmpty(t))return i;var e=n(t[0]);if(e){var r=t.slice(1,t.length),o=e.childStore;return o?o.getChildStore(r):null}return null},i.prototype.isServerRefreshNeeded=function(t,i,n){if(n.valueColChanged||n.secondaryColChanged)return!0;var e=t.level+1;if(!(e<i.length))return!0;var r=i[e].id;return n.changedColumns.indexOf(r)>-1||this.columnModel.getAllGridColumns().filter((function(t){return t.getColDef().showRowGroup&&n.changedColumns.includes(t.getId())})).map((function(t){return t.getColDef().showRowGroup})).some((function(t){return!0===t||t===r}))},Eg([Dt("columnApi")],i.prototype,"columnApi",void 0),Eg([Dt("columnModel")],i.prototype,"columnModel",void 0),Eg([Dt("gridApi")],i.prototype,"gridApi",void 0),Eg([Pt("ssrmStoreUtils")],i)}(Ai),zg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Ng=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Lg=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return zg(i,t),i.prototype.postConstruct=function(){this.rowHeight=this.gridOptionsWrapper.getRowHeightAsNumber(),this.usingTreeData=this.gridOptionsWrapper.isTreeData(),this.usingMasterDetail=this.gridOptionsWrapper.isMasterDetail()},i.prototype.createRowNode=function(t){var i=new Ws(this.beans);return i.setRowHeight(null!=t.rowHeight?t.rowHeight:this.rowHeight),i.group=t.group,i.leafGroup=t.leafGroup,i.level=t.level,i.uiLevel=t.level,i.parent=t.parent,i.stub=!0,i.group&&(i.expanded=!1,i.field=t.field,i.rowGroupColumn=t.rowGroupColumn),i},i.prototype.destroyRowNodes=function(t){var i=this;t&&t.forEach((function(t){return i.destroyRowNode(t)}))},i.prototype.destroyRowNode=function(t,i){void 0===i&&(i=!1),t.childStore&&!i&&(this.destroyBean(t.childStore),t.childStore=null),t.clearRowTopAndRowIndex(),null!=t.id&&this.nodeManager.removeNode(t)},i.prototype.setTreeGroupInfo=function(t){var i=this.gridOptionsWrapper.getIsServerSideGroupFunc(),n=this.gridOptionsWrapper.getServerSideGroupKeyFunc();null!=i&&(t.setGroup(i(t.data)),t.group&&null!=n&&(t.key=n(t.data))),t.group||null==t.childStore||(this.destroyBean(t.childStore),t.childStore=null)},i.prototype.setRowGroupInfo=function(t){t.key=this.valueService.getValue(t.rowGroupColumn,t),null==t.key&&Wr.doOnce((function(){console.warn("AG Grid: null and undefined values are not allowed for server side row model keys"),t.rowGroupColumn&&console.warn("column = "+t.rowGroupColumn.getId()),console.warn("data is ",t.data)}),"ServerSideBlock-CannotHaveNullOrUndefinedForKey")},i.prototype.setMasterDetailInfo=function(t){var i=this.gridOptionsWrapper.getIsRowMasterFunc();t.master=null==i||i(t.data)},i.prototype.updateDataIntoRowNode=function(t,i){t.updateData(i),this.usingTreeData&&this.setTreeGroupInfo(t)},i.prototype.setDataIntoRowNode=function(t,i,n,e){t.stub=!1,Wr.exists(i)?(t.setDataAndId(i,n),this.usingTreeData?this.setTreeGroupInfo(t):t.group?this.setRowGroupInfo(t):this.usingMasterDetail&&this.setMasterDetailInfo(t)):(t.setDataAndId(void 0,void 0),t.key=null),(this.usingTreeData||t.group)&&(this.setGroupDataIntoRowNode(t),this.setChildCountIntoRowNode(t)),Wr.exists(i)&&t.setRowHeight(this.gridOptionsWrapper.getRowHeightForNode(t,!1,e).height)},i.prototype.setChildCountIntoRowNode=function(t){var i=this.gridOptionsWrapper.getChildCountFunc();i&&(t.allChildrenCount=i(t.data))},i.prototype.setGroupDataIntoRowNode=function(t){var i=this,n=this.columnModel.getGroupDisplayColumns(),e=this.gridOptionsWrapper.isTreeData();n.forEach((function(n){if(null==t.groupData&&(t.groupData={}),e)t.groupData[n.getColId()]=t.key;else if(n.isRowGroupDisplayed(t.rowGroupColumn.getId())){var r=i.valueService.getValue(t.rowGroupColumn,t);t.groupData[n.getColId()]=r}}))},i.prototype.clearDisplayIndex=function(t){t.clearRowTopAndRowIndex(),t.group&&Wr.exists(t.childStore)&&t.childStore.clearDisplayIndexes(),t.master&&t.detailNode&&t.detailNode.clearRowTopAndRowIndex()},i.prototype.setDisplayIndex=function(t,i,n){if(t.setRowIndex(i.next()),t.setRowTop(n.value),n.value+=t.rowHeight,t.master&&(t.expanded&&t.detailNode?(t.detailNode.setRowIndex(i.next()),t.detailNode.setRowTop(n.value),n.value+=t.detailNode.rowHeight):t.detailNode&&t.detailNode.clearRowTopAndRowIndex()),t.group&&Wr.exists(t.childStore)){var e=t.childStore;t.expanded?e.setDisplayIndexes(i,n):e.clearDisplayIndexes()}},i.prototype.binarySearchForDisplayIndex=function(t,i){var n=0,e=i.length-1;if(Wr.missing(e)||Wr.missing(n))console.warn("AG Grid: error: topPointer = "+e+", bottomPointer = "+n);else for(;;){var r=Math.floor((n+e)/2),o=i[r];if(o.rowIndex===t)return o;var s=o.detailNode;if(o.master&&o.expanded&&s&&s.rowIndex===t)return o.detailNode;var u=o.childStore;if(o.expanded&&u&&u.isDisplayIndexInStore(t))return u.getRowUsingDisplayIndex(t);if(o.rowIndex<t)n=r+1;else{if(!(o.rowIndex>t))return void console.warn("AG Grid: error: unable to locate rowIndex = "+t+" in cache");e=r-1}}},i.prototype.extractRowBounds=function(t,i){var n=function(t){return{rowHeight:t.rowHeight,rowTop:t.rowTop}};if(t.rowIndex===i)return n(t);if(t.group&&t.expanded&&Wr.exists(t.childStore)){var e=t.childStore;if(e.isDisplayIndexInStore(i))return e.getRowBounds(i)}else if(t.master&&t.expanded&&Wr.exists(t.detailNode)&&t.detailNode.rowIndex===i)return n(t.detailNode)},i.prototype.getIndexAtPixel=function(t,i){if(t.isPixelInRange(i))return t.rowIndex;var n=t.detailNode;if(t.master&&t.expanded&&n&&n.isPixelInRange(i))return t.detailNode.rowIndex;if(t.group&&t.expanded&&Wr.exists(t.childStore)){var e=t.childStore;if(e.isPixelInRange(i))return e.getRowIndexAtPixel(i)}return null},i.prototype.createNodeIdPrefix=function(t){for(var i=[],n=t;n&&n.level>=0;)i.push(n.key),n=n.parent;if(i.length>0)return i.reverse().join("-")},i.prototype.checkOpenByDefault=function(t){if(t.isExpandable()){var i=this.gridOptionsWrapper.getIsServerSideGroupOpenByDefaultFunc();i&&i({data:t.data,rowNode:t})&&window.setTimeout((function(){return t.setExpanded(!0)}),0)}},Ng([Dt("valueService")],i.prototype,"valueService",void 0),Ng([Dt("columnModel")],i.prototype,"columnModel",void 0),Ng([Dt("ssrmNodeManager")],i.prototype,"nodeManager",void 0),Ng([Dt("beans")],i.prototype,"beans",void 0),Ng([Ft],i.prototype,"postConstruct",null),Ng([Pt("ssrmBlockUtils")],i)}(Ai),Bg=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Hg=function(){function t(){this.rowNodes={}}return t.prototype.addRowNode=function(t){var i=t.id;this.rowNodes[i]&&(console.warn("AG Grid: Duplicate node id "+t.id+". Row ID's are provided via the getRowId() callback. Please modify the getRowId() callback code to provide unique row id values."),console.warn("first instance",this.rowNodes[i].data),console.warn("second instance",t.data)),this.rowNodes[i]=t},t.prototype.removeNode=function(t){var i=t.id;this.rowNodes[i]&&(this.rowNodes[i]=void 0)},t.prototype.clear=function(){this.rowNodes={}},Bg([kt],t.prototype,"clear",null),Bg([Pt("ssrmNodeManager")],t)}(),Wg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Vg=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Ug=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.asyncTransactions=[],i}return Wg(i,t),i.prototype.postConstruct=function(){this.gridOptionsWrapper.isRowModelServerSide()},i.prototype.applyTransactionAsync=function(t,i){null==this.asyncTransactionsTimeout&&this.scheduleExecuteAsync(),this.asyncTransactions.push({transaction:t,callback:i})},i.prototype.scheduleExecuteAsync=function(){var t=this,i=this.gridOptionsWrapper.getAsyncTransactionWaitMillis();this.asyncTransactionsTimeout=window.setTimeout((function(){t.executeAsyncTransactions()}),i)},i.prototype.executeAsyncTransactions=function(){var t=this;if(this.asyncTransactions){var i=[],n=[],e=[],r=!1;this.asyncTransactions.forEach((function(o){var s;t.serverSideRowModel.executeOnStore(o.transaction.route,(function(t){s=t.applyTransaction(o.transaction)})),null==s&&(s={status:ll.StoreNotFound}),n.push(s),s.status==ll.StoreLoading?e.push(o):(o.callback&&i.push((function(){return o.callback(s)})),s.status===ll.Applied&&(r=!0))})),i.length>0&&window.setTimeout((function(){i.forEach((function(t){return t()}))}),0),this.asyncTransactionsTimeout=void 0,this.asyncTransactions=e,r&&(this.valueCache.onDataChanged(),this.eventService.dispatchEvent({type:xi.EVENT_STORE_UPDATED})),n.length>0&&this.eventService.dispatchEvent({type:xi.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:n})}},i.prototype.flushAsyncTransactions=function(){null!=this.asyncTransactionsTimeout&&clearTimeout(this.asyncTransactionsTimeout),this.executeAsyncTransactions()},i.prototype.applyTransaction=function(t){var i,n=this;return this.serverSideRowModel.executeOnStore(t.route,(function(n){i=n.applyTransaction(t)})),i?(this.valueCache.onDataChanged(),this.eventService.dispatchEvent({type:xi.EVENT_STORE_UPDATED}),i.update&&i.update.length&&setTimeout((function(){n.rowRenderer.refreshFullWidthRows(i.update)}),0),i):{status:ll.StoreNotFound}},Vg([Dt("rowNodeBlockLoader")],i.prototype,"rowNodeBlockLoader",void 0),Vg([Dt("valueCache")],i.prototype,"valueCache",void 0),Vg([Dt("rowModel")],i.prototype,"serverSideRowModel",void 0),Vg([Dt("rowRenderer")],i.prototype,"rowRenderer",void 0),Vg([Ft],i.prototype,"postConstruct",null),Vg([Pt("ssrmTransactionManager")],i)}(Ai),Kg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),$g=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},qg=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Kg(i,t),i.prototype.postConstruct=function(){this.gridOptionsWrapper.isRowModelServerSide()&&this.addManagedListener(this.eventService,xi.EVENT_ROW_GROUP_OPENED,this.onRowGroupOpened.bind(this))},i.prototype.onRowGroupOpened=function(t){var i=t.node;if(i.expanded){if(i.master)this.createDetailNode(i);else if(Wr.missing(i.childStore)){var n=this.serverSideRowModel.getParams();i.childStore=this.createBean(this.storeFactory.createStore(n,i))}}else this.gridOptionsWrapper.isPurgeClosedRowNodes()&&Wr.exists(i.childStore)&&(i.childStore=this.destroyBean(i.childStore));this.eventService.dispatchEvent({type:xi.EVENT_STORE_UPDATED})},i.prototype.createDetailNode=function(t){if(Wr.exists(t.detailNode))return t.detailNode;var i=new Ws(this.beans);i.detail=!0,i.selectable=!1,i.parent=t,Wr.exists(t.id)&&(i.id="detail_"+t.id),i.data=t.data,i.level=t.level+1;var n=this.gridOptionsWrapper.getRowHeightForNode(i).height;return i.rowHeight=n||200,t.detailNode=i,i},$g([Dt("rowModel")],i.prototype,"serverSideRowModel",void 0),$g([Dt("ssrmStoreFactory")],i.prototype,"storeFactory",void 0),$g([Dt("beans")],i.prototype,"beans",void 0),$g([Ft],i.prototype,"postConstruct",null),$g([Pt("ssrmExpandListener")],i)}(Ai),Yg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Jg=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Zg=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Yg(i,t),i.prototype.postConstruct=function(){this.gridOptionsWrapper.isRowModelServerSide()&&this.addManagedListener(this.eventService,xi.EVENT_SORT_CHANGED,this.onSortChanged.bind(this))},i.prototype.extractSortModel=function(){var t=this.sortController.getSortModel();return this.gridOptionsWrapper.isTreeData()||(this.replaceAutoGroupColumnWithActualRowGroupColumns(t),this.removeMultiColumnPrefixOnColumnIds(t)),t},i.prototype.removeMultiColumnPrefixOnColumnIds=function(t){if(this.gridOptionsWrapper.isGroupMultiAutoColumn())for(var i=Vt.GROUP_AUTO_COLUMN_ID+"-",n=0;n<t.length;++n)t[n].colId.indexOf(i)>-1&&(t[n].colId=t[n].colId.substr(i.length))},i.prototype.replaceAutoGroupColumnWithActualRowGroupColumns=function(t){var i=t.find((function(t){return t.colId==Vt.GROUP_AUTO_COLUMN_ID}));if(i){var n=t.indexOf(i);Wr.removeFromArray(t,i);var e=this.columnModel.getRowGroupColumns().filter((function(i){return 0==t.filter((function(t){return t.colId===i.getColId()})).length})).map((function(t){return{colId:t.getId(),sort:i.sort}}));Wr.insertArrayIntoArray(t,e,n)}},i.prototype.onSortChanged=function(){var t=this.serverSideRowModel.getParams();if(t){var i=this.extractSortModel(),n=this.findChangedColumnsInSort(i,t.sortModel),e=this.listenerUtils.isSortingWithValueColumn(n),r=this.listenerUtils.isSortingWithSecondaryColumn(n);this.serverSideRowModel.refreshAfterSort(i,{valueColChanged:e,secondaryColChanged:r,changedColumns:n})}},i.prototype.findChangedColumnsInSort=function(t,i){var n=[];return[t,i].forEach((function(t){if(t){var i=t.map((function(t){return t.colId}));n=n.concat(i)}})),n.filter((function(n){var e=i.find((function(t){return t.colId===n})),r=t.find((function(t){return t.colId===n}));return function(t,i){return(t?t.sort:null)!==(i?i.sort:null)}(e,r)||function(n,e){return(n?i.indexOf(n):-1)!==(e?t.indexOf(e):-1)}(e,r)}))},Jg([Dt("sortController")],i.prototype,"sortController",void 0),Jg([Dt("columnModel")],i.prototype,"columnModel",void 0),Jg([Dt("rowModel")],i.prototype,"serverSideRowModel",void 0),Jg([Dt("ssrmListenerUtils")],i.prototype,"listenerUtils",void 0),Jg([Ft],i.prototype,"postConstruct",null),Jg([Pt("ssrmSortService")],i)}(Ai),Xg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Qg=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},tm=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Xg(i,t),i.prototype.postConstruct=function(){this.gridOptionsWrapper.isRowModelServerSide()&&this.addManagedListener(this.eventService,xi.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this))},i.prototype.onFilterChanged=function(){var t=this.serverSideRowModel.getParams();if(t){var i=this.filterManager.getFilterModel(),n=this.findChangedColumns(i,t?t.filterModel:{}),e=this.listenerUtils.isSortingWithValueColumn(n),r=this.listenerUtils.isSortingWithSecondaryColumn(n);this.serverSideRowModel.refreshAfterFilter(i,{valueColChanged:e,secondaryColChanged:r,changedColumns:n})}},i.prototype.findChangedColumns=function(t,i){var n={};Object.keys(t).forEach((function(t){return n[t]=!0})),Object.keys(i).forEach((function(t){return n[t]=!0}));var e=[];return Object.keys(n).forEach((function(n){JSON.stringify(t[n])!=JSON.stringify(i[n])&&e.push(n)})),e},Qg([Dt("rowModel")],i.prototype,"serverSideRowModel",void 0),Qg([Dt("filterManager")],i.prototype,"filterManager",void 0),Qg([Dt("ssrmListenerUtils")],i.prototype,"listenerUtils",void 0),Qg([Ft],i.prototype,"postConstruct",null),Qg([Pt("ssrmFilterListener")],i)}(Ai),im=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),nm=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},em=function(t){var i="function"==typeof Symbol&&Symbol.iterator,n=i&&t[i],e=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},rm=function(t){function i(i,n,e,r,o){var s=t.call(this,i)||this;return s.ssrmParams=e,s.storeParams=r,s.parentRowNode=n,s.startRow=i*r.cacheBlockSize,s.parentStore=o,s.level=n.level+1,s.groupLevel=e.rowGroupCols?s.level<e.rowGroupCols.length:void 0,s.leafGroup=!!e.rowGroupCols&&s.level===e.rowGroupCols.length-1,s}return im(i,t),i.prototype.postConstruct=function(){this.usingTreeData=this.gridOptionsWrapper.isTreeData(),!this.usingTreeData&&this.groupLevel&&(this.groupField=this.ssrmParams.rowGroupCols[this.level].field,this.rowGroupColumn=this.columnModel.getRowGroupColumns()[this.level]),this.nodeIdPrefix=this.blockUtils.createNodeIdPrefix(this.parentRowNode),this.setData([])},i.prototype.isDisplayIndexInBlock=function(t){return t>=this.displayIndexStart&&t<this.displayIndexEnd},i.prototype.isBlockBefore=function(t){return t>=this.displayIndexEnd},i.prototype.getDisplayIndexStart=function(){return this.displayIndexStart},i.prototype.getDisplayIndexEnd=function(){return this.displayIndexEnd},i.prototype.getBlockHeightPx=function(){return this.blockHeightPx},i.prototype.getBlockTopPx=function(){return this.blockTopPx},i.prototype.isGroupLevel=function(){return this.groupLevel},i.prototype.getGroupField=function(){return this.groupField},i.prototype.prefixId=function(t){return null!=this.nodeIdPrefix?this.nodeIdPrefix+"-"+t:t.toString()},i.prototype.getBlockStateJson=function(){return{id:this.prefixId(this.getId()),state:{blockNumber:this.getId(),startRow:this.startRow,endRow:this.startRow+this.storeParams.cacheBlockSize,pageStatus:this.getState()}}},i.prototype.isAnyNodeOpen=function(){return this.rowNodes.filter((function(t){return t.expanded})).length>0},i.prototype.forEachNode=function(t,i,n,e){void 0===i&&(i=new Vr),this.rowNodes.forEach((function(r){if(t(r,i.next()),n&&r.childStore){var o=r.childStore;e?o.forEachNodeDeepAfterFilterAndSort(t,i):o.forEachNodeDeep(t,i)}}))},i.prototype.forEachNodeDeep=function(t,i){this.forEachNode(t,i,!0,!1)},i.prototype.forEachNodeAfterFilterAndSort=function(t,i){this.forEachNode(t,i,!0,!0)},i.prototype.forEachNodeShallow=function(t,i){this.forEachNode(t,i,!1,!1)},i.prototype.getLastAccessed=function(){return this.lastAccessed},i.prototype.getRowUsingLocalIndex=function(t){return this.rowNodes[t-this.startRow]},i.prototype.touchLastAccessed=function(){this.lastAccessed=this.ssrmParams.lastAccessedSequence.next()},i.prototype.processServerFail=function(){this.parentStore.onBlockLoadFailed(this)},i.prototype.retryLoads=function(){this.getState()===sf.STATE_FAILED&&(this.setStateWaitingToLoad(),this.rowNodeBlockLoader.checkBlockToLoad(),this.setData()),this.forEachNodeShallow((function(t){t.childStore&&t.childStore.retryLoads()}))},i.prototype.processServerResult=function(t){this.parentStore.onBlockLoaded(this,t)},i.prototype.setData=function(t,i){var n=this;void 0===t&&(t=[]),void 0===i&&(i=!1),this.destroyRowNodes();for(var e=this.parentStore.getRowCount(),r=this.getId()*this.storeParams.cacheBlockSize,o=Math.min(r+this.storeParams.cacheBlockSize,e)-r,s=this.columnModel.getAllDisplayedAutoHeightCols().length>0?this.parentStore.getCachedBlockHeight(this.getId()):void 0,u=s?Math.round(s/o):void 0,h=function(e){var r=e<t.length,o=function(o){var s=null!=o?o:n.blockUtils.createRowNode({field:n.groupField,group:n.groupLevel,leafGroup:n.leafGroup,level:n.level,parent:n.parentRowNode,rowGroupColumn:n.rowGroupColumn,rowHeight:u});if(r){var h=t[e];if(o)n.blockUtils.updateDataIntoRowNode(s,h);else{var c=n.prefixId(n.startRow+e);n.blockUtils.setDataIntoRowNode(s,h,c,u),n.blockUtils.checkOpenByDefault(s)}n.parentStore.removeDuplicateNode(s.id),n.nodeManager.addRowNode(s),n.allNodesMap[s.id]=s}return i&&(s.failedLoad=!0),s},s=c.gridOptionsWrapper.getRowIdFunc(),h=void 0;if(s&&r){var a=t[e],l=c.parentRowNode.getGroupKeys(),f=s({data:a,level:c.level,parentKeys:l.length>0?l:void 0});h=o(c.parentStore.retrieveNodeFromCache(f))}h||(h=o()),c.rowNodes.push(h)},c=this,a=0;a<o;a++)h(a)},i.prototype.removeDuplicateNode=function(t){if(this.getState()!=sf.STATE_LOADED){var i=this.allNodesMap[t];if(i){this.blockUtils.destroyRowNode(i);var n=this.rowNodes.indexOf(i),e=this.blockUtils.createRowNode({field:this.groupField,group:this.groupLevel,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn});this.rowNodes[n]=e}}},i.prototype.refresh=function(){this.getState()!==sf.STATE_WAITING_TO_LOAD&&this.setStateWaitingToLoad()},i.prototype.destroyRowNodes=function(){var t,i=this;null===(t=this.rowNodes)||void 0===t||t.forEach((function(t){var n=i.parentStore.isNodeCached(t.id);i.blockUtils.destroyRowNode(t,n)})),this.rowNodes=[],this.allNodesMap={}},i.prototype.setBeans=function(t){this.logger=t.create("ServerSideBlock")},i.prototype.getRowUsingDisplayIndex=function(t){return this.touchLastAccessed(),this.blockUtils.binarySearchForDisplayIndex(t,this.rowNodes)},i.prototype.loadFromDatasource=function(){this.storeUtils.loadFromDatasource({startRow:this.startRow,endRow:this.startRow+this.storeParams.cacheBlockSize,parentBlock:this,parentNode:this.parentRowNode,storeParams:this.ssrmParams,successCallback:this.pageLoaded.bind(this,this.getVersion()),success:this.success.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),fail:this.pageLoadFailed.bind(this,this.getVersion())})},i.prototype.isPixelInRange=function(t){return t>=this.blockTopPx&&t<this.blockTopPx+this.blockHeightPx},i.prototype.getRowBounds=function(t){var i,n,e;this.touchLastAccessed();try{for(var r=em(this.rowNodes),o=r.next();!o.done&&null==(e=this.blockUtils.extractRowBounds(o.value,t));o=r.next());}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return e},i.prototype.getRowIndexAtPixel=function(t){var i,n;this.touchLastAccessed();var e=null;try{for(var r=em(this.rowNodes),o=r.next();!o.done&&null==(e=this.blockUtils.getIndexAtPixel(o.value,t));o=r.next());}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return e},i.prototype.clearDisplayIndexes=function(){var t=this;this.displayIndexEnd=void 0,this.displayIndexStart=void 0,this.rowNodes.forEach((function(i){return t.blockUtils.clearDisplayIndex(i)}))},i.prototype.setDisplayIndexes=function(t,i){var n=this;this.displayIndexStart=t.peek(),this.blockTopPx=i.value,this.rowNodes.forEach((function(e){return n.blockUtils.setDisplayIndex(e,t,i)})),this.displayIndexEnd=t.peek(),this.blockHeightPx=i.value-this.blockTopPx},nm([Dt("columnModel")],i.prototype,"columnModel",void 0),nm([Dt("ssrmStoreUtils")],i.prototype,"storeUtils",void 0),nm([Dt("ssrmBlockUtils")],i.prototype,"blockUtils",void 0),nm([Dt("ssrmNodeManager")],i.prototype,"nodeManager",void 0),nm([Dt("rowNodeBlockLoader")],i.prototype,"rowNodeBlockLoader",void 0),nm([Ft],i.prototype,"postConstruct",null),nm([kt],i.prototype,"destroyRowNodes",null),nm([(n=0,e=Tt("loggerFactory"),function(t,i){e(t,i,n)})],i.prototype,"setBeans",null),i;var n,e}(sf),om=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),sm=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(t){t[t.FOUND=0]="FOUND",t[t.CONTINUE_FIND=1]="CONTINUE_FIND",t[t.BREAK_FIND=2]="BREAK_FIND"}(fg||(fg={}));var um,hm=function(t){function i(i,n,e){var r=t.call(this)||this;return r.blocks={},r.blockHeights={},r.lastRowIndexKnown=!1,r.displayIndexStart=0,r.displayIndexEnd=0,r.cacheTopPixel=0,r.info={},r.refreshedNodeCache={},r.ssrmParams=i,r.storeParams=n,r.parentRowNode=e,r}return om(i,t),i.prototype.postConstruct=function(){this.defaultRowHeight=this.gridOptionsWrapper.getRowHeightAsNumber();var t=-1===this.parentRowNode.level?this.gridOptionsWrapper.getServerSideInitialRowCount():i.INITIAL_ROW_COUNT;this.rowCount=t},i.prototype.destroyAllBlocks=function(){var t=this;this.getBlocksInOrder().forEach((function(i){return t.destroyBlock(i)})),this.blockUtils.destroyRowNodes(Object.values(this.refreshedNodeCache))},i.prototype.setBeans=function(t){this.logger=t.create("ServerSideCache")},i.prototype.getRowCount=function(){return this.rowCount},i.prototype.isLastRowIndexKnown=function(){return this.lastRowIndexKnown},i.prototype.retryLoads=function(){this.getBlocksInOrder().forEach((function(t){return t.retryLoads()}))},i.prototype.onBlockLoadFailed=function(t){t.setData([],!0),this.fireCacheUpdatedEvent()},i.prototype.onBlockLoaded=function(t,i){this.logger.log("onPageLoaded: page = "+t.getId()+", lastRow = "+i.rowCount);var n=i.storeInfo||i.groupLevelInfo;n&&Object.assign(this.info,n),i.rowData||Wr.doOnce((function(){return console.warn('AG Grid: "params.rowData" is missing from Server-Side Row Model success() callback. Please use the "rowData" attribute. If no data is returned, set an empty list.',i)}),"InfiniteStore.noData");var e=null!=i.rowCount&&i.rowCount>=0?i.rowCount:void 0;this.isAlive()&&(this.checkRowCount(t,e),t.setData(i.rowData),this.destroyAllBlocksPastVirtualRowCount(),this.fireCacheUpdatedEvent())},i.prototype.purgeBlocksIfNeeded=function(t){var n=this,e=this.getBlocksInOrder().filter((function(i){return i!=t}));e.sort((function(t,i){return i.getLastAccessed()-t.getLastAccessed()}));var r=this.storeParams.maxBlocksInCache>0,o=r?this.storeParams.maxBlocksInCache-1:null,s=i.MAX_EMPTY_BLOCKS_TO_KEEP-1;e.forEach((function(t,i){if(t.getState()===rm.STATE_WAITING_TO_LOAD&&i>=s||r&&i>=o){if(t.isAnyNodeOpen())return;if(n.isBlockCurrentlyDisplayed(t))return;if(n.isBlockFocused(t))return;n.destroyBlock(t)}}))},i.prototype.isBlockFocused=function(t){var i=this.focusService.getFocusCellToUseAfterRefresh();if(!i)return!1;if(null!=i.rowPinned)return!1;var n=t.getDisplayIndexStart(),e=t.getDisplayIndexEnd();return null!=e&&null!=n&&i.rowIndex>=n&&i.rowIndex<e},i.prototype.isBlockCurrentlyDisplayed=function(t){var i=t.getDisplayIndexStart(),n=t.getDisplayIndexEnd()-1;return this.rowRenderer.isRangeInRenderedViewport(i,n)},i.prototype.removeDuplicateNode=function(t){this.getBlocksInOrder().forEach((function(i){return i.removeDuplicateNode(t)}))},i.prototype.checkRowCount=function(t,n){if("number"==typeof n&&n>=0)this.rowCount=n,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){var e=(t.getId()+1)*this.storeParams.cacheBlockSize+i.OVERFLOW_SIZE;this.rowCount<e&&(this.rowCount=e)}},i.prototype.forEachNodeDeep=function(t,i){void 0===i&&(i=new Vr),this.getBlocksInOrder().forEach((function(n){return n.forEachNodeDeep(t,i)}))},i.prototype.forEachNodeDeepAfterFilterAndSort=function(t,i){void 0===i&&(i=new Vr),this.getBlocksInOrder().forEach((function(n){return n.forEachNodeAfterFilterAndSort(t,i)}))},i.prototype.getBlocksInOrder=function(){return Wr.getAllValuesInObject(this.blocks).sort((function(t,i){return t.getId()-i.getId()}))},i.prototype.destroyBlock=function(t){delete this.blocks[t.getId()],this.destroyBean(t),this.rowNodeBlockLoader.removeBlock(t)},i.prototype.fireCacheUpdatedEvent=function(){this.eventService.dispatchEvent({type:xi.EVENT_STORE_UPDATED})},i.prototype.destroyAllBlocksPastVirtualRowCount=function(){var t=this,i=[];this.getBlocksInOrder().forEach((function(n){n.getId()*t.storeParams.cacheBlockSize>=t.rowCount&&i.push(n)})),i.length>0&&i.forEach((function(i){return t.destroyBlock(i)}))},i.prototype.refreshStore=function(t){0==this.getRowCount()||t?this.resetStore():this.refreshBlocks(),this.fireCacheUpdatedEvent()},i.prototype.isNodeCached=function(t){return!!this.refreshedNodeCache[t]},i.prototype.retrieveNodeFromCache=function(t){var i=this.refreshedNodeCache[t];return i&&delete this.refreshedNodeCache[t],i},i.prototype.buildRowNodeCache=function(){var t={};this.getBlocksInOrder().forEach((function(i){i.rowNodes.forEach((function(i){i.group&&(t[i.id]=i)}))})),this.refreshedNodeCache=t},i.prototype.refreshBlocks=function(){this.buildRowNodeCache(),this.getBlocksInOrder().forEach((function(t){t.refresh()})),this.lastRowIndexKnown=!1,this.rowNodeBlockLoader.checkBlockToLoad()},i.prototype.resetStore=function(){this.destroyAllBlocks(),this.lastRowIndexKnown=!1,(this.columnModel.isAutoRowHeightActive()||0===this.rowCount)&&(this.rowCount=i.INITIAL_ROW_COUNT)},i.prototype.getRowNodesInRange=function(t,i){var n=[],e=-1,r=!1;Wr.missing(t)&&(r=!0);var o=!1;return this.getBlocksInOrder().forEach((function(s){o||(r&&e+1!==s.getId()?o=!0:(e=s.getId(),s.forEachNodeShallow((function(e){var o=e===t||e===i;(r||o)&&n.push(e),o&&(r=!r)}))))})),o||r?[]:n},i.prototype.findBlockAndExecute=function(t,i,n){var e,r=!1,o=!1,s=null;return this.getBlocksInOrder().forEach((function(n){if(!r&&!o){var u=t(n);u==fg.FOUND?(e=i(n),r=!0):u==fg.CONTINUE_FIND?s=n:u==fg.BREAK_FIND&&(o=!0)}})),r||(e=n(s)),e},i.prototype.getRowBounds=function(t){var i=this;return this.findBlockAndExecute((function(i){return i.isDisplayIndexInBlock(t)?fg.FOUND:i.isBlockBefore(t)?fg.CONTINUE_FIND:fg.BREAK_FIND}),(function(i){return i.getRowBounds(t)}),(function(n){var e,r;return null!==n?(e=n.getBlockTopPx()+n.getBlockHeightPx(),r=n.getDisplayIndexEnd()):(e=i.cacheTopPixel,r=i.displayIndexStart),{rowHeight:i.defaultRowHeight,rowTop:e+(t-r)*i.defaultRowHeight}}))},i.prototype.getRowIndexAtPixel=function(t){var i=this,n=this.findBlockAndExecute((function(i){return i.isPixelInRange(t)?fg.FOUND:i.getBlockTopPx()<t?fg.CONTINUE_FIND:fg.BREAK_FIND}),(function(i){return i.getRowIndexAtPixel(t)}),(function(n){var e,r;n?(e=n.getBlockTopPx()+n.getBlockHeightPx(),r=n.getDisplayIndexEnd()):(e=i.cacheTopPixel,r=i.displayIndexStart);for(var o=i.storeParams.cacheBlockSize,s=i.defaultRowHeight*o,u=n?n.getId()+1:0,h=function(n){var r=i.getCachedBlockHeight(n),o=null!=r?r:s;return{height:o,pixelInBlock:t<=o+e}},c=h(u);!c.pixelInBlock;)e+=c.height,r+=o,c=h(++u);return r+(0|Math.floor((t-e)/(c.height/o)))})),e=this.getDisplayIndexEnd()-1;return Math.min(n,e)},i.prototype.clearDisplayIndexes=function(){this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.getBlocksInOrder().forEach((function(t){return t.clearDisplayIndexes()}))},i.prototype.setDisplayIndexes=function(t,i){var n=this;this.displayIndexStart=t.peek(),this.cacheTopPixel=i.value;var e=-1,r=this.storeParams.cacheBlockSize;this.getBlocksInOrder().forEach((function(o){var s=o.getId(),u=s-e-1,h=u*r;h>0&&t.skip(h);for(var c=1;c<=u;c++){var a=s-c;Wr.exists(n.blockHeights[a])?i.value+=n.blockHeights[a]:i.value+=r*n.defaultRowHeight}e=s,o.setDisplayIndexes(t,i),n.blockHeights[s]=o.getBlockHeightPx()}));var o=(e+1)*r-1,s=this.getRowCount()-o-1;s>0&&(t.skip(s),i.value+=s*this.defaultRowHeight),this.displayIndexEnd=t.peek(),this.cacheHeightPixels=i.value-this.cacheTopPixel},i.prototype.getRowUsingDisplayIndex=function(t,i){var n=this;if(void 0===i&&(i=!1),this.isDisplayIndexInStore(t))return this.findBlockAndExecute((function(i){return i.isDisplayIndexInBlock(t)?fg.FOUND:i.isBlockBefore(t)?fg.CONTINUE_FIND:fg.BREAK_FIND}),(function(i){return i.getRowUsingDisplayIndex(t)}),(function(e){if(!i){var r,o,s,u=n.storeParams.cacheBlockSize;if(e)for(r=e.getId()+1,o=e.getDisplayIndexEnd(),s=e.getBlockHeightPx()+e.getBlockTopPx();!(t>=o&&t<o+u);){o+=u;var h=n.blockHeights[r];Wr.exists(h)?s+=h:s+=n.defaultRowHeight*u,r++}else r=Math.floor((t-n.displayIndexStart)/u),o=n.displayIndexStart+r*u,s=n.cacheTopPixel+r*u*n.defaultRowHeight;return n.logger.log("block missing, rowIndex = "+t+", creating #"+r+", displayIndexStart = "+o),n.createBlock(r,o,{value:s}).getRowUsingDisplayIndex(t)}}))},i.prototype.getTopLevelRowDisplayedIndex=function(t){var i=this.storeParams.cacheBlockSize,n=Math.floor(t/i);return this.findBlockAndExecute((function(t){return t.getId()===n?fg.FOUND:t.getId()<n?fg.CONTINUE_FIND:fg.BREAK_FIND}),(function(i){return i.getRowUsingLocalIndex(t).rowIndex}),(function(n){if(!n)return t;var e=i*(n.getId()+1)-1,r=n.getRowUsingLocalIndex(e);return(r.expanded&&r.childStore?r.childStore.getDisplayIndexEnd()-1:r.expanded&&r.detailNode?r.detailNode.rowIndex:r.rowIndex)+(t-e)}))},i.prototype.addStoreStates=function(t){t.push({infiniteScroll:!0,route:this.parentRowNode.getGroupKeys(),rowCount:this.rowCount,lastRowIndexKnown:this.lastRowIndexKnown,info:this.info,maxBlocksInCache:this.storeParams.maxBlocksInCache,cacheBlockSize:this.storeParams.cacheBlockSize}),this.forEachChildStoreShallow((function(i){return i.addStoreStates(t)}))},i.prototype.getCachedBlockHeight=function(t){return this.blockHeights[t]},i.prototype.createBlock=function(t,i,n){var e=this.createBean(new rm(t,this.parentRowNode,this.ssrmParams,this.storeParams,this));return e.setDisplayIndexes(new Vr(i),n),this.blocks[e.getId()]=e,this.purgeBlocksIfNeeded(e),this.rowNodeBlockLoader.addBlock(e),e},i.prototype.getDisplayIndexEnd=function(){return this.displayIndexEnd},i.prototype.isDisplayIndexInStore=function(t){return 0!==this.getRowCount()&&t>=this.displayIndexStart&&t<this.displayIndexEnd},i.prototype.applyTransaction=function(){return{status:ll.StoreWrongType}},i.prototype.getChildStore=function(t){var i=this;return this.storeUtils.getChildStore(t,this,(function(t){var n=null;return i.getBlocksInOrder().forEach((function(i){i.forEachNodeShallow((function(i){i.key==t&&(n=i)}),new Vr)})),n}))},i.prototype.isPixelInRange=function(t){return 0!==this.getRowCount()&&t>=this.cacheTopPixel&&t<this.cacheTopPixel+this.cacheHeightPixels},i.prototype.refreshAfterFilter=function(t){this.gridOptionsWrapper.isServerSideFilterAllLevels()||this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,t)?this.resetStore():this.forEachChildStoreShallow((function(i){return i.refreshAfterFilter(t)}))},i.prototype.refreshAfterSort=function(t){this.gridOptionsWrapper.isServerSideSortAllLevels()||this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,t)?this.resetStore():this.forEachChildStoreShallow((function(i){return i.refreshAfterSort(t)}))},i.prototype.forEachChildStoreShallow=function(t){this.getBlocksInOrder().forEach((function(i){i.isGroupLevel()&&i.forEachNodeShallow((function(i){var n=i.childStore;n&&t(n)}),new Vr)}))},i.MAX_EMPTY_BLOCKS_TO_KEEP=2,i.INITIAL_ROW_COUNT=1,i.OVERFLOW_SIZE=1,sm([Dt("rowRenderer")],i.prototype,"rowRenderer",void 0),sm([Dt("rowNodeBlockLoader")],i.prototype,"rowNodeBlockLoader",void 0),sm([Dt("ssrmStoreUtils")],i.prototype,"storeUtils",void 0),sm([Dt("focusService")],i.prototype,"focusService",void 0),sm([Dt("columnModel")],i.prototype,"columnModel",void 0),sm([Dt("ssrmBlockUtils")],i.prototype,"blockUtils",void 0),sm([Ft],i.prototype,"postConstruct",null),sm([kt],i.prototype,"destroyAllBlocks",null),sm([(n=0,e=Tt("loggerFactory"),function(t,i){e(t,i,n)})],i.prototype,"setBeans",null),i;var n,e}(Ai),cm=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),am=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},lm=function(t){function i(i,n,e){var r=t.call(this,0)||this;return r.nodeIdSequence=new Vr,r.info={},r.ssrmParams=i,r.parentRowNode=e,r.level=e.level+1,r.groupLevel=i.rowGroupCols?r.level<i.rowGroupCols.length:void 0,r.leafGroup=!!i.rowGroupCols&&r.level===i.rowGroupCols.length-1,r}return cm(i,t),i.prototype.postConstruct=function(){var t=this;this.usingTreeData=this.gridOptionsWrapper.isTreeData(),this.nodeIdPrefix=this.blockUtils.createNodeIdPrefix(this.parentRowNode),!this.usingTreeData&&this.groupLevel&&(this.groupField=this.ssrmParams.rowGroupCols[this.level].field,this.rowGroupColumn=this.columnModel.getRowGroupColumns()[this.level]);var i=1,n=-1===this.parentRowNode.level,e=this.gridOptionsWrapper.getServerSideInitialRowCount();n&&void 0!==e&&(i=e),this.initialiseRowNodes(i),this.rowNodeBlockLoader.addBlock(this),this.addDestroyFunc((function(){return t.rowNodeBlockLoader.removeBlock(t)}))},i.prototype.destroyRowNodes=function(){this.blockUtils.destroyRowNodes(this.allRowNodes),this.allRowNodes=[],this.nodesAfterSort=[],this.nodesAfterFilter=[],this.allNodesMap={}},i.prototype.initialiseRowNodes=function(t,i){void 0===i&&(i=!1),this.destroyRowNodes();for(var n=0;n<t;n++){var e=this.blockUtils.createRowNode({field:this.groupField,group:this.groupLevel,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn});i&&(e.failedLoad=!0),this.allRowNodes.push(e),this.nodesAfterFilter.push(e),this.nodesAfterSort.push(e)}},i.prototype.getBlockStateJson=function(){return{id:this.nodeIdPrefix?this.nodeIdPrefix:"",state:this.getState()}},i.prototype.loadFromDatasource=function(){this.storeUtils.loadFromDatasource({startRow:void 0,endRow:void 0,parentBlock:this,parentNode:this.parentRowNode,storeParams:this.ssrmParams,successCallback:this.pageLoaded.bind(this,this.getVersion()),success:this.success.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),fail:this.pageLoadFailed.bind(this,this.getVersion())})},i.prototype.getStartRow=function(){return 0},i.prototype.getEndRow=function(){return this.nodesAfterSort.length},i.prototype.createDataNode=function(t,i){var n=this.blockUtils.createRowNode({field:this.groupField,group:this.groupLevel,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn});null!=i?Wr.insertIntoArray(this.allRowNodes,n,i):this.allRowNodes.push(n);var e=this.prefixId(this.nodeIdSequence.next());return this.blockUtils.setDataIntoRowNode(n,t,e,void 0),this.nodeManager.addRowNode(n),this.blockUtils.checkOpenByDefault(n),this.allNodesMap[n.id]=n,n},i.prototype.prefixId=function(t){return this.nodeIdPrefix?this.nodeIdPrefix+"-"+t:t.toString()},i.prototype.processServerFail=function(){this.initialiseRowNodes(1,!0),this.fireStoreUpdatedEvent(),this.flushAsyncTransactions()},i.prototype.processServerResult=function(t){if(this.isAlive()){var i=t.storeInfo||t.groupLevelInfo;i&&Object.assign(this.info,i);var n=this.allRowNodes.length>0?this.allNodesMap:void 0;this.allRowNodes=[],this.nodesAfterSort=[],this.nodesAfterFilter=[],this.allNodesMap={},t.rowData||Wr.doOnce((function(){return console.warn('AG Grid: "params.data" is missing from Server-Side Row Model success() callback. Please use the "data" attribute. If no data is returned, set an empty list.',t)}),"FullStore.noData"),this.createOrRecycleNodes(n,t.rowData),n&&this.blockUtils.destroyRowNodes(Wr.getAllValuesInObject(n)),this.filterAndSortNodes(),this.fireStoreUpdatedEvent(),this.flushAsyncTransactions()}},i.prototype.createOrRecycleNodes=function(t,i){var n=this;i&&i.forEach((function(i){var e=function(i){if(t){var e=n.gridOptionsWrapper.getRowIdFunc();if(e){var r=n.parentRowNode.getGroupKeys(),o=e({data:i,parentKeys:r.length>0?r:void 0,level:n.level}),s=t[o];if(s)return delete t[o],s}}}(i);e?function(t,i){n.allNodesMap[t.id]=t,n.blockUtils.updateDataIntoRowNode(t,i),n.allRowNodes.push(t)}(e,i):n.createDataNode(i)}))},i.prototype.flushAsyncTransactions=function(){var t=this;window.setTimeout((function(){return t.transactionManager.flushAsyncTransactions()}),0)},i.prototype.filterAndSortNodes=function(){this.filterRowNodes(),this.sortRowNodes()},i.prototype.sortRowNodes=function(){var t=this.gridOptionsWrapper.isServerSideSortAllLevels()||this.gridOptionsWrapper.isServerSideSortOnServer(),i=this.sortController.getSortOptions();this.nodesAfterSort=t||!i||0==i.length?this.nodesAfterFilter:this.rowNodeSorter.doFullSort(this.nodesAfterFilter,i)},i.prototype.filterRowNodes=function(){var t=this;this.nodesAfterFilter=this.gridOptionsWrapper.isServerSideFilterAllLevels()||this.gridOptionsWrapper.isServerSideFilterOnServer()||this.groupLevel?this.allRowNodes:this.allRowNodes.filter((function(i){return t.filterManager.doesRowPassFilter({rowNode:i})}))},i.prototype.clearDisplayIndexes=function(){var t=this;this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.allRowNodes.forEach((function(i){return t.blockUtils.clearDisplayIndex(i)}))},i.prototype.getDisplayIndexEnd=function(){return this.displayIndexEnd},i.prototype.isDisplayIndexInStore=function(t){return 0!==this.getRowCount()&&t>=this.displayIndexStart&&t<this.displayIndexEnd},i.prototype.setDisplayIndexes=function(t,i){var n=this;this.displayIndexStart=t.peek(),this.topPx=i.value;var e={};this.nodesAfterSort.forEach((function(r){n.blockUtils.setDisplayIndex(r,t,i),e[r.id]=!0})),this.allRowNodes.forEach((function(t){e[t.id]||n.blockUtils.clearDisplayIndex(t)})),this.displayIndexEnd=t.peek(),this.heightPx=i.value-this.topPx},i.prototype.forEachNodeDeep=function(t,i){void 0===i&&(i=new Vr),this.allRowNodes.forEach((function(n){t(n,i.next());var e=n.childStore;e&&e.forEachNodeDeep(t,i)}))},i.prototype.forEachNodeDeepAfterFilterAndSort=function(t,i){void 0===i&&(i=new Vr),this.nodesAfterSort.forEach((function(n){t(n,i.next());var e=n.childStore;e&&e.forEachNodeDeepAfterFilterAndSort(t,i)}))},i.prototype.getRowUsingDisplayIndex=function(t){if(this.isDisplayIndexInStore(t))return this.blockUtils.binarySearchForDisplayIndex(t,this.nodesAfterSort)},i.prototype.getRowBounds=function(t){for(var i=0;i<this.nodesAfterSort.length;i++){var n=this.blockUtils.extractRowBounds(this.nodesAfterSort[i],t);if(n)return n}return null},i.prototype.isPixelInRange=function(t){return t>=this.topPx&&t<this.topPx+this.heightPx},i.prototype.getRowIndexAtPixel=function(t){var i=this;if(t<=this.topPx)return this.nodesAfterSort[0].rowIndex;if(t>=this.topPx+this.heightPx){var n=this.nodesAfterSort[this.nodesAfterSort.length-1];if(t>=n.rowTop+n.rowHeight&&n.expanded){if(n.childStore&&n.childStore.getRowCount()>0)return n.childStore.getRowIndexAtPixel(t);if(n.detailNode)return n.detailNode.rowIndex}return n.rowIndex}var e=null;return this.nodesAfterSort.forEach((function(n){var r=i.blockUtils.getIndexAtPixel(n,t);null!=r&&(e=r)})),null==e?this.displayIndexEnd-1:e},i.prototype.getChildStore=function(t){var i=this;return this.storeUtils.getChildStore(t,this,(function(t){return i.allRowNodes.find((function(i){return i.key==t}))}))},i.prototype.forEachChildStoreShallow=function(t){this.allRowNodes.forEach((function(i){var n=i.childStore;n&&t(n)}))},i.prototype.refreshAfterFilter=function(t){var i=this.gridOptionsWrapper.isServerSideFilterOnServer(),n=this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,t);if(this.gridOptionsWrapper.isServerSideFilterAllLevels()||i&&n)return this.refreshStore(!0),void this.sortRowNodes();this.filterRowNodes(),this.sortRowNodes(),this.forEachChildStoreShallow((function(i){return i.refreshAfterFilter(t)}))},i.prototype.refreshAfterSort=function(t){var i=this.gridOptionsWrapper.isServerSideSortOnServer(),n=this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,t);if(this.gridOptionsWrapper.isServerSideSortAllLevels()||i&&n)return this.refreshStore(!0),void this.filterRowNodes();this.filterRowNodes(),this.sortRowNodes(),this.forEachChildStoreShallow((function(i){return i.refreshAfterSort(t)}))},i.prototype.applyTransaction=function(t){switch(this.getState()){case sf.STATE_FAILED:return{status:ll.StoreLoadingFailed};case sf.STATE_LOADING:return{status:ll.StoreLoading};case sf.STATE_WAITING_TO_LOAD:return{status:ll.StoreWaitingToLoad}}var i=this.gridOptionsWrapper.getIsApplyServerSideTransactionFunc();if(i&&!i({transaction:t,parentNode:this.parentRowNode,storeInfo:this.info,groupLevelInfo:this.info}))return{status:ll.Cancelled};var n={status:ll.Applied,remove:[],update:[],add:[]},e=[];return this.executeAdd(t,n),this.executeRemove(t,n,e),this.executeUpdate(t,n,e),this.filterAndSortNodes(),this.updateSelection(e),n},i.prototype.updateSelection=function(t){t.length>0&&(t.forEach((function(t){t.setSelected(!1,!1,!0)})),this.eventService.dispatchEvent({type:xi.EVENT_SELECTION_CHANGED}))},i.prototype.executeAdd=function(t,i){var n=this,e=t.add,r=t.addIndex;Wr.missingOrEmpty(e)||("number"==typeof r&&r>=0?e.reverse().forEach((function(t){var e=n.createDataNode(t,r);i.add.push(e)})):e.forEach((function(t){var e=n.createDataNode(t);i.add.push(e)})))},i.prototype.executeRemove=function(t,i,n){var e=this,r=t.remove;if(null!=r){var o={};r.forEach((function(t){var r=e.lookupRowNode(t);r&&(r.isSelected()&&n.push(r),r.clearRowTopAndRowIndex(),o[r.id]=!0,delete e.allNodesMap[r.id],i.remove.push(r),e.nodeManager.removeNode(r))})),this.allRowNodes=this.allRowNodes.filter((function(t){return!o[t.id]}))}},i.prototype.executeUpdate=function(t,i,n){var e=this,r=t.update;null!=r&&r.forEach((function(t){var r=e.lookupRowNode(t);r&&(r.updateData(t),!r.selectable&&r.isSelected()&&n.push(r),i.update.push(r))}))},i.prototype.lookupRowNode=function(t){var i,n=this.gridOptionsWrapper.getRowIdFunc();if(null!=n){var e=this.level,r=this.parentRowNode.getGroupKeys(),o=n({data:t,parentKeys:r.length>0?r:void 0,level:e});if(!(i=this.allNodesMap[o]))return console.error("AG Grid: could not find row id="+o+", data item was not found for this id"),null}else if(!(i=this.allRowNodes.find((function(i){return i.data===t}))))return console.error("AG Grid: could not find data item as object was not found",t),null;return i},i.prototype.addStoreStates=function(t){t.push({infiniteScroll:!1,route:this.parentRowNode.getGroupKeys(),rowCount:this.allRowNodes.length,info:this.info}),this.forEachChildStoreShallow((function(i){return i.addStoreStates(t)}))},i.prototype.refreshStore=function(t){t&&this.initialiseRowNodes(this.nodesAfterSort?this.nodesAfterSort.length:1),this.scheduleLoad(),this.fireStoreUpdatedEvent()},i.prototype.retryLoads=function(){this.getState()===sf.STATE_FAILED&&(this.initialiseRowNodes(1),this.scheduleLoad()),this.forEachChildStoreShallow((function(t){return t.retryLoads()}))},i.prototype.scheduleLoad=function(){this.setStateWaitingToLoad(),this.rowNodeBlockLoader.checkBlockToLoad()},i.prototype.fireStoreUpdatedEvent=function(){this.eventService.dispatchEvent({type:xi.EVENT_STORE_UPDATED})},i.prototype.getRowCount=function(){return this.nodesAfterSort.length},i.prototype.getTopLevelRowDisplayedIndex=function(t){return this.nodesAfterSort[t].rowIndex},i.prototype.isLastRowIndexKnown=function(){return this.getState()==sf.STATE_LOADED},i.prototype.getRowNodesInRange=function(t,i){var n=[],e=!1;return Wr.missing(t)&&(e=!0),this.nodesAfterSort.forEach((function(r){var o=r===t||r===i;(e||o)&&n.push(r),o&&(e=!e)})),e?[]:n},am([Dt("ssrmStoreUtils")],i.prototype,"storeUtils",void 0),am([Dt("ssrmBlockUtils")],i.prototype,"blockUtils",void 0),am([Dt("columnModel")],i.prototype,"columnModel",void 0),am([Dt("rowNodeBlockLoader")],i.prototype,"rowNodeBlockLoader",void 0),am([Dt("rowNodeSorter")],i.prototype,"rowNodeSorter",void 0),am([Dt("sortController")],i.prototype,"sortController",void 0),am([Dt("ssrmNodeManager")],i.prototype,"nodeManager",void 0),am([Dt("filterManager")],i.prototype,"filterManager",void 0),am([Dt("ssrmTransactionManager")],i.prototype,"transactionManager",void 0),am([Ft],i.prototype,"postConstruct",null),am([kt],i.prototype,"destroyRowNodes",null),i}(sf),fm=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},dm=function(){function t(){}return t.prototype.createStore=function(t,i){var n=this.getStoreParams(t,i);return new(n.infiniteScroll?hm:lm)(t,n,i)},t.prototype.getStoreParams=function(t,i){var n=this.getLevelSpecificParams(i),e=this.isInfiniteScroll(n);return{infiniteScroll:e,cacheBlockSize:this.getBlockSize(e,n),maxBlocksInCache:this.getMaxBlocksInCache(e,t,n)}},t.prototype.getMaxBlocksInCache=function(t,i,n){if(t){var e=n&&null!=n.maxBlocksInCache?n.maxBlocksInCache:this.gridOptionsWrapper.getMaxBlocksInCache();if(null!=e&&e>=0)if(i.dynamicRowHeight)Wr.doOnce((function(){return console.warn("AG Grid: Server Side Row Model does not support Dynamic Row Height and Cache Purging. Either a) remove getRowHeight() callback or b) remove maxBlocksInCache property. Purging has been disabled.")}),"storeFactory.maxBlocksInCache.dynamicRowHeight");else{if(!this.columnModel.isAutoRowHeightActive())return e;Wr.doOnce((function(){return console.warn("AG Grid: Server Side Row Model does not support Auto Row Height and Cache Purging. Either a) remove colDef.autoHeight or b) remove maxBlocksInCache property. Purging has been disabled.")}),"storeFactory.maxBlocksInCache.autoRowHeightActive")}}},t.prototype.getBlockSize=function(t,i){if(t){var n=i&&null!=i.cacheBlockSize?i.cacheBlockSize:this.gridOptionsWrapper.getCacheBlockSize();return null!=n&&n>0?n:100}},t.prototype.getLevelSpecificParams=function(t){var i=this.gridOptionsWrapper.getServerSideGroupLevelParamsFunc();if(i){var n=i({level:t.level+1,parentRowNode:t.level>=0?t:void 0,rowGroupColumns:this.columnModel.getRowGroupColumns(),pivotColumns:this.columnModel.getPivotColumns(),pivotMode:this.columnModel.isPivotMode()});return null!=n.storeType&&(n.infiniteScroll="partial"===n.storeType),n}},t.prototype.isInfiniteScroll=function(t){return t&&null!=t.infiniteScroll?t.infiniteScroll:this.gridOptionsWrapper.isServerSideInfiniteScroll()},fm([Dt("gridOptionsWrapper")],t.prototype,"gridOptionsWrapper",void 0),fm([Dt("columnModel")],t.prototype,"columnModel",void 0),fm([Pt("ssrmStoreFactory")],t)}(),vm=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},pm=function(){function t(){}return t.prototype.isSortingWithValueColumn=function(t){for(var i=this.columnModel.getValueColumns().map((function(t){return t.getColId()})),n=0;n<t.length;n++)if(i.indexOf(t[n])>-1)return!0;return!1},t.prototype.isSortingWithSecondaryColumn=function(t){if(!this.columnModel.getSecondaryColumns())return!1;for(var i=this.columnModel.getSecondaryColumns().map((function(t){return t.getColId()})),n=0;n<t.length;n++)if(i.indexOf(t[n])>-1)return!0;return!1},vm([Dt("columnModel")],t.prototype,"columnModel",void 0),vm([Pt("ssrmListenerUtils")],t)}(),gm={moduleName:Nt.ServerSideRowModelModule,rowModels:{serverSide:Dg},beans:[qg,Zg,Tg,Lg,Hg,Ug,tm,dm,pm],dependantModules:[Kp]},mm=function(){function t(){}return t.prototype.setBeans=function(t){this.beans=t},t.prototype.getFileName=function(t){var i=this.getDefaultFileExtension();return null!=t&&t.length||(t=this.getDefaultFileName()),-1===t.indexOf(".")?t+"."+i:t},t.prototype.getData=function(t){var i=this.createSerializingSession(t);return this.beans.gridSerializer.serialize(i,t)},t}(),bm=function(){function t(t){this.groupColumns=[];var i=t.valueService,n=t.gridOptionsWrapper,e=t.processCellCallback,r=t.processHeaderCallback,o=t.processGroupHeaderCallback,s=t.processRowGroupCallback;this.columnModel=t.columnModel,this.valueService=i,this.gridOptionsWrapper=n,this.processCellCallback=e,this.processHeaderCallback=r,this.processGroupHeaderCallback=o,this.processRowGroupCallback=s}return t.prototype.prepare=function(t){this.groupColumns=t.filter((function(t){return!!t.getColDef().showRowGroup}))},t.prototype.extractHeaderValue=function(t){var i=this.getHeaderName(this.processHeaderCallback,t);return null!=i?i:""},t.prototype.extractRowCellValue=function(t,i,n,e,r){var o=!this.gridOptionsWrapper.isGroupHideOpenParents()&&this.shouldRenderGroupSummaryCell(r,t,i)?this.createValueForGroupNode(r):this.valueService.getValue(t,r),s=this.processCell({accumulatedRowIndex:n,rowNode:r,column:t,value:o,processCellCallback:this.processCellCallback,type:e});return null!=s?s:""},t.prototype.shouldRenderGroupSummaryCell=function(t,i,n){var e;if(!t||!t.group)return!1;if(-1!==this.groupColumns.indexOf(i)&&(null===(e=t.groupData)||void 0===e?void 0:e[i.getId()]))return!0;var r=this.gridOptionsWrapper.isGroupUseEntireRow(this.columnModel.isPivotMode());return 0===n&&r},t.prototype.getHeaderName=function(t,i){return t?t({column:i,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()}):this.columnModel.getDisplayNameForColumn(i,"csv",!0)},t.prototype.createValueForGroupNode=function(t){if(this.processRowGroupCallback)return this.processRowGroupCallback({node:t,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()});var i=[t.key];if(!this.gridOptionsWrapper.isGroupMultiAutoColumn())for(;t.parent;)i.push((t=t.parent).key);return i.reverse().join(" -> ")},t.prototype.processCell=function(t){var i=t.value,n=t.processCellCallback,e=t.type;return n?n({accumulatedRowIndex:t.accumulatedRowIndex,column:t.column,node:t.rowNode,value:i,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext(),type:e}):null!=i?i:""},t}(),wm=function(){function t(){}return t.download=function(t,i){var n=document.defaultView||window;if(n){var e=document.createElement("a"),r=n.URL.createObjectURL(i);e.setAttribute("href",r),e.setAttribute("download",t),e.style.display="none",document.body.appendChild(e),e.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:n})),document.body.removeChild(e),n.setTimeout((function(){n.URL.revokeObjectURL(r)}),0)}else console.warn("AG Grid: There is no `window` associated with the current `document`")},t}(),ym=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Cm=function(t){function i(i){var n=t.call(this,i)||this;n.isFirstLine=!0,n.result="";var e=i.columnSeparator;return n.suppressQuotes=i.suppressQuotes,n.columnSeparator=e,n}return ym(i,t),i.prototype.addCustomContent=function(t){var i=this;t&&("string"==typeof t?(/^\s*\n/.test(t)||this.beginNewLine(),t=t.replace(/\r?\n/g,"\r\n"),this.result+=t):t.forEach((function(t){i.beginNewLine(),t.forEach((function(t,n){0!==n&&(i.result+=i.columnSeparator),i.result+=i.putInQuotes(t.data.value||""),t.mergeAcross&&i.appendEmptyCells(t.mergeAcross)}))})))},i.prototype.onNewHeaderGroupingRow=function(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}},i.prototype.onNewHeaderGroupingRowColumn=function(t,i,n,e){0!=n&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(i),this.appendEmptyCells(e)},i.prototype.appendEmptyCells=function(t){for(var i=1;i<=t;i++)this.result+=this.columnSeparator+this.putInQuotes("")},i.prototype.onNewHeaderRow=function(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}},i.prototype.onNewHeaderRowColumn=function(t,i){0!=i&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(t))},i.prototype.onNewBodyRow=function(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}},i.prototype.onNewBodyRowColumn=function(t,i,n){0!=i&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractRowCellValue(t,i,i,Vt.EXPORT_TYPE_CSV,n))},i.prototype.putInQuotes=function(t){return this.suppressQuotes?t:null==t?'""':("string"==typeof t?i=t:"function"==typeof t.toString?i=t.toString():(console.warn("AG Grid: unknown value type during csv conversion"),i=""),'"'+i.replace(/"/g,'""')+'"');var i},i.prototype.parse=function(){return this.result},i.prototype.beginNewLine=function(){this.isFirstLine||(this.result+="\r\n"),this.isFirstLine=!1},i}(bm),Sm=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Rm=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Om=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Sm(i,t),i.prototype.postConstruct=function(){this.setBeans({gridSerializer:this.gridSerializer,gridOptionsWrapper:this.gridOptionsWrapper})},i.prototype.getMergedParams=function(t){var i=this.gridOptionsWrapper.getDefaultExportParams("csv");return Object.assign({},i,t)},i.prototype.export=function(t){if(this.isExportSuppressed())return console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration."),"";var i=this.getMergedParams(t),n=this.getData(i),e=new Blob(["\ufeff",n],{type:"text/plain"});return wm.download(this.getFileName(i.fileName),e),n},i.prototype.exportDataAsCsv=function(t){return this.export(t)},i.prototype.getDataAsCsv=function(t,i){void 0===i&&(i=!1);var n=i?Object.assign({},t):this.getMergedParams(t);return this.getData(n)},i.prototype.getDefaultFileName=function(){return"export.csv"},i.prototype.getDefaultFileExtension=function(){return"csv"},i.prototype.createSerializingSession=function(t){var i=this;return new Cm({columnModel:i.columnModel,valueService:i.valueService,gridOptionsWrapper:i.gridOptionsWrapper,processCellCallback:t.processCellCallback||void 0,processHeaderCallback:t.processHeaderCallback||void 0,processGroupHeaderCallback:t.processGroupHeaderCallback||void 0,processRowGroupCallback:t.processRowGroupCallback||void 0,suppressQuotes:t.suppressQuotes||!1,columnSeparator:t.columnSeparator||","})},i.prototype.isExportSuppressed=function(){return this.gridOptionsWrapper.isSuppressCsvExport()},Rm([Dt("columnModel")],i.prototype,"columnModel",void 0),Rm([Dt("valueService")],i.prototype,"valueService",void 0),Rm([Dt("gridSerializer")],i.prototype,"gridSerializer",void 0),Rm([Dt("gridOptionsWrapper")],i.prototype,"gridOptionsWrapper",void 0),Rm([Ft],i.prototype,"postConstruct",null),Rm([Pt("csvCreator")],i)}(mm),Am=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),jm=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(t){t[t.HEADER_GROUPING=0]="HEADER_GROUPING",t[t.HEADER=1]="HEADER",t[t.BODY=2]="BODY"}(um||(um={}));var _m,Gm=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Am(i,t),i.prototype.serialize=function(t,i){void 0===i&&(i={});var n=this.getColumnsToExport(i.allColumns,i.columnKeys);return Wr.compose(this.prepareSession(n),this.prependContent(i),this.exportColumnGroups(i,n),this.exportHeaders(i,n),this.processPinnedTopRows(i,n),this.processRows(i,n),this.processPinnedBottomRows(i,n),this.appendContent(i))(t).parse()},i.prototype.processRow=function(t,i,n,e){var r=i.shouldRowBeSkipped||function(){return!1},o=this.gridOptionsWrapper,s=o.getContext(),u=o.getApi(),h=o.getColumnApi(),c=o.isGroupRemoveSingleChildren(),a=o.isGroupRemoveLowestSingleChildren(),l=null!=i.rowPositions,f=l||!!i.onlySelected,d=o.isGroupHideOpenParents()&&!f,v=this.columnModel.isPivotMode()?e.leafGroup:!e.group,p=1===e.allChildrenCount&&(c||a&&e.leafGroup);if((i.skipGroups||i.skipRowGroups)&&i.skipGroups&&Wr.doOnce((function(){return console.warn("AG Grid: Since v25.2 `skipGroups` has been renamed to `skipRowGroups`.")}),"gridSerializer-skipGroups"),!(!v&&(i.skipRowGroups||p||d)||i.onlySelected&&!e.isSelected()||i.skipPinnedTop&&"top"===e.rowPinned||i.skipPinnedBottom&&"bottom"===e.rowPinned)&&(-1!==e.level||e.leafGroup||e.footer&&l)&&!r({node:e,api:u,columnApi:h,context:s})){var g=t.onNewBodyRow();if(n.forEach((function(t,i){g.onColumn(t,i,e)})),i.getCustomContentBelowRow){var m=i.getCustomContentBelowRow({node:e,api:u,columnApi:h,context:s});m&&t.addCustomContent(m)}}},i.prototype.appendContent=function(t){return function(i){var n=t.customFooter||t.appendContent;return n&&(t.customFooter&&Wr.doOnce((function(){return console.warn("AG Grid: Since version 25.2.0 the `customFooter` param has been deprecated. Use `appendContent` instead.")}),"gridSerializer-customFooter"),i.addCustomContent(n)),i}},i.prototype.prependContent=function(t){return function(i){var n=t.customHeader||t.prependContent;return n&&(t.customHeader&&Wr.doOnce((function(){return console.warn("AG Grid: Since version 25.2.0 the `customHeader` param has been deprecated. Use `prependContent` instead.")}),"gridSerializer-customHeader"),i.addCustomContent(n)),i}},i.prototype.prepareSession=function(t){return function(i){return i.prepare(t),i}},i.prototype.exportColumnGroups=function(t,i){var n=this;return function(e){if(t.skipColumnGroupHeaders)t.columnGroups&&Wr.doOnce((function(){return console.warn("AG Grid: Since v25.2 the `columnGroups` param has deprecated, and groups are exported by default.")}),"gridSerializer-columnGroups");else{var r=new Mi,o=n.displayedGroupCreator.createDisplayedGroups(i,n.columnModel.getGridBalancedTree(),r,null);n.recursivelyAddHeaderGroups(o,e,t.processGroupHeaderCallback)}return e}},i.prototype.exportHeaders=function(t,i){return function(n){if(t.skipHeader||t.skipColumnHeaders)t.skipHeader&&Wr.doOnce((function(){return console.warn("AG Grid: Since v25.2 the `skipHeader` param has been renamed to `skipColumnHeaders`.")}),"gridSerializer-skipHeader");else{var e=n.onNewHeaderRow();i.forEach((function(t,i){e.onColumn(t,i,void 0)}))}return n}},i.prototype.processPinnedTopRows=function(t,i){var n=this;return function(e){var r=n.processRow.bind(n,e,t,i);return t.rowPositions?t.rowPositions.filter((function(t){return"top"===t.rowPinned})).sort((function(t,i){return t.rowIndex-i.rowIndex})).map((function(t){return n.pinnedRowModel.getPinnedTopRow(t.rowIndex)})).forEach(r):n.pinnedRowModel.forEachPinnedTopRow(r),e}},i.prototype.processRows=function(t,i){var n=this;return function(e){var r=n.rowModel,o=r.getType(),s=o===Vt.ROW_MODEL_TYPE_CLIENT_SIDE,u=o===Vt.ROW_MODEL_TYPE_SERVER_SIDE,h=!s&&t.onlySelected,c=n.processRow.bind(n,e,t,i),a=t.exportedRows,l=void 0===a?"filteredAndSorted":a;return t.rowPositions?t.rowPositions.filter((function(t){return null==t.rowPinned})).sort((function(t,i){return t.rowIndex-i.rowIndex})).map((function(t){return r.getRow(t.rowIndex)})).forEach(c):n.columnModel.isPivotMode()?s?r.forEachPivotNode(c):r.forEachNode(c):t.onlySelectedAllPages||h?n.selectionService.getSelectedNodes().forEach(c):"all"===l?r.forEachNode(c):s||u?r.forEachNodeAfterFilterAndSort(c):r.forEachNode(c),e}},i.prototype.processPinnedBottomRows=function(t,i){var n=this;return function(e){var r=n.processRow.bind(n,e,t,i);return t.rowPositions?t.rowPositions.filter((function(t){return"bottom"===t.rowPinned})).sort((function(t,i){return t.rowIndex-i.rowIndex})).map((function(t){return n.pinnedRowModel.getPinnedBottomRow(t.rowIndex)})).forEach(r):n.pinnedRowModel.forEachPinnedBottomRow(r),e}},i.prototype.getColumnsToExport=function(t,i){void 0===t&&(t=!1);var n=this.columnModel.isPivotMode();return i&&i.length?this.columnModel.getGridColumns(i):t&&!n?(this.gridOptionsWrapper.isTreeData()?this.columnModel.getGridColumns([Vt.GROUP_AUTO_COLUMN_ID]):[]).concat(this.columnModel.getAllPrimaryColumns()||[]):this.columnModel.getAllDisplayedColumns()},i.prototype.recursivelyAddHeaderGroups=function(t,i,n){var e=[];t.forEach((function(t){t.getChildren&&t.getChildren().forEach((function(t){return e.push(t)}))})),t.length>0&&t[0]instanceof ui&&this.doAddHeaderHeader(i,t,n),e&&e.length>0&&this.recursivelyAddHeaderGroups(e,i,n)},i.prototype.doAddHeaderHeader=function(t,i,n){var e=this,r=t.onNewHeaderGroupingRow(),o=0;i.forEach((function(t){var i,s=t;i=n?n({columnGroup:s,api:e.gridOptionsWrapper.getApi(),columnApi:e.gridOptionsWrapper.getColumnApi(),context:e.gridOptionsWrapper.getContext()}):e.columnModel.getDisplayNameForColumnGroup(s,"header");var u=s.getLeafColumns().reduce((function(t,i,n,e){var r=Wr.last(t);return"open"===i.getColumnGroupShow()?r&&null==r[1]||t.push(r=[n]):r&&null==r[1]&&(r[1]=n-1),n===e.length-1&&r&&null==r[1]&&(r[1]=n),t}),[]);r.onColumn(s,i||"",o++,s.getLeafColumns().length-1,u)}))},jm([Dt("displayedGroupCreator")],i.prototype,"displayedGroupCreator",void 0),jm([Dt("columnModel")],i.prototype,"columnModel",void 0),jm([Dt("rowModel")],i.prototype,"rowModel",void 0),jm([Dt("pinnedRowModel")],i.prototype,"pinnedRowModel",void 0),jm([Dt("selectionService")],i.prototype,"selectionService",void 0),jm([Dt("rowPositionUtils")],i.prototype,"rowPositionUtils",void 0),jm([Pt("gridSerializer")],i)}(Ai),xm={moduleName:Nt.CsvExportModule,beans:[Om,Gm]},Mm=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Fm=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},km=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.lastPasteOperationTime=0,i.navigatorApiFailed=!1,i}return Mm(i,t),i.prototype.init=function(){var t=this;this.logger=this.loggerFactory.create("ClipboardService"),this.rowModel.getType()===Vt.ROW_MODEL_TYPE_CLIENT_SIDE&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady((function(i){t.gridCtrl=i.gridCtrl}))},i.prototype.pasteFromClipboard=function(){var t=this;this.logger.log("pasteFromClipboard"),!this.gridOptionsWrapper.isSuppressClipboardApi()&&!this.navigatorApiFailed&&navigator.clipboard&&navigator.clipboard.readText?navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch((function(i){Wr.doOnce((function(){console.warn(i),console.warn("AG Grid: Unable to use the Clipboard API (navigator.clipboard.readText()). The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API")}),"clipboardApiError"),t.navigatorApiFailed=!0,t.pasteFromClipboardLegacy()})):this.pasteFromClipboardLegacy()},i.prototype.pasteFromClipboardLegacy=function(){var t=this,i=!1,n=function(n){var e=(new Date).getTime();e-t.lastPasteOperationTime<50&&(i=!0,n.preventDefault()),t.lastPasteOperationTime=e};this.executeOnTempElement((function(t){t.addEventListener("paste",n),t.focus({preventScroll:!0})}),(function(e){var r=e.value;i?t.refocusLastFocusedCell():t.processClipboardData(r),e.removeEventListener("paste",n)}))},i.prototype.refocusLastFocusedCell=function(){var t=this.focusService.getFocusedCell();t&&this.focusService.setFocusedCell({rowIndex:t.rowIndex,column:t.column,rowPinned:t.rowPinned,forceBrowserFocus:!0})},i.prototype.processClipboardData=function(t){var i=this;if(null!=t){var n=Wr.stringToArray(t,this.gridOptionsWrapper.getClipboardDelimiter()),e=this.gridOptionsWrapper.getProcessDataFromClipboardFunc();e&&(n=e({data:n})),null!=n&&(this.gridOptionsWrapper.isSuppressLastEmptyLineOnPaste()&&this.removeLastLineIfBlank(n),this.doPasteOperation((function(t,e,r,o){i.rangeService&&i.rangeService.isMoreThanOneCell()&&!i.hasOnlyOneValueToPaste(n)?i.pasteIntoActiveRange(n,t,e,o):i.pasteStartingFromFocusedCell(n,t,e,r,o)})))}},i.prototype.doPasteOperation=function(t){var i,n=this.gridOptionsWrapper.getApi(),e=this.gridOptionsWrapper.getColumnApi(),r="clipboard";if(this.eventService.dispatchEvent({type:xi.EVENT_PASTE_START,api:n,columnApi:e,source:r}),this.clientSideRowModel){var o=this.gridOptionsWrapper.isAggregateOnlyChangedColumns();i=new rf(o,this.clientSideRowModel.getRootNode())}var s={},u=[];t(s,u,this.focusService.getFocusedCell(),i),i&&this.clientSideRowModel.doAggregate(i),this.rowRenderer.refreshCells(),this.dispatchFlashCells(s),this.fireRowChanged(u),this.refocusLastFocusedCell(),this.eventService.dispatchEvent({type:xi.EVENT_PASTE_END,source:r})},i.prototype.pasteIntoActiveRange=function(t,i,n,e){var r=this,o=this.getRangeSize()%t.length!=0,s=0,u=0;this.iterateActiveRanges(!1,(function(h,c,a,l){if(l-s>=t.length){if(o)return;s+=u,u=0}var f=t[l-s];n.push(c);var d=r.gridOptionsWrapper.getProcessCellFromClipboardFunc();a.forEach((function(t,n){if(t.isCellEditable(c)&&!t.isSuppressPaste(c)){n>=f.length&&(n%=f.length);var o=r.processCell(c,t,f[n],Vt.EXPORT_TYPE_DRAG_COPY,d);c.setDataValue(t,o,Vt.SOURCE_PASTE),e&&e.addParentNode(c.parent,[t]);var s=r.cellPositionUtils.createIdFromValues(h.rowIndex,t,h.rowPinned);i[s]=!0}})),u++}))},i.prototype.pasteStartingFromFocusedCell=function(t,i,n,e,r){if(e){var o={rowIndex:e.rowIndex,rowPinned:e.rowPinned},s=this.columnModel.getDisplayedColumnsStartingAt(e.column);this.isPasteSingleValueIntoRange(t)?this.pasteSingleValueIntoRange(t,n,i,r):this.pasteMultipleValues(t,o,n,s,i,Vt.EXPORT_TYPE_CLIPBOARD,r)}},i.prototype.isPasteSingleValueIntoRange=function(t){return this.hasOnlyOneValueToPaste(t)&&null!=this.rangeService&&!this.rangeService.isEmpty()},i.prototype.pasteSingleValueIntoRange=function(t,i,n,e){var r=this,o=t[0][0];this.iterateActiveRanges(!1,(function(t,s,u){i.push(s),u.forEach((function(t){return r.updateCellValue(s,t,o,n,Vt.EXPORT_TYPE_CLIPBOARD,e)}))}))},i.prototype.hasOnlyOneValueToPaste=function(t){return 1===t.length&&1===t[0].length},i.prototype.copyRangeDown=function(){var t=this;if(this.rangeService&&!this.rangeService.isEmpty()){var i=[];this.doPasteOperation((function(n,e,r,o){var s=t.gridOptionsWrapper.getProcessCellForClipboardFunc(),u=t.gridOptionsWrapper.getProcessCellFromClipboardFunc();t.iterateActiveRanges(!0,(function(r,h,c){i.length?(e.push(h),c.forEach((function(e,s){if(e.isCellEditable(h)&&!e.isSuppressPaste(h)){var c=t.processCell(h,e,i[s],Vt.EXPORT_TYPE_DRAG_COPY,u);h.setDataValue(e,c,Vt.SOURCE_PASTE),o&&o.addParentNode(h.parent,[e]);var a=t.cellPositionUtils.createIdFromValues(r.rowIndex,e,r.rowPinned);n[a]=!0}}))):c.forEach((function(n){var e=t.processCell(h,n,t.valueService.getValue(n,h),Vt.EXPORT_TYPE_DRAG_COPY,s);i.push(e)}))}))}))}},i.prototype.removeLastLineIfBlank=function(t){var i=Wr.last(t);if(i&&1===i.length&&""===i[0]){if(1===t.length)return;Wr.removeFromArray(t,i)}},i.prototype.fireRowChanged=function(t){var i=this;this.gridOptionsWrapper.isFullRowEdit()&&t.forEach((function(t){i.eventService.dispatchEvent({type:xi.EVENT_ROW_VALUE_CHANGED,node:t,data:t.data,rowIndex:t.rowIndex,rowPinned:t.rowPinned})}))},i.prototype.pasteMultipleValues=function(t,i,n,e,r,o,s){var u=this,h=i,c=null!=this.clientSideRowModel&&!this.gridOptionsWrapper.isTreeData();t.forEach((function(t){var i=function(){for(;;){if(!h)return null;var t=u.rowPositionUtils.getRowNode(h);if(h=u.cellNavigationService.getRowBelow({rowPinned:h.rowPinned,rowIndex:h.rowIndex}),null==t)return null;if(!(t.detail||t.footer||c&&t.group))return t}}();i&&(t.forEach((function(t,n){return u.updateCellValue(i,e[n],t,r,o,s)})),n.push(i))}))},i.prototype.updateCellValue=function(t,i,n,e,r,o){if(t&&i&&i.isCellEditable(t)&&!i.isSuppressPaste(t)){var s=this.processCell(t,i,n,r,this.gridOptionsWrapper.getProcessCellFromClipboardFunc());t.setDataValue(i,s,Vt.SOURCE_PASTE),e[this.cellPositionUtils.createIdFromValues(t.rowIndex,i,t.rowPinned)]=!0,o&&o.addParentNode(t.parent,[i])}},i.prototype.copyToClipboard=function(t){void 0===t&&(t={});var i=t.includeHeaders,n=t.includeGroupHeaders;this.logger.log("copyToClipboard: includeHeaders = "+i),null==i&&(i=this.gridOptionsWrapper.isCopyHeadersToClipboard()),null==n&&(n=this.gridOptionsWrapper.isCopyGroupHeadersToClipboard());var e={includeHeaders:i,includeGroupHeaders:n},r=!this.gridOptionsWrapper.isSuppressCopyRowsToClipboard();!this.rangeService||this.rangeService.isEmpty()||this.shouldSkipSingleCellRange()?r&&!this.selectionService.isEmpty()?this.copySelectedRowsToClipboard(e):this.focusService.isAnyCellFocused()&&this.copyFocusedCellToClipboard(e):this.copySelectedRangeToClipboard(e)},i.prototype.shouldSkipSingleCellRange=function(){return this.gridOptionsWrapper.isSuppressCopySingleCellRanges()&&!this.rangeService.isMoreThanOneCell()},i.prototype.iterateActiveRanges=function(t,i,n){var e=this;if(this.rangeService&&!this.rangeService.isEmpty()){var r=this.rangeService.getCellRanges();t?this.iterateActiveRange(r[0],i,n,!0):r.forEach((function(t,o){return e.iterateActiveRange(t,i,n,o===r.length-1)}))}},i.prototype.iterateActiveRange=function(t,i,n,e){if(this.rangeService){var r=this.rangeService.getRangeStartRow(t),o=this.rangeService.getRangeEndRow(t);n&&t.columns&&n(t.columns);for(var s=0,u=!1;!u&&null!=r;){var h=this.rowPositionUtils.getRowNode(r);u=this.rowPositionUtils.sameRow(r,o),i(r,h,t.columns,s++,u&&e),r=this.cellNavigationService.getRowBelow(r)}}},i.prototype.copySelectedRangeToClipboard=function(t){if(void 0===t&&(t={}),this.rangeService&&!this.rangeService.isEmpty()){var i=this.rangeService.areAllRangesAbleToMerge()?this.buildDataFromMergedRanges(t):this.buildDataFromRanges(t),n=i.cellsToFlash;this.copyDataToClipboard(i.data),this.dispatchFlashCells(n)}},i.prototype.buildDataFromMergedRanges=function(t){var i=this,n=new Set,e=this.rangeService.getCellRanges(),r=new Map,o=[],s={};e.forEach((function(t){t.columns.forEach((function(t){return n.add(t)}));var e=i.getRangeRowPositionsAndCellsToFlash(t),u=e.cellsToFlash;e.rowPositions.forEach((function(t){var i=t.rowIndex+"-"+(t.rowPinned||"null");r.get(i)||(r.set(i,!0),o.push(t))})),Object.assign(s,u)}));var u=this.columnModel.getAllDisplayedColumns(),h=Array.from(n);return h.sort((function(t,i){return u.indexOf(t)-u.indexOf(i)})),{data:this.buildExportParams({columns:h,rowPositions:o,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}),cellsToFlash:s}},i.prototype.buildDataFromRanges=function(t){var i=this,n=this.rangeService.getCellRanges(),e=[],r={};return n.forEach((function(n){var o=i.getRangeRowPositionsAndCellsToFlash(n),s=o.rowPositions;Object.assign(r,o.cellsToFlash),e.push(i.buildExportParams({columns:n.columns,rowPositions:s,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}))})),{data:e.join("\n"),cellsToFlash:r}},i.prototype.getRangeRowPositionsAndCellsToFlash=function(t){for(var i=this,n=[],e={},r=this.rangeService.getRangeStartRow(t),o=this.rangeService.getRangeEndRow(t),s=r;s&&(n.push(s),t.columns.forEach((function(t){var n=i.cellPositionUtils.createIdFromValues(s.rowIndex,t,s.rowPinned);e[n]=!0})),!this.rowPositionUtils.sameRow(s,o));)s=this.cellNavigationService.getRowBelow(s);return{rowPositions:n,cellsToFlash:e}},i.prototype.copyFocusedCellToClipboard=function(t){var i;void 0===t&&(t={});var n=this.focusService.getFocusedCell();if(null!=n){var e=this.cellPositionUtils.createId(n),r=this.buildExportParams({columns:[n.column],rowPositions:[{rowPinned:n.rowPinned,rowIndex:n.rowIndex}],includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders});this.copyDataToClipboard(r),this.dispatchFlashCells(((i={})[e]=!0,i))}},i.prototype.copySelectedRowsToClipboard=function(t){void 0===t&&(t={});var i=this.buildExportParams({columns:t.columnKeys,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders});this.copyDataToClipboard(i)},i.prototype.buildExportParams=function(t){var i=t.rowPositions,n=t.includeHeaders,e=t.includeGroupHeaders,r={columnKeys:t.columns,rowPositions:i,skipColumnHeaders:!(void 0!==n&&n),skipColumnGroupHeaders:!(void 0!==e&&e),suppressQuotes:!0,columnSeparator:this.gridOptionsWrapper.getClipboardDelimiter(),onlySelected:!i,processCellCallback:this.gridOptionsWrapper.getProcessCellForClipboardFunc(),processRowGroupCallback:function(t){return t.node.key},processHeaderCallback:this.gridOptionsWrapper.getProcessHeaderForClipboardFunc(),processGroupHeaderCallback:this.gridOptionsWrapper.getProcessGroupHeaderForClipboardFunc()};return this.csvCreator.getDataAsCsv(r,!0)},i.prototype.dispatchFlashCells=function(t){var i=this;window.setTimeout((function(){i.eventService.dispatchEvent({type:xi.EVENT_FLASH_CELLS,cells:t})}),0)},i.prototype.processCell=function(t,i,n,e,r){return r?r({column:i,node:t,value:n,type:e}):n},i.prototype.copyDataToClipboard=function(t){var i=this,n=this.gridOptionsWrapper.getSendToClipboardFunc();n?n({data:t}):!this.gridOptionsWrapper.isSuppressClipboardApi()&&navigator.clipboard?navigator.clipboard.writeText(t).catch((function(n){Wr.doOnce((function(){console.warn(n),console.warn("AG Grid: Unable to use the Clipboard API (navigator.clipboard.writeText()). The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API.")}),"clipboardApiError"),i.copyDataToClipboardLegacy(t)})):this.copyDataToClipboardLegacy(t)},i.prototype.copyDataToClipboardLegacy=function(t){var i=this;this.executeOnTempElement((function(n){var e=i.gridOptionsWrapper.getDocument(),r=e.activeElement;n.value=t||" ",n.select(),n.focus({preventScroll:!0}),e.execCommand("copy")||console.warn("AG Grid: Browser did not allow document.execCommand('copy'). Ensure api.copySelectedRowsToClipboard() is invoked via a user event, i.e. button click, otherwise the browser will prevent it for security reasons."),null!=r&&null!=r.focus&&r.focus({preventScroll:!0})}))},i.prototype.executeOnTempElement=function(t,i){var n=this.gridOptionsWrapper.getDocument(),e=n.createElement("textarea");e.style.width="1px",e.style.height="1px",e.style.top=n.documentElement.scrollTop+"px",e.style.left=n.documentElement.scrollLeft+"px",e.style.position="absolute",e.style.opacity="0";var r=this.gridCtrl.getGui();r.appendChild(e);try{t(e)}catch(t){console.warn("AG Grid: Browser does not support document.execCommand('copy') for clipboard operations")}i?window.setTimeout((function(){i(e),r.removeChild(e)}),100):r.removeChild(e)},i.prototype.getRangeSize=function(){var t=this.rangeService.getCellRanges(),i=0,n=0;return t.length>0&&(i=this.rangeService.getRangeStartRow(t[0]).rowIndex,n=this.rangeService.getRangeEndRow(t[0]).rowIndex),i-n+1},Fm([Dt("csvCreator")],i.prototype,"csvCreator",void 0),Fm([Dt("loggerFactory")],i.prototype,"loggerFactory",void 0),Fm([Dt("selectionService")],i.prototype,"selectionService",void 0),Fm([It("rangeService")],i.prototype,"rangeService",void 0),Fm([Dt("rowModel")],i.prototype,"rowModel",void 0),Fm([Dt("ctrlsService")],i.prototype,"ctrlsService",void 0),Fm([Dt("valueService")],i.prototype,"valueService",void 0),Fm([Dt("focusService")],i.prototype,"focusService",void 0),Fm([Dt("rowRenderer")],i.prototype,"rowRenderer",void 0),Fm([Dt("columnModel")],i.prototype,"columnModel",void 0),Fm([Dt("cellNavigationService")],i.prototype,"cellNavigationService",void 0),Fm([Dt("cellPositionUtils")],i.prototype,"cellPositionUtils",void 0),Fm([Dt("rowPositionUtils")],i.prototype,"rowPositionUtils",void 0),Fm([Ft],i.prototype,"init",null),Fm([Pt("clipboardService")],i)}(Ai),Pm={moduleName:Nt.ClipboardModule,beans:[km],dependantModules:[Kp,xm]},Dm=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Im=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(t){t[t.EXPANDED=0]="EXPANDED",t[t.COLLAPSED=1]="COLLAPSED",t[t.INDETERMINATE=2]="INDETERMINATE"}(_m||(_m={})),function(t){function i(){return t.call(this,i.TEMPLATE)||this}Dm(i,t),i.prototype.postConstruct=function(){var t=this;this.createExpandIcons(),this.addManagedListener(this.eExpand,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eExpand,"keydown",(function(i){i.key===xr.SPACE&&t.onExpandClicked()})),this.addManagedListener(this.eSelect.getInputElement(),"click",this.onSelectClicked.bind(this)),this.eFilterTextField.onValueChange((function(){return t.onFilterTextChanged()})),this.addManagedListener(this.eFilterTextField.getInputElement(),"keypress",this.onMiniFilterKeyPress.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_NEW_COLUMNS_LOADED,this.showOrHideOptions.bind(this));var i=this.gridOptionsWrapper.getLocaleTextFunc();this.eSelect.setInputAriaLabel(i("ariaColumnSelectAll","Toggle Select All Columns")),this.eFilterTextField.setInputAriaLabel(i("ariaFilterColumnsInput","Filter Columns Input"))},i.prototype.init=function(t){this.params=t,this.columnModel.isReady()&&this.showOrHideOptions()},i.prototype.createExpandIcons=function(){this.eExpand.appendChild(this.eExpandChecked=Wr.createIconNoSpan("columnSelectOpen",this.gridOptionsWrapper)),this.eExpand.appendChild(this.eExpandUnchecked=Wr.createIconNoSpan("columnSelectClosed",this.gridOptionsWrapper)),this.eExpand.appendChild(this.eExpandIndeterminate=Wr.createIconNoSpan("columnSelectIndeterminate",this.gridOptionsWrapper)),this.setExpandState(_m.EXPANDED)},i.prototype.showOrHideOptions=function(){var t=!this.params.suppressColumnFilter,i=!this.params.suppressColumnSelectAll,n=!this.params.suppressColumnExpandAll,e=this.columnModel.isPrimaryColumnGroupsPresent(),r=this.gridOptionsWrapper.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(r("searchOoo","Search...")),Wr.setDisplayed(this.eFilterTextField.getGui(),t),Wr.setDisplayed(this.eSelect.getGui(),i),Wr.setDisplayed(this.eExpand,n&&e)},i.prototype.onFilterTextChanged=function(){var t=this;this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=Wr.debounce((function(){var i=t.eFilterTextField.getValue();t.dispatchEvent({type:"filterChanged",filterText:i})}),i.DEBOUNCE_DELAY)),this.onFilterTextChangedDebounced()},i.prototype.onMiniFilterKeyPress=function(t){var n=this;t.key===xr.ENTER&&setTimeout((function(){return n.onSelectClicked()}),i.DEBOUNCE_DELAY)},i.prototype.onSelectClicked=function(){this.dispatchEvent({type:this.selectState?"unselectAll":"selectAll"})},i.prototype.onExpandClicked=function(){this.dispatchEvent({type:this.expandState===_m.EXPANDED?"collapseAll":"expandAll"})},i.prototype.setExpandState=function(t){this.expandState=t,Wr.setDisplayed(this.eExpandChecked,this.expandState===_m.EXPANDED),Wr.setDisplayed(this.eExpandUnchecked,this.expandState===_m.COLLAPSED),Wr.setDisplayed(this.eExpandIndeterminate,this.expandState===_m.INDETERMINATE)},i.prototype.setSelectionState=function(t){this.selectState=t,this.eSelect.setValue(this.selectState)},i.DEBOUNCE_DELAY=300,i.TEMPLATE='<div class="ag-column-select-header" role="presentation" tabindex="-1">\n <div ref="eExpand" class="ag-column-select-header-icon" tabindex="0"></div>\n <ag-checkbox ref="eSelect" class="ag-column-select-header-checkbox"></ag-checkbox>\n <ag-input-text-field class="ag-column-select-header-filter-wrapper" ref="eFilterTextField"></ag-input-text-field>\n </div>',Im([Dt("columnModel")],i.prototype,"columnModel",void 0),Im([no("eExpand")],i.prototype,"eExpand",void 0),Im([no("eSelect")],i.prototype,"eSelect",void 0),Im([no("eFilterTextField")],i.prototype,"eFilterTextField",void 0),Im([Ft],i.prototype,"postConstruct",null)}(io);var Em=function(){function t(t,i,n,e,r){void 0===e&&(e=!1),this.eventService=new Wt,this.displayName=t,this.dept=n,this.group=e,e?(this.columnGroup=i,this.expanded=r,this.children=[]):this.column=i}return t.prototype.isGroup=function(){return this.group},t.prototype.getDisplayName=function(){return this.displayName},t.prototype.getColumnGroup=function(){return this.columnGroup},t.prototype.getColumn=function(){return this.column},t.prototype.getDept=function(){return this.dept},t.prototype.isExpanded=function(){return!!this.expanded},t.prototype.getChildren=function(){return this.children},t.prototype.isPassesFilter=function(){return this.passesFilter},t.prototype.setExpanded=function(i){i!==this.expanded&&(this.expanded=i,this.eventService.dispatchEvent({type:t.EVENT_EXPANDED_CHANGED}))},t.prototype.setPassesFilter=function(t){this.passesFilter=t},t.prototype.addEventListener=function(t,i){this.eventService.addEventListener(t,i)},t.prototype.removeEventListener=function(t,i){this.eventService.removeEventListener(t,i)},t.EVENT_EXPANDED_CHANGED="expandedChanged",t}(),Tm=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),zm=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Nm=function(t,i){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var e,r,o=n.call(t),s=[];try{for(;(void 0===i||i-- >0)&&!(e=o.next()).done;)s.push(e.value)}catch(t){r={error:t}}finally{try{e&&!e.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},Lm=function(t){function i(i,n,e){var r=t.call(this,'<div class="ag-menu"></div>')||this;return r.column=i,r.mouseEvent=n,r.parentEl=e,r.displayName=null,r}return Tm(i,t),i.prototype.postConstruct=function(){this.initializeProperties(this.column),this.buildMenuItemMap(),this.displayName=this.column instanceof qt?this.columnModel.getDisplayNameForColumn(this.column,"columnToolPanel"):this.columnModel.getDisplayNameForProvidedColumnGroup(null,this.column,"columnToolPanel"),this.isActive()&&(this.mouseEvent.preventDefault(),this.displayContextMenu())},i.prototype.initializeProperties=function(t){this.columns=t instanceof hi?t.getLeafColumns():[t],this.allowGrouping=this.columns.some((function(t){return t.isPrimary()&&t.isAllowRowGroup()})),this.allowValues=this.columns.some((function(t){return t.isPrimary()&&t.isAllowValue()})),this.allowPivoting=this.columnModel.isPivotMode()&&this.columns.some((function(t){return t.isPrimary()&&t.isAllowPivot()}))},i.prototype.buildMenuItemMap=function(){var t=this,i=this.gridOptionsWrapper.getLocaleTextFunc();this.menuItemMap=new Map,this.menuItemMap.set("rowGroup",{allowedFunction:function(t){return t.isPrimary()&&t.isAllowRowGroup()},activeFunction:function(t){return t.isRowGroupActive()},activateLabel:function(){return i("groupBy","Group by")+" "+t.displayName},deactivateLabel:function(){return i("ungroupBy","Un-Group by")+" "+t.displayName},activateFunction:function(){var i=t.columnModel.getRowGroupColumns();t.columnModel.setRowGroupColumns(t.addColumnsToList(i),"toolPanelUi")},deActivateFunction:function(){var i=t.columnModel.getRowGroupColumns();t.columnModel.setRowGroupColumns(t.removeColumnsFromList(i),"toolPanelUi")},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"}),this.menuItemMap.set("value",{allowedFunction:function(t){return t.isPrimary()&&t.isAllowValue()},activeFunction:function(t){return t.isValueActive()},activateLabel:function(){return i("addToValues","Add "+t.displayName+" to values",[t.displayName])},deactivateLabel:function(){return i("removeFromValues","Remove "+t.displayName+" from values",[t.displayName])},activateFunction:function(){var i=t.columnModel.getValueColumns();t.columnModel.setValueColumns(t.addColumnsToList(i),"toolPanelUi")},deActivateFunction:function(){var i=t.columnModel.getValueColumns();t.columnModel.setValueColumns(t.removeColumnsFromList(i),"toolPanelUi")},addIcon:"valuePanel",removeIcon:"valuePanel"}),this.menuItemMap.set("pivot",{allowedFunction:function(i){return t.columnModel.isPivotMode()&&i.isPrimary()&&i.isAllowPivot()},activeFunction:function(t){return t.isPivotActive()},activateLabel:function(){return i("addToLabels","Add "+t.displayName+" to labels",[t.displayName])},deactivateLabel:function(){return i("removeFromLabels","Remove "+t.displayName+" from labels",[t.displayName])},activateFunction:function(){var i=t.columnModel.getPivotColumns();t.columnModel.setPivotColumns(t.addColumnsToList(i),"toolPanelUi")},deActivateFunction:function(){var i=t.columnModel.getPivotColumns();t.columnModel.setPivotColumns(t.removeColumnsFromList(i),"toolPanelUi")},addIcon:"pivotPanel",removeIcon:"pivotPanel"})},i.prototype.addColumnsToList=function(t){return function(){for(var t=[],i=0;i<arguments.length;i++)t=t.concat(Nm(arguments[i]));return t}(t).concat(this.columns.filter((function(i){return-1===t.indexOf(i)})))},i.prototype.removeColumnsFromList=function(t){var i=this;return t.filter((function(t){return-1===i.columns.indexOf(t)}))},i.prototype.displayContextMenu=function(){var t=this,i=this.getGui(),n=this.createBean(new ed),e=this.getMappedMenuItems(),r=this.gridOptionsWrapper.getLocaleTextFunc(),o=function(){};i.appendChild(n.getGui()),n.addMenuItems(e),n.addManagedListener(n,hd.EVENT_MENU_ITEM_SELECTED,(function(){t.parentEl.focus(),o()}));var s=this.popupService.addPopup({modal:!0,eChild:i,closeOnEsc:!0,afterGuiAttached:function(){return t.focusService.focusInto(n.getGui())},ariaLabel:r("ariaLabelContextMenu","Context Menu"),closedCallback:function(i){i instanceof KeyboardEvent&&t.parentEl.focus(),t.destroyBean(n)}});s&&(o=s.hideFunc),this.popupService.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEvent,ePopup:i})},i.prototype.isActive=function(){return this.allowGrouping||this.allowValues||this.allowPivoting},i.prototype.getMappedMenuItems=function(){var t,i,n=[],e=function(t){var i=r.columns.some((function(i){return t.allowedFunction(i)&&!t.activeFunction(i)})),e=r.columns.some((function(i){return t.allowedFunction(i)&&t.activeFunction(i)}));i&&n.push({name:t.activateLabel(r.displayName),icon:Wr.createIconNoSpan(t.addIcon,r.gridOptionsWrapper,null),action:function(){return t.activateFunction()}}),e&&n.push({name:t.deactivateLabel(r.displayName),icon:Wr.createIconNoSpan(t.removeIcon,r.gridOptionsWrapper,null),action:function(){return t.deActivateFunction()}})},r=this;try{for(var o=function(t){var i="function"==typeof Symbol&&Symbol.iterator,n=i&&t[i],e=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.menuItemMap.values()),s=o.next();!s.done;s=o.next())e(s.value)}catch(i){t={error:i}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return n},zm([Dt("columnModel")],i.prototype,"columnModel",void 0),zm([Dt("popupService")],i.prototype,"popupService",void 0),zm([Dt("focusService")],i.prototype,"focusService",void 0),zm([Ft],i.prototype,"postConstruct",null),i}(io),Bm=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Hm=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Wm=function(t){function i(i,n,e,r){var o=t.call(this)||this;return o.modelItem=i,o.allowDragging=n,o.eventType=e,o.focusWrapper=r,o.processingColumnStateChange=!1,o.modelItem=i,o.columnGroup=i.getColumnGroup(),o.columnDept=i.getDept(),o.allowDragging=n,o}return Bm(i,t),i.prototype.init=function(){var t=this;this.setTemplate(i.TEMPLATE),this.eDragHandle=Wr.createIconNoSpan("columnDrag",this.gridOptionsWrapper),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");var n=this.cbSelect.getGui(),e=this.cbSelect.getInputElement();n.insertAdjacentElement("afterend",this.eDragHandle),e.setAttribute("tabindex","-1"),this.displayName=this.columnModel.getDisplayNameForProvidedColumnGroup(null,this.columnGroup,this.eventType),Wr.missing(this.displayName)&&(this.displayName=">>"),this.eLabel.innerHTML=this.displayName?this.displayName:"",this.setupExpandContract(),this.addCssClass("ag-column-select-indent-"+this.columnDept),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.eLabel,"click",this.onLabelClicked.bind(this)),this.addManagedListener(this.cbSelect,Ta.EVENT_CHANGED,this.onCheckboxChanged.bind(this)),this.addManagedListener(this.modelItem,Em.EVENT_EXPANDED_CHANGED,this.onExpandChanged.bind(this)),this.addManagedListener(this.focusWrapper,"keydown",this.handleKeyDown.bind(this)),this.addManagedListener(this.focusWrapper,"contextmenu",this.onContextMenu.bind(this)),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip(),sa.getToolPanelClassesFromColDef(this.columnGroup.getColGroupDef(),this.gridOptionsWrapper,null,this.columnGroup).forEach((function(i){return t.addOrRemoveCssClass(i,!0)}))},i.prototype.getColumns=function(){return this.columnGroup.getLeafColumns()},i.prototype.setupTooltip=function(){var t=this,i=this.columnGroup.getColGroupDef();if(i){var n=function(){t.setTooltip(i.headerTooltip)};n(),this.addManagedListener(this.eventService,xi.EVENT_NEW_COLUMNS_LOADED,n)}},i.prototype.getTooltipParams=function(){var i=t.prototype.getTooltipParams.call(this);return i.location="columnToolPanelColumnGroup",i},i.prototype.handleKeyDown=function(t){switch(t.key){case xr.LEFT:t.preventDefault(),this.modelItem.setExpanded(!1);break;case xr.RIGHT:t.preventDefault(),this.modelItem.setExpanded(!0);break;case xr.SPACE:t.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected())}},i.prototype.onContextMenu=function(t){var i=this,n=this.columnGroup;if(!this.gridOptionsWrapper.isFunctionsReadOnly()){var e=this.createBean(new Lm(n,t,this.focusWrapper));this.addDestroyFunc((function(){e.isAlive()&&i.destroyBean(e)}))}},i.prototype.addVisibilityListenersToAllChildren=function(){var t=this;this.columnGroup.getLeafColumns().forEach((function(i){t.addManagedListener(i,qt.EVENT_VISIBLE_CHANGED,t.onColumnStateChanged.bind(t)),t.addManagedListener(i,qt.EVENT_VALUE_CHANGED,t.onColumnStateChanged.bind(t)),t.addManagedListener(i,qt.EVENT_PIVOT_CHANGED,t.onColumnStateChanged.bind(t)),t.addManagedListener(i,qt.EVENT_ROW_GROUP_CHANGED,t.onColumnStateChanged.bind(t))}))},i.prototype.setupDragging=function(){var t=this;if(this.allowDragging){var i=!this.gridOptionsWrapper.isSuppressDragLeaveHidesColumns(),n={type:Ls.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,defaultIconName:i?Xs.ICON_HIDE:Xs.ICON_NOT_ALLOWED,getDragItem:function(){return t.createDragItem()},onDragStarted:function(){t.eventService.dispatchEvent({type:xi.EVENT_COLUMN_PANEL_ITEM_DRAG_START,column:t.columnGroup})},onDragStopped:function(){t.eventService.dispatchEvent({type:xi.EVENT_COLUMN_PANEL_ITEM_DRAG_END})},onGridEnter:function(){i&&t.onChangeCommon(!0)},onGridExit:function(){i&&t.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(n,!0),this.addDestroyFunc((function(){return t.dragAndDropService.removeDragSource(n)}))}else Wr.setDisplayed(this.eDragHandle,!1)},i.prototype.createDragItem=function(){var t={};return this.columnGroup.getLeafColumns().forEach((function(i){t[i.getId()]=i.isVisible()})),{columns:this.columnGroup.getLeafColumns(),visibleState:t}},i.prototype.setupExpandContract=function(){this.eGroupClosedIcon.appendChild(Wr.createIcon("columnSelectClosed",this.gridOptionsWrapper,null)),this.eGroupOpenedIcon.appendChild(Wr.createIcon("columnSelectOpen",this.gridOptionsWrapper,null)),this.addManagedListener(this.eGroupClosedIcon,"click",this.onExpandOrContractClicked.bind(this)),this.addManagedListener(this.eGroupOpenedIcon,"click",this.onExpandOrContractClicked.bind(this));var t=new ds(this.eColumnGroupIcons,!0);this.addManagedListener(t,ds.EVENT_TAP,this.onExpandOrContractClicked.bind(this)),this.addDestroyFunc(t.destroy.bind(t))},i.prototype.onLabelClicked=function(){var t=!this.cbSelect.getValue();this.onChangeCommon(t)},i.prototype.onCheckboxChanged=function(t){this.onChangeCommon(t.selected)},i.prototype.getVisibleLeafColumns=function(){var t=[],i=function(n){n.forEach((function(n){n.isPassesFilter()&&(n.isGroup()?i(n.getChildren()):t.push(n.getColumn()))}))};return i(this.modelItem.getChildren()),t},i.prototype.onChangeCommon=function(t){this.refreshAriaLabel(),this.processingColumnStateChange||this.modelItemUtils.selectAllChildren(this.modelItem.getChildren(),t,this.eventType)},i.prototype.refreshAriaLabel=function(){var t=this.gridOptionsWrapper.getLocaleTextFunc(),i=t("ariaColumnGroup","Column Group"),n=this.cbSelect.getValue()?t("ariaVisible","visible"):t("ariaHidden","hidden"),e=t("ariaToggleVisibility","Press SPACE to toggle visibility");Wr.setAriaLabel(this.focusWrapper,this.displayName+" "+i),this.cbSelect.setInputAriaLabel(e+" ("+n+")"),Wr.setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)},i.prototype.onColumnStateChanged=function(){var t=this.workOutSelectedValue(),i=this.workOutReadOnlyValue();this.processingColumnStateChange=!0,this.cbSelect.setValue(t),this.cbSelect.setReadOnly(i),this.addOrRemoveCssClass("ag-column-select-column-group-readonly",i),this.processingColumnStateChange=!1},i.prototype.workOutSelectedValue=function(){var t=this,i=this.columnModel.isPivotMode(),n=this.getVisibleLeafColumns(),e=0,r=0;if(n.forEach((function(n){!i&&n.getColDef().lockVisible||(t.isColumnChecked(n,i)?e++:r++)})),!(e>0&&r>0))return e>0},i.prototype.workOutReadOnlyValue=function(){var t=this.columnModel.isPivotMode(),i=0;return this.columnGroup.getLeafColumns().forEach((function(n){t?n.isAnyFunctionAllowed()&&i++:n.getColDef().lockVisible||i++})),0===i},i.prototype.isColumnChecked=function(t,i){if(i){var n=t.isPivotActive(),e=t.isRowGroupActive(),r=t.isValueActive();return n||e||r}return t.isVisible()},i.prototype.onExpandOrContractClicked=function(){var t=this.modelItem.isExpanded();this.modelItem.setExpanded(!t)},i.prototype.onExpandChanged=function(){this.setOpenClosedIcons(),this.refreshAriaExpanded()},i.prototype.setOpenClosedIcons=function(){var t=this.modelItem.isExpanded();Wr.setDisplayed(this.eGroupClosedIcon,!t),Wr.setDisplayed(this.eGroupOpenedIcon,t)},i.prototype.refreshAriaExpanded=function(){Wr.setAriaExpanded(this.focusWrapper,this.modelItem.isExpanded())},i.prototype.getDisplayName=function(){return this.displayName},i.prototype.onSelectAllChanged=function(t){var i=this.cbSelect.getValue();!this.cbSelect.isReadOnly()&&(t&&!i||!t&&i)&&this.cbSelect.toggle()},i.prototype.isSelected=function(){return this.cbSelect.getValue()},i.prototype.isSelectable=function(){return!this.cbSelect.isReadOnly()},i.prototype.setSelected=function(t){this.cbSelect.setValue(t,!0)},i.TEMPLATE='<div class="ag-column-select-column-group" aria-hidden="true">\n <span class="ag-column-group-icons" ref="eColumnGroupIcons" >\n <span class="ag-column-group-closed-icon" ref="eGroupClosedIcon"></span>\n <span class="ag-column-group-opened-icon" ref="eGroupOpenedIcon"></span>\n </span>\n <ag-checkbox ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>\n <span class="ag-column-select-column-label" ref="eLabel"></span>\n </div>',Hm([Dt("columnModel")],i.prototype,"columnModel",void 0),Hm([Dt("dragAndDropService")],i.prototype,"dragAndDropService",void 0),Hm([Dt("modelItemUtils")],i.prototype,"modelItemUtils",void 0),Hm([no("cbSelect")],i.prototype,"cbSelect",void 0),Hm([no("eLabel")],i.prototype,"eLabel",void 0),Hm([no("eGroupOpenedIcon")],i.prototype,"eGroupOpenedIcon",void 0),Hm([no("eGroupClosedIcon")],i.prototype,"eGroupClosedIcon",void 0),Hm([no("eColumnGroupIcons")],i.prototype,"eColumnGroupIcons",void 0),Hm([Ft],i.prototype,"init",null),i}(io),Vm=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Um=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Km="ag-list-item-hovered",$m=function(t){function i(i,n){var e=t.call(this)||this;return e.comp=i,e.virtualList=n,e.currentDragColumn=null,e.lastHoveredColumnItem=null,e}return Vm(i,t),i.prototype.postConstruct=function(){this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PANEL_ITEM_DRAG_START,this.columnPanelItemDragStart.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PANEL_ITEM_DRAG_END,this.columnPanelItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()},i.prototype.columnPanelItemDragStart=function(t){this.currentDragColumn=t.column,this.getCurrentColumns().find((function(t){var i=t.getColDef();return!!i.suppressMovable||!!i.lockPosition}))&&(this.moveBlocked=!0)},i.prototype.columnPanelItemDragEnd=function(){var t=this;window.setTimeout((function(){t.currentDragColumn=null,t.moveBlocked=!1}),10)},i.prototype.createDropTarget=function(){var t=this;this.dragAndDropService.addDropTarget({isInterestedIn:function(t){return t===Ls.ToolPanel},getIconName:function(){return Xs[t.moveBlocked?"ICON_NOT_ALLOWED":"ICON_MOVE"]},getContainer:function(){return t.comp.getGui()},onDragging:function(i){return t.onDragging(i)},onDragStop:function(){return t.onDragStop()},onDragLeave:function(){return t.onDragLeave()}})},i.prototype.createAutoScrollService=function(){var t=this.virtualList.getGui();this.autoScrollService=new lh({scrollContainer:t,scrollAxis:"y",getVerticalPosition:function(){return t.scrollTop},setVerticalPosition:function(i){return t.scrollTop=i}})},i.prototype.onDragging=function(t){if(this.currentDragColumn&&!this.moveBlocked){var i=this.getDragColumnItem(t),n=this.virtualList.getComponentAt(i.rowIndex);if(n){var e=n.getGui().parentElement;this.lastHoveredColumnItem&&this.lastHoveredColumnItem.rowIndex===i.rowIndex&&this.lastHoveredColumnItem.position===i.position||(this.autoScrollService.check(t.event),this.clearHoveredItems(),this.lastHoveredColumnItem=i,Wr.radioCssClass(e,""+Km),Wr.radioCssClass(e,"ag-item-highlight-"+i.position))}}},i.prototype.getDragColumnItem=function(t){var i=this.virtualList.getGui(),n=parseFloat(window.getComputedStyle(i).paddingTop),e=this.virtualList.getRowHeight(),r=this.virtualList.getScrollTop(),o=Math.max(0,(t.y-n+r)/e),s=this.comp.getDisplayedColsList().length-1,u=0|Math.min(s,o);return{rowIndex:u,position:Math.round(o)>o||o>s?"bottom":"top",component:this.virtualList.getComponentAt(u)}},i.prototype.onDragStop=function(){if(!this.moveBlocked){var t=this.getTargetIndex(),i=this.getCurrentColumns();null!=t&&this.columnModel.moveColumns(i,t),this.clearHoveredItems(),this.autoScrollService.ensureCleared()}},i.prototype.getMoveDiff=function(t){var i=this.columnModel.getAllGridColumns(),n=this.getCurrentColumns(),e=n.length;return i.indexOf(n[0])<t?e:0},i.prototype.getCurrentColumns=function(){return this.currentDragColumn instanceof hi?this.currentDragColumn.getLeafColumns():[this.currentDragColumn]},i.prototype.getTargetIndex=function(){if(!this.lastHoveredColumnItem)return null;var t,i=this.lastHoveredColumnItem.component,n="top"===this.lastHoveredColumnItem.position;i instanceof Wm?(t=i.getColumns()[0],n=!0):t=i.getColumn();var e=this.columnModel.getAllGridColumns().indexOf(t),r=n?e:e+1;return r-this.getMoveDiff(r)},i.prototype.onDragLeave=function(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()},i.prototype.clearHoveredItems=function(){this.virtualList.getGui().querySelectorAll("."+Km).forEach((function(t){[Km,"ag-item-highlight-top","ag-item-highlight-bottom"].forEach((function(i){t.classList.remove(i)}))})),this.lastHoveredColumnItem=null},Um([Dt("columnModel")],i.prototype,"columnModel",void 0),Um([Dt("dragAndDropService")],i.prototype,"dragAndDropService",void 0),Um([Ft],i.prototype,"postConstruct",null),i}(Ai),qm=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Ym=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Jm=function(t){function i(i,n,e,r,o){var s=t.call(this)||this;return s.column=i,s.columnDept=n,s.allowDragging=e,s.groupsExist=r,s.focusWrapper=o,s.processingColumnStateChange=!1,s}return qm(i,t),i.prototype.init=function(){var t=this;this.setTemplate(i.TEMPLATE),this.eDragHandle=Wr.createIconNoSpan("columnDrag",this.gridOptionsWrapper),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");var n=this.cbSelect.getGui(),e=this.cbSelect.getInputElement();n.insertAdjacentElement("afterend",this.eDragHandle),e.setAttribute("tabindex","-1"),this.displayName=this.columnModel.getDisplayNameForColumn(this.column,"columnToolPanel");var r=Wr.escapeString(this.displayName);this.eLabel.innerHTML=r;var o=this.columnDept;this.groupsExist&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass("ag-column-select-indent-"+o),this.setupDragging(),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,qt.EVENT_VALUE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,qt.EVENT_PIVOT_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,qt.EVENT_ROW_GROUP_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,qt.EVENT_VISIBLE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.focusWrapper,"keydown",this.handleKeyDown.bind(this)),this.addManagedListener(this.focusWrapper,"contextmenu",this.onContextMenu.bind(this)),this.addManagedListener(this.gridOptionsWrapper,"functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListener(this.cbSelect,Ta.EVENT_CHANGED,this.onCheckboxChanged.bind(this)),this.addManagedListener(this.eLabel,"click",this.onLabelClicked.bind(this)),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip(),sa.getToolPanelClassesFromColDef(this.column.getColDef(),this.gridOptionsWrapper,this.column,null).forEach((function(i){return t.addOrRemoveCssClass(i,!0)}))},i.prototype.getColumn=function(){return this.column},i.prototype.setupTooltip=function(){var t=this,i=function(){var i=t.column.getColDef().headerTooltip;t.setTooltip(i)};i(),this.addManagedListener(this.eventService,xi.EVENT_NEW_COLUMNS_LOADED,i)},i.prototype.getTooltipParams=function(){var i=t.prototype.getTooltipParams.call(this);return i.location="columnToolPanelColumn",i.colDef=this.column.getColDef(),i},i.prototype.onContextMenu=function(t){var i=this,n=this.column;if(!this.gridOptionsWrapper.isFunctionsReadOnly()){var e=this.createBean(new Lm(n,t,this.focusWrapper));this.addDestroyFunc((function(){e.isAlive()&&i.destroyBean(e)}))}},i.prototype.handleKeyDown=function(t){t.key===xr.SPACE&&(t.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))},i.prototype.onLabelClicked=function(){if(!this.gridOptionsWrapper.isFunctionsReadOnly()){var t=!this.cbSelect.getValue();this.onChangeCommon(t)}},i.prototype.onCheckboxChanged=function(t){this.onChangeCommon(t.selected)},i.prototype.onChangeCommon=function(t){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),this.processingColumnStateChange||this.modelItemUtils.setColumn(this.column,t,"toolPanelUi"))},i.prototype.refreshAriaLabel=function(){var t=this.gridOptionsWrapper.getLocaleTextFunc(),i=t("ariaColumn","Column"),n=this.cbSelect.getValue()?t("ariaVisible","visible"):t("ariaHidden","hidden"),e=t("ariaToggleVisibility","Press SPACE to toggle visibility");Wr.setAriaLabel(this.focusWrapper,this.displayName+" "+i),this.cbSelect.setInputAriaLabel(e+" ("+n+")"),Wr.setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)},i.prototype.setupDragging=function(){var t=this;if(this.allowDragging){var i=!this.gridOptionsWrapper.isSuppressDragLeaveHidesColumns(),n={type:Ls.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,defaultIconName:i?Xs.ICON_HIDE:Xs.ICON_NOT_ALLOWED,getDragItem:function(){return t.createDragItem()},onDragStarted:function(){t.eventService.dispatchEvent({type:xi.EVENT_COLUMN_PANEL_ITEM_DRAG_START,column:t.column})},onDragStopped:function(){t.eventService.dispatchEvent({type:xi.EVENT_COLUMN_PANEL_ITEM_DRAG_END})},onGridEnter:function(){i&&t.onChangeCommon(!0)},onGridExit:function(){i&&t.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(n,!0),this.addDestroyFunc((function(){return t.dragAndDropService.removeDragSource(n)}))}else Wr.setDisplayed(this.eDragHandle,!1)},i.prototype.createDragItem=function(){var t={};return t[this.column.getId()]=this.column.isVisible(),{columns:[this.column],visibleState:t}},i.prototype.onColumnStateChanged=function(){this.processingColumnStateChange=!0;var t=this.columnModel.isPivotMode();if(t){var i=this.column.isAnyFunctionActive();this.cbSelect.setValue(i)}else this.cbSelect.setValue(this.column.isVisible());var n=!0,e=!0;if(t){var r=this.gridOptionsWrapper.isFunctionsReadOnly(),o=!this.column.isAnyFunctionAllowed();e=n=!r&&!o}else{var s=this.column.getColDef();n=!s.lockVisible,e=!!s.enableRowGroup||!!s.enableValue||!(s.lockPosition||s.suppressMovable)}this.cbSelect.setReadOnly(!n),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!e),this.addOrRemoveCssClass("ag-column-select-column-readonly",!e&&!n);var u=t&&this.gridOptionsWrapper.isFunctionsPassive();this.cbSelect.setPassive(u),this.processingColumnStateChange=!1},i.prototype.getDisplayName=function(){return this.displayName},i.prototype.onSelectAllChanged=function(t){t!==this.cbSelect.getValue()&&(this.cbSelect.isReadOnly()||this.cbSelect.toggle())},i.prototype.isSelected=function(){return this.cbSelect.getValue()},i.prototype.isSelectable=function(){return!this.cbSelect.isReadOnly()},i.prototype.isExpandable=function(){return!1},i.prototype.setExpanded=function(){console.warn("AG Grid: can not expand a column item that does not represent a column group header")},i.TEMPLATE='<div class="ag-column-select-column" aria-hidden="true">\n <ag-checkbox ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>\n <span class="ag-column-select-column-label" ref="eLabel"></span>\n </div>',Ym([Dt("columnModel")],i.prototype,"columnModel",void 0),Ym([Dt("dragAndDropService")],i.prototype,"dragAndDropService",void 0),Ym([Dt("modelItemUtils")],i.prototype,"modelItemUtils",void 0),Ym([no("eLabel")],i.prototype,"eLabel",void 0),Ym([no("cbSelect")],i.prototype,"cbSelect",void 0),Ym([Ft],i.prototype,"init",null),i}(io),Zm=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Xm=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Qm=function(){function t(t){this.items=t}return t.prototype.getRowCount=function(){return this.items.length},t.prototype.getRow=function(t){return this.items[t]},t}();!function(t){function i(){var n=t.call(this,i.TEMPLATE)||this;return n.destroyColumnItemFuncs=[],n}Zm(i,t),i.prototype.destroyColumnTree=function(){this.allColsTree=[],this.destroyColumnItemFuncs.forEach((function(t){return t()})),this.destroyColumnItemFuncs=[]},i.prototype.init=function(t,i,n){var e=this;this.params=t,this.allowDragging=i,this.eventType=n,this.params.suppressSyncLayoutWithGrid||this.addManagedListener(this.eventService,xi.EVENT_COLUMN_MOVED,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_NEW_COLUMNS_LOADED,this.onColumnsChanged.bind(this)),[xi.EVENT_COLUMN_PIVOT_CHANGED,xi.EVENT_COLUMN_PIVOT_MODE_CHANGED,xi.EVENT_COLUMN_ROW_GROUP_CHANGED,xi.EVENT_COLUMN_VALUE_CHANGED,xi.EVENT_COLUMN_VISIBLE,xi.EVENT_NEW_COLUMNS_LOADED].forEach((function(t){e.addManagedListener(e.eventService,t,e.fireSelectionChangedEvent.bind(e))})),this.expandGroupsByDefault=!this.params.contractColumnSelection;var r=this.gridOptionsWrapper.getLocaleTextFunc()("ariaColumnList","Column List");this.virtualList=this.createManagedBean(new Cd("column-select","tree",r)),this.appendChild(this.virtualList.getGui()),this.virtualList.setComponentCreator((function(t,i){return Wr.setAriaLevel(i,t.getDept()+1),e.createComponentFromItem(t,i)})),this.columnModel.isReady()&&this.onColumnsChanged(),t.suppressColumnMove||this.gridOptionsWrapper.isSuppressMovableColumns()||this.createManagedBean(new $m(this,this.virtualList))},i.prototype.createComponentFromItem=function(t,i){if(t.isGroup()){var n=new Wm(t,this.allowDragging,this.eventType,i);return this.getContext().createBean(n),n}var e=new Jm(t.getColumn(),t.getDept(),this.allowDragging,this.groupsExist,i);return this.getContext().createBean(e),e},i.prototype.onColumnsChanged=function(){var t=this.getExpandedStates(),i=this.columnModel.isPivotMode();this.params.suppressSyncLayoutWithGrid||i?this.buildTreeFromProvidedColumnDefs():this.buildTreeFromWhatGridIsDisplaying(),this.setExpandedStates(t),this.markFilteredColumns(),this.flattenAndFilterModel()},i.prototype.getDisplayedColsList=function(){return this.displayedColsList},i.prototype.getExpandedStates=function(){if(!this.allColsTree)return{};var t={};return this.forEachItem((function(i){if(i.isGroup()){var n=i.getColumnGroup();n&&(t[n.getId()]=i.isExpanded())}})),t},i.prototype.setExpandedStates=function(t){this.allColsTree&&this.forEachItem((function(i){if(i.isGroup()){var n=i.getColumnGroup();if(n){var e=t[n.getId()];null!=e&&i.setExpanded(e)}}}))},i.prototype.buildTreeFromWhatGridIsDisplaying=function(){this.colDefService.syncLayoutWithGrid(this.setColumnLayout.bind(this))},i.prototype.setColumnLayout=function(t){var i=this.colDefService.createColumnTree(t);this.buildListModel(i),this.groupsExist=t.some((function(t){return t&&void 0!==t.children})),this.markFilteredColumns(),this.flattenAndFilterModel()},i.prototype.buildTreeFromProvidedColumnDefs=function(){this.buildListModel(this.columnModel.getPrimaryColumnTree()),this.groupsExist=this.columnModel.isPrimaryColumnGroupsPresent()},i.prototype.buildListModel=function(t){var i=this,n=this.onColumnExpanded.bind(this),e=function(t,i,n){t.forEach((function(t){t instanceof hi?r(t,i,n):o(t,i,n)}))},r=function(t,r,o){var s=t.getColGroupDef();if(!s||!s.suppressColumnsToolPanel)if(t.isPadding())e(t.getChildren(),r,o);else{var u=i.columnModel.getDisplayNameForProvidedColumnGroup(null,t,i.eventType),h=new Em(u,t,r,!0,i.expandGroupsByDefault);o.push(h),function(t){t.addEventListener(Em.EVENT_EXPANDED_CHANGED,n);var e=t.removeEventListener.bind(t,Em.EVENT_EXPANDED_CHANGED,n);i.destroyColumnItemFuncs.push(e)}(h),e(t.getChildren(),r+1,h.getChildren())}},o=function(t,n,e){if(!t.getColDef()||!t.getColDef().suppressColumnsToolPanel){var r=i.columnModel.getDisplayNameForColumn(t,"columnToolPanel");e.push(new Em(r,t,n))}};this.destroyColumnTree(),e(t,0,this.allColsTree)},i.prototype.onColumnExpanded=function(){this.flattenAndFilterModel()},i.prototype.flattenAndFilterModel=function(){var t=this;this.displayedColsList=[];var i=function(n){n.isPassesFilter()&&(t.displayedColsList.push(n),n.isGroup()&&n.isExpanded()&&n.getChildren().forEach(i))};this.allColsTree.forEach(i),this.virtualList.setModel(new Qm(this.displayedColsList));var n=this.virtualList.getLastFocusedRow();this.virtualList.refresh(),null!=n&&this.focusRowIfAlive(n),this.notifyListeners()},i.prototype.focusRowIfAlive=function(t){var i=this;window.setTimeout((function(){i.isAlive()&&i.virtualList.focusRow(t)}),0)},i.prototype.forEachItem=function(t){var i=function(n){n.forEach((function(n){t(n),n.isGroup()&&i(n.getChildren())}))};i(this.allColsTree)},i.prototype.doSetExpandedAll=function(t){this.forEachItem((function(i){i.isGroup()&&i.setExpanded(t)}))},i.prototype.setGroupsExpanded=function(t,i){if(i){var n=[];this.forEachItem((function(e){if(e.isGroup()){var r=e.getColumnGroup().getId();i.indexOf(r)>=0&&(e.setExpanded(t),n.push(r))}}));var e=i.filter((function(t){return!Wr.includes(n,t)}));e.length>0&&console.warn("AG Grid: unable to find group(s) for supplied groupIds:",e)}else this.doSetExpandedAll(t)},i.prototype.getExpandState=function(){var t=0,i=0;return this.forEachItem((function(n){n.isGroup()&&(n.isExpanded()?t++:i++)})),t>0&&i>0?_m.INDETERMINATE:i>0?_m.COLLAPSED:_m.EXPANDED},i.prototype.doSetSelectedAll=function(t){this.modelItemUtils.selectAllChildren(this.allColsTree,t,this.eventType)},i.prototype.getSelectionState=function(){var t=0,i=0,n=this.columnModel.isPivotMode();if(this.forEachItem((function(e){if(!e.isGroup()&&e.isPassesFilter()){var r,o=e.getColumn(),s=o.getColDef();if(n){if(!o.isAllowPivot()&&!o.isAllowRowGroup()&&!o.isAllowValue())return;r=o.isValueActive()||o.isPivotActive()||o.isRowGroupActive()}else{if(s.lockVisible)return;r=o.isVisible()}r?t++:i++}})),!(t>0&&i>0))return!(0===t||i>0)},i.prototype.setFilterText=function(t){this.filterText=Wr.exists(t)?t.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()},i.prototype.markFilteredColumns=function(){var t=this,i=function(i){if(!Wr.exists(t.filterText))return!0;var n=i.getDisplayName();return null==n||-1!==n.toLowerCase().indexOf(t.filterText)},n=function(t,e){var r=!1;if(t.isGroup()){var o=i(t);t.getChildren().forEach((function(t){var i=n(t,o||e);i&&(r=i)}))}var s=!(!e&&!r)||i(t);return t.setPassesFilter(s),s};this.allColsTree.forEach((function(t){return n(t,!1)}))},i.prototype.notifyListeners=function(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()},i.prototype.fireGroupExpandedEvent=function(){var t=this.getExpandState();this.dispatchEvent({type:"groupExpanded",state:t})},i.prototype.fireSelectionChangedEvent=function(){var t=this.getSelectionState();this.dispatchEvent({type:"selectionChanged",state:t})},i.TEMPLATE='<div class="ag-column-select-list" role="presentation"></div>',Xm([Dt("columnModel")],i.prototype,"columnModel",void 0),Xm([Dt("toolPanelColDefService")],i.prototype,"colDefService",void 0),Xm([Dt("modelItemUtils")],i.prototype,"modelItemUtils",void 0),Xm([kt],i.prototype,"destroyColumnTree",null)}(io);var tb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),ib=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},nb=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return tb(i,t),i.prototype.createTemplate=function(){return'<div class="ag-pivot-mode-panel">\n <ag-toggle-button ref="cbPivotMode" class="ag-pivot-mode-select"></ag-toggle-button>\n </div>'},i.prototype.init=function(){this.setTemplate(this.createTemplate()),this.cbPivotMode.setValue(this.columnModel.isPivotMode());var t=this.gridOptionsWrapper.getLocaleTextFunc();this.cbPivotMode.setLabel(t("pivotMode","Pivot Mode")),this.addManagedListener(this.cbPivotMode,Ta.EVENT_CHANGED,this.onBtPivotMode.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_NEW_COLUMNS_LOADED,this.onPivotModeChanged.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this))},i.prototype.onBtPivotMode=function(){var t=!!this.cbPivotMode.getValue();if(t!==this.columnModel.isPivotMode()){this.columnModel.setPivotMode(t,"toolPanelUi");var i=this.gridOptionsWrapper.getApi();i&&i.refreshHeader()}},i.prototype.onPivotModeChanged=function(){var t=this.columnModel.isPivotMode();this.cbPivotMode.setValue(t)},ib([Dt("columnModel")],i.prototype,"columnModel",void 0),ib([no("cbPivotMode")],i.prototype,"cbPivotMode",void 0),ib([Mt],i.prototype,"init",null),i}(io),eb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),rb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(t){function i(){return null!==t&&t.apply(this,arguments)||this}eb(i,t),i.prototype.execute=function(t){var i=Wr.missingOrEmpty(this.columnModel.getValueColumns()),n=!this.gridOptionsWrapper.getGroupRowAggFunc(),e=t.changedPath&&t.changedPath.isActive();if(!(i&&n&&e)){var r=this.createAggDetails(t);this.recursivelyCreateAggData(r)}},i.prototype.createAggDetails=function(t){var i=this.columnModel.isPivotActive(),n=this.columnModel.getValueColumns(),e=i?this.columnModel.getPivotColumns():[];return{changedPath:t.changedPath,valueColumns:n,pivotColumns:e}},i.prototype.recursivelyCreateAggData=function(t){var i=this;this.filteredOnly=!this.gridOptionsWrapper.isSuppressAggFilteredOnly(),t.changedPath.forEachChangedNodeDepthFirst((function(n){if(n.hasChildren()){if(-1===n.level){var e=!i.columnModel.isPivotMode();if(i.gridOptionsWrapper.isSuppressAggAtRootLevel()&&e)return}i.aggregateRowNode(n,t)}else n.aggData&&n.setAggData(null)}),!0)},i.prototype.aggregateRowNode=function(t,i){var n,e=0===i.valueColumns.length,r=0===i.pivotColumns.length,o=this.gridOptionsWrapper.getGroupRowAggFunc();n=o?o({nodes:t.childrenAfterFilter}):e?null:r?this.aggregateRowNodeUsingValuesOnly(t,i):this.aggregateRowNodeUsingValuesAndPivot(t),t.setAggData(n),t.sibling&&t.sibling.setAggData(n)},i.prototype.aggregateRowNodeUsingValuesAndPivot=function(t){var i=this,n={},e=this.pivotStage.getPivotColumnDefs();return e.filter((function(t){return!Wr.exists(t.pivotTotalColumnIds)})).forEach((function(e){var r,o=e.pivotValueColumn,s=e.colId;r=t.leafGroup?i.getValuesFromMappedSet(t.childrenMapped,e.pivotKeys||[],o):i.getValuesPivotNonLeaf(t,s),n[s]=i.aggregateValues(r,o.getAggFunc(),o,t)})),e.filter((function(t){return Wr.exists(t.pivotTotalColumnIds)})).forEach((function(e){var r=[],o=e.pivotValueColumn,s=e.pivotTotalColumnIds,u=e.colId;s&&s.length&&(s.forEach((function(t){r.push(n[t])})),n[u]=i.aggregateValues(r,o.getAggFunc(),o,t))})),n},i.prototype.aggregateRowNodeUsingValuesOnly=function(t,i){var n=this,e={},r=i.changedPath.isActive()?i.changedPath.getValueColumnsForNode(t,i.valueColumns):i.valueColumns,o=i.changedPath.isActive()?i.changedPath.getNotValueColumnsForNode(t,i.valueColumns):null,s=this.getValuesNormal(t,r),u=t.aggData;return r.forEach((function(i,r){e[i.getId()]=n.aggregateValues(s[r],i.getAggFunc(),i,t)})),o&&u&&o.forEach((function(t){e[t.getId()]=u[t.getId()]})),e},i.prototype.getValuesPivotNonLeaf=function(t,i){var n=[];return t.childrenAfterFilter.forEach((function(t){n.push(t.aggData[i])})),n},i.prototype.getValuesFromMappedSet=function(t,i,n){var e=this,r=t;if(i.forEach((function(t){return r=r?r[t]:null})),!r)return[];var o=[];return r.forEach((function(t){var i=e.valueService.getValue(n,t);o.push(i)})),o},i.prototype.getValuesNormal=function(t,i){var n=[];i.forEach((function(){return n.push([])}));for(var e=i.length,r=this.filteredOnly?t.childrenAfterFilter:t.childrenAfterGroup,o=r.length,s=0;s<o;s++)for(var u=r[s],h=0;h<e;h++){var c=this.valueService.getValue(i[h],u);n[h].push(c)}return n},i.prototype.aggregateValues=function(t,i,n,e){var r="string"==typeof i?this.aggFuncService.getAggFunc(i):i;return"function"!=typeof r?(console.error("AG Grid: unrecognised aggregation function "+i),null):r({values:t,column:n,colDef:n?n.getColDef():void 0,rowNode:e,data:e?e.data:void 0,api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsWrapper.getContext()})},rb([Dt("columnModel")],i.prototype,"columnModel",void 0),rb([Dt("valueService")],i.prototype,"valueService",void 0),rb([Dt("pivotStage")],i.prototype,"pivotStage",void 0),rb([Dt("aggFuncService")],i.prototype,"aggFuncService",void 0),rb([Dt("gridApi")],i.prototype,"gridApi",void 0),rb([Dt("columnApi")],i.prototype,"columnApi",void 0),i=rb([Pt("aggregationStage")],i)}(Ai);var ob=function(){function t(){this.allSets={},this.allParents=[]}return t.prototype.removeFromChildrenAfterGroup=function(t,i){this.getSet(t).removeFromChildrenAfterGroup[i.id]=!0},t.prototype.removeFromAllLeafChildren=function(t,i){this.getSet(t).removeFromAllLeafChildren[i.id]=!0},t.prototype.getSet=function(t){return this.allSets[t.id]||(this.allSets[t.id]={removeFromAllLeafChildren:{},removeFromChildrenAfterGroup:{}},this.allParents.push(t)),this.allSets[t.id]},t.prototype.getAllParents=function(){return this.allParents},t.prototype.flush=function(){var t=this;this.allParents.forEach((function(i){var n=t.allSets[i.id];i.childrenAfterGroup=i.childrenAfterGroup.filter((function(t){return!n.removeFromChildrenAfterGroup[t.id]})),i.allLeafChildren=i.allLeafChildren.filter((function(t){return!n.removeFromAllLeafChildren[t.id]})),i.updateHasChildren(),i.sibling&&(i.sibling.childrenAfterGroup=i.childrenAfterGroup,i.sibling.allLeafChildren=i.allLeafChildren)})),this.allSets={},this.allParents.length=0},t}(),sb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),ub=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},hb=function(t,i){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var e,r,o=n.call(t),s=[];try{for(;(void 0===i||i-- >0)&&!(e=o.next()).done;)s.push(e.value)}catch(t){r={error:t}}finally{try{e&&!e.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s};!function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.groupIdSequence=new Vr,i}sb(i,t),i.prototype.postConstruct=function(){this.usingTreeData=this.gridOptionsWrapper.isTreeData(),this.usingTreeData&&(this.getDataPath=this.gridOptionsWrapper.getDataPathFunc())},i.prototype.execute=function(t){var i=this.createGroupingDetails(t);i.transactions?this.handleTransaction(i):this.shotgunResetEverything(i,!0===t.afterColumnsChanged),this.positionLeafsAboveGroups(t.changedPath),this.orderGroups(i.rootNode),this.selectableService.updateSelectableAfterGrouping(i.rootNode)},i.prototype.positionLeafsAboveGroups=function(t){this.usingTreeData||t.forEachChangedNodeDepthFirst((function(t){if(t.childrenAfterGroup){var i=[],n=[];t.childrenAfterGroup.forEach((function(t){var e;(null===(e=t.childrenAfterGroup)||void 0===e?void 0:e.length)?n.push(t):i.push(t)})),t.childrenAfterGroup=function(){for(var t=[],i=0;i<arguments.length;i++)t=t.concat(hb(arguments[i]));return t}(i,n)}}),!1)},i.prototype.createGroupingDetails=function(t){var i=t.rowNode,n=t.changedPath,e=t.rowNodeTransactions,r=t.rowNodeOrder,o=this.usingTreeData?null:this.columnModel.getRowGroupColumns();return{includeParents:!this.gridOptionsWrapper.isSuppressParentsInRowNodes(),expandByDefault:this.gridOptionsWrapper.getGroupDefaultExpanded(),groupedCols:o,rootNode:i,pivotMode:this.columnModel.isPivotMode(),groupedColCount:this.usingTreeData||!o?0:o.length,rowNodeOrder:r,transactions:e,changedPath:n}},i.prototype.handleTransaction=function(t){var i=this;t.transactions.forEach((function(n){var e=i.usingTreeData?void 0:new ob;if(Wr.existsAndNotEmpty(n.remove)&&i.removeNodes(n.remove,t,e),Wr.existsAndNotEmpty(n.update)&&i.moveNodesInWrongPath(n.update,t,e),Wr.existsAndNotEmpty(n.add)&&i.insertNodes(n.add,t,!1),e){var r=e.getAllParents().slice();e.flush(),i.removeEmptyGroups(r,t)}})),t.rowNodeOrder&&this.sortChildren(t)},i.prototype.sortChildren=function(t){t.changedPath.forEachChangedNodeDepthFirst((function(i){i.childrenAfterGroup&&Wr.sortRowNodesByOrder(i.childrenAfterGroup,t.rowNodeOrder)&&t.changedPath.addParentNode(i)}),!1,!0)},i.prototype.orderGroups=function(t){if(!this.usingTreeData){var i=this.gridOptionsWrapper.getInitialGroupOrderComparator();Wr.exists(i)&&function t(n){Wr.exists(n.childrenAfterGroup)&&!n.leafGroup&&(n.childrenAfterGroup.sort((function(t,n){return i({nodeA:t,nodeB:n})})),n.childrenAfterGroup.forEach((function(i){return t(i)})))}(t)}},i.prototype.getExistingPathForNode=function(t,i){for(var n=[],e=this.usingTreeData?t:t.parent;e&&e!==i.rootNode;)n.push({key:e.key,rowGroupColumn:e.rowGroupColumn,field:e.field}),e=e.parent;return n.reverse(),n},i.prototype.moveNodesInWrongPath=function(t,i,n){var e=this;t.forEach((function(t){i.changedPath.isActive()&&i.changedPath.addParentNode(t.parent);var r=function(t){return t.key},o=e.getExistingPathForNode(t,i).map(r),s=e.getGroupInfo(t,i).map(r);Wr.areEqual(o,s)||e.moveNode(t,i,n)}))},i.prototype.moveNode=function(t,i,n){this.removeNodesInStages([t],i,n),this.insertOneNode(t,i,!0),t.setData(t.data),i.changedPath.isActive()&&i.changedPath.addParentNode(t.parent)},i.prototype.removeNodes=function(t,i,n){this.removeNodesInStages(t,i,n),i.changedPath.isActive()&&t.forEach((function(t){return i.changedPath.addParentNode(t.parent)}))},i.prototype.removeNodesInStages=function(t,i,n){if(this.removeNodesFromParents(t,i,n),this.usingTreeData){this.postRemoveCreateFillerNodes(t,i);var e=t.map((function(t){return t.parent}));this.removeEmptyGroups(e,i)}},i.prototype.forEachParentGroup=function(t,i,n){for(var e=i;e&&e!==t.rootNode;)n(e),e=e.parent},i.prototype.removeNodesFromParents=function(t,i,n){var e=this,r=null==n,o=n||new ob;t.forEach((function(t){e.removeFromParent(t,o),e.forEachParentGroup(i,t.parent,(function(i){o.removeFromAllLeafChildren(i,t)}))})),r&&o.flush()},i.prototype.postRemoveCreateFillerNodes=function(t,i){var n=this;t.forEach((function(t){if(t.hasChildren()){var e=n.getExistingPathForNode(t,i),r=n.findParentForNode(t,e,i);r.expanded=t.expanded,r.allLeafChildren=t.allLeafChildren,r.childrenAfterGroup=t.childrenAfterGroup,r.childrenMapped=t.childrenMapped,r.updateHasChildren(),r.childrenAfterGroup.forEach((function(t){return t.parent=r}))}}))},i.prototype.removeEmptyGroups=function(t,i){for(var n=this,e=!0,r=function(){e=!1;var r=new ob;t.forEach((function(t){n.forEachParentGroup(i,t,(function(t){(function(t){var i=n.getChildrenMappedKey(t.key,t.rowGroupColumn),e=t.parent;return!!(e&&e.childrenMapped&&e.childrenMapped[i]&&t.isEmptyRowGroupNode())})(t)&&(e=!0,n.removeFromParent(t,r),t.setSelected(!1))}))})),r.flush()};e;)r()},i.prototype.removeFromParent=function(t,i){t.parent&&(i?i.removeFromChildrenAfterGroup(t.parent,t):(Wr.removeFromArray(t.parent.childrenAfterGroup,t),t.parent.updateHasChildren()));var n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);t.parent&&t.parent.childrenMapped&&(t.parent.childrenMapped[n]=void 0),t.setRowTop(null),t.setRowIndex(null)},i.prototype.addToParent=function(t,i){var n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);i&&(null!=i.childrenMapped&&(i.childrenMapped[n]=t),i.childrenAfterGroup.push(t),i.updateHasChildren())},i.prototype.areGroupColsEqual=function(t,i){return null!=t&&null!=i&&t.pivotMode===i.pivotMode&&Wr.areEqual(t.groupedCols,i.groupedCols)},i.prototype.checkAllGroupDataAfterColsChanged=function(t){var i=this,n=function(t){t&&t.forEach((function(t){!i.usingTreeData&&!t.group||(i.setGroupData(t,{field:t.field,key:t.key,rowGroupColumn:t.rowGroupColumn}),n(t.childrenAfterGroup))}))};n(t.rootNode.childrenAfterGroup)},i.prototype.shotgunResetEverything=function(t,i){if(!this.noChangeInGroupingColumns(t,i)){this.selectionService.removeGroupsFromSelection();var n=t.rootNode;n.leafGroup=!this.usingTreeData&&0===t.groupedCols.length,n.childrenAfterGroup=[],n.childrenMapped={},n.updateHasChildren();var e=n.sibling;e&&(e.childrenAfterGroup=n.childrenAfterGroup,e.childrenMapped=n.childrenMapped),this.insertNodes(n.allLeafChildren,t,!1)}},i.prototype.noChangeInGroupingColumns=function(t,i){var n=!1,e=this.columnModel.getGroupDisplayColumns(),r=e?e.map((function(t){return t.getId()})).join("-"):"";return i&&(n=this.usingTreeData||this.areGroupColsEqual(t,this.oldGroupingDetails),this.oldGroupDisplayColIds!==r&&this.checkAllGroupDataAfterColsChanged(t)),this.oldGroupingDetails=t,this.oldGroupDisplayColIds=r,n},i.prototype.insertNodes=function(t,i,n){var e=this;t.forEach((function(t){e.insertOneNode(t,i,n),i.changedPath.isActive()&&i.changedPath.addParentNode(t.parent)}))},i.prototype.insertOneNode=function(t,i,n){var e=this.getGroupInfo(t,i),r=this.findParentForNode(t,e,i);r.group||console.warn("AG Grid: duplicate group keys for row data, keys should be unique",[r.data,t.data]),this.usingTreeData?this.swapGroupWithUserNode(r,t,n):(t.parent=r,t.level=e.length,r.childrenAfterGroup.push(t),r.updateHasChildren())},i.prototype.findParentForNode=function(t,i,n){var e=this,r=n.rootNode;return i.forEach((function(i,o){(r=e.getOrCreateNextNode(r,i,o,n)).allLeafChildren.push(t)})),r},i.prototype.swapGroupWithUserNode=function(t,i,n){i.parent=t.parent,i.key=t.key,i.field=t.field,i.groupData=t.groupData,i.level=t.level,n||(i.expanded=t.expanded),i.leafGroup=t.leafGroup,i.rowGroupIndex=t.rowGroupIndex,i.allLeafChildren=t.allLeafChildren,i.childrenAfterGroup=t.childrenAfterGroup,i.childrenMapped=t.childrenMapped,i.updateHasChildren(),this.removeFromParent(t),i.childrenAfterGroup.forEach((function(t){return t.parent=i})),this.addToParent(i,t.parent)},i.prototype.getOrCreateNextNode=function(t,i,n,e){var r=this.getChildrenMappedKey(i.key,i.rowGroupColumn),o=t.childrenMapped?t.childrenMapped[r]:void 0;return o||(o=this.createGroup(i,t,n,e),this.addToParent(o,t)),o},i.prototype.createGroup=function(t,i,n,e){var r=new Ws(this.beans);return r.group=!0,r.field=t.field,r.rowGroupColumn=t.rowGroupColumn,this.setGroupData(r,t),r.id=Ws.ID_PREFIX_ROW_GROUP+this.groupIdSequence.next(),r.key=t.key,r.level=n,r.leafGroup=!this.usingTreeData&&n===e.groupedColCount-1,r.allLeafChildren=[],r.setAllChildrenCount(0),r.rowGroupIndex=this.usingTreeData?null:n,r.childrenAfterGroup=[],r.childrenMapped={},r.updateHasChildren(),r.parent=e.includeParents?i:null,this.setExpandedInitialValue(e,r),r},i.prototype.setGroupData=function(t,i){var n=this;t.groupData={},this.columnModel.getGroupDisplayColumns().forEach((function(e){(n.usingTreeData||t.rowGroupColumn&&e.isRowGroupDisplayed(t.rowGroupColumn.getId()))&&(t.groupData[e.getColId()]=i.key)}))},i.prototype.getChildrenMappedKey=function(t,i){return i?i.getId()+"-"+t:t},i.prototype.setExpandedInitialValue=function(t,i){if(t.pivotMode&&i.leafGroup)i.expanded=!1;else{var n=this.gridOptionsWrapper.getIsGroupOpenByDefaultFunc();i.expanded=n?1==n({rowNode:i,field:i.field,key:i.key,level:i.level,rowGroupColumn:i.rowGroupColumn}):-1===t.expandByDefault||i.level<t.expandByDefault}},i.prototype.getGroupInfo=function(t,i){return this.usingTreeData?this.getGroupInfoFromCallback(t):this.getGroupInfoFromGroupColumns(t,i)},i.prototype.getGroupInfoFromCallback=function(t){var i=this.getDataPath?this.getDataPath(t.data):null;return null!=i&&0!==i.length||Wr.doOnce((function(){return console.warn("AG Grid: getDataPath() should not return an empty path for data",t.data)}),"groupStage.getGroupInfoFromCallback"),i?i.map((function(t){return{key:t,field:null,rowGroupColumn:null}})):[]},i.prototype.getGroupInfoFromGroupColumns=function(t,i){var n=this,e=[];return i.groupedCols.forEach((function(r){var o=n.valueService.getKeyForNode(r,t),s=null!=o;if(i.pivotMode&&!s&&(o=" ",s=!0),s){var u={key:o,field:r.getColDef().field,rowGroupColumn:r};e.push(u)}})),e},ub([Dt("columnModel")],i.prototype,"columnModel",void 0),ub([Dt("selectableService")],i.prototype,"selectableService",void 0),ub([Dt("valueService")],i.prototype,"valueService",void 0),ub([Dt("beans")],i.prototype,"beans",void 0),ub([Dt("selectionService")],i.prototype,"selectionService",void 0),ub([Ft],i.prototype,"postConstruct",null),i=ub([Pt("groupStage")],i)}(Ai);var cb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),ab=function(){return ab=Object.assign||function(t){for(var i,n=1,e=arguments.length;n<e;n++)for(var r in i=arguments[n])Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r]);return t},ab.apply(this,arguments)},lb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},fb=function(t,i){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var e,r,o=n.call(t),s=[];try{for(;(void 0===i||i-- >0)&&!(e=o.next()).done;)s.push(e.value)}catch(t){r={error:t}}finally{try{e&&!e.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},db=function(){for(var t=[],i=0;i<arguments.length;i++)t=t.concat(fb(arguments[i]));return t};!function(t){function i(){return null!==t&&t.apply(this,arguments)||this}var n;cb(i,t),n=i,i.prototype.createPivotColumnDefs=function(t){var i=this.columnModel.getPivotColumns(),n=this.columnModel.getValueColumns(),e=this.recursiveBuildGroup(0,t,[],i.length,i),r=function t(i,n){return void 0===n&&(n=[]),i.forEach((function(i){void 0!==i.children?t(i.children,n):n.push(i)})),n}(e);return this.addRowGroupTotals(e,r,n),this.addExpandablePivotGroups(e,r),this.addPivotTotalsToGroups(e,r),{pivotColumnGroupDefs:e,pivotColumnDefs:r.map((function(t){return Wr.cloneObject(t)}))}},i.prototype.recursiveBuildGroup=function(t,i,n,e,r){var o=this,s=this.columnModel.getValueColumns();if(t>=e)return this.buildMeasureCols(n);var u=r[t].getColDef(),h=this.headerNameComparator.bind(this,u.pivotComparator);if(1===s.length&&this.gridOptionsWrapper.isRemovePivotHeaderRowWhenSingleValueColumn()&&t===e-1){var c=[];return Wr.iterateObject(i,(function(t){var i=db(n,[t]);c.push(ab(ab({},o.createColDef(s[0],t,i)),{columnGroupShow:"open"}))})),c.sort(h),c}var a=[];return Wr.iterateObject(i,(function(i,s){var u=db(n,[i]);a.push({children:o.recursiveBuildGroup(t+1,s,u,e,r),headerName:i,pivotKeys:u,columnGroupShow:"open",groupId:o.generateColumnGroupId(u)})})),a.sort(h),a},i.prototype.buildMeasureCols=function(t){var i=this,n=this.columnModel.getValueColumns();return 0===n.length?[this.createColDef(null,"-",t)]:n.map((function(n){var e=i.columnModel.getDisplayNameForColumn(n,"header");return ab(ab({},i.createColDef(n,e,t)),{columnGroupShow:"open"})}))},i.prototype.addExpandablePivotGroups=function(t,i){var n=this;if(!this.gridOptionsWrapper.isSuppressExpandablePivotGroups()&&!this.gridOptionsWrapper.getPivotColumnGroupTotals()){var e=function(t,i,r){var o=t;if(o.children){var s=new Map;o.children.forEach((function(t){e(t,i,s)}));var u=!o.children.some((function(t){return t.children}));n.columnModel.getValueColumns().forEach((function(e){var r=n.columnModel.getDisplayNameForColumn(e,"header"),o=n.createColDef(e,r,t.pivotKeys);o.pivotTotalColumnIds=s.get(e.getColId()),o.columnGroupShow="closed",o.aggFunc=e.getAggFunc(),u||(t.children.push(o),i.push(o))})),n.merge(r,s)}else{var h=t;if(!h.pivotValueColumn)return;var c=h.pivotValueColumn.getColId(),a=r.has(c)?r.get(c):[];a.push(h.colId),r.set(c,a)}};t.forEach((function(t){e(t,i,new Map)}))}},i.prototype.addPivotTotalsToGroups=function(t,i){var n=this;if(this.gridOptionsWrapper.getPivotColumnGroupTotals()){var e="after"===this.gridOptionsWrapper.getPivotColumnGroupTotals(),r=this.columnModel.getValueColumns(),o=r.map((function(t){return t.getAggFunc()}));if(o&&!(o.length<1)&&this.sameAggFuncs(o)){var s=r[0];t.forEach((function(t){n.recursivelyAddPivotTotal(t,i,s,e)}))}}},i.prototype.recursivelyAddPivotTotal=function(t,i,n,e){var r=this,o=t;if(!o.children)return t.colId?[t.colId]:null;var s=[];if(o.children.forEach((function(t){var o=r.recursivelyAddPivotTotal(t,i,n,e);o&&(s=s.concat(o))})),o.children.length>1){var u=this.gridOptionsWrapper.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),h=this.createColDef(n,u,t.pivotKeys,!0);h.pivotTotalColumnIds=s,h.aggFunc=n.getAggFunc();var c=t.children;e?c.push(h):c.unshift(h),i.push(h)}return s},i.prototype.addRowGroupTotals=function(t,i,n){var e=this;if(this.gridOptionsWrapper.getPivotRowTotals())for(var r="after"===this.gridOptionsWrapper.getPivotRowTotals(),o=r?n.slice():n.slice().reverse(),s=function(n){var s=o[n],h=[];t.forEach((function(t){h=h.concat(e.extractColIdsForValueColumn(t,s))}));var c=o.length>1||!u.gridOptionsWrapper.isRemovePivotHeaderRowWhenSingleValueColumn();u.createRowGroupTotal(t,i,s,h,r,c)},u=this,h=0;h<o.length;h++)s(h)},i.prototype.extractColIdsForValueColumn=function(t,i){var n=this;if(!t.children)return t.pivotValueColumn===i&&t.colId?[t.colId]:[];var e=[];return t.children.forEach((function(t){n.extractColIdsForValueColumn(t,i);var r=n.extractColIdsForValueColumn(t,i);e=e.concat(r)})),e},i.prototype.createRowGroupTotal=function(t,i,e,r,o,s){var u;if(0===this.columnModel.getValueColumns().length)u=this.createColDef(null,"-",[]);else{var h=this.columnModel.getDisplayNameForColumn(e,"header");(u=this.createColDef(e,h,[])).pivotTotalColumnIds=r}u.colId=n.PIVOT_ROW_TOTAL_PREFIX+u.colId,i.push(u);var c=s?{children:[u],pivotKeys:[],groupId:n.PIVOT_ROW_TOTAL_PREFIX+"_pivotGroup_"+e.getColId()}:u;o?t.push(c):t.unshift(c)},i.prototype.createColDef=function(t,i,n,e){void 0===e&&(e=!1);var r={};if(t){var o=t.getColDef();Object.assign(r,o),r.hide=!1}return r.headerName=i,r.colId=this.generateColumnId(n||[],t&&!e?t.getColId():""),r.field=r.colId,r.valueGetter=function(t){var i;return null===(i=t.data)||void 0===i?void 0:i[t.colDef.field]},r.pivotKeys=n,r.pivotValueColumn=t,!0===r.filter&&(r.filter="agNumberColumnFilter"),r},i.prototype.sameAggFuncs=function(t){if(1==t.length)return!0;for(var i=1;i<t.length;i++)if(t[i]!==t[0])return!1;return!0},i.prototype.headerNameComparator=function(t,i,n){return t?t(i.headerName,n.headerName):i.headerName&&!n.headerName?1:!i.headerName&&n.headerName?-1:i.headerName&&n.headerName?i.headerName<n.headerName?-1:i.headerName>n.headerName?1:0:0},i.prototype.merge=function(t,i){i.forEach((function(i,n){var e=t.has(n)?t.get(n):[],r=db(e,i);t.set(n,r)}))},i.prototype.generateColumnGroupId=function(t){return"pivotGroup_"+this.columnModel.getPivotColumns().map((function(t){return t.getColId()})).join("-")+"_"+t.join("-")},i.prototype.generateColumnId=function(t,i){return"pivot_"+this.columnModel.getPivotColumns().map((function(t){return t.getColId()})).join("-")+"_"+t.join("-")+"_"+i},i.PIVOT_ROW_TOTAL_PREFIX="PivotRowTotal_",lb([Dt("columnModel")],i.prototype,"columnModel",void 0),i=n=lb([Pt("pivotColDefService")],i)}(Ai);var vb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),pb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.uniqueValues={},i}vb(i,t),i.prototype.execute=function(t){var i=t.rowNode,n=t.changedPath;this.columnModel.isPivotActive()?this.executePivotOn(i,n):this.executePivotOff(n)},i.prototype.executePivotOff=function(t){this.aggregationColumnsHashLastTime=null,this.uniqueValues={},this.columnModel.isSecondaryColumnsPresent()&&(this.columnModel.setSecondaryColumns(null,"rowModelUpdated"),t&&t.setInactive())},i.prototype.executePivotOn=function(t,i){var n=this.bucketUpRowNodes(t),e=this.setUniqueValues(n),r=this.columnModel.getValueColumns(),o=r.map((function(t){return t.getId()+"-"+t.getColDef().headerName})).join("#"),s=r.map((function(t){return t.getAggFunc().toString()})).join("#"),u=this.aggregationColumnsHashLastTime!==o,h=this.aggregationFuncsHashLastTime!==s;this.aggregationColumnsHashLastTime=o,this.aggregationFuncsHashLastTime=s;var c=this.columnModel.getRowGroupColumns().map((function(t){return t.getId()})).join("#"),a=c!==this.groupColumnsHashLastTime;if(this.groupColumnsHashLastTime=c,e||u||a||h){var l=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues),f=l.pivotColumnGroupDefs;this.pivotColumnDefs=l.pivotColumnDefs,this.columnModel.setSecondaryColumns(f,"rowModelUpdated"),i&&i.setInactive()}},i.prototype.setUniqueValues=function(t){return!(JSON.stringify(t)===JSON.stringify(this.uniqueValues)||(this.uniqueValues=t,0))},i.prototype.bucketUpRowNodes=function(t){var i=this,n={},e=function(t){t.leafGroup?i.bucketRowNode(t,n):t.childrenAfterFilter.forEach((function(t){e(t)}))};return e(t),n},i.prototype.bucketRowNode=function(t,i){var n=this.columnModel.getPivotColumns();t.childrenMapped=0===n.length?null:this.bucketChildren(t.childrenAfterFilter,n,0,i),t.sibling&&(t.sibling.childrenMapped=t.childrenMapped)},i.prototype.bucketChildren=function(t,i,n,e){var r=this,o={},s=i[n];if(t.forEach((function(t){var i=r.valueService.getKeyForNode(s,t);Wr.missing(i)&&(i=""),e[i]||(e[i]={}),o[i]||(o[i]=[]),o[i].push(t)})),n===i.length-1)return o;var u={};return Wr.iterateObject(o,(function(t,o){u[t]=r.bucketChildren(o,i,n+1,e[t])})),u},i.prototype.getPivotColumnDefs=function(){return this.pivotColumnDefs},pb([Dt("valueService")],i.prototype,"valueService",void 0),pb([Dt("columnModel")],i.prototype,"columnModel",void 0),pb([Dt("pivotColDefService")],i.prototype,"pivotColDefService",void 0),i=pb([Pt("pivotStage")],i)}(Ai);var gb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),mb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},bb="undefined"==typeof BigInt?null:BigInt;function wb(t){for(var i=t.values,n=null,e=0;e<i.length;e++){var r=i[e];"number"==typeof r?null===n?n=r:n+=bb?"number"==typeof n?r:bb(r):r:"bigint"==typeof r&&(n=null===n?r:("bigint"==typeof n?n:bb(n))+r)}return n}function yb(t){return t.values.length>0?t.values[0]:null}function Cb(t){return t.values.length>0?Wr.last(t.values):null}function Sb(t){for(var i=t.values,n=null,e=0;e<i.length;e++){var r=i[e];"number"!=typeof r&&"bigint"!=typeof r||!(null===n||n>r)||(n=r)}return n}function Rb(t){for(var i=t.values,n=null,e=0;e<i.length;e++){var r=i[e];"number"!=typeof r&&"bigint"!=typeof r||!(null===n||n<r)||(n=r)}return n}function Ob(t){for(var i=t.values,n=0,e=0;e<i.length;e++){var r=i[e];n+=null!=r&&"number"==typeof r.value?r.value:1}return n}function Ab(t){for(var i,n,e,r=t.values,o=0,s=0,u=0;u<r.length;u++){var h=r[u],c=null;"number"==typeof h||"bigint"==typeof h?(c=h,s++):null==h||"number"!=typeof h.value&&"bigint"!=typeof h.value||"number"!=typeof h.count||(c=bb?h.value*("number"==typeof h.value?h.count:bb(h.count)):h.value*h.count,s+=h.count),"number"==typeof c?o+=bb?"number"==typeof o?c:bb(c):c:"bigint"==typeof c&&(o=("bigint"==typeof o?o:bb(o))+c)}var a=null;s>0&&(a=bb?o/("number"==typeof o?s:bb(s)):o/s);var l=null===(n=null===(i=t.rowNode)||void 0===i?void 0:i.aggData)||void 0===n?void 0:n[null===(e=t.column)||void 0===e?void 0:e.getColId()];return l&&l.count===s&&l.value===a?l:{count:s,value:a,toString:function(){return"number"==typeof this.value||"bigint"==typeof this.value?this.value.toString():""},toNumber:function(){return this.value}}}!function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.aggFuncsMap={},i.initialised=!1,i}var n;gb(i,t),n=i,i.prototype.init=function(){this.initialised||(this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gridOptionsWrapper.getAggFuncs()))},i.prototype.initialiseWithDefaultAggregations=function(){this.aggFuncsMap[n.AGG_SUM]=wb,this.aggFuncsMap[n.AGG_FIRST]=yb,this.aggFuncsMap[n.AGG_LAST]=Cb,this.aggFuncsMap[n.AGG_MIN]=Sb,this.aggFuncsMap[n.AGG_MAX]=Rb,this.aggFuncsMap[n.AGG_COUNT]=Ob,this.aggFuncsMap[n.AGG_AVG]=Ab,this.initialised=!0},i.prototype.isAggFuncPossible=function(t,i){var n=this.getFuncNames(t),e=Wr.includes(n,i),r=Wr.exists(this.aggFuncsMap[i]);return e&&r},i.prototype.getDefaultAggFunc=function(t){var i=t.getColDef().defaultAggFunc;if(Wr.exists(i)&&this.isAggFuncPossible(t,i))return i;if(this.isAggFuncPossible(t,n.AGG_SUM))return n.AGG_SUM;var e=this.getFuncNames(t);return Wr.existsAndNotEmpty(e)?e[0]:null},i.prototype.addAggFuncs=function(t){Wr.iterateObject(t,this.addAggFunc.bind(this))},i.prototype.addAggFunc=function(t,i){this.init(),this.aggFuncsMap[t]=i},i.prototype.getAggFunc=function(t){return this.init(),this.aggFuncsMap[t]},i.prototype.getFuncNames=function(t){var i=t.getColDef().allowedAggFuncs;return null==i?Object.keys(this.aggFuncsMap).sort():i},i.prototype.clear=function(){this.aggFuncsMap={}},i.AGG_SUM="sum",i.AGG_FIRST="first",i.AGG_LAST="last",i.AGG_MIN="min",i.AGG_MAX="max",i.AGG_COUNT="count",i.AGG_AVG="avg",mb([Ft],i.prototype,"init",null),i=n=mb([Pt("aggFuncService")],i)}(Ai);var jb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),_b=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Gb=function(t){function i(i,n,e,r,o){var s=t.call(this)||this;return s.column=i,s.dragSourceDropTarget=n,s.ghost=e,s.dropZonePurpose=r,s.horizontal=o,s.popupShowing=!1,s}return jb(i,t),i.prototype.init=function(){var t=this;this.setTemplate(i.TEMPLATE);var n=this.getGui(),e=this.gridOptionsWrapper.isFunctionsReadOnly();this.addElementClasses(n),this.addElementClasses(this.eDragHandle,"drag-handle"),this.addElementClasses(this.eText,"text"),this.addElementClasses(this.eButton,"button"),this.eDragHandle.appendChild(Wr.createIconNoSpan("columnDrag",this.gridOptionsWrapper)),this.eButton.appendChild(Wr.createIconNoSpan("cancel",this.gridOptionsWrapper)),this.setupSort(),this.displayName=this.columnModel.getDisplayNameForColumn(this.column,"columnDrop"),this.setupComponents(),this.ghost||e||this.addDragSource(),this.setupAria(),this.addManagedListener(this.column,qt.EVENT_SORT_CHANGED,(function(){t.setupAria()})),this.setupTooltip()},i.prototype.setupAria=function(){var t=this.gridOptionsWrapper.getLocaleTextFunc(),i=this.getColumnAndAggFuncName(),n=i.name,e=i.aggFuncName,r=t("ariaDropZoneColumnComponentAggFuncSeperator"," of "),o={asc:t("ariaDropZoneColumnComponentSortAscending","ascending"),desc:t("ariaDropZoneColumnComponentSortDescending","descending")},s=this.column.getSort(),u=this.gridOptionsWrapper.isRowGroupPanelSuppressSort(),h=[[e&&""+e+r,n,this.isGroupingZone()&&!u&&s&&", "+o[s]].filter((function(t){return!!t})).join("")],c=this.gridOptionsWrapper.isFunctionsReadOnly();if(this.isAggregationZone()&&!c){var a=t("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");h.push(a)}if(this.isGroupingZone()&&this.column.getColDef().sortable&&!u){var l=t("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");h.push(l)}var f=t("ariaDropZoneColumnComponentDescription","Press DELETE to remove");h.push(f),Wr.setAriaLabel(this.getGui(),h.join(". "))},i.prototype.setupTooltip=function(){var t=this,i=function(){var i=t.column.getColDef().headerTooltip;t.setTooltip(i)};i(),this.addManagedListener(this.eventService,xi.EVENT_NEW_COLUMNS_LOADED,i)},i.prototype.setupSort=function(){var t=this,i=this.column.getColDef().sortable,n=this.isGroupingZone();if(i&&n&&!this.gridOptionsWrapper.isRowGroupPanelSuppressSort()){this.eSortIndicator.setupSort(this.column,!0);var e=function(i){i.preventDefault();var n=t.gridOptionsWrapper.isMultiSortKeyCtrl();t.sortController.progressSort(t.column,n?i.ctrlKey||i.metaKey:i.shiftKey,"uiColumnSorted")};this.addGuiEventListener("click",e),this.addGuiEventListener("keydown",(function(i){i.key===xr.ENTER&&t.isGroupingZone()&&e(i)}))}},i.prototype.addDragSource=function(){var t=this,i={type:Ls.ToolPanel,eElement:this.eDragHandle,defaultIconName:Xs.ICON_HIDE,getDragItem:function(){return t.createDragItem()},dragItemName:this.displayName,dragSourceDropTarget:this.dragSourceDropTarget};this.dragAndDropService.addDragSource(i,!0),this.addDestroyFunc((function(){return t.dragAndDropService.removeDragSource(i)}))},i.prototype.createDragItem=function(){var t={};return t[this.column.getId()]=this.column.isVisible(),{columns:[this.column],visibleState:t}},i.prototype.setupComponents=function(){this.setTextValue(),this.setupRemove(),this.ghost&&this.addCssClass("ag-column-drop-cell-ghost"),this.isAggregationZone()&&!this.gridOptionsWrapper.isFunctionsReadOnly()&&this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))},i.prototype.setupRemove=function(){var t=this;Wr.setDisplayed(this.eButton,!this.gridOptionsWrapper.isFunctionsReadOnly());var n={type:i.EVENT_COLUMN_REMOVE};this.addGuiEventListener("keydown",(function(i){var e=i.key===xr.ENTER;i.key===xr.DELETE&&(i.preventDefault(),t.dispatchEvent(n)),e&&t.isAggregationZone()&&!t.gridOptionsWrapper.isFunctionsReadOnly()&&(i.preventDefault(),t.onShowAggFuncSelection())})),this.addManagedListener(this.eButton,"click",(function(i){t.dispatchEvent(n),i.stopPropagation()}));var e=new ds(this.eButton);this.addManagedListener(e,ds.EVENT_TAP,(function(){t.dispatchEvent(n)})),this.addDestroyFunc(e.destroy.bind(e))},i.prototype.getColumnAndAggFuncName=function(){var t=this.displayName,i="";if(this.isAggregationZone()){var n=this.column.getAggFunc(),e="string"==typeof n?n:"agg";i=this.gridOptionsWrapper.getLocaleTextFunc()(e,e)}return{name:t,aggFuncName:i}},i.prototype.setTextValue=function(){var t=this.getColumnAndAggFuncName(),i=t.name,n=t.aggFuncName,e=this.isAggregationZone()?n+"("+i+")":i,r=Wr.escapeString(e);this.eText.innerHTML=r},i.prototype.onShowAggFuncSelection=function(){var t=this;if(!this.popupShowing){this.popupShowing=!0;var i=new Cd("select-agg-func"),n=this.aggFuncService.getFuncNames(this.column),e=this.getGui(),r=i.getGui();i.setModel({getRow:function(t){return n[t]},getRowCount:function(){return n.length}}),this.getContext().createBean(i);var o=Wr.loadTemplate('<div class="ag-select-agg-func-popup"></div>');o.style.top="0px",o.style.left="0px",o.appendChild(r),o.style.width=e.clientWidth+"px";var s=this.gridOptionsWrapper.getLocaleTextFunc(),u=this.popupService.addPopup({modal:!0,eChild:o,closeOnEsc:!0,closedCallback:function(){t.destroyBean(i),t.popupShowing=!1,e.focus()},ariaLabel:s("ariaLabelAggregationFunction","Aggregation Function")});u&&i.setComponentCreator(this.createAggSelect.bind(this,u.hideFunc)),i.addGuiEventListener("keydown",(function(t){if(t.key===xr.ENTER||t.key===xr.SPACE){var n=i.getLastFocusedRow();if(null==n)return;var e=i.getComponentAt(n);e&&e.selectItem()}})),this.popupService.positionPopupUnderComponent({type:"aggFuncSelect",eventSource:e,ePopup:o,keepWithinBounds:!0,column:this.column}),i.refresh();var h=n.findIndex((function(i){return i===t.column.getAggFunc()}));-1===h&&(h=0),i.focusRow(h)}},i.prototype.createAggSelect=function(t,i){var n=this,e=this.gridOptionsWrapper.getLocaleTextFunc(),r=i.toString(),o=e(r,r);return new xb((function(){t(),n.gridOptionsWrapper.isFunctionsPassive()?n.eventService.dispatchEvent({type:xi.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST,columns:[n.column],aggFunc:i}):n.columnModel.setColumnAggFunc(n.column,i,"toolPanelDragAndDrop")}),o)},i.prototype.addElementClasses=function(t,i){t.classList.add("ag-column-drop-cell"+(i=i?"-"+i:""),"ag-column-drop-"+(this.horizontal?"horizontal":"vertical")+"-cell"+i)},i.prototype.isAggregationZone=function(){return"aggregation"===this.dropZonePurpose},i.prototype.isGroupingZone=function(){return"rowGroup"===this.dropZonePurpose},i.EVENT_COLUMN_REMOVE="columnRemove",i.TEMPLATE='<span role="option" tabindex="0">\n <span ref="eDragHandle" class="ag-drag-handle ag-column-drop-cell-drag-handle" role="presentation"></span>\n <span ref="eText" class="ag-column-drop-cell-text" aria-hidden="true"></span>\n <ag-sort-indicator ref="eSortIndicator"></ag-sort-indicator>\n <span ref="eButton" class="ag-column-drop-cell-button" role="presentation"></span>\n </span>',_b([Dt("dragAndDropService")],i.prototype,"dragAndDropService",void 0),_b([Dt("columnModel")],i.prototype,"columnModel",void 0),_b([Dt("popupService")],i.prototype,"popupService",void 0),_b([It("aggFuncService")],i.prototype,"aggFuncService",void 0),_b([Dt("sortController")],i.prototype,"sortController",void 0),_b([no("eText")],i.prototype,"eText",void 0),_b([no("eDragHandle")],i.prototype,"eDragHandle",void 0),_b([no("eButton")],i.prototype,"eButton",void 0),_b([no("eSortIndicator")],i.prototype,"eSortIndicator",void 0),_b([Ft],i.prototype,"init",null),i}(io),xb=function(t){function i(i,n){var e=t.call(this,'<div class="ag-select-agg-func-item"/>')||this;return e.selectItem=i,e.getGui().innerText=n,e.addGuiEventListener("click",e.selectItem),e}return jb(i,t),i}(io),Mb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Fb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},kb=function(t,i){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var e,r,o=n.call(t),s=[];try{for(;(void 0===i||i-- >0)&&!(e=o.next()).done;)s.push(e.value)}catch(t){r={error:t}}finally{try{e&&!e.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},Pb=function(){for(var t=[],i=0;i<arguments.length;i++)t=t.concat(kb(arguments[i]));return t},Db=function(t){function i(n,e){var r=t.call(this,'<div class="ag-unselectable" role="presentation"></div>')||this;return r.horizontal=n,r.dropZonePurpose=e,r.state=i.STATE_NOT_DRAGGING,r.guiDestroyFunctions=[],r.childColumnComponents=[],r.resizeEnabled=!1,r.addElementClasses(r.getGui()),r.eColumnDropList=document.createElement("div"),r.addElementClasses(r.eColumnDropList,"list"),Wr.setAriaRole(r.eColumnDropList,"listbox"),r}return Mb(i,t),i.prototype.isHorizontal=function(){return this.horizontal},i.prototype.toggleResizable=function(t){this.positionableFeature.setResizable(!!t&&{bottom:!0}),this.resizeEnabled=t},i.prototype.setBeans=function(t){this.beans=t},i.prototype.destroy=function(){this.destroyGui(),t.prototype.destroy.call(this)},i.prototype.destroyGui=function(){this.guiDestroyFunctions.forEach((function(t){return t()})),this.guiDestroyFunctions.length=0,this.childColumnComponents.length=0,Wr.clearElement(this.getGui()),Wr.clearElement(this.eColumnDropList)},i.prototype.init=function(t){this.params=t,this.createManagedBean(new go(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.addManagedListener(this.beans.eventService,xi.EVENT_NEW_COLUMNS_LOADED,this.refreshGui.bind(this)),this.addManagedListener(this.beans.gridOptionsWrapper,"functionsReadOnly",this.refreshGui.bind(this)),this.setupDropTarget(),this.positionableFeature=new El(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature),this.refreshGui(),Wr.setAriaLabel(this.eColumnDropList,this.getAriaLabel())},i.prototype.handleKeyDown=function(t){var i=t.key===xr.DOWN,n=t.key===xr.UP;if(this.horizontal){var e=this.gridOptionsWrapper.isEnableRtl();i=!e&&t.key===xr.RIGHT||e&&t.key===xr.LEFT,n=!e&&t.key===xr.LEFT||e&&t.key===xr.RIGHT}if(i||n){var r=this.focusService.findNextFocusableElement(this.getFocusableElement(),!1,n);r&&(t.preventDefault(),r.focus())}},i.prototype.addElementClasses=function(t,i){t.classList.add("ag-column-drop"+(i=i?"-"+i:""),"ag-column-drop-"+(this.horizontal?"horizontal":"vertical")+i)},i.prototype.setupDropTarget=function(){this.dropTarget={getContainer:this.getGui.bind(this),getIconName:this.getIconName.bind(this),onDragging:this.onDragging.bind(this),onDragEnter:this.onDragEnter.bind(this),onDragLeave:this.onDragLeave.bind(this),onDragStop:this.onDragStop.bind(this),isInterestedIn:this.isInterestedIn.bind(this)},this.beans.dragAndDropService.addDropTarget(this.dropTarget)},i.prototype.isInterestedIn=function(t){return t===Ls.HeaderCell||t===Ls.ToolPanel},i.prototype.checkInsertIndex=function(t){var i=this.getNewInsertIndex(t);if(i<0)return!1;var n=i!==this.insertIndex;return n&&(this.insertIndex=i),n},i.prototype.getNewInsertIndex=function(t){var i=this,n=t.event,e=this.horizontal?n.clientX:n.clientY,r=this.childColumnComponents.map((function(t){return t.getGui().getBoundingClientRect()})),o=r.findIndex((function(t){return i.horizontal?t.right>e&&t.left<e:t.top<e&&t.bottom>e}));if(-1===o){var s=this.beans.gridOptionsWrapper.isEnableRtl();return r.every((function(t){return e>(i.horizontal?t.right:t.bottom)}))?s&&this.horizontal?0:this.childColumnComponents.length:r.every((function(t){return e<(i.horizontal?t.left:t.top)}))?s&&this.horizontal?this.childColumnComponents.length:0:this.insertIndex}return this.insertIndex<=o?o+1:o},i.prototype.checkDragStartedBySelf=function(t){this.state===i.STATE_NOT_DRAGGING&&(this.state=i.STATE_REARRANGE_COLUMNS,this.potentialDndColumns=t.dragSource.getDragItem().columns||[],this.refreshGui(),this.checkInsertIndex(t),this.refreshGui())},i.prototype.onDragging=function(t){this.checkDragStartedBySelf(t),this.checkInsertIndex(t)&&this.refreshGui()},i.prototype.onDragEnter=function(t){var n=t.dragSource.getDragItem().columns||[];this.state=i.STATE_NEW_COLUMNS_IN;var e=n.filter(this.isColumnDroppable.bind(this));if(e.length>0){if(this.isRowGroupPanel()&&!this.gridOptionsWrapper.isSuppressRowGroupHidesColumns()&&!t.fromNudge){var r=t.dragSource.getDragItem();this.setColumnsVisible(r.columns,!1,"uiColumnDragged")}this.potentialDndColumns=e,this.checkInsertIndex(t),this.refreshGui()}},i.prototype.setColumnsVisible=function(t,i,n){if(void 0===n&&(n="api"),t){var e=t.filter((function(t){return!t.getColDef().lockVisible}));this.colModel.setColumnsVisible(e,i,n)}},i.prototype.isPotentialDndColumns=function(){return Wr.existsAndNotEmpty(this.potentialDndColumns)},i.prototype.isRowGroupPanel=function(){return"rowGroup"===this.dropZonePurpose},i.prototype.onDragLeave=function(t){if(this.state===i.STATE_REARRANGE_COLUMNS){var n=t.dragSource.getDragItem().columns||[];this.removeColumns(n)}if(this.isPotentialDndColumns()){if(this.isRowGroupPanel()&&!this.gridOptionsWrapper.isSuppressMakeColumnVisibleAfterUnGroup()&&!t.fromNudge){var e=t.dragSource.getDragItem();this.setColumnsVisible(e.columns,!0,"uiColumnDragged")}this.potentialDndColumns=[],this.refreshGui()}this.state=i.STATE_NOT_DRAGGING},i.prototype.onDragStop=function(){if(this.isPotentialDndColumns()){var t=!1;this.state===i.STATE_NEW_COLUMNS_IN?(this.addColumns(this.potentialDndColumns),t=!0):t=this.rearrangeColumns(this.potentialDndColumns),this.potentialDndColumns=[],this.beans.gridOptionsWrapper.isFunctionsPassive()&&t||this.refreshGui()}this.state=i.STATE_NOT_DRAGGING},i.prototype.removeColumns=function(t){var i=this.getExistingColumns().filter((function(i){return!Wr.includes(t,i)}));this.updateColumns(i)},i.prototype.addColumns=function(t){if(t){var i=this.getExistingColumns().slice(),n=t.filter((function(t){return i.indexOf(t)<0}));Wr.insertArrayIntoArray(i,n,this.insertIndex),this.updateColumns(i)}},i.prototype.rearrangeColumns=function(t){var i=this.getNonGhostColumns().slice();return Wr.insertArrayIntoArray(i,t,this.insertIndex),!Wr.areEqual(i,this.getExistingColumns())&&(this.updateColumns(i),!0)},i.prototype.refreshGui=function(){var t=this.eColumnDropList.scrollTop,i=this.resizeEnabled,n=this.getFocusedItem(),e=this.focusService.findNextFocusableElement();e||(e=this.focusService.findNextFocusableElement(void 0,!1,!0)),this.toggleResizable(!1),this.destroyGui(),this.addIconAndTitleToGui(),this.addEmptyMessageToGui(),this.addColumnsToGui(),this.isHorizontal()||(this.eColumnDropList.scrollTop=t),i&&this.toggleResizable(i),this.restoreFocus(n,e)},i.prototype.getFocusedItem=function(){var t=this.getGui(),i=this.gridOptionsWrapper.getDocument().activeElement;return t.contains(i)?Array.from(t.querySelectorAll(".ag-column-drop-cell")).indexOf(i):-1},i.prototype.restoreFocus=function(t,i){var n=this.getGui(),e=Array.from(n.querySelectorAll(".ag-column-drop-cell"));if(-1!==t){0===e.length&&i.focus();var r=e[Math.min(e.length-1,t)];r&&r.focus()}},i.prototype.getNonGhostColumns=function(){var t=this,i=this.getExistingColumns();return this.isPotentialDndColumns()?i.filter((function(i){return!Wr.includes(t.potentialDndColumns,i)})):i},i.prototype.addColumnsToGui=function(){var t=this,i=this.getNonGhostColumns().map((function(i){return t.createColumnComponent(i,!1)}));if(this.isPotentialDndColumns()){var n=this.potentialDndColumns.map((function(i){return t.createColumnComponent(i,!0)}));this.insertIndex>=i.length?i.push.apply(i,Pb(n)):i.splice.apply(i,Pb([this.insertIndex,0],n))}this.appendChild(this.eColumnDropList),i.forEach((function(i,n){n>0&&t.addArrow(t.eColumnDropList),t.eColumnDropList.appendChild(i.getGui())})),this.addAriaLabelsToComponents()},i.prototype.addAriaLabelsToComponents=function(){var t=this;this.childColumnComponents.forEach((function(i,n){var e=i.getGui();Wr.setAriaPosInSet(e,n+1),Wr.setAriaSetSize(e,t.childColumnComponents.length)}))},i.prototype.createColumnComponent=function(t,i){var n=this,e=new Gb(t,this.dropTarget,i,this.dropZonePurpose,this.horizontal);return e.addEventListener(Gb.EVENT_COLUMN_REMOVE,this.removeColumns.bind(this,[t])),this.beans.context.createBean(e),this.guiDestroyFunctions.push((function(){return n.destroyBean(e)})),i||this.childColumnComponents.push(e),e},i.prototype.addIconAndTitleToGui=function(){var t=this.params.icon,i=document.createElement("div");if(i.setAttribute("aria-hidden","true"),this.addElementClasses(i,"title-bar"),this.addElementClasses(t,"icon"),this.addOrRemoveCssClass("ag-column-drop-empty",this.isExistingColumnsEmpty()),i.appendChild(t),!this.horizontal){var n=document.createElement("span");this.addElementClasses(n,"title"),n.innerHTML=this.params.title,i.appendChild(n)}this.appendChild(i)},i.prototype.isExistingColumnsEmpty=function(){return 0===this.getExistingColumns().length},i.prototype.addEmptyMessageToGui=function(){if(this.isExistingColumnsEmpty()&&!this.isPotentialDndColumns()){var t=document.createElement("span");t.innerHTML=this.params.emptyMessage,this.addElementClasses(t,"empty-message"),this.eColumnDropList.appendChild(t)}},i.prototype.addArrow=function(t){if(this.horizontal){var i=this.beans.gridOptionsWrapper.isEnableRtl(),n=Wr.createIconNoSpan(i?"smallLeft":"smallRight",this.beans.gridOptionsWrapper);this.addElementClasses(n,"cell-separator"),t.appendChild(n)}},i.STATE_NOT_DRAGGING="notDragging",i.STATE_NEW_COLUMNS_IN="newColumnsIn",i.STATE_REARRANGE_COLUMNS="rearrangeColumns",Fb([Dt("columnModel")],i.prototype,"colModel",void 0),Fb([Dt("focusService")],i.prototype,"focusService",void 0),i}(io),Ib=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Eb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Tb=function(t){function i(i){return t.call(this,i,"rowGroup")||this}return Ib(i,t),i.prototype.passBeansUp=function(){t.prototype.setBeans.call(this,{gridOptionsWrapper:this.gridOptionsWrapper,eventService:this.eventService,context:this.getContext(),loggerFactory:this.loggerFactory,dragAndDropService:this.dragAndDropService});var i=this.gridOptionsWrapper.getLocaleTextFunc(),n=i("rowGroupColumnsEmptyMessage","Drag here to set row groups"),e=i("groups","Row Groups");t.prototype.init.call(this,{dragAndDropIcon:Xs.ICON_GROUP,icon:Wr.createIconNoSpan("rowGroupPanel",this.gridOptionsWrapper,null),emptyMessage:n,title:e}),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_ROW_GROUP_CHANGED,this.refreshGui.bind(this))},i.prototype.getAriaLabel=function(){return this.gridOptionsWrapper.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")},i.prototype.getTooltipParams=function(){var i=t.prototype.getTooltipParams.call(this);return i.location="rowGroupColumnsList",i},i.prototype.isColumnDroppable=function(t){return!(this.gridOptionsWrapper.isFunctionsReadOnly()||!t.isPrimary())&&t.isAllowRowGroup()&&!t.isRowGroupActive()},i.prototype.updateColumns=function(t){this.gridOptionsWrapper.isFunctionsPassive()?this.eventService.dispatchEvent({type:xi.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST,columns:t}):this.columnModel.setRowGroupColumns(t,"toolPanelUi")},i.prototype.getIconName=function(){return this.isPotentialDndColumns()?Xs.ICON_GROUP:Xs.ICON_NOT_ALLOWED},i.prototype.getExistingColumns=function(){return this.columnModel.getRowGroupColumns()},Eb([Dt("columnModel")],i.prototype,"columnModel",void 0),Eb([Dt("loggerFactory")],i.prototype,"loggerFactory",void 0),Eb([Dt("dragAndDropService")],i.prototype,"dragAndDropService",void 0),Eb([Ft],i.prototype,"passBeansUp",null),i}(Db),zb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Nb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Lb=function(t){function i(i){return t.call(this,i,"pivot")||this}return zb(i,t),i.prototype.passBeansUp=function(){t.prototype.setBeans.call(this,{gridOptionsWrapper:this.gridOptionsWrapper,eventService:this.eventService,context:this.getContext(),loggerFactory:this.loggerFactory,dragAndDropService:this.dragAndDropService});var i=this.gridOptionsWrapper.getLocaleTextFunc(),n=i("pivotColumnsEmptyMessage","Drag here to set column labels"),e=i("pivots","Column Labels");t.prototype.init.call(this,{dragAndDropIcon:Xs.ICON_GROUP,icon:Wr.createIconNoSpan("pivotPanel",this.gridOptionsWrapper,null),emptyMessage:n,title:e}),this.addManagedListener(this.eventService,xi.EVENT_NEW_COLUMNS_LOADED,this.refresh.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PIVOT_CHANGED,this.refresh.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.checkVisibility.bind(this)),this.refresh()},i.prototype.getAriaLabel=function(){return this.gridOptionsWrapper.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")},i.prototype.getTooltipParams=function(){var i=t.prototype.getTooltipParams.call(this);return i.location="pivotColumnsList",i},i.prototype.refresh=function(){this.checkVisibility(),this.refreshGui()},i.prototype.checkVisibility=function(){var t=this.columnModel.isPivotMode();if(this.isHorizontal())switch(this.gridOptionsWrapper.getPivotPanelShow()){case"always":this.setDisplayed(t);break;case"onlyWhenPivoting":var i=this.columnModel.isPivotActive();this.setDisplayed(t&&i);break;default:this.setDisplayed(!1)}else this.setDisplayed(t)},i.prototype.isColumnDroppable=function(t){return!(this.gridOptionsWrapper.isFunctionsReadOnly()||!t.isPrimary())&&t.isAllowPivot()&&!t.isPivotActive()},i.prototype.updateColumns=function(t){this.gridOptionsWrapper.isFunctionsPassive()?this.eventService.dispatchEvent({type:xi.EVENT_COLUMN_PIVOT_CHANGE_REQUEST,columns:t}):this.columnModel.setPivotColumns(t,"toolPanelUi")},i.prototype.getIconName=function(){return this.isPotentialDndColumns()?Xs.ICON_PIVOT:Xs.ICON_NOT_ALLOWED},i.prototype.getExistingColumns=function(){return this.columnModel.getPivotColumns()},Nb([Dt("columnModel")],i.prototype,"columnModel",void 0),Nb([Dt("loggerFactory")],i.prototype,"loggerFactory",void 0),Nb([Dt("dragAndDropService")],i.prototype,"dragAndDropService",void 0),Nb([Ft],i.prototype,"passBeansUp",null),i}(Db),Bb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Hb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(t){function i(){return t.call(this)||this}Bb(i,t),i.prototype.postConstruct=function(){this.setGui(this.createNorthPanel()),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onRowGroupChanged.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_NEW_COLUMNS_LOADED,this.onRowGroupChanged.bind(this)),this.addManagedListener(this.gridOptionsWrapper,"rowGroupPanelShow",this.onRowGroupChanged.bind(this)),this.onRowGroupChanged()},i.prototype.createNorthPanel=function(){var t=document.createElement("div"),i=this.onDropPanelVisible.bind(this);return t.classList.add("ag-column-drop-wrapper"),Wr.setAriaRole(t,"presentation"),this.rowGroupComp=new Tb(!0),this.createManagedBean(this.rowGroupComp),this.pivotComp=new Lb(!0),this.createManagedBean(this.pivotComp),t.appendChild(this.rowGroupComp.getGui()),t.appendChild(this.pivotComp.getGui()),this.addManagedListener(this.rowGroupComp,io.EVENT_DISPLAYED_CHANGED,i),this.addManagedListener(this.pivotComp,io.EVENT_DISPLAYED_CHANGED,i),this.onDropPanelVisible(),t},i.prototype.onDropPanelVisible=function(){var t=this.rowGroupComp.isDisplayed()&&this.pivotComp.isDisplayed();this.rowGroupComp.addOrRemoveCssClass("ag-column-drop-horizontal-half-width",t),this.pivotComp.addOrRemoveCssClass("ag-column-drop-horizontal-half-width",t)},i.prototype.onRowGroupChanged=function(){if(this.rowGroupComp){var t=this.gridOptionsWrapper.getRowGroupPanelShow();if(t===Vt.ALWAYS)this.rowGroupComp.setDisplayed(!0);else if(t===Vt.ONLY_WHEN_GROUPING){var i=!this.columnModel.isRowGroupEmpty();this.rowGroupComp.setDisplayed(i)}else this.rowGroupComp.setDisplayed(!1)}},Hb([Dt("columnModel")],i.prototype,"columnModel",void 0),Hb([Ft],i.prototype,"postConstruct",null)}(io);var Wb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Vb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(t){function i(){return null!==t&&t.apply(this,arguments)||this}Wb(i,t),i.prototype.execute=function(t){var i=this,n=this.columnModel.isPivotMode(),e=this.filterManager.isAggregateFilterPresent(),r=this.gridOptionsWrapper.getGroupAggFiltering()||(n?function(t){return t.node.leafGroup}:function(t){return!t.node.group}),o=function(t,n){void 0===n&&(n=!1),t.childrenAfterFilter&&(t.childrenAfterAggFilter=t.childrenAfterFilter,n&&t.childrenAfterAggFilter.forEach((function(t){return o(t,n)})),i.setAllChildrenCount(t)),t.sibling&&(t.sibling.childrenAfterAggFilter=t.childrenAfterAggFilter)};t.changedPath.forEachChangedNodeDepthFirst(e?function(t){var n;t.childrenAfterAggFilter=(null===(n=t.childrenAfterFilter)||void 0===n?void 0:n.filter((function(t){var n;return r({node:t})&&i.filterManager.doesRowPassAggregateFilters({rowNode:t})?(o(t,!0),!0):null===(n=t.childrenAfterAggFilter)||void 0===n?void 0:n.length})))||null,i.setAllChildrenCount(t),t.sibling&&(t.sibling.childrenAfterAggFilter=t.childrenAfterAggFilter)}:o,!0)},i.prototype.setAllChildrenCountTreeData=function(t){var i=0;t.childrenAfterAggFilter.forEach((function(t){i++,i+=t.allChildrenCount})),t.setAllChildrenCount(i)},i.prototype.setAllChildrenCountGridGrouping=function(t){var i=0;t.childrenAfterAggFilter.forEach((function(t){t.group?i+=t.allChildrenCount:i++})),t.setAllChildrenCount(i)},i.prototype.setAllChildrenCount=function(t){t.hasChildren()?this.gridOptionsWrapper.isTreeData()?this.setAllChildrenCountTreeData(t):this.setAllChildrenCountGridGrouping(t):t.setAllChildrenCount(null)},Vb([Dt("filterManager")],i.prototype,"filterManager",void 0),Vb([Dt("columnModel")],i.prototype,"columnModel",void 0),i=Vb([Pt("filterAggregatesStage")],i)}(Ai);var Ub=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Kb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},$b=function(t){function i(i){return t.call(this,i,"aggregation")||this}return Ub(i,t),i.prototype.passBeansUp=function(){t.prototype.setBeans.call(this,{gridOptionsWrapper:this.gridOptionsWrapper,eventService:this.eventService,context:this.getContext(),loggerFactory:this.loggerFactory,dragAndDropService:this.dragAndDropService});var i=this.gridOptionsWrapper.getLocaleTextFunc(),n=i("valueColumnsEmptyMessage","Drag here to aggregate"),e=i("values","Values");t.prototype.init.call(this,{dragAndDropIcon:Xs.ICON_AGGREGATE,icon:Wr.createIconNoSpan("valuePanel",this.gridOptionsWrapper,null),emptyMessage:n,title:e}),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_VALUE_CHANGED,this.refreshGui.bind(this))},i.prototype.getAriaLabel=function(){return this.gridOptionsWrapper.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")},i.prototype.getTooltipParams=function(){var i=t.prototype.getTooltipParams.call(this);return i.location="valueColumnsList",i},i.prototype.getIconName=function(){return this.isPotentialDndColumns()?Xs.ICON_AGGREGATE:Xs.ICON_NOT_ALLOWED},i.prototype.isColumnDroppable=function(t){return!(this.gridOptionsWrapper.isFunctionsReadOnly()||!t.isPrimary())&&t.isAllowValue()&&!t.isValueActive()},i.prototype.updateColumns=function(t){this.gridOptionsWrapper.isFunctionsPassive()?this.eventService.dispatchEvent({type:xi.EVENT_COLUMN_VALUE_CHANGE_REQUEST,columns:t}):this.columnModel.setValueColumns(t,"toolPanelUi")},i.prototype.getExistingColumns=function(){return this.columnModel.getValueColumns()},Kb([Dt("columnModel")],i.prototype,"columnModel",void 0),Kb([Dt("loggerFactory")],i.prototype,"loggerFactory",void 0),Kb([Dt("dragAndDropService")],i.prototype,"dragAndDropService",void 0),Kb([Ft],i.prototype,"passBeansUp",null),i}(Db),qb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Yb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Jb=function(t){function i(){return t.call(this,i.TEMPLATE)||this}return qb(i,t),i.prototype.postConstruct=function(){this.initialiseTabGuard({})},i.prototype.init=function(t,i,n){this.allowDragging=t,this.params=i,this.eventType=n,this.primaryColsHeaderPanel.init(this.params),this.params.suppressColumnExpandAll&&this.params.suppressColumnFilter&&this.params.suppressColumnSelectAll&&this.primaryColsHeaderPanel.setDisplayed(!1),this.addManagedListener(this.primaryColsListPanel,"groupExpanded",this.onGroupExpanded.bind(this)),this.addManagedListener(this.primaryColsListPanel,"selectionChanged",this.onSelectionChange.bind(this)),this.primaryColsListPanel.init(this.params,this.allowDragging,this.eventType),this.addManagedListener(this.primaryColsHeaderPanel,"expandAll",this.onExpandAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"collapseAll",this.onCollapseAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"selectAll",this.onSelectAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"unselectAll",this.onUnselectAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"filterChanged",this.onFilterChanged.bind(this)),this.positionableFeature=new El(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature)},i.prototype.toggleResizable=function(t){this.positionableFeature.setResizable(!!t&&{bottom:!0})},i.prototype.onExpandAll=function(){this.primaryColsListPanel.doSetExpandedAll(!0)},i.prototype.onCollapseAll=function(){this.primaryColsListPanel.doSetExpandedAll(!1)},i.prototype.expandGroups=function(t){this.primaryColsListPanel.setGroupsExpanded(!0,t)},i.prototype.collapseGroups=function(t){this.primaryColsListPanel.setGroupsExpanded(!1,t)},i.prototype.setColumnLayout=function(t){this.primaryColsListPanel.setColumnLayout(t)},i.prototype.onFilterChanged=function(t){this.primaryColsListPanel.setFilterText(t.filterText)},i.prototype.syncLayoutWithGrid=function(){this.primaryColsListPanel.onColumnsChanged()},i.prototype.onSelectAll=function(){this.primaryColsListPanel.doSetSelectedAll(!0)},i.prototype.onUnselectAll=function(){this.primaryColsListPanel.doSetSelectedAll(!1)},i.prototype.onGroupExpanded=function(t){this.primaryColsHeaderPanel.setExpandState(t.state)},i.prototype.onSelectionChange=function(t){this.primaryColsHeaderPanel.setSelectionState(t.state)},i.TEMPLATE='<div class="ag-column-select">\n <ag-primary-cols-header ref="primaryColsHeaderPanel"></ag-primary-cols-header>\n <ag-primary-cols-list ref="primaryColsListPanel"></ag-primary-cols-list>\n </div>',Yb([no("primaryColsHeaderPanel")],i.prototype,"primaryColsHeaderPanel",void 0),Yb([no("primaryColsListPanel")],i.prototype,"primaryColsListPanel",void 0),Yb([Ft],i.prototype,"postConstruct",null),i}(Qf),Zb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Xb=function(){return Xb=Object.assign||function(t){for(var i,n=1,e=arguments.length;n<e;n++)for(var r in i=arguments[n])Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r]);return t},Xb.apply(this,arguments)},Qb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(t){function i(){var n=t.call(this,i.TEMPLATE)||this;return n.initialised=!1,n.childDestroyFuncs=[],n}Zb(i,t),i.prototype.setVisible=function(i){t.prototype.setDisplayed.call(this,i),i&&!this.initialised&&this.init(this.params)},i.prototype.init=function(t){var i=this;if(this.params=Xb(Xb(Xb({},{suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1,api:this.gridApi,columnApi:this.columnApi}),t),{context:this.gridOptionsWrapper.getContext()}),this.isRowGroupingModuleLoaded()&&!this.params.suppressPivotMode&&(this.pivotModePanel=this.createBean(new nb),this.childDestroyFuncs.push((function(){return i.destroyBean(i.pivotModePanel)})),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new Jb),this.childDestroyFuncs.push((function(){return i.destroyBean(i.primaryColsPanel)})),this.primaryColsPanel.init(!0,this.params,"toolPanelUi"),this.primaryColsPanel.addCssClass("ag-column-panel-column-select"),this.appendChild(this.primaryColsPanel),this.isRowGroupingModuleLoaded()){this.params.suppressRowGroups||(this.rowGroupDropZonePanel=this.createBean(new Tb(!1)),this.childDestroyFuncs.push((function(){return i.destroyBean(i.rowGroupDropZonePanel)})),this.appendChild(this.rowGroupDropZonePanel)),this.params.suppressValues||(this.valuesDropZonePanel=this.createBean(new $b(!1)),this.childDestroyFuncs.push((function(){return i.destroyBean(i.valuesDropZonePanel)})),this.appendChild(this.valuesDropZonePanel)),this.params.suppressPivots||(this.pivotDropZonePanel=this.createBean(new Lb(!1)),this.childDestroyFuncs.push((function(){return i.destroyBean(i.pivotDropZonePanel)})),this.appendChild(this.pivotDropZonePanel)),this.setLastVisible();var n=this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PIVOT_MODE_CHANGED,(function(){i.resetChildrenHeight(),i.setLastVisible()}));this.childDestroyFuncs.push((function(){return n()}))}this.initialised=!0},i.prototype.setPivotModeSectionVisible=function(t){var i=this;this.isRowGroupingModuleLoaded()&&(this.pivotModePanel?this.pivotModePanel.setDisplayed(t):t&&(this.pivotModePanel=this.createBean(new nb),this.getGui().insertBefore(this.pivotModePanel.getGui(),this.getGui().firstChild),this.childDestroyFuncs.push((function(){return i.destroyBean(i.pivotModePanel)}))),this.setLastVisible())},i.prototype.setRowGroupsSectionVisible=function(t){this.isRowGroupingModuleLoaded()&&(this.rowGroupDropZonePanel?this.rowGroupDropZonePanel.setDisplayed(t):t&&(this.rowGroupDropZonePanel=this.createManagedBean(new Tb(!1)),this.appendChild(this.rowGroupDropZonePanel)),this.setLastVisible())},i.prototype.setValuesSectionVisible=function(t){this.isRowGroupingModuleLoaded()&&(this.valuesDropZonePanel?this.valuesDropZonePanel.setDisplayed(t):t&&(this.valuesDropZonePanel=this.createManagedBean(new $b(!1)),this.appendChild(this.valuesDropZonePanel)),this.setLastVisible())},i.prototype.setPivotSectionVisible=function(t){this.isRowGroupingModuleLoaded()&&(this.pivotDropZonePanel?this.pivotDropZonePanel.setDisplayed(t):t&&(this.pivotDropZonePanel=this.createManagedBean(new Lb(!1)),this.appendChild(this.pivotDropZonePanel),this.pivotDropZonePanel.setDisplayed(t)),this.setLastVisible())},i.prototype.setResizers=function(){[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel].forEach((function(t){if(t){var i=t.getGui();t.toggleResizable(!i.classList.contains("ag-last-column-drop")&&!i.classList.contains("ag-hidden"))}}))},i.prototype.setLastVisible=function(){var t=this.getGui();Array.prototype.slice.call(t.querySelectorAll(".ag-column-drop")).forEach((function(t){return t.classList.remove("ag-last-column-drop")}));var i=t.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),n=Wr.last(i);n&&n.classList.add("ag-last-column-drop"),this.setResizers()},i.prototype.resetChildrenHeight=function(){for(var t=this.getGui().children,i=0;i<t.length;i++){var n=t[i];n.style.removeProperty("height"),n.style.removeProperty("flex")}},i.prototype.isRowGroupingModuleLoaded=function(){return Ut.assertRegistered(Nt.RowGroupingModule,"Row Grouping")},i.prototype.expandColumnGroups=function(t){this.primaryColsPanel.expandGroups(t)},i.prototype.collapseColumnGroups=function(t){this.primaryColsPanel.collapseGroups(t)},i.prototype.setColumnLayout=function(t){this.primaryColsPanel.setColumnLayout(t)},i.prototype.syncLayoutWithGrid=function(){this.primaryColsPanel.syncLayoutWithGrid()},i.prototype.destroyChildren=function(){this.childDestroyFuncs.forEach((function(t){return t()})),this.childDestroyFuncs.length=0,Wr.clearElement(this.getGui())},i.prototype.refresh=function(){this.destroyChildren(),this.init(this.params)},i.prototype.destroy=function(){this.destroyChildren(),t.prototype.destroy.call(this)},i.TEMPLATE='<div class="ag-column-panel"></div>',Qb([Dt("gridApi")],i.prototype,"gridApi",void 0),Qb([Dt("columnApi")],i.prototype,"columnApi",void 0)}(io);var tw=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),iw=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},nw=function(t){function i(){var i=t.call(this,'<div class="ag-tool-panel-horizontal-resize"></div>')||this;return i.minWidth=100,i.maxWidth=null,i}return tw(i,t),i.prototype.setElementToResize=function(t){this.elementToResize=t},i.prototype.postConstruct=function(){var t=this.horizontalResizeService.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(t),this.setInverted(this.gridOptionsWrapper.isEnableRtl())},i.prototype.dispatchResizeEvent=function(t,i,n){this.eventService.dispatchEvent({type:xi.EVENT_TOOL_PANEL_SIZE_CHANGED,width:n,started:t,ended:i})},i.prototype.onResizeStart=function(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)},i.prototype.onResizeEnd=function(t){return this.onResizing(t,!0)},i.prototype.onResizing=function(t,i){void 0===i&&(i=!1);var n=Math.max(this.minWidth,Math.floor(this.startingWidth-t*(this.inverted?-1:1)));null!=this.maxWidth&&(n=Math.min(this.maxWidth,n)),this.elementToResize.style.width=n+"px",this.dispatchResizeEvent(!1,i,n)},i.prototype.setInverted=function(t){this.inverted=t},i.prototype.setMaxWidth=function(t){this.maxWidth=t},i.prototype.setMinWidth=function(t){this.minWidth=null!=t?t:100},iw([Dt("horizontalResizeService")],i.prototype,"horizontalResizeService",void 0),iw([Ft],i.prototype,"postConstruct",null),i}(io),ew=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),rw=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},ow=function(t){function i(i){var n=t.call(this)||this;return n.toolPanelDef=i,n}return ew(i,t),i.prototype.getToolPanelId=function(){return this.toolPanelDef.id},i.prototype.postConstruct=function(){var t=this.createTemplate();this.setTemplate(t),this.setLabel(),this.setIcon(),this.addManagedListener(this.eToggleButton,"click",this.onButtonPressed.bind(this))},i.prototype.createTemplate=function(){return'<div class="ag-side-button" role="presentation">\n <button type="button" ref="eToggleButton" tabindex="-1" role="tab" class="ag-side-button-button">\n <div ref="eIconWrapper" class="ag-side-button-icon-wrapper" aria-hidden="true"></div>\n <span ref ="eLabel" class="ag-side-button-label"></span>\n </button>\n </div>'},i.prototype.setLabel=function(){var t=this.gridOptionsWrapper.getLocaleTextFunc(),i=this.toolPanelDef,n=t(i.labelKey,i.labelDefault);this.eLabel.innerText=n},i.prototype.setIcon=function(){this.eIconWrapper.insertAdjacentElement("afterbegin",Wr.createIconNoSpan(this.toolPanelDef.iconKey,this.gridOptionsWrapper))},i.prototype.onButtonPressed=function(){this.dispatchEvent({type:i.EVENT_TOGGLE_BUTTON_CLICKED})},i.prototype.setSelected=function(t){this.addOrRemoveCssClass("ag-selected",t)},i.EVENT_TOGGLE_BUTTON_CLICKED="toggleButtonClicked",rw([no("eToggleButton")],i.prototype,"eToggleButton",void 0),rw([no("eIconWrapper")],i.prototype,"eIconWrapper",void 0),rw([no("eLabel")],i.prototype,"eLabel",void 0),rw([Ft],i.prototype,"postConstruct",null),i}(io),sw=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),uw=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},hw=function(t){function i(){var n=t.call(this,i.TEMPLATE)||this;return n.buttonComps=[],n}return sw(i,t),i.prototype.postConstruct=function(){this.addManagedListener(this.getFocusableElement(),"keydown",this.handleKeyDown.bind(this))},i.prototype.handleKeyDown=function(t){if(t.key===xr.TAB&&t.shiftKey){var i=Wr.last(this.columnModel.getAllDisplayedColumns());this.focusService.focusGridView(i,!0)&&t.preventDefault()}},i.prototype.setToolPanelDefs=function(t){t.forEach(this.addButtonComp.bind(this))},i.prototype.setActiveButton=function(t){this.buttonComps.forEach((function(i){i.setSelected(t===i.getToolPanelId())}))},i.prototype.addButtonComp=function(t){var n=this,e=this.createBean(new ow(t));this.buttonComps.push(e),this.appendChild(e),e.addEventListener(ow.EVENT_TOGGLE_BUTTON_CLICKED,(function(){n.dispatchEvent({type:i.EVENT_SIDE_BAR_BUTTON_CLICKED,toolPanelId:t.id})}))},i.prototype.clearButtons=function(){this.buttonComps=this.destroyBeans(this.buttonComps),Wr.clearElement(this.getGui())},i.EVENT_SIDE_BAR_BUTTON_CLICKED="sideBarButtonClicked",i.TEMPLATE='<div class="ag-side-buttons" role="tablist"></div>',uw([Dt("focusService")],i.prototype,"focusService",void 0),uw([Dt("columnModel")],i.prototype,"columnModel",void 0),uw([Ft],i.prototype,"postConstruct",null),uw([kt],i.prototype,"clearButtons",null),i}(io),cw=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),aw=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},lw=function(t){function i(){return t.call(this,i.TEMPLATE)||this}return cw(i,t),i.prototype.setupResize=function(){var t=this.getGui(),i=this.resizeBar=this.createManagedBean(new nw);i.setElementToResize(t),this.appendChild(i)},i.prototype.getToolPanelId=function(){return this.toolPanelId},i.prototype.setToolPanelDef=function(t){var i=t.id,n=t.minWidth,e=t.maxWidth,r=t.width;this.toolPanelId=i,this.width=r;var o=this.userComponentFactory.getToolPanelCompDetails(t,{}).newAgStackInstance();null!=o?(o.then(this.setToolPanelComponent.bind(this)),null!=n&&this.resizeBar.setMinWidth(n),null!=e&&this.resizeBar.setMaxWidth(e)):console.warn("AG Grid: error processing tool panel component "+i+". You need to specify either 'toolPanel' or 'toolPanelFramework'")},i.prototype.setToolPanelComponent=function(t){var i=this;this.toolPanelCompInstance=t,this.appendChild(t.getGui()),this.addDestroyFunc((function(){i.destroyBean(t)})),this.width&&(this.getGui().style.width=this.width+"px")},i.prototype.getToolPanelInstance=function(){return this.toolPanelCompInstance},i.prototype.setResizerSizerSide=function(t){var i=this.gridOptionsWrapper.isEnableRtl(),n="left"===t;this.resizeBar.setInverted(i?n:!n)},i.prototype.refresh=function(){this.toolPanelCompInstance.refresh()},i.TEMPLATE='<div class="ag-tool-panel-wrapper"/>',aw([Dt("userComponentFactory")],i.prototype,"userComponentFactory",void 0),aw([Ft],i.prototype,"setupResize",null),i}(io),fw=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),dw=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(t){function i(){var n=t.call(this,i.TEMPLATE)||this;return n.toolPanelWrappers=[],n}fw(i,t),i.prototype.postConstruct=function(){var t=this;this.sideBarButtonsComp.addEventListener(hw.EVENT_SIDE_BAR_BUTTON_CLICKED,this.onToolPanelButtonClicked.bind(this)),this.setSideBarDef(),this.gridOptionsWrapper.addEventListener("sideBar",(function(){t.clearDownUi(),t.setSideBarDef()})),this.gridApi.registerSideBarComp(this),this.createManagedBean(new go(this.getFocusableElement(),{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)}))},i.prototype.onTabKeyDown=function(t){if(!t.defaultPrevented){var i=this.focusService,n=this.sideBarButtonsComp,e=this.getGui(),r=n.getGui(),o=this.gridOptionsWrapper.getDocument().activeElement,s=e.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)");if(s)if(r.contains(o))i.focusInto(s,t.shiftKey)&&t.preventDefault();else if(!i.isFocusUnderManagedComponent(s)&&t.shiftKey){var u=i.findFocusableElements(s)[0];if(this.gridOptionsWrapper.getDocument().activeElement===u){var h=r.querySelector(".ag-selected button");h&&(t.preventDefault(),h.focus())}}}},i.prototype.handleKeyDown=function(t){var i=this.gridOptionsWrapper.getDocument();if(this.sideBarButtonsComp.getGui().contains(i.activeElement)){var n=this.sideBarButtonsComp.getGui(),e=Array.prototype.slice.call(n.querySelectorAll(".ag-side-button")),r=i.activeElement,o=e.findIndex((function(t){return t.contains(r)})),s=null;switch(t.key){case xr.LEFT:case xr.UP:s=Math.max(0,o-1);break;case xr.RIGHT:case xr.DOWN:s=Math.min(o+1,e.length-1)}if(null!==s){var u=e[s].querySelector("button");u&&(u.focus(),t.preventDefault())}}},i.prototype.onToolPanelButtonClicked=function(t){var i=t.toolPanelId,n=this.openedItem();this.openToolPanel(n===i?void 0:i)},i.prototype.clearDownUi=function(){this.sideBarButtonsComp.clearButtons(),this.destroyToolPanelWrappers()},i.prototype.setSideBarDef=function(){this.setDisplayed(!1);var t=this.gridOptionsWrapper.getSideBar(),i=!!t&&!!t.toolPanels;if(i){this.setDisplayed(i&&!t.hiddenByDefault);var n=t.toolPanels;this.sideBarButtonsComp.setToolPanelDefs(n),this.setupToolPanels(n),this.setSideBarPosition(t.position),t.hiddenByDefault||this.openToolPanel(t.defaultToolPanel)}},i.prototype.setSideBarPosition=function(t){t||(t="right");var i="left"===t,n=i?"right":"left";return this.addOrRemoveCssClass("ag-side-bar-left",i),this.addOrRemoveCssClass("ag-side-bar-right",!i),this.toolPanelWrappers.forEach((function(t){t.setResizerSizerSide(n)})),this},i.prototype.setupToolPanels=function(t){var i=this;t.forEach((function(t){if(null!=t.id){if("agColumnsToolPanel"===t.toolPanel&&!Ut.assertRegistered(Nt.ColumnToolPanelModule,"Column Tool Panel"))return;if("agFiltersToolPanel"===t.toolPanel&&!Ut.assertRegistered(Nt.FiltersToolPanelModule,"Filters Tool Panel"))return;var n=new lw;i.getContext().createBean(n),n.setToolPanelDef(t),n.setDisplayed(!1),i.getGui().appendChild(n.getGui()),i.toolPanelWrappers.push(n)}else console.warn("AG Grid: please review all your toolPanel components, it seems like at least one of them doesn't have an id")}))},i.prototype.refresh=function(){this.toolPanelWrappers.forEach((function(t){return t.refresh()}))},i.prototype.openToolPanel=function(t){var i=this.openedItem();i!==t&&(this.toolPanelWrappers.forEach((function(i){var n=t===i.getToolPanelId();i.setDisplayed(n)})),i!==this.openedItem()&&(this.sideBarButtonsComp.setActiveButton(t),this.raiseToolPanelVisibleEvent(t)))},i.prototype.getToolPanelInstance=function(t){var i=this.toolPanelWrappers.filter((function(i){return i.getToolPanelId()===t}))[0];if(i)return i.getToolPanelInstance();console.warn("AG Grid: unable to lookup Tool Panel as invalid key supplied: "+t)},i.prototype.raiseToolPanelVisibleEvent=function(t){this.eventService.dispatchEvent({type:xi.EVENT_TOOL_PANEL_VISIBLE_CHANGED,source:t})},i.prototype.close=function(){this.openToolPanel(void 0)},i.prototype.isToolPanelShowing=function(){return!!this.openedItem()},i.prototype.openedItem=function(){var t=null;return this.toolPanelWrappers.forEach((function(i){i.isDisplayed()&&(t=i.getToolPanelId())})),t},i.prototype.destroyToolPanelWrappers=function(){var t=this;this.toolPanelWrappers.forEach((function(i){Wr.removeFromParent(i.getGui()),t.destroyBean(i)})),this.toolPanelWrappers.length=0},i.prototype.destroy=function(){this.destroyToolPanelWrappers(),t.prototype.destroy.call(this)},i.TEMPLATE='<div class="ag-side-bar ag-unselectable">\n <ag-side-bar-buttons ref="sideBarButtons"></ag-side-bar-buttons>\n </div>',dw([Dt("gridApi")],i.prototype,"gridApi",void 0),dw([Dt("focusService")],i.prototype,"focusService",void 0),dw([no("sideBarButtons")],i.prototype,"sideBarButtonsComp",void 0),dw([Ft],i.prototype,"postConstruct",null)}(io);var vw=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),pw=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.isColGroupDef=function(t){return t&&void 0!==t.children},i.getId=function(t){return i.isColGroupDef(t)?t.groupId:t.colId},i}vw(i,t),i.prototype.createColumnTree=function(t){var i=this,n=[],e=function(t,r){if(i.isColGroupDef(t)){var o=t,s=new hi(o,void 0!==o.groupId?o.groupId:o.headerName,!1,r),u=[];return o.children.forEach((function(t){var i=e(t,r+1);i&&u.push(i)})),s.setChildren(u),s}var h=t,c=i.columnModel.getPrimaryColumn(h.colId?h.colId:h.field);return c||n.push(h),c},r=[];return t.forEach((function(t){var i=e(t,0);i&&r.push(i)})),n.length>0&&console.warn("AG Grid: unable to find grid columns for the supplied colDef(s):",n),r},i.prototype.syncLayoutWithGrid=function(t){var i=this.getLeafPathTrees();t(this.mergeLeafPathTrees(i))},i.prototype.getLeafPathTrees=function(){var t=function(i,n){var e;if(i instanceof hi)if(i.isPadding())e=n;else{var r=Object.assign({},i.getColGroupDef());r.groupId=i.getGroupId(),r.children=[n],e=r}else{var o=Object.assign({},i.getColDef());o.colId=i.getColId(),e=o}var s=i.getOriginalParent();return s?t(s,e):e};return this.columnModel.getAllGridColumns().filter((function(t){var i=t.getColDef();return t.isPrimary()&&!i.showRowGroup})).map((function(i){return t(i,i.getColDef())}))},i.prototype.mergeLeafPathTrees=function(t){for(var i,n,e=this,r=function(t,i){if(!e.isColGroupDef(i))return t;var n=t,o=i;return o.children&&o.groupId&&e.addChildrenToGroup(n,o.groupId,o.children[0])||o.children.forEach((function(t){return r(n,t)})),n},o=[],s=1;s<=t.length;s++){var u=t[s-1],h=t[s];n=h,e.isColGroupDef(i=u)&&e.isColGroupDef(n)&&e.getId(i)===e.getId(n)?t[s]=r(u,h):o.push(u)}return o},i.prototype.addChildrenToGroup=function(t,i,n){var e=this;if(!this.isColGroupDef(t))return!0;var r=t,o=n;if(function(t,i){var n=t.children.map(e.getId),r=Wr.includes(n,e.getId(i)),o=Wr.last(t.children),s=o&&e.getId(o)!==e.getId(i);return r&&s}(r,o))return r.children.push(o),!0;if(r.groupId===i){var s=r.children.map(this.getId);if(!Wr.includes(s,this.getId(o)))return r.children.push(o),!0}return r.children.forEach((function(t){return e.addChildrenToGroup(t,i,n)})),!1},pw([Dt("columnModel")],i.prototype,"columnModel",void 0),i=pw([Pt("toolPanelColDefService")],i)}(Ai);var gw=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(){function t(){}t.prototype.selectAllChildren=function(t,i,n){var e=this.extractAllLeafColumns(t);this.setAllColumns(e,i,n)},t.prototype.setColumn=function(t,i,n){this.setAllColumns([t],i,n)},t.prototype.setAllColumns=function(t,i,n){this.columnModel.isPivotMode()?this.setAllPivot(t,i,n):this.setAllVisible(t,i,n)},t.prototype.extractAllLeafColumns=function(t){var i=[],n=function(t){t.forEach((function(t){t.isPassesFilter()&&(t.isGroup()?n(t.getChildren()):i.push(t.getColumn()))}))};return n(t),i},t.prototype.setAllVisible=function(t,i,n){var e=[];t.forEach((function(t){t.getColDef().lockVisible||t.isVisible()!=i&&e.push({colId:t.getId(),hide:!i})})),e.length>0&&this.columnModel.applyColumnState({state:e},n)},t.prototype.setAllPivot=function(t,i,n){this.gridOptionsWrapper.isFunctionsPassive()?this.setAllPivotPassive(t,i):this.setAllPivotActive(t,i,n)},t.prototype.setAllPivotPassive=function(t,i){var n=this.columnModel.getPivotColumns().slice(),e=this.columnModel.getValueColumns().slice(),r=this.columnModel.getRowGroupColumns().slice(),o=!1,s=!1,u=!1;t.forEach(i?function(t){t.isAnyFunctionActive()||(t.isAllowValue()?(e.push(t),s=!0):t.isAllowRowGroup()?(r.push(t),o=!0):t.isAllowPivot()&&(n.push(t),u=!0))}:function(t){t.isAnyFunctionActive()&&(n.indexOf(t)>=0&&(Wr.removeFromArray(n,t),o=!0),e.indexOf(t)>=0&&(Wr.removeFromArray(e,t),s=!0),r.indexOf(t)>=0&&(Wr.removeFromArray(r,t),u=!0))}),o&&this.eventService.dispatchEvent({type:xi.EVENT_COLUMN_PIVOT_CHANGE_REQUEST,columns:n}),u&&this.eventService.dispatchEvent({type:xi.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST,columns:r}),s&&this.eventService.dispatchEvent({type:xi.EVENT_COLUMN_VALUE_CHANGE_REQUEST,columns:r})},t.prototype.setAllPivotActive=function(t,i,n){var e=this,r=[];t.forEach(i?function(t){if(!t.isAnyFunctionActive())if(t.isAllowValue()){var i="string"==typeof t.getAggFunc()?t.getAggFunc():e.aggFuncService.getDefaultAggFunc(t);r.push({colId:t.getId(),aggFunc:i})}else t.isAllowRowGroup()?r.push({colId:t.getId(),rowGroup:!0}):t.isAllowPivot()&&r.push({colId:t.getId(),pivot:!0})}:function(t){(t.isPivotActive()||t.isRowGroupActive()||t.isValueActive())&&r.push({colId:t.getId(),pivot:!1,rowGroup:!1,aggFunc:null})}),r.length>0&&this.columnModel.applyColumnState({state:r},n)},gw([Dt("aggFuncService")],t.prototype,"aggFuncService",void 0),gw([Dt("columnModel")],t.prototype,"columnModel",void 0),gw([Dt("gridOptionsWrapper")],t.prototype,"gridOptionsWrapper",void 0),gw([Dt("eventService")],t.prototype,"eventService",void 0),t=gw([Pt("modelItemUtils")],t)}();var mw=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),bw=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},ww=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return mw(i,t),i.prototype.hideActiveMenu=function(){this.destroyBean(this.activeMenu)},i.prototype.showMenuAfterMouseEvent=function(t,i,n){var e=this;this.showMenu(t,(function(r){var o=r.getGui();e.popupService.positionPopupUnderMouseEvent({type:"columnMenu",column:t,mouseEvent:i,ePopup:o}),n&&r.showTab(n)}),"columnMenu",n,void 0,i.target)},i.prototype.showMenuAfterButtonClick=function(t,i,n,e,r){var o=this,s=-1,u="left";this.gridOptionsWrapper.isEnableRtl()&&(s=1,u="right"),this.showMenu(t,(function(r){var h=r.getGui();o.popupService.positionPopupUnderComponent({type:n,column:t,eventSource:i,ePopup:h,alignSide:u,nudgeX:9*s,nudgeY:-23,keepWithinBounds:!0}),e&&r.showTab(e)}),n,e,r,i)},i.prototype.showMenu=function(t,i,n,e,r,o){var s=this,u=this.createBean(new yw(t,this.lastSelectedTab,r)),h=u.getGui(),c=this.focusService.getFocusedHeader(),a=this.columnModel.getAllDisplayedColumns().indexOf(t),l=o||this.ctrlsService.getGridBodyCtrl().getGui(),f=[];f.push((function(i){if(s.destroyBean(u),t.setMenuVisible(!1,"contextMenu"),i instanceof KeyboardEvent&&o)if(Wr.isVisible(o)){var n=s.focusService.findTabbableParent(o);n&&(t&&s.headerNavigationService.scrollToColumn(t),n.focus())}else if(c&&-1!==a){var e=s.columnModel.getAllDisplayedColumns(),r=e[a]||Wr.last(e);r&&s.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:c.headerRowIndex,column:r}})}}));var d=this.gridOptionsWrapper.getLocaleTextFunc(),v=this.popupService.addPopup({modal:!0,eChild:h,closeOnEsc:!0,closedCallback:function(t){f.forEach((function(i){return i(t)}))},afterGuiAttached:function(t){return u.afterGuiAttached(Object.assign({},{container:n},t))},positionCallback:function(){return i(u)},anchorToElement:l,ariaLabel:d("ariaLabelColumnMenu","Column Menu")});if(v){var p=v.stopAnchoringPromise;p&&p.then((function(i){t.addEventListener(qt.EVENT_LEFT_CHANGED,i),t.addEventListener(qt.EVENT_VISIBLE_CHANGED,i),f.push((function(){t.removeEventListener(qt.EVENT_LEFT_CHANGED,i),t.removeEventListener(qt.EVENT_VISIBLE_CHANGED,i)}))}))}e||(u.showTabBasedOnPreviousSelection(),i(u)),u.addEventListener(yw.EVENT_TAB_SELECTED,(function(t){s.lastSelectedTab=t.key})),t.setMenuVisible(!0,"contextMenu"),this.activeMenu=u,u.addEventListener(Ai.EVENT_DESTROYED,(function(){s.activeMenu===u&&(s.activeMenu=null)}))},i.prototype.isMenuEnabled=function(t){return t.getMenuTabs(yw.TABS_DEFAULT).length>0},bw([Dt("popupService")],i.prototype,"popupService",void 0),bw([Dt("focusService")],i.prototype,"focusService",void 0),bw([Dt("headerNavigationService")],i.prototype,"headerNavigationService",void 0),bw([Dt("ctrlsService")],i.prototype,"ctrlsService",void 0),bw([Dt("columnModel")],i.prototype,"columnModel",void 0),bw([Pt("menuFactory")],i)}(Ai),yw=function(t){function i(n,e,r){var o=t.call(this)||this;return o.tabFactories={},o.includeChecks={},o.column=n,o.initialSelection=e,o.tabFactories[i.TAB_GENERAL]=o.createMainPanel.bind(o),o.tabFactories[i.TAB_FILTER]=o.createFilterPanel.bind(o),o.tabFactories[i.TAB_COLUMNS]=o.createColumnsPanel.bind(o),o.includeChecks[i.TAB_GENERAL]=function(){return!0},o.includeChecks[i.TAB_FILTER]=function(){return n.isFilterAllowed()},o.includeChecks[i.TAB_COLUMNS]=function(){return!0},o.restrictTo=r,o}return mw(i,t),i.prototype.init=function(){var t=this,i=this.getTabsToCreate().map((function(i){return t.createTab(i)}));this.tabbedLayout=new jl({items:i,cssClass:"ag-menu",onActiveItemClicked:this.onHidePopup.bind(this),onItemClicked:this.onTabItemClicked.bind(this)}),this.createBean(this.tabbedLayout),this.mainMenuList&&this.mainMenuList.setParentComponent(this.tabbedLayout)},i.prototype.getTabsToCreate=function(){var t=this;return this.restrictTo?this.restrictTo:this.column.getMenuTabs(i.TABS_DEFAULT).filter((function(i){return t.isValidMenuTabItem(i)})).filter((function(i){return t.isNotSuppressed(i)})).filter((function(i){return t.isModuleLoaded(i)}))},i.prototype.isModuleLoaded=function(t){return t!==i.TAB_COLUMNS||Ut.isRegistered(Nt.ColumnToolPanelModule)},i.prototype.isValidMenuTabItem=function(t){var n=!0,e=i.TABS_DEFAULT;return null!=this.restrictTo&&(n=this.restrictTo.indexOf(t)>-1,e=this.restrictTo),(n=n&&i.TABS_DEFAULT.indexOf(t)>-1)||console.warn("AG Grid: Trying to render an invalid menu item '"+t+"'. Check that your 'menuTabs' contains one of ["+e+"]"),n},i.prototype.isNotSuppressed=function(t){return this.includeChecks[t]()},i.prototype.createTab=function(t){return this.tabFactories[t]()},i.prototype.showTabBasedOnPreviousSelection=function(){this.showTab(this.initialSelection)},i.prototype.showTab=function(t){this.tabItemColumns&&t===i.TAB_COLUMNS?this.tabbedLayout.showItem(this.tabItemColumns):this.tabItemFilter&&t===i.TAB_FILTER?this.tabbedLayout.showItem(this.tabItemFilter):this.tabItemGeneral&&t===i.TAB_GENERAL?this.tabbedLayout.showItem(this.tabItemGeneral):this.tabbedLayout.showFirstItem()},i.prototype.onTabItemClicked=function(t){var n=null;switch(t.item){case this.tabItemColumns:n=i.TAB_COLUMNS;break;case this.tabItemFilter:n=i.TAB_FILTER;break;case this.tabItemGeneral:n=i.TAB_GENERAL}n&&this.activateTab(n)},i.prototype.activateTab=function(t){this.dispatchEvent({type:i.EVENT_TAB_SELECTED,key:t})},i.prototype.getMenuItems=function(){var t,n=this.getDefaultMenuOptions(),e=this.gridOptionsWrapper.getMainMenuItemsFunc();return t=e?e({column:this.column,defaultItems:n}):n,Wr.removeRepeatsFromArray(t,i.MENU_ITEM_SEPARATOR),t},i.prototype.getDefaultMenuOptions=function(){var t=[],n=!this.column.getColDef().lockPinned,e=this.columnModel.getRowGroupColumns().length,r=e>0,o=this.columnModel.getRowGroupColumns().indexOf(this.column)>=0,s=this.column.isAllowValue(),u=this.column.isAllowRowGroup(),h=this.column.isPrimary(),c=this.columnModel.isPivotMode(),a=this.rowModel.getType()===Vt.ROW_MODEL_TYPE_CLIENT_SIDE,l=this.gridOptionsWrapper.isTreeData(),f=h&&r&&s||!h;return n&&t.push("pinSubMenu"),f&&t.push("valueAggSubMenu"),(n||f)&&t.push(i.MENU_ITEM_SEPARATOR),t.push("autoSizeThis"),t.push("autoSizeAll"),t.push(i.MENU_ITEM_SEPARATOR),u&&this.column.isPrimary()&&t.push(o?"rowUnGroup":"rowGroup"),t.push(i.MENU_ITEM_SEPARATOR),t.push("resetColumns"),a&&(l||e>(c?1:0))&&(t.push("expandAll"),t.push("contractAll")),t},i.prototype.createMainPanel=function(){this.mainMenuList=this.createManagedBean(new ed);var t=this.getMenuItems(),n=this.menuItemMapper.mapWithStockItems(t,this.column);return this.mainMenuList.addMenuItems(n),this.mainMenuList.addEventListener(hd.EVENT_MENU_ITEM_SELECTED,this.onHidePopup.bind(this)),this.tabItemGeneral={title:Wr.createIconNoSpan("menu",this.gridOptionsWrapper,this.column),titleLabel:i.TAB_GENERAL.replace("MenuTab",""),bodyPromise:Kr.resolve(this.mainMenuList.getGui()),name:i.TAB_GENERAL},this.tabItemGeneral},i.prototype.onHidePopup=function(t){var i;t&&t.event&&t.event instanceof KeyboardEvent&&(i=t.event),this.hidePopupFunc(i&&{keyboardEvent:i});var n=this.focusService.getFocusedCell(),e=this.gridOptionsWrapper.getDocument();e.activeElement===e.body&&n&&this.focusService.setFocusedCell({rowIndex:n.rowIndex,column:n.column,rowPinned:n.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})},i.prototype.createFilterPanel=function(){var t,n=this.filterManager.getOrCreateFilterWrapper(this.column,"COLUMN_MENU");if(!n)throw new Error("AG Grid - Unable to instantiate filter");return this.tabItemFilter={title:Wr.createIconNoSpan("filter",this.gridOptionsWrapper,this.column),titleLabel:i.TAB_FILTER.replace("MenuTab",""),bodyPromise:null===(t=n)||void 0===t?void 0:t.guiPromise,afterAttachedCallback:function(t){var i;(null===(i=n)||void 0===i?void 0:i.filterPromise)&&n.filterPromise.then((function(i){i&&i.afterGuiAttached&&i.afterGuiAttached(t)}))},name:i.TAB_FILTER},this.tabItemFilter},i.prototype.createColumnsPanel=function(){var t=document.createElement("div");t.classList.add("ag-menu-column-select-wrapper"),this.columnSelectPanel=this.createManagedBean(new Jb);var n=this.column.getColDef().columnsMenuParams;n||(n={}),this.columnSelectPanel.init(!1,{suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!n.contractColumnSelection,suppressColumnExpandAll:!!n.suppressColumnExpandAll,suppressColumnFilter:!!n.suppressColumnFilter,suppressColumnSelectAll:!!n.suppressColumnSelectAll,suppressSyncLayoutWithGrid:!!n.suppressSyncLayoutWithGrid,api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsWrapper.getContext()},"columnMenu");var e=this.columnSelectPanel.getGui();return e.classList.add("ag-menu-column-select"),t.appendChild(e),this.tabItemColumns={title:Wr.createIconNoSpan("columns",this.gridOptionsWrapper,this.column),titleLabel:i.TAB_COLUMNS.replace("MenuTab",""),bodyPromise:Kr.resolve(t),name:i.TAB_COLUMNS},this.tabItemColumns},i.prototype.afterGuiAttached=function(t){var i=t.hidePopup;this.tabbedLayout.setAfterAttachedParams({container:t.container,hidePopup:i}),i&&(this.hidePopupFunc=i,this.addDestroyFunc(i))},i.prototype.getGui=function(){return this.tabbedLayout.getGui()},i.EVENT_TAB_SELECTED="tabSelected",i.TAB_FILTER="filterMenuTab",i.TABS_DEFAULT=[i.TAB_GENERAL="generalMenuTab",i.TAB_FILTER,i.TAB_COLUMNS="columnsMenuTab"],i.MENU_ITEM_SEPARATOR="separator",bw([Dt("columnModel")],i.prototype,"columnModel",void 0),bw([Dt("filterManager")],i.prototype,"filterManager",void 0),bw([Dt("gridApi")],i.prototype,"gridApi",void 0),bw([Dt("columnApi")],i.prototype,"columnApi",void 0),bw([Dt("menuItemMapper")],i.prototype,"menuItemMapper",void 0),bw([Dt("rowModel")],i.prototype,"rowModel",void 0),bw([Dt("focusService")],i.prototype,"focusService",void 0),bw([Ft],i.prototype,"init",null),i}(Ai),Cw=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Sw=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Rw="ag-context-menu-open",Ow=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Cw(i,t),i.prototype.hideActiveMenu=function(){this.destroyBean(this.activeMenu)},i.prototype.getMenuItems=function(t,i,n){var e=[];if(Wr.exists(t)&&Ut.isRegistered(Nt.ClipboardModule)&&i&&e.push("copy","copyWithHeaders","copyWithGroupHeaders","paste","separator"),this.gridOptionsWrapper.isEnableCharts()&&Ut.isRegistered(Nt.RangeSelectionModule)&&Ut.isRegistered(Nt.GridChartsModule)&&(this.columnModel.isPivotMode()&&e.push("pivotChart"),this.rangeService&&!this.rangeService.isEmpty()&&e.push("chartRange")),Wr.exists(t)){var r=!Ut.isRegistered(Nt.CsvExportModule),o=!Ut.isRegistered(Nt.ExcelExportModule),s=this.gridOptionsWrapper.isSuppressExcelExport()||o,u=this.gridOptionsWrapper.isSuppressCsvExport()||r;!(Wr.isIOSUserAgent()||s&&u)&&e.push("export")}if(this.gridOptionsWrapper.getContextMenuItemsFunc()){var h=this.gridOptionsWrapper.getContextMenuItemsFunc();return h?h({node:t,column:i,value:n,defaultItems:e.length?e:void 0}):void 0}return e},i.prototype.onContextMenu=function(t,i,n,e,r,o){!this.gridOptionsWrapper.isAllowContextMenuWithControlKey()&&t&&(t.ctrlKey||t.metaKey)||(t&&this.blockMiddleClickScrollsIfNeeded(t),this.gridOptionsWrapper.isSuppressContextMenu()||this.showMenu(n,e,r,t||i.touches[0],o)&&(t||i).preventDefault())},i.prototype.blockMiddleClickScrollsIfNeeded=function(t){var i=t.which;this.gridOptionsWrapper.isSuppressMiddleClickScrolls()&&2===i&&t.preventDefault()},i.prototype.showMenu=function(t,i,n,e,r){var o=this,s=this.getMenuItems(t,i,n),u=this.ctrlsService.getGridBodyCtrl().getGui();if(void 0===s||Wr.missingOrEmpty(s))return!1;var h=new Aw(s);this.createBean(h);var c=h.getGui(),a={column:i,rowNode:t,type:"contextMenu",mouseEvent:e,ePopup:c,nudgeY:1},l=this.gridOptionsWrapper.getLocaleTextFunc(),f=this.popupService.addPopup({modal:!0,eChild:c,closeOnEsc:!0,closedCallback:function(){u.classList.remove(Rw),o.destroyBean(h)},click:e,positionCallback:function(){o.popupService.positionPopupUnderMouseEvent(Object.assign({},{nudgeX:o.gridOptionsWrapper.isEnableRtl()?-1*(c.offsetWidth+1):1},a))},anchorToElement:r,ariaLabel:l("ariaLabelContextMenu","Context Menu")});return f&&(u.classList.add(Rw),h.afterGuiAttached({container:"contextMenu",hidePopup:f.hideFunc})),this.activeMenu&&this.hideActiveMenu(),this.activeMenu=h,h.addEventListener(Ai.EVENT_DESTROYED,(function(){o.activeMenu===h&&(o.activeMenu=null)})),f&&h.addEventListener(hd.EVENT_MENU_ITEM_SELECTED,f.hideFunc),!0},Sw([Dt("popupService")],i.prototype,"popupService",void 0),Sw([It("rangeService")],i.prototype,"rangeService",void 0),Sw([Dt("ctrlsService")],i.prototype,"ctrlsService",void 0),Sw([Dt("columnModel")],i.prototype,"columnModel",void 0),Sw([Pt("contextMenuFactory")],i)}(Ai),Aw=function(t){function i(i){var n=t.call(this,'<div class="ag-menu" role="presentation"></div>')||this;return n.menuList=null,n.focusedCell=null,n.menuItems=i,n}return Cw(i,t),i.prototype.addMenuItems=function(){var t=this,i=this.createManagedBean(new ed),n=this.menuItemMapper.mapWithStockItems(this.menuItems,null);i.addMenuItems(n),this.appendChild(i),this.menuList=i,i.addEventListener(hd.EVENT_MENU_ITEM_SELECTED,(function(i){return t.dispatchEvent(i)}))},i.prototype.afterGuiAttached=function(t){t.hidePopup&&this.addDestroyFunc(t.hidePopup),this.focusedCell=this.focusService.getFocusedCell(),this.menuList&&this.focusService.focusInto(this.menuList.getGui())},i.prototype.restoreFocusedCell=function(){var t=this.focusService.getFocusedCell();if(t&&this.focusedCell&&this.cellPositionUtils.equals(t,this.focusedCell)){var i=this.focusedCell,n=i.rowIndex,e=i.rowPinned,r=i.column,o=this.gridOptionsWrapper.getDocument();o.activeElement===o.body&&this.focusService.setFocusedCell({rowIndex:n,column:r,rowPinned:e,forceBrowserFocus:!0})}},i.prototype.destroy=function(){this.restoreFocusedCell(),t.prototype.destroy.call(this)},Sw([Dt("menuItemMapper")],i.prototype,"menuItemMapper",void 0),Sw([Dt("focusService")],i.prototype,"focusService",void 0),Sw([Dt("cellPositionUtils")],i.prototype,"cellPositionUtils",void 0),Sw([Ft],i.prototype,"addMenuItems",null),i}(io),jw=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),_w=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Gw=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return jw(i,t),i.prototype.mapWithStockItems=function(t,i){var n=this;if(!t)return[];var e=[];return t.forEach((function(t){var r;if(r="string"==typeof t?n.getStockMenuItem(t,i):t){var o=r.subMenu;o&&o instanceof Array&&(r.subMenu=n.mapWithStockItems(r.subMenu,i)),null!=r&&e.push(r)}})),e},i.prototype.getStockMenuItem=function(t,i){var n=this,e=this.gridOptionsWrapper.getLocaleTextFunc(),r=this.gridOptionsWrapper.isSkipHeaderOnAutoSize();switch(t){case"pinSubMenu":return{name:e("pinColumn","Pin Column"),icon:Wr.createIconNoSpan("menuPin",this.gridOptionsWrapper,null),subMenu:["pinLeft","pinRight","clearPinned"]};case"pinLeft":return{name:e("pinLeft","Pin Left"),action:function(){return n.columnModel.setColumnPinned(i,Vt.PINNED_LEFT,"contextMenu")},checked:!!i&&i.isPinnedLeft()};case"pinRight":return{name:e("pinRight","Pin Right"),action:function(){return n.columnModel.setColumnPinned(i,Vt.PINNED_RIGHT,"contextMenu")},checked:!!i&&i.isPinnedRight()};case"clearPinned":return{name:e("noPin","No Pin"),action:function(){return n.columnModel.setColumnPinned(i,null,"contextMenu")},checked:!!i&&!i.isPinned()};case"valueAggSubMenu":return Ut.assertRegistered(Nt.RowGroupingModule,"Aggregation from Menu")?{name:e("valueAggregation","Value Aggregation"),icon:Wr.createIconNoSpan("menuValue",this.gridOptionsWrapper,null),subMenu:this.createAggregationSubMenu(i)}:null;case"autoSizeThis":return{name:e("autosizeThiscolumn","Autosize This Column"),action:function(){return n.columnModel.autoSizeColumn(i,r,"contextMenu")}};case"autoSizeAll":return{name:e("autosizeAllColumns","Autosize All Columns"),action:function(){return n.columnModel.autoSizeAllColumns(r,"contextMenu")}};case"rowGroup":return{name:e("groupBy","Group by")+" "+Wr.escapeString(this.columnModel.getDisplayNameForColumn(i,"header")),action:function(){return n.columnModel.addRowGroupColumn(i,"contextMenu")},icon:Wr.createIconNoSpan("menuAddRowGroup",this.gridOptionsWrapper,null)};case"rowUnGroup":return{name:e("ungroupBy","Un-Group by")+" "+Wr.escapeString(this.columnModel.getDisplayNameForColumn(i,"header")),action:function(){return n.columnModel.removeRowGroupColumn(i,"contextMenu")},icon:Wr.createIconNoSpan("menuRemoveRowGroup",this.gridOptionsWrapper,null)};case"resetColumns":return{name:e("resetColumns","Reset Columns"),action:function(){return n.columnModel.resetColumnState("contextMenu")}};case"expandAll":return{name:e("expandAll","Expand All"),action:function(){return n.gridApi.expandAll()}};case"contractAll":return{name:e("collapseAll","Collapse All"),action:function(){return n.gridApi.collapseAll()}};case"copy":return Ut.assertRegistered(Nt.ClipboardModule,"Copy from Menu")?{name:e("copy","Copy"),shortcut:e("ctrlC","Ctrl+C"),icon:Wr.createIconNoSpan("clipboardCopy",this.gridOptionsWrapper,null),action:function(){return n.clipboardService.copyToClipboard()}}:null;case"copyWithHeaders":return Ut.assertRegistered(Nt.ClipboardModule,"Copy with Headers from Menu")?{name:e("copyWithHeaders","Copy with Headers"),icon:Wr.createIconNoSpan("clipboardCopy",this.gridOptionsWrapper,null),action:function(){return n.clipboardService.copyToClipboard({includeHeaders:!0})}}:null;case"copyWithGroupHeaders":return Ut.assertRegistered(Nt.ClipboardModule,"Copy with Group Headers from Menu")?{name:e("copyWithGroupHeaders","Copy with Group Headers"),icon:Wr.createIconNoSpan("clipboardCopy",this.gridOptionsWrapper,null),action:function(){return n.clipboardService.copyToClipboard({includeHeaders:!0,includeGroupHeaders:!0})}}:null;case"paste":return Ut.assertRegistered(Nt.ClipboardModule,"Paste from Clipboard")?{name:e("paste","Paste"),shortcut:e("ctrlV","Ctrl+V"),disabled:!0,icon:Wr.createIconNoSpan("clipboardPaste",this.gridOptionsWrapper,null),action:function(){return n.clipboardService.pasteFromClipboard()}}:null;case"export":var o=[],s=Ut.isRegistered(Nt.CsvExportModule),u=Ut.isRegistered(Nt.ExcelExportModule);return!this.gridOptionsWrapper.isSuppressCsvExport()&&s&&o.push("csvExport"),!this.gridOptionsWrapper.isSuppressExcelExport()&&u&&o.push("excelExport"),{name:e("export","Export"),subMenu:o,icon:Wr.createIconNoSpan("save",this.gridOptionsWrapper,null)};case"csvExport":return{name:e("csvExport","CSV Export"),icon:Wr.createIconNoSpan("csvExport",this.gridOptionsWrapper,null),action:function(){return n.gridApi.exportDataAsCsv({})}};case"excelExport":return{name:e("excelExport","Excel Export"),icon:Wr.createIconNoSpan("excelExport",this.gridOptionsWrapper,null),action:function(){return n.gridApi.exportDataAsExcel()}};case"separator":return"separator";default:return this.getChartItems(t)||(console.warn("AG Grid: unknown menu item type "+t),null)}},i.prototype.getChartItems=function(t){var i=this,n=this.gridOptionsWrapper.getLocaleTextFunc(),e=function(t,e,r){return{name:n(t,e),action:function(){return i.chartService.createPivotChart({chartType:r})}}},r=function(t,e,r){return{name:n(t,e),action:function(){return i.chartService.createChartFromCurrentRange(r)}}};switch(t){case"pivotChart":return{name:n("pivotChart","Pivot Chart"),subMenu:["pivotColumnChart","pivotBarChart","pivotPieChart","pivotLineChart","pivotXYChart","pivotAreaChart"],icon:Wr.createIconNoSpan("chart",this.gridOptionsWrapper,null)};case"chartRange":return{name:n("chartRange","Chart Range"),subMenu:["rangeColumnChart","rangeBarChart","rangePieChart","rangeLineChart","rangeXYChart","rangeAreaChart","rangeHistogramChart","rangeCombinationChart"],icon:Wr.createIconNoSpan("chart",this.gridOptionsWrapper,null)};case"pivotColumnChart":return{name:n("columnChart","Column"),subMenu:["pivotGroupedColumn","pivotStackedColumn","pivotNormalizedColumn"]};case"pivotGroupedColumn":return e("groupedColumn","Grouped&lrm;","groupedColumn");case"pivotStackedColumn":return e("stackedColumn","Stacked&lrm;","stackedColumn");case"pivotNormalizedColumn":return e("normalizedColumn","100% Stacked&lrm;","normalizedColumn");case"rangeColumnChart":return{name:n("columnChart","Column"),subMenu:["rangeGroupedColumn","rangeStackedColumn","rangeNormalizedColumn"]};case"rangeGroupedColumn":return r("groupedColumn","Grouped&lrm;","groupedColumn");case"rangeStackedColumn":return r("stackedColumn","Stacked&lrm;","stackedColumn");case"rangeNormalizedColumn":return r("normalizedColumn","100% Stacked&lrm;","normalizedColumn");case"pivotBarChart":return{name:n("barChart","Bar"),subMenu:["pivotGroupedBar","pivotStackedBar","pivotNormalizedBar"]};case"pivotGroupedBar":return e("groupedBar","Grouped&lrm;","groupedBar");case"pivotStackedBar":return e("stackedBar","Stacked&lrm;","stackedBar");case"pivotNormalizedBar":return e("normalizedBar","100% Stacked&lrm;","normalizedBar");case"rangeBarChart":return{name:n("barChart","Bar"),subMenu:["rangeGroupedBar","rangeStackedBar","rangeNormalizedBar"]};case"rangeGroupedBar":return r("groupedBar","Grouped&lrm;","groupedBar");case"rangeStackedBar":return r("stackedBar","Stacked&lrm;","stackedBar");case"rangeNormalizedBar":return r("normalizedBar","100% Stacked&lrm;","normalizedBar");case"pivotPieChart":return{name:n("pieChart","Pie"),subMenu:["pivotPie","pivotDoughnut"]};case"pivotPie":return e("pie","Pie&lrm;","pie");case"pivotDoughnut":return e("doughnut","Doughnut&lrm;","doughnut");case"rangePieChart":return{name:n("pieChart","Pie"),subMenu:["rangePie","rangeDoughnut"]};case"rangePie":return r("pie","Pie&lrm;","pie");case"rangeDoughnut":return r("doughnut","Doughnut&lrm;","doughnut");case"pivotLineChart":return e("line","Line&lrm;","line");case"rangeLineChart":return r("line","Line&lrm;","line");case"pivotXYChart":return{name:n("xyChart","X Y (Scatter)"),subMenu:["pivotScatter","pivotBubble"]};case"pivotScatter":return e("scatter","Scatter&lrm;","scatter");case"pivotBubble":return e("bubble","Bubble&lrm;","bubble");case"rangeXYChart":return{name:n("xyChart","X Y (Scatter)"),subMenu:["rangeScatter","rangeBubble"]};case"rangeScatter":return r("scatter","Scatter&lrm;","scatter");case"rangeBubble":return r("bubble","Bubble&lrm;","bubble");case"pivotAreaChart":return{name:n("areaChart","Area"),subMenu:["pivotArea","pivotStackedArea","pivotNormalizedArea"]};case"pivotArea":return e("area","Area&lrm;","area");case"pivotStackedArea":return e("stackedArea","Stacked&lrm;","stackedArea");case"pivotNormalizedArea":return e("normalizedArea","100% Stacked&lrm;","normalizedArea");case"rangeAreaChart":return{name:n("areaChart","Area"),subMenu:["rangeArea","rangeStackedArea","rangeNormalizedArea"]};case"rangeArea":return r("area","Area&lrm;","area");case"rangeStackedArea":return r("stackedArea","Stacked&lrm;","stackedArea");case"rangeNormalizedArea":return r("normalizedArea","100% Stacked&lrm;","normalizedArea");case"rangeHistogramChart":return r("histogramChart","Histogram&lrm;","histogram");case"rangeColumnLineCombo":return r("columnLineCombo","Column & Line&lrm;","columnLineCombo");case"rangeAreaColumnCombo":return r("AreaColumnCombo","Area & Column&lrm;","areaColumnCombo");case"rangeCombinationChart":return{name:n("combinationChart","Combination"),subMenu:["rangeColumnLineCombo","rangeAreaColumnCombo"]};default:return null}},i.prototype.createAggregationSubMenu=function(t){var i,n=this,e=this.gridOptionsWrapper.getLocaleTextFunc();if(t.isPrimary())i=t;else{var r=t.getColDef().pivotValueColumn;i=Wr.exists(r)?r:void 0}var o=[];if(i){var s=i.isValueActive();this.aggFuncService.getFuncNames(i).forEach((function(t){o.push({name:e(t,t),action:function(){n.columnModel.setColumnAggFunc(i,t,"contextMenu"),n.columnModel.addValueColumn(i,"contextMenu")},checked:s&&i.getAggFunc()===t})}))}return o},_w([Dt("columnModel")],i.prototype,"columnModel",void 0),_w([Dt("gridApi")],i.prototype,"gridApi",void 0),_w([It("clipboardService")],i.prototype,"clipboardService",void 0),_w([It("aggFuncService")],i.prototype,"aggFuncService",void 0),_w([It("chartService")],i.prototype,"chartService",void 0),_w([Pt("menuItemMapper")],i)}(Ai),xw={moduleName:Nt.MenuModule,beans:[ww,Ow,Gw],dependantModules:[Kp]};function Mw(){const t=["2909523kXwted","CompanyName=Sankhya Jiva Tecnologia e Inovao Ltda,LicensedApplication=Sankhya Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869","1131048CARoeW","502909mLEPmu","447255iQEXuN","428UHbJwW","270AFTxAV","194369jhGqTI","1540nWuTrj","2044062GicUQI","30CkXPWg"];return(Mw=function(){return t})()}const Fw=kw;function kw(t,i){const n=Mw();return(kw=function(t){return n[t-=392]})(t,i)}!function(){const t=kw,i=Mw();for(;;)try{if(951926==-parseInt(t(398))/1+-parseInt(t(393))/2+parseInt(t(395))/3+-parseInt(t(400))/4*(parseInt(t(392))/5)+-parseInt(t(401))/6*(-parseInt(t(402))/7)+parseInt(t(397))/8+-parseInt(t(399))/9*(-parseInt(t(394))/10))break;i.push(i.shift())}catch(t){i.push(i.shift())}}();const Pw=Fw(396);class Dw{configFilterColumn(t){this._filterColumn=t,this._filterColumn.addEventListener("applyFilterColumnOptions",this.handleFilteredColumnsChanged.bind(this))}handleFilteredColumnsChanged(t){const i=t.detail;this._filteredColumns.set(i.field,i.values),this._gridOptions.api.refreshHeader(),this._dataUnit.loadData(void 0,void 0,void 0,B)}clearFilter(){this._filteredColumns.clear(),this._gridOptions.api.refreshHeader()}showFilterColumn(t){var i;const n=this.resolveDescriptionColMetadata(t.columnName);null===(i=this._filterColumn)||void 0===i||i.show(Object.assign(Object.assign({},t),{fieldDescriptor:n}))}constructor(t){this.DEFAULT_ROW_HEIGHT=30,this.DEFAULT_HEADER_ROW_HEIGHT=32,this.CHECK_BOX_COL_ID="checkBoxColumn",this.STATUS_COL_ID="statusColumn",this.RECORD_ARCHIVE_COL_ID="__RECORD_ARCHIVE__",this.BLOCK_LOAD_DEBOUNCE=100,this.DEFAULT_FONT_SIZE=14,this.DEFAULT_FONT_SIZE_HTML5=32,this.DEFAULT_ICON_SIZE=12,this.DEFAULT_MAX_SIZE=200,this._menuItems=[],this._idAttribName="__record__id__",this._gridConfig=[],this._filteredColumns=new Map,this._filterColumnleftPosition=0,this._customFormatters=new Map,this._gridShowDom=!1,this.peddingExecutionsOnGridShow=[],this._lastColsConfig=void 0,Ut.registerModules([Kp,Fg,gm,Pm,xw])}getGridConfig(){return this._gridConfig}locateColumn(t,i){this._gridOptions.api.ensureColumnVisible(t),requestAnimationFrame((()=>{this.highlightColumnHeader(t,i)}))}highlightColumnHeader(t,i){const n=i.querySelector(`.ag-header-cell[col-id="${t}"]`);if(!n)return;n.classList.add("ez-grid__column-highlight-header"),n.setAttribute("tabindex","0");const e=t=>{n.contains(t.target)||(n.classList.remove("ez-grid__column-highlight-header"),document.removeEventListener("click",e))};document.addEventListener("click",e)}getSort(t,i){const n=[];return this._gridOptions.columnApi.getColumnState().sort(((t,i)=>t.sortIndex-i.sortIndex)).forEach((({colId:t,sort:i})=>{if(i){const e=this._dataUnit.getField(t),r="asc"===i?m.ASC:m.DESC;n.push(e?{field:e.name,dataType:e.dataType,mode:r}:{field:t,dataType:v.TEXT,mode:r})}})),0===n.length&&void 0===this._gridConfig?i:n}getFilter(){if(this._filteredColumns&&0!==this._filteredColumns.size)return Array.from(this._filteredColumns.entries()).map((([t,i])=>{var n;const e=i.filter((t=>t.check));if(e.length>0){let i=t;const r=this.getCodeColFromDescriptionCol(t);l.isEmpty(r)||(i=r);const o=this._dataUnit.getField(i),s=null!==(n=null==o?void 0:o.dataType)&&void 0!==n?n:v.TEXT;let u="";const h=[];let c;return e.forEach((t=>{const n=`PARAM_${i}_${h.length+1}`;h.push({dataType:s===v.OBJECT?v.TEXT:s,name:n,value:t.value}),null==t.value?c=!0:(u.length>0&&(u+=","),u=`${u}:${n}`)})),{name:`${L}${i}`,expression:this.getExpression(s,i,u,c),params:h}}})).filter((t=>null!=t))}getExpression(t,i,n,e){const r=t===v.DATE?`onlydate(this.${i})`:`this.${i}`;return n.length>0&&e?`(${r} in (${n}) OR ${i} IS NULL)`:e?`${i} IS NULL`:`${r} in (${n})`}initDatagrid(t,i){var n;this._options=i,this._container=t;const e=(null==i?void 0:i.enableLockManagerTaskbarClick)?null==f?void 0:f.addLockManagerCtxId(this._container):null;let r;if(null==i?void 0:i.enableLockManagerLoadingComp){const t=null==f?void 0:f.addLockManagerCtxId(this._container);r=null==f?void 0:f.lock(t,d.APP_LOADING)}if(void 0===this._grid){Np.setLicenseKey(Pw),this._i18n=i.i18n,this._columnStateChangeCallback=i.onColumnStateChange,this._selectionChangeCallback=i.onSelectionChange,this._doubleClickCallBack=i.onDoubleClick,this._multipleSelection=i.allowMultipleSelection,this._dataUnit=i.dataUnit,this._editionManager=new ag(this._dataUnit,i.useEnterLikeTab,i.recordsValidator,i.editionIsDisabled,i.customEditors||this._customEditors,i.customRenders||this._customRenders,i.enableContinuousInsert,i.enableGridInsert,e),this._statusResolver=i.statusResolver,this._dataUnit&&(this._dataUnit.sortingProvider=this,this._dataUnit.addFilterProvider(this)),this._gridOptions={suppressHorizontalScroll:i.suppressHorizontalScroll,localeText:(o=this._options.i18n,{page:o("ez-grid.pageLabel"),more:o("ez-grid.remainingPageLabel"),to:o("ez-grid.remainingTotalLabel"),of:o("ez-grid.remainingTotalLabel"),next:o("ez-grid.nextPage"),previous:o("ez-grid.previousPage"),loadingOoo:o("app.loading"),noRowsToShow:o("ez-grid.noRowsToShow"),pinColumn:o("ez-grid.pinColumn"),unpinColumn:o("ez-grid.unpinColumn"),filterOoo:o("ez-grid.filter"),sortAscending:o("ez-grid.sortAscending"),sortDescending:o("ez-grid.sortDescending"),last:o("ez-grid.last"),first:o("ez-grid.first"),selectAll:o("ez-grid.selectAll"),searchOoo:o("ez-grid.searchOoo"),blanks:o("ez-grid.blanks"),applyFilter:o("ez-grid.applyFilter"),equals:o("ez-grid.equals"),lessThan:o("ez-grid.lessThan"),greaterThan:o("ez-grid.greaterThan"),contains:o("ez-grid.contains"),startsWith:o("ez-grid.startsWith"),endsWith:o("ez-grid.endsWith"),group:o("ez-grid.group"),columns:o("ez-grid.columns"),rowGroupColumns:o("ez-grid.rowGroupColumns"),rowGroupColumnsEmptyMessage:o("ez-grid.rowGroupColumnsEmptyMessage"),valueColumns:o("ez-grid.valueColumns"),pivotMode:o("ez-grid.pivotMode"),groups:o("ez-grid.groups"),values:o("ez-grid.values"),pivots:o("ez-grid.pivots"),valueColumnsEmptyMessage:o("ez-grid.valueColumnsEmptyMessage"),pivotColumnsEmptyMessage:o("ez-grid.pivotColumnsEmptyMessage"),toolPanelButton:o("ez-grid.toolPanelButton"),valueAggregation:o("ez-grid.valueAggregation"),autosizeThiscolumn:o("ez-grid.autosizeThiscolumn"),autosizeAllColumns:o("ez-grid.autosizeAllColumns"),groupBy:o("ez-grid.groupBy"),ungroupBy:o("ez-grid.ungroupBy"),resetColumns:o("ez-grid.resetColumns"),expandAll:o("ez-grid.expandAll"),collapseAll:o("ez-grid.collapseAll"),toolPanel:o("ez-grid.toolPanel"),export:o("ez-grid.export"),csvExport:o("ez-grid.csvExport"),excelExport:o("ez-grid.excelExport"),pinLeft:o("ez-grid.pinLeft"),pinRight:o("ez-grid.pinRight"),noPin:o("ez-grid.noPin"),sum:o("ez-grid.sum"),min:o("ez-grid.min"),max:o("ez-grid.max"),none:o("ez-grid.none"),count:o("ez-grid.count"),average:o("ez-grid.average"),copy:o("ez-grid.copy"),copyWithHeaders:o("ez-grid.copyWithHeaders"),copyWithGroupHeaders:o("ez-grid.copyWithGroupHeaders"),ctrlC:o("ez-grid.ctrlC"),paste:o("ez-grid.paste"),ctrlV:o("ez-grid.ctrlV")}),enableRangeSelection:this._multipleSelection,rowSelection:this._multipleSelection?"multiple":"single",sortingOrder:["desc","asc",null],blockLoadDebounceMillis:this.BLOCK_LOAD_DEBOUNCE,navigateToNextCell:this.navigateToNextCell.bind(this),getRowNodeId:this._dataUnit?t=>"string"==typeof t?t:t[this._idAttribName]:void 0,getMainMenuItems:t=>this.buildMenuItemOptions(t),postProcessPopup:t=>this.setFilterColumnLeftPosition(t),getRowHeight:this.getRowHeight.bind(this),defaultColDef:{headerClass:"ez-grid__cell-header",cellClass:"ez-grid__cell-body",cellClassRules:{invalidValue:t=>this._editionManager.hasInvalidField(t.colDef.field,t.data.__record__id__)},cellStyle:{height:"100%"}},rowClassRules:{"row-striped":({node:t})=>i.enableRowTableStriped&&t.rowIndex%2==0},suppressFieldDotNotation:!0,components:Object.assign({ezGridHeaderComponent:Zp,ezGridCustomHeader:Yp},this._editionManager.getComponents()),context:{editionManager:this._editionManager,dataUnit:this._dataUnit,headerCheckStatusGetter:()=>this.getSelectionHeaderStatus(),headerCheckStatusSetter:t=>this.updateSelectionForAll(t)},processCellForClipboard:this.processFormatterCellCallback,defaultExcelExportParams:{processCellCallback:this.processFormatterCellCallback},defaultCsvExportParams:{processCellCallback:this.processFormatterCellCallback}},this.defineRowModelType(this._gridOptions,i,r),this.setOptionsEvents(this._gridOptions),this.setOptionsSupress(this._gridOptions),this._gridOptions=this._editionManager.configureGrid(this._gridOptions),this._grid=new Dp(t,this._gridOptions);const s=null===(n=this._dataUnit)||void 0===n?void 0:n.getSelectionInfo();(null==s?void 0:s.isAllRecords())?this.selectAll(!0):this.selectRows((null==s?void 0:s.recordIds)||[],!0),this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight()),this._customFormatters=i.customFormatters,this.observer=new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting?(this._gridShowDom=!0,this.peddingExecutionsOnGridShow.forEach((t=>t())),this.peddingExecutionsOnGridShow=[]):this._gridShowDom=!1}))}),{root:null,threshold:.1}),this.observer.observe(t)}var o}processFormatterCellCallback(t){const i=t.column.getColDef();return"function"==typeof i.valueFormatter?i.valueFormatter({value:t.value,data:t.node.data,node:t.node,colDef:i,column:t.column,api:t.api,columnApi:t.columnApi,context:t.context}):t.value}setFilterColumnLeftPosition({type:t,ePopup:i}){"columnMenu"!==t||(this._filterColumnleftPosition=i.getBoundingClientRect().left)}buildMenuItemOptions(t){const i=[];return t.column.getColDef().sortable&&(i.push(this.buildMenuItemOptionSort(t,"asc")),i.push(this.buildMenuItemOptionSort(t,"desc")),this._options.suppressFilterColumn||i.push(this.buildMenuItemFilterColumn(t))),this._menuItems.forEach((n=>i.push({icon:n.icon,name:n.label,action:()=>n.action(t)}))),i.push(this.buildMenuItemOptionPin(t)),i}buildMenuItemOptionSort(t,i){return{icon:"asc"===i?"<i class='ez-icon-ordem-ascendente'></i>":"<i class='ez-icon-ordem-descendente'></i>",name:this._i18n("asc"===i?"ez-grid.sortAscending":"ez-grid.sortDescending"),action:()=>this.sortDataByColumn(t,i)}}buildMenuItemFilterColumn(t){const i=t.column.getId(),n=t.column.getColDef().headerName;return{icon:"<i class='ez-icon-filter'></i>",name:this._i18n("ez-grid.filter"),action:()=>this.showFilterColumn({columnName:i,columnLabel:n,leftPosition:this._filterColumnleftPosition,filteredOptions:this._filteredColumns.get(i)})}}resolveDescriptionColMetadata(t){var i;const n=null===(i=this._gridOptions.columnApi.getColumn(t))||void 0===i?void 0:i.getColDef(),e=this.getCodeColFromDescriptionCol(t);if(!l.isEmpty(e))return{label:n.headerName,name:t,userInterface:h.SHORTTEXT,dataType:v.TEXT,properties:{[W]:e}}}buildMenuItemOptionPin(t){const{column:i,columnApi:n}=t,e=t.column.isPinned();return{icon:`<i class='ez-icon-${e?"un-pin":"push-pin"}'></i>`,name:this._i18n(e?"ez-grid.unpinColumn":"ez-grid.pinColumn"),action:()=>{n.applyColumnState({state:[{colId:i.getColId(),pinned:i.isPinned()?null:"left"}]})}}}sortDataByColumn(t,i){const n=t.column,e=t.columnApi;n.getSort()===i?e.applyColumnState({defaultState:{sort:null}}):e.applyColumnState({state:[{colId:n.getColId(),sort:i}],defaultState:{sort:null}})}getRowHeight(){return this.DEFAULT_ROW_HEIGHT}getHeaderRowHeight(){return this.DEFAULT_HEADER_ROW_HEIGHT}navigateToNextCell(t){var i,n,e,r,o,s,u,h,c;switch(t.key){case"ArrowUp":return!1===(null===(i=this._dataUnit)||void 0===i?void 0:i.hasPrevious())?null:(this._gridOptions.api.deselectAll(),(null===(n=t.nextCellPosition)||void 0===n?void 0:n.rowIndex)<0?(null===(e=this._dataUnit)||void 0===e||e.previousRecord(),null):(null===(r=this._dataUnit)||void 0===r||r.setSelectionByIndex([t.nextCellPosition.rowIndex]),t.nextCellPosition));case"ArrowDown":return!1===(null===(o=this._dataUnit)||void 0===o?void 0:o.hasNext())?null:(this._gridOptions.api.deselectAll(),(null===(s=t.nextCellPosition)||void 0===s?void 0:s.rowIndex)?null===(u=this._dataUnit)||void 0===u||u.setSelectionByIndex([t.nextCellPosition.rowIndex]):null===(h=this._dataUnit)||void 0===h||h.nextRecord(),t.nextCellPosition);case"ArrowLeft":case"ArrowRight":return""!==(null===(c=t.nextCellPosition)||void 0===c?void 0:c.column.colDef.headerName)?t.nextCellPosition:null}return null}defineRowModelType(t,i,n){null!=this._dataUnit&&(t.rowModelType="serverSide",t.serverSideDatasource=this._dataSource=new qp(this._dataUnit,this,i,n),t.serverSideSortOnServer=!0,t.columnDefs=this._colDefs)}setOptionsEvents(t){t.onSortChanged=t=>this.onCallStateChange("sort",t),t.onColumnResized=t=>this.onCallStateChange("columnResize",t),t.onColumnPinned=t=>this.onCallStateChange("columnPinned",t),t.onColumnMoved=t=>this.onCallStateChange("columnMoved",t),t.onColumnVisible=t=>this.onCallStateChange("visibleChange",t),t.onSelectionChanged=t=>this.onSelectionChange(t),t.onRowDoubleClicked=t=>this.onRowDoubleClick(t),t.onDragStopped=t=>this.onCallStateChange("columnMovedEnd",t),t.onCellClicked=t=>this.onCellClicked(t)}setOptionsSupress(t){t.suppressDragLeaveHidesColumns=!0,t.suppressMenuHide=!0}getSelectionHeaderStatus(){const t=this._dataUnit.records;if(t&&0===t.length)return!1;const i=this._dataUnit.getSelectionInfo();if(i.isAllRecords())return!0;const n=i.recordIds;if(null==n||0===n.length)return!1;let e;for(let i=0;i<t.length;i++){const r=n.includes(t[i].__record__id__);if(null!=e&&r!==e)return;e=r}return e}updateSelectionForAll(t){t?this._dataUnit.selectAllRecords():this._dataUnit.unSelectAllRecords()}setData(t){if(void 0===this._grid)throw new Error("Erro interno: Grid ainda não inicializado.");this._gridOptions.api.setRowData(t)}addRows(){if(void 0===this._grid)throw new Error("Erro interno: Grid ainda não inicializado.")}updateRows(t){if(void 0===this._grid)throw new Error("Erro interno: Grid ainda não inicializado.");null==t||t.forEach((t=>this.updateRowData(t)))}updateRowData(t){this._gridOptions.api.getRowNode(t[this._idAttribName]).setData(Object.assign({},t)),this._editionManager.updateCurrentEditorGuiValue(t),this._editionManager.recordValidate()}selectAll(t=!1){try{this._gridOptions.context.selectionChangeQuietly=t,this._gridOptions.api.forEachNode((t=>{t.isSelected()||t.setSelected(!0)}))}finally{const t=Object.assign({},this._gridOptions.context);delete t.selectionChangeQuietly,this._gridOptions.context=t}}selectRows(t,i=!1){var n;try{if(this._gridOptions.context.selectionChangeQuietly=i,void 0===this._grid)throw new Error("Erro interno: Grid ainda não inicializado.");let e;this._gridOptions.api.forEachNode((i=>{t&&t.includes(i.id)?i.isSelected()||(i.setSelected(!0),e=i):i.isSelected()&&i.setSelected(!1)}));const r=this._gridOptions.context.selectionHeader;r&&r.updateCheckbox(),e&&(null===(n=this._gridOptions.api)||void 0===n||n.ensureNodeVisible(e))}finally{const t=Object.assign({},this._gridOptions.context);delete t.selectionChangeQuietly,this._gridOptions.context=t}}removeRows(){if(void 0===this._grid)throw new Error("Erro interno: Grid ainda não inicializado.");this._gridOptions.api.refreshServerSide({purge:!0})}changeValues(t,i){if(void 0===this._grid)throw new Error("Erro interno: Grid ainda não inicializado.");if(t){let n;i?(n=[],i.forEach((t=>{const i=this._gridOptions.api.getRowNode(t);i&&n.push(i)}))):n=this._gridOptions.api.getSelectedNodes(),n.forEach((i=>{const n=i.data;Object.entries(t).forEach((([t,i])=>{n[t]=i})),i.setData(n)})),this._gridOptions.api.refreshCells({force:!0});const e=this._editionManager.getNextInvalidCell();if(e){const t=this._gridOptions.api.getRowNode(e.recordId);t&&e.field&&this.startEdition(t.rowIndex,this._gridOptions.columnApi.getColumn(e.field.name))}}}savingCanceled(t,i){if(!this._gridShowDom)return;const n=this._gridOptions.columnApi.getAllDisplayedColumns(),e=this._gridOptions.api.getRowNode(i).rowIndex,r=n.find((i=>this.isColumnEditable(e,i)&&t.find((t=>t.name===i.getColId()))));this.focusByCollAndRow(r,e),this.startEdition(e,r)}refresh(t=!1){if(void 0===this._grid)throw new Error("Erro interno: Grid ainda não inicializado.");this._gridOptions.api.clearRangeSelection(),this._gridOptions.api.refreshServerSide({purge:!0}),this._options.onRefresh(),t&&this.scrollToSelectedRow()}scrollToSelectedRow(){const t=this._gridOptions.api.getSelectedNodes();t&&0!==t.length&&(this._gridShowDom?this._gridOptions.api.ensureNodeVisible(t[0]):this.peddingExecutionsOnGridShow.push((()=>this._gridOptions.api.ensureNodeVisible(t[0]))))}focusOnGridContainer(){this._container.setAttribute("tabindex","-1"),this._container.focus()}setFocus(){var t,i;(null===(i=null===(t=this._dataUnit)||void 0===t?void 0:t.records)||void 0===i?void 0:i.length)?this._dataUnit.getSelectedRecord()?this.syncSelectWithDataUnit():this.setFocusFirstRow():this.focusOnGridContainer()}setAutoFocus(t){var i;null===(i=this._dataSource)||void 0===i||i.setAutoFocus(t)}setEnableGridInsert(t){var i;null===(i=this._dataSource)||void 0===i||i.setEnableGridInsert(t)}setEnableContinuousInsert(t){var i;null===(i=this._editionManager)||void 0===i||i.setEnableContinuousInsert(t)}setFocusFirstRow(){const t=this._gridOptions.api.getDisplayedRowAtIndex(0);t?this.setFocusOnRow(t.rowIndex):this.focusOnGridContainer()}setFocusLastRow(){const t=this._gridOptions.api.getDisplayedRowAtIndex(this._gridOptions.api.getLastDisplayedRow());t&&this.setFocusOnRow(t.rowIndex)}startEditionOnRowByIndex(t){this._dataUnit.setSelectionByIndex([t]);const i=this.getFirstEditableColl(t);i&&(this.focusByCollAndRow(i,t),this.startEdition(t,i))}startEditionOnLastRow(){var t;if(this._gridShowDom){const i=(null===(t=this._dataUnit.records)||void 0===t?void 0:t.length)-1;this.startEditionOnRowByIndex(i)}}syncSelectWithDataUnit(){const t=this._gridOptions.api.getRowNode(this._dataUnit.getSelectedRecord().__record__id__);if(!t||(null==t?void 0:t.rowIndex)<0)return;const i=this._gridOptions.api.getCellRanges().find((i=>i.startRow.rowIndex===t.rowIndex));if((null==i?void 0:i.columns.length)>0)return this._dataUnit.hasNewRecord()?void this.startEdition(t.rowIndex,i.columns[0]):(this.focusByCollAndRow(i.columns[0],t.rowIndex),void this._gridOptions.api.addCellRange({rowStartIndex:t.rowIndex,rowEndIndex:t.rowIndex,columns:i.columns}));this._gridOptions.api.clearRangeSelection(),this.setFocusOnRow(t.rowIndex)}startEdition(t,i){if(!this._gridShowDom)return;this._gridOptions.api.clearRangeSelection(),this._gridOptions.api.addCellRange({rowStartIndex:t,rowEndIndex:t,columns:[i]}),this._gridOptions.api.setFocusedCell(t,i),this._gridOptions.api.startEditingCell({rowIndex:t,colKey:i});const n=this._gridOptions.api.getCellEditorInstances()[0];n&&n.focusIn()}getFirstEditableColl(t){try{return this._gridOptions.columnApi.getAllDisplayedColumns().find((i=>this.isColumnEditable(t,i)))}catch(t){console.warn(t)}}isColumnEditable(t,i){if(""===i.getColDef().headerName||i.getColDef().headerName===this.CHECK_BOX_COL_ID||-1===t)return!1;const n=this._gridOptions.api.getRowNode(this._dataUnit.records[t][this._idAttribName]);return i.isCellEditable(n)}setFocusOnRow(t){let i=this._gridOptions.columnApi.getAllDisplayedColumns().find((t=>""!==t.getColDef().headerName));this.focusByCollAndRow(i,t),this._gridOptions.api.addCellRange({rowStartIndex:t,rowEndIndex:t,columns:[i]})}focusByCollAndRow(t,i){this._gridOptions.api.ensureColumnVisible(t),this._gridOptions.api.ensureIndexVisible(i),this._gridOptions.api.setFocusedCell(i,t)}setColumnsDef(t){const i=Object.assign({colId:this.CHECK_BOX_COL_ID,headerName:this.CHECK_BOX_COL_ID,checkboxSelection:!0,width:29,suppressMovable:!0,suppressAutoSize:!0,suppressMenu:!0,lockPosition:!0,pinned:!0},this._multipleSelection?{headerComponent:"ezGridHeaderComponent",headerClass:"ag-column-select-header"}:{headerComponentParams:{displayName:""}}),n=this._options.suppressCheckBoxCol?[]:[i];null!=this._statusResolver&&n.push({colId:this.STATUS_COL_ID,headerName:"",checkboxSelection:!1,headerCheckboxSelection:!1,width:29,suppressMovable:!0,suppressAutoSize:!0,suppressMenu:!0,lockPosition:!0,pinned:!0,cellRenderer:Jp,cellRendererParams:{statusResolver:this._statusResolver},cellStyle:{"text-align":"center"},suppressNavigable:!0}),t.forEach((t=>{n.push(this.buildColDef(t))})),this._colDefs=n,this._gridOptions&&this._gridOptions.api&&this.setColsDefsWithStateIfNeeded(this._colDefs)}setColsDefsWithStateIfNeeded(t){this._lastColsConfig||this._gridOptions.api.setColumnDefs(this._colDefs);const i=this.getColsDefWithConfigApplied(t,this._lastColsConfig);this._gridOptions.api.setColumnDefs(i)}getColsDefWithConfigApplied(t,i=[]){const n=i.reduce(((t,i,n)=>(t[i.name]=n,t)),{});return t.filter((t=>!n.hasOwnProperty(t.colId))).sort(((t,i)=>{var e,r;return(null!==(e=n[t.field])&&void 0!==e?e:Number.MAX_VALUE)-(null!==(r=n[i.field])&&void 0!==r?r:Number.MAX_VALUE)}))}clearRangeSelection(){this._gridOptions.api.clearRangeSelection()}hideSelectionColumn(){var t,i;null===(i=null===(t=this._gridOptions)||void 0===t?void 0:t.columnApi)||void 0===i||i.setColumnVisible(this.CHECK_BOX_COL_ID,!1)}showSelectionColumn(){var t,i;null===(i=null===(t=this._gridOptions)||void 0===t?void 0:t.columnApi)||void 0===i||i.setColumnVisible(this.CHECK_BOX_COL_ID,!0)}getColumnsDef(){if(void 0===this._grid)throw new Error("Erro interno: Grid ainda não inicializado.");return this._gridOptions.columnApi.getColumns().filter((t=>![this.CHECK_BOX_COL_ID,this.STATUS_COL_ID].includes(t.getColId()))).map((t=>{const i=t.getColDef(),n={name:i.field,label:i.headerName};return this.conditionalSet(n,"sortable",i.sortable),this.conditionalSet(n,"resizable",i.resizable),this.conditionalSet(n,"sort",i.sort),this.conditionalSet(n,"sortIndex",i.sortIndex),this.conditionalSet(n,"width",i.width),this.conditionalSet(n,"pinned",null!==i.pinned),this.conditionalSet(n,"hidden",i.hide),n}))}setColumnsState(t){if(void 0===this._grid)throw new Error("Erro interno: Grid ainda não inicializado.");this._lastColsConfig=t;const i=this._gridOptions.columnApi.getColumns();let n=this.getColumnsDef(),e=[];const r=i.length-n.length;this._gridConfig=t;let o=[],s=0;t.forEach((i=>{var n,u;const h=this.getColumnWidth(i);this._gridOptions.columnApi.moveColumn(i.name,s+r),this._gridOptions.columnApi.setColumnWidth(i.name,h),e.push(i.name),void 0!==i.ascending&&o.push({colId:i.name,sort:!0!==i.ascending?"desc":"asc",sortIndex:i.orderIndex}),s++;const c=null===(n=this._dataUnit)||void 0===n?void 0:n.getField(i.name);if(this.needToAddDescriptionColumn(i,c,t)){const t=null===(u=null==c?void 0:c.properties)||void 0===u?void 0:u[H];if(!t)return;const i=this._gridOptions.columnApi.getColumn(t),n=null==i?void 0:i.getColDef(),o=this.getColumnWidthByLabel(null==n?void 0:n.headerName);this._gridOptions.columnApi.moveColumn(t,s+r),this._gridOptions.columnApi.setColumnWidth(t,o),e.push(t),s++}}));let u=n.filter((t=>!e.includes(t.name))).map((t=>t.name));this._gridOptions.columnApi.setColumnsVisible(e,!0),this._gridOptions.columnApi.setColumnsVisible(u,!1),this._gridOptions.columnApi.applyColumnState({state:o,defaultState:{sort:null}})}needToAddDescriptionColumn(t,i,n){var e,r;if(!i)return!1;const o=null!==(e=t.configVersion)&&void 0!==e?e:0,s=null===(r=null==i?void 0:i.properties)||void 0===r?void 0:r[H];return(null==i?void 0:i.userInterface)==h.SEARCHPLUS&&o<1&&null!=n.find((t=>t.name===s))}getColumnsState(){if(void 0===this._grid)throw new Error("Erro interno: Grid ainda não inicializado.");return this._gridOptions.columnApi.getColumnState().map((t=>{const i=this._gridOptions.columnApi.getColumn(t.colId),n=i.getColDef(),e=i.getActualWidth(),r={label:n.headerName,name:n.checkboxSelection?"__SELECTION__":t.colId};this.conditionalSet(r,"sort",t.sort),this.conditionalSet(r,"sortIndex",t.sortIndex),this.conditionalSet(r,"width",e),this.conditionalSet(r,"pinned",null!==t.pinned),this.conditionalSet(r,"hidden",t.hide);const o=new Map;return o.set("sortable",n.sortable),this.conditionalSet(r,"props",o),r})).filter((t=>"__SELECTION__"!==t.name&&t.name!==this.STATUS_COL_ID))}getSelection(){return this._gridOptions.api.getSelectedRows()}addColumnMenuItem(t){this._menuItems.map((t=>t.name)).includes(t.name)||this._menuItems.push(t)}quickFilter(t){if(t){const i={term:t,fields:this._gridOptions.columnApi.getColumns().filter((t=>t.isVisible()&&![this.CHECK_BOX_COL_ID,this.STATUS_COL_ID,this.RECORD_ARCHIVE_COL_ID].includes(t.getColId()))).map((t=>t.getColId()))};this._dataSource.quickFilter=i}else this._dataSource.quickFilter=void 0}setSelectedIndex(t){var i;null===(i=this._gridOptions.api.getDisplayedRowAtIndex(t))||void 0===i||i.setSelected(!0)}hasFilterColumn(t){var i;return(null!==(i=this._filteredColumns.get(t))&&void 0!==i?i:[]).map((t=>t.check)).includes(!0)}buildColDef(t){var i,n,e,r,o;let s;const u=l.getBooleanValue(null===(i=t.props)||void 0===i?void 0:i.get("gridSortable"),!0);(null===(n=t.props)||void 0===n?void 0:n.get("gridHeaderTooltip"))?s=null===(e=t.props)||void 0===e?void 0:e.get("gridHeaderTooltip"):!1===u&&(s=this._i18n("ez-grid.columnCantBeOrder"));const c=null===(r=null==t?void 0:t.props)||void 0===r?void 0:r.get(W);return this._editionManager.configureColumn({headerName:t.label,field:t.name,sortable:u,resizable:!0,headerComponent:"ezGridCustomHeader",headerComponentParams:{presentationFrom:c,tooltip:s,isSortable:u,hasFilter:()=>this.hasFilterColumn(t.name),showColumnFilter:i=>this.showFilterColumn({columnName:t.name,columnLabel:t.label,leftPosition:i,filteredOptions:this._filteredColumns.get(t.name),fromIcon:!0})},valueFormatter:i=>{var n,e,r;if(c)return null!==(r=null===(e=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n[c])||void 0===e?void 0:e.label)&&void 0!==r?r:"";if(null==i.value)return"";if(i.value instanceof Promise)return`${this._i18n("app.loading")}...`;if(t.userInterface===h.HTML)return this.setHTMLRender(i,t),"";const o=this._customFormatters.get(t.name);if(o){const n=o.format(i.value,t,i.data.__record__id__);if(n)return n}return this._dataUnit?this._dataUnit.getFormattedValue(t.name,i.value):this.getFormatterByColumn(i,t)},cellStyle:this.getStyleByColumn(t),editable:!(null===(o=t.props)||void 0===o?void 0:o.has(W))})}setHTMLRender(t,i){const n=U.sanitize(t.value);t.colDef.cellRenderer=i=>{if(i.node.rowIndex===t.node.rowIndex){const t=document.createElement("span");return t.innerHTML=n,t}return i.value},t.colDef.cellStyle=n=>{const e=this.getStyleByColumn(i);return n.node.rowIndex===t.node.rowIndex?Object.assign(e,{padding:0}):e}}setCustomFormatters(t){this._customFormatters=t}refreshSelectedRows(){const t=this._gridOptions.api.getSelectedNodes();this._gridOptions.api.redrawRows({rowNodes:t})}getInitCellStyle(){return{"line-height":this.getRowHeight()-1+"px"}}getStyleByColumn(t){var i;let n=this.getInitCellStyle();const e=null===(i=null==t?void 0:t.props)||void 0===i?void 0:i.get("PRIMITIVETUIYPE");switch(null!=e?e:null==t?void 0:t.userInterface){case h.DECIMALNUMBER:case h.INTEGERNUMBER:n["text-align"]="right";break;case h.DATE:case h.DATETIME:case h.TIME:n["text-align"]="center";break;default:n["text-align"]="left"}return n}getFormatterByColumn(t,i){var n,e,r,o;if("OPTIONSELECTOR"===(null==i?void 0:i.userInterface)&&i.options){const n=null==i?void 0:i.options;let e,r;if("string"==typeof n){const t=JSON.parse(n);e=Object.keys(t).map((i=>({value:i,label:t[i]})))}else e=n;return e.forEach((i=>{i.value==t.value&&(r=i)})),null==r?void 0:r.label}if((null==i?void 0:i.userInterface)===h.SWITCH){if("S"===(null==t?void 0:t.value)||!0===(null==t?void 0:t.value)||"true"===(null==t?void 0:t.value))return this._i18n("app.yes");if("N"===(null==t?void 0:t.value)||!1===(null==t?void 0:t.value)||"false"===(null==t?void 0:t.value))return this._i18n("app.no")}if((null==i?void 0:i.userInterface)===h.SEARCH)return null!=(null===(n=null==t?void 0:t.value)||void 0===n?void 0:n.value)?t.value.value+" - "+t.value.label:null==t?void 0:t.value;if((null==i?void 0:i.userInterface)===h.SEARCHPLUS)return null!==(o=null!==(r=null===(e=null==t?void 0:t.value)||void 0===e?void 0:e.value)&&void 0!==r?r:null==t?void 0:t.value)&&void 0!==o?o:"";if((null==i?void 0:i.userInterface)===h.DECIMALNUMBER&&null!=t.value){const n=Number(i.props.get("precision"))||2;return p.format(t.value.toString(),n,n)}if(((null==i?void 0:i.userInterface)===h.DATE||(null==i?void 0:i.userInterface)===h.DATETIME)&&null!=t.value)return t.value.toLocaleDateString();if(((null==i?void 0:i.userInterface)===h.ELAPSEDTIME||(null==i?void 0:i.userInterface)===h.TIME)&&t.value){const i=new g("##:##"),n=String(t.value).padStart(4,"0");return i.format(n)}return(null==i?void 0:i.userInterface)===h.FILE?t.value&&Array.isArray(t.value)?1===t.value.length?t.value[0].name:`${t.value.length} arquivos`:"":void 0}onCallStateChange(t,i){if((!("finished"in i)||i.finished)&&this._columnStateChangeCallback){let n={},e=this.isUIEvent(i.source,i.type);"columnResize"===t&&(n.column={colId:i.column.colId,actualWidth:i.column.actualWidth}),n.isUserChange=e,n.isElementResize=this.isElementResize(i),this._columnStateChangeCallback(t,this.getColumnsState(),n)}}onCellClicked(t){this._editionManager.verifyClickToEdition(t.api,{rowIndex:t.rowIndex,column:t.column,rowPinned:void 0})}isElementResize(t){return t.target&&"eResize"===t.target.getAttribute("ref")}isUIEvent(t,i){return"dragStopped"===i||!!t&&["uiColumnMoved","uiColumnResized","uiColumnDragged","uiColumnExpanded","uiColumnSorted"].includes(t)}onSelectionChange(t){var i,n;const e=null===(n=null===(i=t.api.getSelectedNodes())||void 0===i?void 0:i[0])||void 0===n?void 0:n.id,r=this._dataUnit.isNewRecord(e);this._selectionChangeCallback&&(clearTimeout(this._selectionChangeDeboucing),this._selectionChangeDeboucing=window.setTimeout((async()=>{(r||!e||await this.handleExecuteProceedAutosave())&&this.processBuildSelectionChangeCallback(t)}),0))}async handleExecuteProceedAutosave(){return!this._gridShowDom||await this._editionManager.proceedAutoSave()}processBuildSelectionChangeCallback(t){this._dataUnit?this.handleBuildSelectionChangeWithDU(t.context.selectionChangeQuietly):this.buildSelectionChangeCallback(this._gridOptions.api.getSelectedRows())}handleBuildSelectionChangeWithDU(t){t?this.buildSelectionChangeCallback(this._dataUnit.records):this._dataUnit.updatePageSelection(this._gridOptions.api.getSelectedRows().map((t=>t.__record__id__))).then((t=>this.buildSelectionChangeCallback(t.records)))}buildSelectionChangeCallback(t){this._selectionChangeCallback({selection:t,selectionHeaderStatus:this.getSelectionHeaderStatus()})}onRowDoubleClick(t){var i,n;!this._doubleClickCallBack||this._options.enableGridInsert&&this._dataUnit.hasNewRecord()||(null===(n=null===(i=this._gridOptions)||void 0===i?void 0:i.api)||void 0===n||n.stopEditing(),this._doubleClickCallBack(t.data))}conditionalSet(t,i,n){null!=n&&!1!==n&&(t[i]=n)}processEditionCanceled(){this.clearInvalidCells(!0),this._gridShowDom&&this._dataUnit.clearSelection()}setCellEditors(t){var i,n,e,r,o;if(!this._editionManager)return void(this._customEditors=t);const s=null===(n=null===(i=this._gridOptions)||void 0===i?void 0:i.api)||void 0===n?void 0:n.getEditingCells();this._editionManager.setCellEditors(t),(null==s?void 0:s.length)>0&&this._gridOptions.api.startEditingCell({colKey:null===(r=null===(e=s[0])||void 0===e?void 0:e.column)||void 0===r?void 0:r.getColId(),rowIndex:null===(o=s[0])||void 0===o?void 0:o.rowIndex})}setCellRenders(t){var i,n,e,r,o,s;if(!this._editionManager)return void(this._customRenders=t);this._editionManager.setCellRenders(t);const u=null===(n=null===(i=this._gridOptions)||void 0===i?void 0:i.api)||void 0===n?void 0:n.getEditingCells();null===(e=this._gridOptions)||void 0===e||e.api.redrawRows(),(null==u?void 0:u.length)>0&&this._gridOptions.api.startEditingCell({colKey:null===(o=null===(r=u[0])||void 0===r?void 0:r.column)||void 0===o?void 0:o.getColId(),rowIndex:null===(s=u[0])||void 0===s?void 0:s.rowIndex})}clearInvalidCells(t){this._editionManager&&(this._editionManager.clearInvalidCells(t),this._gridOptions.api.refreshCells({force:!0}))}processContinuousInsert(){this._editionManager.processContinuousInsert()}destroy(){var t;this.observer.disconnect(),null===(t=this._dataSource)||void 0===t||t.destroy()}registryListeners(){var t;null===(t=this._dataSource)||void 0===t||t.registryListeners()}resetPaginationState(){var t,i;null===(i=null===(t=this._gridOptions)||void 0===t?void 0:t.api)||void 0===i||i.clearRangeSelection()}stopEdit(){this._gridOptions.api.stopEditing()}getColumnWidth(t){var i,n,e,r,o,s;if(null==t)return;if(null!=t.customWidth)return t.customWidth;if(null!=t.width&&!isNaN(t.width)){const i=parseInt(t.width);if(i>0)return i+this.DEFAULT_FONT_SIZE_HTML5}const u=null===(i=this._dataUnit)||void 0===i?void 0:i.getField(t.name),c=null!==(n=null==u?void 0:u.label)&&void 0!==n?n:null===(s=null===(o=null===(r=null===(e=this._gridOptions)||void 0===e?void 0:e.columnApi)||void 0===r?void 0:r.getColumn(t.name))||void 0===o?void 0:o.getColDef())||void 0===s?void 0:s.headerName;return(null==u?void 0:u.userInterface)===h.SEARCH?this.DEFAULT_MAX_SIZE:this.getColumnWidthByLabel(c)}getColumnWidthByLabel(t){const i=((null==t?void 0:t.length)||0)*this.DEFAULT_FONT_SIZE+this.DEFAULT_ICON_SIZE;return i>this.DEFAULT_MAX_SIZE?this.DEFAULT_MAX_SIZE:i}getCodeColFromDescriptionCol(t){var i;const n=this._gridOptions.columnApi.getColumn(t),e=null==n?void 0:n.getColDef();return null===(i=null==e?void 0:e.headerComponentParams)||void 0===i?void 0:i.presentationFrom}}function Iw(t){return void 0!==t}function Ew(t,i,n){const e=x();return t?e("utils.selectAllPage"):void 0===n?e("utils.loadingAllRecords",{count:i}):e("utils.selectAllRecords",{total:n})}function Tw(t){return Iw(t)?"":x()("utils.waitForLoad")}function zw(t,i){const n=x();return i?n("utils.allRecordsSelected",{selectionCount:t}):n("utils.selectedRecords",{selectionCount:t,plural:t>1?"s":""})}const Nw=i=>{const{selectionCount:n,currentPageSelected:e,allRecordSelected:r,paginationInfo:o,canSelectAll:s,onSelectAll:u,onSelectPage:h,onClearAll:c,onClose:a,i18n:l}=i,{total:f,hasMore:d,count:v}=o||{};return t("div",Object.assign({class:"ez-box ez-box--shadow-small"},Lw("ezGridSelectionCounter")),t("div",{class:"ez-flex ez-flex--align-items-center ez-size-width--full ez-padding-horizontal--medium"},t("div",{class:"ez-flex ez-flex--wrap ez-flex--align-items-baseline ez-flex--justify-center"},t("label",Object.assign({innerHTML:zw(n,r),class:"ez-text ez-text--primary ez-text--medium ez-margin-right--medium ez-margin-top--medium"},Lw("ezGridSelectionCounter_label"))),t("div",{class:"ez-flex ez-margin-right--medium"},!(!r&&n===f||r&&!d)&&(void 0!==s?s:!!o&&(e||r))&&t("ez-button",Object.assign({key:"selectAllRecordsEzButton",title:Tw(f),enabled:Iw(f),class:"ez-margin-right--medium",label:Ew(r,v,f),mode:"link",onClick:r?h:u},Lw("ezGridSelectionCounter_select"+(r?"Page":"All")))),t("ez-button",Object.assign({key:"clearAllSelectionEzButton",class:"grid__btn-clear",label:l("ez-grid.clearSelection"),mode:"link",onClick:c},Lw("ezGridSelectionCounter_clearAll"))))),t("button",Object.assign({class:"grid__btn-close",title:l("app.close"),onClick:a},Lw("ezGridSelectionCounter_close")),t("ez-icon",{iconName:"close"}))))};function Lw(t){return{[b.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:b.getInternalIDInfo(t)}}class Bw{static getColumnFilters(t,i){return w.getColumnFilters(t,i)}static getFilterFunction(t,i){return w.getFilterFunction(t,i)}static compileDistinct(t,i){return w.compileDistinct(t,i)}static compileDistinctFromArray(t,i,n){return w.compileDistinctFromArray(t,i,n)}}class Hw{constructor(t){this.lastAppliedFilters=[],this.FILTER_COLUMN_TERM="FILTRO_COLUNA_",this.onDataUnitAction=t=>{var i,n;if(t.type===o.DATA_SAVED||t.type===o.RECORDS_REMOVED)return void(this.originalRecords=this.dataUnit.records);if(t.type!==o.DATA_LOADED)return;const e=this.getAppliedFilterNames(null!==(n=null===(i=t.payload)||void 0===i?void 0:i.filters)&&void 0!==n?n:[]);this.originalRecords&&u.equals(e,this.lastAppliedFilters)||(this.originalRecords=t.payload.records,this.lastAppliedFilters=e)},this.dataUnit=t,this.dataUnit.records.length>0&&(this.originalRecords=this.dataUnit.records),this.dataUnit.subscribe(this.onDataUnitAction)}refresh(){this.originalRecords=this.dataUnit.records}getAppliedFilterNames(t){return t.map((t=>t.name)).filter((t=>!t.includes(this.FILTER_COLUMN_TERM)))}getStaticOptions(t){return Promise.resolve(Bw.compileDistinctFromArray(t,this.dataUnit,this.originalRecords))}fetchData(t,i){return new Promise((n=>{const e=this.originalRecords.filter((n=>this.includesSearchTerm(n,i,t))).map((t=>this.buildFieldOption(t,i)));n(this.removeDuplicatedOptions(e))}))}sortItems(t,i){return Hw.defaultSorterMultSelectionOption(this.dataUnit,t,i)}buildFieldOption(t,i){return{value:this.buildValue(t,i),label:this.formatLabel(i,t[i]),check:!0}}buildValue(t,i){var n;let e=t[i];return(null===(n=this.dataUnit.getField(i))||void 0===n?void 0:n.dataType)===v.OBJECT&&(e=e.value),null==e?void 0:e.toString()}removeDuplicatedOptions(t){const i=[];return t.forEach((t=>{i.find((({label:i})=>i===t.label))||i.push(t)})),i}includesSearchTerm(t,i,n){return this.buildLabel(i,t[i]).toLowerCase().includes(n.toLowerCase())}buildLabel(t,i){var n;const{dataType:e}=this.dataUnit.getField(t);return e===v.NUMBER?null==i?void 0:i.toString().replace(".",","):e===v.DATE?"object"==typeof i?null===(n=y.formatDate(this.dataUnit.valueFromString(t,i)))||void 0===n?void 0:n.toString():null==i?void 0:i.toString():e===v.OBJECT?`${null==i?void 0:i.value} - ${null==i?void 0:i.label}`:null==i?void 0:i.toString()}formatLabel(t,i){var n,e;const{userInterface:r,dataType:o}=this.dataUnit.getField(t);return o===v.DATE?"object"==typeof i?y.formatDate(this.dataUnit.valueFromString(t,i)):null==i?void 0:i.toString():o===v.NUMBER&&r!==h.DECIMALNUMBER?null===(n=parseInt(this.dataUnit.getFormattedValue(t,i)))||void 0===n?void 0:n.toString():null===(e=this.dataUnit.getFormattedValue(t,i))||void 0===e?void 0:e.toString()}static defaultSorterMultSelectionOption(t,i,n){const e=t.getField(i);return null==e?C.sortAlphabetically(n):n.sort(((t,i)=>S.compareValues(e,t.value,i.value)))}}const Ww=window,Vw=class{constructor(t){i(this,t),this.ezColumnStateChange=n(this,"ezColumnStateChange",7),this.ezPageChangedChanged=n(this,"ezPageChangedChanged",7),this.ezColumnFilterChanged=n(this,"ezColumnFilterChanged",7),this.ezSelectionChange=n(this,"ezSelectionChange",7),this.ezDoubleClick=n(this,"ezDoubleClick",7),this.configChange=n(this,"configChange",7),this.componentReady=n(this,"componentReady",7),this._gridController=new Dw(!1),this._customEditor=new Map,this._customRenders=new Map,this._paginationInfo=void 0,this._paginationChangedByKeyboard=!0,this._showSelectionCounter=!1,this._isAllSelection=!1,this._currentPageSelected=void 0,this._selectionCount=void 0,this._hasLeftButtons=!1,this._customFormatters=new Map,this.enableLockManagerLoadingComp=!1,this.enableLockManagerTaskbarClick=!0,this.multipleSelection=void 0,this.config=void 0,this.selectionToastConfig=void 0,this.serverUrl=void 0,this.dataUnit=void 0,this.statusResolver=void 0,this.columnfilterDataSource=void 0,this.useEnterLikeTab=!1,this.recordsValidator=void 0,this.canEdit=!0,this.autoFocus=!0,this.paginationCounterMode="auto",this.enableGridInsert=!1,this.enableContinuousInsert=!0,this.suppressCheckboxColumn=!1,this.suppressFilterColumn=!1,this.outlineMode=!1,this.enableRowTableStriped=!0,this.compact=!1,this.useSearchColumn=!0,this.suppressHorizontalScroll=!1,this.mode="complete"}async setColumnsDef(t){this._gridController.setColumnsDef(t)}async getAppliedColumnFilters(){var t;return null!==(t=this._gridController.getFilter())&&void 0!==t?t:[]}async refreshColumnFilterDataSource(){var t,i;this.columnfilterDataSource&&(null===(i=(t=this.columnfilterDataSource).refresh)||void 0===i||i.call(t))}async addColumnMenuItem(t,i,n,e){this._gridController.addColumnMenuItem({label:t,name:i,action:n,icon:e})}async setColumnsState(t){this._gridController.setColumnsState(t)}async setData(t){this._gridController.setData(t)}async getSelection(){return Promise.resolve(this._gridController.getSelection())}async getColumnsState(){return Promise.resolve(this._gridController.getColumnsState())}async getColumns(){return Promise.resolve(this._gridController.getColumnsDef())}async quickFilter(t){this._gridController.quickFilter(t)}async locateColumn(t){this._gridController.locateColumn(t,this._element)}async filterColumns(t){return Promise.resolve(this._gridController.getColumnsState().filter((i=>((t,i)=>{const n=l.replaceAccentuatedCharsLower(null==t?void 0:t.toLocaleLowerCase()),e=l.replaceAccentuatedCharsLower(i.toLocaleLowerCase());return null==n?void 0:n.includes(e)})(i.label,t))))}async addCustomEditor(t,i,n){const e=new Map(this._customEditor);e.set(t,{customEditor:i,detailContext:n}),this._customEditor=e,this._gridController.setCellEditors(e)}async addGridCustomRender(t,i,n){const e=new Map(this._customRenders);e.set(t,{customRender:i,detailContext:n}),this._customRenders=e,this._gridController.setCellRenders(e)}async addCustomValueFormatter(t,i){if(!t||!i)return;const n=new Map(this._customFormatters);n.set(t,i),this._customFormatters=n,this._gridController.setCustomFormatters(n)}async removeCustomValueFormatter(t){if(!t)return;const i=new Map(this._customFormatters);i.delete(t),this._customFormatters=i,this._gridController.setCustomFormatters(i)}async refreshSelectedRows(){this._gridController.refreshSelectedRows()}async getCustomValueFormatter(t){return this._customFormatters.get(t)}async setFocus(){this._gridController.setFocus()}async stopEdit(){this._gridController.stopEdit()}async checkStopEditOutsideClick(t){var i;(null===(i=this._container)||void 0===i?void 0:i.contains(t.target))||this._gridController.stopEdit()}observeConfig(t){this._gridController.setColumnsState(null==t?void 0:t.columns)}updatePaginationTooltip(){this.handleShowCancelPagination(),this._refPaginationLabelTooltip&&this._refPaginationLabelTooltip.getAttribute("data-tooltip")&&this._refPaginationLabelTooltip.setAttribute("data-tooltip",this._getPaginationTooltip())}observePaginationCounterMode(t){"hidden"===t&&this._hidePaginationDescription(),"show"===t&&this._showPaginationDescription()}async observeModeChange(t=this.mode){"simple"===t&&(this.canEdit=!1,this.multipleSelection=!1,this.suppressCheckboxColumn=!0,this.compact=!0)}async handleApplyFilterColumn(){const t=this._gridController.getFilter();this.ezColumnFilterChanged.emit(null!=t?t:[])}onSelectionChange(t){this._currentPageSelected=!0===t.detail.selectionHeaderStatus,this.dataUnit&&this.setSelection(this.dataUnit.getSelectionInfo())}async handleClick(t){this.checkStopEditOutsideClick(t)}setSelection(t){var i;this._selectionCount=null!==(i=null==t?void 0:t.length)&&void 0!==i?i:0,this._isAllSelection=null==t?void 0:t.isAllRecords(),this._showSelectionCounter=this._selectionCount>1||this._isAllSelection}onSelectAllRecords(){var t;null===(t=this.dataUnit)||void 0===t||t.setSelection(_.ALL_RECORDS).then((t=>this.setSelection(t)))}onSelectPageRecords(){var t;null===(t=this.dataUnit)||void 0===t||t.setSelection(this.dataUnit.records.map((t=>t.__record__id__))).then((t=>this.setSelection(t)))}onClearSelectedRecords(){var t;null===(t=this.dataUnit)||void 0===t||t.clearSelection(),this._gridController.clearRangeSelection(),this.setSelection(void 0)}createConfigFromState(t){let i={columns:[]};return t.forEach((t=>{if(!t.hidden){let n={name:t.name};t.width&&(n.width=t.width),t.sort?(n.ascending="ASC"===t.sort.toUpperCase(),n.orderIndex=t.sortIndex):n.orderIndex=0,n&&i.columns.push(n)}})),i}positionSelectionCounter(){var t,i;if(!this._gridSelectionCounter)return;if(!this._showSelectionCounter)return void(this._gridSelectionCounter.style.bottom="");const n=null===(t=this._container)||void 0===t?void 0:t.getBoundingClientRect(),e=null===(i=this._gridSelectionCounter)||void 0===i?void 0:i.getBoundingClientRect();n&&e&&(this._gridSelectionCounter.style.bottom=document.body.clientHeight-(n.bottom-30)+"px",this._gridSelectionCounter.style.left=this.calculatePositionLeft(n,e))}calculatePositionLeft(t,i){let n=t.left+t.width/2;const e=t.left+this._container.clientWidth;return n-i.width/2+i.width>e&&(n=e-i.width/2),`${n}px`}setEvents(){window.removeEventListener("scroll",this.positionSelectionCounter.bind(this)),window.addEventListener("scroll",this.positionSelectionCounter.bind(this))}resizeSelectionCounter(){null!=this._gridSelectionCounter&&(this._gridSelectionCounter.style.width="",this._gridSelectionCounter.clientHeight>42&&(this._gridSelectionCounter.style.width="min-content"),this.positionSelectionCounter())}configSelectionCounter(){null!=this._element&&(null!=this._resizeObserver&&this._resizeObserver.unobserve(this._element),this._resizeObserver=new ResizeObserver(R.debounce(this.resizeSelectionCounter.bind(this),200)),this._resizeObserver.observe(this._element),this.resizeSelectionCounter())}onColumnStateChange(t,i,n){var e;if(this.ezColumnStateChange.emit({type:t,state:i,isUserChange:n.isUserChange}),n.isUserChange)if("columnMovedEnd"!==t||n.isElementResize){if("columnResize"===t&&(null===(e=n.column)||void 0===e?void 0:e.colId)){let t;t=this.config?Object.assign({},this.config):this.createConfigFromState(i);let e=t.columns.find((t=>t.name===n.column.colId));e&&(e.customWidth=n.column.actualWidth,this.configChange.emit(t))}}else{let t;this.config?(t={columns:[]},i.forEach((i=>{let n=this.config.columns.find((t=>t.name===i.name));n&&(n.width=i.width,t.columns.push(n))}))):t=this.createConfigFromState(i),t.columns.length>0&&this.configChange.emit(t)}}buildDataElementId(){b.addIDInfo(this._element,null,{dataUnit:this.dataUnit}),this._refPaginationControl&&b.addIDInfo(this._refPaginationControl,"pagination",{id:"ezGrid"})}handlePageChange(){this.resetPaginationState(),this._gridController.setFocusFirstRow(),this.ezPageChangedChanged.emit()}previousPage(){this.dataUnit&&this.dataUnit.previousPage().then((()=>this.handlePageChange()))}nextPage(){this.dataUnit&&this.dataUnit.nextPage().then((()=>this.handlePageChange()))}nextRecord(){if(this.dataUnit){if(0===this.dataUnit.getSelectionInfo().records.length)return void this.dataUnit.selectFirst();this.dataUnit.nextRecord()}}previousRecord(){this.dataUnit&&this.dataUnit.previousRecord()}resetPaginationState(){var t;this._paginationChangedByKeyboard=!1,null===(t=this._gridController)||void 0===t||t.resetPaginationState()}resolvePaginationClassMode(){return this.shouldPresentPaginationLabel()?"pagination-expanded":"pagination-contracted"}async handleCancelPagination(){var t;this.dataUnit.cancelPagination=!0,await(null===(t=this._cancelPaginationPopoverElement)||void 0===t?void 0:t.hide())}renderCancelPagination(){return t("ez-popover",{ref:t=>this._cancelPaginationPopoverElement=t,"overlay-type":"none",autoClose:!1},t("div",{class:"cancel-pagination"},t("ez-icon",{iconName:"sync",size:"x-large",class:"spin"}),t("span",{onClick:()=>this.handleCancelPagination(),class:"cancel-pagination-btn"},this.i18n("ez-grid.cancelPagination"))))}handleShowCancelPagination(){var t,i,n;this._hasToShowCancelPagination()?(null===(i=this._cancelPaginationPopoverElement)||void 0===i?void 0:i.opened)||null===(n=this._cancelPaginationPopoverElement)||void 0===n||n.show("15px"):null===(t=this._cancelPaginationPopoverElement)||void 0===t||t.hide()}getPaginationControl(){if(!this._paginationInfo)return null;const{currentPage:i,hasMore:n}=this._paginationInfo;return t("div",{class:`grid-header__container grid-header__pagination ${this.resolvePaginationClassMode()}`,ref:t=>this._refPaginationControl=t},this.renderCancelPagination(),t("div",{class:"ez-text ez-text--primary ez-text--medium ez-margin-right--medium",ref:t=>this._refPaginationLabel=t},t("span",{class:"grid-header__pagination-label"},this.shouldPresentPaginationLabel()&&t("strong",{class:"ez-text ez-text--primary ez-text--medium"},this._getActualPageLabel()),this.shouldPresentPaginationLabel()&&this._getRemainingPageLabel())),t("div",{id:"grid-pagination-tooltip",ref:t=>this._refPaginationLabelTooltip=t,class:"ez-flex ez-margin-right--medium",title:`${this._getActualPageLabel()} ${this._getRemainingPageLabel()}`},t("ez-button",{size:"small",class:"ez-margin-right--medium",iconName:"chevron-left",mode:"icon",enabled:i>0,onClick:()=>this.previousPage(),label:this.i18n("ez-grid.previousPage")}),t("ez-button",{size:"small",iconName:"chevron-right",mode:"icon",enabled:n,onClick:()=>this.nextPage(),label:this.i18n("ez-grid.nextPage")})))}shouldPresentPaginationLabel(){return"show"===this.paginationCounterMode||"auto"===this.paginationCounterMode}componentDidLoad(){const t=a.getContextValue("__SNK__APPLICATION__");this.enableLockManagerLoadingComp=!(t&&!(null==t?void 0:t.enableLockManagerLoadingApp))&&this.enableLockManagerLoadingComp,this._gridController.initDatagrid(this._container,{onColumnStateChange:(t,i,n)=>this.onColumnStateChange(t,i,n),onSelectionChange:t=>this.ezSelectionChange.emit(t),onPaginationChange:(t,i)=>{this.handlePaginationChange(i,t)},onPaginationUpdate:t=>{this._paginationInfo=t},onDoubleClick:t=>{this.ezDoubleClick.emit(t)},allowMultipleSelection:this.multipleSelection,serverURL:this.serverUrl,dataUnit:this.dataUnit,statusResolver:this.statusResolver,useEnterLikeTab:this.useEnterLikeTab,recordsValidator:this.recordsValidator,editionIsDisabled:()=>!this.canEdit,customFormatters:this._customFormatters,autoFocus:this.autoFocus,enableGridInsert:this.enableGridInsert,enableContinuousInsert:this.enableContinuousInsert,suppressFilterColumn:this.suppressFilterColumn,suppressCheckBoxCol:this.suppressCheckboxColumn,onRefresh:()=>{this.dataUnit&&this.setSelection(this.dataUnit.getSelectionInfo())},enableLockManagerTaskbarClick:this.enableLockManagerTaskbarClick,enableLockManagerLoadingComp:this.enableLockManagerLoadingComp,enableRowTableStriped:this.enableRowTableStriped,suppressHorizontalScroll:this.suppressHorizontalScroll,i18n:this.i18n}),this.config&&this.observeConfig(this.config),null!=this.dataUnit&&(this._paginationInfo=this.dataUnit.getPaginationInfo()),this.buildDataElementId(),this.setEvents(),this.componentReady.emit(),this._gridController.configFilterColumn(this._filterColumn),this.initKeyboardManager()}handlePaginationChange(t,i){var n;!1!==t&&this.autoFocus&&((null===(n=this._paginationInfo)||void 0===n?void 0:n.currentPage)>(null==i?void 0:i.currentPage)&&this._paginationChangedByKeyboard?this._gridController.setFocusLastRow():(this._gridController.setFocusFirstRow(),this._paginationChangedByKeyboard=!0)),this._paginationInfo=i}_getActualPageLabel(){const{firstRecord:t,lastRecord:i}=this._paginationInfo;return`${t}-${i}`}_getRemainingPageLabel(){const{total:t,count:i}=this._paginationInfo;return`${null==t?this.i18n("ez-grid.remainingPageLabel",{count:i+1}):this.i18n("ez-grid.remainingTotalLabel",{total:t})}`}_hasToShowCancelPagination(){var t;const{total:i,count:n}=null!==(t=this._paginationInfo)&&void 0!==t?t:{};return!this.dataUnit.cancelPagination&&void 0===i&&n>this.dataUnit.pageSize}_getPaginationTooltip(){return this._getActualPageLabel()+this._getRemainingPageLabel()}_initHeaderOverflowWatcher(){var t;null===(t=this._headerOverflowWatcher)||void 0===t||t.destroy(),this._refPaginationControl&&(this._headerOverflowWatcher=new O(this.buildOverFlowWatcherParams()))}buildOverFlowWatcherParams(){return{element:this._refPaginationControl,callback:this.handleOverFlow.bind(this),notOverFlow:["grid-pagination-tooltip"]}}handleOverFlow(){if(!this._refPaginationLabel||!this._refPaginationControl)return;const t=this._refPaginationControl.clientWidth,i=this._refPaginationLabel.scrollWidth,n=this._refPaginationControl.querySelector("#grid-pagination-tooltip"),e=i+((null==n?void 0:n.clientWidth)||0)+(this._getElementMargins(this._refPaginationLabel)+(n?this._getElementMargins(n):0));t>e+this._getPaginationDescriptionWidth()?this._showPaginationDescription():t<=e&&this._hidePaginationDescription()}_getPaginationDescriptionWidth(){var t;return(null===(t=this._refPaginationLabelTooltip)||void 0===t?void 0:t.scrollWidth)||0}_getElementMargins(t){const i=getComputedStyle(t);return parseFloat(i.marginLeft)+parseFloat(i.marginRight)}_hidePaginationDescription(){this._refPaginationLabel.classList.add(A),this._refPaginationLabelTooltip.setAttribute("data-flow","bottom"),this._refPaginationLabelTooltip.setAttribute("data-tooltip",this._getPaginationTooltip())}_showPaginationDescription(){this._refPaginationLabel.classList.remove(A),this._refPaginationLabelTooltip.removeAttribute("data-flow"),this._refPaginationLabelTooltip.removeAttribute("data-tooltip")}disconnectedCallback(){var t,i;null===(t=this._headerOverflowWatcher)||void 0===t||t.destroy(),null===(i=this._gridController)||void 0===i||i.destroy(),this.removeShortcuts()}connectedCallback(){var t;this.observeModeChange(),null===(t=this._gridController)||void 0===t||t.registryListeners()}componentWillRender(){this.configSelectionCounter()}componentDidRender(){Ww.addEventListener("onSubmitFilter",(()=>{G.info(this.i18n("ez-grid.filterAppliedSuccess"))}))}async componentWillLoad(){this.i18n=await M(),this._hasLeftButtons=!!this._element.querySelector('[slot="leftButtons"]'),this.dataUnit.name.includes("InMemoryDataUnit")}componentDidUpdate(){this._gridController.setAutoFocus(this.autoFocus),this._gridController.setEnableGridInsert(this.enableGridInsert),this._gridController.setEnableContinuousInsert(this.enableContinuousInsert),this.dataUnit&&this._showSelectionCounter&&this.setSelection(this.dataUnit.getSelectionInfo()),"auto"===this.paginationCounterMode&&this._initHeaderOverflowWatcher()}getDataSource(){return this.columnfilterDataSource||(this.columnfilterDataSource=new Hw(this.dataUnit)),this.columnfilterDataSource}hideHeader(){return"simple"===this.mode||!this._hasLeftButtons&&!this._paginationInfo}resolveLeftHeaderClass(){return"show"==this.paginationCounterMode?"left__header-expanded":"left__header-contracted"}async initKeyboardManager(){this._keyboardManager=new j({propagate:!1,element:this._element}),this._keyboardManager.bind("ctrl + .",(()=>{this._paginationInfo&&this.nextRecord()}),{description:this.i18n("ez-grid.nextRecord"),element:this._element}).bind("ctrl + ,",(()=>{this._paginationInfo&&this.previousRecord()}),{description:this.i18n("ez-grid.previousRecord"),element:this._element}).bind("ctrl + alt + ArrowLeft",(()=>{if(!this._paginationInfo)return;const{currentPage:t}=this._paginationInfo;t>0&&this.previousPage()}),{description:this.i18n("ez-grid.previousPage"),element:this._element}).bind("ctrl + alt + ArrowRight",(()=>{if(!this._paginationInfo)return;const{hasMore:t}=this._paginationInfo;t&&this.nextPage()}),{description:this.i18n("ez-grid.nextPage"),element:this._element}),this.useSearchColumn&&this._keyboardManager.bind(E,(async()=>{if(!this._container||!this._ezPopoverSearchColumn)return;const t=this._container.getBoundingClientRect();await T(this._columnSearch),this._ezPopoverSearchColumn.showUnder(this._container,{horizontalGap:t.width-z,verticalGap:-1*t.height})}),{description:this.i18n("ez-grid.searchColumn"),element:this._element})}async removeShortcuts(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}renderFieldSearchColumn(){return this._columnSearch=N({value:l.generateUUID(),label:this.i18n("ez-grid.labelSearchColumn")},(({argument:t})=>new Promise((i=>{this.filterColumns(t).then((t=>{i(t.filter((t=>!t.hidden)).map((t=>({label:t.label,value:t.name}))))}))}))),(async t=>{null!=t&&null!=t.value&&(await this.locateColumn(t.value),this._ezPopoverSearchColumn&&this._ezPopoverSearchColumn.hide(),this._container&&requestAnimationFrame((()=>this._container.focus())))})),this._columnSearch}render(){var i;return t(e,{"no-header":this.hideHeader()},t("div",{class:{"grid__container ez-grid":!0,"outline-mode":this.outlineMode,"shadow-mode":!this.outlineMode,"no-padding":this.compact,"header-overlay":!this.hideHeader(),"no-scroll":this.suppressHorizontalScroll},ref:t=>this._container=t,tabindex:"0"}),t("div",{class:{"ez-box ez-padding--small grid-header":!0,"outline-mode":this.outlineMode,"shadow-mode":!this.outlineMode&&!this.hideHeader()},tabindex:"0"},t("filter-column",{class:"grid-header__popover",noHeaderTaskBar:!this._hasLeftButtons,dataSource:this.getDataSource(),dataUnit:this.dataUnit,gridHeaderHidden:this.hideHeader(),ref:t=>this._filterColumn=t}),t("div",{class:"grid-header__position"},t("div",{class:`grid-header__container grid-header__left-container ${this.resolveLeftHeaderClass()}`},t("slot",{name:"leftButtons"})),this.getPaginationControl())),t("ez-popover",{ref:t=>this._ezPopoverSearchColumn=t,overlayType:"none"},this.renderFieldSearchColumn()),t("div",{ref:t=>this._gridSelectionCounter=t,class:`grid__selection-counter ez-elevation--4\n ${this._showSelectionCounter?"grid__selection-counter--opened":""}\n `},t(Nw,{selectionCount:this._selectionCount,currentPageSelected:this._currentPageSelected,paginationInfo:this._paginationInfo,canSelectAll:null===(i=this.selectionToastConfig)||void 0===i?void 0:i.canSelectAll,allRecordSelected:this._isAllSelection,i18n:this.i18n,onSelectAll:()=>this.onSelectAllRecords(),onSelectPage:()=>this.onSelectPageRecords(),onClearAll:()=>this.onClearSelectedRecords(),onClose:()=>this._showSelectionCounter=!1})),t("div",{class:"grid__footer"},t("slot",{name:"footer"})))}static get assetsDirs(){return["../assets"]}get _element(){return r(this)}static get watchers(){return{config:["observeConfig"],_paginationInfo:["updatePaginationTooltip"],paginationCounterMode:["observePaginationCounterMode"],mode:["observeModeChange"]}}};Vw.style=".sc-ez-grid-h{display:grid;grid-template-rows:auto 1fr auto;height:100%;width:100%;--ez-grid__header--background-color:var(--background--xlight, #FFF);--ez-grid__selection-counter--z-index:var(--visible, 1);--ez-grid__container--shadow:var(--shadow);--ez-grid--min-height:300px;--ez-grid__container--shadow--outline:var(--shadow--outline) var(--color--strokes);--ez-grid__header--shadow:var(--shadow--xsmall);--ez-grid__header--shadow--outline:var(--shadow--outline) var(--color--strokes);--ez-grid__header--outline:none;--ez-grid__header--border:none;min-height:var(--ez-grid--min-height)}.grid-header.sc-ez-grid{display:grid;justify-content:space-between;align-items:center;grid-row-start:1;grid-template-columns:1fr;background-color:var(--ez-grid__header--background-color, #FFF)}.grid-header.shadow-mode.sc-ez-grid{box-shadow:var(--ez-grid__header--shadow);border:var(--ez-grid__header--border);outline:var(--ez-grid__header--outline)}.grid-header.outline-mode.sc-ez-grid{box-shadow:var(--ez-grid__header--shadow--outline);border:var(--ez-grid__header--border);outline:var(--ez-grid__header--outline)}.header-overlay.sc-ez-grid{padding-top:15px;margin-top:-12px}.grid__container.sc-ez-grid{outline:none;box-shadow:var(--ez-grid__container--shadow);background-color:var(--ez-grid__header--background-color);border:var(--border--small) var(--color--strokes);border-radius:var(--border--radius-small)}.grid__container.no-scroll.sc-ez-grid{width:100vw}.sc-ez-grid-h:not([no-header]) .grid__container.sc-ez-grid{border:none}.grid__container.outline-mode.sc-ez-grid{box-shadow:var(--ez-grid__container--shadow--outline);border:none;outline:none}.grid-header__popover.sc-ez-grid{position:relative;top:var(--space--sm, 16px)}.grid-header__container.sc-ez-grid{display:flex;align-items:center;flex-grow:1;flex-shrink:1}.grid-header__position.sc-ez-grid{display:flex;align-items:center;justify-content:space-between}.grid__selection-counter.sc-ez-grid{position:fixed;white-space:nowrap;transform:translate(-50%, 0px);left:50%;opacity:0;bottom:-100%;transition:opacity 0.1s, bottom 0.5s}.grid__selection-counter--opened.sc-ez-grid{opacity:1;bottom:0px}.grid__btn-close.sc-ez-grid{display:flex;align-items:center;justify-content:center;padding:0;outline:none;width:20px;height:20px;border:none;background-color:unset;cursor:pointer}.grid__btn-clear.sc-ez-grid{--ez-button--link-color:var(--color--alert-warning-900, #8C6B00);--ez-button--link--hover-color:var(--color--alert-warning-900, #8C6B00)}[no-header].sc-ez-grid-h .grid-header.sc-ez-grid{height:0;padding:0}.grid-header__pagination.sc-ez-grid{justify-content:flex-end;flex-wrap:nowrap;flex-shrink:1;flex-grow:1}.grid-header__pagination-label.sc-ez-grid{width:100%;white-space:nowrap}.overflowed.sc-ez-grid{display:none}.pagination-contracted.sc-ez-grid{width:100px}.pagination-expanded.sc-ez-grid{min-width:150px}.left__header-contracted.sc-ez-grid{width:auto}.left__header-expanded.sc-ez-grid{flex-grow:1}.grid__footer.sc-ez-grid{background-color:var(--background--xlight, #FFF);border-radius:0 0 var(--border--radius-medium) var(--border--radius-medium);box-shadow:var(--shadow--small)}.cancel-pagination.sc-ez-grid{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:4px;padding:8px;width:180px}.cancel-pagination-btn.sc-ez-grid{color:var(--color--error);font-size:var(--text--medium);font-weight:var(--text-weight--large);font-family:var(--font-pattern, Roboto);text-wrap:nowrap;cursor:pointer}.spin.sc-ez-grid{animation-name:spin;animation-duration:5000ms;animation-iteration-count:infinite;animation-timing-function:linear}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}";export{Vw as ez_grid}
309
+ var Ep="undefined"==typeof global?{}:global;Ep.HTMLElement="undefined"==typeof HTMLElement?{}:HTMLElement,Ep.HTMLButtonElement="undefined"==typeof HTMLButtonElement?{}:HTMLButtonElement,Ep.HTMLSelectElement="undefined"==typeof HTMLSelectElement?{}:HTMLSelectElement,Ep.HTMLInputElement="undefined"==typeof HTMLInputElement?{}:HTMLInputElement,Ep.Node="undefined"==typeof Node?{}:Node,Ep.MouseEvent="undefined"==typeof MouseEvent?{}:MouseEvent;var Tp=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),zp=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Np=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.watermarkMessage=void 0,i}var n;return Tp(i,t),n=i,i.prototype.validateLicense=function(){if(Wr.missingOrEmpty(n.licenseKey))this.outputMissingLicenseKey();else if(n.licenseKey.length>32){var t=n.extractLicenseComponents(n.licenseKey),i=t.license,e=t.version,r=t.isTrial;t.md5===this.md5.md5(i)?Wr.exists(e)&&e?this.validateLicenseKeyForVersion(e,!!r,i):this.validateLegacyKey(i):this.outputInvalidLicenseKey()}else this.outputInvalidLicenseKey()},i.extractExpiry=function(t){var i=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt(n.decode(i),10))},i.extractLicenseComponents=function(t){var i=t.replace(/[\u200B-\u200D\uFEFF]/g,""),e=(i=i.replace(/\r?\n|\r/g,"")).length-32,r=i.substring(e),o=i.substring(0,e),s=function(t,i){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var e,r,o=n.call(t),s=[];try{for(;(void 0===i||i-- >0)&&!(e=o.next()).done;)s.push(e.value)}catch(t){r={error:t}}finally{try{e&&!e.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s}(n.extractBracketedInformation(i),2);return{md5:r,license:o,version:s[0],isTrial:s[1]}},i.prototype.getLicenseDetails=function(t){var i=n.extractLicenseComponents(t),e=i.license,r=i.version,o=i.isTrial,s=i.md5===this.md5.md5(e),u=null;return s&&(u=n.extractExpiry(e),s=!isNaN(u.getTime())),{licenseKey:t,valid:s,expiry:s?n.formatDate(u):null,version:r||"legacy",isTrial:o}},i.prototype.isDisplayWatermark=function(){return!Wr.missingOrEmpty(this.watermarkMessage)},i.prototype.getWatermarkMessage=function(){return this.watermarkMessage||""},i.formatDate=function(t){var i=t.getDate(),n=t.getMonth(),e=t.getFullYear();return i+" "+["January","February","March","April","May","June","July","August","September","October","November","December"][n]+" "+e},i.getGridReleaseDate=function(){return new Date(parseInt(n.decode(n.RELEASE_INFORMATION),10))},i.decode=function(t){for(var i,e,r,o,s,u,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="",a=0,l=t.replace(/[^A-Za-z0-9+/=]/g,"");a<l.length;)r=h.indexOf(l.charAt(a++)),i=(15&(o=h.indexOf(l.charAt(a++))))<<4|(s=h.indexOf(l.charAt(a++)))>>2,e=(3&s)<<6|(u=h.indexOf(l.charAt(a++))),c+=String.fromCharCode(r<<2|o>>4),64!=s&&(c+=String.fromCharCode(i)),64!=u&&(c+=String.fromCharCode(e));return n.utf8_decode(c)},i.utf8_decode=function(t){t=t.replace(/rn/g,"n");for(var i="",n=0;n<t.length;n++){var e=t.charCodeAt(n);e<128?i+=String.fromCharCode(e):e>127&&e<2048?(i+=String.fromCharCode(e>>6|192),i+=String.fromCharCode(63&e|128)):(i+=String.fromCharCode(e>>12|224),i+=String.fromCharCode(e>>6&63|128),i+=String.fromCharCode(63&e|128))}return i},i.setLicenseKey=function(t){n.licenseKey=t},i.extractBracketedInformation=function(t){var i=t.split("[").filter((function(t){return t.indexOf("]")>-1})).map((function(t){return t.split("]")[0]}));if(!i||0===i.length)return[null,null];var n=1===i.filter((function(t){return"TRIAL"===t})).length;return[i.filter((function(t){return 0===t.indexOf("v")})).map((function(t){return t.replace(/^v/,"")}))[0],n]},i.prototype.validateLicenseKeyForVersion=function(t,i,n){"2"===t&&(i?this.validateForTrial(n):this.validateLegacyKey(n))},i.prototype.validateLegacyKey=function(t){var i=n.getGridReleaseDate(),e=n.extractExpiry(t),r=!1,o=!1;if(isNaN(e.getTime())||(r=!0,o=i<e),r){if(!o){var s=n.formatDate(e),u=n.formatDate(i);this.outputIncompatibleVersion(s,u)}}else this.outputInvalidLicenseKey()},i.prototype.validateForTrial=function(t){var i=n.extractExpiry(t),e=new Date,r=!1,o=!1;if(isNaN(i.getTime())||(r=!0,o=i>e),r){if(!o){var s=n.formatDate(i);this.outputExpiredTrialKey(s)}}else this.outputInvalidLicenseKey()},i.prototype.outputInvalidLicenseKey=function(){console.error("*****************************************************************************************************************"),console.error("***************************************** AG Grid Enterprise License ********************************************"),console.error("********************************************* Invalid License ***************************************************"),console.error("* Your license for AG Grid Enterprise is not valid - please contact info@ag-grid.com to obtain a valid license. *"),console.error("*****************************************************************************************************************"),console.error("*****************************************************************************************************************"),this.watermarkMessage="Invalid License"},i.prototype.outputExpiredTrialKey=function(t){console.error("****************************************************************************************************************"),console.error("***************************************** AG Grid Enterprise License *******************************************"),console.error("***************************************** Trial Period Expired. *******************************************"),console.error("* Your license for AG Grid Enterprise expired on "+t+". *"),console.error("* Please email info@ag-grid.com to purchase a license. *"),console.error("****************************************************************************************************************"),console.error("****************************************************************************************************************"),this.watermarkMessage="Trial Period Expired"},i.prototype.outputMissingLicenseKey=function(){console.error("****************************************************************************************************************"),console.error("***************************************** AG Grid Enterprise License *******************************************"),console.error("****************************************** License Key Not Found ***********************************************"),console.error("* All AG Grid Enterprise features are unlocked. *"),console.error("* This is an evaluation only version, it is not licensed for development projects intended for production. *"),console.error("* If you want to hide the watermark, please email info@ag-grid.com for a trial license. *"),console.error("****************************************************************************************************************"),console.error("****************************************************************************************************************"),this.watermarkMessage="For Trial Use Only"},i.prototype.outputIncompatibleVersion=function(t,i){console.error("****************************************************************************************************************************"),console.error("****************************************************************************************************************************"),console.error("* AG Grid Enterprise License *"),console.error("* License not compatible with installed version of AG Grid Enterprise. *"),console.error("* *"),console.error("* Your AG Grid License entitles you to all versions of AG Grid that we release within the time covered by your license *"),console.error("* - typically we provide one year licenses which entitles you to all releases / updates of AG Grid within that year. *"),console.error("* Your license has an end (expiry) date which stops the license key working with versions of AG Grid released after the *"),console.error("* license end date. The license key that you have expires on "+t+", however the version of AG Grid you *"),console.error("* are trying to use was released on "+i+". *"),console.error("* *"),console.error("* Please contact info@ag-grid.com to renew your subscription to new versions and get a new license key to work with this *"),console.error("* version of AG Grid. *"),console.error("****************************************************************************************************************************"),console.error("****************************************************************************************************************************"),this.watermarkMessage="License Expired"},i.RELEASE_INFORMATION="MTY2NzI0NjAxNTYyNw==",zp([Dt("md5")],i.prototype,"md5",void 0),zp([Mt],i.prototype,"validateLicense",null),n=zp([Pt("licenseManager")],i)}(Ai),Lp=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Bp=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Hp=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.ieCompatibility=!1,i}return Lp(i,t),i.prototype.init=function(){this.ieCompatibility="5d41402abc4b2a76b9719d911017c592"!=this.md5("hello")},i.prototype.md5cycle=function(t,i){var n=t[0],e=t[1],r=t[2],o=t[3];n=this.ff(n,e,r,o,i[0],7,-680876936),o=this.ff(o,n,e,r,i[1],12,-389564586),r=this.ff(r,o,n,e,i[2],17,606105819),e=this.ff(e,r,o,n,i[3],22,-1044525330),n=this.ff(n,e,r,o,i[4],7,-176418897),o=this.ff(o,n,e,r,i[5],12,1200080426),r=this.ff(r,o,n,e,i[6],17,-1473231341),e=this.ff(e,r,o,n,i[7],22,-45705983),n=this.ff(n,e,r,o,i[8],7,1770035416),o=this.ff(o,n,e,r,i[9],12,-1958414417),r=this.ff(r,o,n,e,i[10],17,-42063),e=this.ff(e,r,o,n,i[11],22,-1990404162),n=this.ff(n,e,r,o,i[12],7,1804603682),o=this.ff(o,n,e,r,i[13],12,-40341101),r=this.ff(r,o,n,e,i[14],17,-1502002290),e=this.ff(e,r,o,n,i[15],22,1236535329),n=this.gg(n,e,r,o,i[1],5,-165796510),o=this.gg(o,n,e,r,i[6],9,-1069501632),r=this.gg(r,o,n,e,i[11],14,643717713),e=this.gg(e,r,o,n,i[0],20,-373897302),n=this.gg(n,e,r,o,i[5],5,-701558691),o=this.gg(o,n,e,r,i[10],9,38016083),r=this.gg(r,o,n,e,i[15],14,-660478335),e=this.gg(e,r,o,n,i[4],20,-405537848),n=this.gg(n,e,r,o,i[9],5,568446438),o=this.gg(o,n,e,r,i[14],9,-1019803690),r=this.gg(r,o,n,e,i[3],14,-187363961),e=this.gg(e,r,o,n,i[8],20,1163531501),n=this.gg(n,e,r,o,i[13],5,-1444681467),o=this.gg(o,n,e,r,i[2],9,-51403784),r=this.gg(r,o,n,e,i[7],14,1735328473),e=this.gg(e,r,o,n,i[12],20,-1926607734),n=this.hh(n,e,r,o,i[5],4,-378558),o=this.hh(o,n,e,r,i[8],11,-2022574463),r=this.hh(r,o,n,e,i[11],16,1839030562),e=this.hh(e,r,o,n,i[14],23,-35309556),n=this.hh(n,e,r,o,i[1],4,-1530992060),o=this.hh(o,n,e,r,i[4],11,1272893353),r=this.hh(r,o,n,e,i[7],16,-155497632),e=this.hh(e,r,o,n,i[10],23,-1094730640),n=this.hh(n,e,r,o,i[13],4,681279174),o=this.hh(o,n,e,r,i[0],11,-358537222),r=this.hh(r,o,n,e,i[3],16,-722521979),e=this.hh(e,r,o,n,i[6],23,76029189),n=this.hh(n,e,r,o,i[9],4,-640364487),o=this.hh(o,n,e,r,i[12],11,-421815835),r=this.hh(r,o,n,e,i[15],16,530742520),e=this.hh(e,r,o,n,i[2],23,-995338651),n=this.ii(n,e,r,o,i[0],6,-198630844),o=this.ii(o,n,e,r,i[7],10,1126891415),r=this.ii(r,o,n,e,i[14],15,-1416354905),e=this.ii(e,r,o,n,i[5],21,-57434055),n=this.ii(n,e,r,o,i[12],6,1700485571),o=this.ii(o,n,e,r,i[3],10,-1894986606),r=this.ii(r,o,n,e,i[10],15,-1051523),e=this.ii(e,r,o,n,i[1],21,-2054922799),n=this.ii(n,e,r,o,i[8],6,1873313359),o=this.ii(o,n,e,r,i[15],10,-30611744),r=this.ii(r,o,n,e,i[6],15,-1560198380),e=this.ii(e,r,o,n,i[13],21,1309151649),n=this.ii(n,e,r,o,i[4],6,-145523070),o=this.ii(o,n,e,r,i[11],10,-1120210379),r=this.ii(r,o,n,e,i[2],15,718787259),e=this.ii(e,r,o,n,i[9],21,-343485551),t[0]=this.add32(n,t[0]),t[1]=this.add32(e,t[1]),t[2]=this.add32(r,t[2]),t[3]=this.add32(o,t[3])},i.prototype.cmn=function(t,i,n,e,r,o){return i=this.add32(this.add32(i,t),this.add32(e,o)),this.add32(i<<r|i>>>32-r,n)},i.prototype.ff=function(t,i,n,e,r,o,s){return this.cmn(i&n|~i&e,t,i,r,o,s)},i.prototype.gg=function(t,i,n,e,r,o,s){return this.cmn(i&e|n&~e,t,i,r,o,s)},i.prototype.hh=function(t,i,n,e,r,o,s){return this.cmn(i^n^e,t,i,r,o,s)},i.prototype.ii=function(t,i,n,e,r,o,s){return this.cmn(n^(i|~e),t,i,r,o,s)},i.prototype.md51=function(t){var i,n=t.length,e=[1732584193,-271733879,-1732584194,271733878];for(i=64;i<=t.length;i+=64)this.md5cycle(e,this.md5blk(t.substring(i-64,i)));t=t.substring(i-64);var r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i<t.length;i++)r[i>>2]|=t.charCodeAt(i)<<(i%4<<3);if(r[i>>2]|=128<<(i%4<<3),i>55)for(this.md5cycle(e,r),i=0;i<16;i++)r[i]=0;return r[14]=8*n,this.md5cycle(e,r),e},i.prototype.md5blk=function(t){for(var i=[],n=0;n<64;n+=4)i[n>>2]=t.charCodeAt(n)+(t.charCodeAt(n+1)<<8)+(t.charCodeAt(n+2)<<16)+(t.charCodeAt(n+3)<<24);return i},i.prototype.rhex=function(t){for(var i="0123456789abcdef".split(""),n="",e=0;e<4;e++)n+=i[t>>8*e+4&15]+i[t>>8*e&15];return n},i.prototype.hex=function(t){for(var i=0;i<t.length;i++)t[i]=this.rhex(t[i]);return t.join("")},i.prototype.md5=function(t){return this.hex(this.md51(t))},i.prototype.add32=function(t,i){return this.ieCompatibility?this.add32Compat(t,i):this.add32Std(t,i)},i.prototype.add32Std=function(t,i){return t+i&4294967295},i.prototype.add32Compat=function(t,i){var n=(65535&t)+(65535&i);return(t>>16)+(i>>16)+(n>>16)<<16|65535&n},Bp([Ft],i.prototype,"init",null),Bp([Pt("md5")],i)}(Ai),Wp=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Vp=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Up=function(t){function i(){return t.call(this,'<div class="ag-watermark">\n <div ref="eLicenseTextRef" class="ag-watermark-text"></div>\n </div>')||this}return Wp(i,t),i.prototype.postConstruct=function(){var t=this,i=this.shouldDisplayWatermark();this.addOrRemoveCssClass("ag-hidden",!i),i&&(this.eLicenseTextRef.innerText=this.licenseManager.getWatermarkMessage(),window.setTimeout((function(){return t.addCssClass("ag-opacity-zero")}),0),window.setTimeout((function(){return t.addCssClass("ag-hidden")}),5e3))},i.prototype.shouldDisplayWatermark=function(){var t=(this.gridOptionsWrapper.getDocument().defaultView||window).location,i=t.hostname,n=void 0===i?"":i,e=t.pathname,r=this.licenseManager.isDisplayWatermark(),o=null!=n.match("^(?:127.0.0.1|localhost|(?:w+.)?ag-grid.com)$");return!!e&&-1!==e.indexOf("forceWatermark")||r&&!o},Vp([Dt("licenseManager")],i.prototype,"licenseManager",void 0),Vp([no("eLicenseTextRef")],i.prototype,"eLicenseTextRef",void 0),Vp([Ft],i.prototype,"postConstruct",null),i}(io),Kp={moduleName:Nt.EnterpriseCoreModule,beans:[Np,Hp],agStackComponents:[{componentName:"AgWatermark",componentClass:Up}]};class $p{constructor(t){this._controller=t}clearColumnFilter(t){var i;return null!==(i=t.filter((t=>!t.name.startsWith(L))))&&void 0!==i?i:[]}interceptAction(t){var i;return t.type===o.LOADING_DATA&&B!==t.payload.source&&s.CHANGING_PAGE_LOADING_SOURCE!==t.payload.source&&(t.payload.filters=void 0!==(null===(i=t.payload)||void 0===i?void 0:i.filters)?this.clearColumnFilter(t.payload.filters):t.payload.filters,this._controller.clearFilter()),t}}class qp{handleDataSaved(t){this._options&&this._options.onPaginationUpdate(this._dataUnit.getPaginationInfo()),this._controller.clearInvalidCells(),this.handleRefreshOrReload(t),this._controller.processContinuousInsert(),this._controller.showSelectionColumn()}handleEditionCanceled(t){this._options.enableGridInsert&&this._controller.processEditionCanceled(),this.handleRefreshOrReload(t),this._controller.showSelectionColumn()}handleSavingCanceled(t){var i,n,e,r;(null===(i=t.payload)||void 0===i?void 0:i.fields)&&(null===(n=t.payload)||void 0===n?void 0:n.recordId)&&this._controller.savingCanceled(null===(e=t.payload)||void 0===e?void 0:e.fields,null===(r=t.payload)||void 0===r?void 0:r.recordId)}handleDataChanged(t){this._options.enableGridInsert?this.updateGridRowNodes(this.createRecordIdList(t)):this.handleRefresh(t)}createRecordIdList(t){var i,n;return(null===(i=t.payload)||void 0===i?void 0:i.records)?null===(n=t.payload)||void 0===n?void 0:n.records:this._dataUnit.getSelectedRecord()?[this._dataUnit.getSelectedRecord().__record__id__]:[]}updateGridRowNodes(t){const i=null==t?void 0:t.map((t=>this.getRecordById(t)));this._controller.updateRows(i)}getRecordById(t){return this._dataUnit.records.find((i=>i.__record__id__===t))}handleRefreshOrReload(t){this._dataUnit.isWaitingToReload()?this.handleReload():this.handleRefresh(t)}handleReload(){this._dataUnit.setWaitingToReload(!1),this._dataUnit.gotoPage(0)}handleRefresh(t){this.isSilentChange(t)||this._controller.refresh(t.type===o.DATA_SAVED)}handleRecordsAdded(){this._options.enableGridInsert&&(this._controller.hideSelectionColumn(),this._controller.refresh(),this.focusOnNewRecord())}focusOnNewRecord(){setTimeout((()=>{this._controller.startEditionOnLastRow()}),1e3)}updateLoadedRecords(t){const i=t.payload;(null==i?void 0:i.length)>0&&i.forEach((t=>{this._controller.changeValues(t,[t.__record__id__])}))}handleFocusFirstRow(){this._options.autoFocus&&this._controller.setFocusFirstRow()}isSilentChange(t){var i,n;return!!(null==t?void 0:t.payload)&&(t.type===o.DATA_CHANGED?null===(i=Object.keys(null==t?void 0:t.payload))||void 0===i?void 0:i.some((i=>{var n;return i.startsWith("transient.")&&t.payload[i]||(null===(n=t.payload.records)||void 0===n?void 0:n.length)>0})):t.type===o.EDITION_CANCELED?!0===(null===(n=null==t?void 0:t.payload)||void 0===n?void 0:n.silent):void 0)}constructor(t,i,n,e){var r;this.RECORD_ARCHIVE="__RECORD_ARCHIVE__",this.duObserver=t=>{var i;switch(t.type){case o.METADATA_LOADED:this._controller.setColumnsDef(this.buildColumnDefs()),null===(i=this._resolveLoading)||void 0===i||i.call(this);break;case o.LOADING_DATA:this._waitingForLoad=!0,this._controller.refresh();break;case o.DATA_LOADED:this._waitingForLoad=!1,this.callbackGetRows(this._lastLoadingParams),this._options&&this._options.onPaginationChange(this._dataUnit.getPaginationInfo(),t.payload.selectFirstRecord),this.updateSelection(),this.handleFocusFirstRow();break;case o.PAGINATION_UPDATED:this._options&&this._options.onPaginationUpdate(this._dataUnit.getPaginationInfo());break;case o.RECORDS_ADDED:case o.RECORDS_COPIED:this.handleRecordsAdded();break;case o.DATA_SAVED:this.handleDataSaved(t);break;case o.EDITION_CANCELED:this.handleEditionCanceled(t);break;case o.DATA_CHANGED:case o.DATA_RESOLVED:this.handleDataChanged(t);break;case o.RECORDS_REMOVED:this.handleRefresh(t);break;case o.SELECTION_CHANGED:case o.NEXT_SELECTED:case o.PREVIOUS_SELECTED:this.updateSelection();break;case o.RECORD_LOADED:this.updateLoadedRecords(t);break;case o.SAVING_CANCELED:this.handleSavingCanceled(t)}};try{this._resolveLoading=e,this._dataUnit=t,this._controller=i,this._controller.setColumnsDef(this.buildColumnDefs()),this._options=n,this._dataUnit.subscribe(this.duObserver),this._dataUnit.addInterceptor(new $p(this._controller))}finally{this._dataUnit.metadata&&(null===(r=this._resolveLoading)||void 0===r||r.call(this))}}updateSelection(){const t=this._dataUnit.getSelectionInfo();t.isAllRecords()?this._controller.selectAll(!0):this._controller.selectRows(t.recordIds,!0)}setAutoFocus(t){this._options.autoFocus=t}setEnableGridInsert(t){this._options.enableGridInsert=t}getRows(t){this.needReload(t)?(this._lastLoadingParams=t,this._dataUnit.loadData(this.quickFilter,void 0,!0,B).then((()=>this.updateSelection()))):(this._lastLoadingParams=t,this._waitingForLoad||(this.callbackGetRows(t),this.updateSelection()))}needReload(t){return!!this._lastLoadingParams&&u.objectToString(t.request)!=u.objectToString(this._lastLoadingParams.request)}callbackGetRows(t){t&&t.success({rowData:this._dataUnit.records})}destroy(){this._dataUnit.unsubscribe(this.duObserver)}registryListeners(){var t,i;null===(t=this._dataUnit)||void 0===t||t.unsubscribe(this.duObserver),null===(i=this._dataUnit)||void 0===i||i.subscribe(this.duObserver)}getDescriptionField(t,i){const n=`${i}.${t}`;return this._dataUnit.metadata.fields.find((t=>t.name===n))}buildColumnDefs(){try{const t=this._controller.getGridConfig()||[],i=[];return this._dataUnit.metadata&&(this._dataUnit.metadata.fields.sort(((i,n)=>t.findIndex((t=>t.name===i.name))-t.findIndex((t=>t.name===n.name)))),this._dataUnit.metadata.fields.forEach((t=>{var n,e,r,o,s,u;if(!1!==t.visible&&t.name!==this.RECORD_ARCHIVE){const c=new Map,a=this._dataUnit.getField(t.name).properties;for(const t in a)c.set(t,a[t]);const l={label:t.label,name:t.name,userInterface:t.userInterface,options:null===(n=this._dataUnit.getField(t.name).properties)||void 0===n?void 0:n.options,props:c};if(i.push(l),t.userInterface===h.SEARCHPLUS&&(null===(e=t.properties)||void 0===e?void 0:e.DESCRIPTIONFIELD)){const n=this.getDescriptionField(null===(r=t.properties)||void 0===r?void 0:r.DESCRIPTIONFIELD,null===(o=t.properties)||void 0===o?void 0:o.ENTITYNAME);if(n)n.label=`${null===(s=t.properties)||void 0===s?void 0:s.DESCRIPTIONFIELDLABEL} (${null===(u=t.properties)||void 0===u?void 0:u.DESCRIPTIONENTITY})`;else{const n=this.buildDescriptionColumn(t);i.push(n),t.properties[H]=n.name}}}}))),i}catch(t){console.warn(t)}}buildDescriptionColumn(t){var i,n,e,r;const o=new Map;o.set(W,t.name);const s=`${null===(i=t.properties)||void 0===i?void 0:i.ENTITYNAME}.${null===(n=t.properties)||void 0===n?void 0:n.DESCRIPTIONFIELD}`;return this._dataUnit.addSourceFieldValue(s,t.name),{label:`${null===(e=t.properties)||void 0===e?void 0:e.DESCRIPTIONFIELDLABEL} (${null===(r=t.properties)||void 0===r?void 0:r.DESCRIPTIONENTITY})`,name:s,userInterface:h.SHORTTEXT,props:o}}}class Yp{init(t){var i;this.params=t,this.element=document.createElement("div"),this.element.classList.add("ag-cell-label-container"),this.element.setAttribute("title",null!==(i=this.params.tooltip)&&void 0!==i?i:""),this.element.innerHTML=`\n <div id='filter-column-${t.column.getColId()}-${t.context.dataUnit.dataUnitId}' class='ez-flex ez-flex--justify-between'>\n <i id='ez-grid-filter-icon' class='ez-icon-filter' style='color:#008561'></i> \n <i id='ez-grid-menu-icon' class='ez-icon-dots-vertical'></i> \n </div>\n <div id='ez-header-container' class='ez-flex ez-flex--justify-between ag-header-cell-text'>\n <span class='ag-header-cell-text'>${this.params.displayName}</span>\n <i id='ez-grid-sort-icon-descendente' class='ez-icon-ordem-descendente' style='display: none;font-weight: 100;margin-left: 4px;font-size: var(--text--large, 14px);align-self: center;'></i>\n <i id='ez-grid-sort-icon-ascendente' class='ez-icon-ordem-ascendente' style='display: none;font-weight: 100;margin-left: 4px;font-size: var(--text--large, 14px);align-self: center;'></i>\n </div>\n `,this.configMenuClick(),this.configSortClick(),this.configSortListener(),this.configFilterButton()}refresh(t){this.params=t,this.configFilterButton(),this.configSortIcon()}configFilterButton(){this.filterButton=this.element.querySelector("#ez-grid-filter-icon"),this.filterButton.style.display=this.params.hasFilter()?"flex":"none",this.onFilterButtonClickListener=this.onClickFilter.bind(this),this.filterButton.addEventListener("click",this.onFilterButtonClickListener)}onClickFilter(){var t;this.params.showColumnFilter(null===(t=this.filterButton)||void 0===t?void 0:t.getBoundingClientRect().left)}configSortIcon(){this.sortDownIcon.style.display=this.params.column.isSortDescending()?"flex":"none",this.sortUpIcon.style.display=this.params.column.isSortAscending()?"flex":"none"}configSortListener(){this.params.enableSorting&&(this.sortUpIcon=this.element.querySelector("#ez-grid-sort-icon-ascendente"),this.sortDownIcon=this.element.querySelector("#ez-grid-sort-icon-descendente"),this.onSortChangedListener=this.configSortIcon.bind(this),this.params.column.addEventListener("sortChanged",this.onSortChangedListener),this.configSortIcon())}onSortClick(t){this.params.progressSort(t.shiftKey)}configSortClick(){this.params.column.getColDef().sortable&&(this.headerContainer=this.element.querySelector("#ez-header-container"),this.onSortClickListener=this.onSortClick.bind(this),this.headerContainer.addEventListener("click",this.onSortClickListener))}onMenuClick(){this.params.showColumnMenu(this.menuButton)}configMenuClick(){this.menuButton=this.element.querySelector("#ez-grid-menu-icon"),this.onMenuClickListener=this.onMenuClick.bind(this),this.menuButton.addEventListener("click",this.onMenuClickListener)}getGui(){return this.element}destroy(){this.onMenuClickListener&&this.menuButton.removeEventListener("click",this.onMenuClickListener),this.onSortClickListener&&this.headerContainer.removeEventListener("click",this.onSortClickListener),this.onFilterButtonClickListener&&this.filterButton.removeEventListener("click",this.onFilterButtonClickListener),this.params.column.removeEventListener("sortChanged",this.onSortChangedListener),this.params.column.removeEventListener("applyFilterColumnOptions",this.onFilterAppliedListener)}}class Jp{constructor(){this.DEFAULT_COLOR="transparent",this._eGui=void 0}init(t){this.renderStatus(t)}refresh(t){return this.renderStatus(t),!1}destroy(){this._eGui=void 0}getGui(){return this._eGui}resolveColor(t,i){let n;if(t instanceof Function)n=t(i);else{const e=Object.keys(t)[0],r=t[e],o=i[e];n=null!=r&&null!=o&&r[o]}return n||this.DEFAULT_COLOR}renderStatus(t){const{data:i,statusResolver:n}=null!=t?t:{};if(null==n)return;const e=this.resolveColor(n,i);this._eGui=document.createElement("div"),this._eGui.innerHTML=`\n <span class="ez-grid__cell-status" style="background-color: ${e||""};"></span>\n `}}class Zp{updateCheckbox(){this.updatingValue=!0;try{const t=this.headerCheckStatusGetter();this.checkBox.indeterminate=null==t,this.checkBox.value=t}finally{this.updatingValue=!1}}init(t){t.context.selectionHeader=this;const i=t.context.headerCheckStatusSetter;this.headerCheckStatusGetter=t.context.headerCheckStatusGetter,this.element=document.createElement("div"),this.element.classList.add("ag-header__selection-checkbox"),this.checkBox=document.createElement("ez-check"),this.checkBox.style.setProperty("--ez-check--focus--background-color","transparent"),this.checkBox.style.setProperty("--ez-check--hover--background-color","transparent"),this.element.append(this.checkBox),this.updateCheckbox(),this.element.addEventListener("ezChange",(t=>{this.updatingValue||i(t.detail)}))}getGui(){return this.element}destroy(){this.element.remove(),this.element=null}refresh(t){return!1}}const Xp=(t,i,n,e)=>Object.assign(Object.assign({},P(t)),{eGridCell:i,dataUnit:n,editionManager:e}),Qp=({name:t,contextName:i})=>{const n=c.parseElement(`<ez-text-input\n class="ez-grid grid_editor"\n data-field-name=${t}\n data-context-name=${i}\n mode="slim"\n />`);return n.autoFocus=!0,n};function tg(t,i,n){const e=c.parseElement(`<ez-number-input\n class="ez-grid grid_editor"\n enabled=${!t}\n precision=${i}\n pretty-precision=${n}\n mode="slim"\n />`);return e.valueGetter=()=>e.getValueAsync(),e.autoFocus=!0,e}function ig(t){let i=t;for(;i;){const t=i.querySelector("[ref=eBodyViewport]");if(t)return t.getBoundingClientRect().bottom;i=i.parentElement}}const ng=new Map([[!0,{value:"S",label:"Sim"}],[!1,{value:"N",label:"Não"}]]),eg=({required:t,props:i,eGridCell:n})=>{const e=null==i?void 0:i.options;let r;if("string"==typeof e){const t=JSON.parse(e);r=Object.keys(t).map((i=>({value:i,label:t[i]})))}else r=e;const o=c.parseElement(`<ez-combo-box\n class="grid_editor"\n suppress-empty-option=${t}\n mode="slim"\n />`);return o.options=r,o.stopPropagateEnterKeyEvent=!0,o.listOptionsPosition={verticalPosition:29,bottomLimit:ig(n),hardPosition:!0},o.autoFocus=!0,o},rg=t=>{const i=eg(Object.assign(Object.assign({},t),{props:Object.assign(Object.assign({},t.props),{options:Array.from(ng.values())})}));return i.valueGetter=()=>{const t=i.value;if(null!=t)return"S"==t.value},i.valueSetter=t=>{null!=t&&(i.value=ng.get(t))},i},og=new Map;og.set(h.DATE,(()=>{const t=c.parseElement('<ez-date-input\n class="ez-grid grid_editor"\n mode="slim"\n data-is-fixed="true"\n />');return t.valueGetter=()=>t.getValueAsync(),t.autoFocus=!0,t})),og.set(h.TIME,(({readOnly:t})=>{const i=c.parseElement(`<ez-time-input\n class="ez-grid grid_editor"\n enabled=${!t}\n mode="slim"\n />`);return i.valueGetter=()=>{const t=i.value;return parseInt(t)<=2359?t:null},i.valueSetter=t=>{const n=parseInt(t)<=2359;return i.value=n?t:null},i})),og.set(h.DATETIME,(({readOnly:t})=>{const i=c.parseElement(`<ez-date-time-input\n class="ez-grid grid_editor"\n mode="slim"\n enabled=${!t}\n data-is-fixed="true"\n />`);return i.valueGetter=()=>i.getValueAsync(),i})),og.set(h.DECIMALNUMBER,(({readOnly:t,props:i})=>{var n,e;const r=Number(null!==(n=null==i?void 0:i.precision)&&void 0!==n?n:2);return tg(t,r,Number(null!==(e=null==i?void 0:i.prettyPrecision)&&void 0!==e?e:r))})),og.set(h.INTEGERNUMBER,(({readOnly:t})=>tg(t,0,0))),og.set(h.SWITCH,rg),og.set(h.CHECKBOX,rg),og.set(h.OPTIONSELECTOR,eg),og.set(h.LONGTEXT,(({eGridCell:t,editionManager:i})=>{const n=c.parseElement('<ez-text-area\n can-show-error="false"\n enable-resize="true"\n />');return n.addEventListener("keydown",(t=>function(t,i,n){if(function(t){return[t.key,t.code].includes("Enter")}(t)){if(t.ctrlKey)return i.appendTextToSelection("\n"),void t.preventDefault();n.navigateByEnterKey(t)}}(t,n,i))),function(t,i){const{width:n}=t.getBoundingClientRect();i.style.minWidth=(n>210?n:210)-12+"px",i.style.resize="both"}(t,n),n.isPopUp=!0,n.autoFocus=!0,n})),og.set(h.SEARCH,(({name:t,required:i,readOnly:n,eGridCell:e,dataUnit:r})=>{var o;const s=c.parseElement(`<ez-search\n class="ez-grid grid_editor"\n mode="slim"\n suppress-empty-option=${i}\n enabled=${!n}\n />`),u=a.getContextValue("__EZUI__SEARCH__OPTION__LOADER__"),h=r.getField(t);return s.optionLoader=i=>u(i,t,r),s.ensureClearButtonVisible=!0,s.suppressPreLoad=!0,s.listOptionsPosition={verticalPosition:29,bottomLimit:ig(e),hardPosition:!0},s.stopPropagateEnterKeyEvent=!0,s.ignoreLimitCharsToSearch=l.getBooleanValue(null===(o=null==h?void 0:h.properties)||void 0===o?void 0:o.ignoreLimitCharsToSearch),s.autoFocus=!0,s.valueGetter=()=>s.getValueAsync(),s})),og.set(h.SEARCHPLUS,(({name:t,required:i,readOnly:n,dataUnit:e})=>{const r=c.parseElement(`<ez-search-plus\n class="ez-grid grid_editor"\n mode="slim"\n suppress-empty-option=${i}\n enabled=${!n}\n hide-description-input=true\n />`),o=a.getContextValue("__EZUI__SEARCH__PLUS__OPTION__LOADER__");return r.optionLoader=i=>o(i,t,e),r.autoFocus=!0,r.valueGetter=()=>r.getValueAsync(),r}));class sg{init(t){this._rowData=t.data;const i=t.column.getColId(),n=t.context.dataUnit;this._fieldMetadata=Xp(n.getField(i),t.eGridCell,n,t.context.editionManager);const e=og.get(this._fieldMetadata.userInterface)||Qp;this._gui=e(this._fieldMetadata),null!=this._gui.valueSetter?this._gui.valueSetter(t.value):this._gui.value=t.value}getGui(){return this._gui}afterGuiAttached(){this.focusIn()}focusIn(){this._gui.focus(),this._gui.setFocus({selectText:!0})}getValue(){return null!=this._gui.valueGetter?this._gui.valueGetter():this._gui.value}setGuiValue(t){null!=this._gui.valueSetter?this._gui.valueSetter(t):this._gui.value=t}isPopup(){return this._gui.isPopUp}getFieldMetadata(){return this._fieldMetadata}getRecord(){return this._rowData}}class ug extends sg{init(t){var i,n;this._value=t.value,this._fieldName=t.column.getColId(),this._customEditorInstance=t.customEditorsInfo.customEditor,super.init(t),this._defaultGui=this.getDefaultGui();const e=super.getFieldMetadata();this._params={cellPossition:ig(t.eGridCell),eGridCell:t.eGridCell,value:t.value,charPress:t.charPress,currentEditor:this._defaultGui,name:this._fieldName,source:F.GRID,detailContext:t.customEditorsInfo.detailContext,setValue:t=>this.setValue(t),getValue:()=>this.getValue(),record:super.getRecord(),editorMetadata:{hidden:!1===(null===(i=e.props)||void 0===i?void 0:i.visible),label:e.label,userInterface:e.userInterface,props:e.props,optionLoader:e.optionLoader,options:(null===(n=e.props)||void 0===n?void 0:n.options)||{}}}}getDefaultGui(){const t=super.getGui();return t.value=this._value,t.onkeyup=t=>{this.setValue(t.target.value)},t}getGui(){const t=this._customEditorInstance.getEditorElement(this._params);return t?"string"==typeof t?c.parseElement(t):(this._customGui=t,t):this._defaultGui}setValue(t){this._value=t}getValue(){var t,i;return(null===(t=this._customGui)||void 0===t?void 0:t.getValue)?this._customGui.getValue():(null===(i=this._customGui)||void 0===i?void 0:i.hasAttribute("value"))?this._customGui.value:this._value}afterGuiAttached(){this.focusIn()}focusIn(){V.resolveFocus(this._customGui)}}class hg{init(t){const i=document.createElement("span");this._currentParams=t,i.textContent=t.value;const n=t.column.getColId(),e=t.context.dataUnit;this._fieldMetadata=Xp(e.getField(n),t.eGridCell,e,t.context.editionManager),this._gui=i}refresh(){try{return this._currentParams.refreshCell(),!0}catch(t){return!1}}getGui(){return this._gui}afterGuiAttached(){this.focusIn()}focusIn(){this._gui.focus(),this._gui.setFocus({selectText:!0})}getValue(){return this._currentParams.getValue()}isPopup(){return this._gui.isPopUp}getFieldMetadata(){return this._fieldMetadata}}class cg extends hg{init(t){var i,n;this._fieldName=t.column.getColId(),this._customRenderInstance=t.customRendersInfo.customRender,super.init(t);const e=super.getFieldMetadata();this._params={value:t.value,charPress:"",currentRender:super.getGui(),name:this._fieldName,source:k.GRID,getValue:()=>t.getValue(),detailContext:t.customRendersInfo.detailContext,renderMetadata:{hidden:!1===(null===(i=e.props)||void 0===i?void 0:i.visible),label:e.label,userInterface:e.userInterface,props:e.props,optionLoader:e.optionLoader,options:(null===(n=e.props)||void 0===n?void 0:n.options)||{}}}}getGui(){const t=this._customRenderInstance.getRenderElement(this._params);return t?"string"==typeof t?c.parseElement(t):t:super.getGui()}}class ag{constructor(t,i,n,e,r,o,s,u,h){this._inProgressChanges=[],this._dataUnit=t,this._recordValidationProcessor=new D(this._dataUnit,{getRequiredFields:()=>this.getRequiredFields(),markAsInvalid:(t,i)=>{this.pushInvalidCell(t,i)},getMessageForField:()=>null},n),this._useEnterLikeTab=i,this._editionIsDisabled=e,this._enableContinuousInsert=s,this._enableGridInsert=u,this._customEditors=r,this._customRenders=o,this._lockerId=h}configureGrid(t){return this._gridOptions=t,t.readOnlyEdit=!0,t.onCellEditRequest=t=>this.onCellEditRequest(t),t.onCellEditingStarted=async t=>{var i;this._dataUnit.hasNewRecord()?this.handleCellEditingStartedRowAdd(t):this._lastCellOpened=this._lastCellEdited={rowIndex:t.rowIndex,column:t.column,rowPinned:void 0},null===(i=this._currentEditLock)||void 0===i||i.call(this),this._currentEditLock=f.lock(this._lockerId,d.TASKBAR_CLICK)},t.onCellEditingStopped=()=>{var t;null===(t=this._currentEditLock)||void 0===t||t.call(this)},t.onCellKeyDown=t=>{t.event&&t.column&&this.onCellKeyDown(t)},t.isRowSelectable=t=>this.isSelectableRow(t),t.onCellFocused=()=>this.lockFocusWhenAddRow(),t}updateCurrentEditorGuiValue(t){const i=this._gridOptions.api.getCellEditorInstances();if(!i||!i.length)return;const n=i[0],e=n.getFieldMetadata();n.setGuiValue(t[e.name])}lockFocusWhenAddRow(){var t,i,n,e;const r=this._gridOptions.api,o=r.getFocusedCell(),s=null==o?void 0:o.rowIndex,u=null===(i=null===(t=this._dataUnit.getAddedRecords())||void 0===t?void 0:t[0])||void 0===i?void 0:i.__record__id__,h=r.getRowNode(u);if(!this._dataUnit.hasNewRecord()||s==(null==h?void 0:h.rowIndex))return;const c=null!==(e=null!==(n=this._lastCellOpened)&&void 0!==n?n:this._lastCellEdited)&&void 0!==e?e:this._lastCellClicked;(null==c?void 0:c.rowIndex)<(null==h?void 0:h.rowIndex)||(r.clearFocusedCell(),c&&null!=(null==h?void 0:h.rowIndex)&&(c.rowIndex=null==h?void 0:h.rowIndex,this.focusOnCell(c)))}handleCellEditingStartedRowAdd(t){var i,n,e,r,o;const s=null===(i=t.node)||void 0===i?void 0:i.id,u=null===(e=null===(n=this._dataUnit.getAddedRecords())||void 0===n?void 0:n[0])||void 0===e?void 0:e.__record__id__;if(s==u)return void(this._lastCellOpened=this._lastCellEdited={rowIndex:t.rowIndex,column:null==t?void 0:t.column,rowPinned:void 0});t.api.stopEditing();const h=null===(r=t.api.getRowNode(u))||void 0===r?void 0:r.rowIndex;this._lastCellOpened=this._lastCellEdited={rowIndex:h,column:null===(o=this._lastCellEdited)||void 0===o?void 0:o.column,rowPinned:void 0}}isSelectableRow(t){return!this._dataUnit.hasNewRecord()||!!this._dataUnit.isNewRecord(t.id)}canContinuousInsert(){var t;return this._enableContinuousInsert&&this._dataUnit.records.length-1===(null===(t=this._lastCellEdited)||void 0===t?void 0:t.rowIndex)}async proceedAutoSave(){var t;if(await new Promise((t=>setTimeout(t,100))),this._inProgressChanges.length&&await Promise.all(null===(t=this._inProgressChanges)||void 0===t?void 0:t.map((({promise:t})=>t))),!this._dataUnit.isDirty())return this.saveSuccess(),!0;if(null==this._dataUnit.getSelectedRecord())return!0;this.clearInvalidCells(!1);try{return await this._recordValidationProcessor.validate(!0),await this.saveDataUnit(),this.saveSuccess(),!0}catch(t){return this.saveFail(t),!1}}async saveDataUnit(){return await this._dataUnit.saveData(),!0}async recordValidate(){if(this._dataUnit.isDirty()){try{this.clearInvalidCells(!1),await this._recordValidationProcessor.validate(!1)}catch(t){}this._gridOptions.api.refreshCells({force:!0})}}navigateByEnterKey(t){const i=t.shiftKey;if(this._useEnterLikeTab)i?this._gridOptions.api.tabToPreviousCell(t):this._gridOptions.api.tabToNextCell(t);else{const t=this._gridOptions.api.getEditingCells()[0];if(t){let{rowIndex:n}=t;this.nextEditionRow(n,t.column,i)}}}getComponents(){return{ezCellEditor:sg}}verifyClickToEdition(t,i){var n,e;const r=null===(n=this._dataUnit.getSelectedRecord())||void 0===n?void 0:n.__record__id__;this._dataUnit.hasNewRecord()&&r&&(null===(e=t.getRowNode(r))||void 0===e?void 0:e.rowIndex)!=i.rowIndex||(this.isSecondClick(i)&&t.startEditingCell({rowIndex:i.rowIndex,colKey:i.column.getColId()}),this._lastCellClicked=i)}configureColumn(t){return t.cellEditor="ezCellEditor",0!=t.editable&&(t.editable=t=>this.canEdit(t)),t.suppressKeyboardEvent=t=>t.event.key===xr.ESCAPE&&t.editing?this._dataUnit.isDirty():t.event.key===xr.ENTER,t.cellEditorSelector=t=>{var i;if(null===(i=this._customEditors)||void 0===i?void 0:i.has(t.colDef.field)){const i=this._customEditors.get(t.colDef.field);return{component:ug,params:{customEditorsInfo:i}}}},t.cellRendererSelector=t=>{var i;if(null===(i=this._customRenders)||void 0===i?void 0:i.has(t.colDef.field)){const i=this._customRenders.get(t.colDef.field);return{component:cg,params:{customRendersInfo:i}}}},t}getRequiredFields(){const t=this.getFormRequiredFields();return this._gridOptions.columnApi.getAllDisplayedColumns().filter((i=>{const n=this._dataUnit.getField(i.getColId());return n&&n.required||t.includes(i.getColId())})).map((t=>t.getColId()))}getFormRequiredFields(){const t=[];return I.getDataBindersByDataUnit(this._dataUnit).forEach((i=>{t.push(...i.getFormRequiredFields())})),t}saveSuccess(){var t;this.focusOnCell(this._targetEditionCell),void 0!==(null===(t=this._targetEditionCell)||void 0===t?void 0:t.rowIndex)&&this._dataUnit.setSelectionByIndex([this._targetEditionCell.rowIndex]),this._lastCellEdited=void 0,this._targetEditionCell=void 0,this._isGridEdition=!1}saveFail(t){var i;if(this.focusOnCell(null!==(i=this._lastCellOpened)&&void 0!==i?i:this._lastCellEdited),this._isGridEdition=!1,t)throw t}focusOnCell(t){var i;if(null==t)return;const{rowIndex:n,column:e}=t;null===(i=this._gridOptions.api.getDisplayedRowAtIndex(n))||void 0===i||i.setSelected(!0,!0),this._gridOptions.api.clearRangeSelection(),this._gridOptions.api.addCellRange({rowStartIndex:n,rowEndIndex:n,columns:[e]}),this._gridOptions.api.startEditingCell({colKey:e.getColId(),rowIndex:n}),this._gridOptions.api.setFocusedCell(n,e.getColId());const r=this._gridOptions.api.getCellEditorInstances()[0];r&&r.focusIn()}onCellKeyDown(t){const i=t.event;switch(i.key){case xr.ENTER:this.processEnterKey(i,t);break;case xr.UP:this.editPreviousRow(t.api);break;case xr.DOWN:this.editNextRow(t.api)}}processEnterKey(t,i){i.api.getEditingCells()[0]?this.navigateByEnterKey(t):i.api.startEditingCell({colKey:i.column.getColId(),rowIndex:i.rowIndex})}nextEditionRow(t,i,n){if(n)(t-=1)<0&&(t=this._dataUnit.records.length-1);else{const i=t;(t+=1)>=this._dataUnit.records.length&&(t=this._enableGridInsert?i:0)}this._targetEditionCell=new lg(t,i,!0),this.finishEdition()}editPreviousRow(t){this.moveEditionVertically(t,-1)}editNextRow(t){this.moveEditionVertically(t,1)}moveEditionVertically(t,i){if(this._dataUnit.hasNewRecord()&&this._isGridEdition)return;const n=t.getEditingCells()[0];if(!n)return;const e=n.rowIndex+i;t.getDisplayedRowAtIndex(e)&&(this._targetEditionCell=new lg(e,n.column,i<0),this.finishEdition())}finishEdition(){this._gridOptions.api.stopEditing(),setTimeout((()=>{this.proceedAutoSave()}),0)}canEdit(t){return!this._editionIsDisabled()&&this.isColEditable(t.colDef.field)}isColEditable(t){const i=this._dataUnit.getField(t);return!(!i||this.isTypeFile(i)||i.readOnly)}isTypeFile(t){return t.userInterface===h.FILE}isSecondClick(t){return!!this._lastCellClicked&&this._lastCellClicked.column==t.column&&this._lastCellClicked.rowIndex==t.rowIndex}onCellEditRequest(t){var i;const n=t.newValue;if(t.oldValue!=n){if(n instanceof Promise){const i={promise:void 0,resolve:()=>{}};return i.promise=new Promise((t=>{i.resolve=t})),this._inProgressChanges.push(i),void this.handlePromiseValue(t,n)}this.updateCellValue(t,n)}else null===(i=this._currentEditLock)||void 0===i||i.call(this)}async handlePromiseValue(t,i){const n=t.colDef.field,e=this._dataUnit.getField(t.colDef.colId),r=(null==e?void 0:e.userInterface)===h.SEARCH?i:t.oldValue;t.node.setData(Object.assign(Object.assign({},t.data),{[n]:r}));const o=await i;return this.updateCellValue(t,o)}async updateCellValue(t,i){var n,e,r;const o=t.colDef.field,s=this._dataUnit.getField(o);""==i&&i!=this._dataUnit.getFieldValue(o)&&(null==s?void 0:s.userInterface)===h.SEARCH&&(i=this._dataUnit.getFieldValue(o));const u={[o]:i},c=null===(n=null==s?void 0:s.properties)||void 0===n?void 0:n[H];l.isEmpty(c)||(u[c]=null==i?void 0:i.label),t.node.setData(Object.assign(Object.assign({},t.data),{[o]:i})),null===(e=this._currentEditLock)||void 0===e||e.call(this),t.oldValue!==i&&(this._isGridEdition=!0,await this._dataUnit.setFieldValue(o,i,[t.data.__record__id__],{suppressCreateNewRecord:!0}),this._lastCellEdited={rowIndex:t.rowIndex,column:t.column,rowPinned:void 0}),null===(r=this._inProgressChanges)||void 0===r||r.forEach((({resolve:t})=>t(i)))}setCellEditors(t){var i;this._customEditors=t,null===(i=this._gridOptions)||void 0===i||i.api.stopEditing()}setCellRenders(t){this._customRenders=t}pushInvalidCell(t,i){this._invalidCells.push({field:t,recordId:i}),this._nextInvalidCell=this._invalidCells[0]}getInvalidCells(){return this._invalidCells}getNextInvalidCell(){return this._nextInvalidCell}async processContinuousInsert(){this.canContinuousInsert()&&this._dataUnit.addRecord()}clearInvalidCells(t){this._invalidCells=[],this._nextInvalidCell=void 0,t&&(this._isGridEdition=!1)}setEnableContinuousInsert(t){this._enableContinuousInsert=t}hasInvalidField(t,i){return!!this.hasInvalidCell()&&(this._nextInvalidCell=this._invalidCells[0],this._nextInvalidCell.field.name===t&&this._nextInvalidCell.recordId===i)}hasInvalidCell(){var t,i,n;const e=(null===(t=this._invalidCells)||void 0===t?void 0:t.length)>0,r=null===(i=this._invalidCells)||void 0===i?void 0:i.filter((()=>{})),o=null===(n=this._invalidCells)||void 0===n?void 0:n.filter((()=>{}));return!!(e&&r&&o)}}class lg{constructor(t,i,n){this.rowPinned=null,this.rowIndex=t,this.column=i,this.backwards=n}}var fg,dg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),vg=function(){return vg=Object.assign||function(t){for(var i,n=1,e=arguments.length;n<e;n++)for(var r in i=arguments[n])Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r]);return t},vg.apply(this,arguments)},pg=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},gg=function(t,i){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var e,r,o=n.call(t),s=[];try{for(;(void 0===i||i-- >0)&&!(e=o.next()).done;)s.push(e.value)}catch(t){r={error:t}}finally{try{e&&!e.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},mg=function(){for(var t=[],i=0;i<arguments.length;i++)t=t.concat(gg(arguments[i]));return t},bg=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.cellRanges=[],i.bodyScrollListener=i.onBodyScroll.bind(i),i.dragging=!1,i.intersectionRange=!1,i}return dg(i,t),i.prototype.init=function(){var t=this;this.addManagedListener(this.eventService,xi.EVENT_NEW_COLUMNS_LOADED,(function(){return t.onColumnsChanged()})),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_VISIBLE,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_VALUE_CHANGED,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PIVOT_MODE_CHANGED,(function(){return t.removeAllCellRanges()})),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_ROW_GROUP_CHANGED,(function(){return t.removeAllCellRanges()})),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PIVOT_CHANGED,(function(){return t.removeAllCellRanges()})),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_GROUP_OPENED,this.refreshLastRangeStart.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_MOVED,this.refreshLastRangeStart.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PINNED,this.refreshLastRangeStart.bind(this)),this.ctrlsService.whenReady((function(){var i=t.ctrlsService.getGridBodyCtrl();t.autoScrollService=new lh({scrollContainer:i.getBodyViewportElement(),scrollAxis:"xy",getVerticalPosition:function(){return i.getScrollFeature().getVScrollPosition().top},setVerticalPosition:function(t){return i.getScrollFeature().setVerticalScrollPosition(t)},getHorizontalPosition:function(){return i.getScrollFeature().getHScrollPosition().left},setHorizontalPosition:function(t){return i.getScrollFeature().setHorizontalScrollPosition(t)},shouldSkipVerticalScroll:function(){return t.gridOptionsWrapper.getDomLayout()!==Vt.DOM_LAYOUT_NORMAL},shouldSkipHorizontalScroll:function(){return i.getScrollFeature().isHorizontalScrollShowing()}})}))},i.prototype.onColumnsChanged=function(){var t=this;this.refreshLastRangeStart();var i=this.columnModel.getAllDisplayedColumns();this.cellRanges.forEach((function(n){var e=n.columns;n.columns=n.columns.filter((function(t){return t.isVisible()&&-1!==i.indexOf(t)})),!Wr.areEqual(e,n.columns)&&t.dispatchChangedEvent(!1,!0,n.id)}));var n=this.cellRanges.length;this.cellRanges=this.cellRanges.filter((function(t){return t.columns.length>0})),n>this.cellRanges.length&&this.dispatchChangedEvent(!1,!0)},i.prototype.refreshLastRangeStart=function(){var t=Wr.last(this.cellRanges);t&&this.refreshRangeStart(t)},i.prototype.isContiguousRange=function(t){var i=t.columns;if(!i.length)return!1;var n=this.columnModel.getAllDisplayedColumns(),e=i.map((function(t){return n.indexOf(t)})).sort((function(t,i){return t-i}));return Wr.last(e)-e[0]+1===i.length},i.prototype.getRangeStartRow=function(t){return t.startRow&&t.endRow?this.rowPositionUtils.before(t.startRow,t.endRow)?t.startRow:t.endRow:{rowIndex:0,rowPinned:this.pinnedRowModel.getPinnedTopRowCount()>0?Vt.PINNED_TOP:null}},i.prototype.getRangeEndRow=function(t){if(t.startRow&&t.endRow)return this.rowPositionUtils.before(t.startRow,t.endRow)?t.endRow:t.startRow;var i=this.pinnedRowModel.getPinnedBottomRowCount();return i>0?{rowIndex:i-1,rowPinned:Vt.PINNED_BOTTOM}:{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}},i.prototype.setRangeToCell=function(t,i){if(void 0===i&&(i=!1),this.gridOptionsWrapper.isEnableRangeSelection()){var n=this.calculateColumnsBetween(t.column,t.column);if(n){(this.gridOptionsWrapper.isSuppressMultiRangeSelection()||!i||Wr.missing(this.cellRanges))&&this.removeAllCellRanges(!0);var e={rowIndex:t.rowIndex,rowPinned:t.rowPinned};this.cellRanges.push({startRow:e,endRow:e,columns:n,startColumn:t.column}),this.setNewestRangeStartCell(t),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}}},i.prototype.extendLatestRangeToCell=function(t){if(!this.isEmpty()&&this.newestRangeStartCell){var i=Wr.last(this.cellRanges);this.updateRangeEnd(i,t)}},i.prototype.updateRangeEnd=function(t,i,n){void 0===n&&(n=!1);var e=this.calculateColumnsBetween(t.startColumn,i.column);e&&!this.isLastCellOfRange(t,i)&&(t.columns=e,t.endRow={rowIndex:i.rowIndex,rowPinned:i.rowPinned},n||this.dispatchChangedEvent(!0,!0,t.id))},i.prototype.refreshRangeStart=function(t){var i=t.startColumn,n=t.columns,e=function(i,n){var e=t.columns.filter((function(t){return t!==i}));i?(t.startColumn=i,t.columns=n?mg([i],e):mg(e,[i])):t.columns=e},r=this.getRangeEdgeColumns(t),o=r.left,s=r.right;i===n[0]&&i!==o?e(o,!0):i===Wr.last(n)&&i===s&&e(s,!1)},i.prototype.getRangeEdgeColumns=function(t){var i=this.columnModel.getAllDisplayedColumns(),n=t.columns.map((function(t){return i.indexOf(t)})).filter((function(t){return t>-1})).sort((function(t,i){return t-i}));return{left:i[n[0]],right:i[Wr.last(n)]}},i.prototype.extendLatestRangeInDirection=function(t){if(!this.isEmpty()&&this.newestRangeStartCell){var i=t.key,n=t.ctrlKey||t.metaKey,e=Wr.last(this.cellRanges),r=this.newestRangeStartCell,o=e.columns[0],s=Wr.last(e.columns),u=this.cellNavigationService.getNextCellToFocus(i,{column:r.column===o?s:o,rowIndex:e.endRow.rowIndex,rowPinned:e.endRow.rowPinned},n);if(u)return this.setCellRange({rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:u.rowIndex,rowEndPinned:u.rowPinned,columnStart:r.column,columnEnd:u.column}),u}},i.prototype.setCellRange=function(t){this.gridOptionsWrapper.isEnableRangeSelection()&&(this.removeAllCellRanges(!0),this.addCellRange(t))},i.prototype.setCellRanges=function(t){var i=this;Wr.shallowCompare(this.cellRanges,t)||(this.removeAllCellRanges(!0),t.forEach((function(t){t.columns&&t.startRow&&i.setNewestRangeStartCell({rowIndex:t.startRow.rowIndex,rowPinned:t.startRow.rowPinned,column:t.columns[0]}),i.cellRanges.push(t)})),this.dispatchChangedEvent(!1,!0))},i.prototype.setNewestRangeStartCell=function(t){this.newestRangeStartCell=t},i.prototype.clearCellRangeCellValues=function(t){var i=this;t||(t=this.cellRanges),t.forEach((function(t){i.forEachRowInRange(t,(function(n){var e=i.rowPositionUtils.getRowNode(n);if(e)for(var r=0;r<t.columns.length;r++){var o=i.columnModel.getGridColumn(t.columns[r]);if(!o||!o.isCellEditable(e))return;e.setDataValue(o,null,"rangeService")}}))}))},i.prototype.createCellRangeFromCellRangeParams=function(t){var i,n=this,e=!1;if(t.columns)i=t.columns.map((function(t){return n.columnModel.getColumnWithValidation(t)})).filter((function(t){return t}));else{var r=this.columnModel.getColumnWithValidation(t.columnStart),o=this.columnModel.getColumnWithValidation(t.columnEnd);if(!r||!o)return;(i=this.calculateColumnsBetween(r,o))&&i.length&&(e=i[0]!==r)}if(i)return{startRow:null!=t.rowStartIndex?{rowIndex:t.rowStartIndex,rowPinned:t.rowStartPinned||null}:void 0,endRow:null!=t.rowEndIndex?{rowIndex:t.rowEndIndex,rowPinned:t.rowEndPinned||null}:void 0,columns:i,startColumn:e?Wr.last(i):i[0]}},i.prototype.addCellRange=function(t){if(this.gridOptionsWrapper.isEnableRangeSelection()){var i=this.createCellRangeFromCellRangeParams(t);i&&(i.startRow&&this.setNewestRangeStartCell({rowIndex:i.startRow.rowIndex,rowPinned:i.startRow.rowPinned,column:i.startColumn}),this.cellRanges.push(i),this.dispatchChangedEvent(!1,!0,i.id))}},i.prototype.getCellRanges=function(){return this.cellRanges},i.prototype.isEmpty=function(){return 0===this.cellRanges.length},i.prototype.isMoreThanOneCell=function(){var t=this.cellRanges.length;if(0===t)return!1;if(t>1)return!0;var i=this.cellRanges[0],n=this.getRangeStartRow(i),e=this.getRangeEndRow(i);return n.rowPinned!==e.rowPinned||n.rowIndex!==e.rowIndex||1!==i.columns.length},i.prototype.areAllRangesAbleToMerge=function(){var t,i,n,e=this,r=new Map;if(this.cellRanges.length<=1)return!0;this.cellRanges.forEach((function(t){e.forEachRowInRange(t,(function(i){var n=(i.rowPinned||"normal")+"_"+i.rowIndex,e=r.get(n),o=t.columns.map((function(t){return t.getId()}));if(e){var s=o.filter((function(t){return-1===e.indexOf(t)}));e.push.apply(e,mg(s))}else r.set(n,o)}))}));try{for(var o=function(t){var i="function"==typeof Symbol&&Symbol.iterator,n=i&&t[i],e=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")}(r.values()),s=o.next();!s.done;s=o.next()){var u=s.value.sort().join();if(void 0!==n){if(n!==u)return!1}else n=u}}catch(i){t={error:i}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return!0},i.prototype.forEachRowInRange=function(t,i){for(var n=this.getRangeStartRow(t),e=this.getRangeEndRow(t),r=n;r&&(i(r),!this.rowPositionUtils.sameRow(r,e));)r=this.cellNavigationService.getRowBelow(r)},i.prototype.removeAllCellRanges=function(t){this.isEmpty()||(this.onDragStop(),this.cellRanges.length=0,t||this.dispatchChangedEvent(!1,!0))},i.prototype.onBodyScroll=function(){this.dragging&&this.lastMouseEvent&&this.onDragging(this.lastMouseEvent)},i.prototype.isCellInAnyRange=function(t){return this.getCellRangeCount(t)>0},i.prototype.isCellInSpecificRange=function(t,i){var n=null!==i.columns&&Wr.includes(i.columns,t.column),e=this.isRowInRange(t.rowIndex,t.rowPinned,i);return n&&e},i.prototype.isLastCellOfRange=function(t,i){var n=t.startRow,e=t.endRow,r=this.rowPositionUtils.before(n,e)?e:n,o=i.rowIndex===r.rowIndex&&i.rowPinned===r.rowPinned,s=t.columns[0],u=Wr.last(t.columns);return i.column===(t.startColumn===s?u:s)&&o},i.prototype.isBottomRightCell=function(t,i){var n=this.columnModel.getAllDisplayedColumns(),e=t.columns.map((function(t){return n.indexOf(t)})).sort((function(t,i){return t-i})),r=t.startRow,o=t.endRow,s=this.rowPositionUtils.before(r,o)?o:r,u=n.indexOf(i.column)===Wr.last(e),h=i.rowIndex===s.rowIndex&&Wr.makeNull(i.rowPinned)===Wr.makeNull(s.rowPinned);return u&&h},i.prototype.getCellRangeCount=function(t){var i=this;return this.isEmpty()?0:this.cellRanges.filter((function(n){return i.isCellInSpecificRange(t,n)})).length},i.prototype.isRowInRange=function(t,i,n){var e=this.getRangeStartRow(n),r=this.getRangeEndRow(n),o={rowIndex:t,rowPinned:i||null};if(o.rowIndex===e.rowIndex&&o.rowPinned==e.rowPinned||o.rowIndex===r.rowIndex&&o.rowPinned==r.rowPinned)return!0;var s=!this.rowPositionUtils.before(o,e),u=this.rowPositionUtils.before(o,r);return s&&u},i.prototype.getDraggingRange=function(){return this.draggingRange},i.prototype.onDragStart=function(t){if(this.gridOptionsWrapper.isEnableRangeSelection()){var i=t.shiftKey,n=t.ctrlKey||t.metaKey,e=!this.gridOptionsWrapper.isSuppressMultiRangeSelection()&&n,r=i&&Wr.existsAndNotEmpty(this.cellRanges);if(e||r&&!Wr.exists(Wr.last(this.cellRanges).type)||this.removeAllCellRanges(!0),this.cellHoverListener=this.addManagedListener(this.ctrlsService.getGridCtrl().getGui(),"mousemove",this.updateValuesOnMove.bind(this)),this.updateValuesOnMove(t),this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=t,this.intersectionRange=e&&this.getCellRangeCount(this.lastCellHovered)>1,r||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=Wr.last(this.cellRanges);else{var o={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned};this.draggingRange={startRow:o,endRow:o,columns:[this.lastCellHovered.column],startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsService.getGridBodyCtrl().addScrollEventListener(this.bodyScrollListener),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}}},i.prototype.intersectLastRange=function(t){var i=this;if(!(t&&this.dragging||this.gridOptionsWrapper.isSuppressMultiRangeSelection()||this.isEmpty())){var n=Wr.last(this.cellRanges),e=this.getRangeStartRow(n),r=this.getRangeEndRow(n),o=[];this.cellRanges.slice(0,-1).forEach((function(t){var s=i.getRangeStartRow(t),u=i.getRangeEndRow(t),h=t.columns,c=h.filter((function(t){return-1===n.columns.indexOf(t)}));if(c.length!==h.length)if(i.rowPositionUtils.before(r,s)||i.rowPositionUtils.before(u,e))o.push(t);else{var a=o.length;if(i.rowPositionUtils.before(s,e)){var l={columns:mg(h),startColumn:n.startColumn,startRow:vg({},s),endRow:i.cellNavigationService.getRowAbove(e)};o.push(l)}if(c.length>0){var f={columns:c,startColumn:Wr.includes(c,n.startColumn)?n.startColumn:c[0],startRow:i.rowPositionUtils.rowMax([vg({},e),vg({},s)]),endRow:i.rowPositionUtils.rowMin([vg({},r),vg({},u)])};o.push(f)}i.rowPositionUtils.before(r,u)&&o.push({columns:mg(h),startColumn:n.startColumn,startRow:i.cellNavigationService.getRowBelow(r),endRow:vg({},u)}),o.length-a==1&&(o[o.length-1].id=t.id)}else o.push(t)})),this.cellRanges=o,t&&this.dispatchChangedEvent(!1,!0)}},i.prototype.updateValuesOnMove=function(t){var i=this.mouseEventService.getCellPositionForEvent(t);this.cellHasChanged=!1,!i||this.lastCellHovered&&this.cellPositionUtils.equals(i,this.lastCellHovered)||(this.lastCellHovered&&(this.cellHasChanged=!0),this.lastCellHovered=i)},i.prototype.onDragging=function(t){var i=this;if(this.dragging&&t){this.lastMouseEvent=t;var n=this.lastCellHovered,e=function(t){return n&&n.rowPinned===t&&i.newestRangeStartCell.rowPinned===t},r=e("top")||e("bottom");if(this.autoScrollService.check(t,r),this.cellHasChanged){var o=this.calculateColumnsBetween(this.newestRangeStartCell.column,n.column);o&&(this.draggingRange.endRow={rowIndex:n.rowIndex,rowPinned:n.rowPinned},this.draggingRange.columns=o,this.dispatchChangedEvent(!1,!1,this.draggingRange.id))}}},i.prototype.onDragStop=function(){if(this.cellHoverListener&&(this.cellHoverListener(),this.cellHoverListener=void 0),this.dragging){var t=this.draggingRange.id;this.autoScrollService.ensureCleared(),this.ctrlsService.getGridBodyCtrl().removeScrollEventListener(this.bodyScrollListener),this.lastMouseEvent=null,this.dragging=!1,this.draggingRange=void 0,this.lastCellHovered=void 0,this.intersectionRange&&(this.intersectionRange=!1,this.intersectLastRange()),this.dispatchChangedEvent(!1,!0,t)}},i.prototype.dispatchChangedEvent=function(t,i,n){var e=Object.freeze({type:xi.EVENT_RANGE_SELECTION_CHANGED,started:t,finished:i,id:n});this.eventService.dispatchEvent(e)},i.prototype.calculateColumnsBetween=function(t,i){var n=this.columnModel.getAllDisplayedColumns(),e=t===i,r=n.indexOf(t);if(r<0)console.warn("AG Grid: column "+t.getId()+" is not visible");else{var o=e?r:n.indexOf(i);if(!(o<0)){if(e)return[t];for(var s=Math.min(r,o),u=s===r?o:r,h=[],c=s;c<=u;c++)h.push(n[c]);return h}console.warn("AG Grid: column "+i.getId()+" is not visible")}},pg([Dt("rowModel")],i.prototype,"rowModel",void 0),pg([Dt("columnModel")],i.prototype,"columnModel",void 0),pg([Dt("mouseEventService")],i.prototype,"mouseEventService",void 0),pg([Dt("cellNavigationService")],i.prototype,"cellNavigationService",void 0),pg([Dt("pinnedRowModel")],i.prototype,"pinnedRowModel",void 0),pg([Dt("rowPositionUtils")],i.prototype,"rowPositionUtils",void 0),pg([Dt("cellPositionUtils")],i.prototype,"cellPositionUtils",void 0),pg([Dt("ctrlsService")],i.prototype,"ctrlsService",void 0),pg([Ft],i.prototype,"init",null),pg([Pt("rangeService")],i)}(Ai),wg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),yg=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Cg=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.changedCalculatedValues=!1,i.dragging=!1,i.shouldDestroyOnEndDragging=!1,i}return wg(i,t),i.prototype.init=function(){var t=this;this.dragService.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragStart:this.onDragStart.bind(this),onDragging:function(i){t.dragging=!0,t.rangeService.autoScrollService.check(i),t.changedCalculatedValues&&(t.onDrag(i),t.changedCalculatedValues=!1)},onDragStop:function(i){t.dragging=!1,t.onDragEnd(i),t.clearValues(),t.rangeService.autoScrollService.ensureCleared(),document.body.classList.remove(t.getDraggingCssClass()),t.shouldDestroyOnEndDragging&&t.destroy()}}),this.addManagedListener(this.getGui(),"mousedown",this.preventRangeExtension.bind(this))},i.prototype.isDragging=function(){return this.dragging},i.prototype.getCellCtrl=function(){return this.cellCtrl},i.prototype.setCellCtrl=function(t){this.cellCtrl=t},i.prototype.getCellRange=function(){return this.cellRange},i.prototype.setCellRange=function(t){this.cellRange=t},i.prototype.getRangeStartRow=function(){return this.rangeStartRow},i.prototype.setRangeStartRow=function(t){this.rangeStartRow=t},i.prototype.getRangeEndRow=function(){return this.rangeEndRow},i.prototype.setRangeEndRow=function(t){this.rangeEndRow=t},i.prototype.getLastCellHovered=function(){return this.lastCellHovered},i.prototype.preventRangeExtension=function(t){t.preventDefault(),t.stopPropagation()},i.prototype.onDragStart=function(){this.cellHoverListener=this.addManagedListener(this.ctrlsService.getGridCtrl().getGui(),"mousemove",this.updateValuesOnMove.bind(this)),document.body.classList.add(this.getDraggingCssClass())},i.prototype.getDraggingCssClass=function(){return"ag-dragging-"+(this.type===wh.FILL?"fill":"range")+"-handle"},i.prototype.updateValuesOnMove=function(t){var i=this.mouseEventService.getCellPositionForEvent(t);!i||this.lastCellHovered&&this.cellPositionUtils.equals(i,this.lastCellHovered)||(this.lastCellHovered=i,this.changedCalculatedValues=!0)},i.prototype.getType=function(){return this.type},i.prototype.refresh=function(t){var i=this.getCellCtrl(),n=this.getGui(),e=Wr.last(this.rangeService.getCellRanges()),r=e.startRow,o=e.endRow;if(r&&o&&(this.rowPositionUtils.before(o,r)?(this.setRangeStartRow(o),this.setRangeEndRow(r)):(this.setRangeStartRow(r),this.setRangeEndRow(o))),i!==t||!Wr.isVisible(n)){this.setCellCtrl(t);var s=t.getComp().getParentOfValue();s&&s.appendChild(n)}this.setCellRange(e)},i.prototype.clearValues=function(){this.lastCellHovered=void 0,this.removeListeners()},i.prototype.removeListeners=function(){this.cellHoverListener&&(this.cellHoverListener(),this.cellHoverListener=void 0)},i.prototype.destroy=function(){if(!this.shouldDestroyOnEndDragging&&this.isDragging())return Wr.setDisplayed(this.getGui(),!1),void(this.shouldDestroyOnEndDragging=!0);this.shouldDestroyOnEndDragging=!1,t.prototype.destroy.call(this),this.removeListeners();var i=this.getGui();i.parentElement&&i.parentElement.removeChild(i)},yg([Dt("rowRenderer")],i.prototype,"rowRenderer",void 0),yg([Dt("dragService")],i.prototype,"dragService",void 0),yg([Dt("rangeService")],i.prototype,"rangeService",void 0),yg([Dt("mouseEventService")],i.prototype,"mouseEventService",void 0),yg([Dt("columnModel")],i.prototype,"columnModel",void 0),yg([Dt("cellNavigationService")],i.prototype,"cellNavigationService",void 0),yg([Dt("navigationService")],i.prototype,"navigationService",void 0),yg([Dt("rowPositionUtils")],i.prototype,"rowPositionUtils",void 0),yg([Dt("cellPositionUtils")],i.prototype,"cellPositionUtils",void 0),yg([Dt("ctrlsService")],i.prototype,"ctrlsService",void 0),yg([Ft],i.prototype,"init",null),i}(io),Sg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Rg=function(){return Rg=Object.assign||function(t){for(var i,n=1,e=arguments.length;n<e;n++)for(var r in i=arguments[n])Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r]);return t},Rg.apply(this,arguments)},Og=function(t,i){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var e,r,o=n.call(t),s=[];try{for(;(void 0===i||i-- >0)&&!(e=o.next()).done;)s.push(e.value)}catch(t){r={error:t}}finally{try{e&&!e.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},Ag=function(t){function i(){var n=t.call(this,i.TEMPLATE)||this;return n.markedCells=[],n.cellValues=[],n.isUp=!1,n.isLeft=!1,n.isReduce=!1,n.type=wh.FILL,n}return Sg(i,t),i.prototype.updateValuesOnMove=function(i){t.prototype.updateValuesOnMove.call(this,i),this.initialXY||(this.initialXY=this.mouseEventService.getNormalisedPosition(i));var n,e=this.initialXY,r=e.x,o=e.y,s=this.mouseEventService.getNormalisedPosition(i),u=s.y,h=Math.abs(r-s.x),c=Math.abs(o-u),a=this.gridOptionsWrapper.getFillHandleDirection();(n="xy"===a?h>c?"x":"y":a)!==this.dragAxis&&(this.dragAxis=n,this.changedCalculatedValues=!0)},i.prototype.onDrag=function(){if(!this.initialPosition){var t=this.getCellCtrl();if(!t)return;this.initialPosition=t.getCellPosition()}var i=this.getLastCellHovered();i&&this.markPathFrom(this.initialPosition,i)},i.prototype.onDragEnd=function(t){if(this.initialXY=null,this.markedCells.length){var i,n="x"===this.dragAxis,e=this.getCellRange(),r=e.columns.length,o=this.getRangeStartRow(),s=this.getRangeEndRow();if(this.isUp||this.isLeft){var u=n?o:this.lastCellMarked;i=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:u.rowIndex,rowStartPinned:u.rowPinned,columnStart:n?this.lastCellMarked.column:e.columns[0],rowEndIndex:s.rowIndex,rowEndPinned:s.rowPinned,columnEnd:e.columns[r-1]})}else i=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:o.rowIndex,rowStartPinned:o.rowPinned,columnStart:e.columns[0],rowEndIndex:n?s.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:n?s.rowPinned:this.lastCellMarked.rowPinned,columnEnd:n?this.lastCellMarked.column:e.columns[r-1]});i&&(this.raiseFillStartEvent(),this.handleValueChanged(e,i,t),this.rangeService.setCellRanges([i]),this.raiseFillEndEvent(e,i))}},i.prototype.raiseFillStartEvent=function(){this.eventService.dispatchEvent({type:xi.EVENT_FILL_START})},i.prototype.raiseFillEndEvent=function(t,i){this.eventService.dispatchEvent({type:xi.EVENT_FILL_END,initialRange:t,finalRange:i})},i.prototype.handleValueChanged=function(t,i,n){var e=this,r=this.rangeService.getRangeEndRow(t),o=this.rangeService.getRangeStartRow(t),s=this.rangeService.getRangeEndRow(i),u=this.rangeService.getRangeStartRow(i),h="y"===this.dragAxis;if(!this.isReduce||this.gridOptionsWrapper.isSuppressClearOnFillReduction()){var c=!0,a=[],l=[],f=0,d=function(){a.length=0,l.length=0,f=0},v=function(i,n){var l=e.isUp?r:o,f=!1;h&&(c=!0,d());for(var v=function(){var v=e.rowPositionUtils.getRowNode(l);if(!v)return"break";h&&i?p(a,i,v,(function(){return!e.rowPositionUtils.sameRow(l,e.isUp?o:r)})):n&&(c=!0,d(),n.forEach((function(i){return p(a,i,v,(function(){return i!==(e.isLeft?t.columns[0]:Wr.last(t.columns))}))}))),f=e.rowPositionUtils.sameRow(l,e.isUp?u:s),l=e.isUp?e.cellNavigationService.getRowAbove(l):e.cellNavigationService.getRowBelow(l)};!f&&l&&"break"!==v(););},p=function(t,i,r,o){var s,u=!1;if(c)s=e.getValueFromObject(e.valueService.getValue(i,r)),l.push(s),c=o();else{var h=e.processValues(n,t,l,i,r,f++),a=h.fromUserFunction;if(s=h.value,i.isCellEditable(r)){var d=e.getValueFromObject(e.valueService.getValue(i,r));a&&d===s?u=!0:r.setDataValue(i,s,"rangeService")}}u||t.push(s)};h?t.columns.forEach((function(t){v(t)})):(g=this.isLeft?function(){for(var t=[],i=0;i<arguments.length;i++)t=t.concat(Og(arguments[i]));return t}(i.columns).reverse():i.columns,v(void 0,g))}else{var g=h?t.columns:t.columns.filter((function(t){return i.columns.indexOf(t)<0})),m=h?this.cellNavigationService.getRowBelow(s):u;m&&this.clearCellsInRange(m,r,g)}},i.prototype.clearCellsInRange=function(t,i,n){this.rangeService.clearCellRangeCellValues([{startRow:t,endRow:i,columns:n,startColumn:n[0]}])},i.prototype.processValues=function(t,i,n,e,r,o){var s,u=this.gridOptionsWrapper.getFillOperation();if(s="y"===this.dragAxis?this.isUp?"up":"down":this.isLeft?"left":"right",u){var h=u({event:t,values:i,initialValues:n,currentIndex:o,currentCellValue:this.valueService.getValue(e,r),direction:s,column:e,rowNode:r});if(!1!==h)return{value:h,fromUserFunction:!0}}var c=i.map(this.getValueFromObject),a=!c.some((function(t){var i=parseFloat(t);return isNaN(i)||i.toString()!==t.toString()}));if(t.altKey||!a){if(a&&1===n.length){var l=this.isUp||this.isLeft?-1:1;return{value:parseFloat(Wr.last(c))+1*l,fromUserFunction:!1}}return{value:c[o%c.length],fromUserFunction:!1}}return{value:Wr.last(Wr.findLineByLeastSquares(c.map(Number))),fromUserFunction:!1}},i.prototype.getValueFromObject=function(t){return null!=t&&"object"==typeof t?t.toString():t},i.prototype.clearValues=function(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,t.prototype.clearValues.call(this)},i.prototype.clearMarkedPath=function(){this.markedCells.forEach((function(t){if(t.isAlive()){var i=t.getComp();i.addOrRemoveCssClass("ag-selection-fill-top",!1),i.addOrRemoveCssClass("ag-selection-fill-right",!1),i.addOrRemoveCssClass("ag-selection-fill-bottom",!1),i.addOrRemoveCssClass("ag-selection-fill-left",!1)}})),this.markedCells.length=0,this.isUp=!1,this.isLeft=!1,this.isReduce=!1},i.prototype.clearCellValues=function(){this.cellValues.length=0},i.prototype.markPathFrom=function(t,i){if(this.clearMarkedPath(),this.clearCellValues(),"y"===this.dragAxis){if(this.rowPositionUtils.sameRow(i,t))return;var n=this.rowPositionUtils.before(i,t),e=this.getRangeStartRow(),r=this.getRangeEndRow();n&&(i.rowPinned==e.rowPinned&&i.rowIndex>=e.rowIndex||e.rowPinned!=r.rowPinned&&i.rowPinned==r.rowPinned&&i.rowIndex<=r.rowIndex)?(this.reduceVertical(t,i),this.isReduce=!0):(this.extendVertical(t,i,n),this.isReduce=!1)}else{var o=t.column,s=i.column;if(o===s)return;var u=this.columnModel.getAllDisplayedColumns(),h=u.indexOf(o),c=u.indexOf(s);c<=h&&c>=u.indexOf(this.getCellRange().columns[0])?(this.reduceHorizontal(t,i),this.isReduce=!0):(this.extendHorizontal(t,i,c<h),this.isReduce=!1)}this.lastCellMarked=i},i.prototype.extendVertical=function(t,i,n){var e=this.navigationService,r=this.rangeService,o=t;do{for(var s=this.getCellRange(),u=s.columns.length,h=0;h<u;h++){var c=s.columns[h],a=Rg(Rg({},{rowIndex:o.rowIndex,rowPinned:o.rowPinned}),{column:c}),l=r.isCellInSpecificRange(a,s),f=this.rowPositionUtils.sameRow(o,t);if(n&&(this.isUp=!0),!f){var d=e.getCellByPosition(a);if(d){this.markedCells.push(d);var v=d.getComp();l||(v.addOrRemoveCssClass("ag-selection-fill-left",0===h),v.addOrRemoveCssClass("ag-selection-fill-right",h===u-1)),v.addOrRemoveCssClass(n?"ag-selection-fill-top":"ag-selection-fill-bottom",this.rowPositionUtils.sameRow(o,i))}}}if(this.rowPositionUtils.sameRow(o,i))break}while(o=n?this.cellNavigationService.getRowAbove(o):this.cellNavigationService.getRowBelow(o))},i.prototype.reduceVertical=function(t,i){var n=t;do{for(var e=this.getCellRange(),r=e.columns.length,o=this.rowPositionUtils.sameRow(n,i),s=0;s<r;s++){var u=Rg(Rg({},{rowIndex:n.rowIndex,rowPinned:n.rowPinned}),{column:e.columns[s]}),h=this.navigationService.getCellByPosition(u);h&&(this.markedCells.push(h),h.getComp().addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(n,i)))}if(o)break}while(n=this.cellNavigationService.getRowAbove(n))},i.prototype.extendHorizontal=function(t,i,n){var e=this,r=this.columnModel.getAllDisplayedColumns(),o=r.indexOf(n?i.column:t.column),s=r.indexOf(n?this.getCellRange().columns[0]:i.column),u=n?0:1,h=r.slice(o+u,s+u),c=this.getRangeStartRow(),a=this.getRangeEndRow();h.forEach((function(t){var i=c,r=!1;do{r=e.rowPositionUtils.sameRow(i,a);var o=e.navigationService.getCellByPosition({rowIndex:i.rowIndex,rowPinned:i.rowPinned,column:t});if(o){e.markedCells.push(o);var s=o.getComp();s.addOrRemoveCssClass("ag-selection-fill-top",e.rowPositionUtils.sameRow(i,c)),s.addOrRemoveCssClass("ag-selection-fill-bottom",e.rowPositionUtils.sameRow(i,a)),n?(e.isLeft=!0,s.addOrRemoveCssClass("ag-selection-fill-left",t===h[0])):s.addOrRemoveCssClass("ag-selection-fill-right",t===Wr.last(h))}i=e.cellNavigationService.getRowBelow(i)}while(!r)}))},i.prototype.reduceHorizontal=function(t,i){var n=this,e=this.columnModel.getAllDisplayedColumns(),r=e.indexOf(i.column),o=e.indexOf(t.column),s=e.slice(r,o),u=this.getRangeStartRow(),h=this.getRangeEndRow();s.forEach((function(t){var i=u,e=!1;do{e=n.rowPositionUtils.sameRow(i,h);var r=n.navigationService.getCellByPosition({rowIndex:i.rowIndex,rowPinned:i.rowPinned,column:t});r&&(n.markedCells.push(r),r.getComp().addOrRemoveCssClass("ag-selection-fill-right",t===s[0])),i=n.cellNavigationService.getRowBelow(i)}while(!e)}))},i.prototype.refresh=function(i){var n=this.rangeService.getCellRanges()[0];n.startRow&&n.endRow?t.prototype.refresh.call(this,i):this.destroy()},i.TEMPLATE='<div class="ag-fill-handle"></div>',function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);o>3&&s&&Object.defineProperty(i,n,s)}([Dt("valueService")],i.prototype,"valueService",void 0),i}(Cg),jg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),_g=function(){return _g=Object.assign||function(t){for(var i,n=1,e=arguments.length;n<e;n++)for(var r in i=arguments[n])Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r]);return t},_g.apply(this,arguments)},Gg=function(t){function i(){var n=t.call(this,i.TEMPLATE)||this;return n.type=wh.RANGE,n.rangeFixed=!1,n}return jg(i,t),i.prototype.onDrag=function(){var t=this.getLastCellHovered();if(t){var i=this.rangeService.getCellRanges(),n=Wr.last(i);this.rangeFixed||(this.fixRangeStartEnd(n),this.rangeFixed=!0),this.endPosition={rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:t.column},2===i.length&&i[0].type===yh.DIMENSION&&n.type===yh.VALUE&&!this.rowPositionUtils.sameRow(this.endPosition,this.rangeService.getRangeEndRow(n))&&this.rangeService.updateRangeEnd(i[0],_g(_g({},this.endPosition),{column:i[0].columns[0]}),!0),this.rangeService.extendLatestRangeToCell(this.endPosition)}},i.prototype.onDragEnd=function(){var t=Wr.last(this.rangeService.getCellRanges());this.fixRangeStartEnd(t),this.rangeFixed=!1},i.prototype.fixRangeStartEnd=function(t){var i=this.rangeService.getRangeStartRow(t),n=this.rangeService.getRangeEndRow(t),e=t.columns[0];t.startRow=i,t.endRow=n,t.startColumn=e},i.TEMPLATE='<div class="ag-range-handle"></div>',i}(Cg),xg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Mg=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return xg(i,t),i.prototype.createSelectionHandle=function(t){return this.createBean(t===wh.RANGE?new Gg:new Ag)},function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s}([Pt("selectionHandleFactory")],i)}(Ai),Fg={moduleName:Nt.RangeSelectionModule,beans:[bg,Mg],agStackComponents:[{componentName:"AgFillHandle",componentClass:Ag},{componentName:"AgRangeHandle",componentClass:Gg}],dependantModules:[Kp]},kg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Pg=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Dg=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.onRowHeightChanged_debounced=Wr.debounce(i.onRowHeightChanged.bind(i),100),i.pauseStoreUpdateListening=!1,i.started=!1,i}return kg(i,t),i.prototype.ensureRowHeightsValid=function(){return!1},i.prototype.start=function(){this.started=!0;var t=this.gridOptionsWrapper.getServerSideDatasource();t&&this.setDatasource(t)},i.prototype.destroyDatasource=function(){this.datasource&&(this.datasource.destroy&&this.datasource.destroy(),this.rowRenderer.datasourceChanged(),this.datasource=void 0)},i.prototype.addEventListeners=function(){this.addManagedListener(this.eventService,xi.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverything.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_STORE_UPDATED,this.onStoreUpdated.bind(this));var t=this.resetRootStore.bind(this);this.addManagedListener(this.eventService,xi.EVENT_COLUMN_VALUE_CHANGED,t),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PIVOT_CHANGED,t),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_ROW_GROUP_CHANGED,t),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PIVOT_MODE_CHANGED,t),this.verifyProps()},i.prototype.verifyProps=function(){null!=this.gridOptionsWrapper.getInitialGroupOrderComparator()&&Wr.doOnce((function(){return console.warn("AG Grid: initialGroupOrderComparator cannot be used with Server Side Row Model. If using Full Store, then provide the rows to the grid in the desired sort order. If using Infinite Scroll, then sorting is done on the server side, nothing to do with the client.")}),"SSRM.InitialGroupOrderComparator"),this.gridOptionsWrapper.isRowSelection()&&null==this.gridOptionsWrapper.getRowIdFunc()&&Wr.doOnce((function(){return console.warn("AG Grid: getRowId callback must be provided for Server Side Row Model selection to work correctly.")}),"SSRM.SelectionNeedsRowNodeIdFunc")},i.prototype.setDatasource=function(t){this.started&&(this.destroyDatasource(),this.datasource=t,this.resetRootStore())},i.prototype.isLastRowIndexKnown=function(){var t=this.getRootStore();return!!t&&t.isLastRowIndexKnown()},i.prototype.onColumnEverything=function(){if(!this.gridOptionsWrapper.isSuppressEnterpriseResetOnNewColumns())if(this.storeParams){var t=this.columnsToValueObjects(this.columnModel.getRowGroupColumns()),i=this.columnsToValueObjects(this.columnModel.getValueColumns()),n=this.columnsToValueObjects(this.columnModel.getPivotColumns()),e=!Wr.jsonEquals(this.storeParams.sortModel,this.sortController.getSortModel()),r=!Wr.jsonEquals(this.storeParams.rowGroupCols,t),o=!Wr.jsonEquals(this.storeParams.pivotCols,n),s=!Wr.jsonEquals(this.storeParams.valueCols,i);(e||r||o||s)&&this.resetRootStore()}else this.resetRootStore()},i.prototype.destroyRootStore=function(){this.rootNode&&this.rootNode.childStore&&(this.rootNode.childStore=this.destroyBean(this.rootNode.childStore),this.nodeManager.clear())},i.prototype.refreshAfterSort=function(t,i){this.storeParams&&(this.storeParams.sortModel=t);var n=this.getRootStore();n&&(n.refreshAfterSort(i),this.onStoreUpdated())},i.prototype.resetRootStore=function(){this.destroyRootStore(),this.rootNode=new Ws(this.beans),this.rootNode.group=!0,this.rootNode.level=-1,this.datasource&&(this.storeParams=this.createStoreParams(),this.rootNode.childStore=this.createBean(this.storeFactory.createStore(this.storeParams,this.rootNode)),this.updateRowIndexesAndBounds()),this.eventService.dispatchEvent({type:xi.EVENT_ROW_DATA_UPDATED}),this.dispatchModelUpdated(!0)},i.prototype.columnsToValueObjects=function(t){var i=this;return t.map((function(t){return{id:t.getId(),aggFunc:t.getAggFunc(),displayName:i.columnModel.getDisplayNameForColumn(t,"model"),field:t.getColDef().field}}))},i.prototype.createStoreParams=function(){var t=this.columnsToValueObjects(this.columnModel.getRowGroupColumns()),i=this.columnsToValueObjects(this.columnModel.getValueColumns()),n=this.columnsToValueObjects(this.columnModel.getPivotColumns()),e=this.gridOptionsWrapper.isDynamicRowHeight();return{valueCols:i,rowGroupCols:t,pivotCols:n,pivotMode:this.columnModel.isPivotMode(),filterModel:this.filterManager.getFilterModel(),sortModel:this.sortListener.extractSortModel(),datasource:this.datasource,lastAccessedSequence:new Vr,dynamicRowHeight:e}},i.prototype.getParams=function(){return this.storeParams},i.prototype.dispatchModelUpdated=function(t){void 0===t&&(t=!1),this.eventService.dispatchEvent({type:xi.EVENT_MODEL_UPDATED,animate:!t,keepRenderedRows:!t,newPage:!1,newData:!1})},i.prototype.onStoreUpdated=function(){this.pauseStoreUpdateListening||(this.updateRowIndexesAndBounds(),this.dispatchModelUpdated())},i.prototype.onRowHeightChangedDebounced=function(){this.onRowHeightChanged_debounced()},i.prototype.onRowHeightChanged=function(){this.updateRowIndexesAndBounds(),this.dispatchModelUpdated()},i.prototype.updateRowIndexesAndBounds=function(){var t=this.getRootStore();t&&t.setDisplayIndexes(new Vr,{value:0})},i.prototype.retryLoads=function(){var t=this.getRootStore();t&&(t.retryLoads(),this.onStoreUpdated())},i.prototype.getRow=function(t){var i=this.getRootStore();if(i)return i.getRowUsingDisplayIndex(t)},i.prototype.expandAll=function(t){this.pauseStoreUpdateListening=!0,this.forEachNode((function(i){i.group&&!i.stub&&i.setExpanded(t)})),this.pauseStoreUpdateListening=!1,this.onStoreUpdated()},i.prototype.refreshAfterFilter=function(t,i){this.storeParams&&(this.storeParams.filterModel=t);var n=this.getRootStore();n&&(n.refreshAfterFilter(i),this.onStoreUpdated())},i.prototype.getRootStore=function(){if(this.rootNode&&this.rootNode.childStore)return this.rootNode.childStore},i.prototype.getRowCount=function(){var t=this.getRootStore();return t?t.getDisplayIndexEnd():0},i.prototype.getTopLevelRowCount=function(){var t=this.getRootStore();return t?t.getRowCount():1},i.prototype.getTopLevelRowDisplayedIndex=function(t){var i=this.getRootStore();return i?i.getTopLevelRowDisplayedIndex(t):t},i.prototype.getRowBounds=function(t){var i=this.getRootStore();return i?i.getRowBounds(t):{rowTop:0,rowHeight:this.gridOptionsWrapper.getRowHeightAsNumber()}},i.prototype.getRowIndexAtPixel=function(t){var i=this.getRootStore();return t<=0||!i?0:i.getRowIndexAtPixel(t)},i.prototype.isEmpty=function(){return!1},i.prototype.isRowsToRender=function(){return null!=this.getRootStore()&&this.getRowCount()>0},i.prototype.getType=function(){return Vt.ROW_MODEL_TYPE_SERVER_SIDE},i.prototype.forEachNode=function(t){var i=this.getRootStore();i&&i.forEachNodeDeep(t)},i.prototype.forEachNodeAfterFilterAndSort=function(t){var i=this.getRootStore();i&&i.forEachNodeDeepAfterFilterAndSort(t)},i.prototype.executeOnStore=function(t,i){var n=this.getRootStore();if(n){var e=n.getChildStore(t);e&&i(e)}},i.prototype.refreshStore=function(t){void 0===t&&(t={}),this.executeOnStore(t.route?t.route:[],(function(i){return i.refreshStore(1==t.purge)}))},i.prototype.getStoreState=function(){var t=[],i=this.getRootStore();return i&&i.addStoreStates(t),t},i.prototype.getNodesInRangeForSelection=function(t,i){return Wr.exists(i)&&t.parent!==i.parent?[]:t.parent.childStore.getRowNodesInRange(i,t)},i.prototype.getRowNode=function(t){var i;return this.forEachNode((function(n){n.id===t&&(i=n),n.detailNode&&n.detailNode.id===t&&(i=n.detailNode)})),i},i.prototype.isRowPresent=function(t){return!!this.getRowNode(t.id)},Pg([Dt("columnModel")],i.prototype,"columnModel",void 0),Pg([Dt("filterManager")],i.prototype,"filterManager",void 0),Pg([Dt("sortController")],i.prototype,"sortController",void 0),Pg([Dt("rowRenderer")],i.prototype,"rowRenderer",void 0),Pg([Dt("ssrmSortService")],i.prototype,"sortListener",void 0),Pg([Dt("ssrmNodeManager")],i.prototype,"nodeManager",void 0),Pg([Dt("ssrmStoreFactory")],i.prototype,"storeFactory",void 0),Pg([Dt("beans")],i.prototype,"beans",void 0),Pg([kt],i.prototype,"destroyDatasource",null),Pg([Ft],i.prototype,"addEventListeners",null),Pg([kt],i.prototype,"destroyRootStore",null),Pg([Pt("rowModel")],i)}(Ai),Ig=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Eg=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Tg=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Ig(i,t),i.prototype.loadFromDatasource=function(t){var i=t.storeParams,n=t.parentBlock,e=t.parentNode.getGroupKeys();if(i.datasource){var r={successCallback:t.successCallback,success:t.success,failCallback:t.failCallback,fail:t.fail,request:{startRow:t.startRow,endRow:t.endRow,rowGroupCols:i.rowGroupCols,valueCols:i.valueCols,pivotCols:i.pivotCols,pivotMode:i.pivotMode,groupKeys:e,filterModel:i.filterModel,sortModel:i.sortModel},parentNode:t.parentNode,api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsWrapper.getContext()};window.setTimeout((function(){i.datasource&&n.isAlive()?i.datasource.getRows(r):t.failCallback()}),0)}},i.prototype.getChildStore=function(t,i,n){if(Wr.missingOrEmpty(t))return i;var e=n(t[0]);if(e){var r=t.slice(1,t.length),o=e.childStore;return o?o.getChildStore(r):null}return null},i.prototype.isServerRefreshNeeded=function(t,i,n){if(n.valueColChanged||n.secondaryColChanged)return!0;var e=t.level+1;if(!(e<i.length))return!0;var r=i[e].id;return n.changedColumns.indexOf(r)>-1||this.columnModel.getAllGridColumns().filter((function(t){return t.getColDef().showRowGroup&&n.changedColumns.includes(t.getId())})).map((function(t){return t.getColDef().showRowGroup})).some((function(t){return!0===t||t===r}))},Eg([Dt("columnApi")],i.prototype,"columnApi",void 0),Eg([Dt("columnModel")],i.prototype,"columnModel",void 0),Eg([Dt("gridApi")],i.prototype,"gridApi",void 0),Eg([Pt("ssrmStoreUtils")],i)}(Ai),zg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Ng=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Lg=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return zg(i,t),i.prototype.postConstruct=function(){this.rowHeight=this.gridOptionsWrapper.getRowHeightAsNumber(),this.usingTreeData=this.gridOptionsWrapper.isTreeData(),this.usingMasterDetail=this.gridOptionsWrapper.isMasterDetail()},i.prototype.createRowNode=function(t){var i=new Ws(this.beans);return i.setRowHeight(null!=t.rowHeight?t.rowHeight:this.rowHeight),i.group=t.group,i.leafGroup=t.leafGroup,i.level=t.level,i.uiLevel=t.level,i.parent=t.parent,i.stub=!0,i.group&&(i.expanded=!1,i.field=t.field,i.rowGroupColumn=t.rowGroupColumn),i},i.prototype.destroyRowNodes=function(t){var i=this;t&&t.forEach((function(t){return i.destroyRowNode(t)}))},i.prototype.destroyRowNode=function(t,i){void 0===i&&(i=!1),t.childStore&&!i&&(this.destroyBean(t.childStore),t.childStore=null),t.clearRowTopAndRowIndex(),null!=t.id&&this.nodeManager.removeNode(t)},i.prototype.setTreeGroupInfo=function(t){var i=this.gridOptionsWrapper.getIsServerSideGroupFunc(),n=this.gridOptionsWrapper.getServerSideGroupKeyFunc();null!=i&&(t.setGroup(i(t.data)),t.group&&null!=n&&(t.key=n(t.data))),t.group||null==t.childStore||(this.destroyBean(t.childStore),t.childStore=null)},i.prototype.setRowGroupInfo=function(t){t.key=this.valueService.getValue(t.rowGroupColumn,t),null==t.key&&Wr.doOnce((function(){console.warn("AG Grid: null and undefined values are not allowed for server side row model keys"),t.rowGroupColumn&&console.warn("column = "+t.rowGroupColumn.getId()),console.warn("data is ",t.data)}),"ServerSideBlock-CannotHaveNullOrUndefinedForKey")},i.prototype.setMasterDetailInfo=function(t){var i=this.gridOptionsWrapper.getIsRowMasterFunc();t.master=null==i||i(t.data)},i.prototype.updateDataIntoRowNode=function(t,i){t.updateData(i),this.usingTreeData&&this.setTreeGroupInfo(t)},i.prototype.setDataIntoRowNode=function(t,i,n,e){t.stub=!1,Wr.exists(i)?(t.setDataAndId(i,n),this.usingTreeData?this.setTreeGroupInfo(t):t.group?this.setRowGroupInfo(t):this.usingMasterDetail&&this.setMasterDetailInfo(t)):(t.setDataAndId(void 0,void 0),t.key=null),(this.usingTreeData||t.group)&&(this.setGroupDataIntoRowNode(t),this.setChildCountIntoRowNode(t)),Wr.exists(i)&&t.setRowHeight(this.gridOptionsWrapper.getRowHeightForNode(t,!1,e).height)},i.prototype.setChildCountIntoRowNode=function(t){var i=this.gridOptionsWrapper.getChildCountFunc();i&&(t.allChildrenCount=i(t.data))},i.prototype.setGroupDataIntoRowNode=function(t){var i=this,n=this.columnModel.getGroupDisplayColumns(),e=this.gridOptionsWrapper.isTreeData();n.forEach((function(n){if(null==t.groupData&&(t.groupData={}),e)t.groupData[n.getColId()]=t.key;else if(n.isRowGroupDisplayed(t.rowGroupColumn.getId())){var r=i.valueService.getValue(t.rowGroupColumn,t);t.groupData[n.getColId()]=r}}))},i.prototype.clearDisplayIndex=function(t){t.clearRowTopAndRowIndex(),t.group&&Wr.exists(t.childStore)&&t.childStore.clearDisplayIndexes(),t.master&&t.detailNode&&t.detailNode.clearRowTopAndRowIndex()},i.prototype.setDisplayIndex=function(t,i,n){if(t.setRowIndex(i.next()),t.setRowTop(n.value),n.value+=t.rowHeight,t.master&&(t.expanded&&t.detailNode?(t.detailNode.setRowIndex(i.next()),t.detailNode.setRowTop(n.value),n.value+=t.detailNode.rowHeight):t.detailNode&&t.detailNode.clearRowTopAndRowIndex()),t.group&&Wr.exists(t.childStore)){var e=t.childStore;t.expanded?e.setDisplayIndexes(i,n):e.clearDisplayIndexes()}},i.prototype.binarySearchForDisplayIndex=function(t,i){var n=0,e=i.length-1;if(Wr.missing(e)||Wr.missing(n))console.warn("AG Grid: error: topPointer = "+e+", bottomPointer = "+n);else for(;;){var r=Math.floor((n+e)/2),o=i[r];if(o.rowIndex===t)return o;var s=o.detailNode;if(o.master&&o.expanded&&s&&s.rowIndex===t)return o.detailNode;var u=o.childStore;if(o.expanded&&u&&u.isDisplayIndexInStore(t))return u.getRowUsingDisplayIndex(t);if(o.rowIndex<t)n=r+1;else{if(!(o.rowIndex>t))return void console.warn("AG Grid: error: unable to locate rowIndex = "+t+" in cache");e=r-1}}},i.prototype.extractRowBounds=function(t,i){var n=function(t){return{rowHeight:t.rowHeight,rowTop:t.rowTop}};if(t.rowIndex===i)return n(t);if(t.group&&t.expanded&&Wr.exists(t.childStore)){var e=t.childStore;if(e.isDisplayIndexInStore(i))return e.getRowBounds(i)}else if(t.master&&t.expanded&&Wr.exists(t.detailNode)&&t.detailNode.rowIndex===i)return n(t.detailNode)},i.prototype.getIndexAtPixel=function(t,i){if(t.isPixelInRange(i))return t.rowIndex;var n=t.detailNode;if(t.master&&t.expanded&&n&&n.isPixelInRange(i))return t.detailNode.rowIndex;if(t.group&&t.expanded&&Wr.exists(t.childStore)){var e=t.childStore;if(e.isPixelInRange(i))return e.getRowIndexAtPixel(i)}return null},i.prototype.createNodeIdPrefix=function(t){for(var i=[],n=t;n&&n.level>=0;)i.push(n.key),n=n.parent;if(i.length>0)return i.reverse().join("-")},i.prototype.checkOpenByDefault=function(t){if(t.isExpandable()){var i=this.gridOptionsWrapper.getIsServerSideGroupOpenByDefaultFunc();i&&i({data:t.data,rowNode:t})&&window.setTimeout((function(){return t.setExpanded(!0)}),0)}},Ng([Dt("valueService")],i.prototype,"valueService",void 0),Ng([Dt("columnModel")],i.prototype,"columnModel",void 0),Ng([Dt("ssrmNodeManager")],i.prototype,"nodeManager",void 0),Ng([Dt("beans")],i.prototype,"beans",void 0),Ng([Ft],i.prototype,"postConstruct",null),Ng([Pt("ssrmBlockUtils")],i)}(Ai),Bg=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Hg=function(){function t(){this.rowNodes={}}return t.prototype.addRowNode=function(t){var i=t.id;this.rowNodes[i]&&(console.warn("AG Grid: Duplicate node id "+t.id+". Row ID's are provided via the getRowId() callback. Please modify the getRowId() callback code to provide unique row id values."),console.warn("first instance",this.rowNodes[i].data),console.warn("second instance",t.data)),this.rowNodes[i]=t},t.prototype.removeNode=function(t){var i=t.id;this.rowNodes[i]&&(this.rowNodes[i]=void 0)},t.prototype.clear=function(){this.rowNodes={}},Bg([kt],t.prototype,"clear",null),Bg([Pt("ssrmNodeManager")],t)}(),Wg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Vg=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Ug=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.asyncTransactions=[],i}return Wg(i,t),i.prototype.postConstruct=function(){this.gridOptionsWrapper.isRowModelServerSide()},i.prototype.applyTransactionAsync=function(t,i){null==this.asyncTransactionsTimeout&&this.scheduleExecuteAsync(),this.asyncTransactions.push({transaction:t,callback:i})},i.prototype.scheduleExecuteAsync=function(){var t=this,i=this.gridOptionsWrapper.getAsyncTransactionWaitMillis();this.asyncTransactionsTimeout=window.setTimeout((function(){t.executeAsyncTransactions()}),i)},i.prototype.executeAsyncTransactions=function(){var t=this;if(this.asyncTransactions){var i=[],n=[],e=[],r=!1;this.asyncTransactions.forEach((function(o){var s;t.serverSideRowModel.executeOnStore(o.transaction.route,(function(t){s=t.applyTransaction(o.transaction)})),null==s&&(s={status:ll.StoreNotFound}),n.push(s),s.status==ll.StoreLoading?e.push(o):(o.callback&&i.push((function(){return o.callback(s)})),s.status===ll.Applied&&(r=!0))})),i.length>0&&window.setTimeout((function(){i.forEach((function(t){return t()}))}),0),this.asyncTransactionsTimeout=void 0,this.asyncTransactions=e,r&&(this.valueCache.onDataChanged(),this.eventService.dispatchEvent({type:xi.EVENT_STORE_UPDATED})),n.length>0&&this.eventService.dispatchEvent({type:xi.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:n})}},i.prototype.flushAsyncTransactions=function(){null!=this.asyncTransactionsTimeout&&clearTimeout(this.asyncTransactionsTimeout),this.executeAsyncTransactions()},i.prototype.applyTransaction=function(t){var i,n=this;return this.serverSideRowModel.executeOnStore(t.route,(function(n){i=n.applyTransaction(t)})),i?(this.valueCache.onDataChanged(),this.eventService.dispatchEvent({type:xi.EVENT_STORE_UPDATED}),i.update&&i.update.length&&setTimeout((function(){n.rowRenderer.refreshFullWidthRows(i.update)}),0),i):{status:ll.StoreNotFound}},Vg([Dt("rowNodeBlockLoader")],i.prototype,"rowNodeBlockLoader",void 0),Vg([Dt("valueCache")],i.prototype,"valueCache",void 0),Vg([Dt("rowModel")],i.prototype,"serverSideRowModel",void 0),Vg([Dt("rowRenderer")],i.prototype,"rowRenderer",void 0),Vg([Ft],i.prototype,"postConstruct",null),Vg([Pt("ssrmTransactionManager")],i)}(Ai),Kg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),$g=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},qg=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Kg(i,t),i.prototype.postConstruct=function(){this.gridOptionsWrapper.isRowModelServerSide()&&this.addManagedListener(this.eventService,xi.EVENT_ROW_GROUP_OPENED,this.onRowGroupOpened.bind(this))},i.prototype.onRowGroupOpened=function(t){var i=t.node;if(i.expanded){if(i.master)this.createDetailNode(i);else if(Wr.missing(i.childStore)){var n=this.serverSideRowModel.getParams();i.childStore=this.createBean(this.storeFactory.createStore(n,i))}}else this.gridOptionsWrapper.isPurgeClosedRowNodes()&&Wr.exists(i.childStore)&&(i.childStore=this.destroyBean(i.childStore));this.eventService.dispatchEvent({type:xi.EVENT_STORE_UPDATED})},i.prototype.createDetailNode=function(t){if(Wr.exists(t.detailNode))return t.detailNode;var i=new Ws(this.beans);i.detail=!0,i.selectable=!1,i.parent=t,Wr.exists(t.id)&&(i.id="detail_"+t.id),i.data=t.data,i.level=t.level+1;var n=this.gridOptionsWrapper.getRowHeightForNode(i).height;return i.rowHeight=n||200,t.detailNode=i,i},$g([Dt("rowModel")],i.prototype,"serverSideRowModel",void 0),$g([Dt("ssrmStoreFactory")],i.prototype,"storeFactory",void 0),$g([Dt("beans")],i.prototype,"beans",void 0),$g([Ft],i.prototype,"postConstruct",null),$g([Pt("ssrmExpandListener")],i)}(Ai),Yg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Jg=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Zg=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Yg(i,t),i.prototype.postConstruct=function(){this.gridOptionsWrapper.isRowModelServerSide()&&this.addManagedListener(this.eventService,xi.EVENT_SORT_CHANGED,this.onSortChanged.bind(this))},i.prototype.extractSortModel=function(){var t=this.sortController.getSortModel();return this.gridOptionsWrapper.isTreeData()||(this.replaceAutoGroupColumnWithActualRowGroupColumns(t),this.removeMultiColumnPrefixOnColumnIds(t)),t},i.prototype.removeMultiColumnPrefixOnColumnIds=function(t){if(this.gridOptionsWrapper.isGroupMultiAutoColumn())for(var i=Vt.GROUP_AUTO_COLUMN_ID+"-",n=0;n<t.length;++n)t[n].colId.indexOf(i)>-1&&(t[n].colId=t[n].colId.substr(i.length))},i.prototype.replaceAutoGroupColumnWithActualRowGroupColumns=function(t){var i=t.find((function(t){return t.colId==Vt.GROUP_AUTO_COLUMN_ID}));if(i){var n=t.indexOf(i);Wr.removeFromArray(t,i);var e=this.columnModel.getRowGroupColumns().filter((function(i){return 0==t.filter((function(t){return t.colId===i.getColId()})).length})).map((function(t){return{colId:t.getId(),sort:i.sort}}));Wr.insertArrayIntoArray(t,e,n)}},i.prototype.onSortChanged=function(){var t=this.serverSideRowModel.getParams();if(t){var i=this.extractSortModel(),n=this.findChangedColumnsInSort(i,t.sortModel),e=this.listenerUtils.isSortingWithValueColumn(n),r=this.listenerUtils.isSortingWithSecondaryColumn(n);this.serverSideRowModel.refreshAfterSort(i,{valueColChanged:e,secondaryColChanged:r,changedColumns:n})}},i.prototype.findChangedColumnsInSort=function(t,i){var n=[];return[t,i].forEach((function(t){if(t){var i=t.map((function(t){return t.colId}));n=n.concat(i)}})),n.filter((function(n){var e=i.find((function(t){return t.colId===n})),r=t.find((function(t){return t.colId===n}));return function(t,i){return(t?t.sort:null)!==(i?i.sort:null)}(e,r)||function(n,e){return(n?i.indexOf(n):-1)!==(e?t.indexOf(e):-1)}(e,r)}))},Jg([Dt("sortController")],i.prototype,"sortController",void 0),Jg([Dt("columnModel")],i.prototype,"columnModel",void 0),Jg([Dt("rowModel")],i.prototype,"serverSideRowModel",void 0),Jg([Dt("ssrmListenerUtils")],i.prototype,"listenerUtils",void 0),Jg([Ft],i.prototype,"postConstruct",null),Jg([Pt("ssrmSortService")],i)}(Ai),Xg=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Qg=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},tm=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Xg(i,t),i.prototype.postConstruct=function(){this.gridOptionsWrapper.isRowModelServerSide()&&this.addManagedListener(this.eventService,xi.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this))},i.prototype.onFilterChanged=function(){var t=this.serverSideRowModel.getParams();if(t){var i=this.filterManager.getFilterModel(),n=this.findChangedColumns(i,t?t.filterModel:{}),e=this.listenerUtils.isSortingWithValueColumn(n),r=this.listenerUtils.isSortingWithSecondaryColumn(n);this.serverSideRowModel.refreshAfterFilter(i,{valueColChanged:e,secondaryColChanged:r,changedColumns:n})}},i.prototype.findChangedColumns=function(t,i){var n={};Object.keys(t).forEach((function(t){return n[t]=!0})),Object.keys(i).forEach((function(t){return n[t]=!0}));var e=[];return Object.keys(n).forEach((function(n){JSON.stringify(t[n])!=JSON.stringify(i[n])&&e.push(n)})),e},Qg([Dt("rowModel")],i.prototype,"serverSideRowModel",void 0),Qg([Dt("filterManager")],i.prototype,"filterManager",void 0),Qg([Dt("ssrmListenerUtils")],i.prototype,"listenerUtils",void 0),Qg([Ft],i.prototype,"postConstruct",null),Qg([Pt("ssrmFilterListener")],i)}(Ai),im=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),nm=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},em=function(t){var i="function"==typeof Symbol&&Symbol.iterator,n=i&&t[i],e=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},rm=function(t){function i(i,n,e,r,o){var s=t.call(this,i)||this;return s.ssrmParams=e,s.storeParams=r,s.parentRowNode=n,s.startRow=i*r.cacheBlockSize,s.parentStore=o,s.level=n.level+1,s.groupLevel=e.rowGroupCols?s.level<e.rowGroupCols.length:void 0,s.leafGroup=!!e.rowGroupCols&&s.level===e.rowGroupCols.length-1,s}return im(i,t),i.prototype.postConstruct=function(){this.usingTreeData=this.gridOptionsWrapper.isTreeData(),!this.usingTreeData&&this.groupLevel&&(this.groupField=this.ssrmParams.rowGroupCols[this.level].field,this.rowGroupColumn=this.columnModel.getRowGroupColumns()[this.level]),this.nodeIdPrefix=this.blockUtils.createNodeIdPrefix(this.parentRowNode),this.setData([])},i.prototype.isDisplayIndexInBlock=function(t){return t>=this.displayIndexStart&&t<this.displayIndexEnd},i.prototype.isBlockBefore=function(t){return t>=this.displayIndexEnd},i.prototype.getDisplayIndexStart=function(){return this.displayIndexStart},i.prototype.getDisplayIndexEnd=function(){return this.displayIndexEnd},i.prototype.getBlockHeightPx=function(){return this.blockHeightPx},i.prototype.getBlockTopPx=function(){return this.blockTopPx},i.prototype.isGroupLevel=function(){return this.groupLevel},i.prototype.getGroupField=function(){return this.groupField},i.prototype.prefixId=function(t){return null!=this.nodeIdPrefix?this.nodeIdPrefix+"-"+t:t.toString()},i.prototype.getBlockStateJson=function(){return{id:this.prefixId(this.getId()),state:{blockNumber:this.getId(),startRow:this.startRow,endRow:this.startRow+this.storeParams.cacheBlockSize,pageStatus:this.getState()}}},i.prototype.isAnyNodeOpen=function(){return this.rowNodes.filter((function(t){return t.expanded})).length>0},i.prototype.forEachNode=function(t,i,n,e){void 0===i&&(i=new Vr),this.rowNodes.forEach((function(r){if(t(r,i.next()),n&&r.childStore){var o=r.childStore;e?o.forEachNodeDeepAfterFilterAndSort(t,i):o.forEachNodeDeep(t,i)}}))},i.prototype.forEachNodeDeep=function(t,i){this.forEachNode(t,i,!0,!1)},i.prototype.forEachNodeAfterFilterAndSort=function(t,i){this.forEachNode(t,i,!0,!0)},i.prototype.forEachNodeShallow=function(t,i){this.forEachNode(t,i,!1,!1)},i.prototype.getLastAccessed=function(){return this.lastAccessed},i.prototype.getRowUsingLocalIndex=function(t){return this.rowNodes[t-this.startRow]},i.prototype.touchLastAccessed=function(){this.lastAccessed=this.ssrmParams.lastAccessedSequence.next()},i.prototype.processServerFail=function(){this.parentStore.onBlockLoadFailed(this)},i.prototype.retryLoads=function(){this.getState()===sf.STATE_FAILED&&(this.setStateWaitingToLoad(),this.rowNodeBlockLoader.checkBlockToLoad(),this.setData()),this.forEachNodeShallow((function(t){t.childStore&&t.childStore.retryLoads()}))},i.prototype.processServerResult=function(t){this.parentStore.onBlockLoaded(this,t)},i.prototype.setData=function(t,i){var n=this;void 0===t&&(t=[]),void 0===i&&(i=!1),this.destroyRowNodes();for(var e=this.parentStore.getRowCount(),r=this.getId()*this.storeParams.cacheBlockSize,o=Math.min(r+this.storeParams.cacheBlockSize,e)-r,s=this.columnModel.getAllDisplayedAutoHeightCols().length>0?this.parentStore.getCachedBlockHeight(this.getId()):void 0,u=s?Math.round(s/o):void 0,h=function(e){var r=e<t.length,o=function(o){var s=null!=o?o:n.blockUtils.createRowNode({field:n.groupField,group:n.groupLevel,leafGroup:n.leafGroup,level:n.level,parent:n.parentRowNode,rowGroupColumn:n.rowGroupColumn,rowHeight:u});if(r){var h=t[e];if(o)n.blockUtils.updateDataIntoRowNode(s,h);else{var c=n.prefixId(n.startRow+e);n.blockUtils.setDataIntoRowNode(s,h,c,u),n.blockUtils.checkOpenByDefault(s)}n.parentStore.removeDuplicateNode(s.id),n.nodeManager.addRowNode(s),n.allNodesMap[s.id]=s}return i&&(s.failedLoad=!0),s},s=c.gridOptionsWrapper.getRowIdFunc(),h=void 0;if(s&&r){var a=t[e],l=c.parentRowNode.getGroupKeys(),f=s({data:a,level:c.level,parentKeys:l.length>0?l:void 0});h=o(c.parentStore.retrieveNodeFromCache(f))}h||(h=o()),c.rowNodes.push(h)},c=this,a=0;a<o;a++)h(a)},i.prototype.removeDuplicateNode=function(t){if(this.getState()!=sf.STATE_LOADED){var i=this.allNodesMap[t];if(i){this.blockUtils.destroyRowNode(i);var n=this.rowNodes.indexOf(i),e=this.blockUtils.createRowNode({field:this.groupField,group:this.groupLevel,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn});this.rowNodes[n]=e}}},i.prototype.refresh=function(){this.getState()!==sf.STATE_WAITING_TO_LOAD&&this.setStateWaitingToLoad()},i.prototype.destroyRowNodes=function(){var t,i=this;null===(t=this.rowNodes)||void 0===t||t.forEach((function(t){var n=i.parentStore.isNodeCached(t.id);i.blockUtils.destroyRowNode(t,n)})),this.rowNodes=[],this.allNodesMap={}},i.prototype.setBeans=function(t){this.logger=t.create("ServerSideBlock")},i.prototype.getRowUsingDisplayIndex=function(t){return this.touchLastAccessed(),this.blockUtils.binarySearchForDisplayIndex(t,this.rowNodes)},i.prototype.loadFromDatasource=function(){this.storeUtils.loadFromDatasource({startRow:this.startRow,endRow:this.startRow+this.storeParams.cacheBlockSize,parentBlock:this,parentNode:this.parentRowNode,storeParams:this.ssrmParams,successCallback:this.pageLoaded.bind(this,this.getVersion()),success:this.success.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),fail:this.pageLoadFailed.bind(this,this.getVersion())})},i.prototype.isPixelInRange=function(t){return t>=this.blockTopPx&&t<this.blockTopPx+this.blockHeightPx},i.prototype.getRowBounds=function(t){var i,n,e;this.touchLastAccessed();try{for(var r=em(this.rowNodes),o=r.next();!o.done&&null==(e=this.blockUtils.extractRowBounds(o.value,t));o=r.next());}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return e},i.prototype.getRowIndexAtPixel=function(t){var i,n;this.touchLastAccessed();var e=null;try{for(var r=em(this.rowNodes),o=r.next();!o.done&&null==(e=this.blockUtils.getIndexAtPixel(o.value,t));o=r.next());}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return e},i.prototype.clearDisplayIndexes=function(){var t=this;this.displayIndexEnd=void 0,this.displayIndexStart=void 0,this.rowNodes.forEach((function(i){return t.blockUtils.clearDisplayIndex(i)}))},i.prototype.setDisplayIndexes=function(t,i){var n=this;this.displayIndexStart=t.peek(),this.blockTopPx=i.value,this.rowNodes.forEach((function(e){return n.blockUtils.setDisplayIndex(e,t,i)})),this.displayIndexEnd=t.peek(),this.blockHeightPx=i.value-this.blockTopPx},nm([Dt("columnModel")],i.prototype,"columnModel",void 0),nm([Dt("ssrmStoreUtils")],i.prototype,"storeUtils",void 0),nm([Dt("ssrmBlockUtils")],i.prototype,"blockUtils",void 0),nm([Dt("ssrmNodeManager")],i.prototype,"nodeManager",void 0),nm([Dt("rowNodeBlockLoader")],i.prototype,"rowNodeBlockLoader",void 0),nm([Ft],i.prototype,"postConstruct",null),nm([kt],i.prototype,"destroyRowNodes",null),nm([(n=0,e=Tt("loggerFactory"),function(t,i){e(t,i,n)})],i.prototype,"setBeans",null),i;var n,e}(sf),om=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),sm=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(t){t[t.FOUND=0]="FOUND",t[t.CONTINUE_FIND=1]="CONTINUE_FIND",t[t.BREAK_FIND=2]="BREAK_FIND"}(fg||(fg={}));var um,hm=function(t){function i(i,n,e){var r=t.call(this)||this;return r.blocks={},r.blockHeights={},r.lastRowIndexKnown=!1,r.displayIndexStart=0,r.displayIndexEnd=0,r.cacheTopPixel=0,r.info={},r.refreshedNodeCache={},r.ssrmParams=i,r.storeParams=n,r.parentRowNode=e,r}return om(i,t),i.prototype.postConstruct=function(){this.defaultRowHeight=this.gridOptionsWrapper.getRowHeightAsNumber();var t=-1===this.parentRowNode.level?this.gridOptionsWrapper.getServerSideInitialRowCount():i.INITIAL_ROW_COUNT;this.rowCount=t},i.prototype.destroyAllBlocks=function(){var t=this;this.getBlocksInOrder().forEach((function(i){return t.destroyBlock(i)})),this.blockUtils.destroyRowNodes(Object.values(this.refreshedNodeCache))},i.prototype.setBeans=function(t){this.logger=t.create("ServerSideCache")},i.prototype.getRowCount=function(){return this.rowCount},i.prototype.isLastRowIndexKnown=function(){return this.lastRowIndexKnown},i.prototype.retryLoads=function(){this.getBlocksInOrder().forEach((function(t){return t.retryLoads()}))},i.prototype.onBlockLoadFailed=function(t){t.setData([],!0),this.fireCacheUpdatedEvent()},i.prototype.onBlockLoaded=function(t,i){this.logger.log("onPageLoaded: page = "+t.getId()+", lastRow = "+i.rowCount);var n=i.storeInfo||i.groupLevelInfo;n&&Object.assign(this.info,n),i.rowData||Wr.doOnce((function(){return console.warn('AG Grid: "params.rowData" is missing from Server-Side Row Model success() callback. Please use the "rowData" attribute. If no data is returned, set an empty list.',i)}),"InfiniteStore.noData");var e=null!=i.rowCount&&i.rowCount>=0?i.rowCount:void 0;this.isAlive()&&(this.checkRowCount(t,e),t.setData(i.rowData),this.destroyAllBlocksPastVirtualRowCount(),this.fireCacheUpdatedEvent())},i.prototype.purgeBlocksIfNeeded=function(t){var n=this,e=this.getBlocksInOrder().filter((function(i){return i!=t}));e.sort((function(t,i){return i.getLastAccessed()-t.getLastAccessed()}));var r=this.storeParams.maxBlocksInCache>0,o=r?this.storeParams.maxBlocksInCache-1:null,s=i.MAX_EMPTY_BLOCKS_TO_KEEP-1;e.forEach((function(t,i){if(t.getState()===rm.STATE_WAITING_TO_LOAD&&i>=s||r&&i>=o){if(t.isAnyNodeOpen())return;if(n.isBlockCurrentlyDisplayed(t))return;if(n.isBlockFocused(t))return;n.destroyBlock(t)}}))},i.prototype.isBlockFocused=function(t){var i=this.focusService.getFocusCellToUseAfterRefresh();if(!i)return!1;if(null!=i.rowPinned)return!1;var n=t.getDisplayIndexStart(),e=t.getDisplayIndexEnd();return null!=e&&null!=n&&i.rowIndex>=n&&i.rowIndex<e},i.prototype.isBlockCurrentlyDisplayed=function(t){var i=t.getDisplayIndexStart(),n=t.getDisplayIndexEnd()-1;return this.rowRenderer.isRangeInRenderedViewport(i,n)},i.prototype.removeDuplicateNode=function(t){this.getBlocksInOrder().forEach((function(i){return i.removeDuplicateNode(t)}))},i.prototype.checkRowCount=function(t,n){if("number"==typeof n&&n>=0)this.rowCount=n,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){var e=(t.getId()+1)*this.storeParams.cacheBlockSize+i.OVERFLOW_SIZE;this.rowCount<e&&(this.rowCount=e)}},i.prototype.forEachNodeDeep=function(t,i){void 0===i&&(i=new Vr),this.getBlocksInOrder().forEach((function(n){return n.forEachNodeDeep(t,i)}))},i.prototype.forEachNodeDeepAfterFilterAndSort=function(t,i){void 0===i&&(i=new Vr),this.getBlocksInOrder().forEach((function(n){return n.forEachNodeAfterFilterAndSort(t,i)}))},i.prototype.getBlocksInOrder=function(){return Wr.getAllValuesInObject(this.blocks).sort((function(t,i){return t.getId()-i.getId()}))},i.prototype.destroyBlock=function(t){delete this.blocks[t.getId()],this.destroyBean(t),this.rowNodeBlockLoader.removeBlock(t)},i.prototype.fireCacheUpdatedEvent=function(){this.eventService.dispatchEvent({type:xi.EVENT_STORE_UPDATED})},i.prototype.destroyAllBlocksPastVirtualRowCount=function(){var t=this,i=[];this.getBlocksInOrder().forEach((function(n){n.getId()*t.storeParams.cacheBlockSize>=t.rowCount&&i.push(n)})),i.length>0&&i.forEach((function(i){return t.destroyBlock(i)}))},i.prototype.refreshStore=function(t){0==this.getRowCount()||t?this.resetStore():this.refreshBlocks(),this.fireCacheUpdatedEvent()},i.prototype.isNodeCached=function(t){return!!this.refreshedNodeCache[t]},i.prototype.retrieveNodeFromCache=function(t){var i=this.refreshedNodeCache[t];return i&&delete this.refreshedNodeCache[t],i},i.prototype.buildRowNodeCache=function(){var t={};this.getBlocksInOrder().forEach((function(i){i.rowNodes.forEach((function(i){i.group&&(t[i.id]=i)}))})),this.refreshedNodeCache=t},i.prototype.refreshBlocks=function(){this.buildRowNodeCache(),this.getBlocksInOrder().forEach((function(t){t.refresh()})),this.lastRowIndexKnown=!1,this.rowNodeBlockLoader.checkBlockToLoad()},i.prototype.resetStore=function(){this.destroyAllBlocks(),this.lastRowIndexKnown=!1,(this.columnModel.isAutoRowHeightActive()||0===this.rowCount)&&(this.rowCount=i.INITIAL_ROW_COUNT)},i.prototype.getRowNodesInRange=function(t,i){var n=[],e=-1,r=!1;Wr.missing(t)&&(r=!0);var o=!1;return this.getBlocksInOrder().forEach((function(s){o||(r&&e+1!==s.getId()?o=!0:(e=s.getId(),s.forEachNodeShallow((function(e){var o=e===t||e===i;(r||o)&&n.push(e),o&&(r=!r)}))))})),o||r?[]:n},i.prototype.findBlockAndExecute=function(t,i,n){var e,r=!1,o=!1,s=null;return this.getBlocksInOrder().forEach((function(n){if(!r&&!o){var u=t(n);u==fg.FOUND?(e=i(n),r=!0):u==fg.CONTINUE_FIND?s=n:u==fg.BREAK_FIND&&(o=!0)}})),r||(e=n(s)),e},i.prototype.getRowBounds=function(t){var i=this;return this.findBlockAndExecute((function(i){return i.isDisplayIndexInBlock(t)?fg.FOUND:i.isBlockBefore(t)?fg.CONTINUE_FIND:fg.BREAK_FIND}),(function(i){return i.getRowBounds(t)}),(function(n){var e,r;return null!==n?(e=n.getBlockTopPx()+n.getBlockHeightPx(),r=n.getDisplayIndexEnd()):(e=i.cacheTopPixel,r=i.displayIndexStart),{rowHeight:i.defaultRowHeight,rowTop:e+(t-r)*i.defaultRowHeight}}))},i.prototype.getRowIndexAtPixel=function(t){var i=this,n=this.findBlockAndExecute((function(i){return i.isPixelInRange(t)?fg.FOUND:i.getBlockTopPx()<t?fg.CONTINUE_FIND:fg.BREAK_FIND}),(function(i){return i.getRowIndexAtPixel(t)}),(function(n){var e,r;n?(e=n.getBlockTopPx()+n.getBlockHeightPx(),r=n.getDisplayIndexEnd()):(e=i.cacheTopPixel,r=i.displayIndexStart);for(var o=i.storeParams.cacheBlockSize,s=i.defaultRowHeight*o,u=n?n.getId()+1:0,h=function(n){var r=i.getCachedBlockHeight(n),o=null!=r?r:s;return{height:o,pixelInBlock:t<=o+e}},c=h(u);!c.pixelInBlock;)e+=c.height,r+=o,c=h(++u);return r+(0|Math.floor((t-e)/(c.height/o)))})),e=this.getDisplayIndexEnd()-1;return Math.min(n,e)},i.prototype.clearDisplayIndexes=function(){this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.getBlocksInOrder().forEach((function(t){return t.clearDisplayIndexes()}))},i.prototype.setDisplayIndexes=function(t,i){var n=this;this.displayIndexStart=t.peek(),this.cacheTopPixel=i.value;var e=-1,r=this.storeParams.cacheBlockSize;this.getBlocksInOrder().forEach((function(o){var s=o.getId(),u=s-e-1,h=u*r;h>0&&t.skip(h);for(var c=1;c<=u;c++){var a=s-c;Wr.exists(n.blockHeights[a])?i.value+=n.blockHeights[a]:i.value+=r*n.defaultRowHeight}e=s,o.setDisplayIndexes(t,i),n.blockHeights[s]=o.getBlockHeightPx()}));var o=(e+1)*r-1,s=this.getRowCount()-o-1;s>0&&(t.skip(s),i.value+=s*this.defaultRowHeight),this.displayIndexEnd=t.peek(),this.cacheHeightPixels=i.value-this.cacheTopPixel},i.prototype.getRowUsingDisplayIndex=function(t,i){var n=this;if(void 0===i&&(i=!1),this.isDisplayIndexInStore(t))return this.findBlockAndExecute((function(i){return i.isDisplayIndexInBlock(t)?fg.FOUND:i.isBlockBefore(t)?fg.CONTINUE_FIND:fg.BREAK_FIND}),(function(i){return i.getRowUsingDisplayIndex(t)}),(function(e){if(!i){var r,o,s,u=n.storeParams.cacheBlockSize;if(e)for(r=e.getId()+1,o=e.getDisplayIndexEnd(),s=e.getBlockHeightPx()+e.getBlockTopPx();!(t>=o&&t<o+u);){o+=u;var h=n.blockHeights[r];Wr.exists(h)?s+=h:s+=n.defaultRowHeight*u,r++}else r=Math.floor((t-n.displayIndexStart)/u),o=n.displayIndexStart+r*u,s=n.cacheTopPixel+r*u*n.defaultRowHeight;return n.logger.log("block missing, rowIndex = "+t+", creating #"+r+", displayIndexStart = "+o),n.createBlock(r,o,{value:s}).getRowUsingDisplayIndex(t)}}))},i.prototype.getTopLevelRowDisplayedIndex=function(t){var i=this.storeParams.cacheBlockSize,n=Math.floor(t/i);return this.findBlockAndExecute((function(t){return t.getId()===n?fg.FOUND:t.getId()<n?fg.CONTINUE_FIND:fg.BREAK_FIND}),(function(i){return i.getRowUsingLocalIndex(t).rowIndex}),(function(n){if(!n)return t;var e=i*(n.getId()+1)-1,r=n.getRowUsingLocalIndex(e);return(r.expanded&&r.childStore?r.childStore.getDisplayIndexEnd()-1:r.expanded&&r.detailNode?r.detailNode.rowIndex:r.rowIndex)+(t-e)}))},i.prototype.addStoreStates=function(t){t.push({infiniteScroll:!0,route:this.parentRowNode.getGroupKeys(),rowCount:this.rowCount,lastRowIndexKnown:this.lastRowIndexKnown,info:this.info,maxBlocksInCache:this.storeParams.maxBlocksInCache,cacheBlockSize:this.storeParams.cacheBlockSize}),this.forEachChildStoreShallow((function(i){return i.addStoreStates(t)}))},i.prototype.getCachedBlockHeight=function(t){return this.blockHeights[t]},i.prototype.createBlock=function(t,i,n){var e=this.createBean(new rm(t,this.parentRowNode,this.ssrmParams,this.storeParams,this));return e.setDisplayIndexes(new Vr(i),n),this.blocks[e.getId()]=e,this.purgeBlocksIfNeeded(e),this.rowNodeBlockLoader.addBlock(e),e},i.prototype.getDisplayIndexEnd=function(){return this.displayIndexEnd},i.prototype.isDisplayIndexInStore=function(t){return 0!==this.getRowCount()&&t>=this.displayIndexStart&&t<this.displayIndexEnd},i.prototype.applyTransaction=function(){return{status:ll.StoreWrongType}},i.prototype.getChildStore=function(t){var i=this;return this.storeUtils.getChildStore(t,this,(function(t){var n=null;return i.getBlocksInOrder().forEach((function(i){i.forEachNodeShallow((function(i){i.key==t&&(n=i)}),new Vr)})),n}))},i.prototype.isPixelInRange=function(t){return 0!==this.getRowCount()&&t>=this.cacheTopPixel&&t<this.cacheTopPixel+this.cacheHeightPixels},i.prototype.refreshAfterFilter=function(t){this.gridOptionsWrapper.isServerSideFilterAllLevels()||this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,t)?this.resetStore():this.forEachChildStoreShallow((function(i){return i.refreshAfterFilter(t)}))},i.prototype.refreshAfterSort=function(t){this.gridOptionsWrapper.isServerSideSortAllLevels()||this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,t)?this.resetStore():this.forEachChildStoreShallow((function(i){return i.refreshAfterSort(t)}))},i.prototype.forEachChildStoreShallow=function(t){this.getBlocksInOrder().forEach((function(i){i.isGroupLevel()&&i.forEachNodeShallow((function(i){var n=i.childStore;n&&t(n)}),new Vr)}))},i.MAX_EMPTY_BLOCKS_TO_KEEP=2,i.INITIAL_ROW_COUNT=1,i.OVERFLOW_SIZE=1,sm([Dt("rowRenderer")],i.prototype,"rowRenderer",void 0),sm([Dt("rowNodeBlockLoader")],i.prototype,"rowNodeBlockLoader",void 0),sm([Dt("ssrmStoreUtils")],i.prototype,"storeUtils",void 0),sm([Dt("focusService")],i.prototype,"focusService",void 0),sm([Dt("columnModel")],i.prototype,"columnModel",void 0),sm([Dt("ssrmBlockUtils")],i.prototype,"blockUtils",void 0),sm([Ft],i.prototype,"postConstruct",null),sm([kt],i.prototype,"destroyAllBlocks",null),sm([(n=0,e=Tt("loggerFactory"),function(t,i){e(t,i,n)})],i.prototype,"setBeans",null),i;var n,e}(Ai),cm=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),am=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},lm=function(t){function i(i,n,e){var r=t.call(this,0)||this;return r.nodeIdSequence=new Vr,r.info={},r.ssrmParams=i,r.parentRowNode=e,r.level=e.level+1,r.groupLevel=i.rowGroupCols?r.level<i.rowGroupCols.length:void 0,r.leafGroup=!!i.rowGroupCols&&r.level===i.rowGroupCols.length-1,r}return cm(i,t),i.prototype.postConstruct=function(){var t=this;this.usingTreeData=this.gridOptionsWrapper.isTreeData(),this.nodeIdPrefix=this.blockUtils.createNodeIdPrefix(this.parentRowNode),!this.usingTreeData&&this.groupLevel&&(this.groupField=this.ssrmParams.rowGroupCols[this.level].field,this.rowGroupColumn=this.columnModel.getRowGroupColumns()[this.level]);var i=1,n=-1===this.parentRowNode.level,e=this.gridOptionsWrapper.getServerSideInitialRowCount();n&&void 0!==e&&(i=e),this.initialiseRowNodes(i),this.rowNodeBlockLoader.addBlock(this),this.addDestroyFunc((function(){return t.rowNodeBlockLoader.removeBlock(t)}))},i.prototype.destroyRowNodes=function(){this.blockUtils.destroyRowNodes(this.allRowNodes),this.allRowNodes=[],this.nodesAfterSort=[],this.nodesAfterFilter=[],this.allNodesMap={}},i.prototype.initialiseRowNodes=function(t,i){void 0===i&&(i=!1),this.destroyRowNodes();for(var n=0;n<t;n++){var e=this.blockUtils.createRowNode({field:this.groupField,group:this.groupLevel,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn});i&&(e.failedLoad=!0),this.allRowNodes.push(e),this.nodesAfterFilter.push(e),this.nodesAfterSort.push(e)}},i.prototype.getBlockStateJson=function(){return{id:this.nodeIdPrefix?this.nodeIdPrefix:"",state:this.getState()}},i.prototype.loadFromDatasource=function(){this.storeUtils.loadFromDatasource({startRow:void 0,endRow:void 0,parentBlock:this,parentNode:this.parentRowNode,storeParams:this.ssrmParams,successCallback:this.pageLoaded.bind(this,this.getVersion()),success:this.success.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),fail:this.pageLoadFailed.bind(this,this.getVersion())})},i.prototype.getStartRow=function(){return 0},i.prototype.getEndRow=function(){return this.nodesAfterSort.length},i.prototype.createDataNode=function(t,i){var n=this.blockUtils.createRowNode({field:this.groupField,group:this.groupLevel,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn});null!=i?Wr.insertIntoArray(this.allRowNodes,n,i):this.allRowNodes.push(n);var e=this.prefixId(this.nodeIdSequence.next());return this.blockUtils.setDataIntoRowNode(n,t,e,void 0),this.nodeManager.addRowNode(n),this.blockUtils.checkOpenByDefault(n),this.allNodesMap[n.id]=n,n},i.prototype.prefixId=function(t){return this.nodeIdPrefix?this.nodeIdPrefix+"-"+t:t.toString()},i.prototype.processServerFail=function(){this.initialiseRowNodes(1,!0),this.fireStoreUpdatedEvent(),this.flushAsyncTransactions()},i.prototype.processServerResult=function(t){if(this.isAlive()){var i=t.storeInfo||t.groupLevelInfo;i&&Object.assign(this.info,i);var n=this.allRowNodes.length>0?this.allNodesMap:void 0;this.allRowNodes=[],this.nodesAfterSort=[],this.nodesAfterFilter=[],this.allNodesMap={},t.rowData||Wr.doOnce((function(){return console.warn('AG Grid: "params.data" is missing from Server-Side Row Model success() callback. Please use the "data" attribute. If no data is returned, set an empty list.',t)}),"FullStore.noData"),this.createOrRecycleNodes(n,t.rowData),n&&this.blockUtils.destroyRowNodes(Wr.getAllValuesInObject(n)),this.filterAndSortNodes(),this.fireStoreUpdatedEvent(),this.flushAsyncTransactions()}},i.prototype.createOrRecycleNodes=function(t,i){var n=this;i&&i.forEach((function(i){var e=function(i){if(t){var e=n.gridOptionsWrapper.getRowIdFunc();if(e){var r=n.parentRowNode.getGroupKeys(),o=e({data:i,parentKeys:r.length>0?r:void 0,level:n.level}),s=t[o];if(s)return delete t[o],s}}}(i);e?function(t,i){n.allNodesMap[t.id]=t,n.blockUtils.updateDataIntoRowNode(t,i),n.allRowNodes.push(t)}(e,i):n.createDataNode(i)}))},i.prototype.flushAsyncTransactions=function(){var t=this;window.setTimeout((function(){return t.transactionManager.flushAsyncTransactions()}),0)},i.prototype.filterAndSortNodes=function(){this.filterRowNodes(),this.sortRowNodes()},i.prototype.sortRowNodes=function(){var t=this.gridOptionsWrapper.isServerSideSortAllLevels()||this.gridOptionsWrapper.isServerSideSortOnServer(),i=this.sortController.getSortOptions();this.nodesAfterSort=t||!i||0==i.length?this.nodesAfterFilter:this.rowNodeSorter.doFullSort(this.nodesAfterFilter,i)},i.prototype.filterRowNodes=function(){var t=this;this.nodesAfterFilter=this.gridOptionsWrapper.isServerSideFilterAllLevels()||this.gridOptionsWrapper.isServerSideFilterOnServer()||this.groupLevel?this.allRowNodes:this.allRowNodes.filter((function(i){return t.filterManager.doesRowPassFilter({rowNode:i})}))},i.prototype.clearDisplayIndexes=function(){var t=this;this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.allRowNodes.forEach((function(i){return t.blockUtils.clearDisplayIndex(i)}))},i.prototype.getDisplayIndexEnd=function(){return this.displayIndexEnd},i.prototype.isDisplayIndexInStore=function(t){return 0!==this.getRowCount()&&t>=this.displayIndexStart&&t<this.displayIndexEnd},i.prototype.setDisplayIndexes=function(t,i){var n=this;this.displayIndexStart=t.peek(),this.topPx=i.value;var e={};this.nodesAfterSort.forEach((function(r){n.blockUtils.setDisplayIndex(r,t,i),e[r.id]=!0})),this.allRowNodes.forEach((function(t){e[t.id]||n.blockUtils.clearDisplayIndex(t)})),this.displayIndexEnd=t.peek(),this.heightPx=i.value-this.topPx},i.prototype.forEachNodeDeep=function(t,i){void 0===i&&(i=new Vr),this.allRowNodes.forEach((function(n){t(n,i.next());var e=n.childStore;e&&e.forEachNodeDeep(t,i)}))},i.prototype.forEachNodeDeepAfterFilterAndSort=function(t,i){void 0===i&&(i=new Vr),this.nodesAfterSort.forEach((function(n){t(n,i.next());var e=n.childStore;e&&e.forEachNodeDeepAfterFilterAndSort(t,i)}))},i.prototype.getRowUsingDisplayIndex=function(t){if(this.isDisplayIndexInStore(t))return this.blockUtils.binarySearchForDisplayIndex(t,this.nodesAfterSort)},i.prototype.getRowBounds=function(t){for(var i=0;i<this.nodesAfterSort.length;i++){var n=this.blockUtils.extractRowBounds(this.nodesAfterSort[i],t);if(n)return n}return null},i.prototype.isPixelInRange=function(t){return t>=this.topPx&&t<this.topPx+this.heightPx},i.prototype.getRowIndexAtPixel=function(t){var i=this;if(t<=this.topPx)return this.nodesAfterSort[0].rowIndex;if(t>=this.topPx+this.heightPx){var n=this.nodesAfterSort[this.nodesAfterSort.length-1];if(t>=n.rowTop+n.rowHeight&&n.expanded){if(n.childStore&&n.childStore.getRowCount()>0)return n.childStore.getRowIndexAtPixel(t);if(n.detailNode)return n.detailNode.rowIndex}return n.rowIndex}var e=null;return this.nodesAfterSort.forEach((function(n){var r=i.blockUtils.getIndexAtPixel(n,t);null!=r&&(e=r)})),null==e?this.displayIndexEnd-1:e},i.prototype.getChildStore=function(t){var i=this;return this.storeUtils.getChildStore(t,this,(function(t){return i.allRowNodes.find((function(i){return i.key==t}))}))},i.prototype.forEachChildStoreShallow=function(t){this.allRowNodes.forEach((function(i){var n=i.childStore;n&&t(n)}))},i.prototype.refreshAfterFilter=function(t){var i=this.gridOptionsWrapper.isServerSideFilterOnServer(),n=this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,t);if(this.gridOptionsWrapper.isServerSideFilterAllLevels()||i&&n)return this.refreshStore(!0),void this.sortRowNodes();this.filterRowNodes(),this.sortRowNodes(),this.forEachChildStoreShallow((function(i){return i.refreshAfterFilter(t)}))},i.prototype.refreshAfterSort=function(t){var i=this.gridOptionsWrapper.isServerSideSortOnServer(),n=this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,t);if(this.gridOptionsWrapper.isServerSideSortAllLevels()||i&&n)return this.refreshStore(!0),void this.filterRowNodes();this.filterRowNodes(),this.sortRowNodes(),this.forEachChildStoreShallow((function(i){return i.refreshAfterSort(t)}))},i.prototype.applyTransaction=function(t){switch(this.getState()){case sf.STATE_FAILED:return{status:ll.StoreLoadingFailed};case sf.STATE_LOADING:return{status:ll.StoreLoading};case sf.STATE_WAITING_TO_LOAD:return{status:ll.StoreWaitingToLoad}}var i=this.gridOptionsWrapper.getIsApplyServerSideTransactionFunc();if(i&&!i({transaction:t,parentNode:this.parentRowNode,storeInfo:this.info,groupLevelInfo:this.info}))return{status:ll.Cancelled};var n={status:ll.Applied,remove:[],update:[],add:[]},e=[];return this.executeAdd(t,n),this.executeRemove(t,n,e),this.executeUpdate(t,n,e),this.filterAndSortNodes(),this.updateSelection(e),n},i.prototype.updateSelection=function(t){t.length>0&&(t.forEach((function(t){t.setSelected(!1,!1,!0)})),this.eventService.dispatchEvent({type:xi.EVENT_SELECTION_CHANGED}))},i.prototype.executeAdd=function(t,i){var n=this,e=t.add,r=t.addIndex;Wr.missingOrEmpty(e)||("number"==typeof r&&r>=0?e.reverse().forEach((function(t){var e=n.createDataNode(t,r);i.add.push(e)})):e.forEach((function(t){var e=n.createDataNode(t);i.add.push(e)})))},i.prototype.executeRemove=function(t,i,n){var e=this,r=t.remove;if(null!=r){var o={};r.forEach((function(t){var r=e.lookupRowNode(t);r&&(r.isSelected()&&n.push(r),r.clearRowTopAndRowIndex(),o[r.id]=!0,delete e.allNodesMap[r.id],i.remove.push(r),e.nodeManager.removeNode(r))})),this.allRowNodes=this.allRowNodes.filter((function(t){return!o[t.id]}))}},i.prototype.executeUpdate=function(t,i,n){var e=this,r=t.update;null!=r&&r.forEach((function(t){var r=e.lookupRowNode(t);r&&(r.updateData(t),!r.selectable&&r.isSelected()&&n.push(r),i.update.push(r))}))},i.prototype.lookupRowNode=function(t){var i,n=this.gridOptionsWrapper.getRowIdFunc();if(null!=n){var e=this.level,r=this.parentRowNode.getGroupKeys(),o=n({data:t,parentKeys:r.length>0?r:void 0,level:e});if(!(i=this.allNodesMap[o]))return console.error("AG Grid: could not find row id="+o+", data item was not found for this id"),null}else if(!(i=this.allRowNodes.find((function(i){return i.data===t}))))return console.error("AG Grid: could not find data item as object was not found",t),null;return i},i.prototype.addStoreStates=function(t){t.push({infiniteScroll:!1,route:this.parentRowNode.getGroupKeys(),rowCount:this.allRowNodes.length,info:this.info}),this.forEachChildStoreShallow((function(i){return i.addStoreStates(t)}))},i.prototype.refreshStore=function(t){t&&this.initialiseRowNodes(this.nodesAfterSort?this.nodesAfterSort.length:1),this.scheduleLoad(),this.fireStoreUpdatedEvent()},i.prototype.retryLoads=function(){this.getState()===sf.STATE_FAILED&&(this.initialiseRowNodes(1),this.scheduleLoad()),this.forEachChildStoreShallow((function(t){return t.retryLoads()}))},i.prototype.scheduleLoad=function(){this.setStateWaitingToLoad(),this.rowNodeBlockLoader.checkBlockToLoad()},i.prototype.fireStoreUpdatedEvent=function(){this.eventService.dispatchEvent({type:xi.EVENT_STORE_UPDATED})},i.prototype.getRowCount=function(){return this.nodesAfterSort.length},i.prototype.getTopLevelRowDisplayedIndex=function(t){return this.nodesAfterSort[t].rowIndex},i.prototype.isLastRowIndexKnown=function(){return this.getState()==sf.STATE_LOADED},i.prototype.getRowNodesInRange=function(t,i){var n=[],e=!1;return Wr.missing(t)&&(e=!0),this.nodesAfterSort.forEach((function(r){var o=r===t||r===i;(e||o)&&n.push(r),o&&(e=!e)})),e?[]:n},am([Dt("ssrmStoreUtils")],i.prototype,"storeUtils",void 0),am([Dt("ssrmBlockUtils")],i.prototype,"blockUtils",void 0),am([Dt("columnModel")],i.prototype,"columnModel",void 0),am([Dt("rowNodeBlockLoader")],i.prototype,"rowNodeBlockLoader",void 0),am([Dt("rowNodeSorter")],i.prototype,"rowNodeSorter",void 0),am([Dt("sortController")],i.prototype,"sortController",void 0),am([Dt("ssrmNodeManager")],i.prototype,"nodeManager",void 0),am([Dt("filterManager")],i.prototype,"filterManager",void 0),am([Dt("ssrmTransactionManager")],i.prototype,"transactionManager",void 0),am([Ft],i.prototype,"postConstruct",null),am([kt],i.prototype,"destroyRowNodes",null),i}(sf),fm=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},dm=function(){function t(){}return t.prototype.createStore=function(t,i){var n=this.getStoreParams(t,i);return new(n.infiniteScroll?hm:lm)(t,n,i)},t.prototype.getStoreParams=function(t,i){var n=this.getLevelSpecificParams(i),e=this.isInfiniteScroll(n);return{infiniteScroll:e,cacheBlockSize:this.getBlockSize(e,n),maxBlocksInCache:this.getMaxBlocksInCache(e,t,n)}},t.prototype.getMaxBlocksInCache=function(t,i,n){if(t){var e=n&&null!=n.maxBlocksInCache?n.maxBlocksInCache:this.gridOptionsWrapper.getMaxBlocksInCache();if(null!=e&&e>=0)if(i.dynamicRowHeight)Wr.doOnce((function(){return console.warn("AG Grid: Server Side Row Model does not support Dynamic Row Height and Cache Purging. Either a) remove getRowHeight() callback or b) remove maxBlocksInCache property. Purging has been disabled.")}),"storeFactory.maxBlocksInCache.dynamicRowHeight");else{if(!this.columnModel.isAutoRowHeightActive())return e;Wr.doOnce((function(){return console.warn("AG Grid: Server Side Row Model does not support Auto Row Height and Cache Purging. Either a) remove colDef.autoHeight or b) remove maxBlocksInCache property. Purging has been disabled.")}),"storeFactory.maxBlocksInCache.autoRowHeightActive")}}},t.prototype.getBlockSize=function(t,i){if(t){var n=i&&null!=i.cacheBlockSize?i.cacheBlockSize:this.gridOptionsWrapper.getCacheBlockSize();return null!=n&&n>0?n:100}},t.prototype.getLevelSpecificParams=function(t){var i=this.gridOptionsWrapper.getServerSideGroupLevelParamsFunc();if(i){var n=i({level:t.level+1,parentRowNode:t.level>=0?t:void 0,rowGroupColumns:this.columnModel.getRowGroupColumns(),pivotColumns:this.columnModel.getPivotColumns(),pivotMode:this.columnModel.isPivotMode()});return null!=n.storeType&&(n.infiniteScroll="partial"===n.storeType),n}},t.prototype.isInfiniteScroll=function(t){return t&&null!=t.infiniteScroll?t.infiniteScroll:this.gridOptionsWrapper.isServerSideInfiniteScroll()},fm([Dt("gridOptionsWrapper")],t.prototype,"gridOptionsWrapper",void 0),fm([Dt("columnModel")],t.prototype,"columnModel",void 0),fm([Pt("ssrmStoreFactory")],t)}(),vm=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},pm=function(){function t(){}return t.prototype.isSortingWithValueColumn=function(t){for(var i=this.columnModel.getValueColumns().map((function(t){return t.getColId()})),n=0;n<t.length;n++)if(i.indexOf(t[n])>-1)return!0;return!1},t.prototype.isSortingWithSecondaryColumn=function(t){if(!this.columnModel.getSecondaryColumns())return!1;for(var i=this.columnModel.getSecondaryColumns().map((function(t){return t.getColId()})),n=0;n<t.length;n++)if(i.indexOf(t[n])>-1)return!0;return!1},vm([Dt("columnModel")],t.prototype,"columnModel",void 0),vm([Pt("ssrmListenerUtils")],t)}(),gm={moduleName:Nt.ServerSideRowModelModule,rowModels:{serverSide:Dg},beans:[qg,Zg,Tg,Lg,Hg,Ug,tm,dm,pm],dependantModules:[Kp]},mm=function(){function t(){}return t.prototype.setBeans=function(t){this.beans=t},t.prototype.getFileName=function(t){var i=this.getDefaultFileExtension();return null!=t&&t.length||(t=this.getDefaultFileName()),-1===t.indexOf(".")?t+"."+i:t},t.prototype.getData=function(t){var i=this.createSerializingSession(t);return this.beans.gridSerializer.serialize(i,t)},t}(),bm=function(){function t(t){this.groupColumns=[];var i=t.valueService,n=t.gridOptionsWrapper,e=t.processCellCallback,r=t.processHeaderCallback,o=t.processGroupHeaderCallback,s=t.processRowGroupCallback;this.columnModel=t.columnModel,this.valueService=i,this.gridOptionsWrapper=n,this.processCellCallback=e,this.processHeaderCallback=r,this.processGroupHeaderCallback=o,this.processRowGroupCallback=s}return t.prototype.prepare=function(t){this.groupColumns=t.filter((function(t){return!!t.getColDef().showRowGroup}))},t.prototype.extractHeaderValue=function(t){var i=this.getHeaderName(this.processHeaderCallback,t);return null!=i?i:""},t.prototype.extractRowCellValue=function(t,i,n,e,r){var o=!this.gridOptionsWrapper.isGroupHideOpenParents()&&this.shouldRenderGroupSummaryCell(r,t,i)?this.createValueForGroupNode(r):this.valueService.getValue(t,r),s=this.processCell({accumulatedRowIndex:n,rowNode:r,column:t,value:o,processCellCallback:this.processCellCallback,type:e});return null!=s?s:""},t.prototype.shouldRenderGroupSummaryCell=function(t,i,n){var e;if(!t||!t.group)return!1;if(-1!==this.groupColumns.indexOf(i)&&(null===(e=t.groupData)||void 0===e?void 0:e[i.getId()]))return!0;var r=this.gridOptionsWrapper.isGroupUseEntireRow(this.columnModel.isPivotMode());return 0===n&&r},t.prototype.getHeaderName=function(t,i){return t?t({column:i,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()}):this.columnModel.getDisplayNameForColumn(i,"csv",!0)},t.prototype.createValueForGroupNode=function(t){if(this.processRowGroupCallback)return this.processRowGroupCallback({node:t,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()});var i=[t.key];if(!this.gridOptionsWrapper.isGroupMultiAutoColumn())for(;t.parent;)i.push((t=t.parent).key);return i.reverse().join(" -> ")},t.prototype.processCell=function(t){var i=t.value,n=t.processCellCallback,e=t.type;return n?n({accumulatedRowIndex:t.accumulatedRowIndex,column:t.column,node:t.rowNode,value:i,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext(),type:e}):null!=i?i:""},t}(),wm=function(){function t(){}return t.download=function(t,i){var n=document.defaultView||window;if(n){var e=document.createElement("a"),r=n.URL.createObjectURL(i);e.setAttribute("href",r),e.setAttribute("download",t),e.style.display="none",document.body.appendChild(e),e.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:n})),document.body.removeChild(e),n.setTimeout((function(){n.URL.revokeObjectURL(r)}),0)}else console.warn("AG Grid: There is no `window` associated with the current `document`")},t}(),ym=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Cm=function(t){function i(i){var n=t.call(this,i)||this;n.isFirstLine=!0,n.result="";var e=i.columnSeparator;return n.suppressQuotes=i.suppressQuotes,n.columnSeparator=e,n}return ym(i,t),i.prototype.addCustomContent=function(t){var i=this;t&&("string"==typeof t?(/^\s*\n/.test(t)||this.beginNewLine(),t=t.replace(/\r?\n/g,"\r\n"),this.result+=t):t.forEach((function(t){i.beginNewLine(),t.forEach((function(t,n){0!==n&&(i.result+=i.columnSeparator),i.result+=i.putInQuotes(t.data.value||""),t.mergeAcross&&i.appendEmptyCells(t.mergeAcross)}))})))},i.prototype.onNewHeaderGroupingRow=function(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}},i.prototype.onNewHeaderGroupingRowColumn=function(t,i,n,e){0!=n&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(i),this.appendEmptyCells(e)},i.prototype.appendEmptyCells=function(t){for(var i=1;i<=t;i++)this.result+=this.columnSeparator+this.putInQuotes("")},i.prototype.onNewHeaderRow=function(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}},i.prototype.onNewHeaderRowColumn=function(t,i){0!=i&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(t))},i.prototype.onNewBodyRow=function(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}},i.prototype.onNewBodyRowColumn=function(t,i,n){0!=i&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractRowCellValue(t,i,i,Vt.EXPORT_TYPE_CSV,n))},i.prototype.putInQuotes=function(t){return this.suppressQuotes?t:null==t?'""':("string"==typeof t?i=t:"function"==typeof t.toString?i=t.toString():(console.warn("AG Grid: unknown value type during csv conversion"),i=""),'"'+i.replace(/"/g,'""')+'"');var i},i.prototype.parse=function(){return this.result},i.prototype.beginNewLine=function(){this.isFirstLine||(this.result+="\r\n"),this.isFirstLine=!1},i}(bm),Sm=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Rm=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Om=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Sm(i,t),i.prototype.postConstruct=function(){this.setBeans({gridSerializer:this.gridSerializer,gridOptionsWrapper:this.gridOptionsWrapper})},i.prototype.getMergedParams=function(t){var i=this.gridOptionsWrapper.getDefaultExportParams("csv");return Object.assign({},i,t)},i.prototype.export=function(t){if(this.isExportSuppressed())return console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration."),"";var i=this.getMergedParams(t),n=this.getData(i),e=new Blob(["\ufeff",n],{type:"text/plain"});return wm.download(this.getFileName(i.fileName),e),n},i.prototype.exportDataAsCsv=function(t){return this.export(t)},i.prototype.getDataAsCsv=function(t,i){void 0===i&&(i=!1);var n=i?Object.assign({},t):this.getMergedParams(t);return this.getData(n)},i.prototype.getDefaultFileName=function(){return"export.csv"},i.prototype.getDefaultFileExtension=function(){return"csv"},i.prototype.createSerializingSession=function(t){var i=this;return new Cm({columnModel:i.columnModel,valueService:i.valueService,gridOptionsWrapper:i.gridOptionsWrapper,processCellCallback:t.processCellCallback||void 0,processHeaderCallback:t.processHeaderCallback||void 0,processGroupHeaderCallback:t.processGroupHeaderCallback||void 0,processRowGroupCallback:t.processRowGroupCallback||void 0,suppressQuotes:t.suppressQuotes||!1,columnSeparator:t.columnSeparator||","})},i.prototype.isExportSuppressed=function(){return this.gridOptionsWrapper.isSuppressCsvExport()},Rm([Dt("columnModel")],i.prototype,"columnModel",void 0),Rm([Dt("valueService")],i.prototype,"valueService",void 0),Rm([Dt("gridSerializer")],i.prototype,"gridSerializer",void 0),Rm([Dt("gridOptionsWrapper")],i.prototype,"gridOptionsWrapper",void 0),Rm([Ft],i.prototype,"postConstruct",null),Rm([Pt("csvCreator")],i)}(mm),Am=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),jm=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(t){t[t.HEADER_GROUPING=0]="HEADER_GROUPING",t[t.HEADER=1]="HEADER",t[t.BODY=2]="BODY"}(um||(um={}));var _m,Gm=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Am(i,t),i.prototype.serialize=function(t,i){void 0===i&&(i={});var n=this.getColumnsToExport(i.allColumns,i.columnKeys);return Wr.compose(this.prepareSession(n),this.prependContent(i),this.exportColumnGroups(i,n),this.exportHeaders(i,n),this.processPinnedTopRows(i,n),this.processRows(i,n),this.processPinnedBottomRows(i,n),this.appendContent(i))(t).parse()},i.prototype.processRow=function(t,i,n,e){var r=i.shouldRowBeSkipped||function(){return!1},o=this.gridOptionsWrapper,s=o.getContext(),u=o.getApi(),h=o.getColumnApi(),c=o.isGroupRemoveSingleChildren(),a=o.isGroupRemoveLowestSingleChildren(),l=null!=i.rowPositions,f=l||!!i.onlySelected,d=o.isGroupHideOpenParents()&&!f,v=this.columnModel.isPivotMode()?e.leafGroup:!e.group,p=1===e.allChildrenCount&&(c||a&&e.leafGroup);if((i.skipGroups||i.skipRowGroups)&&i.skipGroups&&Wr.doOnce((function(){return console.warn("AG Grid: Since v25.2 `skipGroups` has been renamed to `skipRowGroups`.")}),"gridSerializer-skipGroups"),!(!v&&(i.skipRowGroups||p||d)||i.onlySelected&&!e.isSelected()||i.skipPinnedTop&&"top"===e.rowPinned||i.skipPinnedBottom&&"bottom"===e.rowPinned)&&(-1!==e.level||e.leafGroup||e.footer&&l)&&!r({node:e,api:u,columnApi:h,context:s})){var g=t.onNewBodyRow();if(n.forEach((function(t,i){g.onColumn(t,i,e)})),i.getCustomContentBelowRow){var m=i.getCustomContentBelowRow({node:e,api:u,columnApi:h,context:s});m&&t.addCustomContent(m)}}},i.prototype.appendContent=function(t){return function(i){var n=t.customFooter||t.appendContent;return n&&(t.customFooter&&Wr.doOnce((function(){return console.warn("AG Grid: Since version 25.2.0 the `customFooter` param has been deprecated. Use `appendContent` instead.")}),"gridSerializer-customFooter"),i.addCustomContent(n)),i}},i.prototype.prependContent=function(t){return function(i){var n=t.customHeader||t.prependContent;return n&&(t.customHeader&&Wr.doOnce((function(){return console.warn("AG Grid: Since version 25.2.0 the `customHeader` param has been deprecated. Use `prependContent` instead.")}),"gridSerializer-customHeader"),i.addCustomContent(n)),i}},i.prototype.prepareSession=function(t){return function(i){return i.prepare(t),i}},i.prototype.exportColumnGroups=function(t,i){var n=this;return function(e){if(t.skipColumnGroupHeaders)t.columnGroups&&Wr.doOnce((function(){return console.warn("AG Grid: Since v25.2 the `columnGroups` param has deprecated, and groups are exported by default.")}),"gridSerializer-columnGroups");else{var r=new Mi,o=n.displayedGroupCreator.createDisplayedGroups(i,n.columnModel.getGridBalancedTree(),r,null);n.recursivelyAddHeaderGroups(o,e,t.processGroupHeaderCallback)}return e}},i.prototype.exportHeaders=function(t,i){return function(n){if(t.skipHeader||t.skipColumnHeaders)t.skipHeader&&Wr.doOnce((function(){return console.warn("AG Grid: Since v25.2 the `skipHeader` param has been renamed to `skipColumnHeaders`.")}),"gridSerializer-skipHeader");else{var e=n.onNewHeaderRow();i.forEach((function(t,i){e.onColumn(t,i,void 0)}))}return n}},i.prototype.processPinnedTopRows=function(t,i){var n=this;return function(e){var r=n.processRow.bind(n,e,t,i);return t.rowPositions?t.rowPositions.filter((function(t){return"top"===t.rowPinned})).sort((function(t,i){return t.rowIndex-i.rowIndex})).map((function(t){return n.pinnedRowModel.getPinnedTopRow(t.rowIndex)})).forEach(r):n.pinnedRowModel.forEachPinnedTopRow(r),e}},i.prototype.processRows=function(t,i){var n=this;return function(e){var r=n.rowModel,o=r.getType(),s=o===Vt.ROW_MODEL_TYPE_CLIENT_SIDE,u=o===Vt.ROW_MODEL_TYPE_SERVER_SIDE,h=!s&&t.onlySelected,c=n.processRow.bind(n,e,t,i),a=t.exportedRows,l=void 0===a?"filteredAndSorted":a;return t.rowPositions?t.rowPositions.filter((function(t){return null==t.rowPinned})).sort((function(t,i){return t.rowIndex-i.rowIndex})).map((function(t){return r.getRow(t.rowIndex)})).forEach(c):n.columnModel.isPivotMode()?s?r.forEachPivotNode(c):r.forEachNode(c):t.onlySelectedAllPages||h?n.selectionService.getSelectedNodes().forEach(c):"all"===l?r.forEachNode(c):s||u?r.forEachNodeAfterFilterAndSort(c):r.forEachNode(c),e}},i.prototype.processPinnedBottomRows=function(t,i){var n=this;return function(e){var r=n.processRow.bind(n,e,t,i);return t.rowPositions?t.rowPositions.filter((function(t){return"bottom"===t.rowPinned})).sort((function(t,i){return t.rowIndex-i.rowIndex})).map((function(t){return n.pinnedRowModel.getPinnedBottomRow(t.rowIndex)})).forEach(r):n.pinnedRowModel.forEachPinnedBottomRow(r),e}},i.prototype.getColumnsToExport=function(t,i){void 0===t&&(t=!1);var n=this.columnModel.isPivotMode();return i&&i.length?this.columnModel.getGridColumns(i):t&&!n?(this.gridOptionsWrapper.isTreeData()?this.columnModel.getGridColumns([Vt.GROUP_AUTO_COLUMN_ID]):[]).concat(this.columnModel.getAllPrimaryColumns()||[]):this.columnModel.getAllDisplayedColumns()},i.prototype.recursivelyAddHeaderGroups=function(t,i,n){var e=[];t.forEach((function(t){t.getChildren&&t.getChildren().forEach((function(t){return e.push(t)}))})),t.length>0&&t[0]instanceof ui&&this.doAddHeaderHeader(i,t,n),e&&e.length>0&&this.recursivelyAddHeaderGroups(e,i,n)},i.prototype.doAddHeaderHeader=function(t,i,n){var e=this,r=t.onNewHeaderGroupingRow(),o=0;i.forEach((function(t){var i,s=t;i=n?n({columnGroup:s,api:e.gridOptionsWrapper.getApi(),columnApi:e.gridOptionsWrapper.getColumnApi(),context:e.gridOptionsWrapper.getContext()}):e.columnModel.getDisplayNameForColumnGroup(s,"header");var u=s.getLeafColumns().reduce((function(t,i,n,e){var r=Wr.last(t);return"open"===i.getColumnGroupShow()?r&&null==r[1]||t.push(r=[n]):r&&null==r[1]&&(r[1]=n-1),n===e.length-1&&r&&null==r[1]&&(r[1]=n),t}),[]);r.onColumn(s,i||"",o++,s.getLeafColumns().length-1,u)}))},jm([Dt("displayedGroupCreator")],i.prototype,"displayedGroupCreator",void 0),jm([Dt("columnModel")],i.prototype,"columnModel",void 0),jm([Dt("rowModel")],i.prototype,"rowModel",void 0),jm([Dt("pinnedRowModel")],i.prototype,"pinnedRowModel",void 0),jm([Dt("selectionService")],i.prototype,"selectionService",void 0),jm([Dt("rowPositionUtils")],i.prototype,"rowPositionUtils",void 0),jm([Pt("gridSerializer")],i)}(Ai),xm={moduleName:Nt.CsvExportModule,beans:[Om,Gm]},Mm=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Fm=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},km=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.lastPasteOperationTime=0,i.navigatorApiFailed=!1,i}return Mm(i,t),i.prototype.init=function(){var t=this;this.logger=this.loggerFactory.create("ClipboardService"),this.rowModel.getType()===Vt.ROW_MODEL_TYPE_CLIENT_SIDE&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady((function(i){t.gridCtrl=i.gridCtrl}))},i.prototype.pasteFromClipboard=function(){var t=this;this.logger.log("pasteFromClipboard"),!this.gridOptionsWrapper.isSuppressClipboardApi()&&!this.navigatorApiFailed&&navigator.clipboard&&navigator.clipboard.readText?navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch((function(i){Wr.doOnce((function(){console.warn(i),console.warn("AG Grid: Unable to use the Clipboard API (navigator.clipboard.readText()). The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API")}),"clipboardApiError"),t.navigatorApiFailed=!0,t.pasteFromClipboardLegacy()})):this.pasteFromClipboardLegacy()},i.prototype.pasteFromClipboardLegacy=function(){var t=this,i=!1,n=function(n){var e=(new Date).getTime();e-t.lastPasteOperationTime<50&&(i=!0,n.preventDefault()),t.lastPasteOperationTime=e};this.executeOnTempElement((function(t){t.addEventListener("paste",n),t.focus({preventScroll:!0})}),(function(e){var r=e.value;i?t.refocusLastFocusedCell():t.processClipboardData(r),e.removeEventListener("paste",n)}))},i.prototype.refocusLastFocusedCell=function(){var t=this.focusService.getFocusedCell();t&&this.focusService.setFocusedCell({rowIndex:t.rowIndex,column:t.column,rowPinned:t.rowPinned,forceBrowserFocus:!0})},i.prototype.processClipboardData=function(t){var i=this;if(null!=t){var n=Wr.stringToArray(t,this.gridOptionsWrapper.getClipboardDelimiter()),e=this.gridOptionsWrapper.getProcessDataFromClipboardFunc();e&&(n=e({data:n})),null!=n&&(this.gridOptionsWrapper.isSuppressLastEmptyLineOnPaste()&&this.removeLastLineIfBlank(n),this.doPasteOperation((function(t,e,r,o){i.rangeService&&i.rangeService.isMoreThanOneCell()&&!i.hasOnlyOneValueToPaste(n)?i.pasteIntoActiveRange(n,t,e,o):i.pasteStartingFromFocusedCell(n,t,e,r,o)})))}},i.prototype.doPasteOperation=function(t){var i,n=this.gridOptionsWrapper.getApi(),e=this.gridOptionsWrapper.getColumnApi(),r="clipboard";if(this.eventService.dispatchEvent({type:xi.EVENT_PASTE_START,api:n,columnApi:e,source:r}),this.clientSideRowModel){var o=this.gridOptionsWrapper.isAggregateOnlyChangedColumns();i=new rf(o,this.clientSideRowModel.getRootNode())}var s={},u=[];t(s,u,this.focusService.getFocusedCell(),i),i&&this.clientSideRowModel.doAggregate(i),this.rowRenderer.refreshCells(),this.dispatchFlashCells(s),this.fireRowChanged(u),this.refocusLastFocusedCell(),this.eventService.dispatchEvent({type:xi.EVENT_PASTE_END,source:r})},i.prototype.pasteIntoActiveRange=function(t,i,n,e){var r=this,o=this.getRangeSize()%t.length!=0,s=0,u=0;this.iterateActiveRanges(!1,(function(h,c,a,l){if(l-s>=t.length){if(o)return;s+=u,u=0}var f=t[l-s];n.push(c);var d=r.gridOptionsWrapper.getProcessCellFromClipboardFunc();a.forEach((function(t,n){if(t.isCellEditable(c)&&!t.isSuppressPaste(c)){n>=f.length&&(n%=f.length);var o=r.processCell(c,t,f[n],Vt.EXPORT_TYPE_DRAG_COPY,d);c.setDataValue(t,o,Vt.SOURCE_PASTE),e&&e.addParentNode(c.parent,[t]);var s=r.cellPositionUtils.createIdFromValues(h.rowIndex,t,h.rowPinned);i[s]=!0}})),u++}))},i.prototype.pasteStartingFromFocusedCell=function(t,i,n,e,r){if(e){var o={rowIndex:e.rowIndex,rowPinned:e.rowPinned},s=this.columnModel.getDisplayedColumnsStartingAt(e.column);this.isPasteSingleValueIntoRange(t)?this.pasteSingleValueIntoRange(t,n,i,r):this.pasteMultipleValues(t,o,n,s,i,Vt.EXPORT_TYPE_CLIPBOARD,r)}},i.prototype.isPasteSingleValueIntoRange=function(t){return this.hasOnlyOneValueToPaste(t)&&null!=this.rangeService&&!this.rangeService.isEmpty()},i.prototype.pasteSingleValueIntoRange=function(t,i,n,e){var r=this,o=t[0][0];this.iterateActiveRanges(!1,(function(t,s,u){i.push(s),u.forEach((function(t){return r.updateCellValue(s,t,o,n,Vt.EXPORT_TYPE_CLIPBOARD,e)}))}))},i.prototype.hasOnlyOneValueToPaste=function(t){return 1===t.length&&1===t[0].length},i.prototype.copyRangeDown=function(){var t=this;if(this.rangeService&&!this.rangeService.isEmpty()){var i=[];this.doPasteOperation((function(n,e,r,o){var s=t.gridOptionsWrapper.getProcessCellForClipboardFunc(),u=t.gridOptionsWrapper.getProcessCellFromClipboardFunc();t.iterateActiveRanges(!0,(function(r,h,c){i.length?(e.push(h),c.forEach((function(e,s){if(e.isCellEditable(h)&&!e.isSuppressPaste(h)){var c=t.processCell(h,e,i[s],Vt.EXPORT_TYPE_DRAG_COPY,u);h.setDataValue(e,c,Vt.SOURCE_PASTE),o&&o.addParentNode(h.parent,[e]);var a=t.cellPositionUtils.createIdFromValues(r.rowIndex,e,r.rowPinned);n[a]=!0}}))):c.forEach((function(n){var e=t.processCell(h,n,t.valueService.getValue(n,h),Vt.EXPORT_TYPE_DRAG_COPY,s);i.push(e)}))}))}))}},i.prototype.removeLastLineIfBlank=function(t){var i=Wr.last(t);if(i&&1===i.length&&""===i[0]){if(1===t.length)return;Wr.removeFromArray(t,i)}},i.prototype.fireRowChanged=function(t){var i=this;this.gridOptionsWrapper.isFullRowEdit()&&t.forEach((function(t){i.eventService.dispatchEvent({type:xi.EVENT_ROW_VALUE_CHANGED,node:t,data:t.data,rowIndex:t.rowIndex,rowPinned:t.rowPinned})}))},i.prototype.pasteMultipleValues=function(t,i,n,e,r,o,s){var u=this,h=i,c=null!=this.clientSideRowModel&&!this.gridOptionsWrapper.isTreeData();t.forEach((function(t){var i=function(){for(;;){if(!h)return null;var t=u.rowPositionUtils.getRowNode(h);if(h=u.cellNavigationService.getRowBelow({rowPinned:h.rowPinned,rowIndex:h.rowIndex}),null==t)return null;if(!(t.detail||t.footer||c&&t.group))return t}}();i&&(t.forEach((function(t,n){return u.updateCellValue(i,e[n],t,r,o,s)})),n.push(i))}))},i.prototype.updateCellValue=function(t,i,n,e,r,o){if(t&&i&&i.isCellEditable(t)&&!i.isSuppressPaste(t)){var s=this.processCell(t,i,n,r,this.gridOptionsWrapper.getProcessCellFromClipboardFunc());t.setDataValue(i,s,Vt.SOURCE_PASTE),e[this.cellPositionUtils.createIdFromValues(t.rowIndex,i,t.rowPinned)]=!0,o&&o.addParentNode(t.parent,[i])}},i.prototype.copyToClipboard=function(t){void 0===t&&(t={});var i=t.includeHeaders,n=t.includeGroupHeaders;this.logger.log("copyToClipboard: includeHeaders = "+i),null==i&&(i=this.gridOptionsWrapper.isCopyHeadersToClipboard()),null==n&&(n=this.gridOptionsWrapper.isCopyGroupHeadersToClipboard());var e={includeHeaders:i,includeGroupHeaders:n},r=!this.gridOptionsWrapper.isSuppressCopyRowsToClipboard();!this.rangeService||this.rangeService.isEmpty()||this.shouldSkipSingleCellRange()?r&&!this.selectionService.isEmpty()?this.copySelectedRowsToClipboard(e):this.focusService.isAnyCellFocused()&&this.copyFocusedCellToClipboard(e):this.copySelectedRangeToClipboard(e)},i.prototype.shouldSkipSingleCellRange=function(){return this.gridOptionsWrapper.isSuppressCopySingleCellRanges()&&!this.rangeService.isMoreThanOneCell()},i.prototype.iterateActiveRanges=function(t,i,n){var e=this;if(this.rangeService&&!this.rangeService.isEmpty()){var r=this.rangeService.getCellRanges();t?this.iterateActiveRange(r[0],i,n,!0):r.forEach((function(t,o){return e.iterateActiveRange(t,i,n,o===r.length-1)}))}},i.prototype.iterateActiveRange=function(t,i,n,e){if(this.rangeService){var r=this.rangeService.getRangeStartRow(t),o=this.rangeService.getRangeEndRow(t);n&&t.columns&&n(t.columns);for(var s=0,u=!1;!u&&null!=r;){var h=this.rowPositionUtils.getRowNode(r);u=this.rowPositionUtils.sameRow(r,o),i(r,h,t.columns,s++,u&&e),r=this.cellNavigationService.getRowBelow(r)}}},i.prototype.copySelectedRangeToClipboard=function(t){if(void 0===t&&(t={}),this.rangeService&&!this.rangeService.isEmpty()){var i=this.rangeService.areAllRangesAbleToMerge()?this.buildDataFromMergedRanges(t):this.buildDataFromRanges(t),n=i.cellsToFlash;this.copyDataToClipboard(i.data),this.dispatchFlashCells(n)}},i.prototype.buildDataFromMergedRanges=function(t){var i=this,n=new Set,e=this.rangeService.getCellRanges(),r=new Map,o=[],s={};e.forEach((function(t){t.columns.forEach((function(t){return n.add(t)}));var e=i.getRangeRowPositionsAndCellsToFlash(t),u=e.cellsToFlash;e.rowPositions.forEach((function(t){var i=t.rowIndex+"-"+(t.rowPinned||"null");r.get(i)||(r.set(i,!0),o.push(t))})),Object.assign(s,u)}));var u=this.columnModel.getAllDisplayedColumns(),h=Array.from(n);return h.sort((function(t,i){return u.indexOf(t)-u.indexOf(i)})),{data:this.buildExportParams({columns:h,rowPositions:o,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}),cellsToFlash:s}},i.prototype.buildDataFromRanges=function(t){var i=this,n=this.rangeService.getCellRanges(),e=[],r={};return n.forEach((function(n){var o=i.getRangeRowPositionsAndCellsToFlash(n),s=o.rowPositions;Object.assign(r,o.cellsToFlash),e.push(i.buildExportParams({columns:n.columns,rowPositions:s,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}))})),{data:e.join("\n"),cellsToFlash:r}},i.prototype.getRangeRowPositionsAndCellsToFlash=function(t){for(var i=this,n=[],e={},r=this.rangeService.getRangeStartRow(t),o=this.rangeService.getRangeEndRow(t),s=r;s&&(n.push(s),t.columns.forEach((function(t){var n=i.cellPositionUtils.createIdFromValues(s.rowIndex,t,s.rowPinned);e[n]=!0})),!this.rowPositionUtils.sameRow(s,o));)s=this.cellNavigationService.getRowBelow(s);return{rowPositions:n,cellsToFlash:e}},i.prototype.copyFocusedCellToClipboard=function(t){var i;void 0===t&&(t={});var n=this.focusService.getFocusedCell();if(null!=n){var e=this.cellPositionUtils.createId(n),r=this.buildExportParams({columns:[n.column],rowPositions:[{rowPinned:n.rowPinned,rowIndex:n.rowIndex}],includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders});this.copyDataToClipboard(r),this.dispatchFlashCells(((i={})[e]=!0,i))}},i.prototype.copySelectedRowsToClipboard=function(t){void 0===t&&(t={});var i=this.buildExportParams({columns:t.columnKeys,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders});this.copyDataToClipboard(i)},i.prototype.buildExportParams=function(t){var i=t.rowPositions,n=t.includeHeaders,e=t.includeGroupHeaders,r={columnKeys:t.columns,rowPositions:i,skipColumnHeaders:!(void 0!==n&&n),skipColumnGroupHeaders:!(void 0!==e&&e),suppressQuotes:!0,columnSeparator:this.gridOptionsWrapper.getClipboardDelimiter(),onlySelected:!i,processCellCallback:this.gridOptionsWrapper.getProcessCellForClipboardFunc(),processRowGroupCallback:function(t){return t.node.key},processHeaderCallback:this.gridOptionsWrapper.getProcessHeaderForClipboardFunc(),processGroupHeaderCallback:this.gridOptionsWrapper.getProcessGroupHeaderForClipboardFunc()};return this.csvCreator.getDataAsCsv(r,!0)},i.prototype.dispatchFlashCells=function(t){var i=this;window.setTimeout((function(){i.eventService.dispatchEvent({type:xi.EVENT_FLASH_CELLS,cells:t})}),0)},i.prototype.processCell=function(t,i,n,e,r){return r?r({column:i,node:t,value:n,type:e}):n},i.prototype.copyDataToClipboard=function(t){var i=this,n=this.gridOptionsWrapper.getSendToClipboardFunc();n?n({data:t}):!this.gridOptionsWrapper.isSuppressClipboardApi()&&navigator.clipboard?navigator.clipboard.writeText(t).catch((function(n){Wr.doOnce((function(){console.warn(n),console.warn("AG Grid: Unable to use the Clipboard API (navigator.clipboard.writeText()). The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API.")}),"clipboardApiError"),i.copyDataToClipboardLegacy(t)})):this.copyDataToClipboardLegacy(t)},i.prototype.copyDataToClipboardLegacy=function(t){var i=this;this.executeOnTempElement((function(n){var e=i.gridOptionsWrapper.getDocument(),r=e.activeElement;n.value=t||" ",n.select(),n.focus({preventScroll:!0}),e.execCommand("copy")||console.warn("AG Grid: Browser did not allow document.execCommand('copy'). Ensure api.copySelectedRowsToClipboard() is invoked via a user event, i.e. button click, otherwise the browser will prevent it for security reasons."),null!=r&&null!=r.focus&&r.focus({preventScroll:!0})}))},i.prototype.executeOnTempElement=function(t,i){var n=this.gridOptionsWrapper.getDocument(),e=n.createElement("textarea");e.style.width="1px",e.style.height="1px",e.style.top=n.documentElement.scrollTop+"px",e.style.left=n.documentElement.scrollLeft+"px",e.style.position="absolute",e.style.opacity="0";var r=this.gridCtrl.getGui();r.appendChild(e);try{t(e)}catch(t){console.warn("AG Grid: Browser does not support document.execCommand('copy') for clipboard operations")}i?window.setTimeout((function(){i(e),r.removeChild(e)}),100):r.removeChild(e)},i.prototype.getRangeSize=function(){var t=this.rangeService.getCellRanges(),i=0,n=0;return t.length>0&&(i=this.rangeService.getRangeStartRow(t[0]).rowIndex,n=this.rangeService.getRangeEndRow(t[0]).rowIndex),i-n+1},Fm([Dt("csvCreator")],i.prototype,"csvCreator",void 0),Fm([Dt("loggerFactory")],i.prototype,"loggerFactory",void 0),Fm([Dt("selectionService")],i.prototype,"selectionService",void 0),Fm([It("rangeService")],i.prototype,"rangeService",void 0),Fm([Dt("rowModel")],i.prototype,"rowModel",void 0),Fm([Dt("ctrlsService")],i.prototype,"ctrlsService",void 0),Fm([Dt("valueService")],i.prototype,"valueService",void 0),Fm([Dt("focusService")],i.prototype,"focusService",void 0),Fm([Dt("rowRenderer")],i.prototype,"rowRenderer",void 0),Fm([Dt("columnModel")],i.prototype,"columnModel",void 0),Fm([Dt("cellNavigationService")],i.prototype,"cellNavigationService",void 0),Fm([Dt("cellPositionUtils")],i.prototype,"cellPositionUtils",void 0),Fm([Dt("rowPositionUtils")],i.prototype,"rowPositionUtils",void 0),Fm([Ft],i.prototype,"init",null),Fm([Pt("clipboardService")],i)}(Ai),Pm={moduleName:Nt.ClipboardModule,beans:[km],dependantModules:[Kp,xm]},Dm=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Im=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(t){t[t.EXPANDED=0]="EXPANDED",t[t.COLLAPSED=1]="COLLAPSED",t[t.INDETERMINATE=2]="INDETERMINATE"}(_m||(_m={})),function(t){function i(){return t.call(this,i.TEMPLATE)||this}Dm(i,t),i.prototype.postConstruct=function(){var t=this;this.createExpandIcons(),this.addManagedListener(this.eExpand,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eExpand,"keydown",(function(i){i.key===xr.SPACE&&t.onExpandClicked()})),this.addManagedListener(this.eSelect.getInputElement(),"click",this.onSelectClicked.bind(this)),this.eFilterTextField.onValueChange((function(){return t.onFilterTextChanged()})),this.addManagedListener(this.eFilterTextField.getInputElement(),"keypress",this.onMiniFilterKeyPress.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_NEW_COLUMNS_LOADED,this.showOrHideOptions.bind(this));var i=this.gridOptionsWrapper.getLocaleTextFunc();this.eSelect.setInputAriaLabel(i("ariaColumnSelectAll","Toggle Select All Columns")),this.eFilterTextField.setInputAriaLabel(i("ariaFilterColumnsInput","Filter Columns Input"))},i.prototype.init=function(t){this.params=t,this.columnModel.isReady()&&this.showOrHideOptions()},i.prototype.createExpandIcons=function(){this.eExpand.appendChild(this.eExpandChecked=Wr.createIconNoSpan("columnSelectOpen",this.gridOptionsWrapper)),this.eExpand.appendChild(this.eExpandUnchecked=Wr.createIconNoSpan("columnSelectClosed",this.gridOptionsWrapper)),this.eExpand.appendChild(this.eExpandIndeterminate=Wr.createIconNoSpan("columnSelectIndeterminate",this.gridOptionsWrapper)),this.setExpandState(_m.EXPANDED)},i.prototype.showOrHideOptions=function(){var t=!this.params.suppressColumnFilter,i=!this.params.suppressColumnSelectAll,n=!this.params.suppressColumnExpandAll,e=this.columnModel.isPrimaryColumnGroupsPresent(),r=this.gridOptionsWrapper.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(r("searchOoo","Search...")),Wr.setDisplayed(this.eFilterTextField.getGui(),t),Wr.setDisplayed(this.eSelect.getGui(),i),Wr.setDisplayed(this.eExpand,n&&e)},i.prototype.onFilterTextChanged=function(){var t=this;this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=Wr.debounce((function(){var i=t.eFilterTextField.getValue();t.dispatchEvent({type:"filterChanged",filterText:i})}),i.DEBOUNCE_DELAY)),this.onFilterTextChangedDebounced()},i.prototype.onMiniFilterKeyPress=function(t){var n=this;t.key===xr.ENTER&&setTimeout((function(){return n.onSelectClicked()}),i.DEBOUNCE_DELAY)},i.prototype.onSelectClicked=function(){this.dispatchEvent({type:this.selectState?"unselectAll":"selectAll"})},i.prototype.onExpandClicked=function(){this.dispatchEvent({type:this.expandState===_m.EXPANDED?"collapseAll":"expandAll"})},i.prototype.setExpandState=function(t){this.expandState=t,Wr.setDisplayed(this.eExpandChecked,this.expandState===_m.EXPANDED),Wr.setDisplayed(this.eExpandUnchecked,this.expandState===_m.COLLAPSED),Wr.setDisplayed(this.eExpandIndeterminate,this.expandState===_m.INDETERMINATE)},i.prototype.setSelectionState=function(t){this.selectState=t,this.eSelect.setValue(this.selectState)},i.DEBOUNCE_DELAY=300,i.TEMPLATE='<div class="ag-column-select-header" role="presentation" tabindex="-1">\n <div ref="eExpand" class="ag-column-select-header-icon" tabindex="0"></div>\n <ag-checkbox ref="eSelect" class="ag-column-select-header-checkbox"></ag-checkbox>\n <ag-input-text-field class="ag-column-select-header-filter-wrapper" ref="eFilterTextField"></ag-input-text-field>\n </div>',Im([Dt("columnModel")],i.prototype,"columnModel",void 0),Im([no("eExpand")],i.prototype,"eExpand",void 0),Im([no("eSelect")],i.prototype,"eSelect",void 0),Im([no("eFilterTextField")],i.prototype,"eFilterTextField",void 0),Im([Ft],i.prototype,"postConstruct",null)}(io);var Em=function(){function t(t,i,n,e,r){void 0===e&&(e=!1),this.eventService=new Wt,this.displayName=t,this.dept=n,this.group=e,e?(this.columnGroup=i,this.expanded=r,this.children=[]):this.column=i}return t.prototype.isGroup=function(){return this.group},t.prototype.getDisplayName=function(){return this.displayName},t.prototype.getColumnGroup=function(){return this.columnGroup},t.prototype.getColumn=function(){return this.column},t.prototype.getDept=function(){return this.dept},t.prototype.isExpanded=function(){return!!this.expanded},t.prototype.getChildren=function(){return this.children},t.prototype.isPassesFilter=function(){return this.passesFilter},t.prototype.setExpanded=function(i){i!==this.expanded&&(this.expanded=i,this.eventService.dispatchEvent({type:t.EVENT_EXPANDED_CHANGED}))},t.prototype.setPassesFilter=function(t){this.passesFilter=t},t.prototype.addEventListener=function(t,i){this.eventService.addEventListener(t,i)},t.prototype.removeEventListener=function(t,i){this.eventService.removeEventListener(t,i)},t.EVENT_EXPANDED_CHANGED="expandedChanged",t}(),Tm=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),zm=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Nm=function(t,i){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var e,r,o=n.call(t),s=[];try{for(;(void 0===i||i-- >0)&&!(e=o.next()).done;)s.push(e.value)}catch(t){r={error:t}}finally{try{e&&!e.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},Lm=function(t){function i(i,n,e){var r=t.call(this,'<div class="ag-menu"></div>')||this;return r.column=i,r.mouseEvent=n,r.parentEl=e,r.displayName=null,r}return Tm(i,t),i.prototype.postConstruct=function(){this.initializeProperties(this.column),this.buildMenuItemMap(),this.displayName=this.column instanceof qt?this.columnModel.getDisplayNameForColumn(this.column,"columnToolPanel"):this.columnModel.getDisplayNameForProvidedColumnGroup(null,this.column,"columnToolPanel"),this.isActive()&&(this.mouseEvent.preventDefault(),this.displayContextMenu())},i.prototype.initializeProperties=function(t){this.columns=t instanceof hi?t.getLeafColumns():[t],this.allowGrouping=this.columns.some((function(t){return t.isPrimary()&&t.isAllowRowGroup()})),this.allowValues=this.columns.some((function(t){return t.isPrimary()&&t.isAllowValue()})),this.allowPivoting=this.columnModel.isPivotMode()&&this.columns.some((function(t){return t.isPrimary()&&t.isAllowPivot()}))},i.prototype.buildMenuItemMap=function(){var t=this,i=this.gridOptionsWrapper.getLocaleTextFunc();this.menuItemMap=new Map,this.menuItemMap.set("rowGroup",{allowedFunction:function(t){return t.isPrimary()&&t.isAllowRowGroup()},activeFunction:function(t){return t.isRowGroupActive()},activateLabel:function(){return i("groupBy","Group by")+" "+t.displayName},deactivateLabel:function(){return i("ungroupBy","Un-Group by")+" "+t.displayName},activateFunction:function(){var i=t.columnModel.getRowGroupColumns();t.columnModel.setRowGroupColumns(t.addColumnsToList(i),"toolPanelUi")},deActivateFunction:function(){var i=t.columnModel.getRowGroupColumns();t.columnModel.setRowGroupColumns(t.removeColumnsFromList(i),"toolPanelUi")},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"}),this.menuItemMap.set("value",{allowedFunction:function(t){return t.isPrimary()&&t.isAllowValue()},activeFunction:function(t){return t.isValueActive()},activateLabel:function(){return i("addToValues","Add "+t.displayName+" to values",[t.displayName])},deactivateLabel:function(){return i("removeFromValues","Remove "+t.displayName+" from values",[t.displayName])},activateFunction:function(){var i=t.columnModel.getValueColumns();t.columnModel.setValueColumns(t.addColumnsToList(i),"toolPanelUi")},deActivateFunction:function(){var i=t.columnModel.getValueColumns();t.columnModel.setValueColumns(t.removeColumnsFromList(i),"toolPanelUi")},addIcon:"valuePanel",removeIcon:"valuePanel"}),this.menuItemMap.set("pivot",{allowedFunction:function(i){return t.columnModel.isPivotMode()&&i.isPrimary()&&i.isAllowPivot()},activeFunction:function(t){return t.isPivotActive()},activateLabel:function(){return i("addToLabels","Add "+t.displayName+" to labels",[t.displayName])},deactivateLabel:function(){return i("removeFromLabels","Remove "+t.displayName+" from labels",[t.displayName])},activateFunction:function(){var i=t.columnModel.getPivotColumns();t.columnModel.setPivotColumns(t.addColumnsToList(i),"toolPanelUi")},deActivateFunction:function(){var i=t.columnModel.getPivotColumns();t.columnModel.setPivotColumns(t.removeColumnsFromList(i),"toolPanelUi")},addIcon:"pivotPanel",removeIcon:"pivotPanel"})},i.prototype.addColumnsToList=function(t){return function(){for(var t=[],i=0;i<arguments.length;i++)t=t.concat(Nm(arguments[i]));return t}(t).concat(this.columns.filter((function(i){return-1===t.indexOf(i)})))},i.prototype.removeColumnsFromList=function(t){var i=this;return t.filter((function(t){return-1===i.columns.indexOf(t)}))},i.prototype.displayContextMenu=function(){var t=this,i=this.getGui(),n=this.createBean(new ed),e=this.getMappedMenuItems(),r=this.gridOptionsWrapper.getLocaleTextFunc(),o=function(){};i.appendChild(n.getGui()),n.addMenuItems(e),n.addManagedListener(n,hd.EVENT_MENU_ITEM_SELECTED,(function(){t.parentEl.focus(),o()}));var s=this.popupService.addPopup({modal:!0,eChild:i,closeOnEsc:!0,afterGuiAttached:function(){return t.focusService.focusInto(n.getGui())},ariaLabel:r("ariaLabelContextMenu","Context Menu"),closedCallback:function(i){i instanceof KeyboardEvent&&t.parentEl.focus(),t.destroyBean(n)}});s&&(o=s.hideFunc),this.popupService.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEvent,ePopup:i})},i.prototype.isActive=function(){return this.allowGrouping||this.allowValues||this.allowPivoting},i.prototype.getMappedMenuItems=function(){var t,i,n=[],e=function(t){var i=r.columns.some((function(i){return t.allowedFunction(i)&&!t.activeFunction(i)})),e=r.columns.some((function(i){return t.allowedFunction(i)&&t.activeFunction(i)}));i&&n.push({name:t.activateLabel(r.displayName),icon:Wr.createIconNoSpan(t.addIcon,r.gridOptionsWrapper,null),action:function(){return t.activateFunction()}}),e&&n.push({name:t.deactivateLabel(r.displayName),icon:Wr.createIconNoSpan(t.removeIcon,r.gridOptionsWrapper,null),action:function(){return t.deActivateFunction()}})},r=this;try{for(var o=function(t){var i="function"==typeof Symbol&&Symbol.iterator,n=i&&t[i],e=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.menuItemMap.values()),s=o.next();!s.done;s=o.next())e(s.value)}catch(i){t={error:i}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return n},zm([Dt("columnModel")],i.prototype,"columnModel",void 0),zm([Dt("popupService")],i.prototype,"popupService",void 0),zm([Dt("focusService")],i.prototype,"focusService",void 0),zm([Ft],i.prototype,"postConstruct",null),i}(io),Bm=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Hm=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Wm=function(t){function i(i,n,e,r){var o=t.call(this)||this;return o.modelItem=i,o.allowDragging=n,o.eventType=e,o.focusWrapper=r,o.processingColumnStateChange=!1,o.modelItem=i,o.columnGroup=i.getColumnGroup(),o.columnDept=i.getDept(),o.allowDragging=n,o}return Bm(i,t),i.prototype.init=function(){var t=this;this.setTemplate(i.TEMPLATE),this.eDragHandle=Wr.createIconNoSpan("columnDrag",this.gridOptionsWrapper),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");var n=this.cbSelect.getGui(),e=this.cbSelect.getInputElement();n.insertAdjacentElement("afterend",this.eDragHandle),e.setAttribute("tabindex","-1"),this.displayName=this.columnModel.getDisplayNameForProvidedColumnGroup(null,this.columnGroup,this.eventType),Wr.missing(this.displayName)&&(this.displayName=">>"),this.eLabel.innerHTML=this.displayName?this.displayName:"",this.setupExpandContract(),this.addCssClass("ag-column-select-indent-"+this.columnDept),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.eLabel,"click",this.onLabelClicked.bind(this)),this.addManagedListener(this.cbSelect,Ta.EVENT_CHANGED,this.onCheckboxChanged.bind(this)),this.addManagedListener(this.modelItem,Em.EVENT_EXPANDED_CHANGED,this.onExpandChanged.bind(this)),this.addManagedListener(this.focusWrapper,"keydown",this.handleKeyDown.bind(this)),this.addManagedListener(this.focusWrapper,"contextmenu",this.onContextMenu.bind(this)),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip(),sa.getToolPanelClassesFromColDef(this.columnGroup.getColGroupDef(),this.gridOptionsWrapper,null,this.columnGroup).forEach((function(i){return t.addOrRemoveCssClass(i,!0)}))},i.prototype.getColumns=function(){return this.columnGroup.getLeafColumns()},i.prototype.setupTooltip=function(){var t=this,i=this.columnGroup.getColGroupDef();if(i){var n=function(){t.setTooltip(i.headerTooltip)};n(),this.addManagedListener(this.eventService,xi.EVENT_NEW_COLUMNS_LOADED,n)}},i.prototype.getTooltipParams=function(){var i=t.prototype.getTooltipParams.call(this);return i.location="columnToolPanelColumnGroup",i},i.prototype.handleKeyDown=function(t){switch(t.key){case xr.LEFT:t.preventDefault(),this.modelItem.setExpanded(!1);break;case xr.RIGHT:t.preventDefault(),this.modelItem.setExpanded(!0);break;case xr.SPACE:t.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected())}},i.prototype.onContextMenu=function(t){var i=this,n=this.columnGroup;if(!this.gridOptionsWrapper.isFunctionsReadOnly()){var e=this.createBean(new Lm(n,t,this.focusWrapper));this.addDestroyFunc((function(){e.isAlive()&&i.destroyBean(e)}))}},i.prototype.addVisibilityListenersToAllChildren=function(){var t=this;this.columnGroup.getLeafColumns().forEach((function(i){t.addManagedListener(i,qt.EVENT_VISIBLE_CHANGED,t.onColumnStateChanged.bind(t)),t.addManagedListener(i,qt.EVENT_VALUE_CHANGED,t.onColumnStateChanged.bind(t)),t.addManagedListener(i,qt.EVENT_PIVOT_CHANGED,t.onColumnStateChanged.bind(t)),t.addManagedListener(i,qt.EVENT_ROW_GROUP_CHANGED,t.onColumnStateChanged.bind(t))}))},i.prototype.setupDragging=function(){var t=this;if(this.allowDragging){var i=!this.gridOptionsWrapper.isSuppressDragLeaveHidesColumns(),n={type:Ls.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,defaultIconName:i?Xs.ICON_HIDE:Xs.ICON_NOT_ALLOWED,getDragItem:function(){return t.createDragItem()},onDragStarted:function(){t.eventService.dispatchEvent({type:xi.EVENT_COLUMN_PANEL_ITEM_DRAG_START,column:t.columnGroup})},onDragStopped:function(){t.eventService.dispatchEvent({type:xi.EVENT_COLUMN_PANEL_ITEM_DRAG_END})},onGridEnter:function(){i&&t.onChangeCommon(!0)},onGridExit:function(){i&&t.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(n,!0),this.addDestroyFunc((function(){return t.dragAndDropService.removeDragSource(n)}))}else Wr.setDisplayed(this.eDragHandle,!1)},i.prototype.createDragItem=function(){var t={};return this.columnGroup.getLeafColumns().forEach((function(i){t[i.getId()]=i.isVisible()})),{columns:this.columnGroup.getLeafColumns(),visibleState:t}},i.prototype.setupExpandContract=function(){this.eGroupClosedIcon.appendChild(Wr.createIcon("columnSelectClosed",this.gridOptionsWrapper,null)),this.eGroupOpenedIcon.appendChild(Wr.createIcon("columnSelectOpen",this.gridOptionsWrapper,null)),this.addManagedListener(this.eGroupClosedIcon,"click",this.onExpandOrContractClicked.bind(this)),this.addManagedListener(this.eGroupOpenedIcon,"click",this.onExpandOrContractClicked.bind(this));var t=new ds(this.eColumnGroupIcons,!0);this.addManagedListener(t,ds.EVENT_TAP,this.onExpandOrContractClicked.bind(this)),this.addDestroyFunc(t.destroy.bind(t))},i.prototype.onLabelClicked=function(){var t=!this.cbSelect.getValue();this.onChangeCommon(t)},i.prototype.onCheckboxChanged=function(t){this.onChangeCommon(t.selected)},i.prototype.getVisibleLeafColumns=function(){var t=[],i=function(n){n.forEach((function(n){n.isPassesFilter()&&(n.isGroup()?i(n.getChildren()):t.push(n.getColumn()))}))};return i(this.modelItem.getChildren()),t},i.prototype.onChangeCommon=function(t){this.refreshAriaLabel(),this.processingColumnStateChange||this.modelItemUtils.selectAllChildren(this.modelItem.getChildren(),t,this.eventType)},i.prototype.refreshAriaLabel=function(){var t=this.gridOptionsWrapper.getLocaleTextFunc(),i=t("ariaColumnGroup","Column Group"),n=this.cbSelect.getValue()?t("ariaVisible","visible"):t("ariaHidden","hidden"),e=t("ariaToggleVisibility","Press SPACE to toggle visibility");Wr.setAriaLabel(this.focusWrapper,this.displayName+" "+i),this.cbSelect.setInputAriaLabel(e+" ("+n+")"),Wr.setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)},i.prototype.onColumnStateChanged=function(){var t=this.workOutSelectedValue(),i=this.workOutReadOnlyValue();this.processingColumnStateChange=!0,this.cbSelect.setValue(t),this.cbSelect.setReadOnly(i),this.addOrRemoveCssClass("ag-column-select-column-group-readonly",i),this.processingColumnStateChange=!1},i.prototype.workOutSelectedValue=function(){var t=this,i=this.columnModel.isPivotMode(),n=this.getVisibleLeafColumns(),e=0,r=0;if(n.forEach((function(n){!i&&n.getColDef().lockVisible||(t.isColumnChecked(n,i)?e++:r++)})),!(e>0&&r>0))return e>0},i.prototype.workOutReadOnlyValue=function(){var t=this.columnModel.isPivotMode(),i=0;return this.columnGroup.getLeafColumns().forEach((function(n){t?n.isAnyFunctionAllowed()&&i++:n.getColDef().lockVisible||i++})),0===i},i.prototype.isColumnChecked=function(t,i){if(i){var n=t.isPivotActive(),e=t.isRowGroupActive(),r=t.isValueActive();return n||e||r}return t.isVisible()},i.prototype.onExpandOrContractClicked=function(){var t=this.modelItem.isExpanded();this.modelItem.setExpanded(!t)},i.prototype.onExpandChanged=function(){this.setOpenClosedIcons(),this.refreshAriaExpanded()},i.prototype.setOpenClosedIcons=function(){var t=this.modelItem.isExpanded();Wr.setDisplayed(this.eGroupClosedIcon,!t),Wr.setDisplayed(this.eGroupOpenedIcon,t)},i.prototype.refreshAriaExpanded=function(){Wr.setAriaExpanded(this.focusWrapper,this.modelItem.isExpanded())},i.prototype.getDisplayName=function(){return this.displayName},i.prototype.onSelectAllChanged=function(t){var i=this.cbSelect.getValue();!this.cbSelect.isReadOnly()&&(t&&!i||!t&&i)&&this.cbSelect.toggle()},i.prototype.isSelected=function(){return this.cbSelect.getValue()},i.prototype.isSelectable=function(){return!this.cbSelect.isReadOnly()},i.prototype.setSelected=function(t){this.cbSelect.setValue(t,!0)},i.TEMPLATE='<div class="ag-column-select-column-group" aria-hidden="true">\n <span class="ag-column-group-icons" ref="eColumnGroupIcons" >\n <span class="ag-column-group-closed-icon" ref="eGroupClosedIcon"></span>\n <span class="ag-column-group-opened-icon" ref="eGroupOpenedIcon"></span>\n </span>\n <ag-checkbox ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>\n <span class="ag-column-select-column-label" ref="eLabel"></span>\n </div>',Hm([Dt("columnModel")],i.prototype,"columnModel",void 0),Hm([Dt("dragAndDropService")],i.prototype,"dragAndDropService",void 0),Hm([Dt("modelItemUtils")],i.prototype,"modelItemUtils",void 0),Hm([no("cbSelect")],i.prototype,"cbSelect",void 0),Hm([no("eLabel")],i.prototype,"eLabel",void 0),Hm([no("eGroupOpenedIcon")],i.prototype,"eGroupOpenedIcon",void 0),Hm([no("eGroupClosedIcon")],i.prototype,"eGroupClosedIcon",void 0),Hm([no("eColumnGroupIcons")],i.prototype,"eColumnGroupIcons",void 0),Hm([Ft],i.prototype,"init",null),i}(io),Vm=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Um=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Km="ag-list-item-hovered",$m=function(t){function i(i,n){var e=t.call(this)||this;return e.comp=i,e.virtualList=n,e.currentDragColumn=null,e.lastHoveredColumnItem=null,e}return Vm(i,t),i.prototype.postConstruct=function(){this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PANEL_ITEM_DRAG_START,this.columnPanelItemDragStart.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PANEL_ITEM_DRAG_END,this.columnPanelItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()},i.prototype.columnPanelItemDragStart=function(t){this.currentDragColumn=t.column,this.getCurrentColumns().find((function(t){var i=t.getColDef();return!!i.suppressMovable||!!i.lockPosition}))&&(this.moveBlocked=!0)},i.prototype.columnPanelItemDragEnd=function(){var t=this;window.setTimeout((function(){t.currentDragColumn=null,t.moveBlocked=!1}),10)},i.prototype.createDropTarget=function(){var t=this;this.dragAndDropService.addDropTarget({isInterestedIn:function(t){return t===Ls.ToolPanel},getIconName:function(){return Xs[t.moveBlocked?"ICON_NOT_ALLOWED":"ICON_MOVE"]},getContainer:function(){return t.comp.getGui()},onDragging:function(i){return t.onDragging(i)},onDragStop:function(){return t.onDragStop()},onDragLeave:function(){return t.onDragLeave()}})},i.prototype.createAutoScrollService=function(){var t=this.virtualList.getGui();this.autoScrollService=new lh({scrollContainer:t,scrollAxis:"y",getVerticalPosition:function(){return t.scrollTop},setVerticalPosition:function(i){return t.scrollTop=i}})},i.prototype.onDragging=function(t){if(this.currentDragColumn&&!this.moveBlocked){var i=this.getDragColumnItem(t),n=this.virtualList.getComponentAt(i.rowIndex);if(n){var e=n.getGui().parentElement;this.lastHoveredColumnItem&&this.lastHoveredColumnItem.rowIndex===i.rowIndex&&this.lastHoveredColumnItem.position===i.position||(this.autoScrollService.check(t.event),this.clearHoveredItems(),this.lastHoveredColumnItem=i,Wr.radioCssClass(e,""+Km),Wr.radioCssClass(e,"ag-item-highlight-"+i.position))}}},i.prototype.getDragColumnItem=function(t){var i=this.virtualList.getGui(),n=parseFloat(window.getComputedStyle(i).paddingTop),e=this.virtualList.getRowHeight(),r=this.virtualList.getScrollTop(),o=Math.max(0,(t.y-n+r)/e),s=this.comp.getDisplayedColsList().length-1,u=0|Math.min(s,o);return{rowIndex:u,position:Math.round(o)>o||o>s?"bottom":"top",component:this.virtualList.getComponentAt(u)}},i.prototype.onDragStop=function(){if(!this.moveBlocked){var t=this.getTargetIndex(),i=this.getCurrentColumns();null!=t&&this.columnModel.moveColumns(i,t),this.clearHoveredItems(),this.autoScrollService.ensureCleared()}},i.prototype.getMoveDiff=function(t){var i=this.columnModel.getAllGridColumns(),n=this.getCurrentColumns(),e=n.length;return i.indexOf(n[0])<t?e:0},i.prototype.getCurrentColumns=function(){return this.currentDragColumn instanceof hi?this.currentDragColumn.getLeafColumns():[this.currentDragColumn]},i.prototype.getTargetIndex=function(){if(!this.lastHoveredColumnItem)return null;var t,i=this.lastHoveredColumnItem.component,n="top"===this.lastHoveredColumnItem.position;i instanceof Wm?(t=i.getColumns()[0],n=!0):t=i.getColumn();var e=this.columnModel.getAllGridColumns().indexOf(t),r=n?e:e+1;return r-this.getMoveDiff(r)},i.prototype.onDragLeave=function(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()},i.prototype.clearHoveredItems=function(){this.virtualList.getGui().querySelectorAll("."+Km).forEach((function(t){[Km,"ag-item-highlight-top","ag-item-highlight-bottom"].forEach((function(i){t.classList.remove(i)}))})),this.lastHoveredColumnItem=null},Um([Dt("columnModel")],i.prototype,"columnModel",void 0),Um([Dt("dragAndDropService")],i.prototype,"dragAndDropService",void 0),Um([Ft],i.prototype,"postConstruct",null),i}(Ai),qm=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Ym=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Jm=function(t){function i(i,n,e,r,o){var s=t.call(this)||this;return s.column=i,s.columnDept=n,s.allowDragging=e,s.groupsExist=r,s.focusWrapper=o,s.processingColumnStateChange=!1,s}return qm(i,t),i.prototype.init=function(){var t=this;this.setTemplate(i.TEMPLATE),this.eDragHandle=Wr.createIconNoSpan("columnDrag",this.gridOptionsWrapper),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");var n=this.cbSelect.getGui(),e=this.cbSelect.getInputElement();n.insertAdjacentElement("afterend",this.eDragHandle),e.setAttribute("tabindex","-1"),this.displayName=this.columnModel.getDisplayNameForColumn(this.column,"columnToolPanel");var r=Wr.escapeString(this.displayName);this.eLabel.innerHTML=r;var o=this.columnDept;this.groupsExist&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass("ag-column-select-indent-"+o),this.setupDragging(),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,qt.EVENT_VALUE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,qt.EVENT_PIVOT_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,qt.EVENT_ROW_GROUP_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,qt.EVENT_VISIBLE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.focusWrapper,"keydown",this.handleKeyDown.bind(this)),this.addManagedListener(this.focusWrapper,"contextmenu",this.onContextMenu.bind(this)),this.addManagedListener(this.gridOptionsWrapper,"functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListener(this.cbSelect,Ta.EVENT_CHANGED,this.onCheckboxChanged.bind(this)),this.addManagedListener(this.eLabel,"click",this.onLabelClicked.bind(this)),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip(),sa.getToolPanelClassesFromColDef(this.column.getColDef(),this.gridOptionsWrapper,this.column,null).forEach((function(i){return t.addOrRemoveCssClass(i,!0)}))},i.prototype.getColumn=function(){return this.column},i.prototype.setupTooltip=function(){var t=this,i=function(){var i=t.column.getColDef().headerTooltip;t.setTooltip(i)};i(),this.addManagedListener(this.eventService,xi.EVENT_NEW_COLUMNS_LOADED,i)},i.prototype.getTooltipParams=function(){var i=t.prototype.getTooltipParams.call(this);return i.location="columnToolPanelColumn",i.colDef=this.column.getColDef(),i},i.prototype.onContextMenu=function(t){var i=this,n=this.column;if(!this.gridOptionsWrapper.isFunctionsReadOnly()){var e=this.createBean(new Lm(n,t,this.focusWrapper));this.addDestroyFunc((function(){e.isAlive()&&i.destroyBean(e)}))}},i.prototype.handleKeyDown=function(t){t.key===xr.SPACE&&(t.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))},i.prototype.onLabelClicked=function(){if(!this.gridOptionsWrapper.isFunctionsReadOnly()){var t=!this.cbSelect.getValue();this.onChangeCommon(t)}},i.prototype.onCheckboxChanged=function(t){this.onChangeCommon(t.selected)},i.prototype.onChangeCommon=function(t){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),this.processingColumnStateChange||this.modelItemUtils.setColumn(this.column,t,"toolPanelUi"))},i.prototype.refreshAriaLabel=function(){var t=this.gridOptionsWrapper.getLocaleTextFunc(),i=t("ariaColumn","Column"),n=this.cbSelect.getValue()?t("ariaVisible","visible"):t("ariaHidden","hidden"),e=t("ariaToggleVisibility","Press SPACE to toggle visibility");Wr.setAriaLabel(this.focusWrapper,this.displayName+" "+i),this.cbSelect.setInputAriaLabel(e+" ("+n+")"),Wr.setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)},i.prototype.setupDragging=function(){var t=this;if(this.allowDragging){var i=!this.gridOptionsWrapper.isSuppressDragLeaveHidesColumns(),n={type:Ls.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,defaultIconName:i?Xs.ICON_HIDE:Xs.ICON_NOT_ALLOWED,getDragItem:function(){return t.createDragItem()},onDragStarted:function(){t.eventService.dispatchEvent({type:xi.EVENT_COLUMN_PANEL_ITEM_DRAG_START,column:t.column})},onDragStopped:function(){t.eventService.dispatchEvent({type:xi.EVENT_COLUMN_PANEL_ITEM_DRAG_END})},onGridEnter:function(){i&&t.onChangeCommon(!0)},onGridExit:function(){i&&t.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(n,!0),this.addDestroyFunc((function(){return t.dragAndDropService.removeDragSource(n)}))}else Wr.setDisplayed(this.eDragHandle,!1)},i.prototype.createDragItem=function(){var t={};return t[this.column.getId()]=this.column.isVisible(),{columns:[this.column],visibleState:t}},i.prototype.onColumnStateChanged=function(){this.processingColumnStateChange=!0;var t=this.columnModel.isPivotMode();if(t){var i=this.column.isAnyFunctionActive();this.cbSelect.setValue(i)}else this.cbSelect.setValue(this.column.isVisible());var n=!0,e=!0;if(t){var r=this.gridOptionsWrapper.isFunctionsReadOnly(),o=!this.column.isAnyFunctionAllowed();e=n=!r&&!o}else{var s=this.column.getColDef();n=!s.lockVisible,e=!!s.enableRowGroup||!!s.enableValue||!(s.lockPosition||s.suppressMovable)}this.cbSelect.setReadOnly(!n),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!e),this.addOrRemoveCssClass("ag-column-select-column-readonly",!e&&!n);var u=t&&this.gridOptionsWrapper.isFunctionsPassive();this.cbSelect.setPassive(u),this.processingColumnStateChange=!1},i.prototype.getDisplayName=function(){return this.displayName},i.prototype.onSelectAllChanged=function(t){t!==this.cbSelect.getValue()&&(this.cbSelect.isReadOnly()||this.cbSelect.toggle())},i.prototype.isSelected=function(){return this.cbSelect.getValue()},i.prototype.isSelectable=function(){return!this.cbSelect.isReadOnly()},i.prototype.isExpandable=function(){return!1},i.prototype.setExpanded=function(){console.warn("AG Grid: can not expand a column item that does not represent a column group header")},i.TEMPLATE='<div class="ag-column-select-column" aria-hidden="true">\n <ag-checkbox ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>\n <span class="ag-column-select-column-label" ref="eLabel"></span>\n </div>',Ym([Dt("columnModel")],i.prototype,"columnModel",void 0),Ym([Dt("dragAndDropService")],i.prototype,"dragAndDropService",void 0),Ym([Dt("modelItemUtils")],i.prototype,"modelItemUtils",void 0),Ym([no("eLabel")],i.prototype,"eLabel",void 0),Ym([no("cbSelect")],i.prototype,"cbSelect",void 0),Ym([Ft],i.prototype,"init",null),i}(io),Zm=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Xm=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Qm=function(){function t(t){this.items=t}return t.prototype.getRowCount=function(){return this.items.length},t.prototype.getRow=function(t){return this.items[t]},t}();!function(t){function i(){var n=t.call(this,i.TEMPLATE)||this;return n.destroyColumnItemFuncs=[],n}Zm(i,t),i.prototype.destroyColumnTree=function(){this.allColsTree=[],this.destroyColumnItemFuncs.forEach((function(t){return t()})),this.destroyColumnItemFuncs=[]},i.prototype.init=function(t,i,n){var e=this;this.params=t,this.allowDragging=i,this.eventType=n,this.params.suppressSyncLayoutWithGrid||this.addManagedListener(this.eventService,xi.EVENT_COLUMN_MOVED,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_NEW_COLUMNS_LOADED,this.onColumnsChanged.bind(this)),[xi.EVENT_COLUMN_PIVOT_CHANGED,xi.EVENT_COLUMN_PIVOT_MODE_CHANGED,xi.EVENT_COLUMN_ROW_GROUP_CHANGED,xi.EVENT_COLUMN_VALUE_CHANGED,xi.EVENT_COLUMN_VISIBLE,xi.EVENT_NEW_COLUMNS_LOADED].forEach((function(t){e.addManagedListener(e.eventService,t,e.fireSelectionChangedEvent.bind(e))})),this.expandGroupsByDefault=!this.params.contractColumnSelection;var r=this.gridOptionsWrapper.getLocaleTextFunc()("ariaColumnList","Column List");this.virtualList=this.createManagedBean(new Cd("column-select","tree",r)),this.appendChild(this.virtualList.getGui()),this.virtualList.setComponentCreator((function(t,i){return Wr.setAriaLevel(i,t.getDept()+1),e.createComponentFromItem(t,i)})),this.columnModel.isReady()&&this.onColumnsChanged(),t.suppressColumnMove||this.gridOptionsWrapper.isSuppressMovableColumns()||this.createManagedBean(new $m(this,this.virtualList))},i.prototype.createComponentFromItem=function(t,i){if(t.isGroup()){var n=new Wm(t,this.allowDragging,this.eventType,i);return this.getContext().createBean(n),n}var e=new Jm(t.getColumn(),t.getDept(),this.allowDragging,this.groupsExist,i);return this.getContext().createBean(e),e},i.prototype.onColumnsChanged=function(){var t=this.getExpandedStates(),i=this.columnModel.isPivotMode();this.params.suppressSyncLayoutWithGrid||i?this.buildTreeFromProvidedColumnDefs():this.buildTreeFromWhatGridIsDisplaying(),this.setExpandedStates(t),this.markFilteredColumns(),this.flattenAndFilterModel()},i.prototype.getDisplayedColsList=function(){return this.displayedColsList},i.prototype.getExpandedStates=function(){if(!this.allColsTree)return{};var t={};return this.forEachItem((function(i){if(i.isGroup()){var n=i.getColumnGroup();n&&(t[n.getId()]=i.isExpanded())}})),t},i.prototype.setExpandedStates=function(t){this.allColsTree&&this.forEachItem((function(i){if(i.isGroup()){var n=i.getColumnGroup();if(n){var e=t[n.getId()];null!=e&&i.setExpanded(e)}}}))},i.prototype.buildTreeFromWhatGridIsDisplaying=function(){this.colDefService.syncLayoutWithGrid(this.setColumnLayout.bind(this))},i.prototype.setColumnLayout=function(t){var i=this.colDefService.createColumnTree(t);this.buildListModel(i),this.groupsExist=t.some((function(t){return t&&void 0!==t.children})),this.markFilteredColumns(),this.flattenAndFilterModel()},i.prototype.buildTreeFromProvidedColumnDefs=function(){this.buildListModel(this.columnModel.getPrimaryColumnTree()),this.groupsExist=this.columnModel.isPrimaryColumnGroupsPresent()},i.prototype.buildListModel=function(t){var i=this,n=this.onColumnExpanded.bind(this),e=function(t,i,n){t.forEach((function(t){t instanceof hi?r(t,i,n):o(t,i,n)}))},r=function(t,r,o){var s=t.getColGroupDef();if(!s||!s.suppressColumnsToolPanel)if(t.isPadding())e(t.getChildren(),r,o);else{var u=i.columnModel.getDisplayNameForProvidedColumnGroup(null,t,i.eventType),h=new Em(u,t,r,!0,i.expandGroupsByDefault);o.push(h),function(t){t.addEventListener(Em.EVENT_EXPANDED_CHANGED,n);var e=t.removeEventListener.bind(t,Em.EVENT_EXPANDED_CHANGED,n);i.destroyColumnItemFuncs.push(e)}(h),e(t.getChildren(),r+1,h.getChildren())}},o=function(t,n,e){if(!t.getColDef()||!t.getColDef().suppressColumnsToolPanel){var r=i.columnModel.getDisplayNameForColumn(t,"columnToolPanel");e.push(new Em(r,t,n))}};this.destroyColumnTree(),e(t,0,this.allColsTree)},i.prototype.onColumnExpanded=function(){this.flattenAndFilterModel()},i.prototype.flattenAndFilterModel=function(){var t=this;this.displayedColsList=[];var i=function(n){n.isPassesFilter()&&(t.displayedColsList.push(n),n.isGroup()&&n.isExpanded()&&n.getChildren().forEach(i))};this.allColsTree.forEach(i),this.virtualList.setModel(new Qm(this.displayedColsList));var n=this.virtualList.getLastFocusedRow();this.virtualList.refresh(),null!=n&&this.focusRowIfAlive(n),this.notifyListeners()},i.prototype.focusRowIfAlive=function(t){var i=this;window.setTimeout((function(){i.isAlive()&&i.virtualList.focusRow(t)}),0)},i.prototype.forEachItem=function(t){var i=function(n){n.forEach((function(n){t(n),n.isGroup()&&i(n.getChildren())}))};i(this.allColsTree)},i.prototype.doSetExpandedAll=function(t){this.forEachItem((function(i){i.isGroup()&&i.setExpanded(t)}))},i.prototype.setGroupsExpanded=function(t,i){if(i){var n=[];this.forEachItem((function(e){if(e.isGroup()){var r=e.getColumnGroup().getId();i.indexOf(r)>=0&&(e.setExpanded(t),n.push(r))}}));var e=i.filter((function(t){return!Wr.includes(n,t)}));e.length>0&&console.warn("AG Grid: unable to find group(s) for supplied groupIds:",e)}else this.doSetExpandedAll(t)},i.prototype.getExpandState=function(){var t=0,i=0;return this.forEachItem((function(n){n.isGroup()&&(n.isExpanded()?t++:i++)})),t>0&&i>0?_m.INDETERMINATE:i>0?_m.COLLAPSED:_m.EXPANDED},i.prototype.doSetSelectedAll=function(t){this.modelItemUtils.selectAllChildren(this.allColsTree,t,this.eventType)},i.prototype.getSelectionState=function(){var t=0,i=0,n=this.columnModel.isPivotMode();if(this.forEachItem((function(e){if(!e.isGroup()&&e.isPassesFilter()){var r,o=e.getColumn(),s=o.getColDef();if(n){if(!o.isAllowPivot()&&!o.isAllowRowGroup()&&!o.isAllowValue())return;r=o.isValueActive()||o.isPivotActive()||o.isRowGroupActive()}else{if(s.lockVisible)return;r=o.isVisible()}r?t++:i++}})),!(t>0&&i>0))return!(0===t||i>0)},i.prototype.setFilterText=function(t){this.filterText=Wr.exists(t)?t.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()},i.prototype.markFilteredColumns=function(){var t=this,i=function(i){if(!Wr.exists(t.filterText))return!0;var n=i.getDisplayName();return null==n||-1!==n.toLowerCase().indexOf(t.filterText)},n=function(t,e){var r=!1;if(t.isGroup()){var o=i(t);t.getChildren().forEach((function(t){var i=n(t,o||e);i&&(r=i)}))}var s=!(!e&&!r)||i(t);return t.setPassesFilter(s),s};this.allColsTree.forEach((function(t){return n(t,!1)}))},i.prototype.notifyListeners=function(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()},i.prototype.fireGroupExpandedEvent=function(){var t=this.getExpandState();this.dispatchEvent({type:"groupExpanded",state:t})},i.prototype.fireSelectionChangedEvent=function(){var t=this.getSelectionState();this.dispatchEvent({type:"selectionChanged",state:t})},i.TEMPLATE='<div class="ag-column-select-list" role="presentation"></div>',Xm([Dt("columnModel")],i.prototype,"columnModel",void 0),Xm([Dt("toolPanelColDefService")],i.prototype,"colDefService",void 0),Xm([Dt("modelItemUtils")],i.prototype,"modelItemUtils",void 0),Xm([kt],i.prototype,"destroyColumnTree",null)}(io);var tb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),ib=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},nb=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return tb(i,t),i.prototype.createTemplate=function(){return'<div class="ag-pivot-mode-panel">\n <ag-toggle-button ref="cbPivotMode" class="ag-pivot-mode-select"></ag-toggle-button>\n </div>'},i.prototype.init=function(){this.setTemplate(this.createTemplate()),this.cbPivotMode.setValue(this.columnModel.isPivotMode());var t=this.gridOptionsWrapper.getLocaleTextFunc();this.cbPivotMode.setLabel(t("pivotMode","Pivot Mode")),this.addManagedListener(this.cbPivotMode,Ta.EVENT_CHANGED,this.onBtPivotMode.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_NEW_COLUMNS_LOADED,this.onPivotModeChanged.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this))},i.prototype.onBtPivotMode=function(){var t=!!this.cbPivotMode.getValue();if(t!==this.columnModel.isPivotMode()){this.columnModel.setPivotMode(t,"toolPanelUi");var i=this.gridOptionsWrapper.getApi();i&&i.refreshHeader()}},i.prototype.onPivotModeChanged=function(){var t=this.columnModel.isPivotMode();this.cbPivotMode.setValue(t)},ib([Dt("columnModel")],i.prototype,"columnModel",void 0),ib([no("cbPivotMode")],i.prototype,"cbPivotMode",void 0),ib([Mt],i.prototype,"init",null),i}(io),eb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),rb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(t){function i(){return null!==t&&t.apply(this,arguments)||this}eb(i,t),i.prototype.execute=function(t){var i=Wr.missingOrEmpty(this.columnModel.getValueColumns()),n=!this.gridOptionsWrapper.getGroupRowAggFunc(),e=t.changedPath&&t.changedPath.isActive();if(!(i&&n&&e)){var r=this.createAggDetails(t);this.recursivelyCreateAggData(r)}},i.prototype.createAggDetails=function(t){var i=this.columnModel.isPivotActive(),n=this.columnModel.getValueColumns(),e=i?this.columnModel.getPivotColumns():[];return{changedPath:t.changedPath,valueColumns:n,pivotColumns:e}},i.prototype.recursivelyCreateAggData=function(t){var i=this;this.filteredOnly=!this.gridOptionsWrapper.isSuppressAggFilteredOnly(),t.changedPath.forEachChangedNodeDepthFirst((function(n){if(n.hasChildren()){if(-1===n.level){var e=!i.columnModel.isPivotMode();if(i.gridOptionsWrapper.isSuppressAggAtRootLevel()&&e)return}i.aggregateRowNode(n,t)}else n.aggData&&n.setAggData(null)}),!0)},i.prototype.aggregateRowNode=function(t,i){var n,e=0===i.valueColumns.length,r=0===i.pivotColumns.length,o=this.gridOptionsWrapper.getGroupRowAggFunc();n=o?o({nodes:t.childrenAfterFilter}):e?null:r?this.aggregateRowNodeUsingValuesOnly(t,i):this.aggregateRowNodeUsingValuesAndPivot(t),t.setAggData(n),t.sibling&&t.sibling.setAggData(n)},i.prototype.aggregateRowNodeUsingValuesAndPivot=function(t){var i=this,n={},e=this.pivotStage.getPivotColumnDefs();return e.filter((function(t){return!Wr.exists(t.pivotTotalColumnIds)})).forEach((function(e){var r,o=e.pivotValueColumn,s=e.colId;r=t.leafGroup?i.getValuesFromMappedSet(t.childrenMapped,e.pivotKeys||[],o):i.getValuesPivotNonLeaf(t,s),n[s]=i.aggregateValues(r,o.getAggFunc(),o,t)})),e.filter((function(t){return Wr.exists(t.pivotTotalColumnIds)})).forEach((function(e){var r=[],o=e.pivotValueColumn,s=e.pivotTotalColumnIds,u=e.colId;s&&s.length&&(s.forEach((function(t){r.push(n[t])})),n[u]=i.aggregateValues(r,o.getAggFunc(),o,t))})),n},i.prototype.aggregateRowNodeUsingValuesOnly=function(t,i){var n=this,e={},r=i.changedPath.isActive()?i.changedPath.getValueColumnsForNode(t,i.valueColumns):i.valueColumns,o=i.changedPath.isActive()?i.changedPath.getNotValueColumnsForNode(t,i.valueColumns):null,s=this.getValuesNormal(t,r),u=t.aggData;return r.forEach((function(i,r){e[i.getId()]=n.aggregateValues(s[r],i.getAggFunc(),i,t)})),o&&u&&o.forEach((function(t){e[t.getId()]=u[t.getId()]})),e},i.prototype.getValuesPivotNonLeaf=function(t,i){var n=[];return t.childrenAfterFilter.forEach((function(t){n.push(t.aggData[i])})),n},i.prototype.getValuesFromMappedSet=function(t,i,n){var e=this,r=t;if(i.forEach((function(t){return r=r?r[t]:null})),!r)return[];var o=[];return r.forEach((function(t){var i=e.valueService.getValue(n,t);o.push(i)})),o},i.prototype.getValuesNormal=function(t,i){var n=[];i.forEach((function(){return n.push([])}));for(var e=i.length,r=this.filteredOnly?t.childrenAfterFilter:t.childrenAfterGroup,o=r.length,s=0;s<o;s++)for(var u=r[s],h=0;h<e;h++){var c=this.valueService.getValue(i[h],u);n[h].push(c)}return n},i.prototype.aggregateValues=function(t,i,n,e){var r="string"==typeof i?this.aggFuncService.getAggFunc(i):i;return"function"!=typeof r?(console.error("AG Grid: unrecognised aggregation function "+i),null):r({values:t,column:n,colDef:n?n.getColDef():void 0,rowNode:e,data:e?e.data:void 0,api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsWrapper.getContext()})},rb([Dt("columnModel")],i.prototype,"columnModel",void 0),rb([Dt("valueService")],i.prototype,"valueService",void 0),rb([Dt("pivotStage")],i.prototype,"pivotStage",void 0),rb([Dt("aggFuncService")],i.prototype,"aggFuncService",void 0),rb([Dt("gridApi")],i.prototype,"gridApi",void 0),rb([Dt("columnApi")],i.prototype,"columnApi",void 0),i=rb([Pt("aggregationStage")],i)}(Ai);var ob=function(){function t(){this.allSets={},this.allParents=[]}return t.prototype.removeFromChildrenAfterGroup=function(t,i){this.getSet(t).removeFromChildrenAfterGroup[i.id]=!0},t.prototype.removeFromAllLeafChildren=function(t,i){this.getSet(t).removeFromAllLeafChildren[i.id]=!0},t.prototype.getSet=function(t){return this.allSets[t.id]||(this.allSets[t.id]={removeFromAllLeafChildren:{},removeFromChildrenAfterGroup:{}},this.allParents.push(t)),this.allSets[t.id]},t.prototype.getAllParents=function(){return this.allParents},t.prototype.flush=function(){var t=this;this.allParents.forEach((function(i){var n=t.allSets[i.id];i.childrenAfterGroup=i.childrenAfterGroup.filter((function(t){return!n.removeFromChildrenAfterGroup[t.id]})),i.allLeafChildren=i.allLeafChildren.filter((function(t){return!n.removeFromAllLeafChildren[t.id]})),i.updateHasChildren(),i.sibling&&(i.sibling.childrenAfterGroup=i.childrenAfterGroup,i.sibling.allLeafChildren=i.allLeafChildren)})),this.allSets={},this.allParents.length=0},t}(),sb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),ub=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},hb=function(t,i){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var e,r,o=n.call(t),s=[];try{for(;(void 0===i||i-- >0)&&!(e=o.next()).done;)s.push(e.value)}catch(t){r={error:t}}finally{try{e&&!e.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s};!function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.groupIdSequence=new Vr,i}sb(i,t),i.prototype.postConstruct=function(){this.usingTreeData=this.gridOptionsWrapper.isTreeData(),this.usingTreeData&&(this.getDataPath=this.gridOptionsWrapper.getDataPathFunc())},i.prototype.execute=function(t){var i=this.createGroupingDetails(t);i.transactions?this.handleTransaction(i):this.shotgunResetEverything(i,!0===t.afterColumnsChanged),this.positionLeafsAboveGroups(t.changedPath),this.orderGroups(i.rootNode),this.selectableService.updateSelectableAfterGrouping(i.rootNode)},i.prototype.positionLeafsAboveGroups=function(t){this.usingTreeData||t.forEachChangedNodeDepthFirst((function(t){if(t.childrenAfterGroup){var i=[],n=[];t.childrenAfterGroup.forEach((function(t){var e;(null===(e=t.childrenAfterGroup)||void 0===e?void 0:e.length)?n.push(t):i.push(t)})),t.childrenAfterGroup=function(){for(var t=[],i=0;i<arguments.length;i++)t=t.concat(hb(arguments[i]));return t}(i,n)}}),!1)},i.prototype.createGroupingDetails=function(t){var i=t.rowNode,n=t.changedPath,e=t.rowNodeTransactions,r=t.rowNodeOrder,o=this.usingTreeData?null:this.columnModel.getRowGroupColumns();return{includeParents:!this.gridOptionsWrapper.isSuppressParentsInRowNodes(),expandByDefault:this.gridOptionsWrapper.getGroupDefaultExpanded(),groupedCols:o,rootNode:i,pivotMode:this.columnModel.isPivotMode(),groupedColCount:this.usingTreeData||!o?0:o.length,rowNodeOrder:r,transactions:e,changedPath:n}},i.prototype.handleTransaction=function(t){var i=this;t.transactions.forEach((function(n){var e=i.usingTreeData?void 0:new ob;if(Wr.existsAndNotEmpty(n.remove)&&i.removeNodes(n.remove,t,e),Wr.existsAndNotEmpty(n.update)&&i.moveNodesInWrongPath(n.update,t,e),Wr.existsAndNotEmpty(n.add)&&i.insertNodes(n.add,t,!1),e){var r=e.getAllParents().slice();e.flush(),i.removeEmptyGroups(r,t)}})),t.rowNodeOrder&&this.sortChildren(t)},i.prototype.sortChildren=function(t){t.changedPath.forEachChangedNodeDepthFirst((function(i){i.childrenAfterGroup&&Wr.sortRowNodesByOrder(i.childrenAfterGroup,t.rowNodeOrder)&&t.changedPath.addParentNode(i)}),!1,!0)},i.prototype.orderGroups=function(t){if(!this.usingTreeData){var i=this.gridOptionsWrapper.getInitialGroupOrderComparator();Wr.exists(i)&&function t(n){Wr.exists(n.childrenAfterGroup)&&!n.leafGroup&&(n.childrenAfterGroup.sort((function(t,n){return i({nodeA:t,nodeB:n})})),n.childrenAfterGroup.forEach((function(i){return t(i)})))}(t)}},i.prototype.getExistingPathForNode=function(t,i){for(var n=[],e=this.usingTreeData?t:t.parent;e&&e!==i.rootNode;)n.push({key:e.key,rowGroupColumn:e.rowGroupColumn,field:e.field}),e=e.parent;return n.reverse(),n},i.prototype.moveNodesInWrongPath=function(t,i,n){var e=this;t.forEach((function(t){i.changedPath.isActive()&&i.changedPath.addParentNode(t.parent);var r=function(t){return t.key},o=e.getExistingPathForNode(t,i).map(r),s=e.getGroupInfo(t,i).map(r);Wr.areEqual(o,s)||e.moveNode(t,i,n)}))},i.prototype.moveNode=function(t,i,n){this.removeNodesInStages([t],i,n),this.insertOneNode(t,i,!0),t.setData(t.data),i.changedPath.isActive()&&i.changedPath.addParentNode(t.parent)},i.prototype.removeNodes=function(t,i,n){this.removeNodesInStages(t,i,n),i.changedPath.isActive()&&t.forEach((function(t){return i.changedPath.addParentNode(t.parent)}))},i.prototype.removeNodesInStages=function(t,i,n){if(this.removeNodesFromParents(t,i,n),this.usingTreeData){this.postRemoveCreateFillerNodes(t,i);var e=t.map((function(t){return t.parent}));this.removeEmptyGroups(e,i)}},i.prototype.forEachParentGroup=function(t,i,n){for(var e=i;e&&e!==t.rootNode;)n(e),e=e.parent},i.prototype.removeNodesFromParents=function(t,i,n){var e=this,r=null==n,o=n||new ob;t.forEach((function(t){e.removeFromParent(t,o),e.forEachParentGroup(i,t.parent,(function(i){o.removeFromAllLeafChildren(i,t)}))})),r&&o.flush()},i.prototype.postRemoveCreateFillerNodes=function(t,i){var n=this;t.forEach((function(t){if(t.hasChildren()){var e=n.getExistingPathForNode(t,i),r=n.findParentForNode(t,e,i);r.expanded=t.expanded,r.allLeafChildren=t.allLeafChildren,r.childrenAfterGroup=t.childrenAfterGroup,r.childrenMapped=t.childrenMapped,r.updateHasChildren(),r.childrenAfterGroup.forEach((function(t){return t.parent=r}))}}))},i.prototype.removeEmptyGroups=function(t,i){for(var n=this,e=!0,r=function(){e=!1;var r=new ob;t.forEach((function(t){n.forEachParentGroup(i,t,(function(t){(function(t){var i=n.getChildrenMappedKey(t.key,t.rowGroupColumn),e=t.parent;return!!(e&&e.childrenMapped&&e.childrenMapped[i]&&t.isEmptyRowGroupNode())})(t)&&(e=!0,n.removeFromParent(t,r),t.setSelected(!1))}))})),r.flush()};e;)r()},i.prototype.removeFromParent=function(t,i){t.parent&&(i?i.removeFromChildrenAfterGroup(t.parent,t):(Wr.removeFromArray(t.parent.childrenAfterGroup,t),t.parent.updateHasChildren()));var n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);t.parent&&t.parent.childrenMapped&&(t.parent.childrenMapped[n]=void 0),t.setRowTop(null),t.setRowIndex(null)},i.prototype.addToParent=function(t,i){var n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);i&&(null!=i.childrenMapped&&(i.childrenMapped[n]=t),i.childrenAfterGroup.push(t),i.updateHasChildren())},i.prototype.areGroupColsEqual=function(t,i){return null!=t&&null!=i&&t.pivotMode===i.pivotMode&&Wr.areEqual(t.groupedCols,i.groupedCols)},i.prototype.checkAllGroupDataAfterColsChanged=function(t){var i=this,n=function(t){t&&t.forEach((function(t){!i.usingTreeData&&!t.group||(i.setGroupData(t,{field:t.field,key:t.key,rowGroupColumn:t.rowGroupColumn}),n(t.childrenAfterGroup))}))};n(t.rootNode.childrenAfterGroup)},i.prototype.shotgunResetEverything=function(t,i){if(!this.noChangeInGroupingColumns(t,i)){this.selectionService.removeGroupsFromSelection();var n=t.rootNode;n.leafGroup=!this.usingTreeData&&0===t.groupedCols.length,n.childrenAfterGroup=[],n.childrenMapped={},n.updateHasChildren();var e=n.sibling;e&&(e.childrenAfterGroup=n.childrenAfterGroup,e.childrenMapped=n.childrenMapped),this.insertNodes(n.allLeafChildren,t,!1)}},i.prototype.noChangeInGroupingColumns=function(t,i){var n=!1,e=this.columnModel.getGroupDisplayColumns(),r=e?e.map((function(t){return t.getId()})).join("-"):"";return i&&(n=this.usingTreeData||this.areGroupColsEqual(t,this.oldGroupingDetails),this.oldGroupDisplayColIds!==r&&this.checkAllGroupDataAfterColsChanged(t)),this.oldGroupingDetails=t,this.oldGroupDisplayColIds=r,n},i.prototype.insertNodes=function(t,i,n){var e=this;t.forEach((function(t){e.insertOneNode(t,i,n),i.changedPath.isActive()&&i.changedPath.addParentNode(t.parent)}))},i.prototype.insertOneNode=function(t,i,n){var e=this.getGroupInfo(t,i),r=this.findParentForNode(t,e,i);r.group||console.warn("AG Grid: duplicate group keys for row data, keys should be unique",[r.data,t.data]),this.usingTreeData?this.swapGroupWithUserNode(r,t,n):(t.parent=r,t.level=e.length,r.childrenAfterGroup.push(t),r.updateHasChildren())},i.prototype.findParentForNode=function(t,i,n){var e=this,r=n.rootNode;return i.forEach((function(i,o){(r=e.getOrCreateNextNode(r,i,o,n)).allLeafChildren.push(t)})),r},i.prototype.swapGroupWithUserNode=function(t,i,n){i.parent=t.parent,i.key=t.key,i.field=t.field,i.groupData=t.groupData,i.level=t.level,n||(i.expanded=t.expanded),i.leafGroup=t.leafGroup,i.rowGroupIndex=t.rowGroupIndex,i.allLeafChildren=t.allLeafChildren,i.childrenAfterGroup=t.childrenAfterGroup,i.childrenMapped=t.childrenMapped,i.updateHasChildren(),this.removeFromParent(t),i.childrenAfterGroup.forEach((function(t){return t.parent=i})),this.addToParent(i,t.parent)},i.prototype.getOrCreateNextNode=function(t,i,n,e){var r=this.getChildrenMappedKey(i.key,i.rowGroupColumn),o=t.childrenMapped?t.childrenMapped[r]:void 0;return o||(o=this.createGroup(i,t,n,e),this.addToParent(o,t)),o},i.prototype.createGroup=function(t,i,n,e){var r=new Ws(this.beans);return r.group=!0,r.field=t.field,r.rowGroupColumn=t.rowGroupColumn,this.setGroupData(r,t),r.id=Ws.ID_PREFIX_ROW_GROUP+this.groupIdSequence.next(),r.key=t.key,r.level=n,r.leafGroup=!this.usingTreeData&&n===e.groupedColCount-1,r.allLeafChildren=[],r.setAllChildrenCount(0),r.rowGroupIndex=this.usingTreeData?null:n,r.childrenAfterGroup=[],r.childrenMapped={},r.updateHasChildren(),r.parent=e.includeParents?i:null,this.setExpandedInitialValue(e,r),r},i.prototype.setGroupData=function(t,i){var n=this;t.groupData={},this.columnModel.getGroupDisplayColumns().forEach((function(e){(n.usingTreeData||t.rowGroupColumn&&e.isRowGroupDisplayed(t.rowGroupColumn.getId()))&&(t.groupData[e.getColId()]=i.key)}))},i.prototype.getChildrenMappedKey=function(t,i){return i?i.getId()+"-"+t:t},i.prototype.setExpandedInitialValue=function(t,i){if(t.pivotMode&&i.leafGroup)i.expanded=!1;else{var n=this.gridOptionsWrapper.getIsGroupOpenByDefaultFunc();i.expanded=n?1==n({rowNode:i,field:i.field,key:i.key,level:i.level,rowGroupColumn:i.rowGroupColumn}):-1===t.expandByDefault||i.level<t.expandByDefault}},i.prototype.getGroupInfo=function(t,i){return this.usingTreeData?this.getGroupInfoFromCallback(t):this.getGroupInfoFromGroupColumns(t,i)},i.prototype.getGroupInfoFromCallback=function(t){var i=this.getDataPath?this.getDataPath(t.data):null;return null!=i&&0!==i.length||Wr.doOnce((function(){return console.warn("AG Grid: getDataPath() should not return an empty path for data",t.data)}),"groupStage.getGroupInfoFromCallback"),i?i.map((function(t){return{key:t,field:null,rowGroupColumn:null}})):[]},i.prototype.getGroupInfoFromGroupColumns=function(t,i){var n=this,e=[];return i.groupedCols.forEach((function(r){var o=n.valueService.getKeyForNode(r,t),s=null!=o;if(i.pivotMode&&!s&&(o=" ",s=!0),s){var u={key:o,field:r.getColDef().field,rowGroupColumn:r};e.push(u)}})),e},ub([Dt("columnModel")],i.prototype,"columnModel",void 0),ub([Dt("selectableService")],i.prototype,"selectableService",void 0),ub([Dt("valueService")],i.prototype,"valueService",void 0),ub([Dt("beans")],i.prototype,"beans",void 0),ub([Dt("selectionService")],i.prototype,"selectionService",void 0),ub([Ft],i.prototype,"postConstruct",null),i=ub([Pt("groupStage")],i)}(Ai);var cb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),ab=function(){return ab=Object.assign||function(t){for(var i,n=1,e=arguments.length;n<e;n++)for(var r in i=arguments[n])Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r]);return t},ab.apply(this,arguments)},lb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},fb=function(t,i){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var e,r,o=n.call(t),s=[];try{for(;(void 0===i||i-- >0)&&!(e=o.next()).done;)s.push(e.value)}catch(t){r={error:t}}finally{try{e&&!e.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},db=function(){for(var t=[],i=0;i<arguments.length;i++)t=t.concat(fb(arguments[i]));return t};!function(t){function i(){return null!==t&&t.apply(this,arguments)||this}var n;cb(i,t),n=i,i.prototype.createPivotColumnDefs=function(t){var i=this.columnModel.getPivotColumns(),n=this.columnModel.getValueColumns(),e=this.recursiveBuildGroup(0,t,[],i.length,i),r=function t(i,n){return void 0===n&&(n=[]),i.forEach((function(i){void 0!==i.children?t(i.children,n):n.push(i)})),n}(e);return this.addRowGroupTotals(e,r,n),this.addExpandablePivotGroups(e,r),this.addPivotTotalsToGroups(e,r),{pivotColumnGroupDefs:e,pivotColumnDefs:r.map((function(t){return Wr.cloneObject(t)}))}},i.prototype.recursiveBuildGroup=function(t,i,n,e,r){var o=this,s=this.columnModel.getValueColumns();if(t>=e)return this.buildMeasureCols(n);var u=r[t].getColDef(),h=this.headerNameComparator.bind(this,u.pivotComparator);if(1===s.length&&this.gridOptionsWrapper.isRemovePivotHeaderRowWhenSingleValueColumn()&&t===e-1){var c=[];return Wr.iterateObject(i,(function(t){var i=db(n,[t]);c.push(ab(ab({},o.createColDef(s[0],t,i)),{columnGroupShow:"open"}))})),c.sort(h),c}var a=[];return Wr.iterateObject(i,(function(i,s){var u=db(n,[i]);a.push({children:o.recursiveBuildGroup(t+1,s,u,e,r),headerName:i,pivotKeys:u,columnGroupShow:"open",groupId:o.generateColumnGroupId(u)})})),a.sort(h),a},i.prototype.buildMeasureCols=function(t){var i=this,n=this.columnModel.getValueColumns();return 0===n.length?[this.createColDef(null,"-",t)]:n.map((function(n){var e=i.columnModel.getDisplayNameForColumn(n,"header");return ab(ab({},i.createColDef(n,e,t)),{columnGroupShow:"open"})}))},i.prototype.addExpandablePivotGroups=function(t,i){var n=this;if(!this.gridOptionsWrapper.isSuppressExpandablePivotGroups()&&!this.gridOptionsWrapper.getPivotColumnGroupTotals()){var e=function(t,i,r){var o=t;if(o.children){var s=new Map;o.children.forEach((function(t){e(t,i,s)}));var u=!o.children.some((function(t){return t.children}));n.columnModel.getValueColumns().forEach((function(e){var r=n.columnModel.getDisplayNameForColumn(e,"header"),o=n.createColDef(e,r,t.pivotKeys);o.pivotTotalColumnIds=s.get(e.getColId()),o.columnGroupShow="closed",o.aggFunc=e.getAggFunc(),u||(t.children.push(o),i.push(o))})),n.merge(r,s)}else{var h=t;if(!h.pivotValueColumn)return;var c=h.pivotValueColumn.getColId(),a=r.has(c)?r.get(c):[];a.push(h.colId),r.set(c,a)}};t.forEach((function(t){e(t,i,new Map)}))}},i.prototype.addPivotTotalsToGroups=function(t,i){var n=this;if(this.gridOptionsWrapper.getPivotColumnGroupTotals()){var e="after"===this.gridOptionsWrapper.getPivotColumnGroupTotals(),r=this.columnModel.getValueColumns(),o=r.map((function(t){return t.getAggFunc()}));if(o&&!(o.length<1)&&this.sameAggFuncs(o)){var s=r[0];t.forEach((function(t){n.recursivelyAddPivotTotal(t,i,s,e)}))}}},i.prototype.recursivelyAddPivotTotal=function(t,i,n,e){var r=this,o=t;if(!o.children)return t.colId?[t.colId]:null;var s=[];if(o.children.forEach((function(t){var o=r.recursivelyAddPivotTotal(t,i,n,e);o&&(s=s.concat(o))})),o.children.length>1){var u=this.gridOptionsWrapper.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),h=this.createColDef(n,u,t.pivotKeys,!0);h.pivotTotalColumnIds=s,h.aggFunc=n.getAggFunc();var c=t.children;e?c.push(h):c.unshift(h),i.push(h)}return s},i.prototype.addRowGroupTotals=function(t,i,n){var e=this;if(this.gridOptionsWrapper.getPivotRowTotals())for(var r="after"===this.gridOptionsWrapper.getPivotRowTotals(),o=r?n.slice():n.slice().reverse(),s=function(n){var s=o[n],h=[];t.forEach((function(t){h=h.concat(e.extractColIdsForValueColumn(t,s))}));var c=o.length>1||!u.gridOptionsWrapper.isRemovePivotHeaderRowWhenSingleValueColumn();u.createRowGroupTotal(t,i,s,h,r,c)},u=this,h=0;h<o.length;h++)s(h)},i.prototype.extractColIdsForValueColumn=function(t,i){var n=this;if(!t.children)return t.pivotValueColumn===i&&t.colId?[t.colId]:[];var e=[];return t.children.forEach((function(t){n.extractColIdsForValueColumn(t,i);var r=n.extractColIdsForValueColumn(t,i);e=e.concat(r)})),e},i.prototype.createRowGroupTotal=function(t,i,e,r,o,s){var u;if(0===this.columnModel.getValueColumns().length)u=this.createColDef(null,"-",[]);else{var h=this.columnModel.getDisplayNameForColumn(e,"header");(u=this.createColDef(e,h,[])).pivotTotalColumnIds=r}u.colId=n.PIVOT_ROW_TOTAL_PREFIX+u.colId,i.push(u);var c=s?{children:[u],pivotKeys:[],groupId:n.PIVOT_ROW_TOTAL_PREFIX+"_pivotGroup_"+e.getColId()}:u;o?t.push(c):t.unshift(c)},i.prototype.createColDef=function(t,i,n,e){void 0===e&&(e=!1);var r={};if(t){var o=t.getColDef();Object.assign(r,o),r.hide=!1}return r.headerName=i,r.colId=this.generateColumnId(n||[],t&&!e?t.getColId():""),r.field=r.colId,r.valueGetter=function(t){var i;return null===(i=t.data)||void 0===i?void 0:i[t.colDef.field]},r.pivotKeys=n,r.pivotValueColumn=t,!0===r.filter&&(r.filter="agNumberColumnFilter"),r},i.prototype.sameAggFuncs=function(t){if(1==t.length)return!0;for(var i=1;i<t.length;i++)if(t[i]!==t[0])return!1;return!0},i.prototype.headerNameComparator=function(t,i,n){return t?t(i.headerName,n.headerName):i.headerName&&!n.headerName?1:!i.headerName&&n.headerName?-1:i.headerName&&n.headerName?i.headerName<n.headerName?-1:i.headerName>n.headerName?1:0:0},i.prototype.merge=function(t,i){i.forEach((function(i,n){var e=t.has(n)?t.get(n):[],r=db(e,i);t.set(n,r)}))},i.prototype.generateColumnGroupId=function(t){return"pivotGroup_"+this.columnModel.getPivotColumns().map((function(t){return t.getColId()})).join("-")+"_"+t.join("-")},i.prototype.generateColumnId=function(t,i){return"pivot_"+this.columnModel.getPivotColumns().map((function(t){return t.getColId()})).join("-")+"_"+t.join("-")+"_"+i},i.PIVOT_ROW_TOTAL_PREFIX="PivotRowTotal_",lb([Dt("columnModel")],i.prototype,"columnModel",void 0),i=n=lb([Pt("pivotColDefService")],i)}(Ai);var vb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),pb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.uniqueValues={},i}vb(i,t),i.prototype.execute=function(t){var i=t.rowNode,n=t.changedPath;this.columnModel.isPivotActive()?this.executePivotOn(i,n):this.executePivotOff(n)},i.prototype.executePivotOff=function(t){this.aggregationColumnsHashLastTime=null,this.uniqueValues={},this.columnModel.isSecondaryColumnsPresent()&&(this.columnModel.setSecondaryColumns(null,"rowModelUpdated"),t&&t.setInactive())},i.prototype.executePivotOn=function(t,i){var n=this.bucketUpRowNodes(t),e=this.setUniqueValues(n),r=this.columnModel.getValueColumns(),o=r.map((function(t){return t.getId()+"-"+t.getColDef().headerName})).join("#"),s=r.map((function(t){return t.getAggFunc().toString()})).join("#"),u=this.aggregationColumnsHashLastTime!==o,h=this.aggregationFuncsHashLastTime!==s;this.aggregationColumnsHashLastTime=o,this.aggregationFuncsHashLastTime=s;var c=this.columnModel.getRowGroupColumns().map((function(t){return t.getId()})).join("#"),a=c!==this.groupColumnsHashLastTime;if(this.groupColumnsHashLastTime=c,e||u||a||h){var l=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues),f=l.pivotColumnGroupDefs;this.pivotColumnDefs=l.pivotColumnDefs,this.columnModel.setSecondaryColumns(f,"rowModelUpdated"),i&&i.setInactive()}},i.prototype.setUniqueValues=function(t){return!(JSON.stringify(t)===JSON.stringify(this.uniqueValues)||(this.uniqueValues=t,0))},i.prototype.bucketUpRowNodes=function(t){var i=this,n={},e=function(t){t.leafGroup?i.bucketRowNode(t,n):t.childrenAfterFilter.forEach((function(t){e(t)}))};return e(t),n},i.prototype.bucketRowNode=function(t,i){var n=this.columnModel.getPivotColumns();t.childrenMapped=0===n.length?null:this.bucketChildren(t.childrenAfterFilter,n,0,i),t.sibling&&(t.sibling.childrenMapped=t.childrenMapped)},i.prototype.bucketChildren=function(t,i,n,e){var r=this,o={},s=i[n];if(t.forEach((function(t){var i=r.valueService.getKeyForNode(s,t);Wr.missing(i)&&(i=""),e[i]||(e[i]={}),o[i]||(o[i]=[]),o[i].push(t)})),n===i.length-1)return o;var u={};return Wr.iterateObject(o,(function(t,o){u[t]=r.bucketChildren(o,i,n+1,e[t])})),u},i.prototype.getPivotColumnDefs=function(){return this.pivotColumnDefs},pb([Dt("valueService")],i.prototype,"valueService",void 0),pb([Dt("columnModel")],i.prototype,"columnModel",void 0),pb([Dt("pivotColDefService")],i.prototype,"pivotColDefService",void 0),i=pb([Pt("pivotStage")],i)}(Ai);var gb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),mb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},bb="undefined"==typeof BigInt?null:BigInt;function wb(t){for(var i=t.values,n=null,e=0;e<i.length;e++){var r=i[e];"number"==typeof r?null===n?n=r:n+=bb?"number"==typeof n?r:bb(r):r:"bigint"==typeof r&&(n=null===n?r:("bigint"==typeof n?n:bb(n))+r)}return n}function yb(t){return t.values.length>0?t.values[0]:null}function Cb(t){return t.values.length>0?Wr.last(t.values):null}function Sb(t){for(var i=t.values,n=null,e=0;e<i.length;e++){var r=i[e];"number"!=typeof r&&"bigint"!=typeof r||!(null===n||n>r)||(n=r)}return n}function Rb(t){for(var i=t.values,n=null,e=0;e<i.length;e++){var r=i[e];"number"!=typeof r&&"bigint"!=typeof r||!(null===n||n<r)||(n=r)}return n}function Ob(t){for(var i=t.values,n=0,e=0;e<i.length;e++){var r=i[e];n+=null!=r&&"number"==typeof r.value?r.value:1}return n}function Ab(t){for(var i,n,e,r=t.values,o=0,s=0,u=0;u<r.length;u++){var h=r[u],c=null;"number"==typeof h||"bigint"==typeof h?(c=h,s++):null==h||"number"!=typeof h.value&&"bigint"!=typeof h.value||"number"!=typeof h.count||(c=bb?h.value*("number"==typeof h.value?h.count:bb(h.count)):h.value*h.count,s+=h.count),"number"==typeof c?o+=bb?"number"==typeof o?c:bb(c):c:"bigint"==typeof c&&(o=("bigint"==typeof o?o:bb(o))+c)}var a=null;s>0&&(a=bb?o/("number"==typeof o?s:bb(s)):o/s);var l=null===(n=null===(i=t.rowNode)||void 0===i?void 0:i.aggData)||void 0===n?void 0:n[null===(e=t.column)||void 0===e?void 0:e.getColId()];return l&&l.count===s&&l.value===a?l:{count:s,value:a,toString:function(){return"number"==typeof this.value||"bigint"==typeof this.value?this.value.toString():""},toNumber:function(){return this.value}}}!function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.aggFuncsMap={},i.initialised=!1,i}var n;gb(i,t),n=i,i.prototype.init=function(){this.initialised||(this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gridOptionsWrapper.getAggFuncs()))},i.prototype.initialiseWithDefaultAggregations=function(){this.aggFuncsMap[n.AGG_SUM]=wb,this.aggFuncsMap[n.AGG_FIRST]=yb,this.aggFuncsMap[n.AGG_LAST]=Cb,this.aggFuncsMap[n.AGG_MIN]=Sb,this.aggFuncsMap[n.AGG_MAX]=Rb,this.aggFuncsMap[n.AGG_COUNT]=Ob,this.aggFuncsMap[n.AGG_AVG]=Ab,this.initialised=!0},i.prototype.isAggFuncPossible=function(t,i){var n=this.getFuncNames(t),e=Wr.includes(n,i),r=Wr.exists(this.aggFuncsMap[i]);return e&&r},i.prototype.getDefaultAggFunc=function(t){var i=t.getColDef().defaultAggFunc;if(Wr.exists(i)&&this.isAggFuncPossible(t,i))return i;if(this.isAggFuncPossible(t,n.AGG_SUM))return n.AGG_SUM;var e=this.getFuncNames(t);return Wr.existsAndNotEmpty(e)?e[0]:null},i.prototype.addAggFuncs=function(t){Wr.iterateObject(t,this.addAggFunc.bind(this))},i.prototype.addAggFunc=function(t,i){this.init(),this.aggFuncsMap[t]=i},i.prototype.getAggFunc=function(t){return this.init(),this.aggFuncsMap[t]},i.prototype.getFuncNames=function(t){var i=t.getColDef().allowedAggFuncs;return null==i?Object.keys(this.aggFuncsMap).sort():i},i.prototype.clear=function(){this.aggFuncsMap={}},i.AGG_SUM="sum",i.AGG_FIRST="first",i.AGG_LAST="last",i.AGG_MIN="min",i.AGG_MAX="max",i.AGG_COUNT="count",i.AGG_AVG="avg",mb([Ft],i.prototype,"init",null),i=n=mb([Pt("aggFuncService")],i)}(Ai);var jb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),_b=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Gb=function(t){function i(i,n,e,r,o){var s=t.call(this)||this;return s.column=i,s.dragSourceDropTarget=n,s.ghost=e,s.dropZonePurpose=r,s.horizontal=o,s.popupShowing=!1,s}return jb(i,t),i.prototype.init=function(){var t=this;this.setTemplate(i.TEMPLATE);var n=this.getGui(),e=this.gridOptionsWrapper.isFunctionsReadOnly();this.addElementClasses(n),this.addElementClasses(this.eDragHandle,"drag-handle"),this.addElementClasses(this.eText,"text"),this.addElementClasses(this.eButton,"button"),this.eDragHandle.appendChild(Wr.createIconNoSpan("columnDrag",this.gridOptionsWrapper)),this.eButton.appendChild(Wr.createIconNoSpan("cancel",this.gridOptionsWrapper)),this.setupSort(),this.displayName=this.columnModel.getDisplayNameForColumn(this.column,"columnDrop"),this.setupComponents(),this.ghost||e||this.addDragSource(),this.setupAria(),this.addManagedListener(this.column,qt.EVENT_SORT_CHANGED,(function(){t.setupAria()})),this.setupTooltip()},i.prototype.setupAria=function(){var t=this.gridOptionsWrapper.getLocaleTextFunc(),i=this.getColumnAndAggFuncName(),n=i.name,e=i.aggFuncName,r=t("ariaDropZoneColumnComponentAggFuncSeperator"," of "),o={asc:t("ariaDropZoneColumnComponentSortAscending","ascending"),desc:t("ariaDropZoneColumnComponentSortDescending","descending")},s=this.column.getSort(),u=this.gridOptionsWrapper.isRowGroupPanelSuppressSort(),h=[[e&&""+e+r,n,this.isGroupingZone()&&!u&&s&&", "+o[s]].filter((function(t){return!!t})).join("")],c=this.gridOptionsWrapper.isFunctionsReadOnly();if(this.isAggregationZone()&&!c){var a=t("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");h.push(a)}if(this.isGroupingZone()&&this.column.getColDef().sortable&&!u){var l=t("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");h.push(l)}var f=t("ariaDropZoneColumnComponentDescription","Press DELETE to remove");h.push(f),Wr.setAriaLabel(this.getGui(),h.join(". "))},i.prototype.setupTooltip=function(){var t=this,i=function(){var i=t.column.getColDef().headerTooltip;t.setTooltip(i)};i(),this.addManagedListener(this.eventService,xi.EVENT_NEW_COLUMNS_LOADED,i)},i.prototype.setupSort=function(){var t=this,i=this.column.getColDef().sortable,n=this.isGroupingZone();if(i&&n&&!this.gridOptionsWrapper.isRowGroupPanelSuppressSort()){this.eSortIndicator.setupSort(this.column,!0);var e=function(i){i.preventDefault();var n=t.gridOptionsWrapper.isMultiSortKeyCtrl();t.sortController.progressSort(t.column,n?i.ctrlKey||i.metaKey:i.shiftKey,"uiColumnSorted")};this.addGuiEventListener("click",e),this.addGuiEventListener("keydown",(function(i){i.key===xr.ENTER&&t.isGroupingZone()&&e(i)}))}},i.prototype.addDragSource=function(){var t=this,i={type:Ls.ToolPanel,eElement:this.eDragHandle,defaultIconName:Xs.ICON_HIDE,getDragItem:function(){return t.createDragItem()},dragItemName:this.displayName,dragSourceDropTarget:this.dragSourceDropTarget};this.dragAndDropService.addDragSource(i,!0),this.addDestroyFunc((function(){return t.dragAndDropService.removeDragSource(i)}))},i.prototype.createDragItem=function(){var t={};return t[this.column.getId()]=this.column.isVisible(),{columns:[this.column],visibleState:t}},i.prototype.setupComponents=function(){this.setTextValue(),this.setupRemove(),this.ghost&&this.addCssClass("ag-column-drop-cell-ghost"),this.isAggregationZone()&&!this.gridOptionsWrapper.isFunctionsReadOnly()&&this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))},i.prototype.setupRemove=function(){var t=this;Wr.setDisplayed(this.eButton,!this.gridOptionsWrapper.isFunctionsReadOnly());var n={type:i.EVENT_COLUMN_REMOVE};this.addGuiEventListener("keydown",(function(i){var e=i.key===xr.ENTER;i.key===xr.DELETE&&(i.preventDefault(),t.dispatchEvent(n)),e&&t.isAggregationZone()&&!t.gridOptionsWrapper.isFunctionsReadOnly()&&(i.preventDefault(),t.onShowAggFuncSelection())})),this.addManagedListener(this.eButton,"click",(function(i){t.dispatchEvent(n),i.stopPropagation()}));var e=new ds(this.eButton);this.addManagedListener(e,ds.EVENT_TAP,(function(){t.dispatchEvent(n)})),this.addDestroyFunc(e.destroy.bind(e))},i.prototype.getColumnAndAggFuncName=function(){var t=this.displayName,i="";if(this.isAggregationZone()){var n=this.column.getAggFunc(),e="string"==typeof n?n:"agg";i=this.gridOptionsWrapper.getLocaleTextFunc()(e,e)}return{name:t,aggFuncName:i}},i.prototype.setTextValue=function(){var t=this.getColumnAndAggFuncName(),i=t.name,n=t.aggFuncName,e=this.isAggregationZone()?n+"("+i+")":i,r=Wr.escapeString(e);this.eText.innerHTML=r},i.prototype.onShowAggFuncSelection=function(){var t=this;if(!this.popupShowing){this.popupShowing=!0;var i=new Cd("select-agg-func"),n=this.aggFuncService.getFuncNames(this.column),e=this.getGui(),r=i.getGui();i.setModel({getRow:function(t){return n[t]},getRowCount:function(){return n.length}}),this.getContext().createBean(i);var o=Wr.loadTemplate('<div class="ag-select-agg-func-popup"></div>');o.style.top="0px",o.style.left="0px",o.appendChild(r),o.style.width=e.clientWidth+"px";var s=this.gridOptionsWrapper.getLocaleTextFunc(),u=this.popupService.addPopup({modal:!0,eChild:o,closeOnEsc:!0,closedCallback:function(){t.destroyBean(i),t.popupShowing=!1,e.focus()},ariaLabel:s("ariaLabelAggregationFunction","Aggregation Function")});u&&i.setComponentCreator(this.createAggSelect.bind(this,u.hideFunc)),i.addGuiEventListener("keydown",(function(t){if(t.key===xr.ENTER||t.key===xr.SPACE){var n=i.getLastFocusedRow();if(null==n)return;var e=i.getComponentAt(n);e&&e.selectItem()}})),this.popupService.positionPopupUnderComponent({type:"aggFuncSelect",eventSource:e,ePopup:o,keepWithinBounds:!0,column:this.column}),i.refresh();var h=n.findIndex((function(i){return i===t.column.getAggFunc()}));-1===h&&(h=0),i.focusRow(h)}},i.prototype.createAggSelect=function(t,i){var n=this,e=this.gridOptionsWrapper.getLocaleTextFunc(),r=i.toString(),o=e(r,r);return new xb((function(){t(),n.gridOptionsWrapper.isFunctionsPassive()?n.eventService.dispatchEvent({type:xi.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST,columns:[n.column],aggFunc:i}):n.columnModel.setColumnAggFunc(n.column,i,"toolPanelDragAndDrop")}),o)},i.prototype.addElementClasses=function(t,i){t.classList.add("ag-column-drop-cell"+(i=i?"-"+i:""),"ag-column-drop-"+(this.horizontal?"horizontal":"vertical")+"-cell"+i)},i.prototype.isAggregationZone=function(){return"aggregation"===this.dropZonePurpose},i.prototype.isGroupingZone=function(){return"rowGroup"===this.dropZonePurpose},i.EVENT_COLUMN_REMOVE="columnRemove",i.TEMPLATE='<span role="option" tabindex="0">\n <span ref="eDragHandle" class="ag-drag-handle ag-column-drop-cell-drag-handle" role="presentation"></span>\n <span ref="eText" class="ag-column-drop-cell-text" aria-hidden="true"></span>\n <ag-sort-indicator ref="eSortIndicator"></ag-sort-indicator>\n <span ref="eButton" class="ag-column-drop-cell-button" role="presentation"></span>\n </span>',_b([Dt("dragAndDropService")],i.prototype,"dragAndDropService",void 0),_b([Dt("columnModel")],i.prototype,"columnModel",void 0),_b([Dt("popupService")],i.prototype,"popupService",void 0),_b([It("aggFuncService")],i.prototype,"aggFuncService",void 0),_b([Dt("sortController")],i.prototype,"sortController",void 0),_b([no("eText")],i.prototype,"eText",void 0),_b([no("eDragHandle")],i.prototype,"eDragHandle",void 0),_b([no("eButton")],i.prototype,"eButton",void 0),_b([no("eSortIndicator")],i.prototype,"eSortIndicator",void 0),_b([Ft],i.prototype,"init",null),i}(io),xb=function(t){function i(i,n){var e=t.call(this,'<div class="ag-select-agg-func-item"/>')||this;return e.selectItem=i,e.getGui().innerText=n,e.addGuiEventListener("click",e.selectItem),e}return jb(i,t),i}(io),Mb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Fb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},kb=function(t,i){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var e,r,o=n.call(t),s=[];try{for(;(void 0===i||i-- >0)&&!(e=o.next()).done;)s.push(e.value)}catch(t){r={error:t}}finally{try{e&&!e.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},Pb=function(){for(var t=[],i=0;i<arguments.length;i++)t=t.concat(kb(arguments[i]));return t},Db=function(t){function i(n,e){var r=t.call(this,'<div class="ag-unselectable" role="presentation"></div>')||this;return r.horizontal=n,r.dropZonePurpose=e,r.state=i.STATE_NOT_DRAGGING,r.guiDestroyFunctions=[],r.childColumnComponents=[],r.resizeEnabled=!1,r.addElementClasses(r.getGui()),r.eColumnDropList=document.createElement("div"),r.addElementClasses(r.eColumnDropList,"list"),Wr.setAriaRole(r.eColumnDropList,"listbox"),r}return Mb(i,t),i.prototype.isHorizontal=function(){return this.horizontal},i.prototype.toggleResizable=function(t){this.positionableFeature.setResizable(!!t&&{bottom:!0}),this.resizeEnabled=t},i.prototype.setBeans=function(t){this.beans=t},i.prototype.destroy=function(){this.destroyGui(),t.prototype.destroy.call(this)},i.prototype.destroyGui=function(){this.guiDestroyFunctions.forEach((function(t){return t()})),this.guiDestroyFunctions.length=0,this.childColumnComponents.length=0,Wr.clearElement(this.getGui()),Wr.clearElement(this.eColumnDropList)},i.prototype.init=function(t){this.params=t,this.createManagedBean(new go(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.addManagedListener(this.beans.eventService,xi.EVENT_NEW_COLUMNS_LOADED,this.refreshGui.bind(this)),this.addManagedListener(this.beans.gridOptionsWrapper,"functionsReadOnly",this.refreshGui.bind(this)),this.setupDropTarget(),this.positionableFeature=new El(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature),this.refreshGui(),Wr.setAriaLabel(this.eColumnDropList,this.getAriaLabel())},i.prototype.handleKeyDown=function(t){var i=t.key===xr.DOWN,n=t.key===xr.UP;if(this.horizontal){var e=this.gridOptionsWrapper.isEnableRtl();i=!e&&t.key===xr.RIGHT||e&&t.key===xr.LEFT,n=!e&&t.key===xr.LEFT||e&&t.key===xr.RIGHT}if(i||n){var r=this.focusService.findNextFocusableElement(this.getFocusableElement(),!1,n);r&&(t.preventDefault(),r.focus())}},i.prototype.addElementClasses=function(t,i){t.classList.add("ag-column-drop"+(i=i?"-"+i:""),"ag-column-drop-"+(this.horizontal?"horizontal":"vertical")+i)},i.prototype.setupDropTarget=function(){this.dropTarget={getContainer:this.getGui.bind(this),getIconName:this.getIconName.bind(this),onDragging:this.onDragging.bind(this),onDragEnter:this.onDragEnter.bind(this),onDragLeave:this.onDragLeave.bind(this),onDragStop:this.onDragStop.bind(this),isInterestedIn:this.isInterestedIn.bind(this)},this.beans.dragAndDropService.addDropTarget(this.dropTarget)},i.prototype.isInterestedIn=function(t){return t===Ls.HeaderCell||t===Ls.ToolPanel},i.prototype.checkInsertIndex=function(t){var i=this.getNewInsertIndex(t);if(i<0)return!1;var n=i!==this.insertIndex;return n&&(this.insertIndex=i),n},i.prototype.getNewInsertIndex=function(t){var i=this,n=t.event,e=this.horizontal?n.clientX:n.clientY,r=this.childColumnComponents.map((function(t){return t.getGui().getBoundingClientRect()})),o=r.findIndex((function(t){return i.horizontal?t.right>e&&t.left<e:t.top<e&&t.bottom>e}));if(-1===o){var s=this.beans.gridOptionsWrapper.isEnableRtl();return r.every((function(t){return e>(i.horizontal?t.right:t.bottom)}))?s&&this.horizontal?0:this.childColumnComponents.length:r.every((function(t){return e<(i.horizontal?t.left:t.top)}))?s&&this.horizontal?this.childColumnComponents.length:0:this.insertIndex}return this.insertIndex<=o?o+1:o},i.prototype.checkDragStartedBySelf=function(t){this.state===i.STATE_NOT_DRAGGING&&(this.state=i.STATE_REARRANGE_COLUMNS,this.potentialDndColumns=t.dragSource.getDragItem().columns||[],this.refreshGui(),this.checkInsertIndex(t),this.refreshGui())},i.prototype.onDragging=function(t){this.checkDragStartedBySelf(t),this.checkInsertIndex(t)&&this.refreshGui()},i.prototype.onDragEnter=function(t){var n=t.dragSource.getDragItem().columns||[];this.state=i.STATE_NEW_COLUMNS_IN;var e=n.filter(this.isColumnDroppable.bind(this));if(e.length>0){if(this.isRowGroupPanel()&&!this.gridOptionsWrapper.isSuppressRowGroupHidesColumns()&&!t.fromNudge){var r=t.dragSource.getDragItem();this.setColumnsVisible(r.columns,!1,"uiColumnDragged")}this.potentialDndColumns=e,this.checkInsertIndex(t),this.refreshGui()}},i.prototype.setColumnsVisible=function(t,i,n){if(void 0===n&&(n="api"),t){var e=t.filter((function(t){return!t.getColDef().lockVisible}));this.colModel.setColumnsVisible(e,i,n)}},i.prototype.isPotentialDndColumns=function(){return Wr.existsAndNotEmpty(this.potentialDndColumns)},i.prototype.isRowGroupPanel=function(){return"rowGroup"===this.dropZonePurpose},i.prototype.onDragLeave=function(t){if(this.state===i.STATE_REARRANGE_COLUMNS){var n=t.dragSource.getDragItem().columns||[];this.removeColumns(n)}if(this.isPotentialDndColumns()){if(this.isRowGroupPanel()&&!this.gridOptionsWrapper.isSuppressMakeColumnVisibleAfterUnGroup()&&!t.fromNudge){var e=t.dragSource.getDragItem();this.setColumnsVisible(e.columns,!0,"uiColumnDragged")}this.potentialDndColumns=[],this.refreshGui()}this.state=i.STATE_NOT_DRAGGING},i.prototype.onDragStop=function(){if(this.isPotentialDndColumns()){var t=!1;this.state===i.STATE_NEW_COLUMNS_IN?(this.addColumns(this.potentialDndColumns),t=!0):t=this.rearrangeColumns(this.potentialDndColumns),this.potentialDndColumns=[],this.beans.gridOptionsWrapper.isFunctionsPassive()&&t||this.refreshGui()}this.state=i.STATE_NOT_DRAGGING},i.prototype.removeColumns=function(t){var i=this.getExistingColumns().filter((function(i){return!Wr.includes(t,i)}));this.updateColumns(i)},i.prototype.addColumns=function(t){if(t){var i=this.getExistingColumns().slice(),n=t.filter((function(t){return i.indexOf(t)<0}));Wr.insertArrayIntoArray(i,n,this.insertIndex),this.updateColumns(i)}},i.prototype.rearrangeColumns=function(t){var i=this.getNonGhostColumns().slice();return Wr.insertArrayIntoArray(i,t,this.insertIndex),!Wr.areEqual(i,this.getExistingColumns())&&(this.updateColumns(i),!0)},i.prototype.refreshGui=function(){var t=this.eColumnDropList.scrollTop,i=this.resizeEnabled,n=this.getFocusedItem(),e=this.focusService.findNextFocusableElement();e||(e=this.focusService.findNextFocusableElement(void 0,!1,!0)),this.toggleResizable(!1),this.destroyGui(),this.addIconAndTitleToGui(),this.addEmptyMessageToGui(),this.addColumnsToGui(),this.isHorizontal()||(this.eColumnDropList.scrollTop=t),i&&this.toggleResizable(i),this.restoreFocus(n,e)},i.prototype.getFocusedItem=function(){var t=this.getGui(),i=this.gridOptionsWrapper.getDocument().activeElement;return t.contains(i)?Array.from(t.querySelectorAll(".ag-column-drop-cell")).indexOf(i):-1},i.prototype.restoreFocus=function(t,i){var n=this.getGui(),e=Array.from(n.querySelectorAll(".ag-column-drop-cell"));if(-1!==t){0===e.length&&i.focus();var r=e[Math.min(e.length-1,t)];r&&r.focus()}},i.prototype.getNonGhostColumns=function(){var t=this,i=this.getExistingColumns();return this.isPotentialDndColumns()?i.filter((function(i){return!Wr.includes(t.potentialDndColumns,i)})):i},i.prototype.addColumnsToGui=function(){var t=this,i=this.getNonGhostColumns().map((function(i){return t.createColumnComponent(i,!1)}));if(this.isPotentialDndColumns()){var n=this.potentialDndColumns.map((function(i){return t.createColumnComponent(i,!0)}));this.insertIndex>=i.length?i.push.apply(i,Pb(n)):i.splice.apply(i,Pb([this.insertIndex,0],n))}this.appendChild(this.eColumnDropList),i.forEach((function(i,n){n>0&&t.addArrow(t.eColumnDropList),t.eColumnDropList.appendChild(i.getGui())})),this.addAriaLabelsToComponents()},i.prototype.addAriaLabelsToComponents=function(){var t=this;this.childColumnComponents.forEach((function(i,n){var e=i.getGui();Wr.setAriaPosInSet(e,n+1),Wr.setAriaSetSize(e,t.childColumnComponents.length)}))},i.prototype.createColumnComponent=function(t,i){var n=this,e=new Gb(t,this.dropTarget,i,this.dropZonePurpose,this.horizontal);return e.addEventListener(Gb.EVENT_COLUMN_REMOVE,this.removeColumns.bind(this,[t])),this.beans.context.createBean(e),this.guiDestroyFunctions.push((function(){return n.destroyBean(e)})),i||this.childColumnComponents.push(e),e},i.prototype.addIconAndTitleToGui=function(){var t=this.params.icon,i=document.createElement("div");if(i.setAttribute("aria-hidden","true"),this.addElementClasses(i,"title-bar"),this.addElementClasses(t,"icon"),this.addOrRemoveCssClass("ag-column-drop-empty",this.isExistingColumnsEmpty()),i.appendChild(t),!this.horizontal){var n=document.createElement("span");this.addElementClasses(n,"title"),n.innerHTML=this.params.title,i.appendChild(n)}this.appendChild(i)},i.prototype.isExistingColumnsEmpty=function(){return 0===this.getExistingColumns().length},i.prototype.addEmptyMessageToGui=function(){if(this.isExistingColumnsEmpty()&&!this.isPotentialDndColumns()){var t=document.createElement("span");t.innerHTML=this.params.emptyMessage,this.addElementClasses(t,"empty-message"),this.eColumnDropList.appendChild(t)}},i.prototype.addArrow=function(t){if(this.horizontal){var i=this.beans.gridOptionsWrapper.isEnableRtl(),n=Wr.createIconNoSpan(i?"smallLeft":"smallRight",this.beans.gridOptionsWrapper);this.addElementClasses(n,"cell-separator"),t.appendChild(n)}},i.STATE_NOT_DRAGGING="notDragging",i.STATE_NEW_COLUMNS_IN="newColumnsIn",i.STATE_REARRANGE_COLUMNS="rearrangeColumns",Fb([Dt("columnModel")],i.prototype,"colModel",void 0),Fb([Dt("focusService")],i.prototype,"focusService",void 0),i}(io),Ib=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Eb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Tb=function(t){function i(i){return t.call(this,i,"rowGroup")||this}return Ib(i,t),i.prototype.passBeansUp=function(){t.prototype.setBeans.call(this,{gridOptionsWrapper:this.gridOptionsWrapper,eventService:this.eventService,context:this.getContext(),loggerFactory:this.loggerFactory,dragAndDropService:this.dragAndDropService});var i=this.gridOptionsWrapper.getLocaleTextFunc(),n=i("rowGroupColumnsEmptyMessage","Drag here to set row groups"),e=i("groups","Row Groups");t.prototype.init.call(this,{dragAndDropIcon:Xs.ICON_GROUP,icon:Wr.createIconNoSpan("rowGroupPanel",this.gridOptionsWrapper,null),emptyMessage:n,title:e}),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_ROW_GROUP_CHANGED,this.refreshGui.bind(this))},i.prototype.getAriaLabel=function(){return this.gridOptionsWrapper.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")},i.prototype.getTooltipParams=function(){var i=t.prototype.getTooltipParams.call(this);return i.location="rowGroupColumnsList",i},i.prototype.isColumnDroppable=function(t){return!(this.gridOptionsWrapper.isFunctionsReadOnly()||!t.isPrimary())&&t.isAllowRowGroup()&&!t.isRowGroupActive()},i.prototype.updateColumns=function(t){this.gridOptionsWrapper.isFunctionsPassive()?this.eventService.dispatchEvent({type:xi.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST,columns:t}):this.columnModel.setRowGroupColumns(t,"toolPanelUi")},i.prototype.getIconName=function(){return this.isPotentialDndColumns()?Xs.ICON_GROUP:Xs.ICON_NOT_ALLOWED},i.prototype.getExistingColumns=function(){return this.columnModel.getRowGroupColumns()},Eb([Dt("columnModel")],i.prototype,"columnModel",void 0),Eb([Dt("loggerFactory")],i.prototype,"loggerFactory",void 0),Eb([Dt("dragAndDropService")],i.prototype,"dragAndDropService",void 0),Eb([Ft],i.prototype,"passBeansUp",null),i}(Db),zb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Nb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Lb=function(t){function i(i){return t.call(this,i,"pivot")||this}return zb(i,t),i.prototype.passBeansUp=function(){t.prototype.setBeans.call(this,{gridOptionsWrapper:this.gridOptionsWrapper,eventService:this.eventService,context:this.getContext(),loggerFactory:this.loggerFactory,dragAndDropService:this.dragAndDropService});var i=this.gridOptionsWrapper.getLocaleTextFunc(),n=i("pivotColumnsEmptyMessage","Drag here to set column labels"),e=i("pivots","Column Labels");t.prototype.init.call(this,{dragAndDropIcon:Xs.ICON_GROUP,icon:Wr.createIconNoSpan("pivotPanel",this.gridOptionsWrapper,null),emptyMessage:n,title:e}),this.addManagedListener(this.eventService,xi.EVENT_NEW_COLUMNS_LOADED,this.refresh.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PIVOT_CHANGED,this.refresh.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.checkVisibility.bind(this)),this.refresh()},i.prototype.getAriaLabel=function(){return this.gridOptionsWrapper.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")},i.prototype.getTooltipParams=function(){var i=t.prototype.getTooltipParams.call(this);return i.location="pivotColumnsList",i},i.prototype.refresh=function(){this.checkVisibility(),this.refreshGui()},i.prototype.checkVisibility=function(){var t=this.columnModel.isPivotMode();if(this.isHorizontal())switch(this.gridOptionsWrapper.getPivotPanelShow()){case"always":this.setDisplayed(t);break;case"onlyWhenPivoting":var i=this.columnModel.isPivotActive();this.setDisplayed(t&&i);break;default:this.setDisplayed(!1)}else this.setDisplayed(t)},i.prototype.isColumnDroppable=function(t){return!(this.gridOptionsWrapper.isFunctionsReadOnly()||!t.isPrimary())&&t.isAllowPivot()&&!t.isPivotActive()},i.prototype.updateColumns=function(t){this.gridOptionsWrapper.isFunctionsPassive()?this.eventService.dispatchEvent({type:xi.EVENT_COLUMN_PIVOT_CHANGE_REQUEST,columns:t}):this.columnModel.setPivotColumns(t,"toolPanelUi")},i.prototype.getIconName=function(){return this.isPotentialDndColumns()?Xs.ICON_PIVOT:Xs.ICON_NOT_ALLOWED},i.prototype.getExistingColumns=function(){return this.columnModel.getPivotColumns()},Nb([Dt("columnModel")],i.prototype,"columnModel",void 0),Nb([Dt("loggerFactory")],i.prototype,"loggerFactory",void 0),Nb([Dt("dragAndDropService")],i.prototype,"dragAndDropService",void 0),Nb([Ft],i.prototype,"passBeansUp",null),i}(Db),Bb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Hb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(t){function i(){return t.call(this)||this}Bb(i,t),i.prototype.postConstruct=function(){this.setGui(this.createNorthPanel()),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onRowGroupChanged.bind(this)),this.addManagedListener(this.eventService,xi.EVENT_NEW_COLUMNS_LOADED,this.onRowGroupChanged.bind(this)),this.addManagedListener(this.gridOptionsWrapper,"rowGroupPanelShow",this.onRowGroupChanged.bind(this)),this.onRowGroupChanged()},i.prototype.createNorthPanel=function(){var t=document.createElement("div"),i=this.onDropPanelVisible.bind(this);return t.classList.add("ag-column-drop-wrapper"),Wr.setAriaRole(t,"presentation"),this.rowGroupComp=new Tb(!0),this.createManagedBean(this.rowGroupComp),this.pivotComp=new Lb(!0),this.createManagedBean(this.pivotComp),t.appendChild(this.rowGroupComp.getGui()),t.appendChild(this.pivotComp.getGui()),this.addManagedListener(this.rowGroupComp,io.EVENT_DISPLAYED_CHANGED,i),this.addManagedListener(this.pivotComp,io.EVENT_DISPLAYED_CHANGED,i),this.onDropPanelVisible(),t},i.prototype.onDropPanelVisible=function(){var t=this.rowGroupComp.isDisplayed()&&this.pivotComp.isDisplayed();this.rowGroupComp.addOrRemoveCssClass("ag-column-drop-horizontal-half-width",t),this.pivotComp.addOrRemoveCssClass("ag-column-drop-horizontal-half-width",t)},i.prototype.onRowGroupChanged=function(){if(this.rowGroupComp){var t=this.gridOptionsWrapper.getRowGroupPanelShow();if(t===Vt.ALWAYS)this.rowGroupComp.setDisplayed(!0);else if(t===Vt.ONLY_WHEN_GROUPING){var i=!this.columnModel.isRowGroupEmpty();this.rowGroupComp.setDisplayed(i)}else this.rowGroupComp.setDisplayed(!1)}},Hb([Dt("columnModel")],i.prototype,"columnModel",void 0),Hb([Ft],i.prototype,"postConstruct",null)}(io);var Wb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Vb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(t){function i(){return null!==t&&t.apply(this,arguments)||this}Wb(i,t),i.prototype.execute=function(t){var i=this,n=this.columnModel.isPivotMode(),e=this.filterManager.isAggregateFilterPresent(),r=this.gridOptionsWrapper.getGroupAggFiltering()||(n?function(t){return t.node.leafGroup}:function(t){return!t.node.group}),o=function(t,n){void 0===n&&(n=!1),t.childrenAfterFilter&&(t.childrenAfterAggFilter=t.childrenAfterFilter,n&&t.childrenAfterAggFilter.forEach((function(t){return o(t,n)})),i.setAllChildrenCount(t)),t.sibling&&(t.sibling.childrenAfterAggFilter=t.childrenAfterAggFilter)};t.changedPath.forEachChangedNodeDepthFirst(e?function(t){var n;t.childrenAfterAggFilter=(null===(n=t.childrenAfterFilter)||void 0===n?void 0:n.filter((function(t){var n;return r({node:t})&&i.filterManager.doesRowPassAggregateFilters({rowNode:t})?(o(t,!0),!0):null===(n=t.childrenAfterAggFilter)||void 0===n?void 0:n.length})))||null,i.setAllChildrenCount(t),t.sibling&&(t.sibling.childrenAfterAggFilter=t.childrenAfterAggFilter)}:o,!0)},i.prototype.setAllChildrenCountTreeData=function(t){var i=0;t.childrenAfterAggFilter.forEach((function(t){i++,i+=t.allChildrenCount})),t.setAllChildrenCount(i)},i.prototype.setAllChildrenCountGridGrouping=function(t){var i=0;t.childrenAfterAggFilter.forEach((function(t){t.group?i+=t.allChildrenCount:i++})),t.setAllChildrenCount(i)},i.prototype.setAllChildrenCount=function(t){t.hasChildren()?this.gridOptionsWrapper.isTreeData()?this.setAllChildrenCountTreeData(t):this.setAllChildrenCountGridGrouping(t):t.setAllChildrenCount(null)},Vb([Dt("filterManager")],i.prototype,"filterManager",void 0),Vb([Dt("columnModel")],i.prototype,"columnModel",void 0),i=Vb([Pt("filterAggregatesStage")],i)}(Ai);var Ub=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Kb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},$b=function(t){function i(i){return t.call(this,i,"aggregation")||this}return Ub(i,t),i.prototype.passBeansUp=function(){t.prototype.setBeans.call(this,{gridOptionsWrapper:this.gridOptionsWrapper,eventService:this.eventService,context:this.getContext(),loggerFactory:this.loggerFactory,dragAndDropService:this.dragAndDropService});var i=this.gridOptionsWrapper.getLocaleTextFunc(),n=i("valueColumnsEmptyMessage","Drag here to aggregate"),e=i("values","Values");t.prototype.init.call(this,{dragAndDropIcon:Xs.ICON_AGGREGATE,icon:Wr.createIconNoSpan("valuePanel",this.gridOptionsWrapper,null),emptyMessage:n,title:e}),this.addManagedListener(this.eventService,xi.EVENT_COLUMN_VALUE_CHANGED,this.refreshGui.bind(this))},i.prototype.getAriaLabel=function(){return this.gridOptionsWrapper.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")},i.prototype.getTooltipParams=function(){var i=t.prototype.getTooltipParams.call(this);return i.location="valueColumnsList",i},i.prototype.getIconName=function(){return this.isPotentialDndColumns()?Xs.ICON_AGGREGATE:Xs.ICON_NOT_ALLOWED},i.prototype.isColumnDroppable=function(t){return!(this.gridOptionsWrapper.isFunctionsReadOnly()||!t.isPrimary())&&t.isAllowValue()&&!t.isValueActive()},i.prototype.updateColumns=function(t){this.gridOptionsWrapper.isFunctionsPassive()?this.eventService.dispatchEvent({type:xi.EVENT_COLUMN_VALUE_CHANGE_REQUEST,columns:t}):this.columnModel.setValueColumns(t,"toolPanelUi")},i.prototype.getExistingColumns=function(){return this.columnModel.getValueColumns()},Kb([Dt("columnModel")],i.prototype,"columnModel",void 0),Kb([Dt("loggerFactory")],i.prototype,"loggerFactory",void 0),Kb([Dt("dragAndDropService")],i.prototype,"dragAndDropService",void 0),Kb([Ft],i.prototype,"passBeansUp",null),i}(Db),qb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Yb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Jb=function(t){function i(){return t.call(this,i.TEMPLATE)||this}return qb(i,t),i.prototype.postConstruct=function(){this.initialiseTabGuard({})},i.prototype.init=function(t,i,n){this.allowDragging=t,this.params=i,this.eventType=n,this.primaryColsHeaderPanel.init(this.params),this.params.suppressColumnExpandAll&&this.params.suppressColumnFilter&&this.params.suppressColumnSelectAll&&this.primaryColsHeaderPanel.setDisplayed(!1),this.addManagedListener(this.primaryColsListPanel,"groupExpanded",this.onGroupExpanded.bind(this)),this.addManagedListener(this.primaryColsListPanel,"selectionChanged",this.onSelectionChange.bind(this)),this.primaryColsListPanel.init(this.params,this.allowDragging,this.eventType),this.addManagedListener(this.primaryColsHeaderPanel,"expandAll",this.onExpandAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"collapseAll",this.onCollapseAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"selectAll",this.onSelectAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"unselectAll",this.onUnselectAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"filterChanged",this.onFilterChanged.bind(this)),this.positionableFeature=new El(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature)},i.prototype.toggleResizable=function(t){this.positionableFeature.setResizable(!!t&&{bottom:!0})},i.prototype.onExpandAll=function(){this.primaryColsListPanel.doSetExpandedAll(!0)},i.prototype.onCollapseAll=function(){this.primaryColsListPanel.doSetExpandedAll(!1)},i.prototype.expandGroups=function(t){this.primaryColsListPanel.setGroupsExpanded(!0,t)},i.prototype.collapseGroups=function(t){this.primaryColsListPanel.setGroupsExpanded(!1,t)},i.prototype.setColumnLayout=function(t){this.primaryColsListPanel.setColumnLayout(t)},i.prototype.onFilterChanged=function(t){this.primaryColsListPanel.setFilterText(t.filterText)},i.prototype.syncLayoutWithGrid=function(){this.primaryColsListPanel.onColumnsChanged()},i.prototype.onSelectAll=function(){this.primaryColsListPanel.doSetSelectedAll(!0)},i.prototype.onUnselectAll=function(){this.primaryColsListPanel.doSetSelectedAll(!1)},i.prototype.onGroupExpanded=function(t){this.primaryColsHeaderPanel.setExpandState(t.state)},i.prototype.onSelectionChange=function(t){this.primaryColsHeaderPanel.setSelectionState(t.state)},i.TEMPLATE='<div class="ag-column-select">\n <ag-primary-cols-header ref="primaryColsHeaderPanel"></ag-primary-cols-header>\n <ag-primary-cols-list ref="primaryColsListPanel"></ag-primary-cols-list>\n </div>',Yb([no("primaryColsHeaderPanel")],i.prototype,"primaryColsHeaderPanel",void 0),Yb([no("primaryColsListPanel")],i.prototype,"primaryColsListPanel",void 0),Yb([Ft],i.prototype,"postConstruct",null),i}(Qf),Zb=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Xb=function(){return Xb=Object.assign||function(t){for(var i,n=1,e=arguments.length;n<e;n++)for(var r in i=arguments[n])Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r]);return t},Xb.apply(this,arguments)},Qb=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(t){function i(){var n=t.call(this,i.TEMPLATE)||this;return n.initialised=!1,n.childDestroyFuncs=[],n}Zb(i,t),i.prototype.setVisible=function(i){t.prototype.setDisplayed.call(this,i),i&&!this.initialised&&this.init(this.params)},i.prototype.init=function(t){var i=this;if(this.params=Xb(Xb(Xb({},{suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1,api:this.gridApi,columnApi:this.columnApi}),t),{context:this.gridOptionsWrapper.getContext()}),this.isRowGroupingModuleLoaded()&&!this.params.suppressPivotMode&&(this.pivotModePanel=this.createBean(new nb),this.childDestroyFuncs.push((function(){return i.destroyBean(i.pivotModePanel)})),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new Jb),this.childDestroyFuncs.push((function(){return i.destroyBean(i.primaryColsPanel)})),this.primaryColsPanel.init(!0,this.params,"toolPanelUi"),this.primaryColsPanel.addCssClass("ag-column-panel-column-select"),this.appendChild(this.primaryColsPanel),this.isRowGroupingModuleLoaded()){this.params.suppressRowGroups||(this.rowGroupDropZonePanel=this.createBean(new Tb(!1)),this.childDestroyFuncs.push((function(){return i.destroyBean(i.rowGroupDropZonePanel)})),this.appendChild(this.rowGroupDropZonePanel)),this.params.suppressValues||(this.valuesDropZonePanel=this.createBean(new $b(!1)),this.childDestroyFuncs.push((function(){return i.destroyBean(i.valuesDropZonePanel)})),this.appendChild(this.valuesDropZonePanel)),this.params.suppressPivots||(this.pivotDropZonePanel=this.createBean(new Lb(!1)),this.childDestroyFuncs.push((function(){return i.destroyBean(i.pivotDropZonePanel)})),this.appendChild(this.pivotDropZonePanel)),this.setLastVisible();var n=this.addManagedListener(this.eventService,xi.EVENT_COLUMN_PIVOT_MODE_CHANGED,(function(){i.resetChildrenHeight(),i.setLastVisible()}));this.childDestroyFuncs.push((function(){return n()}))}this.initialised=!0},i.prototype.setPivotModeSectionVisible=function(t){var i=this;this.isRowGroupingModuleLoaded()&&(this.pivotModePanel?this.pivotModePanel.setDisplayed(t):t&&(this.pivotModePanel=this.createBean(new nb),this.getGui().insertBefore(this.pivotModePanel.getGui(),this.getGui().firstChild),this.childDestroyFuncs.push((function(){return i.destroyBean(i.pivotModePanel)}))),this.setLastVisible())},i.prototype.setRowGroupsSectionVisible=function(t){this.isRowGroupingModuleLoaded()&&(this.rowGroupDropZonePanel?this.rowGroupDropZonePanel.setDisplayed(t):t&&(this.rowGroupDropZonePanel=this.createManagedBean(new Tb(!1)),this.appendChild(this.rowGroupDropZonePanel)),this.setLastVisible())},i.prototype.setValuesSectionVisible=function(t){this.isRowGroupingModuleLoaded()&&(this.valuesDropZonePanel?this.valuesDropZonePanel.setDisplayed(t):t&&(this.valuesDropZonePanel=this.createManagedBean(new $b(!1)),this.appendChild(this.valuesDropZonePanel)),this.setLastVisible())},i.prototype.setPivotSectionVisible=function(t){this.isRowGroupingModuleLoaded()&&(this.pivotDropZonePanel?this.pivotDropZonePanel.setDisplayed(t):t&&(this.pivotDropZonePanel=this.createManagedBean(new Lb(!1)),this.appendChild(this.pivotDropZonePanel),this.pivotDropZonePanel.setDisplayed(t)),this.setLastVisible())},i.prototype.setResizers=function(){[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel].forEach((function(t){if(t){var i=t.getGui();t.toggleResizable(!i.classList.contains("ag-last-column-drop")&&!i.classList.contains("ag-hidden"))}}))},i.prototype.setLastVisible=function(){var t=this.getGui();Array.prototype.slice.call(t.querySelectorAll(".ag-column-drop")).forEach((function(t){return t.classList.remove("ag-last-column-drop")}));var i=t.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),n=Wr.last(i);n&&n.classList.add("ag-last-column-drop"),this.setResizers()},i.prototype.resetChildrenHeight=function(){for(var t=this.getGui().children,i=0;i<t.length;i++){var n=t[i];n.style.removeProperty("height"),n.style.removeProperty("flex")}},i.prototype.isRowGroupingModuleLoaded=function(){return Ut.assertRegistered(Nt.RowGroupingModule,"Row Grouping")},i.prototype.expandColumnGroups=function(t){this.primaryColsPanel.expandGroups(t)},i.prototype.collapseColumnGroups=function(t){this.primaryColsPanel.collapseGroups(t)},i.prototype.setColumnLayout=function(t){this.primaryColsPanel.setColumnLayout(t)},i.prototype.syncLayoutWithGrid=function(){this.primaryColsPanel.syncLayoutWithGrid()},i.prototype.destroyChildren=function(){this.childDestroyFuncs.forEach((function(t){return t()})),this.childDestroyFuncs.length=0,Wr.clearElement(this.getGui())},i.prototype.refresh=function(){this.destroyChildren(),this.init(this.params)},i.prototype.destroy=function(){this.destroyChildren(),t.prototype.destroy.call(this)},i.TEMPLATE='<div class="ag-column-panel"></div>',Qb([Dt("gridApi")],i.prototype,"gridApi",void 0),Qb([Dt("columnApi")],i.prototype,"columnApi",void 0)}(io);var tw=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),iw=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},nw=function(t){function i(){var i=t.call(this,'<div class="ag-tool-panel-horizontal-resize"></div>')||this;return i.minWidth=100,i.maxWidth=null,i}return tw(i,t),i.prototype.setElementToResize=function(t){this.elementToResize=t},i.prototype.postConstruct=function(){var t=this.horizontalResizeService.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(t),this.setInverted(this.gridOptionsWrapper.isEnableRtl())},i.prototype.dispatchResizeEvent=function(t,i,n){this.eventService.dispatchEvent({type:xi.EVENT_TOOL_PANEL_SIZE_CHANGED,width:n,started:t,ended:i})},i.prototype.onResizeStart=function(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)},i.prototype.onResizeEnd=function(t){return this.onResizing(t,!0)},i.prototype.onResizing=function(t,i){void 0===i&&(i=!1);var n=Math.max(this.minWidth,Math.floor(this.startingWidth-t*(this.inverted?-1:1)));null!=this.maxWidth&&(n=Math.min(this.maxWidth,n)),this.elementToResize.style.width=n+"px",this.dispatchResizeEvent(!1,i,n)},i.prototype.setInverted=function(t){this.inverted=t},i.prototype.setMaxWidth=function(t){this.maxWidth=t},i.prototype.setMinWidth=function(t){this.minWidth=null!=t?t:100},iw([Dt("horizontalResizeService")],i.prototype,"horizontalResizeService",void 0),iw([Ft],i.prototype,"postConstruct",null),i}(io),ew=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),rw=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},ow=function(t){function i(i){var n=t.call(this)||this;return n.toolPanelDef=i,n}return ew(i,t),i.prototype.getToolPanelId=function(){return this.toolPanelDef.id},i.prototype.postConstruct=function(){var t=this.createTemplate();this.setTemplate(t),this.setLabel(),this.setIcon(),this.addManagedListener(this.eToggleButton,"click",this.onButtonPressed.bind(this))},i.prototype.createTemplate=function(){return'<div class="ag-side-button" role="presentation">\n <button type="button" ref="eToggleButton" tabindex="-1" role="tab" class="ag-side-button-button">\n <div ref="eIconWrapper" class="ag-side-button-icon-wrapper" aria-hidden="true"></div>\n <span ref ="eLabel" class="ag-side-button-label"></span>\n </button>\n </div>'},i.prototype.setLabel=function(){var t=this.gridOptionsWrapper.getLocaleTextFunc(),i=this.toolPanelDef,n=t(i.labelKey,i.labelDefault);this.eLabel.innerText=n},i.prototype.setIcon=function(){this.eIconWrapper.insertAdjacentElement("afterbegin",Wr.createIconNoSpan(this.toolPanelDef.iconKey,this.gridOptionsWrapper))},i.prototype.onButtonPressed=function(){this.dispatchEvent({type:i.EVENT_TOGGLE_BUTTON_CLICKED})},i.prototype.setSelected=function(t){this.addOrRemoveCssClass("ag-selected",t)},i.EVENT_TOGGLE_BUTTON_CLICKED="toggleButtonClicked",rw([no("eToggleButton")],i.prototype,"eToggleButton",void 0),rw([no("eIconWrapper")],i.prototype,"eIconWrapper",void 0),rw([no("eLabel")],i.prototype,"eLabel",void 0),rw([Ft],i.prototype,"postConstruct",null),i}(io),sw=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),uw=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},hw=function(t){function i(){var n=t.call(this,i.TEMPLATE)||this;return n.buttonComps=[],n}return sw(i,t),i.prototype.postConstruct=function(){this.addManagedListener(this.getFocusableElement(),"keydown",this.handleKeyDown.bind(this))},i.prototype.handleKeyDown=function(t){if(t.key===xr.TAB&&t.shiftKey){var i=Wr.last(this.columnModel.getAllDisplayedColumns());this.focusService.focusGridView(i,!0)&&t.preventDefault()}},i.prototype.setToolPanelDefs=function(t){t.forEach(this.addButtonComp.bind(this))},i.prototype.setActiveButton=function(t){this.buttonComps.forEach((function(i){i.setSelected(t===i.getToolPanelId())}))},i.prototype.addButtonComp=function(t){var n=this,e=this.createBean(new ow(t));this.buttonComps.push(e),this.appendChild(e),e.addEventListener(ow.EVENT_TOGGLE_BUTTON_CLICKED,(function(){n.dispatchEvent({type:i.EVENT_SIDE_BAR_BUTTON_CLICKED,toolPanelId:t.id})}))},i.prototype.clearButtons=function(){this.buttonComps=this.destroyBeans(this.buttonComps),Wr.clearElement(this.getGui())},i.EVENT_SIDE_BAR_BUTTON_CLICKED="sideBarButtonClicked",i.TEMPLATE='<div class="ag-side-buttons" role="tablist"></div>',uw([Dt("focusService")],i.prototype,"focusService",void 0),uw([Dt("columnModel")],i.prototype,"columnModel",void 0),uw([Ft],i.prototype,"postConstruct",null),uw([kt],i.prototype,"clearButtons",null),i}(io),cw=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),aw=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},lw=function(t){function i(){return t.call(this,i.TEMPLATE)||this}return cw(i,t),i.prototype.setupResize=function(){var t=this.getGui(),i=this.resizeBar=this.createManagedBean(new nw);i.setElementToResize(t),this.appendChild(i)},i.prototype.getToolPanelId=function(){return this.toolPanelId},i.prototype.setToolPanelDef=function(t){var i=t.id,n=t.minWidth,e=t.maxWidth,r=t.width;this.toolPanelId=i,this.width=r;var o=this.userComponentFactory.getToolPanelCompDetails(t,{}).newAgStackInstance();null!=o?(o.then(this.setToolPanelComponent.bind(this)),null!=n&&this.resizeBar.setMinWidth(n),null!=e&&this.resizeBar.setMaxWidth(e)):console.warn("AG Grid: error processing tool panel component "+i+". You need to specify either 'toolPanel' or 'toolPanelFramework'")},i.prototype.setToolPanelComponent=function(t){var i=this;this.toolPanelCompInstance=t,this.appendChild(t.getGui()),this.addDestroyFunc((function(){i.destroyBean(t)})),this.width&&(this.getGui().style.width=this.width+"px")},i.prototype.getToolPanelInstance=function(){return this.toolPanelCompInstance},i.prototype.setResizerSizerSide=function(t){var i=this.gridOptionsWrapper.isEnableRtl(),n="left"===t;this.resizeBar.setInverted(i?n:!n)},i.prototype.refresh=function(){this.toolPanelCompInstance.refresh()},i.TEMPLATE='<div class="ag-tool-panel-wrapper"/>',aw([Dt("userComponentFactory")],i.prototype,"userComponentFactory",void 0),aw([Ft],i.prototype,"setupResize",null),i}(io),fw=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),dw=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(t){function i(){var n=t.call(this,i.TEMPLATE)||this;return n.toolPanelWrappers=[],n}fw(i,t),i.prototype.postConstruct=function(){var t=this;this.sideBarButtonsComp.addEventListener(hw.EVENT_SIDE_BAR_BUTTON_CLICKED,this.onToolPanelButtonClicked.bind(this)),this.setSideBarDef(),this.gridOptionsWrapper.addEventListener("sideBar",(function(){t.clearDownUi(),t.setSideBarDef()})),this.gridApi.registerSideBarComp(this),this.createManagedBean(new go(this.getFocusableElement(),{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)}))},i.prototype.onTabKeyDown=function(t){if(!t.defaultPrevented){var i=this.focusService,n=this.sideBarButtonsComp,e=this.getGui(),r=n.getGui(),o=this.gridOptionsWrapper.getDocument().activeElement,s=e.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)");if(s)if(r.contains(o))i.focusInto(s,t.shiftKey)&&t.preventDefault();else if(!i.isFocusUnderManagedComponent(s)&&t.shiftKey){var u=i.findFocusableElements(s)[0];if(this.gridOptionsWrapper.getDocument().activeElement===u){var h=r.querySelector(".ag-selected button");h&&(t.preventDefault(),h.focus())}}}},i.prototype.handleKeyDown=function(t){var i=this.gridOptionsWrapper.getDocument();if(this.sideBarButtonsComp.getGui().contains(i.activeElement)){var n=this.sideBarButtonsComp.getGui(),e=Array.prototype.slice.call(n.querySelectorAll(".ag-side-button")),r=i.activeElement,o=e.findIndex((function(t){return t.contains(r)})),s=null;switch(t.key){case xr.LEFT:case xr.UP:s=Math.max(0,o-1);break;case xr.RIGHT:case xr.DOWN:s=Math.min(o+1,e.length-1)}if(null!==s){var u=e[s].querySelector("button");u&&(u.focus(),t.preventDefault())}}},i.prototype.onToolPanelButtonClicked=function(t){var i=t.toolPanelId,n=this.openedItem();this.openToolPanel(n===i?void 0:i)},i.prototype.clearDownUi=function(){this.sideBarButtonsComp.clearButtons(),this.destroyToolPanelWrappers()},i.prototype.setSideBarDef=function(){this.setDisplayed(!1);var t=this.gridOptionsWrapper.getSideBar(),i=!!t&&!!t.toolPanels;if(i){this.setDisplayed(i&&!t.hiddenByDefault);var n=t.toolPanels;this.sideBarButtonsComp.setToolPanelDefs(n),this.setupToolPanels(n),this.setSideBarPosition(t.position),t.hiddenByDefault||this.openToolPanel(t.defaultToolPanel)}},i.prototype.setSideBarPosition=function(t){t||(t="right");var i="left"===t,n=i?"right":"left";return this.addOrRemoveCssClass("ag-side-bar-left",i),this.addOrRemoveCssClass("ag-side-bar-right",!i),this.toolPanelWrappers.forEach((function(t){t.setResizerSizerSide(n)})),this},i.prototype.setupToolPanels=function(t){var i=this;t.forEach((function(t){if(null!=t.id){if("agColumnsToolPanel"===t.toolPanel&&!Ut.assertRegistered(Nt.ColumnToolPanelModule,"Column Tool Panel"))return;if("agFiltersToolPanel"===t.toolPanel&&!Ut.assertRegistered(Nt.FiltersToolPanelModule,"Filters Tool Panel"))return;var n=new lw;i.getContext().createBean(n),n.setToolPanelDef(t),n.setDisplayed(!1),i.getGui().appendChild(n.getGui()),i.toolPanelWrappers.push(n)}else console.warn("AG Grid: please review all your toolPanel components, it seems like at least one of them doesn't have an id")}))},i.prototype.refresh=function(){this.toolPanelWrappers.forEach((function(t){return t.refresh()}))},i.prototype.openToolPanel=function(t){var i=this.openedItem();i!==t&&(this.toolPanelWrappers.forEach((function(i){var n=t===i.getToolPanelId();i.setDisplayed(n)})),i!==this.openedItem()&&(this.sideBarButtonsComp.setActiveButton(t),this.raiseToolPanelVisibleEvent(t)))},i.prototype.getToolPanelInstance=function(t){var i=this.toolPanelWrappers.filter((function(i){return i.getToolPanelId()===t}))[0];if(i)return i.getToolPanelInstance();console.warn("AG Grid: unable to lookup Tool Panel as invalid key supplied: "+t)},i.prototype.raiseToolPanelVisibleEvent=function(t){this.eventService.dispatchEvent({type:xi.EVENT_TOOL_PANEL_VISIBLE_CHANGED,source:t})},i.prototype.close=function(){this.openToolPanel(void 0)},i.prototype.isToolPanelShowing=function(){return!!this.openedItem()},i.prototype.openedItem=function(){var t=null;return this.toolPanelWrappers.forEach((function(i){i.isDisplayed()&&(t=i.getToolPanelId())})),t},i.prototype.destroyToolPanelWrappers=function(){var t=this;this.toolPanelWrappers.forEach((function(i){Wr.removeFromParent(i.getGui()),t.destroyBean(i)})),this.toolPanelWrappers.length=0},i.prototype.destroy=function(){this.destroyToolPanelWrappers(),t.prototype.destroy.call(this)},i.TEMPLATE='<div class="ag-side-bar ag-unselectable">\n <ag-side-bar-buttons ref="sideBarButtons"></ag-side-bar-buttons>\n </div>',dw([Dt("gridApi")],i.prototype,"gridApi",void 0),dw([Dt("focusService")],i.prototype,"focusService",void 0),dw([no("sideBarButtons")],i.prototype,"sideBarButtonsComp",void 0),dw([Ft],i.prototype,"postConstruct",null)}(io);var vw=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),pw=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.isColGroupDef=function(t){return t&&void 0!==t.children},i.getId=function(t){return i.isColGroupDef(t)?t.groupId:t.colId},i}vw(i,t),i.prototype.createColumnTree=function(t){var i=this,n=[],e=function(t,r){if(i.isColGroupDef(t)){var o=t,s=new hi(o,void 0!==o.groupId?o.groupId:o.headerName,!1,r),u=[];return o.children.forEach((function(t){var i=e(t,r+1);i&&u.push(i)})),s.setChildren(u),s}var h=t,c=i.columnModel.getPrimaryColumn(h.colId?h.colId:h.field);return c||n.push(h),c},r=[];return t.forEach((function(t){var i=e(t,0);i&&r.push(i)})),n.length>0&&console.warn("AG Grid: unable to find grid columns for the supplied colDef(s):",n),r},i.prototype.syncLayoutWithGrid=function(t){var i=this.getLeafPathTrees();t(this.mergeLeafPathTrees(i))},i.prototype.getLeafPathTrees=function(){var t=function(i,n){var e;if(i instanceof hi)if(i.isPadding())e=n;else{var r=Object.assign({},i.getColGroupDef());r.groupId=i.getGroupId(),r.children=[n],e=r}else{var o=Object.assign({},i.getColDef());o.colId=i.getColId(),e=o}var s=i.getOriginalParent();return s?t(s,e):e};return this.columnModel.getAllGridColumns().filter((function(t){var i=t.getColDef();return t.isPrimary()&&!i.showRowGroup})).map((function(i){return t(i,i.getColDef())}))},i.prototype.mergeLeafPathTrees=function(t){for(var i,n,e=this,r=function(t,i){if(!e.isColGroupDef(i))return t;var n=t,o=i;return o.children&&o.groupId&&e.addChildrenToGroup(n,o.groupId,o.children[0])||o.children.forEach((function(t){return r(n,t)})),n},o=[],s=1;s<=t.length;s++){var u=t[s-1],h=t[s];n=h,e.isColGroupDef(i=u)&&e.isColGroupDef(n)&&e.getId(i)===e.getId(n)?t[s]=r(u,h):o.push(u)}return o},i.prototype.addChildrenToGroup=function(t,i,n){var e=this;if(!this.isColGroupDef(t))return!0;var r=t,o=n;if(function(t,i){var n=t.children.map(e.getId),r=Wr.includes(n,e.getId(i)),o=Wr.last(t.children),s=o&&e.getId(o)!==e.getId(i);return r&&s}(r,o))return r.children.push(o),!0;if(r.groupId===i){var s=r.children.map(this.getId);if(!Wr.includes(s,this.getId(o)))return r.children.push(o),!0}return r.children.forEach((function(t){return e.addChildrenToGroup(t,i,n)})),!1},pw([Dt("columnModel")],i.prototype,"columnModel",void 0),i=pw([Pt("toolPanelColDefService")],i)}(Ai);var gw=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s};!function(){function t(){}t.prototype.selectAllChildren=function(t,i,n){var e=this.extractAllLeafColumns(t);this.setAllColumns(e,i,n)},t.prototype.setColumn=function(t,i,n){this.setAllColumns([t],i,n)},t.prototype.setAllColumns=function(t,i,n){this.columnModel.isPivotMode()?this.setAllPivot(t,i,n):this.setAllVisible(t,i,n)},t.prototype.extractAllLeafColumns=function(t){var i=[],n=function(t){t.forEach((function(t){t.isPassesFilter()&&(t.isGroup()?n(t.getChildren()):i.push(t.getColumn()))}))};return n(t),i},t.prototype.setAllVisible=function(t,i,n){var e=[];t.forEach((function(t){t.getColDef().lockVisible||t.isVisible()!=i&&e.push({colId:t.getId(),hide:!i})})),e.length>0&&this.columnModel.applyColumnState({state:e},n)},t.prototype.setAllPivot=function(t,i,n){this.gridOptionsWrapper.isFunctionsPassive()?this.setAllPivotPassive(t,i):this.setAllPivotActive(t,i,n)},t.prototype.setAllPivotPassive=function(t,i){var n=this.columnModel.getPivotColumns().slice(),e=this.columnModel.getValueColumns().slice(),r=this.columnModel.getRowGroupColumns().slice(),o=!1,s=!1,u=!1;t.forEach(i?function(t){t.isAnyFunctionActive()||(t.isAllowValue()?(e.push(t),s=!0):t.isAllowRowGroup()?(r.push(t),o=!0):t.isAllowPivot()&&(n.push(t),u=!0))}:function(t){t.isAnyFunctionActive()&&(n.indexOf(t)>=0&&(Wr.removeFromArray(n,t),o=!0),e.indexOf(t)>=0&&(Wr.removeFromArray(e,t),s=!0),r.indexOf(t)>=0&&(Wr.removeFromArray(r,t),u=!0))}),o&&this.eventService.dispatchEvent({type:xi.EVENT_COLUMN_PIVOT_CHANGE_REQUEST,columns:n}),u&&this.eventService.dispatchEvent({type:xi.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST,columns:r}),s&&this.eventService.dispatchEvent({type:xi.EVENT_COLUMN_VALUE_CHANGE_REQUEST,columns:r})},t.prototype.setAllPivotActive=function(t,i,n){var e=this,r=[];t.forEach(i?function(t){if(!t.isAnyFunctionActive())if(t.isAllowValue()){var i="string"==typeof t.getAggFunc()?t.getAggFunc():e.aggFuncService.getDefaultAggFunc(t);r.push({colId:t.getId(),aggFunc:i})}else t.isAllowRowGroup()?r.push({colId:t.getId(),rowGroup:!0}):t.isAllowPivot()&&r.push({colId:t.getId(),pivot:!0})}:function(t){(t.isPivotActive()||t.isRowGroupActive()||t.isValueActive())&&r.push({colId:t.getId(),pivot:!1,rowGroup:!1,aggFunc:null})}),r.length>0&&this.columnModel.applyColumnState({state:r},n)},gw([Dt("aggFuncService")],t.prototype,"aggFuncService",void 0),gw([Dt("columnModel")],t.prototype,"columnModel",void 0),gw([Dt("gridOptionsWrapper")],t.prototype,"gridOptionsWrapper",void 0),gw([Dt("eventService")],t.prototype,"eventService",void 0),t=gw([Pt("modelItemUtils")],t)}();var mw=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),bw=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},ww=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return mw(i,t),i.prototype.hideActiveMenu=function(){this.destroyBean(this.activeMenu)},i.prototype.showMenuAfterMouseEvent=function(t,i,n){var e=this;this.showMenu(t,(function(r){var o=r.getGui();e.popupService.positionPopupUnderMouseEvent({type:"columnMenu",column:t,mouseEvent:i,ePopup:o}),n&&r.showTab(n)}),"columnMenu",n,void 0,i.target)},i.prototype.showMenuAfterButtonClick=function(t,i,n,e,r){var o=this,s=-1,u="left";this.gridOptionsWrapper.isEnableRtl()&&(s=1,u="right"),this.showMenu(t,(function(r){var h=r.getGui();o.popupService.positionPopupUnderComponent({type:n,column:t,eventSource:i,ePopup:h,alignSide:u,nudgeX:9*s,nudgeY:-23,keepWithinBounds:!0}),e&&r.showTab(e)}),n,e,r,i)},i.prototype.showMenu=function(t,i,n,e,r,o){var s=this,u=this.createBean(new yw(t,this.lastSelectedTab,r)),h=u.getGui(),c=this.focusService.getFocusedHeader(),a=this.columnModel.getAllDisplayedColumns().indexOf(t),l=o||this.ctrlsService.getGridBodyCtrl().getGui(),f=[];f.push((function(i){if(s.destroyBean(u),t.setMenuVisible(!1,"contextMenu"),i instanceof KeyboardEvent&&o)if(Wr.isVisible(o)){var n=s.focusService.findTabbableParent(o);n&&(t&&s.headerNavigationService.scrollToColumn(t),n.focus())}else if(c&&-1!==a){var e=s.columnModel.getAllDisplayedColumns(),r=e[a]||Wr.last(e);r&&s.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:c.headerRowIndex,column:r}})}}));var d=this.gridOptionsWrapper.getLocaleTextFunc(),v=this.popupService.addPopup({modal:!0,eChild:h,closeOnEsc:!0,closedCallback:function(t){f.forEach((function(i){return i(t)}))},afterGuiAttached:function(t){return u.afterGuiAttached(Object.assign({},{container:n},t))},positionCallback:function(){return i(u)},anchorToElement:l,ariaLabel:d("ariaLabelColumnMenu","Column Menu")});if(v){var p=v.stopAnchoringPromise;p&&p.then((function(i){t.addEventListener(qt.EVENT_LEFT_CHANGED,i),t.addEventListener(qt.EVENT_VISIBLE_CHANGED,i),f.push((function(){t.removeEventListener(qt.EVENT_LEFT_CHANGED,i),t.removeEventListener(qt.EVENT_VISIBLE_CHANGED,i)}))}))}e||(u.showTabBasedOnPreviousSelection(),i(u)),u.addEventListener(yw.EVENT_TAB_SELECTED,(function(t){s.lastSelectedTab=t.key})),t.setMenuVisible(!0,"contextMenu"),this.activeMenu=u,u.addEventListener(Ai.EVENT_DESTROYED,(function(){s.activeMenu===u&&(s.activeMenu=null)}))},i.prototype.isMenuEnabled=function(t){return t.getMenuTabs(yw.TABS_DEFAULT).length>0},bw([Dt("popupService")],i.prototype,"popupService",void 0),bw([Dt("focusService")],i.prototype,"focusService",void 0),bw([Dt("headerNavigationService")],i.prototype,"headerNavigationService",void 0),bw([Dt("ctrlsService")],i.prototype,"ctrlsService",void 0),bw([Dt("columnModel")],i.prototype,"columnModel",void 0),bw([Pt("menuFactory")],i)}(Ai),yw=function(t){function i(n,e,r){var o=t.call(this)||this;return o.tabFactories={},o.includeChecks={},o.column=n,o.initialSelection=e,o.tabFactories[i.TAB_GENERAL]=o.createMainPanel.bind(o),o.tabFactories[i.TAB_FILTER]=o.createFilterPanel.bind(o),o.tabFactories[i.TAB_COLUMNS]=o.createColumnsPanel.bind(o),o.includeChecks[i.TAB_GENERAL]=function(){return!0},o.includeChecks[i.TAB_FILTER]=function(){return n.isFilterAllowed()},o.includeChecks[i.TAB_COLUMNS]=function(){return!0},o.restrictTo=r,o}return mw(i,t),i.prototype.init=function(){var t=this,i=this.getTabsToCreate().map((function(i){return t.createTab(i)}));this.tabbedLayout=new jl({items:i,cssClass:"ag-menu",onActiveItemClicked:this.onHidePopup.bind(this),onItemClicked:this.onTabItemClicked.bind(this)}),this.createBean(this.tabbedLayout),this.mainMenuList&&this.mainMenuList.setParentComponent(this.tabbedLayout)},i.prototype.getTabsToCreate=function(){var t=this;return this.restrictTo?this.restrictTo:this.column.getMenuTabs(i.TABS_DEFAULT).filter((function(i){return t.isValidMenuTabItem(i)})).filter((function(i){return t.isNotSuppressed(i)})).filter((function(i){return t.isModuleLoaded(i)}))},i.prototype.isModuleLoaded=function(t){return t!==i.TAB_COLUMNS||Ut.isRegistered(Nt.ColumnToolPanelModule)},i.prototype.isValidMenuTabItem=function(t){var n=!0,e=i.TABS_DEFAULT;return null!=this.restrictTo&&(n=this.restrictTo.indexOf(t)>-1,e=this.restrictTo),(n=n&&i.TABS_DEFAULT.indexOf(t)>-1)||console.warn("AG Grid: Trying to render an invalid menu item '"+t+"'. Check that your 'menuTabs' contains one of ["+e+"]"),n},i.prototype.isNotSuppressed=function(t){return this.includeChecks[t]()},i.prototype.createTab=function(t){return this.tabFactories[t]()},i.prototype.showTabBasedOnPreviousSelection=function(){this.showTab(this.initialSelection)},i.prototype.showTab=function(t){this.tabItemColumns&&t===i.TAB_COLUMNS?this.tabbedLayout.showItem(this.tabItemColumns):this.tabItemFilter&&t===i.TAB_FILTER?this.tabbedLayout.showItem(this.tabItemFilter):this.tabItemGeneral&&t===i.TAB_GENERAL?this.tabbedLayout.showItem(this.tabItemGeneral):this.tabbedLayout.showFirstItem()},i.prototype.onTabItemClicked=function(t){var n=null;switch(t.item){case this.tabItemColumns:n=i.TAB_COLUMNS;break;case this.tabItemFilter:n=i.TAB_FILTER;break;case this.tabItemGeneral:n=i.TAB_GENERAL}n&&this.activateTab(n)},i.prototype.activateTab=function(t){this.dispatchEvent({type:i.EVENT_TAB_SELECTED,key:t})},i.prototype.getMenuItems=function(){var t,n=this.getDefaultMenuOptions(),e=this.gridOptionsWrapper.getMainMenuItemsFunc();return t=e?e({column:this.column,defaultItems:n}):n,Wr.removeRepeatsFromArray(t,i.MENU_ITEM_SEPARATOR),t},i.prototype.getDefaultMenuOptions=function(){var t=[],n=!this.column.getColDef().lockPinned,e=this.columnModel.getRowGroupColumns().length,r=e>0,o=this.columnModel.getRowGroupColumns().indexOf(this.column)>=0,s=this.column.isAllowValue(),u=this.column.isAllowRowGroup(),h=this.column.isPrimary(),c=this.columnModel.isPivotMode(),a=this.rowModel.getType()===Vt.ROW_MODEL_TYPE_CLIENT_SIDE,l=this.gridOptionsWrapper.isTreeData(),f=h&&r&&s||!h;return n&&t.push("pinSubMenu"),f&&t.push("valueAggSubMenu"),(n||f)&&t.push(i.MENU_ITEM_SEPARATOR),t.push("autoSizeThis"),t.push("autoSizeAll"),t.push(i.MENU_ITEM_SEPARATOR),u&&this.column.isPrimary()&&t.push(o?"rowUnGroup":"rowGroup"),t.push(i.MENU_ITEM_SEPARATOR),t.push("resetColumns"),a&&(l||e>(c?1:0))&&(t.push("expandAll"),t.push("contractAll")),t},i.prototype.createMainPanel=function(){this.mainMenuList=this.createManagedBean(new ed);var t=this.getMenuItems(),n=this.menuItemMapper.mapWithStockItems(t,this.column);return this.mainMenuList.addMenuItems(n),this.mainMenuList.addEventListener(hd.EVENT_MENU_ITEM_SELECTED,this.onHidePopup.bind(this)),this.tabItemGeneral={title:Wr.createIconNoSpan("menu",this.gridOptionsWrapper,this.column),titleLabel:i.TAB_GENERAL.replace("MenuTab",""),bodyPromise:Kr.resolve(this.mainMenuList.getGui()),name:i.TAB_GENERAL},this.tabItemGeneral},i.prototype.onHidePopup=function(t){var i;t&&t.event&&t.event instanceof KeyboardEvent&&(i=t.event),this.hidePopupFunc(i&&{keyboardEvent:i});var n=this.focusService.getFocusedCell(),e=this.gridOptionsWrapper.getDocument();e.activeElement===e.body&&n&&this.focusService.setFocusedCell({rowIndex:n.rowIndex,column:n.column,rowPinned:n.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})},i.prototype.createFilterPanel=function(){var t,n=this.filterManager.getOrCreateFilterWrapper(this.column,"COLUMN_MENU");if(!n)throw new Error("AG Grid - Unable to instantiate filter");return this.tabItemFilter={title:Wr.createIconNoSpan("filter",this.gridOptionsWrapper,this.column),titleLabel:i.TAB_FILTER.replace("MenuTab",""),bodyPromise:null===(t=n)||void 0===t?void 0:t.guiPromise,afterAttachedCallback:function(t){var i;(null===(i=n)||void 0===i?void 0:i.filterPromise)&&n.filterPromise.then((function(i){i&&i.afterGuiAttached&&i.afterGuiAttached(t)}))},name:i.TAB_FILTER},this.tabItemFilter},i.prototype.createColumnsPanel=function(){var t=document.createElement("div");t.classList.add("ag-menu-column-select-wrapper"),this.columnSelectPanel=this.createManagedBean(new Jb);var n=this.column.getColDef().columnsMenuParams;n||(n={}),this.columnSelectPanel.init(!1,{suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!n.contractColumnSelection,suppressColumnExpandAll:!!n.suppressColumnExpandAll,suppressColumnFilter:!!n.suppressColumnFilter,suppressColumnSelectAll:!!n.suppressColumnSelectAll,suppressSyncLayoutWithGrid:!!n.suppressSyncLayoutWithGrid,api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsWrapper.getContext()},"columnMenu");var e=this.columnSelectPanel.getGui();return e.classList.add("ag-menu-column-select"),t.appendChild(e),this.tabItemColumns={title:Wr.createIconNoSpan("columns",this.gridOptionsWrapper,this.column),titleLabel:i.TAB_COLUMNS.replace("MenuTab",""),bodyPromise:Kr.resolve(t),name:i.TAB_COLUMNS},this.tabItemColumns},i.prototype.afterGuiAttached=function(t){var i=t.hidePopup;this.tabbedLayout.setAfterAttachedParams({container:t.container,hidePopup:i}),i&&(this.hidePopupFunc=i,this.addDestroyFunc(i))},i.prototype.getGui=function(){return this.tabbedLayout.getGui()},i.EVENT_TAB_SELECTED="tabSelected",i.TAB_FILTER="filterMenuTab",i.TABS_DEFAULT=[i.TAB_GENERAL="generalMenuTab",i.TAB_FILTER,i.TAB_COLUMNS="columnsMenuTab"],i.MENU_ITEM_SEPARATOR="separator",bw([Dt("columnModel")],i.prototype,"columnModel",void 0),bw([Dt("filterManager")],i.prototype,"filterManager",void 0),bw([Dt("gridApi")],i.prototype,"gridApi",void 0),bw([Dt("columnApi")],i.prototype,"columnApi",void 0),bw([Dt("menuItemMapper")],i.prototype,"menuItemMapper",void 0),bw([Dt("rowModel")],i.prototype,"rowModel",void 0),bw([Dt("focusService")],i.prototype,"focusService",void 0),bw([Ft],i.prototype,"init",null),i}(Ai),Cw=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),Sw=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Rw="ag-context-menu-open",Ow=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Cw(i,t),i.prototype.hideActiveMenu=function(){this.destroyBean(this.activeMenu)},i.prototype.getMenuItems=function(t,i,n){var e=[];if(Wr.exists(t)&&Ut.isRegistered(Nt.ClipboardModule)&&i&&e.push("copy","copyWithHeaders","copyWithGroupHeaders","paste","separator"),this.gridOptionsWrapper.isEnableCharts()&&Ut.isRegistered(Nt.RangeSelectionModule)&&Ut.isRegistered(Nt.GridChartsModule)&&(this.columnModel.isPivotMode()&&e.push("pivotChart"),this.rangeService&&!this.rangeService.isEmpty()&&e.push("chartRange")),Wr.exists(t)){var r=!Ut.isRegistered(Nt.CsvExportModule),o=!Ut.isRegistered(Nt.ExcelExportModule),s=this.gridOptionsWrapper.isSuppressExcelExport()||o,u=this.gridOptionsWrapper.isSuppressCsvExport()||r;!(Wr.isIOSUserAgent()||s&&u)&&e.push("export")}if(this.gridOptionsWrapper.getContextMenuItemsFunc()){var h=this.gridOptionsWrapper.getContextMenuItemsFunc();return h?h({node:t,column:i,value:n,defaultItems:e.length?e:void 0}):void 0}return e},i.prototype.onContextMenu=function(t,i,n,e,r,o){!this.gridOptionsWrapper.isAllowContextMenuWithControlKey()&&t&&(t.ctrlKey||t.metaKey)||(t&&this.blockMiddleClickScrollsIfNeeded(t),this.gridOptionsWrapper.isSuppressContextMenu()||this.showMenu(n,e,r,t||i.touches[0],o)&&(t||i).preventDefault())},i.prototype.blockMiddleClickScrollsIfNeeded=function(t){var i=t.which;this.gridOptionsWrapper.isSuppressMiddleClickScrolls()&&2===i&&t.preventDefault()},i.prototype.showMenu=function(t,i,n,e,r){var o=this,s=this.getMenuItems(t,i,n),u=this.ctrlsService.getGridBodyCtrl().getGui();if(void 0===s||Wr.missingOrEmpty(s))return!1;var h=new Aw(s);this.createBean(h);var c=h.getGui(),a={column:i,rowNode:t,type:"contextMenu",mouseEvent:e,ePopup:c,nudgeY:1},l=this.gridOptionsWrapper.getLocaleTextFunc(),f=this.popupService.addPopup({modal:!0,eChild:c,closeOnEsc:!0,closedCallback:function(){u.classList.remove(Rw),o.destroyBean(h)},click:e,positionCallback:function(){o.popupService.positionPopupUnderMouseEvent(Object.assign({},{nudgeX:o.gridOptionsWrapper.isEnableRtl()?-1*(c.offsetWidth+1):1},a))},anchorToElement:r,ariaLabel:l("ariaLabelContextMenu","Context Menu")});return f&&(u.classList.add(Rw),h.afterGuiAttached({container:"contextMenu",hidePopup:f.hideFunc})),this.activeMenu&&this.hideActiveMenu(),this.activeMenu=h,h.addEventListener(Ai.EVENT_DESTROYED,(function(){o.activeMenu===h&&(o.activeMenu=null)})),f&&h.addEventListener(hd.EVENT_MENU_ITEM_SELECTED,f.hideFunc),!0},Sw([Dt("popupService")],i.prototype,"popupService",void 0),Sw([It("rangeService")],i.prototype,"rangeService",void 0),Sw([Dt("ctrlsService")],i.prototype,"ctrlsService",void 0),Sw([Dt("columnModel")],i.prototype,"columnModel",void 0),Sw([Pt("contextMenuFactory")],i)}(Ai),Aw=function(t){function i(i){var n=t.call(this,'<div class="ag-menu" role="presentation"></div>')||this;return n.menuList=null,n.focusedCell=null,n.menuItems=i,n}return Cw(i,t),i.prototype.addMenuItems=function(){var t=this,i=this.createManagedBean(new ed),n=this.menuItemMapper.mapWithStockItems(this.menuItems,null);i.addMenuItems(n),this.appendChild(i),this.menuList=i,i.addEventListener(hd.EVENT_MENU_ITEM_SELECTED,(function(i){return t.dispatchEvent(i)}))},i.prototype.afterGuiAttached=function(t){t.hidePopup&&this.addDestroyFunc(t.hidePopup),this.focusedCell=this.focusService.getFocusedCell(),this.menuList&&this.focusService.focusInto(this.menuList.getGui())},i.prototype.restoreFocusedCell=function(){var t=this.focusService.getFocusedCell();if(t&&this.focusedCell&&this.cellPositionUtils.equals(t,this.focusedCell)){var i=this.focusedCell,n=i.rowIndex,e=i.rowPinned,r=i.column,o=this.gridOptionsWrapper.getDocument();o.activeElement===o.body&&this.focusService.setFocusedCell({rowIndex:n,column:r,rowPinned:e,forceBrowserFocus:!0})}},i.prototype.destroy=function(){this.restoreFocusedCell(),t.prototype.destroy.call(this)},Sw([Dt("menuItemMapper")],i.prototype,"menuItemMapper",void 0),Sw([Dt("focusService")],i.prototype,"focusService",void 0),Sw([Dt("cellPositionUtils")],i.prototype,"cellPositionUtils",void 0),Sw([Ft],i.prototype,"addMenuItems",null),i}(io),jw=function(){var t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},t(i,n)};return function(i,n){function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}}(),_w=function(t,i,n,e){var r,o=arguments.length,s=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,n,e);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(i,n,s):r(i,n))||s);return o>3&&s&&Object.defineProperty(i,n,s),s},Gw=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return jw(i,t),i.prototype.mapWithStockItems=function(t,i){var n=this;if(!t)return[];var e=[];return t.forEach((function(t){var r;if(r="string"==typeof t?n.getStockMenuItem(t,i):t){var o=r.subMenu;o&&o instanceof Array&&(r.subMenu=n.mapWithStockItems(r.subMenu,i)),null!=r&&e.push(r)}})),e},i.prototype.getStockMenuItem=function(t,i){var n=this,e=this.gridOptionsWrapper.getLocaleTextFunc(),r=this.gridOptionsWrapper.isSkipHeaderOnAutoSize();switch(t){case"pinSubMenu":return{name:e("pinColumn","Pin Column"),icon:Wr.createIconNoSpan("menuPin",this.gridOptionsWrapper,null),subMenu:["pinLeft","pinRight","clearPinned"]};case"pinLeft":return{name:e("pinLeft","Pin Left"),action:function(){return n.columnModel.setColumnPinned(i,Vt.PINNED_LEFT,"contextMenu")},checked:!!i&&i.isPinnedLeft()};case"pinRight":return{name:e("pinRight","Pin Right"),action:function(){return n.columnModel.setColumnPinned(i,Vt.PINNED_RIGHT,"contextMenu")},checked:!!i&&i.isPinnedRight()};case"clearPinned":return{name:e("noPin","No Pin"),action:function(){return n.columnModel.setColumnPinned(i,null,"contextMenu")},checked:!!i&&!i.isPinned()};case"valueAggSubMenu":return Ut.assertRegistered(Nt.RowGroupingModule,"Aggregation from Menu")?{name:e("valueAggregation","Value Aggregation"),icon:Wr.createIconNoSpan("menuValue",this.gridOptionsWrapper,null),subMenu:this.createAggregationSubMenu(i)}:null;case"autoSizeThis":return{name:e("autosizeThiscolumn","Autosize This Column"),action:function(){return n.columnModel.autoSizeColumn(i,r,"contextMenu")}};case"autoSizeAll":return{name:e("autosizeAllColumns","Autosize All Columns"),action:function(){return n.columnModel.autoSizeAllColumns(r,"contextMenu")}};case"rowGroup":return{name:e("groupBy","Group by")+" "+Wr.escapeString(this.columnModel.getDisplayNameForColumn(i,"header")),action:function(){return n.columnModel.addRowGroupColumn(i,"contextMenu")},icon:Wr.createIconNoSpan("menuAddRowGroup",this.gridOptionsWrapper,null)};case"rowUnGroup":return{name:e("ungroupBy","Un-Group by")+" "+Wr.escapeString(this.columnModel.getDisplayNameForColumn(i,"header")),action:function(){return n.columnModel.removeRowGroupColumn(i,"contextMenu")},icon:Wr.createIconNoSpan("menuRemoveRowGroup",this.gridOptionsWrapper,null)};case"resetColumns":return{name:e("resetColumns","Reset Columns"),action:function(){return n.columnModel.resetColumnState("contextMenu")}};case"expandAll":return{name:e("expandAll","Expand All"),action:function(){return n.gridApi.expandAll()}};case"contractAll":return{name:e("collapseAll","Collapse All"),action:function(){return n.gridApi.collapseAll()}};case"copy":return Ut.assertRegistered(Nt.ClipboardModule,"Copy from Menu")?{name:e("copy","Copy"),shortcut:e("ctrlC","Ctrl+C"),icon:Wr.createIconNoSpan("clipboardCopy",this.gridOptionsWrapper,null),action:function(){return n.clipboardService.copyToClipboard()}}:null;case"copyWithHeaders":return Ut.assertRegistered(Nt.ClipboardModule,"Copy with Headers from Menu")?{name:e("copyWithHeaders","Copy with Headers"),icon:Wr.createIconNoSpan("clipboardCopy",this.gridOptionsWrapper,null),action:function(){return n.clipboardService.copyToClipboard({includeHeaders:!0})}}:null;case"copyWithGroupHeaders":return Ut.assertRegistered(Nt.ClipboardModule,"Copy with Group Headers from Menu")?{name:e("copyWithGroupHeaders","Copy with Group Headers"),icon:Wr.createIconNoSpan("clipboardCopy",this.gridOptionsWrapper,null),action:function(){return n.clipboardService.copyToClipboard({includeHeaders:!0,includeGroupHeaders:!0})}}:null;case"paste":return Ut.assertRegistered(Nt.ClipboardModule,"Paste from Clipboard")?{name:e("paste","Paste"),shortcut:e("ctrlV","Ctrl+V"),disabled:!0,icon:Wr.createIconNoSpan("clipboardPaste",this.gridOptionsWrapper,null),action:function(){return n.clipboardService.pasteFromClipboard()}}:null;case"export":var o=[],s=Ut.isRegistered(Nt.CsvExportModule),u=Ut.isRegistered(Nt.ExcelExportModule);return!this.gridOptionsWrapper.isSuppressCsvExport()&&s&&o.push("csvExport"),!this.gridOptionsWrapper.isSuppressExcelExport()&&u&&o.push("excelExport"),{name:e("export","Export"),subMenu:o,icon:Wr.createIconNoSpan("save",this.gridOptionsWrapper,null)};case"csvExport":return{name:e("csvExport","CSV Export"),icon:Wr.createIconNoSpan("csvExport",this.gridOptionsWrapper,null),action:function(){return n.gridApi.exportDataAsCsv({})}};case"excelExport":return{name:e("excelExport","Excel Export"),icon:Wr.createIconNoSpan("excelExport",this.gridOptionsWrapper,null),action:function(){return n.gridApi.exportDataAsExcel()}};case"separator":return"separator";default:return this.getChartItems(t)||(console.warn("AG Grid: unknown menu item type "+t),null)}},i.prototype.getChartItems=function(t){var i=this,n=this.gridOptionsWrapper.getLocaleTextFunc(),e=function(t,e,r){return{name:n(t,e),action:function(){return i.chartService.createPivotChart({chartType:r})}}},r=function(t,e,r){return{name:n(t,e),action:function(){return i.chartService.createChartFromCurrentRange(r)}}};switch(t){case"pivotChart":return{name:n("pivotChart","Pivot Chart"),subMenu:["pivotColumnChart","pivotBarChart","pivotPieChart","pivotLineChart","pivotXYChart","pivotAreaChart"],icon:Wr.createIconNoSpan("chart",this.gridOptionsWrapper,null)};case"chartRange":return{name:n("chartRange","Chart Range"),subMenu:["rangeColumnChart","rangeBarChart","rangePieChart","rangeLineChart","rangeXYChart","rangeAreaChart","rangeHistogramChart","rangeCombinationChart"],icon:Wr.createIconNoSpan("chart",this.gridOptionsWrapper,null)};case"pivotColumnChart":return{name:n("columnChart","Column"),subMenu:["pivotGroupedColumn","pivotStackedColumn","pivotNormalizedColumn"]};case"pivotGroupedColumn":return e("groupedColumn","Grouped&lrm;","groupedColumn");case"pivotStackedColumn":return e("stackedColumn","Stacked&lrm;","stackedColumn");case"pivotNormalizedColumn":return e("normalizedColumn","100% Stacked&lrm;","normalizedColumn");case"rangeColumnChart":return{name:n("columnChart","Column"),subMenu:["rangeGroupedColumn","rangeStackedColumn","rangeNormalizedColumn"]};case"rangeGroupedColumn":return r("groupedColumn","Grouped&lrm;","groupedColumn");case"rangeStackedColumn":return r("stackedColumn","Stacked&lrm;","stackedColumn");case"rangeNormalizedColumn":return r("normalizedColumn","100% Stacked&lrm;","normalizedColumn");case"pivotBarChart":return{name:n("barChart","Bar"),subMenu:["pivotGroupedBar","pivotStackedBar","pivotNormalizedBar"]};case"pivotGroupedBar":return e("groupedBar","Grouped&lrm;","groupedBar");case"pivotStackedBar":return e("stackedBar","Stacked&lrm;","stackedBar");case"pivotNormalizedBar":return e("normalizedBar","100% Stacked&lrm;","normalizedBar");case"rangeBarChart":return{name:n("barChart","Bar"),subMenu:["rangeGroupedBar","rangeStackedBar","rangeNormalizedBar"]};case"rangeGroupedBar":return r("groupedBar","Grouped&lrm;","groupedBar");case"rangeStackedBar":return r("stackedBar","Stacked&lrm;","stackedBar");case"rangeNormalizedBar":return r("normalizedBar","100% Stacked&lrm;","normalizedBar");case"pivotPieChart":return{name:n("pieChart","Pie"),subMenu:["pivotPie","pivotDoughnut"]};case"pivotPie":return e("pie","Pie&lrm;","pie");case"pivotDoughnut":return e("doughnut","Doughnut&lrm;","doughnut");case"rangePieChart":return{name:n("pieChart","Pie"),subMenu:["rangePie","rangeDoughnut"]};case"rangePie":return r("pie","Pie&lrm;","pie");case"rangeDoughnut":return r("doughnut","Doughnut&lrm;","doughnut");case"pivotLineChart":return e("line","Line&lrm;","line");case"rangeLineChart":return r("line","Line&lrm;","line");case"pivotXYChart":return{name:n("xyChart","X Y (Scatter)"),subMenu:["pivotScatter","pivotBubble"]};case"pivotScatter":return e("scatter","Scatter&lrm;","scatter");case"pivotBubble":return e("bubble","Bubble&lrm;","bubble");case"rangeXYChart":return{name:n("xyChart","X Y (Scatter)"),subMenu:["rangeScatter","rangeBubble"]};case"rangeScatter":return r("scatter","Scatter&lrm;","scatter");case"rangeBubble":return r("bubble","Bubble&lrm;","bubble");case"pivotAreaChart":return{name:n("areaChart","Area"),subMenu:["pivotArea","pivotStackedArea","pivotNormalizedArea"]};case"pivotArea":return e("area","Area&lrm;","area");case"pivotStackedArea":return e("stackedArea","Stacked&lrm;","stackedArea");case"pivotNormalizedArea":return e("normalizedArea","100% Stacked&lrm;","normalizedArea");case"rangeAreaChart":return{name:n("areaChart","Area"),subMenu:["rangeArea","rangeStackedArea","rangeNormalizedArea"]};case"rangeArea":return r("area","Area&lrm;","area");case"rangeStackedArea":return r("stackedArea","Stacked&lrm;","stackedArea");case"rangeNormalizedArea":return r("normalizedArea","100% Stacked&lrm;","normalizedArea");case"rangeHistogramChart":return r("histogramChart","Histogram&lrm;","histogram");case"rangeColumnLineCombo":return r("columnLineCombo","Column & Line&lrm;","columnLineCombo");case"rangeAreaColumnCombo":return r("AreaColumnCombo","Area & Column&lrm;","areaColumnCombo");case"rangeCombinationChart":return{name:n("combinationChart","Combination"),subMenu:["rangeColumnLineCombo","rangeAreaColumnCombo"]};default:return null}},i.prototype.createAggregationSubMenu=function(t){var i,n=this,e=this.gridOptionsWrapper.getLocaleTextFunc();if(t.isPrimary())i=t;else{var r=t.getColDef().pivotValueColumn;i=Wr.exists(r)?r:void 0}var o=[];if(i){var s=i.isValueActive();this.aggFuncService.getFuncNames(i).forEach((function(t){o.push({name:e(t,t),action:function(){n.columnModel.setColumnAggFunc(i,t,"contextMenu"),n.columnModel.addValueColumn(i,"contextMenu")},checked:s&&i.getAggFunc()===t})}))}return o},_w([Dt("columnModel")],i.prototype,"columnModel",void 0),_w([Dt("gridApi")],i.prototype,"gridApi",void 0),_w([It("clipboardService")],i.prototype,"clipboardService",void 0),_w([It("aggFuncService")],i.prototype,"aggFuncService",void 0),_w([It("chartService")],i.prototype,"chartService",void 0),_w([Pt("menuItemMapper")],i)}(Ai),xw={moduleName:Nt.MenuModule,beans:[ww,Ow,Gw],dependantModules:[Kp]};function Mw(){const t=["2909523kXwted","CompanyName=Sankhya Jiva Tecnologia e Inovao Ltda,LicensedApplication=Sankhya Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869","1131048CARoeW","502909mLEPmu","447255iQEXuN","428UHbJwW","270AFTxAV","194369jhGqTI","1540nWuTrj","2044062GicUQI","30CkXPWg"];return(Mw=function(){return t})()}const Fw=kw;function kw(t,i){const n=Mw();return(kw=function(t){return n[t-=392]})(t,i)}!function(){const t=kw,i=Mw();for(;;)try{if(951926==-parseInt(t(398))/1+-parseInt(t(393))/2+parseInt(t(395))/3+-parseInt(t(400))/4*(parseInt(t(392))/5)+-parseInt(t(401))/6*(-parseInt(t(402))/7)+parseInt(t(397))/8+-parseInt(t(399))/9*(-parseInt(t(394))/10))break;i.push(i.shift())}catch(t){i.push(i.shift())}}();const Pw=Fw(396);class Dw{configFilterColumn(t){this._filterColumn=t,this._filterColumn.addEventListener("applyFilterColumnOptions",this.handleFilteredColumnsChanged.bind(this))}handleFilteredColumnsChanged(t){const i=t.detail;this._filteredColumns.set(i.field,i.values),this._gridOptions.api.refreshHeader(),this._dataUnit.loadData(void 0,void 0,void 0,B)}clearFilter(){this._filteredColumns.clear(),this._gridOptions.api.refreshHeader()}showFilterColumn(t){var i;const n=this.resolveDescriptionColMetadata(t.columnName);null===(i=this._filterColumn)||void 0===i||i.show(Object.assign(Object.assign({},t),{fieldDescriptor:n}))}constructor(t){this.DEFAULT_ROW_HEIGHT=30,this.DEFAULT_HEADER_ROW_HEIGHT=32,this.CHECK_BOX_COL_ID="checkBoxColumn",this.STATUS_COL_ID="statusColumn",this.RECORD_ARCHIVE_COL_ID="__RECORD_ARCHIVE__",this.BLOCK_LOAD_DEBOUNCE=100,this.DEFAULT_FONT_SIZE=14,this.DEFAULT_FONT_SIZE_HTML5=32,this.DEFAULT_ICON_SIZE=12,this.DEFAULT_MAX_SIZE=200,this._menuItems=[],this._idAttribName="__record__id__",this._gridConfig=[],this._filteredColumns=new Map,this._filterColumnleftPosition=0,this._customFormatters=new Map,this._gridShowDom=!1,this.peddingExecutionsOnGridShow=[],this._lastColsConfig=void 0,Ut.registerModules([Kp,Fg,gm,Pm,xw])}getGridConfig(){return this._gridConfig}locateColumn(t,i){this._gridOptions.api.ensureColumnVisible(t),requestAnimationFrame((()=>{this.highlightColumnHeader(t,i)}))}highlightColumnHeader(t,i){const n=i.querySelector(`.ag-header-cell[col-id="${t}"]`);if(!n)return;n.classList.add("ez-grid__column-highlight-header"),n.setAttribute("tabindex","0");const e=t=>{n.contains(t.target)||(n.classList.remove("ez-grid__column-highlight-header"),document.removeEventListener("click",e))};document.addEventListener("click",e)}getSort(t,i){const n=[];return this._gridOptions.columnApi.getColumnState().sort(((t,i)=>t.sortIndex-i.sortIndex)).forEach((({colId:t,sort:i})=>{if(i){const e=this._dataUnit.getField(t),r="asc"===i?m.ASC:m.DESC;n.push(e?{field:e.name,dataType:e.dataType,mode:r}:{field:t,dataType:v.TEXT,mode:r})}})),0===n.length&&void 0===this._gridConfig?i:n}getFilter(){if(this._filteredColumns&&0!==this._filteredColumns.size)return Array.from(this._filteredColumns.entries()).map((([t,i])=>{var n;const e=i.filter((t=>t.check));if(e.length>0){let i=t;const r=this.getCodeColFromDescriptionCol(t);l.isEmpty(r)||(i=r);const o=this._dataUnit.getField(i),s=null!==(n=null==o?void 0:o.dataType)&&void 0!==n?n:v.TEXT;let u="";const h=[];let c;return e.forEach((t=>{const n=`PARAM_${i}_${h.length+1}`;h.push({dataType:s===v.OBJECT?v.TEXT:s,name:n,value:t.value}),null==t.value?c=!0:(u.length>0&&(u+=","),u=`${u}:${n}`)})),{name:`${L}${i}`,expression:this.getExpression(s,i,u,c),params:h}}})).filter((t=>null!=t))}getExpression(t,i,n,e){const r=t===v.DATE?`onlydate(this.${i})`:`this.${i}`;return n.length>0&&e?`(${r} in (${n}) OR ${i} IS NULL)`:e?`${i} IS NULL`:`${r} in (${n})`}initDatagrid(t,i){var n;this._options=i,this._container=t;const e=(null==i?void 0:i.enableLockManagerTaskbarClick)?null==f?void 0:f.addLockManagerCtxId(this._container):null;let r;if(null==i?void 0:i.enableLockManagerLoadingComp){const t=null==f?void 0:f.addLockManagerCtxId(this._container);r=null==f?void 0:f.lock(t,d.APP_LOADING)}if(void 0===this._grid){Np.setLicenseKey(Pw),this._i18n=i.i18n,this._columnStateChangeCallback=i.onColumnStateChange,this._selectionChangeCallback=i.onSelectionChange,this._doubleClickCallBack=i.onDoubleClick,this._multipleSelection=i.allowMultipleSelection,this._dataUnit=i.dataUnit,this._editionManager=new ag(this._dataUnit,i.useEnterLikeTab,i.recordsValidator,i.editionIsDisabled,i.customEditors||this._customEditors,i.customRenders||this._customRenders,i.enableContinuousInsert,i.enableGridInsert,e),this._statusResolver=i.statusResolver,this._dataUnit&&(this._dataUnit.sortingProvider=this,this._dataUnit.addFilterProvider(this)),this._gridOptions={suppressHorizontalScroll:i.suppressHorizontalScroll,localeText:(o=this._options.i18n,{page:o("ez-grid.pageLabel"),more:o("ez-grid.remainingPageLabel"),to:o("ez-grid.remainingTotalLabel"),of:o("ez-grid.remainingTotalLabel"),next:o("ez-grid.nextPage"),previous:o("ez-grid.previousPage"),loadingOoo:o("app.loading"),noRowsToShow:o("ez-grid.noRowsToShow"),pinColumn:o("ez-grid.pinColumn"),unpinColumn:o("ez-grid.unpinColumn"),filterOoo:o("ez-grid.filter"),sortAscending:o("ez-grid.sortAscending"),sortDescending:o("ez-grid.sortDescending"),last:o("ez-grid.last"),first:o("ez-grid.first"),selectAll:o("ez-grid.selectAll"),searchOoo:o("ez-grid.searchOoo"),blanks:o("ez-grid.blanks"),applyFilter:o("ez-grid.applyFilter"),equals:o("ez-grid.equals"),lessThan:o("ez-grid.lessThan"),greaterThan:o("ez-grid.greaterThan"),contains:o("ez-grid.contains"),startsWith:o("ez-grid.startsWith"),endsWith:o("ez-grid.endsWith"),group:o("ez-grid.group"),columns:o("ez-grid.columns"),rowGroupColumns:o("ez-grid.rowGroupColumns"),rowGroupColumnsEmptyMessage:o("ez-grid.rowGroupColumnsEmptyMessage"),valueColumns:o("ez-grid.valueColumns"),pivotMode:o("ez-grid.pivotMode"),groups:o("ez-grid.groups"),values:o("ez-grid.values"),pivots:o("ez-grid.pivots"),valueColumnsEmptyMessage:o("ez-grid.valueColumnsEmptyMessage"),pivotColumnsEmptyMessage:o("ez-grid.pivotColumnsEmptyMessage"),toolPanelButton:o("ez-grid.toolPanelButton"),valueAggregation:o("ez-grid.valueAggregation"),autosizeThiscolumn:o("ez-grid.autosizeThiscolumn"),autosizeAllColumns:o("ez-grid.autosizeAllColumns"),groupBy:o("ez-grid.groupBy"),ungroupBy:o("ez-grid.ungroupBy"),resetColumns:o("ez-grid.resetColumns"),expandAll:o("ez-grid.expandAll"),collapseAll:o("ez-grid.collapseAll"),toolPanel:o("ez-grid.toolPanel"),export:o("ez-grid.export"),csvExport:o("ez-grid.csvExport"),excelExport:o("ez-grid.excelExport"),pinLeft:o("ez-grid.pinLeft"),pinRight:o("ez-grid.pinRight"),noPin:o("ez-grid.noPin"),sum:o("ez-grid.sum"),min:o("ez-grid.min"),max:o("ez-grid.max"),none:o("ez-grid.none"),count:o("ez-grid.count"),average:o("ez-grid.average"),copy:o("ez-grid.copy"),copyWithHeaders:o("ez-grid.copyWithHeaders"),copyWithGroupHeaders:o("ez-grid.copyWithGroupHeaders"),ctrlC:o("ez-grid.ctrlC"),paste:o("ez-grid.paste"),ctrlV:o("ez-grid.ctrlV")}),enableRangeSelection:this._multipleSelection,rowSelection:this._multipleSelection?"multiple":"single",sortingOrder:["desc","asc",null],blockLoadDebounceMillis:this.BLOCK_LOAD_DEBOUNCE,navigateToNextCell:this.navigateToNextCell.bind(this),getRowNodeId:this._dataUnit?t=>"string"==typeof t?t:t[this._idAttribName]:void 0,getMainMenuItems:t=>this.buildMenuItemOptions(t),postProcessPopup:t=>this.setFilterColumnLeftPosition(t),getRowHeight:this.getRowHeight.bind(this),defaultColDef:{headerClass:"ez-grid__cell-header",cellClass:"ez-grid__cell-body",cellClassRules:{invalidValue:t=>this._editionManager.hasInvalidField(t.colDef.field,t.data.__record__id__)},cellStyle:{height:"100%"}},rowClassRules:{"row-striped":({node:t})=>i.enableRowTableStriped&&t.rowIndex%2==0},suppressFieldDotNotation:!0,components:Object.assign({ezGridHeaderComponent:Zp,ezGridCustomHeader:Yp},this._editionManager.getComponents()),context:{editionManager:this._editionManager,dataUnit:this._dataUnit,headerCheckStatusGetter:()=>this.getSelectionHeaderStatus(),headerCheckStatusSetter:t=>this.updateSelectionForAll(t)},processCellForClipboard:this.processFormatterCellCallback,defaultExcelExportParams:{processCellCallback:this.processFormatterCellCallback},defaultCsvExportParams:{processCellCallback:this.processFormatterCellCallback}},this.defineRowModelType(this._gridOptions,i,r),this.setOptionsEvents(this._gridOptions),this.setOptionsSupress(this._gridOptions),this._gridOptions=this._editionManager.configureGrid(this._gridOptions),this._grid=new Dp(t,this._gridOptions);const s=null===(n=this._dataUnit)||void 0===n?void 0:n.getSelectionInfo();(null==s?void 0:s.isAllRecords())?this.selectAll(!0):this.selectRows((null==s?void 0:s.recordIds)||[],!0),this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight()),this._customFormatters=i.customFormatters,this.observer=new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting?(this._gridShowDom=!0,this.peddingExecutionsOnGridShow.forEach((t=>t())),this.peddingExecutionsOnGridShow=[]):this._gridShowDom=!1}))}),{root:null,threshold:.1}),this.observer.observe(t)}var o}processFormatterCellCallback(t){const i=t.column.getColDef();return"function"==typeof i.valueFormatter?i.valueFormatter({value:t.value,data:t.node.data,node:t.node,colDef:i,column:t.column,api:t.api,columnApi:t.columnApi,context:t.context}):t.value}setFilterColumnLeftPosition({type:t,ePopup:i}){"columnMenu"!==t||(this._filterColumnleftPosition=i.getBoundingClientRect().left)}buildMenuItemOptions(t){const i=[];return t.column.getColDef().sortable&&(i.push(this.buildMenuItemOptionSort(t,"asc")),i.push(this.buildMenuItemOptionSort(t,"desc")),this._options.suppressFilterColumn||i.push(this.buildMenuItemFilterColumn(t))),this._menuItems.forEach((n=>i.push({icon:n.icon,name:n.label,action:()=>n.action(t)}))),i.push(this.buildMenuItemOptionPin(t)),i}buildMenuItemOptionSort(t,i){return{icon:"asc"===i?"<i class='ez-icon-ordem-ascendente'></i>":"<i class='ez-icon-ordem-descendente'></i>",name:this._i18n("asc"===i?"ez-grid.sortAscending":"ez-grid.sortDescending"),action:()=>this.sortDataByColumn(t,i)}}buildMenuItemFilterColumn(t){const i=t.column.getId(),n=t.column.getColDef().headerName;return{icon:"<i class='ez-icon-filter'></i>",name:this._i18n("ez-grid.filter"),action:()=>this.showFilterColumn({columnName:i,columnLabel:n,leftPosition:this._filterColumnleftPosition,filteredOptions:this._filteredColumns.get(i)})}}resolveDescriptionColMetadata(t){var i;const n=null===(i=this._gridOptions.columnApi.getColumn(t))||void 0===i?void 0:i.getColDef(),e=this.getCodeColFromDescriptionCol(t);if(!l.isEmpty(e))return{label:n.headerName,name:t,userInterface:h.SHORTTEXT,dataType:v.TEXT,properties:{[W]:e}}}buildMenuItemOptionPin(t){const{column:i,columnApi:n}=t,e=t.column.isPinned();return{icon:`<i class='ez-icon-${e?"un-pin":"push-pin"}'></i>`,name:this._i18n(e?"ez-grid.unpinColumn":"ez-grid.pinColumn"),action:()=>{n.applyColumnState({state:[{colId:i.getColId(),pinned:i.isPinned()?null:"left"}]})}}}sortDataByColumn(t,i){const n=t.column,e=t.columnApi;n.getSort()===i?e.applyColumnState({defaultState:{sort:null}}):e.applyColumnState({state:[{colId:n.getColId(),sort:i}],defaultState:{sort:null}})}getRowHeight(){return this.DEFAULT_ROW_HEIGHT}getHeaderRowHeight(){return this.DEFAULT_HEADER_ROW_HEIGHT}navigateToNextCell(t){var i,n,e,r,o,s,u,h,c;switch(t.key){case"ArrowUp":return!1===(null===(i=this._dataUnit)||void 0===i?void 0:i.hasPrevious())?null:(this._gridOptions.api.deselectAll(),(null===(n=t.nextCellPosition)||void 0===n?void 0:n.rowIndex)<0?(null===(e=this._dataUnit)||void 0===e||e.previousRecord(),null):(null===(r=this._dataUnit)||void 0===r||r.setSelectionByIndex([t.nextCellPosition.rowIndex]),t.nextCellPosition));case"ArrowDown":return!1===(null===(o=this._dataUnit)||void 0===o?void 0:o.hasNext())?null:(this._gridOptions.api.deselectAll(),(null===(s=t.nextCellPosition)||void 0===s?void 0:s.rowIndex)?null===(u=this._dataUnit)||void 0===u||u.setSelectionByIndex([t.nextCellPosition.rowIndex]):null===(h=this._dataUnit)||void 0===h||h.nextRecord(),t.nextCellPosition);case"ArrowLeft":case"ArrowRight":return""!==(null===(c=t.nextCellPosition)||void 0===c?void 0:c.column.colDef.headerName)?t.nextCellPosition:null}return null}defineRowModelType(t,i,n){null!=this._dataUnit&&(t.rowModelType="serverSide",t.serverSideDatasource=this._dataSource=new qp(this._dataUnit,this,i,n),t.serverSideSortOnServer=!0,t.columnDefs=this._colDefs)}setOptionsEvents(t){t.onSortChanged=t=>this.onCallStateChange("sort",t),t.onColumnResized=t=>this.onCallStateChange("columnResize",t),t.onColumnPinned=t=>this.onCallStateChange("columnPinned",t),t.onColumnMoved=t=>this.onCallStateChange("columnMoved",t),t.onColumnVisible=t=>this.onCallStateChange("visibleChange",t),t.onSelectionChanged=t=>this.onSelectionChange(t),t.onRowDoubleClicked=t=>this.onRowDoubleClick(t),t.onDragStopped=t=>this.onCallStateChange("columnMovedEnd",t),t.onCellClicked=t=>this.onCellClicked(t)}setOptionsSupress(t){t.suppressDragLeaveHidesColumns=!0,t.suppressMenuHide=!0}getSelectionHeaderStatus(){const t=this._dataUnit.records;if(t&&0===t.length)return!1;const i=this._dataUnit.getSelectionInfo();if(i.isAllRecords())return!0;const n=i.recordIds;if(null==n||0===n.length)return!1;let e;for(let i=0;i<t.length;i++){const r=n.includes(t[i].__record__id__);if(null!=e&&r!==e)return;e=r}return e}updateSelectionForAll(t){t?this._dataUnit.selectAllRecords():this._dataUnit.unSelectAllRecords()}setData(t){if(void 0===this._grid)throw new Error("Erro interno: Grid ainda não inicializado.");this._gridOptions.api.setRowData(t)}addRows(){if(void 0===this._grid)throw new Error("Erro interno: Grid ainda não inicializado.")}updateRows(t){if(void 0===this._grid)throw new Error("Erro interno: Grid ainda não inicializado.");null==t||t.forEach((t=>this.updateRowData(t)))}updateRowData(t){this._gridOptions.api.getRowNode(t[this._idAttribName]).setData(Object.assign({},t)),this._editionManager.updateCurrentEditorGuiValue(t),this._editionManager.recordValidate()}selectAll(t=!1){try{this._gridOptions.context.selectionChangeQuietly=t,this._gridOptions.api.forEachNode((t=>{t.isSelected()||t.setSelected(!0)}))}finally{const t=Object.assign({},this._gridOptions.context);delete t.selectionChangeQuietly,this._gridOptions.context=t}}selectRows(t,i=!1){var n;try{if(this._gridOptions.context.selectionChangeQuietly=i,void 0===this._grid)throw new Error("Erro interno: Grid ainda não inicializado.");let e;this._gridOptions.api.forEachNode((i=>{t&&t.includes(i.id)?i.isSelected()||(i.setSelected(!0),e=i):i.isSelected()&&i.setSelected(!1)}));const r=this._gridOptions.context.selectionHeader;r&&r.updateCheckbox(),e&&(null===(n=this._gridOptions.api)||void 0===n||n.ensureNodeVisible(e))}finally{const t=Object.assign({},this._gridOptions.context);delete t.selectionChangeQuietly,this._gridOptions.context=t}}removeRows(){if(void 0===this._grid)throw new Error("Erro interno: Grid ainda não inicializado.");this._gridOptions.api.refreshServerSide({purge:!0})}changeValues(t,i){if(void 0===this._grid)throw new Error("Erro interno: Grid ainda não inicializado.");if(t){let n;i?(n=[],i.forEach((t=>{const i=this._gridOptions.api.getRowNode(t);i&&n.push(i)}))):n=this._gridOptions.api.getSelectedNodes(),n.forEach((i=>{const n=i.data;Object.entries(t).forEach((([t,i])=>{n[t]=i})),i.setData(n)})),this._gridOptions.api.refreshCells({force:!0});const e=this._editionManager.getNextInvalidCell();if(e){const t=this._gridOptions.api.getRowNode(e.recordId);t&&e.field&&this.startEdition(t.rowIndex,this._gridOptions.columnApi.getColumn(e.field.name))}}}savingCanceled(t,i){if(!this._gridShowDom)return;const n=this._gridOptions.columnApi.getAllDisplayedColumns(),e=this._gridOptions.api.getRowNode(i).rowIndex,r=n.find((i=>this.isColumnEditable(e,i)&&t.find((t=>t.name===i.getColId()))));this.focusByCollAndRow(r,e),this.startEdition(e,r)}refresh(t=!1){if(void 0===this._grid)throw new Error("Erro interno: Grid ainda não inicializado.");this._gridOptions.api.clearRangeSelection(),this._gridOptions.api.refreshServerSide({purge:!0}),this._options.onRefresh(),t&&this.scrollToSelectedRow()}scrollToSelectedRow(){const t=this._gridOptions.api.getSelectedNodes();t&&0!==t.length&&(this._gridShowDom?this._gridOptions.api.ensureNodeVisible(t[0]):this.peddingExecutionsOnGridShow.push((()=>this._gridOptions.api.ensureNodeVisible(t[0]))))}focusOnGridContainer(){this._container.setAttribute("tabindex","-1"),this._container.focus()}setFocus(){var t,i;(null===(i=null===(t=this._dataUnit)||void 0===t?void 0:t.records)||void 0===i?void 0:i.length)?this._dataUnit.getSelectedRecord()?this.syncSelectWithDataUnit():this.setFocusFirstRow():this.focusOnGridContainer()}setAutoFocus(t){var i;null===(i=this._dataSource)||void 0===i||i.setAutoFocus(t)}setEnableGridInsert(t){var i;null===(i=this._dataSource)||void 0===i||i.setEnableGridInsert(t)}setEnableContinuousInsert(t){var i;null===(i=this._editionManager)||void 0===i||i.setEnableContinuousInsert(t)}setFocusFirstRow(){const t=this._gridOptions.api.getDisplayedRowAtIndex(0);t?this.setFocusOnRow(t.rowIndex):this.focusOnGridContainer()}setFocusLastRow(){const t=this._gridOptions.api.getDisplayedRowAtIndex(this._gridOptions.api.getLastDisplayedRow());t&&this.setFocusOnRow(t.rowIndex)}startEditionOnRowByIndex(t){this._dataUnit.setSelectionByIndex([t]);const i=this.getFirstEditableColl(t);i&&(this.focusByCollAndRow(i,t),this.startEdition(t,i))}startEditionOnLastRow(){var t;if(this._gridShowDom){const i=(null===(t=this._dataUnit.records)||void 0===t?void 0:t.length)-1;this.startEditionOnRowByIndex(i)}}syncSelectWithDataUnit(){const t=this._gridOptions.api.getRowNode(this._dataUnit.getSelectedRecord().__record__id__);if(!t||(null==t?void 0:t.rowIndex)<0)return;const i=this._gridOptions.api.getCellRanges().find((i=>i.startRow.rowIndex===t.rowIndex));if((null==i?void 0:i.columns.length)>0)return this._dataUnit.hasNewRecord()?void this.startEdition(t.rowIndex,i.columns[0]):(this.focusByCollAndRow(i.columns[0],t.rowIndex),void this._gridOptions.api.addCellRange({rowStartIndex:t.rowIndex,rowEndIndex:t.rowIndex,columns:i.columns}));this._gridOptions.api.clearRangeSelection(),this.setFocusOnRow(t.rowIndex)}startEdition(t,i){if(!this._gridShowDom)return;this._gridOptions.api.clearRangeSelection(),this._gridOptions.api.addCellRange({rowStartIndex:t,rowEndIndex:t,columns:[i]}),this._gridOptions.api.setFocusedCell(t,i),this._gridOptions.api.startEditingCell({rowIndex:t,colKey:i});const n=this._gridOptions.api.getCellEditorInstances()[0];n&&n.focusIn()}getFirstEditableColl(t){try{return this._gridOptions.columnApi.getAllDisplayedColumns().find((i=>this.isColumnEditable(t,i)))}catch(t){console.warn(t)}}isColumnEditable(t,i){if(""===i.getColDef().headerName||i.getColDef().headerName===this.CHECK_BOX_COL_ID||-1===t)return!1;const n=this._gridOptions.api.getRowNode(this._dataUnit.records[t][this._idAttribName]);return i.isCellEditable(n)}setFocusOnRow(t){let i=this._gridOptions.columnApi.getAllDisplayedColumns().find((t=>""!==t.getColDef().headerName));this.focusByCollAndRow(i,t),this._gridOptions.api.addCellRange({rowStartIndex:t,rowEndIndex:t,columns:[i]})}focusByCollAndRow(t,i){this._gridOptions.api.ensureColumnVisible(t),this._gridOptions.api.ensureIndexVisible(i),this._gridOptions.api.setFocusedCell(i,t)}setColumnsDef(t){const i=Object.assign({colId:this.CHECK_BOX_COL_ID,headerName:this.CHECK_BOX_COL_ID,checkboxSelection:!0,width:29,suppressMovable:!0,suppressAutoSize:!0,suppressMenu:!0,lockPosition:!0,pinned:!0},this._multipleSelection?{headerComponent:"ezGridHeaderComponent",headerClass:"ag-column-select-header"}:{headerComponentParams:{displayName:""}}),n=this._options.suppressCheckBoxCol?[]:[i];null!=this._statusResolver&&n.push({colId:this.STATUS_COL_ID,headerName:"",checkboxSelection:!1,headerCheckboxSelection:!1,width:29,suppressMovable:!0,suppressAutoSize:!0,suppressMenu:!0,lockPosition:!0,pinned:!0,cellRenderer:Jp,cellRendererParams:{statusResolver:this._statusResolver},cellStyle:{"text-align":"center"},suppressNavigable:!0}),t.forEach((t=>{n.push(this.buildColDef(t))})),this._colDefs=n,this._gridOptions&&this._gridOptions.api&&this.setColsDefsWithStateIfNeeded(this._colDefs)}setColsDefsWithStateIfNeeded(t){this._lastColsConfig||this._gridOptions.api.setColumnDefs(this._colDefs);const i=this.getColsDefWithConfigApplied(t,this._lastColsConfig);this._gridOptions.api.setColumnDefs(i)}getColsDefWithConfigApplied(t,i=[]){const n=i.reduce(((t,i,n)=>(t[i.name]=n,t)),{});return t.filter((t=>!n.hasOwnProperty(t.colId))).sort(((t,i)=>{var e,r;return(null!==(e=n[t.field])&&void 0!==e?e:Number.MAX_VALUE)-(null!==(r=n[i.field])&&void 0!==r?r:Number.MAX_VALUE)}))}clearRangeSelection(){this._gridOptions.api.clearRangeSelection()}hideSelectionColumn(){var t,i;null===(i=null===(t=this._gridOptions)||void 0===t?void 0:t.columnApi)||void 0===i||i.setColumnVisible(this.CHECK_BOX_COL_ID,!1)}showSelectionColumn(){var t,i;null===(i=null===(t=this._gridOptions)||void 0===t?void 0:t.columnApi)||void 0===i||i.setColumnVisible(this.CHECK_BOX_COL_ID,!0)}getColumnsDef(){if(void 0===this._grid)throw new Error("Erro interno: Grid ainda não inicializado.");return this._gridOptions.columnApi.getColumns().filter((t=>![this.CHECK_BOX_COL_ID,this.STATUS_COL_ID].includes(t.getColId()))).map((t=>{const i=t.getColDef(),n={name:i.field,label:i.headerName};return this.conditionalSet(n,"sortable",i.sortable),this.conditionalSet(n,"resizable",i.resizable),this.conditionalSet(n,"sort",i.sort),this.conditionalSet(n,"sortIndex",i.sortIndex),this.conditionalSet(n,"width",i.width),this.conditionalSet(n,"pinned",null!==i.pinned),this.conditionalSet(n,"hidden",i.hide),n}))}setColumnsState(t){if(void 0===this._grid)throw new Error("Erro interno: Grid ainda não inicializado.");this._lastColsConfig=t;const i=this._gridOptions.columnApi.getColumns();let n=this.getColumnsDef(),e=[];const r=i.length-n.length;this._gridConfig=t;let o=[],s=0;t.forEach((i=>{var n,u;const h=this.getColumnWidth(i);this._gridOptions.columnApi.moveColumn(i.name,s+r),this._gridOptions.columnApi.setColumnWidth(i.name,h),e.push(i.name),void 0!==i.ascending&&o.push({colId:i.name,sort:!0!==i.ascending?"desc":"asc",sortIndex:i.orderIndex}),s++;const c=null===(n=this._dataUnit)||void 0===n?void 0:n.getField(i.name);if(this.needToAddDescriptionColumn(i,c,t)){const t=null===(u=null==c?void 0:c.properties)||void 0===u?void 0:u[H];if(!t)return;const i=this._gridOptions.columnApi.getColumn(t),n=null==i?void 0:i.getColDef(),o=this.getColumnWidthByLabel(null==n?void 0:n.headerName);this._gridOptions.columnApi.moveColumn(t,s+r),this._gridOptions.columnApi.setColumnWidth(t,o),e.push(t),s++}}));let u=n.filter((t=>!e.includes(t.name))).map((t=>t.name));this._gridOptions.columnApi.setColumnsVisible(e,!0),this._gridOptions.columnApi.setColumnsVisible(u,!1),this._gridOptions.columnApi.applyColumnState({state:o,defaultState:{sort:null}})}needToAddDescriptionColumn(t,i,n){var e,r;if(!i)return!1;const o=null!==(e=t.configVersion)&&void 0!==e?e:0,s=null===(r=null==i?void 0:i.properties)||void 0===r?void 0:r[H];return(null==i?void 0:i.userInterface)==h.SEARCHPLUS&&o<1&&null!=n.find((t=>t.name===s))}getColumnsState(){if(void 0===this._grid)throw new Error("Erro interno: Grid ainda não inicializado.");return this._gridOptions.columnApi.getColumnState().map((t=>{const i=this._gridOptions.columnApi.getColumn(t.colId),n=i.getColDef(),e=i.getActualWidth(),r={label:n.headerName,name:n.checkboxSelection?"__SELECTION__":t.colId};this.conditionalSet(r,"sort",t.sort),this.conditionalSet(r,"sortIndex",t.sortIndex),this.conditionalSet(r,"width",e),this.conditionalSet(r,"pinned",null!==t.pinned),this.conditionalSet(r,"hidden",t.hide);const o=new Map;return o.set("sortable",n.sortable),this.conditionalSet(r,"props",o),r})).filter((t=>"__SELECTION__"!==t.name&&t.name!==this.STATUS_COL_ID))}getSelection(){return this._gridOptions.api.getSelectedRows()}addColumnMenuItem(t){this._menuItems.map((t=>t.name)).includes(t.name)||this._menuItems.push(t)}quickFilter(t){if(t){const i={term:t,fields:this._gridOptions.columnApi.getColumns().filter((t=>t.isVisible()&&![this.CHECK_BOX_COL_ID,this.STATUS_COL_ID,this.RECORD_ARCHIVE_COL_ID].includes(t.getColId()))).map((t=>t.getColId()))};this._dataSource.quickFilter=i}else this._dataSource.quickFilter=void 0}setSelectedIndex(t){var i;null===(i=this._gridOptions.api.getDisplayedRowAtIndex(t))||void 0===i||i.setSelected(!0)}hasFilterColumn(t){var i;return(null!==(i=this._filteredColumns.get(t))&&void 0!==i?i:[]).map((t=>t.check)).includes(!0)}buildColDef(t){var i,n,e,r,o;let s;const u=l.getBooleanValue(null===(i=t.props)||void 0===i?void 0:i.get("gridSortable"),!0);(null===(n=t.props)||void 0===n?void 0:n.get("gridHeaderTooltip"))?s=null===(e=t.props)||void 0===e?void 0:e.get("gridHeaderTooltip"):!1===u&&(s=this._i18n("ez-grid.columnCantBeOrder"));const c=null===(r=null==t?void 0:t.props)||void 0===r?void 0:r.get(W);return this._editionManager.configureColumn({headerName:t.label,field:t.name,sortable:u,resizable:!0,headerComponent:"ezGridCustomHeader",headerComponentParams:{presentationFrom:c,tooltip:s,isSortable:u,hasFilter:()=>this.hasFilterColumn(t.name),showColumnFilter:i=>this.showFilterColumn({columnName:t.name,columnLabel:t.label,leftPosition:i,filteredOptions:this._filteredColumns.get(t.name),fromIcon:!0})},valueFormatter:i=>{var n,e,r;if(c)return null!==(r=null===(e=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n[c])||void 0===e?void 0:e.label)&&void 0!==r?r:"";if(null==i.value)return"";if(i.value instanceof Promise)return`${this._i18n("app.loading")}...`;if(t.userInterface===h.HTML)return this.setHTMLRender(i,t),"";const o=this._customFormatters.get(t.name);if(o){const n=o.format(i.value,t,i.data.__record__id__);if(n)return n}return this._dataUnit?this._dataUnit.getFormattedValue(t.name,i.value):this.getFormatterByColumn(i,t)},cellStyle:this.getStyleByColumn(t),editable:!(null===(o=t.props)||void 0===o?void 0:o.has(W))})}setHTMLRender(t,i){const n=U.sanitize(t.value);t.colDef.cellRenderer=i=>{if(i.node.rowIndex===t.node.rowIndex){const t=document.createElement("span");return t.innerHTML=n,t}return i.value},t.colDef.cellStyle=n=>{const e=this.getStyleByColumn(i);return n.node.rowIndex===t.node.rowIndex?Object.assign(e,{padding:0}):e}}setCustomFormatters(t){this._customFormatters=t}refreshSelectedRows(){const t=this._gridOptions.api.getSelectedNodes();this._gridOptions.api.redrawRows({rowNodes:t})}getInitCellStyle(){return{"line-height":this.getRowHeight()-1+"px"}}getStyleByColumn(t){var i;let n=this.getInitCellStyle();const e=null===(i=null==t?void 0:t.props)||void 0===i?void 0:i.get("PRIMITIVETUIYPE"),r=null==t?void 0:t.userInterface;if(r===h.SEARCH)return n["text-align"]="left",n;switch(null!=e?e:r){case h.DECIMALNUMBER:case h.INTEGERNUMBER:n["text-align"]="right";break;case h.DATE:case h.DATETIME:case h.TIME:n["text-align"]="center";break;default:n["text-align"]="left"}return n}getFormatterByColumn(t,i){var n,e,r,o;if("OPTIONSELECTOR"===(null==i?void 0:i.userInterface)&&i.options){const n=null==i?void 0:i.options;let e,r;if("string"==typeof n){const t=JSON.parse(n);e=Object.keys(t).map((i=>({value:i,label:t[i]})))}else e=n;return e.forEach((i=>{i.value==t.value&&(r=i)})),null==r?void 0:r.label}if((null==i?void 0:i.userInterface)===h.SWITCH){if("S"===(null==t?void 0:t.value)||!0===(null==t?void 0:t.value)||"true"===(null==t?void 0:t.value))return this._i18n("app.yes");if("N"===(null==t?void 0:t.value)||!1===(null==t?void 0:t.value)||"false"===(null==t?void 0:t.value))return this._i18n("app.no")}if((null==i?void 0:i.userInterface)===h.SEARCH)return null!=(null===(n=null==t?void 0:t.value)||void 0===n?void 0:n.value)?t.value.value+" - "+t.value.label:null==t?void 0:t.value;if((null==i?void 0:i.userInterface)===h.SEARCHPLUS)return null!==(o=null!==(r=null===(e=null==t?void 0:t.value)||void 0===e?void 0:e.value)&&void 0!==r?r:null==t?void 0:t.value)&&void 0!==o?o:"";if((null==i?void 0:i.userInterface)===h.DECIMALNUMBER&&null!=t.value){const n=Number(i.props.get("precision"))||2;return p.format(t.value.toString(),n,n)}if(((null==i?void 0:i.userInterface)===h.DATE||(null==i?void 0:i.userInterface)===h.DATETIME)&&null!=t.value)return t.value.toLocaleDateString();if(((null==i?void 0:i.userInterface)===h.ELAPSEDTIME||(null==i?void 0:i.userInterface)===h.TIME)&&t.value){const i=new g("##:##"),n=String(t.value).padStart(4,"0");return i.format(n)}return(null==i?void 0:i.userInterface)===h.FILE?t.value&&Array.isArray(t.value)?1===t.value.length?t.value[0].name:`${t.value.length} arquivos`:"":void 0}onCallStateChange(t,i){if((!("finished"in i)||i.finished)&&this._columnStateChangeCallback){let n={},e=this.isUIEvent(i.source,i.type);"columnResize"===t&&(n.column={colId:i.column.colId,actualWidth:i.column.actualWidth}),n.isUserChange=e,n.isElementResize=this.isElementResize(i),this._columnStateChangeCallback(t,this.getColumnsState(),n)}}onCellClicked(t){this._editionManager.verifyClickToEdition(t.api,{rowIndex:t.rowIndex,column:t.column,rowPinned:void 0})}isElementResize(t){return t.target&&"eResize"===t.target.getAttribute("ref")}isUIEvent(t,i){return"dragStopped"===i||!!t&&["uiColumnMoved","uiColumnResized","uiColumnDragged","uiColumnExpanded","uiColumnSorted"].includes(t)}onSelectionChange(t){var i,n;const e=null===(n=null===(i=t.api.getSelectedNodes())||void 0===i?void 0:i[0])||void 0===n?void 0:n.id,r=this._dataUnit.isNewRecord(e);this._selectionChangeCallback&&(clearTimeout(this._selectionChangeDeboucing),this._selectionChangeDeboucing=window.setTimeout((async()=>{(r||!e||await this.handleExecuteProceedAutosave())&&this.processBuildSelectionChangeCallback(t)}),0))}async handleExecuteProceedAutosave(){return!this._gridShowDom||await this._editionManager.proceedAutoSave()}processBuildSelectionChangeCallback(t){this._dataUnit?this.handleBuildSelectionChangeWithDU(t.context.selectionChangeQuietly):this.buildSelectionChangeCallback(this._gridOptions.api.getSelectedRows())}handleBuildSelectionChangeWithDU(t){t?this.buildSelectionChangeCallback(this._dataUnit.records):this._dataUnit.updatePageSelection(this._gridOptions.api.getSelectedRows().map((t=>t.__record__id__))).then((t=>this.buildSelectionChangeCallback(t.records)))}buildSelectionChangeCallback(t){this._selectionChangeCallback({selection:t,selectionHeaderStatus:this.getSelectionHeaderStatus()})}onRowDoubleClick(t){var i,n;!this._doubleClickCallBack||this._options.enableGridInsert&&this._dataUnit.hasNewRecord()||(null===(n=null===(i=this._gridOptions)||void 0===i?void 0:i.api)||void 0===n||n.stopEditing(),this._doubleClickCallBack(t.data))}conditionalSet(t,i,n){null!=n&&!1!==n&&(t[i]=n)}processEditionCanceled(){this.clearInvalidCells(!0),this._gridShowDom&&this._dataUnit.clearSelection()}setCellEditors(t){var i,n,e,r,o;if(!this._editionManager)return void(this._customEditors=t);const s=null===(n=null===(i=this._gridOptions)||void 0===i?void 0:i.api)||void 0===n?void 0:n.getEditingCells();this._editionManager.setCellEditors(t),(null==s?void 0:s.length)>0&&this._gridOptions.api.startEditingCell({colKey:null===(r=null===(e=s[0])||void 0===e?void 0:e.column)||void 0===r?void 0:r.getColId(),rowIndex:null===(o=s[0])||void 0===o?void 0:o.rowIndex})}setCellRenders(t){var i,n,e,r,o,s;if(!this._editionManager)return void(this._customRenders=t);this._editionManager.setCellRenders(t);const u=null===(n=null===(i=this._gridOptions)||void 0===i?void 0:i.api)||void 0===n?void 0:n.getEditingCells();null===(e=this._gridOptions)||void 0===e||e.api.redrawRows(),(null==u?void 0:u.length)>0&&this._gridOptions.api.startEditingCell({colKey:null===(o=null===(r=u[0])||void 0===r?void 0:r.column)||void 0===o?void 0:o.getColId(),rowIndex:null===(s=u[0])||void 0===s?void 0:s.rowIndex})}clearInvalidCells(t){this._editionManager&&(this._editionManager.clearInvalidCells(t),this._gridOptions.api.refreshCells({force:!0}))}processContinuousInsert(){this._editionManager.processContinuousInsert()}destroy(){var t;this.observer.disconnect(),null===(t=this._dataSource)||void 0===t||t.destroy()}registryListeners(){var t;null===(t=this._dataSource)||void 0===t||t.registryListeners()}resetPaginationState(){var t,i;null===(i=null===(t=this._gridOptions)||void 0===t?void 0:t.api)||void 0===i||i.clearRangeSelection()}stopEdit(){this._gridOptions.api.stopEditing()}getColumnWidth(t){var i,n,e,r,o,s;if(null==t)return;if(null!=t.customWidth)return t.customWidth;if(null!=t.width&&!isNaN(t.width)){const i=parseInt(t.width);if(i>0)return i+this.DEFAULT_FONT_SIZE_HTML5}const u=null===(i=this._dataUnit)||void 0===i?void 0:i.getField(t.name),c=null!==(n=null==u?void 0:u.label)&&void 0!==n?n:null===(s=null===(o=null===(r=null===(e=this._gridOptions)||void 0===e?void 0:e.columnApi)||void 0===r?void 0:r.getColumn(t.name))||void 0===o?void 0:o.getColDef())||void 0===s?void 0:s.headerName;return(null==u?void 0:u.userInterface)===h.SEARCH?this.DEFAULT_MAX_SIZE:this.getColumnWidthByLabel(c)}getColumnWidthByLabel(t){const i=((null==t?void 0:t.length)||0)*this.DEFAULT_FONT_SIZE+this.DEFAULT_ICON_SIZE;return i>this.DEFAULT_MAX_SIZE?this.DEFAULT_MAX_SIZE:i}getCodeColFromDescriptionCol(t){var i;const n=this._gridOptions.columnApi.getColumn(t),e=null==n?void 0:n.getColDef();return null===(i=null==e?void 0:e.headerComponentParams)||void 0===i?void 0:i.presentationFrom}}function Iw(t){return void 0!==t}function Ew(t,i,n){const e=x();return t?e("utils.selectAllPage"):void 0===n?e("utils.loadingAllRecords",{count:i}):e("utils.selectAllRecords",{total:n})}function Tw(t){return Iw(t)?"":x()("utils.waitForLoad")}function zw(t,i){const n=x();return i?n("utils.allRecordsSelected",{selectionCount:t}):n("utils.selectedRecords",{selectionCount:t,plural:t>1?"s":""})}const Nw=i=>{const{selectionCount:n,currentPageSelected:e,allRecordSelected:r,paginationInfo:o,canSelectAll:s,onSelectAll:u,onSelectPage:h,onClearAll:c,onClose:a,i18n:l}=i,{total:f,hasMore:d,count:v}=o||{};return t("div",Object.assign({class:"ez-box ez-box--shadow-small"},Lw("ezGridSelectionCounter")),t("div",{class:"ez-flex ez-flex--align-items-center ez-size-width--full ez-padding-horizontal--medium"},t("div",{class:"ez-flex ez-flex--wrap ez-flex--align-items-baseline ez-flex--justify-center"},t("label",Object.assign({innerHTML:zw(n,r),class:"ez-text ez-text--primary ez-text--medium ez-margin-right--medium ez-margin-top--medium"},Lw("ezGridSelectionCounter_label"))),t("div",{class:"ez-flex ez-margin-right--medium"},!(!r&&n===f||r&&!d)&&(void 0!==s?s:!!o&&(e||r))&&t("ez-button",Object.assign({key:"selectAllRecordsEzButton",title:Tw(f),enabled:Iw(f),class:"ez-margin-right--medium",label:Ew(r,v,f),mode:"link",onClick:r?h:u},Lw("ezGridSelectionCounter_select"+(r?"Page":"All")))),t("ez-button",Object.assign({key:"clearAllSelectionEzButton",class:"grid__btn-clear",label:l("ez-grid.clearSelection"),mode:"link",onClick:c},Lw("ezGridSelectionCounter_clearAll"))))),t("button",Object.assign({class:"grid__btn-close",title:l("app.close"),onClick:a},Lw("ezGridSelectionCounter_close")),t("ez-icon",{iconName:"close"}))))};function Lw(t){return{[b.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:b.getInternalIDInfo(t)}}class Bw{static getColumnFilters(t,i){return w.getColumnFilters(t,i)}static getFilterFunction(t,i){return w.getFilterFunction(t,i)}static compileDistinct(t,i){return w.compileDistinct(t,i)}static compileDistinctFromArray(t,i,n){return w.compileDistinctFromArray(t,i,n)}}class Hw{constructor(t){this.lastAppliedFilters=[],this.FILTER_COLUMN_TERM="FILTRO_COLUNA_",this.onDataUnitAction=t=>{var i,n;if(t.type===o.DATA_SAVED||t.type===o.RECORDS_REMOVED)return void(this.originalRecords=this.dataUnit.records);if(t.type!==o.DATA_LOADED)return;const e=this.getAppliedFilterNames(null!==(n=null===(i=t.payload)||void 0===i?void 0:i.filters)&&void 0!==n?n:[]);this.originalRecords&&u.equals(e,this.lastAppliedFilters)||(this.originalRecords=t.payload.records,this.lastAppliedFilters=e)},this.dataUnit=t,this.dataUnit.records.length>0&&(this.originalRecords=this.dataUnit.records),this.dataUnit.subscribe(this.onDataUnitAction)}refresh(){this.originalRecords=this.dataUnit.records}getAppliedFilterNames(t){return t.map((t=>t.name)).filter((t=>!t.includes(this.FILTER_COLUMN_TERM)))}getStaticOptions(t){return Promise.resolve(Bw.compileDistinctFromArray(t,this.dataUnit,this.originalRecords))}fetchData(t,i){return new Promise((n=>{const e=this.originalRecords.filter((n=>this.includesSearchTerm(n,i,t))).map((t=>this.buildFieldOption(t,i)));n(this.removeDuplicatedOptions(e))}))}sortItems(t,i){return Hw.defaultSorterMultSelectionOption(this.dataUnit,t,i)}buildFieldOption(t,i){return{value:this.buildValue(t,i),label:this.formatLabel(i,t[i]),check:!0}}buildValue(t,i){var n;let e=t[i];return(null===(n=this.dataUnit.getField(i))||void 0===n?void 0:n.dataType)===v.OBJECT&&(e=e.value),null==e?void 0:e.toString()}removeDuplicatedOptions(t){const i=[];return t.forEach((t=>{i.find((({label:i})=>i===t.label))||i.push(t)})),i}includesSearchTerm(t,i,n){return this.buildLabel(i,t[i]).toLowerCase().includes(n.toLowerCase())}buildLabel(t,i){var n;const{dataType:e}=this.dataUnit.getField(t);return e===v.NUMBER?null==i?void 0:i.toString().replace(".",","):e===v.DATE?"object"==typeof i?null===(n=y.formatDate(this.dataUnit.valueFromString(t,i)))||void 0===n?void 0:n.toString():null==i?void 0:i.toString():e===v.OBJECT?`${null==i?void 0:i.value} - ${null==i?void 0:i.label}`:null==i?void 0:i.toString()}formatLabel(t,i){var n,e;const{userInterface:r,dataType:o}=this.dataUnit.getField(t);return o===v.DATE?"object"==typeof i?y.formatDate(this.dataUnit.valueFromString(t,i)):null==i?void 0:i.toString():o===v.NUMBER&&r!==h.DECIMALNUMBER?null===(n=parseInt(this.dataUnit.getFormattedValue(t,i)))||void 0===n?void 0:n.toString():null===(e=this.dataUnit.getFormattedValue(t,i))||void 0===e?void 0:e.toString()}static defaultSorterMultSelectionOption(t,i,n){const e=t.getField(i);return null==e?C.sortAlphabetically(n):n.sort(((t,i)=>S.compareValues(e,t.value,i.value)))}}const Ww=window,Vw=class{constructor(t){i(this,t),this.ezColumnStateChange=n(this,"ezColumnStateChange",7),this.ezPageChangedChanged=n(this,"ezPageChangedChanged",7),this.ezColumnFilterChanged=n(this,"ezColumnFilterChanged",7),this.ezSelectionChange=n(this,"ezSelectionChange",7),this.ezDoubleClick=n(this,"ezDoubleClick",7),this.configChange=n(this,"configChange",7),this.componentReady=n(this,"componentReady",7),this._gridController=new Dw(!1),this._customEditor=new Map,this._customRenders=new Map,this._paginationInfo=void 0,this._paginationChangedByKeyboard=!0,this._showSelectionCounter=!1,this._isAllSelection=!1,this._currentPageSelected=void 0,this._selectionCount=void 0,this._hasLeftButtons=!1,this._customFormatters=new Map,this.enableLockManagerLoadingComp=!1,this.enableLockManagerTaskbarClick=!0,this.multipleSelection=void 0,this.config=void 0,this.selectionToastConfig=void 0,this.serverUrl=void 0,this.dataUnit=void 0,this.statusResolver=void 0,this.columnfilterDataSource=void 0,this.useEnterLikeTab=!1,this.recordsValidator=void 0,this.canEdit=!0,this.autoFocus=!0,this.paginationCounterMode="auto",this.enableGridInsert=!1,this.enableContinuousInsert=!0,this.suppressCheckboxColumn=!1,this.suppressFilterColumn=!1,this.outlineMode=!1,this.enableRowTableStriped=!0,this.compact=!1,this.useSearchColumn=!0,this.suppressHorizontalScroll=!1,this.mode="complete"}async setColumnsDef(t){this._gridController.setColumnsDef(t)}async getAppliedColumnFilters(){var t;return null!==(t=this._gridController.getFilter())&&void 0!==t?t:[]}async refreshColumnFilterDataSource(){var t,i;this.columnfilterDataSource&&(null===(i=(t=this.columnfilterDataSource).refresh)||void 0===i||i.call(t))}async addColumnMenuItem(t,i,n,e){this._gridController.addColumnMenuItem({label:t,name:i,action:n,icon:e})}async setColumnsState(t){this._gridController.setColumnsState(t)}async setData(t){this._gridController.setData(t)}async getSelection(){return Promise.resolve(this._gridController.getSelection())}async getColumnsState(){return Promise.resolve(this._gridController.getColumnsState())}async getColumns(){return Promise.resolve(this._gridController.getColumnsDef())}async quickFilter(t){this._gridController.quickFilter(t)}async locateColumn(t){this._gridController.locateColumn(t,this._element)}async filterColumns(t){return Promise.resolve(this._gridController.getColumnsState().filter((i=>((t,i)=>{const n=l.replaceAccentuatedCharsLower(null==t?void 0:t.toLocaleLowerCase()),e=l.replaceAccentuatedCharsLower(i.toLocaleLowerCase());return null==n?void 0:n.includes(e)})(i.label,t))))}async addCustomEditor(t,i,n){const e=new Map(this._customEditor);e.set(t,{customEditor:i,detailContext:n}),this._customEditor=e,this._gridController.setCellEditors(e)}async addGridCustomRender(t,i,n){const e=new Map(this._customRenders);e.set(t,{customRender:i,detailContext:n}),this._customRenders=e,this._gridController.setCellRenders(e)}async addCustomValueFormatter(t,i){if(!t||!i)return;const n=new Map(this._customFormatters);n.set(t,i),this._customFormatters=n,this._gridController.setCustomFormatters(n)}async removeCustomValueFormatter(t){if(!t)return;const i=new Map(this._customFormatters);i.delete(t),this._customFormatters=i,this._gridController.setCustomFormatters(i)}async refreshSelectedRows(){this._gridController.refreshSelectedRows()}async getCustomValueFormatter(t){return this._customFormatters.get(t)}async setFocus(){this._gridController.setFocus()}async stopEdit(){this._gridController.stopEdit()}async checkStopEditOutsideClick(t){var i;(null===(i=this._container)||void 0===i?void 0:i.contains(t.target))||this._gridController.stopEdit()}observeConfig(t){this._gridController.setColumnsState(null==t?void 0:t.columns)}updatePaginationTooltip(){this.handleShowCancelPagination(),this._refPaginationLabelTooltip&&this._refPaginationLabelTooltip.getAttribute("data-tooltip")&&this._refPaginationLabelTooltip.setAttribute("data-tooltip",this._getPaginationTooltip())}observePaginationCounterMode(t){"hidden"===t&&this._hidePaginationDescription(),"show"===t&&this._showPaginationDescription()}async observeModeChange(t=this.mode){"simple"===t&&(this.canEdit=!1,this.multipleSelection=!1,this.suppressCheckboxColumn=!0,this.compact=!0)}async handleApplyFilterColumn(){const t=this._gridController.getFilter();this.ezColumnFilterChanged.emit(null!=t?t:[])}onSelectionChange(t){this._currentPageSelected=!0===t.detail.selectionHeaderStatus,this.dataUnit&&this.setSelection(this.dataUnit.getSelectionInfo())}async handleClick(t){this.checkStopEditOutsideClick(t)}setSelection(t){var i;this._selectionCount=null!==(i=null==t?void 0:t.length)&&void 0!==i?i:0,this._isAllSelection=null==t?void 0:t.isAllRecords(),this._showSelectionCounter=this._selectionCount>1||this._isAllSelection}onSelectAllRecords(){var t;null===(t=this.dataUnit)||void 0===t||t.setSelection(_.ALL_RECORDS).then((t=>this.setSelection(t)))}onSelectPageRecords(){var t;null===(t=this.dataUnit)||void 0===t||t.setSelection(this.dataUnit.records.map((t=>t.__record__id__))).then((t=>this.setSelection(t)))}onClearSelectedRecords(){var t;null===(t=this.dataUnit)||void 0===t||t.clearSelection(),this._gridController.clearRangeSelection(),this.setSelection(void 0)}createConfigFromState(t){let i={columns:[]};return t.forEach((t=>{if(!t.hidden){let n={name:t.name};t.width&&(n.width=t.width),t.sort?(n.ascending="ASC"===t.sort.toUpperCase(),n.orderIndex=t.sortIndex):n.orderIndex=0,n&&i.columns.push(n)}})),i}positionSelectionCounter(){var t,i;if(!this._gridSelectionCounter)return;if(!this._showSelectionCounter)return void(this._gridSelectionCounter.style.bottom="");const n=null===(t=this._container)||void 0===t?void 0:t.getBoundingClientRect(),e=null===(i=this._gridSelectionCounter)||void 0===i?void 0:i.getBoundingClientRect();n&&e&&(this._gridSelectionCounter.style.bottom=document.body.clientHeight-(n.bottom-30)+"px",this._gridSelectionCounter.style.left=this.calculatePositionLeft(n,e))}calculatePositionLeft(t,i){let n=t.left+t.width/2;const e=t.left+this._container.clientWidth;return n-i.width/2+i.width>e&&(n=e-i.width/2),`${n}px`}setEvents(){window.removeEventListener("scroll",this.positionSelectionCounter.bind(this)),window.addEventListener("scroll",this.positionSelectionCounter.bind(this))}resizeSelectionCounter(){null!=this._gridSelectionCounter&&(this._gridSelectionCounter.style.width="",this._gridSelectionCounter.clientHeight>42&&(this._gridSelectionCounter.style.width="min-content"),this.positionSelectionCounter())}configSelectionCounter(){null!=this._element&&(null!=this._resizeObserver&&this._resizeObserver.unobserve(this._element),this._resizeObserver=new ResizeObserver(R.debounce(this.resizeSelectionCounter.bind(this),200)),this._resizeObserver.observe(this._element),this.resizeSelectionCounter())}onColumnStateChange(t,i,n){var e;if(this.ezColumnStateChange.emit({type:t,state:i,isUserChange:n.isUserChange}),n.isUserChange)if("columnMovedEnd"!==t||n.isElementResize){if("columnResize"===t&&(null===(e=n.column)||void 0===e?void 0:e.colId)){let t;t=this.config?Object.assign({},this.config):this.createConfigFromState(i);let e=t.columns.find((t=>t.name===n.column.colId));e&&(e.customWidth=n.column.actualWidth,this.configChange.emit(t))}}else{let t;this.config?(t={columns:[]},i.forEach((i=>{let n=this.config.columns.find((t=>t.name===i.name));n&&(n.width=i.width,t.columns.push(n))}))):t=this.createConfigFromState(i),t.columns.length>0&&this.configChange.emit(t)}}buildDataElementId(){b.addIDInfo(this._element,null,{dataUnit:this.dataUnit}),this._refPaginationControl&&b.addIDInfo(this._refPaginationControl,"pagination",{id:"ezGrid"})}handlePageChange(){this.resetPaginationState(),this._gridController.setFocusFirstRow(),this.ezPageChangedChanged.emit()}previousPage(){this.dataUnit&&this.dataUnit.previousPage().then((()=>this.handlePageChange()))}nextPage(){this.dataUnit&&this.dataUnit.nextPage().then((()=>this.handlePageChange()))}nextRecord(){if(this.dataUnit){if(0===this.dataUnit.getSelectionInfo().records.length)return void this.dataUnit.selectFirst();this.dataUnit.nextRecord()}}previousRecord(){this.dataUnit&&this.dataUnit.previousRecord()}resetPaginationState(){var t;this._paginationChangedByKeyboard=!1,null===(t=this._gridController)||void 0===t||t.resetPaginationState()}resolvePaginationClassMode(){return this.shouldPresentPaginationLabel()?"pagination-expanded":"pagination-contracted"}async handleCancelPagination(){var t;this.dataUnit.cancelPagination=!0,await(null===(t=this._cancelPaginationPopoverElement)||void 0===t?void 0:t.hide())}renderCancelPagination(){return t("ez-popover",{ref:t=>this._cancelPaginationPopoverElement=t,"overlay-type":"none",autoClose:!1},t("div",{class:"cancel-pagination"},t("ez-icon",{iconName:"sync",size:"x-large",class:"spin"}),t("span",{onClick:()=>this.handleCancelPagination(),class:"cancel-pagination-btn"},this.i18n("ez-grid.cancelPagination"))))}handleShowCancelPagination(){var t,i,n;this._hasToShowCancelPagination()?(null===(i=this._cancelPaginationPopoverElement)||void 0===i?void 0:i.opened)||null===(n=this._cancelPaginationPopoverElement)||void 0===n||n.show("15px"):null===(t=this._cancelPaginationPopoverElement)||void 0===t||t.hide()}getPaginationControl(){if(!this._paginationInfo)return null;const{currentPage:i,hasMore:n}=this._paginationInfo;return t("div",{class:`grid-header__container grid-header__pagination ${this.resolvePaginationClassMode()}`,ref:t=>this._refPaginationControl=t},this.renderCancelPagination(),t("div",{class:"ez-text ez-text--primary ez-text--medium ez-margin-right--medium",ref:t=>this._refPaginationLabel=t},t("span",{class:"grid-header__pagination-label"},this.shouldPresentPaginationLabel()&&t("strong",{class:"ez-text ez-text--primary ez-text--medium"},this._getActualPageLabel()),this.shouldPresentPaginationLabel()&&this._getRemainingPageLabel())),t("div",{id:"grid-pagination-tooltip",ref:t=>this._refPaginationLabelTooltip=t,class:"ez-flex ez-margin-right--medium",title:`${this._getActualPageLabel()} ${this._getRemainingPageLabel()}`},t("ez-button",{size:"small",class:"ez-margin-right--medium",iconName:"chevron-left",mode:"icon",enabled:i>0,onClick:()=>this.previousPage(),label:this.i18n("ez-grid.previousPage")}),t("ez-button",{size:"small",iconName:"chevron-right",mode:"icon",enabled:n,onClick:()=>this.nextPage(),label:this.i18n("ez-grid.nextPage")})))}shouldPresentPaginationLabel(){return"show"===this.paginationCounterMode||"auto"===this.paginationCounterMode}componentDidLoad(){const t=a.getContextValue("__SNK__APPLICATION__");this.enableLockManagerLoadingComp=!(t&&!(null==t?void 0:t.enableLockManagerLoadingApp))&&this.enableLockManagerLoadingComp,this._gridController.initDatagrid(this._container,{onColumnStateChange:(t,i,n)=>this.onColumnStateChange(t,i,n),onSelectionChange:t=>this.ezSelectionChange.emit(t),onPaginationChange:(t,i)=>{this.handlePaginationChange(i,t)},onPaginationUpdate:t=>{this._paginationInfo=t},onDoubleClick:t=>{this.ezDoubleClick.emit(t)},allowMultipleSelection:this.multipleSelection,serverURL:this.serverUrl,dataUnit:this.dataUnit,statusResolver:this.statusResolver,useEnterLikeTab:this.useEnterLikeTab,recordsValidator:this.recordsValidator,editionIsDisabled:()=>!this.canEdit,customFormatters:this._customFormatters,autoFocus:this.autoFocus,enableGridInsert:this.enableGridInsert,enableContinuousInsert:this.enableContinuousInsert,suppressFilterColumn:this.suppressFilterColumn,suppressCheckBoxCol:this.suppressCheckboxColumn,onRefresh:()=>{this.dataUnit&&this.setSelection(this.dataUnit.getSelectionInfo())},enableLockManagerTaskbarClick:this.enableLockManagerTaskbarClick,enableLockManagerLoadingComp:this.enableLockManagerLoadingComp,enableRowTableStriped:this.enableRowTableStriped,suppressHorizontalScroll:this.suppressHorizontalScroll,i18n:this.i18n}),this.config&&this.observeConfig(this.config),null!=this.dataUnit&&(this._paginationInfo=this.dataUnit.getPaginationInfo()),this.buildDataElementId(),this.setEvents(),this.componentReady.emit(),this._gridController.configFilterColumn(this._filterColumn),this.initKeyboardManager()}handlePaginationChange(t,i){var n;!1!==t&&this.autoFocus&&((null===(n=this._paginationInfo)||void 0===n?void 0:n.currentPage)>(null==i?void 0:i.currentPage)&&this._paginationChangedByKeyboard?this._gridController.setFocusLastRow():(this._gridController.setFocusFirstRow(),this._paginationChangedByKeyboard=!0)),this._paginationInfo=i}_getActualPageLabel(){const{firstRecord:t,lastRecord:i}=this._paginationInfo;return`${t}-${i}`}_getRemainingPageLabel(){const{total:t,count:i}=this._paginationInfo;return`${null==t?this.i18n("ez-grid.remainingPageLabel",{count:i+1}):this.i18n("ez-grid.remainingTotalLabel",{total:t})}`}_hasToShowCancelPagination(){var t;const{total:i,count:n}=null!==(t=this._paginationInfo)&&void 0!==t?t:{};return!this.dataUnit.cancelPagination&&void 0===i&&n>this.dataUnit.pageSize}_getPaginationTooltip(){return this._getActualPageLabel()+this._getRemainingPageLabel()}_initHeaderOverflowWatcher(){var t;null===(t=this._headerOverflowWatcher)||void 0===t||t.destroy(),this._refPaginationControl&&(this._headerOverflowWatcher=new O(this.buildOverFlowWatcherParams()))}buildOverFlowWatcherParams(){return{element:this._refPaginationControl,callback:this.handleOverFlow.bind(this),notOverFlow:["grid-pagination-tooltip"]}}handleOverFlow(){if(!this._refPaginationLabel||!this._refPaginationControl)return;const t=this._refPaginationControl.clientWidth,i=this._refPaginationLabel.scrollWidth,n=this._refPaginationControl.querySelector("#grid-pagination-tooltip"),e=i+((null==n?void 0:n.clientWidth)||0)+(this._getElementMargins(this._refPaginationLabel)+(n?this._getElementMargins(n):0));t>e+this._getPaginationDescriptionWidth()?this._showPaginationDescription():t<=e&&this._hidePaginationDescription()}_getPaginationDescriptionWidth(){var t;return(null===(t=this._refPaginationLabelTooltip)||void 0===t?void 0:t.scrollWidth)||0}_getElementMargins(t){const i=getComputedStyle(t);return parseFloat(i.marginLeft)+parseFloat(i.marginRight)}_hidePaginationDescription(){this._refPaginationLabel.classList.add(A),this._refPaginationLabelTooltip.setAttribute("data-flow","bottom"),this._refPaginationLabelTooltip.setAttribute("data-tooltip",this._getPaginationTooltip())}_showPaginationDescription(){this._refPaginationLabel.classList.remove(A),this._refPaginationLabelTooltip.removeAttribute("data-flow"),this._refPaginationLabelTooltip.removeAttribute("data-tooltip")}disconnectedCallback(){var t,i;null===(t=this._headerOverflowWatcher)||void 0===t||t.destroy(),null===(i=this._gridController)||void 0===i||i.destroy(),this.removeShortcuts()}connectedCallback(){var t;this.observeModeChange(),null===(t=this._gridController)||void 0===t||t.registryListeners()}componentWillRender(){this.configSelectionCounter()}componentDidRender(){Ww.addEventListener("onSubmitFilter",(()=>{G.info(this.i18n("ez-grid.filterAppliedSuccess"))}))}async componentWillLoad(){this.i18n=await M(),this._hasLeftButtons=!!this._element.querySelector('[slot="leftButtons"]'),this.dataUnit.name.includes("InMemoryDataUnit")}componentDidUpdate(){this._gridController.setAutoFocus(this.autoFocus),this._gridController.setEnableGridInsert(this.enableGridInsert),this._gridController.setEnableContinuousInsert(this.enableContinuousInsert),this.dataUnit&&this._showSelectionCounter&&this.setSelection(this.dataUnit.getSelectionInfo()),"auto"===this.paginationCounterMode&&this._initHeaderOverflowWatcher()}getDataSource(){return this.columnfilterDataSource||(this.columnfilterDataSource=new Hw(this.dataUnit)),this.columnfilterDataSource}hideHeader(){return"simple"===this.mode||!this._hasLeftButtons&&!this._paginationInfo}resolveLeftHeaderClass(){return"show"==this.paginationCounterMode?"left__header-expanded":"left__header-contracted"}async initKeyboardManager(){this._keyboardManager=new j({propagate:!1,element:this._element}),this._keyboardManager.bind("ctrl + .",(()=>{this._paginationInfo&&this.nextRecord()}),{description:this.i18n("ez-grid.nextRecord"),element:this._element}).bind("ctrl + ,",(()=>{this._paginationInfo&&this.previousRecord()}),{description:this.i18n("ez-grid.previousRecord"),element:this._element}).bind("ctrl + alt + ArrowLeft",(()=>{if(!this._paginationInfo)return;const{currentPage:t}=this._paginationInfo;t>0&&this.previousPage()}),{description:this.i18n("ez-grid.previousPage"),element:this._element}).bind("ctrl + alt + ArrowRight",(()=>{if(!this._paginationInfo)return;const{hasMore:t}=this._paginationInfo;t&&this.nextPage()}),{description:this.i18n("ez-grid.nextPage"),element:this._element}),this.useSearchColumn&&this._keyboardManager.bind(E,(async()=>{if(!this._container||!this._ezPopoverSearchColumn)return;const t=this._container.getBoundingClientRect();await T(this._columnSearch),this._ezPopoverSearchColumn.showUnder(this._container,{horizontalGap:t.width-z,verticalGap:-1*t.height})}),{description:this.i18n("ez-grid.searchColumn"),element:this._element})}async removeShortcuts(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}renderFieldSearchColumn(){return this._columnSearch=N({value:l.generateUUID(),label:this.i18n("ez-grid.labelSearchColumn")},(({argument:t})=>new Promise((i=>{this.filterColumns(t).then((t=>{i(t.filter((t=>!t.hidden)).map((t=>({label:t.label,value:t.name}))))}))}))),(async t=>{null!=t&&null!=t.value&&(await this.locateColumn(t.value),this._ezPopoverSearchColumn&&this._ezPopoverSearchColumn.hide(),this._container&&requestAnimationFrame((()=>this._container.focus())))})),this._columnSearch}render(){var i;return t(e,{"no-header":this.hideHeader()},t("div",{class:{"grid__container ez-grid":!0,"outline-mode":this.outlineMode,"shadow-mode":!this.outlineMode,"no-padding":this.compact,"header-overlay":!this.hideHeader(),"no-scroll":this.suppressHorizontalScroll},ref:t=>this._container=t,tabindex:"0"}),t("div",{class:{"ez-box ez-padding--small grid-header":!0,"outline-mode":this.outlineMode,"shadow-mode":!this.outlineMode&&!this.hideHeader()},tabindex:"0"},t("filter-column",{class:"grid-header__popover",noHeaderTaskBar:!this._hasLeftButtons,dataSource:this.getDataSource(),dataUnit:this.dataUnit,gridHeaderHidden:this.hideHeader(),ref:t=>this._filterColumn=t}),t("div",{class:"grid-header__position"},t("div",{class:`grid-header__container grid-header__left-container ${this.resolveLeftHeaderClass()}`},t("slot",{name:"leftButtons"})),this.getPaginationControl())),t("ez-popover",{ref:t=>this._ezPopoverSearchColumn=t,overlayType:"none"},this.renderFieldSearchColumn()),t("div",{ref:t=>this._gridSelectionCounter=t,class:`grid__selection-counter ez-elevation--4\n ${this._showSelectionCounter?"grid__selection-counter--opened":""}\n `},t(Nw,{selectionCount:this._selectionCount,currentPageSelected:this._currentPageSelected,paginationInfo:this._paginationInfo,canSelectAll:null===(i=this.selectionToastConfig)||void 0===i?void 0:i.canSelectAll,allRecordSelected:this._isAllSelection,i18n:this.i18n,onSelectAll:()=>this.onSelectAllRecords(),onSelectPage:()=>this.onSelectPageRecords(),onClearAll:()=>this.onClearSelectedRecords(),onClose:()=>this._showSelectionCounter=!1})),t("div",{class:"grid__footer"},t("slot",{name:"footer"})))}static get assetsDirs(){return["../assets"]}get _element(){return r(this)}static get watchers(){return{config:["observeConfig"],_paginationInfo:["updatePaginationTooltip"],paginationCounterMode:["observePaginationCounterMode"],mode:["observeModeChange"]}}};Vw.style=".sc-ez-grid-h{display:grid;grid-template-rows:auto 1fr auto;height:100%;width:100%;--ez-grid__header--background-color:var(--background--xlight, #FFF);--ez-grid__selection-counter--z-index:var(--visible, 1);--ez-grid__container--shadow:var(--shadow);--ez-grid--min-height:300px;--ez-grid__container--shadow--outline:var(--shadow--outline) var(--color--strokes);--ez-grid__header--shadow:var(--shadow--xsmall);--ez-grid__header--shadow--outline:var(--shadow--outline) var(--color--strokes);--ez-grid__header--outline:none;--ez-grid__header--border:none;min-height:var(--ez-grid--min-height)}.grid-header.sc-ez-grid{display:grid;justify-content:space-between;align-items:center;grid-row-start:1;grid-template-columns:1fr;background-color:var(--ez-grid__header--background-color, #FFF)}.grid-header.shadow-mode.sc-ez-grid{box-shadow:var(--ez-grid__header--shadow);border:var(--ez-grid__header--border);outline:var(--ez-grid__header--outline)}.grid-header.outline-mode.sc-ez-grid{box-shadow:var(--ez-grid__header--shadow--outline);border:var(--ez-grid__header--border);outline:var(--ez-grid__header--outline)}.header-overlay.sc-ez-grid{padding-top:15px;margin-top:-12px}.grid__container.sc-ez-grid{outline:none;box-shadow:var(--ez-grid__container--shadow);background-color:var(--ez-grid__header--background-color);border:var(--border--small) var(--color--strokes);border-radius:var(--border--radius-small)}.grid__container.no-scroll.sc-ez-grid{width:100vw}.sc-ez-grid-h:not([no-header]) .grid__container.sc-ez-grid{border:none}.grid__container.outline-mode.sc-ez-grid{box-shadow:var(--ez-grid__container--shadow--outline);border:none;outline:none}.grid-header__popover.sc-ez-grid{position:relative;top:var(--space--sm, 16px)}.grid-header__container.sc-ez-grid{display:flex;align-items:center;flex-grow:1;flex-shrink:1}.grid-header__position.sc-ez-grid{display:flex;align-items:center;justify-content:space-between}.grid__selection-counter.sc-ez-grid{position:fixed;white-space:nowrap;transform:translate(-50%, 0px);left:50%;opacity:0;bottom:-100%;transition:opacity 0.1s, bottom 0.5s}.grid__selection-counter--opened.sc-ez-grid{opacity:1;bottom:0px}.grid__btn-close.sc-ez-grid{display:flex;align-items:center;justify-content:center;padding:0;outline:none;width:20px;height:20px;border:none;background-color:unset;cursor:pointer}.grid__btn-clear.sc-ez-grid{--ez-button--link-color:var(--color--alert-warning-900, #8C6B00);--ez-button--link--hover-color:var(--color--alert-warning-900, #8C6B00)}[no-header].sc-ez-grid-h .grid-header.sc-ez-grid{height:0;padding:0}.grid-header__pagination.sc-ez-grid{justify-content:flex-end;flex-wrap:nowrap;flex-shrink:1;flex-grow:1}.grid-header__pagination-label.sc-ez-grid{width:100%;white-space:nowrap}.overflowed.sc-ez-grid{display:none}.pagination-contracted.sc-ez-grid{width:100px}.pagination-expanded.sc-ez-grid{min-width:150px}.left__header-contracted.sc-ez-grid{width:auto}.left__header-expanded.sc-ez-grid{flex-grow:1}.grid__footer.sc-ez-grid{background-color:var(--background--xlight, #FFF);border-radius:0 0 var(--border--radius-medium) var(--border--radius-medium);box-shadow:var(--shadow--small)}.cancel-pagination.sc-ez-grid{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:4px;padding:8px;width:180px}.cancel-pagination-btn.sc-ez-grid{color:var(--color--error);font-size:var(--text--medium);font-weight:var(--text-weight--large);font-family:var(--font-pattern, Roboto);text-wrap:nowrap;cursor:pointer}.spin.sc-ez-grid{animation-name:spin;animation-duration:5000ms;animation-iteration-count:infinite;animation-timing-function:linear}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}";export{Vw as ez_grid}