@easyquery/ui 7.2.5-beta01 → 7.2.5-rc01

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 (280) hide show
  1. package/dist/easyquery.ui.cjs.js +14443 -0
  2. package/dist/easyquery.ui.esm.js +14383 -0
  3. package/dist/types/i18n/text_resources.d.ts +1 -0
  4. package/dist/{lib → types}/views/view.d.ts +3 -1
  5. package/dist/{lib → types}/widgets/query_panel.d.ts +2 -1
  6. package/dist/{lib → types}/widgets/renderers/querypanel/subquery_expression_renderer.d.ts +2 -4
  7. package/package.json +16 -54
  8. package/api-eq-community.js +0 -15
  9. package/dist/assets/css/aggr-settings.css +0 -242
  10. package/dist/assets/css/easychart.css +0 -73
  11. package/dist/assets/css/easyfacets.css +0 -280
  12. package/dist/assets/css/easyquery-mobile.css +0 -267
  13. package/dist/assets/css/easyquery.css +0 -1712
  14. package/dist/assets/css/eq-icons-default.css +0 -140
  15. package/dist/assets/css/eq-icons-files.css +0 -138
  16. package/dist/assets/css/eqview.css +0 -596
  17. package/dist/assets/css/images/ExportCSV.png +0 -0
  18. package/dist/assets/css/images/ExportExel.png +0 -0
  19. package/dist/assets/css/images/aggr_settings_cancel.png +0 -0
  20. package/dist/assets/css/images/aggr_settings_func.png +0 -0
  21. package/dist/assets/css/images/aggr_settings_group.png +0 -0
  22. package/dist/assets/css/images/ajax-loader.gif +0 -0
  23. package/dist/assets/css/images/chart-settings.png +0 -0
  24. package/dist/assets/css/images/checkbox_checked.png +0 -0
  25. package/dist/assets/css/images/checkbox_unchecked.png +0 -0
  26. package/dist/assets/css/images/clearButton.png +0 -0
  27. package/dist/assets/css/images/colbtn-aggrfunc.png +0 -0
  28. package/dist/assets/css/images/condbtn-addcondition.png +0 -0
  29. package/dist/assets/css/images/condbtn-addpredicate.png +0 -0
  30. package/dist/assets/css/images/condbtn-delete.png +0 -0
  31. package/dist/assets/css/images/condbtn-disabled.png +0 -0
  32. package/dist/assets/css/images/condbtn-enabled.png +0 -0
  33. package/dist/assets/css/images/condbtn-menu.png +0 -0
  34. package/dist/assets/css/images/condbtn-param.png +0 -0
  35. package/dist/assets/css/images/eqjs-ep-add-columns-hover.png +0 -0
  36. package/dist/assets/css/images/eqjs-ep-add-columns.png +0 -0
  37. package/dist/assets/css/images/eqjs-ep-add-cond-hover.png +0 -0
  38. package/dist/assets/css/images/eqjs-ep-add-cond.png +0 -0
  39. package/dist/assets/css/images/eqjs-ep-deselect-all-hover.png +0 -0
  40. package/dist/assets/css/images/eqjs-ep-deselect-all.png +0 -0
  41. package/dist/assets/css/images/eqjs-ep-select-all-hover.png +0 -0
  42. package/dist/assets/css/images/eqjs-ep-select-all.png +0 -0
  43. package/dist/assets/css/images/eqjs-fb-header-icon.png +0 -0
  44. package/dist/assets/css/images/execute.png +0 -0
  45. package/dist/assets/css/images/loadButton.png +0 -0
  46. package/dist/assets/css/images/logo.png +0 -0
  47. package/dist/assets/css/images/node-close.png +0 -0
  48. package/dist/assets/css/images/node-open.png +0 -0
  49. package/dist/assets/css/images/saveButton.png +0 -0
  50. package/dist/assets/css/images/sorting_asc.png +0 -0
  51. package/dist/assets/css/images/sorting_desc.png +0 -0
  52. package/dist/assets/css/images/sorting_none.png +0 -0
  53. package/dist/assets/css/images/ve-loader.gif +0 -0
  54. package/dist/browser/eq.community.css.map +0 -1
  55. package/dist/browser/eq.community.js +0 -34654
  56. package/dist/browser/eq.community.js.map +0 -1
  57. package/dist/browser/eq.community.min.js +0 -2
  58. package/dist/browser/eq.community.min.js.LICENSE.txt +0 -11
  59. package/dist/browser/eq.community.min.js.map +0 -1
  60. package/dist/browser/eq.core.css +0 -4564
  61. package/dist/browser/eq.core.min.css +0 -3
  62. package/dist/browser/eq.view.css +0 -607
  63. package/dist/browser/eq.view.css.map +0 -1
  64. package/dist/browser/eq.view.min.css +0 -1
  65. package/dist/bundles/easyquery.ui.js +0 -23077
  66. package/dist/bundles/easyquery.ui.js.map +0 -1
  67. package/dist/bundles/easyquery.ui.min.js +0 -3
  68. package/dist/bundles/easyquery.ui.min.js.LICENSE.txt +0 -3
  69. package/dist/bundles/easyquery.ui.min.js.map +0 -1
  70. package/dist/lib/dialog/aggr_settings_dialog.js +0 -107
  71. package/dist/lib/dialog/aggr_settings_dialog.js.map +0 -1
  72. package/dist/lib/dialog/export_dialog.js +0 -64
  73. package/dist/lib/dialog/export_dialog.js.map +0 -1
  74. package/dist/lib/extensions.d.ts +0 -7
  75. package/dist/lib/extensions.js +0 -14
  76. package/dist/lib/extensions.js.map +0 -1
  77. package/dist/lib/facets/chart_facet.js +0 -241
  78. package/dist/lib/facets/chart_facet.js.map +0 -1
  79. package/dist/lib/facets/datatable_facet.js +0 -72
  80. package/dist/lib/facets/datatable_facet.js.map +0 -1
  81. package/dist/lib/facets/pivot_table_facet.js +0 -699
  82. package/dist/lib/facets/pivot_table_facet.js.map +0 -1
  83. package/dist/lib/facets/result_facet.js +0 -247
  84. package/dist/lib/facets/result_facet.js.map +0 -1
  85. package/dist/lib/i18n/text_resources.js +0 -261
  86. package/dist/lib/i18n/text_resources.js.map +0 -1
  87. package/dist/lib/public_api.js +0 -93
  88. package/dist/lib/public_api.js.map +0 -1
  89. package/dist/lib/types/facet_type.js +0 -7
  90. package/dist/lib/types/facet_type.js.map +0 -1
  91. package/dist/lib/types/qp_editable_part.js +0 -17
  92. package/dist/lib/types/qp_editable_part.js.map +0 -1
  93. package/dist/lib/utils/browser_utils.js +0 -59
  94. package/dist/lib/utils/browser_utils.js.map +0 -1
  95. package/dist/lib/utils/display_format_parser.js +0 -62
  96. package/dist/lib/utils/display_format_parser.js.map +0 -1
  97. package/dist/lib/utils/dropdown.js +0 -58
  98. package/dist/lib/utils/dropdown.js.map +0 -1
  99. package/dist/lib/utils/popup_menu.js +0 -1260
  100. package/dist/lib/utils/popup_menu.js.map +0 -1
  101. package/dist/lib/utils/utils.js +0 -47
  102. package/dist/lib/utils/utils.js.map +0 -1
  103. package/dist/lib/views/adv_search_view.js +0 -713
  104. package/dist/lib/views/adv_search_view.js.map +0 -1
  105. package/dist/lib/views/data_filter_view.js +0 -80
  106. package/dist/lib/views/data_filter_view.js.map +0 -1
  107. package/dist/lib/views/html_data_filter_view.js +0 -45
  108. package/dist/lib/views/html_data_filter_view.js.map +0 -1
  109. package/dist/lib/views/report_view.js +0 -733
  110. package/dist/lib/views/report_view.js.map +0 -1
  111. package/dist/lib/views/view.js +0 -534
  112. package/dist/lib/views/view.js.map +0 -1
  113. package/dist/lib/views/view_options.js +0 -2
  114. package/dist/lib/views/view_options.js.map +0 -1
  115. package/dist/lib/widgets/aggregation_bar.js +0 -146
  116. package/dist/lib/widgets/aggregation_bar.js.map +0 -1
  117. package/dist/lib/widgets/charts/chart_type.js +0 -16
  118. package/dist/lib/widgets/charts/chart_type.js.map +0 -1
  119. package/dist/lib/widgets/charts/chart_widget.js +0 -385
  120. package/dist/lib/widgets/charts/chart_widget.js.map +0 -1
  121. package/dist/lib/widgets/charts/chart_widget_chartjs.js +0 -187
  122. package/dist/lib/widgets/charts/chart_widget_chartjs.js.map +0 -1
  123. package/dist/lib/widgets/charts/chart_widget_google.js +0 -166
  124. package/dist/lib/widgets/charts/chart_widget_google.js.map +0 -1
  125. package/dist/lib/widgets/columns_bar.js +0 -687
  126. package/dist/lib/widgets/columns_bar.js.map +0 -1
  127. package/dist/lib/widgets/columns_panel.js +0 -721
  128. package/dist/lib/widgets/columns_panel.js.map +0 -1
  129. package/dist/lib/widgets/easy_grid_widget.js +0 -169
  130. package/dist/lib/widgets/easy_grid_widget.js.map +0 -1
  131. package/dist/lib/widgets/entities_panel.js +0 -623
  132. package/dist/lib/widgets/entities_panel.js.map +0 -1
  133. package/dist/lib/widgets/eq_result_html_grid.js +0 -186
  134. package/dist/lib/widgets/eq_result_html_grid.js.map +0 -1
  135. package/dist/lib/widgets/export_widget.js +0 -58
  136. package/dist/lib/widgets/export_widget.js.map +0 -1
  137. package/dist/lib/widgets/facet_container.js +0 -54
  138. package/dist/lib/widgets/facet_container.js.map +0 -1
  139. package/dist/lib/widgets/filter_bar.js +0 -260
  140. package/dist/lib/widgets/filter_bar.js.map +0 -1
  141. package/dist/lib/widgets/grid.js +0 -80
  142. package/dist/lib/widgets/grid.js.map +0 -1
  143. package/dist/lib/widgets/html_content_widget.js +0 -72
  144. package/dist/lib/widgets/html_content_widget.js.map +0 -1
  145. package/dist/lib/widgets/locale_widget.js +0 -80
  146. package/dist/lib/widgets/locale_widget.js.map +0 -1
  147. package/dist/lib/widgets/manage_drilldown_widget.js +0 -156
  148. package/dist/lib/widgets/manage_drilldown_widget.js.map +0 -1
  149. package/dist/lib/widgets/process_widget.js +0 -51
  150. package/dist/lib/widgets/process_widget.js.map +0 -1
  151. package/dist/lib/widgets/query_panel.js +0 -676
  152. package/dist/lib/widgets/query_panel.js.map +0 -1
  153. package/dist/lib/widgets/queryname_widget.js +0 -119
  154. package/dist/lib/widgets/queryname_widget.js.map +0 -1
  155. package/dist/lib/widgets/renderers/aggr_settings/aggr_settings_renderer.js +0 -430
  156. package/dist/lib/widgets/renderers/aggr_settings/aggr_settings_renderer.js.map +0 -1
  157. package/dist/lib/widgets/renderers/base_element_renderer.js +0 -64
  158. package/dist/lib/widgets/renderers/base_element_renderer.js.map +0 -1
  159. package/dist/lib/widgets/renderers/columnsbar/aggrfunc_column_renderer_cb.js +0 -50
  160. package/dist/lib/widgets/renderers/columnsbar/aggrfunc_column_renderer_cb.js.map +0 -1
  161. package/dist/lib/widgets/renderers/columnsbar/attr_column_renderer_cb.js +0 -86
  162. package/dist/lib/widgets/renderers/columnsbar/attr_column_renderer_cb.js.map +0 -1
  163. package/dist/lib/widgets/renderers/columnsbar/column_renderer_cb.js +0 -532
  164. package/dist/lib/widgets/renderers/columnsbar/column_renderer_cb.js.map +0 -1
  165. package/dist/lib/widgets/renderers/columnsbar/editable_column_renderer_cb.js +0 -102
  166. package/dist/lib/widgets/renderers/columnsbar/editable_column_renderer_cb.js.map +0 -1
  167. package/dist/lib/widgets/renderers/columnspanel/aggrfunc_column_renderer_cp.js +0 -173
  168. package/dist/lib/widgets/renderers/columnspanel/aggrfunc_column_renderer_cp.js.map +0 -1
  169. package/dist/lib/widgets/renderers/columnspanel/attr_column_renderer_cp.js +0 -193
  170. package/dist/lib/widgets/renderers/columnspanel/attr_column_renderer_cp.js.map +0 -1
  171. package/dist/lib/widgets/renderers/columnspanel/column_renderer_cp.js +0 -811
  172. package/dist/lib/widgets/renderers/columnspanel/column_renderer_cp.js.map +0 -1
  173. package/dist/lib/widgets/renderers/columnspanel/editable_column_renderer_cp.js +0 -277
  174. package/dist/lib/widgets/renderers/columnspanel/editable_column_renderer_cp.js.map +0 -1
  175. package/dist/lib/widgets/renderers/dropdown_renderer.js +0 -43
  176. package/dist/lib/widgets/renderers/dropdown_renderer.js.map +0 -1
  177. package/dist/lib/widgets/renderers/querypanel/addrow_renderer.js +0 -88
  178. package/dist/lib/widgets/renderers/querypanel/addrow_renderer.js.map +0 -1
  179. package/dist/lib/widgets/renderers/querypanel/attribute_expression_renderer.js +0 -72
  180. package/dist/lib/widgets/renderers/querypanel/attribute_expression_renderer.js.map +0 -1
  181. package/dist/lib/widgets/renderers/querypanel/bind_to_parent_column_expression_renderer.js +0 -42
  182. package/dist/lib/widgets/renderers/querypanel/bind_to_parent_column_expression_renderer.js.map +0 -1
  183. package/dist/lib/widgets/renderers/querypanel/condition_group_renderer.js +0 -232
  184. package/dist/lib/widgets/renderers/querypanel/condition_group_renderer.js.map +0 -1
  185. package/dist/lib/widgets/renderers/querypanel/condition_renderer.js +0 -510
  186. package/dist/lib/widgets/renderers/querypanel/condition_renderer.js.map +0 -1
  187. package/dist/lib/widgets/renderers/querypanel/datetime_expression_render.js +0 -109
  188. package/dist/lib/widgets/renderers/querypanel/datetime_expression_render.js.map +0 -1
  189. package/dist/lib/widgets/renderers/querypanel/expression_renderer.js +0 -92
  190. package/dist/lib/widgets/renderers/querypanel/expression_renderer.js.map +0 -1
  191. package/dist/lib/widgets/renderers/querypanel/input_expression_renderer.js +0 -166
  192. package/dist/lib/widgets/renderers/querypanel/input_expression_renderer.js.map +0 -1
  193. package/dist/lib/widgets/renderers/querypanel/list_expression_renderer.js +0 -318
  194. package/dist/lib/widgets/renderers/querypanel/list_expression_renderer.js.map +0 -1
  195. package/dist/lib/widgets/renderers/querypanel/operator_renderer.js +0 -96
  196. package/dist/lib/widgets/renderers/querypanel/operator_renderer.js.map +0 -1
  197. package/dist/lib/widgets/renderers/querypanel/subquery_expression_renderer.js +0 -238
  198. package/dist/lib/widgets/renderers/querypanel/subquery_expression_renderer.js.map +0 -1
  199. package/dist/lib/widgets/renderers/querypanel/text_renderer.js +0 -37
  200. package/dist/lib/widgets/renderers/querypanel/text_renderer.js.map +0 -1
  201. package/dist/lib/widgets/renderers/sortingbar/column_renderer_sb.js +0 -173
  202. package/dist/lib/widgets/renderers/sortingbar/column_renderer_sb.js.map +0 -1
  203. package/dist/lib/widgets/result_facets_panel.js +0 -504
  204. package/dist/lib/widgets/result_facets_panel.js.map +0 -1
  205. package/dist/lib/widgets/sorting_bar.js +0 -334
  206. package/dist/lib/widgets/sorting_bar.js.map +0 -1
  207. package/dist/lib/widgets/statement_panel.js +0 -61
  208. package/dist/lib/widgets/statement_panel.js.map +0 -1
  209. package/dist/lib/widgets/widget_options.js +0 -2
  210. package/dist/lib/widgets/widget_options.js.map +0 -1
  211. package/styles-eq-core.js +0 -10
  212. package/styles-eq-view.js +0 -1
  213. package/tsconfig.json +0 -23
  214. package/webpack.config.js +0 -181
  215. /package/dist/{lib → types}/dialog/aggr_settings_dialog.d.ts +0 -0
  216. /package/dist/{lib → types}/dialog/export_dialog.d.ts +0 -0
  217. /package/dist/{lib/i18n/text_resources.d.ts → types/extensions.d.ts} +0 -0
  218. /package/dist/{lib → types}/facets/chart_facet.d.ts +0 -0
  219. /package/dist/{lib → types}/facets/datatable_facet.d.ts +0 -0
  220. /package/dist/{lib → types}/facets/pivot_table_facet.d.ts +0 -0
  221. /package/dist/{lib → types}/facets/result_facet.d.ts +0 -0
  222. /package/dist/{lib → types}/public_api.d.ts +0 -0
  223. /package/dist/{lib → types}/types/facet_type.d.ts +0 -0
  224. /package/dist/{lib → types}/types/qp_editable_part.d.ts +0 -0
  225. /package/dist/{lib → types}/utils/browser_utils.d.ts +0 -0
  226. /package/dist/{lib → types}/utils/display_format_parser.d.ts +0 -0
  227. /package/dist/{lib → types}/utils/dropdown.d.ts +0 -0
  228. /package/dist/{lib → types}/utils/popup_menu.d.ts +0 -0
  229. /package/dist/{lib → types}/utils/utils.d.ts +0 -0
  230. /package/dist/{lib → types}/views/adv_search_view.d.ts +0 -0
  231. /package/dist/{lib → types}/views/data_filter_view.d.ts +0 -0
  232. /package/dist/{lib → types}/views/html_data_filter_view.d.ts +0 -0
  233. /package/dist/{lib → types}/views/report_view.d.ts +0 -0
  234. /package/dist/{lib → types}/views/view_options.d.ts +0 -0
  235. /package/dist/{lib → types}/widgets/aggregation_bar.d.ts +0 -0
  236. /package/dist/{lib → types}/widgets/charts/chart_type.d.ts +0 -0
  237. /package/dist/{lib → types}/widgets/charts/chart_widget.d.ts +0 -0
  238. /package/dist/{lib → types}/widgets/charts/chart_widget_chartjs.d.ts +0 -0
  239. /package/dist/{lib → types}/widgets/charts/chart_widget_google.d.ts +0 -0
  240. /package/dist/{lib → types}/widgets/columns_bar.d.ts +0 -0
  241. /package/dist/{lib → types}/widgets/columns_panel.d.ts +0 -0
  242. /package/dist/{lib → types}/widgets/easy_grid_widget.d.ts +0 -0
  243. /package/dist/{lib → types}/widgets/entities_panel.d.ts +0 -0
  244. /package/dist/{lib → types}/widgets/eq_result_html_grid.d.ts +0 -0
  245. /package/dist/{lib → types}/widgets/export_widget.d.ts +0 -0
  246. /package/dist/{lib → types}/widgets/facet_container.d.ts +0 -0
  247. /package/dist/{lib → types}/widgets/filter_bar.d.ts +0 -0
  248. /package/dist/{lib → types}/widgets/grid.d.ts +0 -0
  249. /package/dist/{lib → types}/widgets/html_content_widget.d.ts +0 -0
  250. /package/dist/{lib → types}/widgets/locale_widget.d.ts +0 -0
  251. /package/dist/{lib → types}/widgets/manage_drilldown_widget.d.ts +0 -0
  252. /package/dist/{lib → types}/widgets/process_widget.d.ts +0 -0
  253. /package/dist/{lib → types}/widgets/queryname_widget.d.ts +0 -0
  254. /package/dist/{lib → types}/widgets/renderers/aggr_settings/aggr_settings_renderer.d.ts +0 -0
  255. /package/dist/{lib → types}/widgets/renderers/base_element_renderer.d.ts +0 -0
  256. /package/dist/{lib → types}/widgets/renderers/columnsbar/aggrfunc_column_renderer_cb.d.ts +0 -0
  257. /package/dist/{lib → types}/widgets/renderers/columnsbar/attr_column_renderer_cb.d.ts +0 -0
  258. /package/dist/{lib → types}/widgets/renderers/columnsbar/column_renderer_cb.d.ts +0 -0
  259. /package/dist/{lib → types}/widgets/renderers/columnsbar/editable_column_renderer_cb.d.ts +0 -0
  260. /package/dist/{lib → types}/widgets/renderers/columnspanel/aggrfunc_column_renderer_cp.d.ts +0 -0
  261. /package/dist/{lib → types}/widgets/renderers/columnspanel/attr_column_renderer_cp.d.ts +0 -0
  262. /package/dist/{lib → types}/widgets/renderers/columnspanel/column_renderer_cp.d.ts +0 -0
  263. /package/dist/{lib → types}/widgets/renderers/columnspanel/editable_column_renderer_cp.d.ts +0 -0
  264. /package/dist/{lib → types}/widgets/renderers/dropdown_renderer.d.ts +0 -0
  265. /package/dist/{lib → types}/widgets/renderers/querypanel/addrow_renderer.d.ts +0 -0
  266. /package/dist/{lib → types}/widgets/renderers/querypanel/attribute_expression_renderer.d.ts +0 -0
  267. /package/dist/{lib → types}/widgets/renderers/querypanel/bind_to_parent_column_expression_renderer.d.ts +0 -0
  268. /package/dist/{lib → types}/widgets/renderers/querypanel/condition_group_renderer.d.ts +0 -0
  269. /package/dist/{lib → types}/widgets/renderers/querypanel/condition_renderer.d.ts +0 -0
  270. /package/dist/{lib → types}/widgets/renderers/querypanel/datetime_expression_render.d.ts +0 -0
  271. /package/dist/{lib → types}/widgets/renderers/querypanel/expression_renderer.d.ts +0 -0
  272. /package/dist/{lib → types}/widgets/renderers/querypanel/input_expression_renderer.d.ts +0 -0
  273. /package/dist/{lib → types}/widgets/renderers/querypanel/list_expression_renderer.d.ts +0 -0
  274. /package/dist/{lib → types}/widgets/renderers/querypanel/operator_renderer.d.ts +0 -0
  275. /package/dist/{lib → types}/widgets/renderers/querypanel/text_renderer.d.ts +0 -0
  276. /package/dist/{lib → types}/widgets/renderers/sortingbar/column_renderer_sb.d.ts +0 -0
  277. /package/dist/{lib → types}/widgets/result_facets_panel.d.ts +0 -0
  278. /package/dist/{lib → types}/widgets/sorting_bar.d.ts +0 -0
  279. /package/dist/{lib → types}/widgets/statement_panel.d.ts +0 -0
  280. /package/dist/{lib → types}/widgets/widget_options.d.ts +0 -0
@@ -1,3 +0,0 @@
1
- /*! For license information please see easyquery.ui.min.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("easyqueryCore")):"function"==typeof define&&define.amd?define("easyqueryUI",["easyqueryCore"],e):"object"==typeof exports?exports.easyqueryUI=e(require("easyqueryCore")):t.easyqueryUI=e(t.easyqueryCore)}(self,(function(__WEBPACK_EXTERNAL_MODULE__388__){return function(){"use strict";var __webpack_modules__={903:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{z:function(){return browserUtils}});var _utils__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(974),browserUtils;(function(browserUtils){var _isFirefox=null,_isIE=null;function isIE(){return eval("/*@cc_on!@*/false || !!document.documentMode")}function isFirefox(){if(null===_isFirefox){var t=navigator.userAgent;_isFirefox=t.toLowerCase().indexOf("firefox")>-1}return _isFirefox}browserUtils.isIE=isIE,browserUtils.isFirefox=isFirefox;var _detectedIsMobileMode=!1,_isMobileMode=void 0,detectIsMobileMode=function(){var t=isMobileMode();_detectedIsMobileMode=window.matchMedia("only screen and (max-width: 840px)").matches||window.matchMedia("only screen and (max-height: 420px)").matches;var e=isMobileMode();e!==t&&mobileModeChangeHandler&&mobileModeChangeHandler(e)},mobileModeChangeHandler;function isMobileMode(){return void 0!==_isMobileMode?_isMobileMode:_detectedIsMobileMode}function setIsMobileMode(t){var e=isMobileMode();_isMobileMode=t;var n=isMobileMode();n!==e&&mobileModeChangeHandler&&mobileModeChangeHandler(n)}function onMobileModeChanged(t){mobileModeChangeHandler=t}function getMobileCssClass(){return isMobileMode()?_utils__WEBPACK_IMPORTED_MODULE_0__.XD:null}detectIsMobileMode(),window.addEventListener("resize",(function(){return detectIsMobileMode()})),browserUtils.isMobileMode=isMobileMode,browserUtils.setIsMobileMode=setIsMobileMode,browserUtils.onMobileModeChanged=onMobileModeChanged,browserUtils.getMobileCssClass=getMobileCssClass})(browserUtils||(browserUtils={}))},974:function(t,e,n){n.d(e,{X1:function(){return o},XD:function(){return s},YR:function(){return r},n6:function(){return i}});n(514);function o(t){for(var e=0;null!==t;){var n=document.defaultView.getComputedStyle(t,null).getPropertyValue("z-index");if("auto"!=n){var o=parseInt(n);o>e&&(e=o)}t=t.parentElement}return e}function i(t){setTimeout((function(e){t&&t.focus()}),100)}var r="eqjs",s="eqjs-mobile"},902:function(t,e,n){var o,i;n.d(e,{$h:function(){return w},iW:function(){return p},QJ:function(){return S},g:function(){return o},XH:function(){return k},vp:function(){return B},ag:function(){return c},Xu:function(){return E},P6:function(){return u}}),function(t){t[t.Unknown=0]="Unknown",t[t.String=1]="String",t[t.Byte=2]="Byte",t[t.Word=3]="Word",t[t.Int32=4]="Int32",t[t.Int64=5]="Int64",t[t.Bool=6]="Bool",t[t.Float=7]="Float",t[t.Currency=8]="Currency",t[t.BCD=9]="BCD",t[t.Date=10]="Date",t[t.Time=11]="Time",t[t.DateTime=12]="DateTime",t[t.Autoinc=13]="Autoinc",t[t.Memo=14]="Memo",t[t.Blob=15]="Blob",t[t.FixedChar=16]="FixedChar",t[t.Guid=17]="Guid",t[t.Geometry=18]="Geometry",t[t.Geography=19]="Geography"}(o||(o={})),function(t){t[t.Data=0]="Data",t[t.Virtual=1]="Virtual",t[t.Lookup=2]="Lookup"}(i||(i={}));var r,s="Unknown",a="EDIT",l="DATETIME";!function(t){t.Trace="TRACE",t.Options="OPTIONS",t.Get="GET",t.Put="PUT",t.Post="POST",t.Delete="DELETE"}(r||(r={}));var c,u,d=function(){function t(t,e){this.xhr=t,this.method=e.method,this.url=e.url,this.headers=e.headers,this.queryParams=e.queryParams,this.data=e.data}return t.prototype.setHeader=function(t,e){this.headers[t]=e},t.prototype.setQueryParam=function(t,e){this.queryParams[t]=e},t.prototype.getXMLHttpRequest=function(){return this.xhr},t.prototype.getResponseHeaders=function(){if(this.xhr.readyState==this.xhr.HEADERS_RECEIVED){for(var t={},e=0,n=this.xhr.getAllResponseHeaders().trim().split(/[\r\n]+/);e<n.length;e++){var o=n[e].split(": "),i=o.shift(),r=o.join(": ");t[i]=r}return t}return{}},t.prototype.open=function(){var t=this;if(this.xhr.readyState===this.xhr.UNSENT){var e=this.url;for(var n in this.queryParams&&Object.keys(this.queryParams).length>0&&(e+=encodeURI("?"+Object.keys(this.queryParams).map((function(e){return e+"="+t.queryParams[e]})).join("&"))),this.xhr.open(this.method,e,!0),this.xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"),this.headers)this.xhr.setRequestHeader(n,this.headers[n])}},t.prototype.abort=function(){this.xhr.abort()},t}();!function(t){var e,n={shortDateFormat:"MM/dd/yyyy",longDateFormat:"dd MMM, yyyy",editDateFormat:"MM/dd/yyyy",shortTimeFormat:"HH:mm",editTimeFormat:"HH:mm",longTimeFormat:"HH:mm:ss",shortMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longMonthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],shortWeekDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longWeekDayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],decimalSeparator:".",currency:"USD"},i={localeId:"en-US",englishName:"English",displayName:"English",texts:{ButtonOK:"OK",ButtonCancel:"Cancel",Yes:"Yes",No:"No",True:"True",False:"False"},settings:n},r={"en-US":i},s=[];function a(t){for(var e=0,n=s;e<n.length;e++){(0,n[e])(t)}}function l(){return e.localeId}function c(t){var n=r[t];n?u.assignDeep(e,n):(e.englishName=t,e.displayName=t,e.texts=u.assignDeep({},i.texts)),e.localeId=t}function d(){return e.settings}function h(t){e.settings||(e.settings=u.assignDeep({},n)),e.settings=u.assignDeep(e.settings,t)}function p(t,n){a(n);var o=e;t&&(n.localeId||(n.localeId=t),(o=r[t])||(o=u.assignDeep({},i),r[t]=o)),u.assignDeep(o,n)}function f(){var t,n,o,i,r,s,a="object"==typeof navigator?navigator.language:void 0;t=a,n=new Date(2020,5,7,19,34,56,88),o=n.toLocaleDateString(t,{year:"numeric",month:"numeric",day:"numeric"}),i=n.toLocaleTimeString(t,{hour:"numeric",minute:"numeric",second:"numeric"}),r=o.replace("07","dd").replace("7","d").replace("06","MM").replace("6","M").replace("2020","yyyy").replace("20","yy"),s=i.replace("19","HH").replace("07","hh").replace("7","h").replace("34","mm").replace("56","ss").replace("PM","tt"),e.settings||(e.settings={}),h({shortDateFormat:r,shortTimeFormat:s})}function g(t){var e,n=d();switch(t){case o.Date:e=n.shortDateFormat;break;case o.Time:e=n.shortTimeFormat;break;default:e=n.shortDateFormat+" "+n.shortTimeFormat}return e}function m(t){var e,n=d();switch(t){case o.Date:e=n.longDateFormat;break;case o.Time:e=n.longTimeFormat;break;default:e=n.longDateFormat+" "+n.longTimeFormat}return e}t.addMapper=function(t){s.push(t)},t.getLocales=function(){var t=[];for(var e in r)t.push({locale:e,englishName:r[e].englishName,displayName:r[e].displayName});return t.sort((function(t,e){return t.englishName>e.englishName?1:t.englishName===e.englishName?0:-1}))},t.getCurrentLocale=l,t.setLocale=function(t){console.warn("This method is deprecated. Use setCurrentLocale instead"),c(t)},t.setCurrentLocale=c,t.getText=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=e.texts,i="";if(t&&t.length)for(var r=t.length,s=0;s<r&&"object"==typeof(i=o[t[s]]);s++)o=i;return i},t.getLocaleSettings=d,t.getOneLocaleSetting=function(t){return e.settings[t]},t.getShortMonthName=function(t){var e=d();if(t>0&&t<13)return e.shortMonthNames[t-1];throw"Wrong month number: "+t},t.getLongMonthName=function(t){var e=d();if(t>0&&t<13)return e.longMonthNames[t-1];throw"Wrong month number: "+t},t.getShortWeekDayName=function(t){var e=d();if(t>0&&t<8)return e.shortWeekDayNames.length>=t?e.shortWeekDayNames[t-1]:t.toString();throw"Wrong month number: "+t},t.getLongWeekDayName=function(t){var e=d();if(t>0&&t<8)return e.longWeekDayNames.length>=t?e.longWeekDayNames[t-1]:t.toString();throw"Wrong month number: "+t},t.updateLocaleSettings=h,t.updateLocaleTexts=function(t){"object"==typeof t?(a({localeId:e.localeId,texts:t}),u.assignDeep(e.texts,t)):console.error("Wrong parameter type in updateLocaleTexts function call.The first parameter (localeId) is not necessary. Use updateLocaleTexts(texts) instead")},t.updateDefaultTexts=function(t){for(var n in r){var o=r[n];o.texts=u.assignDeep({},t,o.texts)}e.texts=u.assignDeep({},t,e.texts)},t.updateLocaleInfo=p,t.addLocale=function(t,e){p(t,e)},t.resetLocales=function(){e||(e=u.assignDeep({},i),f())},t.dateTimeToStr=function(t,e,n){return n?"d"==n?n=g(o.Date):"D"==n?n=m(o.Date):"f"==n?n=g(o.DateTime):"F"==n&&(n=m(o.DateTime)):n=g(e),u.dateTimeToStr(t,n)},t.numberToStr=function(e,n){if(n&&n.length>0){var o=n.charAt(0).toUpperCase();if("S"===o)return function(e,n){if(!y[n]){var o=n.split("|").filter((function(t){return t.length>0})).map((function(t){return t.split("=")}));if(y[n]={},o.length>0)if(o[0].length>1)for(var i=0,r=o;i<r.length;i++){var s=r[i];y[n][Number.parseInt(s[1])]=s[0]}else o.forEach((function(t,e){y[n][e]=t[0]}))}var a=y[n];if(void 0!==a[e]){s=a[e];return t.getText(s)||s}return e.toString()}(e,n.slice(1));if(["D","F","C"].indexOf(o)>=0){var i=l();return e.toLocaleString(i,function(t){var e=d(),n=t[0].toUpperCase(),o=t.length>1?Number.parseInt(t.slice(1)):"D"==n?1:2;switch(n){case"D":return{style:"decimal",useGrouping:!1,minimumIntegerDigits:o};case"C":return{style:"currency",currency:e.currency,minimumFractionDigits:o};default:return{style:"decimal",minimumFractionDigits:o,maximumFractionDigits:o}}}(n))}return function(t,e){for(var n=t.toString(),o="",i=n.length-1,r=e.length-1;r>=0;r--){var s=e.charAt(r);"#"===s||"0"===s?i>=0?(o+=n.charAt(i),i--):"0"===s&&(o+=0):o+=s}return o.split("").reverse().join("")}(Math.trunc(e),n)}var r=d();return u.numberToStr(e,r.decimalSeparator)},t.booleanToStr=function(e,n){if(n&&n.length>0&&"S"===n.charAt(0).toUpperCase()){var o=n.slice(1).split("|");if(o.length>1){var i=o[e?1:0];return t.getText(i)||i}}return"".concat(e)};var y={}}(c||(c={})),function(t){t.getAllDataTypes=function(){return Object.values(o).filter((function(t){return"number"==typeof t}))},t.getDateDataTypes=function(){return[o.Time,o.Date,o.DateTime]},t.getStringDataTypes=function(){return[o.String,o.Memo,o.FixedChar]};var e=[o.Byte,o.Word,o.Int32,o.Int64,o.Float,o.Currency,o.Autoinc];t.getNumericDataTypes=function(){return e};var n=[o.Byte,o.Word,o.Int32,o.Int64,o.Autoinc];function i(t,e,n){e||(e={});for(var o=0,s=n;o<s.length;o++){var a=s[o];if(a)for(var l in a)if(a.hasOwnProperty(l)){var c=a[l];null!==c&&"object"==typeof c?t.has(c)?e[l]=t.get(c):Array.isArray(c)?(e[l]=r(c),t.set(c,e[l])):(void 0!==e[l]&&null!=e[l]||(e[l]=Object.create(Object.getPrototypeOf(c))),t.set(c,e[l]),i(t,e[l],[c])):e[l]=c}}return e}function r(t){for(var e=[],n=0,o=t;n<o.length;n++){var i=o[n];e.push(i)}return e}t.assign=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var o=0;o<e.length;o++){var i=e[o];if(i)for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r])}return t},t.assignDeep=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return i(new WeakMap,t,e)},t.getIfDefined=function(t,e){return void 0!==t?t:e},t.IsDefinedAndNotNull=function(t){return null!=t},t.copyArrayTo=function(t,e){for(var n=t.length,o=e.length,i=0;i<n&&i<o;i++)e[i]=t[i]},t.createArrayFrom=r,t.findItemById=function(t,e){for(var n=t.length,o=0;o<n;o++)if(t[o].id===e)return t[o];return null},t.findItemIndexById=function(t,e){for(var n=t.length,o=0;o<n;o++)if(t[o].id===e)return o;return-1},t.indexOfArrayItem=function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=t.length,o=0;o<n;o++)if(e==t[o])return o;return-1},t.moveArrayItem=function(t,e,n){if(e>=t.length)throw"Index out of bounds: "+e;n>=t.length&&(n=t.length-1);var o=t.splice(e,1)[0];t.splice(n,0,o)},t.removeArrayItem=function(t,e){var n=t.indexOf(e);if(-1!=n)return t.splice(n,1)[0]},t.insertArrayItem=function(t,e,n){t.splice(e,0,n)},t.fillArray=function(t,e,n,o){void 0===n&&(n=0);for(var i=t.length>>>0,r=n>>0,s=r<0?Math.max(i+r,0):Math.min(r,i),a=void 0===o?i:o>>0,l=a<0?Math.max(i+a,0):Math.min(a,i);s<l;)t[s]=e,s++;return t},t.shiftToFitWindow=function(t,e){var n=document.getElementsByTagName("body")[0],o=window.innerWidth||document.documentElement.clientWidth||n.clientWidth,i=t+e,r=0;return i>o&&t+(r=o-i-10)<0&&(r=10-t),r},t.isObject=function(t){return null!==t&&("function"==typeof t||"object"==typeof t)},t.isNumericType=function(t){return e.indexOf(t)>=0},t.isIntType=function(t){return n.indexOf(t)>=0},t.isNumeric=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},t.areCompatibleDataTypes=function(t,e){return void 0===t||void 0===e||t==o.Unknown||e==o.Unknown||t==e||t==o.Date&&e==o.DateTime||t==o.DateTime&&e==o.Date},t.isPropSet=function(t,e){return t[e]||t[e.toLowerCase()]||t[e.toUpperCase()]};var s="0123456789abcdefghijklmnopqrstuvwxyz";function a(t,e){var n=t.length;if(n>e){var o=n/e,i="";i+=t[0];for(var r=o,s=void 0,a=1;a<n;a++)s=t[a],a+1>r&&(i+=s,r+=o);return i}return t}function l(t,e){return Math.floor(Math.random()*(e-t))+t}function u(t){var e=parseInt(t);if(isNaN(e))throw'"'.concat(t,'" is not a valid number');return e}t.generateId=function(t){t||(t="easy");var e=t.length>4?function(t,e){var n=t.split("-"),o=1,i=e;n.length<e&&(o=e/n.length,i=n.length);for(var r="",s=0;s<i;s++)r+=a(n[s],o);return r}(t,4):t;e&&e.length>0&&(e+="-");var n=s[l(0,s.length)]+s[l(0,s.length)]+s[l(0,s.length)],o=l(0,1e4);return e+n+function(t,e){void 0===e&&(e=36);var n="",o=t;do{n=s[o%e]+n,o=Math.floor(o/=e)}while(o>0);return n}(621355968e9+1e4*(new Date).getTime()-0x8d60e562e627800-o)},t.strToDateTime=function(t,e){if(!t||0==t.length)return new Date;var n=t.replace(/[^a-zA-Z0-9_]/g,"-"),o=e.replace(/[^a-zA-Z0-9_]/g,"-").split("-"),i=n.split("-"),r=o.indexOf("MM"),s=o.indexOf("dd"),a=o.indexOf("yyyy"),l=o.indexOf("HH"),c=o.indexOf("mm"),d=o.indexOf("ss"),h=new Date;try{var p=a>-1&&a<i.length?u(i[a]):h.getFullYear(),f=r>-1&&r<i.length?u(i[r])-1:h.getMonth()-1;if(f>11)throw"";var g=s>-1&&s<i.length?u(i[s]):h.getDate();if(g>function(t,e){return new Date(e,t+1,0).getDate()}(f,p))throw"";var m=l>-1&&l<i.length?u(i[l]):0;if(m>23)throw"";var y=c>-1&&c<i.length?u(i[c]):0;if(y>59)throw"";var v=d>-1&&d<i.length?u(i[d]):0;if(v>59)throw"";return new Date(p,f,g,m,y,v)}catch(e){throw"".concat(t," is not a valid date.")}},t.strToTime=function(t){var e=t.split(":");try{var n=e.length>0?u(e[0]):0;if(n>23)throw"";var o=e.length>1?u(e[1]):0;if(o>59)throw"";var i=e.length>1?u(e[1]):0;if(i>59)throw"";return new Date(0,0,0,n,o,i)}catch(e){throw"".concat(t," is not a valid time.")}};var d=/\[([^\]]+)]|y{2,4}|M{1,4}|d{1,2}|H{1,2}|h{1,2}|m{2}|s{2}|t{2}/g;t.dateTimeToStr=function(t,e){var n=t.getFullYear().toString(),o=t.getMonth()+1,i=t.getDate(),r=t.getHours(),s=t.getMinutes(),a=t.getSeconds(),l=r%12||12,u=r>11,h={yyyy:n,yy:n.substring(n.length-2),MMMM:c.getLongMonthName(o),MMM:c.getShortMonthName(o),MM:o<10?"0"+o:o.toString(),M:o.toString(),dd:i<10?"0"+i:i.toString(),d:i.toString(),HH:r<10?"0"+r:r.toString(),H:r.toString(),hh:l<10?"0"+l:l.toString(),h:l.toString(),tt:u?"PM":"AM",mm:s<10?"0"+s:s.toString(),ss:a<10?"0"+a:a.toString()};return e.replace(d,(function(t,e){return e||h[t]}))},t.numberToStr=function(t,e){return e=e||c.getLocaleSettings().decimalSeparator,t.toString().replace(".",e)}}(u||(u={}));var h,p,f=function(){function t(t,e){this.request=t,this.promise=e}return t.prototype.getPromise=function(){return this.promise},t.prototype.getRequest=function(){return this.request},t.prototype.then=function(t,e){return this.promise.then(t,e)},t.prototype.catch=function(t){return this.promise.catch(t)},t.prototype.finally=function(t){return this.promise.finally(t)},t}(),g=(h=function(t,e){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},h(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),m=function(){return m=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},m.apply(this,arguments)},y=function(t){function e(e,n){var o=t.call(this,n)||this;return o.status=e,o}return g(e,t),e}(Error),v=(function(){function t(){this.defaultHeaders={},this.customPayload=void 0}Object.defineProperty(t.prototype,"responseBody",{get:function(){return this._responseBody},enumerable:!1,configurable:!0}),t.prototype.get=function(t,e){return this.send(r.Get,t,null,e)},t.prototype.post=function(t,e,n){return this.send(r.Post,t,e,n)},t.prototype.put=function(t,e,n){return this.send(r.Put,t,e,n)},t.prototype.delete=function(t,e,n){return this.send(r.Delete,t,e,n)},t.prototype.send=function(e,n,o,i){var r=this,s=(i=i||{}).dataType||"json",a=i.contentType||"form-data"!==s?"application/json":null;o&&"form-data"!=s&&this.customPayload&&(o.data=u.assignDeep(o.data||{},this.customPayload));var l=new("onload"in new XMLHttpRequest?XMLHttpRequest:window.XDomainRequest),c={method:e,url:n,headers:m(m({},this.defaultHeaders),i.headers||{}),queryParams:i.queryParams||{},data:o};a&&(c.headers["Content-Type"]=a);var h=new d(l,c);this.beforeEachRequest&&(console.warn("HttpClient: 'beforeEachRequest' is deprecated and will be removed in future updates.\n Use 'onRequest' instead"),this.beforeEachRequest(h)),this.onRequest&&this.onRequest(h);var p=h.data&&"string"!=typeof h.data&&"json"==s?JSON.stringify(h.data):h.data;return h.open(),new f(h,new Promise((function(e,o){i.responseType&&(l.responseType=i.responseType),l.onerror=function(t){o(new y(l.status,l.responseText))},l.onreadystatechange=function(){if(4==l.readyState){var i=l.getResponseHeader("Content-Type")||"",s=l.status;if(0===s)o(new y(s,"Network error or the request was aborted"));else if(s>=200&&s<400){var a="arraybuffer"===l.responseType||"blob"===l.responseType?l.response:0==i.indexOf("application/json")?JSON.parse(l.responseText):l.responseText;r._responseBody=a,r.onResponse&&r.onResponse(l),e(a)}else{("arraybuffer"===l.responseType||"blob"===l.responseType?t.decodeArrayBuffer(l.response):Promise.resolve(l.responseText)).then((function(t){var e=0==i.indexOf("application/json")?JSON.parse(t):t;r._responseBody=e;var a=e.message||(404==s?"No such endpoint: ".concat(n):e);o(new y(s,a))}))}}},l.send(p)})))},t.decodeArrayBuffer=function(t){var e=new FileReader;return new Promise((function(n){e.onloadend=function(){e.readyState==FileReader.DONE&&n(e.result)},e.readAsText(new Blob([t]))}))}}(),function(){function t(t){this.isEditable=!0,this.name="",this.caption="",this.description="",this.parent=t,this.attributes=new Array,this.subEntities=new Array}return t.prototype.loadFromData=function(t,e){if(e){if(this.id=e.id,this.name=e.name,this.captionPlural=e.namePlur,this.caption=e.name,this.description=e.desc,void 0!==e.ied&&(this.isEditable=e.ied),this.subEntities=new Array,e.ents)for(var n=0;n<e.ents.length;n++){var o=t.createEntity(this);o.loadFromData(t,e.ents[n]),this.subEntities.push(o)}if(this.attributes=new Array,e.attrs)for(n=0;n<e.attrs.length;n++){var i=t.createEntityAttr(this);i.loadFromData(t,e.attrs[n]),this.attributes.push(i)}}},t.prototype.scan=function(t,e){var n={stop:!1},o=function(i){if(e&&e(i,n),i.attributes)for(var r=i.attributes.length,s=0;s<r&&!n.stop;s++){var a=i.attributes[s];if(t&&t(a,n),n.stop)return}if(i.subEntities){var l=i.subEntities.length;for(s=0;s<l&&!n.stop;s++)o(i.subEntities[s])}};o(this)},t.prototype.getFirstPrimaryAttr=function(){return this.getPrimaryAttrs()[0]},t.prototype.getPrimaryAttrs=function(){return this.attributes.filter((function(t){return t.isPrimaryKey}))},t}()),C=function(){function t(t){this.id="",this.caption="{Unrecognized attribute}",this.dataType=o.String,this.size=0,this.isPrimaryKey=!1,this.isForeignKey=!1,this.isNullable=!0,this.showOnView=!0,this.isEditable=!0,this.showOnCreate=!0,this.showOnEdit=!0,this.showInLookup=!1,this.lookupAttr="",this.expr="",this.entity=t,this.kind=i.Data}return t.prototype.loadFromData=function(t,e){if(e){this.id=e.id,this.description=e.desc,this.caption=e.cptn,this.dataType=e.dtype,this.isPrimaryKey=e.ipk,this.isForeignKey=e.ifk,this.size=e.size,this.lookupAttr=e.lattr,this.lookupEntity=e.lent,this.dataAttr=e.dattr,this.lookupDataAttr=e.ldattr;var n=u.getDateDataTypes().indexOf(this.dataType);this.defaultValue=e.defVal&&n?new Date(e.defVal):e.defVal,this.isNullable=u.getIfDefined(e.nul,this.isNullable),this.isEditable=u.getIfDefined(e.ied,this.isEditable),this.showOnView=u.getIfDefined(e.ivis||e.sov,this.showOnView),this.showOnCreate=u.getIfDefined(e.soc,this.showOnCreate),this.showOnEdit=u.getIfDefined(e.soe,this.showOnEdit),this.showInLookup=u.getIfDefined(e.sil,this.showInLookup),this.kind=e.kind,this.displayFormat=e.dfmt,e.udata&&(this.userData=e.udata),e.edtr&&(this.defaultEditor=t.getEditorById(e.edtr)||t.createValueEditor())}},t}(),b=function(){function t(){this.id="",this.tag=s,this.resType=o.Unknown,this.defValue=""}return t.prototype.loadFromData=function(t){t&&(this.id=t.id,this.tag=t.tag,this.defValue=t.defval,this.resType=t.rtype,this.accept=t.accept,this.multiline=t.multiline,t.subType&&(this.resType=t.subType),t.name&&(this.name=t.name),t.values&&(this.values=t.values))},t.prototype.getValueText=function(t){var e="";if(!this.values)return e;if(Array.isArray(t))for(var n=0,o=this.values;n<o.length;n++){var i=o[n];t.indexOf(i.id)>=0&&(e+=i.text+",")}else for(var r=0,s=this.values;r<s.length;r++){(i=s[r]).id===t&&(e+=i.text+",")}return e&&(e=e.substring(0,e.length-1)),e},t}(),x=(function(){function t(){this.mainEntity=null,this.id="__none",this.name="Empty model",this.rootEntity=this.createEntity(),this.displayFormats=new Map}t.prototype.getMainEntity=function(){return this.mainEntity},t.prototype.createEntity=function(t){return new v(t)},t.prototype.createEntityAttr=function(t){return new C(t)},t.prototype.createValueEditor=function(){return new b},t.prototype.loadFromJSON=function(t){var e=JSON.parse(t);this.loadFromData(e)},t.prototype.loadFromData=function(t){if(this.id=t.id,this.name=t.name,this.version=t.vers,this.editors=new Array,t.editors)for(var e=0;e<t.editors.length;e++){var n=this.createValueEditor();n.loadFromData(t.editors[e]),this.editors.push(n)}if(this.rootEntity.loadFromData(this,t.entroot),this.displayFormats=new Map,t.displayFormats)for(var i in t.displayFormats){var r=o[i],s=t.displayFormats[i]||new Array;this.displayFormats.set(r,s)}},t.prototype.getDisplayFormats=function(){return this.displayFormats},t.prototype.getDisplayFormatsForType=function(t){return this.displayFormats.has(t)?this.displayFormats.get(t):[]},t.prototype.getDefaultFormat=function(t){return this.displayFormats.has(t)?this.displayFormats.get(t).filter((function(t){return t.isdef}))[0]:null},t.prototype.setData=function(t){"string"==typeof t?this.loadFromJSON(t):this.loadFromData(t)},t.prototype.isEmpty=function(){return 0===this.rootEntity.subEntities.length&&0===this.rootEntity.attributes.length},t.prototype.getId=function(){return this.id},t.prototype.getName=function(){return this.name},t.prototype.getRootEntity=function(){return this.rootEntity},t.prototype.getEditorById=function(t){for(var e=0,n=this.editors;e<n.length;e++){var o=n[e];if(o.id===t)return o}return null},t.prototype.getAttributeById=function(t){var e=this.getEntityAttrById(this.getRootEntity(),t);return e||null},t.prototype.checkAttrProperty=function(t,e){var n=this.getAttributeById(t);if(n){if(void 0===n[e])throw"No such property: "+e;return!!n[e]||!!n.lookupAttr&&(t=n.lookupAttr,(n=this.getAttributeById(t))&&n[e])}return!1},t.prototype.getEntityAttrById=function(t,e){var n,o;if(t.attributes){var i=t.attributes.length;for(n=0;n<i;n++)if(t.attributes[n].id==e)return t.attributes[n]}if(t.subEntities){var r=t.subEntities.length;for(n=0;n<r;n++)if(o=this.getEntityAttrById(t.subEntities[n],e))return o}return null},t.prototype.listByEntityWithFilter=function(t,e){var n,o=new Array,i=null;if(t.subEntities)for(var r=t.subEntities.length,s=0;s<r;s++){if(i=t.subEntities[s],!e||e(i,null))(n=c.getText("Entities",i.name))||(n=i.caption),(h=u.assign(this.createEntity(),{id:i.name,text:n,items:[],isEntity:!0})).items=this.listByEntityWithFilter(i,e),h.items.length>0&&o.push(h)}var a=null;if(t.attributes)for(var l=t.attributes.length,d=0;d<l;d++)if(a=t.attributes[d],!e||e(t,a)){(n=c.getText("Attributes",a.id))||(n=a.caption);var h=u.assign(this.createEntity(),{id:a.id,text:n,dataType:a.dataType});o.push(h)}return o},t.prototype.listByEntity=function(t,e,n){e=e||{};var o,i=[],r=[],s=null;if(t.subEntities)for(var a=t.subEntities.length,l=0;l<a;l++)if(s=t.subEntities[l],!n||n(s,null)){o=c.getText("Entities",s.name)||s.caption;var d=u.assign(this.createEntity(),{id:s.name,text:o,items:[],isEntity:!0,description:s.description}),h=u.assign({},e);h.includeRootData=!1,d.items=this.listByEntity(s,h,n),d.items.length>0&&i.push(d)}var p=null;if(t.attributes)for(var f=t.attributes.length,g=0;g<f;g++)p=t.attributes[g],n&&!n(t,p)||(o=c.getText("Attributes",p.id)||p.caption,r.push(u.assign(this.createEntityAttr(t),{id:p.id,text:o,dataType:p.dataType,lookupAttr:p.lookupAttr,description:p.description})));var m,y=function(t,e){return t.text.toLowerCase()==e.text.toLowerCase()?0:t.text.toLowerCase()>e.text.toLowerCase()?1:-1};return e.sortEntities&&(i.sort(y),r.sort(y)),m=e.attrPlacement&&0!=e.attrPlacement?r.concat(i):i.concat(r),2==e.attrPlacement&&m.sort(y),e.includeRootData?((o=c.getText("Entities",t.name))||(o=t.caption),{id:t.name,text:o,items:m}):m},t.prototype.clear=function(){this.rootEntity=this.createEntity(),this.editors=[],this.version=""},t.prototype.addDefaultValueEditors=function(){this.addOrUpdateValueEditor("_DTE",a,o.String).defValue="",this.addOrUpdateValueEditor("_DPDE",l,o.DateTime),this.addOrUpdateValueEditor("_DPTE",l,o.DateTime)},t.prototype.addOrUpdateValueEditor=function(t,e,n){var o=u.findItemById(this.editors,t);return o||((o=this.createValueEditor()).id=t,this.editors.push(o)),o.tag=e,o.resType=n,o},t.prototype.getEntitiesTree=function(t,e){return this.listByEntity(this.getRootEntity(),t,e)},t.prototype.getEntitiesTreeWithFilter=function(t){return this.listByEntityWithFilter(this.getRootEntity(),t)},t.prototype.getFullEntityPathByAttr=function(t,e){return e=e||" ",this.getEntityPathByAttr(this.getRootEntity(),t,e,!0)},t.prototype.getEntityPathByAttr=function(t,e,n,o){if(!t)return"";n=n||" ";var i="";if(t.caption&&!o){var r=c.getText("Entities",t.caption);i=r||t.caption}if(t.attributes)for(var s=t.attributes.length,a=0;a<s;a++)if(t.attributes[a].id==e)return i;if(t.subEntities){var l=t.subEntities.length;for(a=0;a<l;a++){var u=t.subEntities[a],d=this.getEntityPathByAttr(u,e,n,!1);if(""!==d)return""!==i&&(d=i+n+d),d}}return""},t.prototype.getAttributeText=function(t,e){var n=c.getText("Attributes",t.id);if(n||(n=t.caption),!e)return n;var o=this.getFullEntityPathByAttr(t.id," ");return(o?e.replace(new RegExp("{attr}","g"),n).replace(new RegExp("{entity}","g"),o):n).trim()},t.prototype.runThroughEntities=function(t,e){this.getRootEntity().scan(t,e)},t.prototype.getFirstAttributeByFilter=function(t){var e=null;return this.runThroughEntities((function(n,o){t(n)&&(o.stop=!0,e=n)}),null),e}}(),function(){return x=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},x.apply(this,arguments)}),w=function(){function t(t){this.colStore=t,this.aggregates=[],this.groups=[],this.useGrandTotals=!1,this.useRecordCount=!1,this._caseSensitiveGroups=!1,this.COUNT_FIELD_NAME="GRPRECCNT"}return Object.defineProperty(t.prototype,"caseSensitiveGroups",{get:function(){return this._caseSensitiveGroups},set:function(t){this._caseSensitiveGroups=t,this.updateCompareProc()},enumerable:!1,configurable:!0}),t.prototype.updateCompareProc=function(){this.compareValues=this._caseSensitiveGroups?this.strictCompare:this.caseInsensitiveCompare},t.prototype.addGroup=function(t){var e=t.columns||this.colStore.getColumnIds(t.from,t.to);if(!this.colStore.validateColumns(e))throw"Invalid columns: "+e;if(this.hasColumnsInUse(e))throw"Can't add same columns to different groups/aggregates";return this.groups.push(x({columns:e},t)),this},t.prototype.addAggregateColumn=function(t,e){var n="string"==typeof t?t:this.colStore.getColumnIds(t,t)[0];if(this.hasColumnsInUse([n])||!this.colStore.validateAggregate(n,e))throw"Invalid aggregation function for the column: "+n;return this.aggregates.push({colId:n,funcId:e}),this},t.prototype.addGrandTotals=function(){return this.useGrandTotals=!0,this},t.prototype.addCounts=function(){return this.useRecordCount=!0,this},t.prototype.getGroups=function(){var t=this,e=[];return this.groups.map((function(n){return e=e.concat(n.columns),x(x({},n),{columns:Array.from(e),aggregates:Array.from(t.aggregates)})}))},t.prototype.getInternalGroups=function(){return this.groups},t.prototype.lastGroup=function(){var t=this.getGroups();return t[t.length-1]},t.prototype.getAggregates=function(){return this.aggregates},t.prototype.hasAggregates=function(){return this.aggregates.length>0},t.prototype.hasGroups=function(){return this.groups.length>0},t.prototype.hasGrandTotals=function(){return this.useGrandTotals},t.prototype.hasRecordCount=function(){return this.useRecordCount},t.prototype.isEmpty=function(){return!(this.hasAggregates()||this.hasGroups()||this.hasAggregates()||this.hasRecordCount())},t.prototype.drop=function(){console.warn('"drop()" method is obsolete. Use "clear()" instead'),this.clear()},t.prototype.clear=function(){return this.groups=[],this.aggregates=[],this.useGrandTotals=!1,this.useRecordCount=!1,this.caseSensitiveGroups=!1,this},t.prototype.hasColumnsInUse=function(t){for(var e=0,n=this.groups;e<n.length;e++){if(n[e].columns.filter((function(e){return t.indexOf(e)>=0})).length>0)return!0}for(var o=0,i=this.aggregates;o<i.length;o++){var r=i[o];if(t.indexOf(r.colId)>=0)return!0}return!1},t.prototype.needAggrCalculation=function(){return(this.hasAggregates()||this.hasRecordCount())&&(this.hasGrandTotals()||this.hasGroups())},t.prototype.saveToData=function(){return{groups:Array.from(this.groups),ugt:this.useGrandTotals,urc:this.useRecordCount,csg:this.caseSensitiveGroups,aggregates:Array.from(this.aggregates)}},t.prototype.loadFromData=function(t){t&&(void 0!==t.ugt&&(this.useGrandTotals=t.ugt),void 0!==t.urc&&(this.useRecordCount=t.urc),void 0!==t.csg&&(this.caseSensitiveGroups=t.csg),t.groups&&(this.groups=Array.from(t.groups)),t.aggregates&&(this.aggregates=Array.from(t.aggregates)))},t.prototype.buildGroupKey=function(t,e){var n=!this.caseSensitiveGroups,o={};if(t)for(var i=0,r=t.columns;i<r.length;i++){var s=r[i],a=e.getValue(s);n&&"string"==typeof a&&(a=a.toLowerCase()),o[s]=a}return o},t.prototype.strictCompare=function(t,e){return t instanceof Date?t.getTime()===e.getTime():t===e},t.prototype.caseInsensitiveCompare=function(t,e){return t instanceof Date?t.getTime()===e.getTime():("string"==typeof t?t.toLowerCase():t)===("string"==typeof e?e.toLowerCase():e)},t}();!function(t){t[t.None=0]="None",t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=3]="Right"}(p||(p={}));var E,T=function(t){if(!t)throw Error("Options are required");if(!t.id)throw Error("Field Id is required");if(!t.label)throw Error("Label is required");this.id=t.id,this.type=u.getIfDefined(t.type,o.String),this.label=t.label,this.originAttrId=t.originAttrId,this.isAggr=t.isAggr||!1,this.displayFormat=t.dfmt,this.groupFooterColumnTemplate=t.gfct,this.style=t.style||{},this.description=t.description,this.calculatedWidth=0},D=function(){function t(){this.items=[],this.mapper={},this._dateColumnIdx=[]}return Object.defineProperty(t.prototype,"count",{get:function(){return this.items.length},enumerable:!1,configurable:!0}),t.prototype.add=function(t){var e;e=t instanceof T?t:new T(t);var n=this.items.length;return this.items.push(e),this.mapper[e.id]=n,[o.Date,o.DateTime,o.Time].indexOf(e.type)>=0&&this._dateColumnIdx.push(n),n},t.prototype.updateDateColumnIdx=function(){this._dateColumnIdx=this.getItems().filter((function(t){return[o.Date,o.DateTime,o.Time].indexOf(t.type)>=0})).map((function(t,e){return e}))},t.prototype.put=function(t,e){t>=0&&t<this.count&&(this.items[t]=e,this.updateDateColumnIdx())},t.prototype.move=function(t,e){var n=this.items.indexOf(t);n>=0&&n!=e&&(u.moveArrayItem(this.items,n,e),this.updateDateColumnIdx())},t.prototype.get=function(t){return t>=0&&t<this.count?this.items[t]:null},t.prototype.getIndex=function(t){return this.mapper[t]},t.prototype.getItems=function(){return this.items},t.prototype.getDateColumnIndexes=function(){return this._dateColumnIdx},t.prototype.removeAt=function(t){var e=this.get(t);this.items.splice(t,1);var n=this._dateColumnIdx.indexOf(t);n>=0&&this._dateColumnIdx.splice(n,1),delete this.mapper[e.id]},t.prototype.clear=function(){this.items=[],this._dateColumnIdx=[],this.mapper={}},t}(),S=function(){function t(t,e){this.columns=t,this.values=e}return t.prototype.toArray=function(){return Array.from(this.values)},t.prototype.size=function(){return this.values.length},t.prototype.getValue=function(t){var e;if("string"==typeof t){if(void 0===(e=this.columns.getIndex(t)))throw new RangeError("No column with id '".concat(t,"'"))}else e=t;if(e>=this.values.length)throw new RangeError("Out of range: "+e);return this.values[e]},t.prototype.setValue=function(t,e){var n;if("string"==typeof t){if(void 0===(n=this.columns.getIndex(t)))throw new RangeError("No column with id '".concat(t,"'"))}else n=t;if(n>=this.values.length)throw new RangeError("Out of range: "+n);this.values[n]=e},t}(),k=function(){function t(t){if(this._chunkSize=1e3,this._elasticChunks=!1,this.cachedRows=[],this.total=0,this.loader=null,this.needTotal=!0,this.isInMemory=!1,t=t||{},this._chunkSize=t.chunkSize||this._chunkSize,this._elasticChunks=t.elasticChunks||this._elasticChunks,this.loader=t.loader,void 0!==t.inMemory&&(this.isInMemory=t.inMemory),this.isInMemory&&(this.needTotal=!1),this._columns=new D,this.onUpdate=t.onUpdate,t.columns)for(var e=0,n=t.columns;e<n.length;e++){var o=n[e];this._columns.add(o)}if(t.rows)for(var i=0,r=t.rows;i<r.length;i++){var s=r[i],a=this.createRow(s);this.addRow(a)}this.needTotal=!this._elasticChunks}return Object.defineProperty(t.prototype,"columns",{get:function(){return this._columns},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"chunkSize",{get:function(){return this._chunkSize},set:function(t){this._chunkSize=t,this.total=0,this.needTotal=!this.elasticChunks,this.cachedRows=[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"elasticChunks",{get:function(){return this._elasticChunks},set:function(t){this._elasticChunks=t,this.total=0,this.needTotal=!this.elasticChunks,this.cachedRows=[]},enumerable:!1,configurable:!0}),t.prototype.getRows=function(t){var e=this,n=0,o=this._chunkSize;t&&("page"in t?(n=t.pageSize*(t.page-1),o=t.pageSize):(n=t.offset,o=t.limit));var i=n+o;if(!this.needTotal&&!this.elasticChunks){if(n>=this.total)return Promise.resolve([]);i>this.total&&(i=this.total)}if(this.isInMemory&&i>this.cachedRows.length&&(i=this.cachedRows.length),i<=this.cachedRows.length)return Promise.resolve(this.cachedRows.slice(n,i));if(!this.loader)throw"Loader is not defined. Can't get the rows from ".concat(n," to ").concat(i);var r=this.needTotal;this.needTotal&&(this.needTotal=!1);var s=this.cachedRows.length,a=i-s;return a<this._chunkSize&&(a=this._chunkSize),this.loader.loadChunk({offset:s,limit:a,needTotal:r}).then((function(t){(r&&(e.total=t.total),Array.prototype.push.apply(e.cachedRows,t.table.getCachedRows()),i>e.cachedRows.length&&(i=e.cachedRows.length),e.elasticChunks)&&(t.table.getCachedCount()<a&&(e.total=e.cachedRows.length));return e.fireUpdated(),e.cachedRows.slice(n,i)}))},t.prototype.getRow=function(t){return this.getRows({offset:t,limit:1}).then((function(t){return t.length>0?t[0]:null}))},t.prototype.getTotal=function(){return this.total},t.prototype.setTotal=function(t){this.total=t,this.needTotal=!1},t.prototype.getCachedCount=function(){return this.cachedRows.length},t.prototype.clear=function(){this.columns.clear(),this.cachedRows=[],this.total=0,this.needTotal=!this._elasticChunks,this.fireUpdated()},t.prototype.createRow=function(t){var e=this,n=this._columns.getDateColumnIndexes(),o=new Array(this._columns.count),i=t instanceof S?function(e){return t.getValue(e)}:function(e){return t[e]};return t&&this.columns.getItems().forEach((function(t){var r=i(t.id),s=e.columns.getIndex(t.id);o[s]=n.indexOf(s)>=0?e.mapDate(r,t.type):r})),new S(this._columns,o)},t.prototype.mapDate=function(t,e){if(t){var n=new Date(t);return isNaN(n.getTime())&&e==o.Time&&(n=u.strToTime(t)),n}return null},t.prototype.addRow=function(t){var e;if(Array.isArray(t)){var n=t,o=this._columns.getDateColumnIndexes();if(o.length>0)for(var i=0,r=o;i<r.length;i++){var s=r[i];n[s]&&(n[s]=this.mapDate(n[s],this._columns.get(s).type))}e=new S(this._columns,n)}else e=this.createRow(t);this.cachedRows.push(e);var a=this.getCachedCount();return a>this.total&&(this.total=a),e},t.prototype.getCachedRows=function(){return this.cachedRows},t.prototype.totalIsKnown=function(){return this.elasticChunks?this.getCachedCount()===this.total:!this.needTotal},t.prototype.fireUpdated=function(){this.onUpdate&&this.onUpdate(this)},t}(),M=function(){function t(){}return t.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))},t}(),B=function(){function t(t){this.silentMode=0,this.events=new Array,this.source=t}return t.prototype.subscribe=function(t,e){var n=this.getEventRecByType(t),o={id:M.newGuid(),callback:e};return n?n.eventCallbacks.push(o):(n={type:t,eventCallbacks:new Array(o)},this.events.push(n)),o.id},t.prototype.unsubscribe=function(t,e){var n=this.getEventRecByType(t);if(n){var o=-1;for(o=0;o<n.eventCallbacks.length&&n.eventCallbacks[o].id!==e;o++);o>=0&&n.eventCallbacks.splice(o,1)}},t.prototype.fire=function(t,e,n,o){if(void 0===n&&(n=0),void 0===o&&(o=!1),!this.silentMode||o){var i=this.getEventRecByType(t);if(i){var r={type:t,source:this.source,data:e},s=function(){for(var t=0,e=i.eventCallbacks;t<e.length;t++){e[t].callback(r)}};n>0?setTimeout(s,n):s()}}},t.prototype.enterSilentMode=function(){this.silentMode++},t.prototype.exitSilentMode=function(){this.silentMode&&this.silentMode--},t.prototype.isSilent=function(){return this.silentMode>0},t.prototype.getEventRecByType=function(t){for(var e=0,n=this.events;e<n.length;e++){var o=n[e];if(o.type==t)return o}return null},t}();!function(t){t.renderLiquidTemplate=function(t,e){var n=t;if(e)for(var o in e){var i=new RegExp("{{"+o+"}}","g");n=n.replace(i,e[o])}return n}}(E||(E={})),c.resetLocales(),"function"!=typeof Object.values&&(Object.values=function(t){return Object.keys(t).map((function(e){return t[e]}))}),"function"!=typeof Math.trunc&&(Math.trunc=function(t){return isNaN(t)?NaN:t>0?Math.floor(t):Math.ceil(t)})},514:function(t,e,n){n.d(e,{M:function(){return et},w4:function(){return it},Hq:function(){return x},KX:function(){return S},J1:function(){return V},bF:function(){return r},MN:function(){return i},sJ:function(){return u},uC:function(){return D},Yy:function(){return I},lE:function(){return p},MX:function(){return h},S3:function(){return d},L8:function(){return f},e6:function(){return s},pn:function(){return c},V_:function(){return a},qw:function(){return g},iM:function(){return m},AN:function(){return l}});var o=n(902);n(789);function i(t,e,n){var o=document.createElement(e),i=n||{};return i.cssClass&&(o.className=i.cssClass),t.appendChild(o),o}function r(t,e){t.className=t.className?t.className+" "+e:e}function s(t){t.style.display="none"}function a(t,e){e||(e=""),t.style.display=e}function l(t,e,n){n||(n={}),n.display||(n.display=""),n.duration||(n.duration=200),s(t),a(e,n.display),n.complete&&n.complete()}function c(t){return"none"!=t.style.display&&0!=t.offsetWidth&&0!=t.offsetHeight}function u(t){var e;return"function"==typeof Event?e=new Event(t):(e=document.createEvent("Event")).initEvent(t,!0,!0),e}function d(){return{width:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),height:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}function h(){var t=document.body,e=document.documentElement;return{top:window.pageYOffset||e.scrollTop||t.scrollTop,left:window.pageXOffset||e.scrollLeft||t.scrollLeft}}function p(t){var e={x:0,y:0};if(null!==t){var n=function(t){var e,n={top:0,right:0,bottom:0,left:0,width:0,height:0};try{e=t.getBoundingClientRect()}catch(t){e=n}var o=document.body,i=document.documentElement,r=h(),s=r.top,a=r.left,l=i.clientTop||o.clientTop||0,c=i.clientLeft||o.clientLeft||0,u=e.top+s-l,d=e.left+a-c;return{top:Math.round(u),left:Math.round(d)}}(t);e={x:n.left,y:n.top}}return e}function f(){return{width:window.innerWidth,height:window.innerHeight}}function g(t,e,n){t.style.removeProperty("display");var o=window.getComputedStyle(t).display;"none"===o&&(o="block"),t.style.display=o;var i=t.offsetHeight;t.style.overflow="hidden",t.style.height="0px",t.style.paddingTop="0px",t.style.paddingBottom="0px",t.style.marginTop="0px",t.style.marginBottom="0px",t.offsetHeight,t.style.boxSizing="border-box",t.style.transitionProperty="height, margin, padding",t.style.transitionDuration=e+"ms",t.style.height=i+"px",t.style.removeProperty("padding-top"),t.style.removeProperty("padding-bottom"),t.style.removeProperty("margin-top"),t.style.removeProperty("margin-bottom"),window.setTimeout((function(){t.style.removeProperty("height"),t.style.removeProperty("overflow"),t.style.removeProperty("transition-duration"),t.style.removeProperty("transition-property"),t.style.removeProperty("box-sizing"),n&&n()}),e)}function m(t,e,n){t.style.transitionProperty="height, margin, padding",t.style.transitionDuration=e+"ms",t.style.boxSizing="border-box",t.style.height=t.offsetHeight+"px",t.offsetHeight,t.style.overflow="hidden",t.style.height="0px",t.style.paddingTop="0px",t.style.paddingBottom="0px",t.style.marginTop="0px",t.style.marginBottom="0px",window.setTimeout((function(){t.style.display="none",t.style.removeProperty("height"),t.style.removeProperty("padding-top"),t.style.removeProperty("padding-bottom"),t.style.removeProperty("margin-top"),t.style.removeProperty("margin-bottom"),t.style.removeProperty("overflow"),t.style.removeProperty("transition-duration"),t.style.removeProperty("transition-property"),t.style.removeProperty("box-sizing"),n&&n()}),e)}var y="eqjs";var v,C=(v=function(t,e){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},v(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}v(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),b=function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))},x=function(){function t(t,e){this.element="string"==typeof t?document.createElement(t):t,e&&this.element.parentElement!==e&&e.appendChild(this.element)}return t.prototype.addChild=function(t,e){var n=D(t,this.element);return e&&e(n),this},t.prototype.addChildElement=function(t){return t&&this.element.appendChild(t),this},t.prototype.attr=function(t,e){return this.element.setAttribute(t,e),this},t.prototype.id=function(t){return this.attr("id",t)},t.prototype.focus=function(){return this.element.focus(),this},t.prototype.title=function(t){return this.attr("title",t)},t.prototype.data=function(t,e){return void 0===e&&(e=null),null===e?(this.element.removeAttribute("data-"+t),this):this.attr("data-"+t,e)},t.prototype.show=function(){return this.removeStyle("display")},t.prototype.hide=function(t){return void 0===t&&(t=!0),t?this.setStyle("display","none"):this},t.prototype.visible=function(t){return void 0===t&&(t=!0),t?this.setStyle("visibility","visible"):this.setStyle("visibility","hidden")},t.prototype.isVisible=function(){return!!(this.element.offsetWidth||this.element.offsetHeight||this.element.getClientRects().length)},t.prototype.addClass=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t)for(var o=b(b([],t.trim().split(" "),!0),e,!0),i=0;i<o.length;i++)this.element.classList.add(o[i]);return this},t.prototype.removeClass=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t)for(var o=b(b([],t.trim().split(" "),!0),e,!0),i=0;i<o.length;i++)this.element.classList.remove(o[i]);return this},t.prototype.toggleClass=function(t,e){return void 0===e&&(e=void 0),t&&this.element.classList.toggle(t,e),this},t.prototype.on=function(t,e){for(var n=t.split(" "),o=0;o<n.length;o++)this.element.addEventListener(n[o],e);return this},t.prototype.off=function(t,e){for(var n=t.split(" "),o=0;o<n.length;o++)this.element.removeEventListener(n[o],e);return this},t.prototype.setStyle=function(t,e){return this.element.style.setProperty(t,e),this},t.prototype.removeStyle=function(t){return this.element.style.removeProperty(t),this},t.prototype.text=function(t){return this.element.innerText=t,this},t.prototype.html=function(t){return this.element.innerHTML=t,this},t.prototype.clear=function(){var t=this.element;this.element=document.createElement(this.element.tagName),t.replaceWith(this.element)},t.prototype.addText=function(t){var e=document.createTextNode(t);return this.element.appendChild(e),this},t.prototype.addHtml=function(t){return this.element.innerHTML+=t,this},t.prototype.toDOM=function(){return this.element},t.prototype.appendTo=function(t){return t&&t.appendChild(this.element),this},t}(),w=function(t){function e(e,n){return e?t.call(this,e,n)||this:t.call(this,"textarea",n)||this}return C(e,t),e.prototype.name=function(t){return this.element.name=t,this},e.prototype.rows=function(t){return this.element.rows=t,this},e.prototype.cols=function(t){return this.element.cols=t,this},e.prototype.value=function(t){return this.element.value=t,this},e}(x),E=function(t){function e(e,n){return e?t.call(this,e,n)||this:t.call(this,"input",n)||this}return C(e,t),e.prototype.name=function(t){return this.element.name=t,this},e.prototype.type=function(t){return this.element.type=t,this},e.prototype.size=function(t){return this.element.size=t,this},e.prototype.value=function(t){return t instanceof Date?this.element.valueAsDate=t:"number"==typeof t?this.element.valueAsNumber=t:this.element.value=t,this},e.prototype.mask=function(t){return function(t,e){var n={9:"[0-9]",a:"[a-z]"},o=e.split(""),i=function(e){if("focus"!==e.type||""===t.value){var i=[],r=t.selectionStart;o.forEach((function(e,o){if(n[e]){var r=new RegExp(n[e],"i").test(t.value.charAt(o));i.push(r?t.value.charAt(o):"_")}else i.push(e)})),t.value=i.join(""),t.selectionStart=t.selectionEnd=r}};t.addEventListener("keydown",(function(e){if(8===e.keyCode||46===e.keyCode){e.preventDefault();var i=[],r=t.selectionStart;if(0==r)return;for(var s=r,a=!0,l=o.length-1;l>=0;l--){var c=o[l];if(n[c]){var u=new RegExp(n[c],"i").test(t.value.charAt(l));u&&l!=r-1&&(a=!1),l===r-1&&s--,i.push(u&&l!=r-1?t.value.charAt(l):"_")}else l===s-1&&s--,r-1===l&&r--,i.push(c)}t.value=a?"":i.reverse().join(""),t.selectionStart=t.selectionEnd=s<0?0:s;var d=document.createEvent("Event");d.initEvent("input",!0,!0),t.dispatchEvent(d)}})),t.addEventListener("keypress",(function(e){var i=String.fromCharCode(e.charCode);if(i){e.preventDefault();var r=[],s=t.selectionStart,a=s;o.forEach((function(e,o){if(n[e]){var l=o!=s?t.value.charAt(o):i,c=new RegExp(n[e],"i").test(l);r.push(c?l:"_"),c&&s===o&&a++}else r.push(e),a===o&&a++,s===o&&s++})),t.value=r.join(""),t.selectionStart=t.selectionEnd=a;var l=document.createEvent("Event");l.initEvent("input",!0,!0),t.dispatchEvent(l)}})),t.addEventListener("input",i),t.addEventListener("focus",i)}(this.element,t),this},e}(x),T=function(t){function e(e,n){return e?t.call(this,e,n)||this:t.call(this,"select",n)||this}return C(e,t),e.prototype.addOption=function(t){var e=document.createElement("option");return"string"==typeof t?(e.value=t,e.innerHTML=t):(e.value=t.value,e.innerHTML=t.title||t.value,e.selected=t.selected||!1),this.element.appendChild(e),this},e.prototype.value=function(t){return this.element.value=t,this},e}(x);function D(t,e){return"div"===t||t instanceof HTMLDivElement||"span"===t||t instanceof HTMLSpanElement||"a"===t||t instanceof HTMLAnchorElement||"button"===t||t instanceof HTMLButtonElement||"img"===t||t instanceof HTMLImageElement?new x(t,e):"input"===t||t instanceof HTMLInputElement?new E(t instanceof HTMLInputElement?t:null,e):"textarea"===t||t instanceof HTMLTextAreaElement?new w(t instanceof HTMLTextAreaElement?t:null,e):"select"===t||t instanceof HTMLSelectElement?new T(t instanceof HTMLSelectElement?t:null,e):new x(t,e)}var S,k="undefined"!=typeof TouchEvent;!function(t){t.None="none",t.Allow="allow",t.Forbid="forbid"}(S||(S={}));var M,B=function(t,e,n){this.dropEffect=S.Allow,this.pageX=0,this.pageY=0,this.item=t,this.dragImage=e,this.data=t.data,this.sourceEvent=n,n&&n instanceof MouseEvent&&(this.pageX=n.pageX,this.pageY=n.pageY),n&&k&&n instanceof TouchEvent&&n.touches[0]&&(this.pageX=n.touches[0].pageX,this.pageY=n.touches[0].pageY)},P=function(t){t&&t instanceof MouseEvent&&(this.x=t.pageX,this.y=t.pageY),t&&k&&t instanceof TouchEvent&&t.touches[0]&&(this.x=t.touches[0].pageX,this.y=t.touches[0].pageY)},I=new(function(){function t(){this.delta=5,this.draggableItem=null,this.dragImage=null,this.finishedSuccessfully=!1,this.mouseDownPosition=null,this.containerDescriptors=[],this.containerDescriptorIndex=-1,this.dropEffect=S.None,this.classPrefix="eqjs-drop",this.DRAG_DISABLED_ATTR="drag-disabled"}return t.prototype.registerDraggableItem=function(t){var e=this,n=t.element;if(!n)throw Error("Element in draggle item is null or undefined");n.ondragstart=function(){return!1};var o=function(t){if(!n.hasAttribute(e.DRAG_DISABLED_ATTR)){t.preventDefault(),t instanceof MouseEvent&&t.stopPropagation();var o=new P(t);(Math.abs(o.x-e.mouseDownPosition.x)>e.delta||Math.abs(o.y-e.mouseDownPosition.y)>e.delta)&&r(t)}},i=function(t){e.mouseMoveDragListener(t)},r=function(r){r.preventDefault(),r.stopPropagation(),n.removeEventListener("mousemove",o),n.removeEventListener("touchmove",o),e.finishedSuccessfully=!1,t.beforeDragStart&&t.beforeDragStart(),e.dragImage=D("div").setStyle("position","absolute").setStyle("z-index","65530").toDOM(),document.body.appendChild(e.dragImage),e.dragImage.appendChild(n.cloneNode(!0)),t.renderer&&t.renderer(e.dragImage),e.dropEffect=S.None,e.updateCusror(e.dropEffect),e.updateImageClass(e.dropEffect),e.draggableItem={element:n,scope:t.scope,data:t.data},e.updateDragItemPosition(r);var s=new B(e.draggableItem,e.dragImage,r);s.dropEffect=e.dropEffect,t.onDragStart&&t.onDragStart(s),e.dropEffect!==s.dropEffect&&(e.dropEffect=s.dropEffect,e.updateImageClass(e.dropEffect)),document.addEventListener("mousemove",i,!0),document.addEventListener("touchmove",i,!0)},s=function(t){k&&t instanceof TouchEvent&&t.preventDefault(),e.mouseDownPosition=new P(t),n.addEventListener("mousemove",o),n.addEventListener("touchmove",o),document.addEventListener("mouseup",a),document.addEventListener("touchend",a)};n.addEventListener("mousedown",s),n.addEventListener("touchstart",s);var a=function(t){e.mouseDownPosition=null,n.removeEventListener("mousemove",o),n.removeEventListener("touchmove",o),document.removeEventListener("mousemove",i,!0),document.removeEventListener("touchmove",i,!0),e.draggableItem&&l(t)},l=function(n){try{if(e.containerDescriptorIndex>=0){var o=e.containerDescriptors[e.containerDescriptorIndex],i={element:o.element,scopes:o.scopes,data:o.data},r=new B(e.draggableItem,e.dragImage,n);try{i.scopes.indexOf(e.draggableItem.scope)>=0&&e.dropEffect===S.Allow&&(e.finishedSuccessfully=!0,o.onDrop&&o.onDrop(i,r))}finally{o.onDragLeave&&o.onDragLeave(i,r)}}}finally{try{var s=new B(e.draggableItem,e.dragImage,n);s.data.finishedSuccessfully=e.finishedSuccessfully,t.onDragEnd&&t.onDragEnd(s)}finally{e.draggableItem=null,e.dragImage&&e.dragImage.parentElement&&e.dragImage.parentElement.removeChild(e.dragImage),e.dragImage=null,e.finishedSuccessfully=!1,document.removeEventListener("mouseup",a),document.removeEventListener("touchend",a)}}}},t.prototype.registerDropContainer=function(t){if(!t.element)throw Error("Element in drop container is null or undefined");this.containerDescriptors.push(t)},t.prototype.removeDropContainer=function(t){var e=this.containerDescriptors.filter((function(e){return e===t||e.element==t}));if(e)for(var n=0,i=e;n<i.length;n++){var r=i[n];o.P6.removeArrayItem(this.containerDescriptors,r)}},t.prototype.mouseMoveDragListener=function(t){if(t instanceof MouseEvent&&t.preventDefault(),t.stopPropagation(),this.updateDragItemPosition(t),-1==this.containerDescriptorIndex){for(var e=0;e<this.containerDescriptors.length;e++){var n=this.containerDescriptors[e];if(this.detectDragEnterEvent(n.element,t)){this.containerDescriptorIndex=e;break}}this.containerDescriptorIndex>=0&&this.dragEnterEvent(t)}else{n=this.containerDescriptors[this.containerDescriptorIndex];this.detectDragLeaveEvent(n.element,t)&&(this.dragLeaveEvent(t),this.containerDescriptorIndex=-1)}if(this.containerDescriptorIndex>=0){var o={element:(n=this.containerDescriptors[this.containerDescriptorIndex]).element,scopes:n.scopes,data:n.data};if(o.scopes.indexOf(this.draggableItem.scope)>=0){var i=new B(this.draggableItem,this.dragImage,t);i.dropEffect=this.dropEffect,n.onDragOver&&n.onDragOver(o,i)}}},t.prototype.updateCusror=function(t){switch(t){case S.Allow:this.setCursorStyle(this.dragImage,"grabbing");break;case S.Forbid:this.setCursorStyle(this.dragImage,"no-drop");break;default:this.setCursorStyle(this.dragImage,"grabbing")}},t.prototype.updateImageClass=function(t){switch(this.dragImage.classList.remove("".concat(this.classPrefix,"-allow")),this.dragImage.classList.remove("".concat(this.classPrefix,"-forbid")),this.dragImage.classList.remove("".concat(this.classPrefix,"-none")),t){case S.Allow:this.dragImage.classList.add("".concat(this.classPrefix,"-allow"));break;case S.None:this.dragImage.classList.add("".concat(this.classPrefix,"-none"));break;case S.Forbid:this.dragImage.classList.add("".concat(this.classPrefix,"-forbid"));break;default:this.dragImage.classList.add("".concat(this.classPrefix,"-none"))}},t.prototype.setCursorStyle=function(t,e){if(t){t.style.cursor=e;for(var n=0;n<t.children.length;n++)this.setCursorStyle(t.children[n],e)}},t.prototype.updateDragItemPosition=function(t){if(this.dragImage){var e=new P(t);this.dragImage.style.top=e.y-this.dragImage.offsetHeight/2+"px",this.dragImage.style.left=e.x-this.dragImage.offsetWidth/2+"px"}},t.prototype.dragEnterEvent=function(t){var e=this.containerDescriptors[this.containerDescriptorIndex],n={element:e.element,scopes:e.scopes,data:e.data};if(n.scopes.indexOf(this.draggableItem.scope)>=0){var o=new B(this.draggableItem,this.dragImage,t);o.dropEffect=S.Allow,e.onDragEnter&&e.onDragEnter(n,o),this.dropEffect=o.dropEffect,this.updateCusror(this.dropEffect),this.updateImageClass(this.dropEffect)}else this.dropEffect!==S.Forbid&&(this.dropEffect=S.None,this.updateCusror(this.dropEffect),this.updateImageClass(this.dropEffect))},t.prototype.dragLeaveEvent=function(t){var e=this.containerDescriptors[this.containerDescriptorIndex],n={element:e.element,scopes:e.scopes,data:e.data};if(n.scopes.indexOf(this.draggableItem.scope)>=0){var o=new B(this.draggableItem,this.dragImage,t);o.dropEffect=S.None,e.onDragLeave&&e.onDragLeave(n,o),this.dropEffect=o.dropEffect,this.updateCusror(this.dropEffect),this.updateImageClass(this.dropEffect)}},t.prototype.detectDragEnterEvent=function(t,e){var n=p(t),o=new P(e);return!(o.y<n.y||o.y>n.y+t.offsetHeight)&&!(o.x<n.x||o.x>n.x+t.offsetWidth)},t.prototype.detectDragLeaveEvent=function(t,e){var n=p(t),o=new P(e);return!(o.y>n.y&&o.y<n.y+t.offsetHeight&&o.x>n.x&&o.x<n.x+t.offsetWidth)},t}());!function(t){t[t.Always=0]="Always",t[t.Once=1]="Once",t[t.Never=2]="Never"}(M||(M={}));var A,O="keg",L=/{0:(.*?)}/g;!function(t){t[t.STRING=1]="STRING",t[t.NUMBER=2]="NUMBER",t[t.DATETIME=3]="DATETIME",t[t.BOOL=4]="BOOL"}(A||(A={}));var R,_=function(t,e,n,o){var i=t?t.toString().replace(/\n/g,"↵ "):"";n.innerText=i,n.title=i,e.align==R.NONE&&n.classList.add("".concat(O,"-cell-value-align-left"))},F=function(t,e,n,i){var r=(t||"").toString();"number"==typeof t&&(r=e.dataColumn&&e.dataColumn.displayFormat&&L.test(e.dataColumn.displayFormat)?e.dataColumn.displayFormat.replace(L,(function(e,n){return o.ag.numberToStr(t,n)})):t.toLocaleString()),n.innerText=r,n.title=r,e.align==R.NONE&&n.classList.add("".concat(O,"-cell-value-align-right"))},Q=function(t,e,n,i){var r="[object Date]"===Object.prototype.toString.call(t),s=(t||"").toString();if(r)if(e.dataColumn&&e.dataColumn.displayFormat&&L.test(e.dataColumn.displayFormat))s=e.dataColumn.displayFormat.replace(L,(function(n,i){return o.ag.dateTimeToStr(t,e.type,i)}));else{var a=o.ag.getCurrentLocale(),l={hour:"numeric",minute:"numeric",second:"numeric"};switch(e.type){case o.g.Date:s=t.toLocaleDateString(a);break;case o.g.Time:s=t.toLocaleTimeString(a,l);break;case o.g.DateTime:s="".concat(t.toLocaleDateString(a)," ").concat(t.toLocaleTimeString(a,l))}}n.innerText=s,n.title=s,e.align==R.NONE&&n.classList.add("".concat(O,"-cell-value-align-right"))},N=function(t,e,n,i){if(e.dataColumn&&e.dataColumn.displayFormat&&L.test(e.dataColumn.displayFormat)){var r=e.dataColumn.displayFormat.replace(L,(function(e,n){return o.ag.booleanToStr(t,n)}));return _(r,e,n)}n.classList.add("".concat(O,"-cell-value-bool")),n.classList.add("".concat(O,"-").concat(t?"cell-value-true":"cell-value-false"))},q=function(){function t(t){this.renderers={},this.defaultRenderers={},this.registerRenderer("StringDefault",_),this.setDefaultRenderer(A.STRING,_),this.registerRenderer("NumberDefault",F),this.setDefaultRenderer(A.NUMBER,F),this.registerRenderer("DateTimeDefault",Q),this.setDefaultRenderer(A.DATETIME,Q),this.registerRenderer("BoolDefault",N),this.setDefaultRenderer(A.BOOL,N)}return t.prototype.getDefaultRenderer=function(t){var e=this.getCellType(t);return this.defaultRenderers[A[e]]},t.prototype.getDefaultRendererByType=function(t){return this.defaultRenderers[A[t]]},t.prototype.setDefaultRenderer=function(t,e){e&&(this.defaultRenderers[A[t]]=e)},t.prototype.getRenderer=function(t){return this.renderers[t]},t.prototype.registerRenderer=function(t,e){this.renderers[t]=e},t.prototype.getCellType=function(t){switch(t){case o.g.Autoinc:case o.g.Byte:case o.g.Word:case o.g.Currency:case o.g.Float:case o.g.Int32:case o.g.Int64:return A.NUMBER;case o.g.Date:case o.g.DateTime:case o.g.Time:return A.DATETIME;case o.g.Bool:return A.BOOL;default:return A.STRING}},t}();!function(t){t[t.NONE=1]="NONE",t[t.LEFT=2]="LEFT",t[t.CENTER=3]="CENTER",t[t.RIGHT=4]="RIGHT"}(R||(R={}));var H,W=function(){function t(t,e,n){void 0===n&&(n=!1),this._label=null,this._description=null,this.align=R.NONE,this.isVisible=!0,this.isRowNum=!1,this.dataColumn=t,this.grid=e;var i=e.options.columnWidths||{};t?(t.style.alignment&&(this.align=function(t){switch(t){case o.iW.Left:return R.LEFT;case o.iW.Center:return R.CENTER;case o.iW.Right:return R.RIGHT;default:return R.NONE}}(t.style.alignment)),this.width=i&&i[this.type]?i[this.type].default:250,this.cellRenderer=this.grid.cellRendererStore.getDefaultRenderer(t.type),this._description=t.description):n&&(this.isRowNum=!0,this.width=i&&i.rowNumColumn?i.rowNumColumn.default:60,this._label="",this.cellRenderer=this.grid.cellRendererStore.getDefaultRendererByType(A.NUMBER)),e&&e.options&&e.options.onGetCellRenderer&&(this.cellRenderer=e.options.onGetCellRenderer(this,this.cellRenderer)||this.cellRenderer)}return Object.defineProperty(t.prototype,"label",{get:function(){return this._label?this._label:this.isRowNum?"":this.dataColumn.label},set:function(t){this._label=this.label},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"description",{get:function(){return this._description},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.dataColumn?this.dataColumn.type:null},enumerable:!1,configurable:!0}),t}(),j=function(){function t(t,e){this.items=[],this.grid=e,this.sync(t)}return t.prototype.sync=function(t,e){void 0===e&&(e=!0),this.clear();var n=new W(null,this.grid,!0);if(this.add(n),e||(n.isVisible=!1),t)for(var o=0,i=t.getItems();o<i.length;o++){var r=i[o],s=new W(r,this.grid);this.grid.options.onSyncGridColumn&&this.grid.options.onSyncGridColumn(s),this.add(s)}},Object.defineProperty(t.prototype,"count",{get:function(){return this.items.length},enumerable:!1,configurable:!0}),t.prototype.add=function(t){var e=this.items.length;return this.items.push(t),e},t.prototype.put=function(t,e){t>=0&&t<this.items.length&&(this.items[t]=e)},t.prototype.move=function(t,e){var n=this.items.indexOf(t);n>=0&&n!=e&&o.P6.moveArrayItem(this.items,n,e)},t.prototype.get=function(t){return t>=0&&t<this.items.length?this.items[t]:null},t.prototype.getItems=function(){return this.items},t.prototype.removeAt=function(t){this.get(t);this.items.splice(t,1)},t.prototype.clear=function(){this.items=[]},t}(),G=function(){return G=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},G.apply(this,arguments)},z=function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))},V=function(){function t(t){if(this.cssPrefix="keg",this.pagination={page:1,pageSize:30,total:0},this.paginationOptions={maxButtonCount:10,useBootstrap:!1},this.defaultDataGridOptions={slot:null,dataTable:null,fixHeightOnFirstRender:!1,syncGridColumns:!0,useRowNumeration:!0,allowDragDrop:!1,aggregates:{settings:null,calculator:null},paging:{enabled:!0,pageSize:30,pageSizeItems:[20,30,50,100,200]},columnWidths:{autoResize:M.Always,stringColumns:{min:100,max:500,default:250},numberColumns:{min:60,default:120},boolColumns:{min:50,default:80},dateColumns:{min:80,default:200},otherColumns:{min:100,max:500,default:250},rowNumColumn:{min:40,default:60}},showPlusButton:!1,viewportRowsCount:null,showActiveRow:!0},this.rowsOnPagePromise=null,this.containerInitialHeight=0,this.firstRender=!0,this.prevRowTotals=null,this.landingIndex=-1,this.landingSlot=D("div").addClass("".concat(this.cssPrefix,"-col-landing-slot")).addChildElement(D("div").toDOM()).toDOM(),this._activeRowIndex=-1,t&&t.paging&&(t.paging=o.P6.assign(this.defaultDataGridOptions.paging,t.paging)),this.options=this.mergeOptions(t),this.processColumnWidthsOptions(),!this.options.slot)throw Error('"slot" parameter is required to initialize EasyDataGrid');if(!this.options.dataTable)throw Error('"dataTable" parameter is required to initialize EasyDataGrid');this.dataTable=t.dataTable,this.eventEmitter=new o.vp(this),this.cellRendererStore=new q(t),this.columns=new j(this.dataTable.columns,this),this.setSlot(this.options.slot),this.init(this.options)}return t.prototype.mergeOptions=function(t){var e=o.P6.assignDeep({},this.defaultDataGridOptions.columnWidths,t.columnWidths),n=o.P6.assignDeep({},this.defaultDataGridOptions.paging,t.paging),i=o.P6.assign({},this.defaultDataGridOptions,t);return i.columnWidths=e,i.paging=n,i},t.prototype.processColumnWidthsOptions=function(){var t=this.options.columnWidths;if(t){o.P6.getStringDataTypes().forEach((function(e){t[e]=G(G({},t.stringColumns),t[e])})),o.P6.getNumericDataTypes().forEach((function(e){t[e]=G(G({},t.numberColumns),t[e])})),t[o.g.Bool]=G(G({},t.boolColumns),t[o.g.Bool]),o.P6.getDateDataTypes().forEach((function(e){t[e]=G(G({},t.dateColumns),t[e])}));var e=z(z(z(z([],o.P6.getStringDataTypes(),!0),o.P6.getNumericDataTypes(),!0),o.P6.getDateDataTypes(),!0),[o.g.Bool],!1);o.P6.getAllDataTypes().forEach((function(n){n in e||(t[n]=G(G({},t.otherColumns),t[n]))})),t[o.g.Unknown]=t.otherColumns}},t.prototype.setSlot=function(t){if("string"==typeof t){if(t.length)if("#"===t[0])this.slot=document.getElementById(t.substring(1));else{if("."!==t[0])throw Error("Unrecognized slot parameter (Must be id, class or HTMLElement): "+t);var e=document.getElementsByClassName(t.substring(1));e.length&&(this.slot=e[0])}}else this.slot=t},t.prototype.init=function(t){var e=this;t.onInit&&this.addEventListener("init",t.onInit),t.onRowClick&&this.addEventListener("rowClick",t.onRowClick),t.onRowDbClick&&this.addEventListener("rowDbClick",t.onRowDbClick),t.onPlusButtonClick&&this.addEventListener("plusButtonClick",t.onPlusButtonClick),t.onColumnChanged&&this.addEventListener("columnChanged",t.onColumnChanged),t.onColumnDeleted&&this.addEventListener("columnDeleted",t.onColumnDeleted),t.onColumnMoved&&this.addEventListener("columnMoved",t.onColumnMoved),t.onPageChanged&&this.addEventListener("pageChanged",t.onPageChanged),t.onActiveRowChanged&&this.addEventListener("activeRowChanged",t.onActiveRowChanged),this.addEventListener("pageChanged",(function(t){return e.activeRowIndex=-1})),o.P6.assignDeep(this.paginationOptions,t.pagination),this.pagination.pageSize=this.options.paging.pageSize||this.pagination.pageSize,this.options.allowDragDrop&&I.registerDropContainer({element:this.slot,scopes:["gridColumnMove"],onDragEnter:function(t,n){e.slot.classList.add("".concat(y,"-drophover")),e.showLandingSlot(n.pageX,n.pageY)},onDragOver:function(t,n){e.showLandingSlot(n.pageX,n.pageY)},onDragLeave:function(t,n){n.dropEffect=S.Forbid,e.slot.classList.remove("".concat(y,"-drophover")),e.hideLandingSlot()},onDrop:function(t,n){e.dataTable.columns.move(n.data.column,e.landingIndex),e.refresh(),e.fireEvent({type:"columnMoved",columnId:n.data.column.id,newIndex:e.landingIndex})}}),this.refresh(),this.fireEvent("init")},t.prototype.fireEvent=function(t){"string"==typeof t?this.eventEmitter.fire(t):this.eventEmitter.fire(t.type,t)},t.prototype.setData=function(t){this.dataTable=t,this.clear(),this.refresh()},t.prototype.getData=function(){return this.dataTable},t.prototype.getColumns=function(){return this.columns},t.prototype.destroy=function(){this.slot.innerHTML=""},t.prototype.refresh=function(){this.clearDOM(),this.render()},t.prototype.clearDOM=function(){this.slot.innerHTML=""},t.prototype.clear=function(){this.pagination.page=1,this.clearDOM()},t.prototype.render=function(){var t=this;if(this.hasData()||this.options.showPlusButton){this.containerInitialHeight=this.slot.clientHeight,this.rootDiv=document.createElement("div"),this.rootDiv.style.width="100%",this.rootDiv.classList.add("".concat(this.cssPrefix,"-root")),this.columns.sync(this.dataTable.columns,this.options.useRowNumeration),this.renderHeader(),this.rootDiv.appendChild(this.headerDiv),this.renderBody(),this.rootDiv.appendChild(this.bodyDiv),this.renderFooter(),this.rootDiv.appendChild(this.footerDiv);var e=document.createElement("div");e.classList.add("".concat(this.cssPrefix,"-container")),e.appendChild(this.rootDiv),this.slot.appendChild(e);var n=this.options.columnWidths.autoResize!==M.Never;this.rowsOnPagePromise?this.rowsOnPagePromise.then((function(){return t.updateHeight()})).then((function(){t.firstRender=!1,t.rowsOnPagePromise=null})):setTimeout((function(){t.updateHeight().then((function(){t.firstRender=!1,n&&t.resizeColumns()}))}),100)}},t.prototype.updateHeight=function(){var t=this;return new Promise((function(e){if(t.options.viewportRowsCount){var n=t.bodyCellContainerDiv.firstElementChild,o=(n?n.offsetHeight:36)*t.options.viewportRowsCount;return D(t.bodyViewportDiv).setStyle("height","".concat(o,"px")),void setTimeout((function(){var n=t.bodyViewportDiv.offsetHeight-t.bodyViewportDiv.clientHeight;o+=n,D(t.bodyViewportDiv).setStyle("height","".concat(o,"px")),e()}),100)}t.containerInitialHeight,e()})).then((function(){t.options.fixHeightOnFirstRender&&t.firstRender&&(t.slot.style.height="".concat(t.slot.offsetHeight,"px"))}))},t.prototype.getContainerWidth=function(){return this.columns.getItems().filter((function(t){return t.isVisible})).map((function(t){return t.width})).reduce((function(t,e){return t+e}))},t.prototype.renderHeader=function(){var t=this;this.headerDiv=D("div").addClass("".concat(this.cssPrefix,"-header")).toDOM(),this.headerViewportDiv=D("div",this.headerDiv).addClass("".concat(this.cssPrefix,"-header-viewport")).toDOM(),this.headerCellContainerDiv=D("div",this.headerViewportDiv).addClass("".concat(this.cssPrefix,"-header-cell-container")).toDOM(),this.headerRowDiv=D("div",this.headerCellContainerDiv).addClass("".concat(this.cssPrefix,"-header-row")).toDOM(),this.columns.getItems().forEach((function(e,n){if(e.isVisible){var o=t.renderColumnHeader(e,n);t.headerRowDiv.appendChild(o),e.isRowNum&&D(o).addChildElement(t.renderHeaderButtons())}}));var e=this.getContainerWidth();D(this.headerCellContainerDiv).setStyle("width","".concat(e,"px"))},t.prototype.hasData=function(){return this.dataTable.columns.count>0},t.prototype.renderColumnHeader=function(t,e){var n=this,o=D("div").addClass("".concat(this.cssPrefix,"-header-cell")).data("col-idx","".concat(e)).setStyle("width","".concat(t.width,"px"));t.dataColumn&&o.data("col-id","".concat(t.dataColumn.id));var i=o.toDOM();return D("div",i).addClass("".concat(this.cssPrefix,"-header-cell-resize")),t.isRowNum||D("div",i).addClass("".concat(this.cssPrefix,"-header-cell-label")).text(t.label),t.description&&D("div",i).addClass("question-mark").title(t.description),this.options.allowDragDrop&&I.registerDraggableItem({element:i,scope:"gridColumnMove",data:{column:t},renderer:function(e){e.innerHTML="";var o=document.createElement("div");o.innerText=t.label,e.classList.add("".concat(n.cssPrefix,"-sortable-helper")),e.appendChild(o)},onDragStart:function(t){t.dropEffect=S.Allow}}),i},t.prototype.renderBody=function(){var t=this;this.bodyDiv=D("div").addClass("".concat(this.cssPrefix,"-body")).toDOM(),this.bodyViewportDiv=D("div",this.bodyDiv).addClass("".concat(this.cssPrefix,"-body-viewport")).attr("tabIndex","0").toDOM(),this.bodyCellContainerDiv=D("div",this.bodyViewportDiv).addClass("".concat(this.cssPrefix,"-cell-container")).toDOM();var e=this.canShowAggregates();this.dataTable&&(this.showProgress(),this.rowsOnPagePromise=this.getRowsToRender().then((function(n){t.pagination.total=t.dataTable.getTotal(),t.hideProgress(),t.bodyCellContainerDiv.innerHTML="",t.prevRowTotals=null;var i=0;if(n.length){var r=e?t.options.aggregates.settings.getGroups():[];i=n.length<t.pagination.pageSize?n.length:t.pagination.pageSize,n.forEach((function(n,o){if(e&&t.updateTotalsState(r,n),o<i){var s=t.renderRow(n,o);t.bodyCellContainerDiv.appendChild(s)}}));var s=t.options.aggregates&&t.options.aggregates.showGrandTotalsOnEachPage;if(e&&(t.isLastPage()||s)){var a=new o.QJ(t.dataTable.columns,new Array(t.dataTable.columns.count));t.updateTotalsState(r,a,!0)}}if(t.options.columnWidths.autoResize!==M.Never)t.resizeColumns();else{var l=t.getContainerWidth();D(t.bodyCellContainerDiv).setStyle("width","".concat(l,"px"))}return i})).catch((function(t){return console.error(t),0}))),this.bodyViewportDiv.addEventListener("scroll",(function(e){D(t.headerViewportDiv).setStyle("margin-left","-".concat(t.bodyViewportDiv.scrollLeft,"px"))})),this.bodyViewportDiv.addEventListener("keydown",this.onViewportKeydown.bind(this))},t.prototype.isLastPage=function(){return this.dataTable.elasticChunks?this.dataTable.totalIsKnown()&&this.pagination.page*this.pagination.pageSize>=this.pagination.total:this.pagination.page*this.pagination.pageSize>=this.pagination.total},t.prototype.canShowAggregates=function(){if(!this.options||!this.options.aggregates||!this.options.aggregates.settings)return!1;var t=this.options.aggregates.settings;return(t.hasAggregates()||t.hasRecordCount())&&(t.hasGroups()||t.hasGrandTotals())},t.prototype.updateTotalsState=function(t,e,n){void 0===n&&(n=!1);var i=this.options.aggregates.settings;if(this.prevRowTotals&&i.hasGroups()){for(var r=-1,s=1;s<=t.length;s++){for(var a=0,l=t[s-1].columns;a<l.length;a++){var c=l[a];if(!i.compareValues(this.prevRowTotals.getValue(c),e.getValue(c))){r=s;break}}if(-1!==r)break}if(-1!==r)for(s=t.length;s>=r;s--){var u=new o.QJ(this.dataTable.columns,this.prevRowTotals.toArray()),d=this.renderTotalsRow(s,u);this.bodyCellContainerDiv.appendChild(d)}}if(n&&i.hasGrandTotals()&&i.hasAggregates()){d=this.renderTotalsRow(0,e);this.bodyCellContainerDiv.appendChild(d)}this.prevRowTotals=e},t.prototype.applyGroupColumnTemplate=function(t,e,n){var o=t.replace(/{{\s*GroupValue\s*}}/g,e?"".concat(e):"-");return o=o.replace(/{{\s*GroupCount\s*}}/g,n?"".concat(n):"-")},t.prototype.renderTotalsRow=function(t,e){var n=this,o=this.options.aggregates.settings,i=t>0?o.getGroups()[t-1]:{columns:[],aggregates:o.getAggregates()},r=D("div").addClass("".concat(this.cssPrefix,"-row")).addClass("".concat(this.cssPrefix,"-row-totals")).addClass("".concat(this.cssPrefix,"-totals-lv").concat(t)).data("totals-level","".concat(t)).attr("tabindex","-1").toDOM();this.columns.getItems().forEach((function(t,o){if(t.isVisible){var s="",a=t.isRowNum?-1:n.dataTable.columns.getIndex(t.dataColumn.id);!t.isRowNum&&t.dataColumn&&i.columns.indexOf(t.dataColumn.id)>=0&&(s=e.getValue(a)),a==n.dataTable.columns.count-1&&(s=". . . . . ."),r.appendChild(n.renderCell(t,o,s,r))}}));var s=this.options.aggregates.calculator.getAggrContainer(),a=o.getAggregates().map((function(t){return t.colId})),l=o.buildGroupKey(i,e);return s.getAggregateData(t,l).then((function(s){for(var l=0,c=a;l<c.length;l++){var u=c[l];e.setValue(u,s[u])}r.innerHTML="",n.columns.getItems().forEach((function(l,c){if(l.isVisible){var u="",d=l.isRowNum?-1:n.dataTable.columns.getIndex(l.dataColumn.id);if(!l.isRowNum){var h=!1;if(l.dataColumn){var p=i.columns.indexOf(l.dataColumn.id),f=a.indexOf(l.dataColumn.id);h=t>0?p==i.columns.length-1:0==d,(p>=0||f>=0)&&(u=e.getValue(d))}var g="";if(t>0&&!(g=l.dataColumn.groupFooterColumnTemplate)&&o.hasRecordCount()&&h&&(g="{{GroupValue}} ({{GroupCount}})"),g)u=n.renderCell(l,c,u,r).firstChild.innerHTML,u=n.applyGroupColumnTemplate(g,u,s[o.COUNT_FIELD_NAME])}var m=n.renderCell(l,c,u,r);r.appendChild(m)}}))})).catch((function(t){return console.error(t)})),r},t.prototype.onViewportKeydown=function(t){if(this.options.showActiveRow){var e=this.bodyCellContainerDiv.querySelectorAll(".".concat(this.cssPrefix,"-row")).length,n=void 0;switch(t.key){case"ArrowLeft":case"ArrowRight":break;case"ArrowUp":t.preventDefault(),n=this.activeRowIndex<0||this.activeRowIndex>=e?e-1:this.activeRowIndex-1,this.activeRowIndex=n>=0?n:0;break;case"ArrowDown":t.preventDefault(),n=this.activeRowIndex<0||this.activeRowIndex>=e?0:this.activeRowIndex+1,this.activeRowIndex=n<e?n:e-1}}},t.prototype.ensureRowVisibility=function(t){var e="number"==typeof t?this.getDataRow(t):t;if(e){var n=e.getBoundingClientRect(),o=this.bodyViewportDiv.getBoundingClientRect(),i=n.top-o.top,r=n.bottom-o.top,s=this.bodyViewportDiv.clientHeight,a=window.innerHeight||document.documentElement.clientHeight;if(i>0&&r<=s&&n.top>0&&n.bottom<a)return;i<0?this.bodyViewportDiv.scrollTop=this.bodyViewportDiv.scrollTop+i:r>s&&(this.bodyViewportDiv.scrollTop=this.bodyViewportDiv.scrollTop+r-s),(n=e.getBoundingClientRect()).top<0?document.documentElement.scrollTop=document.documentElement.scrollTop+n.top:n.bottom>a&&(document.documentElement.scrollTop=document.documentElement.scrollTop+n.bottom-a)}},t.prototype.getRowsToRender=function(){return!1===this.options.paging.enabled?Promise.resolve(this.dataTable.getCachedRows()):this.dataTable.getRows({offset:(this.pagination.page-1)*this.pagination.pageSize,limit:this.pagination.pageSize+1}).catch((function(t){return console.error(t),[]}))},t.prototype.renderFooter=function(){var t=this;this.footerDiv=D("div").addClass("".concat(this.cssPrefix,"-footer")).toDOM(),this.rowsOnPagePromise&&this.rowsOnPagePromise.then((function(e){t.footerDiv.innerHTML="",t.footerPaginateDiv=t.renderPageNavigator(),t.footerDiv.appendChild(t.footerPaginateDiv);var n=t.renderPageInfoBlock(e);t.footerDiv.appendChild(n)}))},t.prototype.renderPageInfoBlock=function(t){var e=D("div").addClass("".concat(this.cssPrefix,"-page-info")).toDOM();if(this.dataTable.getTotal()>0){var n=t?(this.pagination.page-1)*this.pagination.pageSize+1:0,i=t?n+t-1:0,r=this.dataTable.getTotal().toString();if(this.dataTable.elasticChunks)this.dataTable.getCachedCount()!==this.dataTable.getTotal()&&(r="?");e.innerHTML=o.ag.getText("GridPageInfo").replace("{FirstPageRecordNum}","<span>".concat(n.toString(),"</span>")).replace("{LastPageRecordNum}","<span>".concat(i.toString(),"</span>")).replace("{Total}","<span>".concat(r,"</span>"))}return e},t.prototype.showProgress=function(){},t.prototype.hideProgress=function(){},t.prototype.getLocalIndexByGlobal=function(t){return this.pagination?t%this.pagination.pageSize:t},t.prototype.getGlobalIndexByLocal=function(t){return this.pagination?(this.pagination.page-1)*this.pagination.pageSize+t:t},t.prototype.renderRow=function(t,e){var n=this,o=this.getGlobalIndexByLocal(e),i=D("div").addClass("".concat(this.cssPrefix,"-row")).addClass("".concat(this.cssPrefix,"-row-").concat(e%2==1?"odd":"even")).data("row-idx","".concat(o)).attr("tabindex","-1").on("click",(function(o){n.activeRowIndex=e,n.fireEvent({type:"rowClick",row:t,rowIndex:e,sourceEvent:o})})).on("dblclick",(function(o){n.fireEvent({type:"rowDbClick",row:t,rowIndex:e,sourceEvent:o})}));0==e&&i.addClass("".concat(this.cssPrefix,"-row-first"));var r=i.toDOM();return this.options.showActiveRow&&e==this.activeRowIndex&&i.addClass("".concat(this.cssPrefix,"-row-active")),this.columns.getItems().forEach((function(e,i){if(e.isVisible){var s=e.isRowNum?-1:n.dataTable.columns.getIndex(e.dataColumn.id),a=e.isRowNum?o+1:t.getValue(s);r.appendChild(n.renderCell(e,i,a,r))}})),r},t.prototype.renderCell=function(t,e,n,o){var i=D("div").addClass("".concat(this.cssPrefix,"-cell")).data("col-idx","".concat(e)).attr("tabindex","-1").setStyle("width","".concat(t.width,"px"));t.align==R.LEFT?i.addClass("".concat(this.cssPrefix,"-cell-align-left")):t.align==R.RIGHT?i.addClass("".concat(this.cssPrefix,"-cell-align-right")):t.align==R.CENTER&&i.addClass("".concat(this.cssPrefix,"-cell-align-center"));var r=i.toDOM(),s=r.appendChild(D("div").addClass("".concat(this.cssPrefix,"-cell-value")).toDOM());return t.cellRenderer&&t.cellRenderer(n,t,s,o),r},t.prototype.setPage=function(t){this.pagination.page=t,this.fireEvent({type:"pageChanged",page:t}),this.refresh(),this.bodyViewportDiv.focus()},t.prototype.renderPageNavigator=function(){var t=this,e=document.createElement("div");e.className="".concat(this.cssPrefix,"-pagination-wrapper");var n=this.dataTable.getTotal();if(this.options.paging&&this.options.paging.enabled&&n>0){var i=this.paginationOptions.useBootstrap?"":"".concat(this.cssPrefix,"-"),r=function(e){var n=e.target;if(n.hasAttribute("data-page")){var o=parseInt(n.getAttribute("data-page"));t.setPage(o)}},s=function(e,n,o,s,a){var l=document.createElement("li");if(l.className="".concat(i,"page-item"),!s){a&&(l.className+=" active");var c=document.createElement("a");return c.setAttribute("href","javascript:void(0)"),c.innerHTML=n||e.toString(),c.setAttribute("data-page","".concat(e)),c.className="".concat(i,"page-link"),c.addEventListener("click",r),l.appendChild(c),l}var u=document.createElement("span");if(u.setAttribute("aria-hidden","true"),u.className="".concat(i,"page-link"),o)l.className+=" disabled";else{if(t.paginationOptions.useBootstrap)(u=document.createElement("a")).setAttribute("href","javascript:void(0)"),u.setAttribute("data-page","".concat(e));else{var d=document.createElement("a");d.setAttribute("href","javascript:void(0)"),d.setAttribute("data-page","".concat(e)),u=d}u.className="".concat(i,"page-link"),u.addEventListener("click",r)}return u.innerHTML=n,l.appendChild(u),l};if(this.dataTable.elasticChunks){var a=this.pagination.page||1;(c=document.createElement("ul")).className="".concat(i,"pagination");var l=s(a-1,"&laquo;",1==a,!0,!1);c.appendChild(l),l=s(a+1,"&raquo;",this.isLastPage(),!0,!1),c.appendChild(l),e.appendChild(c)}else if(this.pagination.total>this.pagination.pageSize){a=this.pagination.page||1;var c,u=Math.ceil(this.pagination.total/this.pagination.pageSize)||1,d=this.paginationOptions.maxButtonCount||10,h=a-1,p=h-h%d+1,f=p+d-1;f>u&&(f=u),(c=document.createElement("ul")).className="".concat(i,"pagination");l=s(p-1,"&laquo;",1==p,!0,!1);c.appendChild(l);for(var g=p;g<=f;g++)l=s(g,g.toString(),!1,!1,g==a),c.appendChild(l);l=s(f+1,"&raquo;",f==u,!0,!1),c.appendChild(l),e.appendChild(c)}if(this.options.paging.allowPageSizeChange){var m=document.createElement("div");m.className="".concat(this.cssPrefix,"-page-sizes");var y=document.createElement("div");y.className="kfrm-select ".concat(this.cssPrefix,"-page-sizes-select"),m.appendChild(y);var v=document.createElement("select"),C=this.options.paging.pageSizeItems||[],b=new Set(C);b.add(this.options.paging.pageSize||20),Array.from(b).forEach((function(t){var e=document.createElement("option");e.value=t.toString(),e.text=t.toString(),v.appendChild(e)})),v.value=(this.pagination.pageSize||20).toString(),y.appendChild(v),v.addEventListener("change",(function(e){var n=parseInt(e.target.value);t.pagination.pageSize=n,t.pagination.page=1,t.refresh()}));var x=document.createElement("div");x.className="".concat(this.cssPrefix,"-page-sizes-label"),m.appendChild(x);var w=document.createElement("span");w.innerText=o.ag.getText("GridItemsPerPage"),x.appendChild(w),e.appendChild(m)}}return e},t.prototype.addEventListener=function(t,e){return this.eventEmitter.subscribe(t,(function(t){return e(t.data)}))},t.prototype.removeEventListener=function(t,e){this.eventEmitter.unsubscribe(t,e)},t.prototype.renderHeaderButtons=function(){var t=this;return this.options.showPlusButton?D("div").addClass("".concat(this.cssPrefix,"-header-btn-plus")).title(this.options.plusButtonTitle||"Add").addChild("a",(function(e){return e.attr("href","javascript:void(0)").on("click",(function(e){e.preventDefault(),t.fireEvent({type:"plusButtonClick",sourceEvent:e})}))})).toDOM():D("span").addText("#").toDOM()},t.prototype.showLandingSlot=function(t,e){for(var n=this.headerRowDiv.querySelectorAll("[class*=".concat(this.cssPrefix,"-table-col]")),o=[],i=1;i<n.length;i++){var r=n[i];"none"!==r.style.display&&o.push(r)}if(0===o.length)return this.landingIndex=0,void this.headerRowDiv.appendChild(this.landingSlot);var s=p(this.landingSlot);if(!(t>=s.x&&t<=s.x+this.landingSlot.offsetWidth)){for(var a=this.landingIndex,l=0,c=o;l<c.length;l++){var u=c[l],d=p(u),h=u.offsetWidth;t>d.x&&t<d.x+h&&(a=parseInt(u.getAttribute("data-col-idx"))-1)}a!=this.landingIndex&&(this.landingIndex=a,this.landingIndex<o.length?this.headerRowDiv.insertBefore(this.landingSlot,o[this.landingIndex]):this.headerRowDiv.appendChild(this.landingSlot))}},t.prototype.hideLandingSlot=function(){var t=this;this.landingIndex=-1,setTimeout((function(){t.landingSlot.parentElement&&t.landingSlot.parentElement.removeChild(t.landingSlot)}),10)},Object.defineProperty(t.prototype,"activeRowIndex",{get:function(){return this._activeRowIndex},set:function(t){if(t!==this._activeRowIndex){var e=this._activeRowIndex;this._activeRowIndex=t,this.updateActiveRow(),this.fireEvent({type:"activeRowChanged",oldValue:e,newValue:this.activeRowIndex,rowIndex:this.getGlobalIndexByLocal(this.activeRowIndex)})}},enumerable:!1,configurable:!0}),t.prototype.updateActiveRow=function(){var t=this;if(this.options.showActiveRow){this.bodyCellContainerDiv.querySelectorAll("[class*=".concat(this.cssPrefix,"-row-active]")).forEach((function(e){e.classList.remove("".concat(t.cssPrefix,"-row-active"))}));var e=this.getActiveRow();e&&(e.classList.add("".concat(this.cssPrefix,"-row-active")),this.ensureRowVisibility(this.activeRowIndex))}},t.prototype.getActiveRow=function(){return this.getDataRow(this.activeRowIndex)},t.prototype.getDataRow=function(t){var e=Array.from(this.bodyCellContainerDiv.querySelectorAll(".".concat(this.cssPrefix,"-row:not(.").concat(this.cssPrefix,"-row-totals)")));return t>=0&&t<e.length?e[t]:null},t.prototype.focus=function(){this.bodyViewportDiv.focus()},t.prototype.resizeColumns=function(){if(this.options.columnWidths.autoResize!==M.Never){var t=this.bodyCellContainerDiv.style.width;this.bodyCellContainerDiv.style.visibility="hidden",this.bodyCellContainerDiv.style.width="1px",this.headerRowDiv.style.width="1px";for(var e=0,n=this.columns.getItems(),i=this.headerCellContainerDiv.querySelectorAll(".".concat(this.cssPrefix,"-header-cell")),r=0,s=function(t){var s=n[t];if(!s.isVisible)return"continue";var l=a.options.columnWidths.autoResize!==M.Always&&s.dataColumn?s.dataColumn.calculatedWidth:0,c=a.bodyCellContainerDiv.querySelectorAll(".".concat(a.cssPrefix,'-cell[data-col-idx="').concat(t,'"] > .').concat(a.cssPrefix,"-cell-value")),u=0;if(l>0)e+=l,s.width=l,c.forEach((function(t){t.parentElement.style.width="".concat(l,"px")})),i[r].style.width="".concat(l,"px");else if(0==c.length&&(i[r].style.width=null,i[r].style.whiteSpace="nowrap"),u=i[r].offsetWidth,c.length>0){c.forEach((function(t){t.parentElement.style.width=null;var e=t.parentElement.offsetWidth;e>u&&(u=e)})),u+=3;var d=s.isRowNum?a.options.columnWidths.rowNumColumn.max||500:a.options.columnWidths[s.dataColumn.type].max||2e3,h=s.isRowNum?a.options.columnWidths.rowNumColumn.min||0:a.options.columnWidths[s.dataColumn.type].min||20;u>d&&(u=d),u<h&&(u=h),o.P6.isNumericType(s.type)&&(u=Math.round(1.3*u)),e+=u,s.width=u,c.forEach((function(t){t.parentElement.style.width="".concat(u,"px")})),i[r].style.width="".concat(u,"px"),s.dataColumn&&(s.dataColumn.calculatedWidth=u)}else e+=u;r++},a=this,l=0;l<this.columns.count;l++)s(l);e>0?(this.bodyCellContainerDiv.style.width="".concat(e,"px"),this.headerCellContainerDiv.style.width="".concat(e,"px")):(this.bodyCellContainerDiv.style.width=t,this.headerCellContainerDiv.style.width=t),this.bodyCellContainerDiv.style.visibility=null,this.headerRowDiv.removeAttribute("style")}},t}(),U=function(){function t(t,e){this.slot=t,this.options=e||{},this.options.yearRange||(this.options.yearRange="c-10:c+10")}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"kdtp-cal"},enumerable:!1,configurable:!0}),t.prototype.setDate=function(t){this.currentDate=new Date(t)},t.prototype.getDate=function(){return new Date(this.currentDate)},t.prototype.dateChanged=function(t){this.options.onDateChanged&&this.options.onDateChanged(this.currentDate,t)},t}(),Y=function(){function t(t){this.calendar=null,this.timePicker=null,this.options=t,this.render()}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"kdtp"},enumerable:!1,configurable:!0}),t.prototype.setDateTime=function(t){this.currentDateTime=new Date(t),this.calendar&&this.calendar.setDate(this.currentDateTime),this.timePicker&&this.timePicker.setTime(this.currentDateTime)},t.prototype.getDateTime=function(){return new Date(this.currentDateTime)},t.prototype.render=function(){var t=this;this.options.showCalendar&&(this.calendar=this.createCalendar({yearRange:this.options.yearRange,showDateTimeInput:this.options.showDateTimeInput,timePickerIsUsed:this.options.showTimePicker,oneClickDateSelection:this.options.oneClickDateSelection,onDateChanged:function(e,n){t.currentDateTime=e,t.timePicker&&t.timePicker.setTime(t.currentDateTime),t.options.showTimePicker&&t.dateTimeChanged(),n&&t.apply(t.currentDateTime)}}),this.calendar&&this.calendar.render()),this.options.showTimePicker&&(this.timePicker=this.createTimePicker({onTimeChanged:function(e){t.currentDateTime.setHours(e.getHours()),t.currentDateTime.setMinutes(e.getMinutes()),t.calendar&&t.calendar.setDate(t.currentDateTime),t.dateTimeChanged()}}),this.timePicker&&this.timePicker.render()),this.setDateTime(new Date)},t.prototype.createCalendar=function(t){return null},t.prototype.createTimePicker=function(t){return null},t.prototype.show=function(t){this.options.beforeShow&&this.options.beforeShow();var e=p(t||document.body);this.slot.style.top=e.y+t.clientHeight+"px",this.slot.style.left=e.x+"px"},t.prototype.apply=function(t){this.options.onApply&&this.options.onApply(t),this.destroy()},t.prototype.cancel=function(){this.options.onCancel&&this.options.onCancel(),this.destroy()},t.prototype.destroy=function(){this.slot&&this.slot.parentElement&&this.slot.parentElement.removeChild(this.slot)},t.prototype.dateTimeChanged=function(){this.options.onDateTimeChanged&&this.options.onDateTimeChanged(this.currentDateTime)},t}(),J=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),X=function(t){function e(e,n){var i=t.call(this,e,n)||this;i.daysOfWeek=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],i.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],i.calendarBody=null,i.isManualInputChanging=!1;for(var r=0;r<i.daysOfWeek.length;r++)i.daysOfWeek[r]=o.ag.getShortWeekDayName(r+1);for(r=0;r<i.months.length;r++)i.months[r]=o.ag.getLongMonthName(r+1);return i}return J(e,t),e.prototype.setDate=function(e){t.prototype.setDate.call(this,e),this.selectedMonth=this.currentDate.getMonth(),this.selectedYear=this.currentDate.getFullYear(),this.rerenderMonth()},e.prototype.render=function(){var t=this,e=D("div",this.slot).addClass("".concat(this.cssPrefix,"-header"));this.options.showDateTimeInput?e.addChildElement(this.renderManualDateInput()):e.addChild("span",(function(e){return t.headerTextElem=e.toDOM()})),D(this.slot).addChildElement(this.renderCalendarButtons()),this.calendarBody=D("div",this.slot).addClass("".concat(this.cssPrefix,"-body")).toDOM()},e.prototype.getInputDateFormat=function(){var t=o.ag.getLocaleSettings();return this.options.timePickerIsUsed?"".concat(t.editDateFormat," ").concat(t.editTimeFormat):t.editDateFormat},e.prototype.renderManualDateInput=function(){var t=this,e=this.getInputDateFormat(),n=D("input").attr("placeholder",e).addClass("".concat(this.cssPrefix,"-header-input"));return n.mask(e.replace("yyyy","9999").replace("MM","99").replace("dd","99").replace("HH","99").replace("mm","99").replace("ss","99")).on("input",(function(i){n.removeClass("error");try{t.isManualInputChanging=!0;var r=o.P6.strToDateTime(t.manualInputElem.value,e);t.currentDate=r,t.jump(t.currentDate.getFullYear(),t.currentDate.getMonth()),t.dateChanged(!1)}catch(t){n.addClass("error")}finally{t.isManualInputChanging=!1}})).on("keydown",(function(e){13===e.keyCode&&(e.preventDefault(),e.stopPropagation(),t.manualInputElem.className.indexOf("error")<0&&!t.isManualInputChanging&&t.dateChanged(!0))})).on("focus",(function(){setTimeout((function(){t.manualInputElem.selectionStart=0,t.manualInputElem.selectionEnd=0}),50)})),this.manualInputElem=n.toDOM(),this.manualInputElem},e.prototype.updateDisplayedDateValue=function(){if(this.manualInputElem){if(!this.isManualInputChanging){var t=this.getInputDateFormat();this.manualInputElem.value=o.P6.dateTimeToStr(this.currentDate,t),this.manualInputElem.focus()}}else if(this.headerTextElem){var e=o.ag.getCurrentLocale();this.headerTextElem.innerText=this.currentDate.toLocaleString("en"==e?void 0:e,{year:"numeric",month:"long",day:"numeric"})}},e.prototype.renderCalendarButtons=function(){var t=this;return D("nav").addClass("".concat(this.cssPrefix,"-nav")).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-nav-prev")).on("click",(function(){t.prev()})).addChild("span",(function(t){return t.html("&lsaquo;")}))})).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-nav-selectors")).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-nav-month")).addChild("select",(function(e){e.on("change",(function(){t.jump(t.selectedYear,parseInt(t.selectMonthElem.value))}));for(var n=function(n){e.addChild("option",(function(e){return e.attr("value",n.toString()).text(t.months[n])}))},o=0;o<t.months.length;o++)n(o);t.selectMonthElem=e.toDOM()}))})).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-nav-year")).addChild("select",(function(e){return t.selectYearElem=e.on("change",(function(){t.jump(parseInt(t.selectYearElem.value),t.selectedMonth)})).toDOM()}))}))})).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-nav-next")).on("click",(function(){t.next()})).addChild("span",(function(t){return t.html("&rsaquo;")}))})).toDOM()},e.prototype.prev=function(){this.selectedYear=0===this.selectedMonth?this.selectedYear-1:this.selectedYear,this.selectedMonth=0===this.selectedMonth?11:this.selectedMonth-1,this.rerenderMonth()},e.prototype.next=function(){this.selectedYear=11===this.selectedMonth?this.selectedYear+1:this.selectedYear,this.selectedMonth=(this.selectedMonth+1)%12,this.rerenderMonth()},e.prototype.rerenderSelectYear=function(){var t=/c-(\d*):c\+(\d*)/g.exec(this.options.yearRange),e=0,n=1;null!==t&&(e=parseInt(t[1]),n=parseInt(t[2])),this.selectYearElem.innerHTML="";for(var o=0;o<=e+n;o++){var i=document.createElement("option"),r=this.selectedYear-e+o;i.value=r.toString(),i.innerText=r.toString(),this.selectYearElem.appendChild(i)}},e.prototype.jump=function(t,e){this.selectedYear=t,this.selectedMonth=e,this.rerenderMonth()},e.prototype.rerenderMonth=function(){var t=this;this.updateDisplayedDateValue(),this.rerenderSelectYear();var e=new Date(this.selectedYear,this.selectedMonth).getDay(),n=new Date(this.selectedYear,this.selectedMonth+1,0).getDate();this.calendarBody.innerHTML="",this.selectYearElem.value=this.selectedYear.toString(),this.selectMonthElem.value=this.selectedMonth.toString(),this.daysOfWeek.forEach((function(e,n){D("div",t.calendarBody).addClass("".concat(t.cssPrefix,"-weekday")).addClass(0==n||6==n?"".concat(t.cssPrefix,"-weekend"):"").text(e)}));for(var o=0;o<e;o++)D("div",this.calendarBody).addClass("".concat(this.cssPrefix,"-day-empty"));for(var i=new Date,r=1;r<=n;r++){var s=D("div",this.calendarBody).addClass("".concat(this.cssPrefix,"-day")).attr("data-date",r.toString()).text(r.toString()).on("click",(function(e){t.currentDate.setFullYear(t.selectedYear),t.currentDate.setMonth(t.selectedMonth),t.currentDate.setDate(parseInt(e.target.getAttribute("data-date"))),t.dateChanged(t.options.oneClickDateSelection)}));r===i.getDate()&&this.selectedYear===i.getFullYear()&&this.selectedMonth===i.getMonth()&&s.addClass("".concat(this.cssPrefix,"-day-current")),r===this.currentDate.getDate()&&this.selectedYear===this.currentDate.getFullYear()&&this.selectedMonth===this.currentDate.getMonth()&&s.addClass("".concat(this.cssPrefix,"-day-selected"));var a=(e+r-1)%7;0!=a&&6!=a||s.addClass("".concat(this.cssPrefix,"-weekend"))}var l=(e+n)%7,c=0==l?0:7-l;for(o=0;o<c;o++)D("div",this.calendarBody).addClass("".concat(this.cssPrefix,"-day-empty"))},e.prototype.dateChanged=function(e){t.prototype.dateChanged.call(this,e),this.rerenderMonth()},e}(U),K=function(){function t(t,e){this.slot=t,this.options=e||{}}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"kdtp-tp"},enumerable:!1,configurable:!0}),t.prototype.setTime=function(t){this.currentTime=new Date(t)},t.prototype.getTime=function(){return new Date(this.currentTime)},t.prototype.timeChanged=function(){this.options.onTimeChanged&&this.options.onTimeChanged(this.currentTime)},t}(),$=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $(e,t),e.prototype.setTime=function(e){t.prototype.setTime.call(this,e),this.updateDisplayedTime(),this.hoursInput.valueAsNumber=e.getHours(),this.minutesInput.valueAsNumber=e.getMinutes()},e.prototype.render=function(){var t=this;D("div",this.slot).addClass("".concat(this.cssPrefix,"-time")).addChild("span",(function(e){return t.timeText=e.toDOM()})).toDOM();var e=D("div",this.slot).addClass("".concat(this.cssPrefix,"-sliders"));return e.addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-time-row")).title("Hours").addChild("input",(function(e){return t.hoursInput=e.addClass("".concat(t.cssPrefix,"-input-hours")).type("range").attr("min","0").attr("max","23").attr("step","1").on("input",(function(e){t.currentTime.setHours(t.hoursInput.valueAsNumber),t.updateDisplayedTime(),t.timeChanged()})).toDOM()}))})),e.addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-time-row")).title("Minutes").addChild("input",(function(e){return t.minutesInput=e.addClass("".concat(t.cssPrefix,"-input-minutes")).type("range").attr("min","0").attr("max","59").attr("step","1").on("input",(function(e){t.currentTime.setMinutes(t.minutesInput.valueAsNumber),t.updateDisplayedTime(),t.timeChanged()})).toDOM()}))})),this.slot},e.prototype.updateDisplayedTime=function(){var t=o.ag.getCurrentLocale(),e=this.currentTime.toLocaleString("en"==t?void 0:t,{hour:"numeric",minute:"numeric"});this.timeText.innerText=e},e}(K),tt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),et=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return tt(e,t),e.prototype.render=function(){var e=this,n=D("div",document.body).addClass("".concat(this.cssPrefix)).attr("tabIndex","0").setStyle("position","absolute").setStyle("top","-1000px").setStyle("left","-1000px").on("keydown",(function(t){return 27===t.keyCode?e.cancel():13===t.keyCode&&e.apply(e.getDateTime()),!1}));this.options.zIndex&&n.setStyle("z-index","".concat(this.options.zIndex)),this.slot=n.toDOM(),t.prototype.render.call(this),this.renderButtons(),this.globalMouseDownHandler=function(t){var n=window.event||t;n.srcElement||n.target;return!e.slot.contains(n.target)&&(document.removeEventListener("mousedown",e.globalMouseDownHandler,!0),e.cancel()),!0}},e.prototype.renderButtons=function(){var t=this,e=D("div",this.slot).addClass("".concat(this.cssPrefix,"-buttons")).addChild("button",(function(e){return t.nowButton=e.addClass("".concat(t.cssPrefix,"-button ").concat(t.cssPrefix,"-button-now")).text(o.ag.getText("ButtonNow")).on("click",(function(){return t.setDateTime(new Date),t.dateTimeChanged(),!1})).toDOM()}));!this.options.showTimePicker&&this.options.oneClickDateSelection||e.addChild("button",(function(e){return t.submitButton=e.addClass("".concat(t.cssPrefix,"-button ").concat(t.cssPrefix,"-button-apply")).text(o.ag.getText("ButtonApply")).on("click",(function(){return t.apply(t.getDateTime()),!1})).toDOM()})),e.addChild("button",(function(e){return t.submitButton=e.addClass("".concat(t.cssPrefix,"-button ").concat(t.cssPrefix,"-button-cancel")).text(o.ag.getText("ButtonCancel")).on("click",(function(){return t.cancel(),!1})).toDOM()}))},e.prototype.createCalendar=function(t){return this.calendarSlot=D("div",this.slot).addClass("".concat(this.cssPrefix,"-cal")).toDOM(),new X(this.calendarSlot,t)},e.prototype.createTimePicker=function(t){return this.timePickerSlot=D("div",this.slot).addClass("".concat(this.cssPrefix,"-tp")).toDOM(),new Z(this.timePickerSlot,t)},e.prototype.show=function(e){var n=this;if(this.options.showDateTimeInput){this.options.beforeShow&&this.options.beforeShow();var o=p(e||document.body),i=p(e?e.parentElement||e:document.body);this.slot.style.top=i.y+"px",this.slot.style.left=o.x+"px"}else t.prototype.show.call(this,e),this.slot.focus();setTimeout((function(){document.addEventListener("mousedown",n.globalMouseDownHandler,!0)}),1)},e}(Y);!function(t){t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=3]="Right"}(H||(H={}));var nt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ot="kdlg",it=function(){function t(){}return t.prototype.openConfirm=function(t,e,n){var o=this,i={title:t,closable:!1,submitable:!0,cancelable:!0,body:'<div id="'.concat(ot,'-dialog-confirm">').concat(e,"</div>")};return n?(i.onSubmit=function(){n(!0)},i.onCancel=function(){n(!1)},void this.open(i)):new Promise((function(t){i.onSubmit=function(){t(!0)},i.onCancel=function(){t(!1)},o.open(i)}))},t.prototype.openPrompt=function(t,e,n,o){var i=this,r={title:t,submitable:!0,closable:!0,cancelable:!0,submitOnEnter:!0,body:'<div id="'.concat(ot,'-dialog-form" class="kfrm-form">\n <div class="kfrm-fields label-above">\n <label for="').concat(ot,'-dialog-form-input" id="').concat(ot,'-dialog-form-content">').concat(e,'</label>\n <input type="text" name="').concat(ot,'-dialog-form-input" id="').concat(ot,'-dialog-form-input" />\n </div>\n </div>'),arrangeParents:!1,beforeOpen:function(){var t=document.getElementById("".concat(ot,"-dialog-form-input"));n&&(t.value=n),t.focus()}},s=function(t){var e=document.getElementById("".concat(ot,"-dialog-form-input")),n=e.value;return n&&n.replace(/\s/g,"").length>0?(t(n),!0):(e.classList.add("eqjs-invalid"),!1)};return o?(r.onSubmit=function(){return s(o)},r.onCancel=function(){o("")},void this.open(r)):new Promise((function(t){r.onSubmit=function(){return s(t)},r.onCancel=function(){t("")},i.open(r)}))},t.prototype.open=function(t,e){var n=this,o=new rt(t,e),i=t.onDestroy;return t.onDestroy=function(t){n.untrack(t),i&&i(t)},o.open(),this.track(o),o},t.prototype.createSet=function(t){return new at(t,this)},t.prototype.untrack=function(e){var n=t.openDialogs.indexOf(e);n>=0&&t.openDialogs.splice(n,1)},t.prototype.track=function(e){t.openDialogs.push(e)},t.prototype.openProgress=function(t){var e=this,n=new st(t),o=t.onDestroy;return t.onDestroy=function(t){e.untrack(t),o&&o(t)},n.open(),this.track(n),n},t.prototype.getAllDialogs=function(){return Array.from(t.openDialogs)},t.prototype.closeAllDialogs=function(){for(var e=0,n=Array.from(t.openDialogs);e<n.length;e++){n[e].close()}},t.openDialogs=[],t}(),rt=function(){function t(t,e){var n=this;this.options=t,this.submitHandler=function(t){return(!n.options.onSubmit||!1!==n.options.onSubmit(n,t))&&(n.destroy(),!0)},this.cancelHandler=function(){n.options.onCancel&&n.options.onCancel(n),n.destroy()},this.keydownHandler=function(t){return 13!=t.keyCode||!n.isActiveDialog()||(t.preventDefault(),t.stopPropagation(),!n.submitHandler())||(window.removeEventListener("keydown",n.keydownHandler,!1),!1)},this.dialogId=o.P6.generateId("dlg"),this.data=e,this.slot=D("div",document.body).attr("tab-index","-1").data("dialog-id",this.dialogId).addClass("".concat(ot,"-modal"),"is-active").focus().addChild("div",(function(t){return t.addClass("kdlg-modal-background")})).addChild("div",(function(i){return n.windowElement=i.addClass("".concat(ot,"-modal-window")).addChild("header",(function(e){n.headerElement=e.addClass("".concat(ot,"-header")).addChild("p",(function(e){return e.addClass("".concat(ot,"-header-title")).addText(t.title)})).toDOM(),!1!==t.closable&&e.addChild("button",(function(t){return t.addClass("".concat(ot,"-modal-close")).on("click",(function(){n.cancelHandler()})).focus()}))})).addChild("div",(function(t){t.addClass("".concat(ot,"-alert-container")),n.alertElement=t.toDOM()})).addChild("section",(function(i){if(n.bodyElement=i.addClass("".concat(ot,"-body")).toDOM(),"string"==typeof t.body){var r=o.Xu.renderLiquidTemplate(t.body,e);i.addHtml(r)}else i.addChildElement(t.body)})).addChild("footer",(function(e){var i=null;i=t.footerAlignment&&t.footerAlignment==H.Center?"align-center":"align-right",n.footerElement=e.addClass("".concat(ot,"-footer")).toDOM(),e.addClass(i),!1!==t.submitable&&(e.addChild("button",(function(e){e.id(n.dialogId+"-btn-submit").addClass("kfrm-button","is-info").addText(t.submitButtonText||o.ag.getText("ButtonOK")),t.recaptchaSiteKey?(e.data("sitekey",t.recaptchaSiteKey),e.addClass("g-recaptcha"),e.on("click",(function(e){grecaptcha?grecaptcha.ready((function(){grecaptcha.execute(t.recaptchaSiteKey,{action:"submit"}).then((function(t){n.submitHandler(t)}))})):n.submitHandler()}))):e.on("click",(function(t){n.submitHandler()})),e.focus()})),!1!==t.cancelable&&e.addChild("button",(function(e){return e.id(n.dialogId+"-btn-cancel").addClass("kfrm-button").addText(t.cancelButtonText||o.ag.getText("ButtonCancel")).on("click",(function(t){n.cancelHandler()}))})))})).toDOM()})).toDOM()}return t.prototype.getData=function(){return this.data},t.prototype.getRootElement=function(){return this.slot},t.prototype.getSubmitButtonElement=function(){return document.getElementById(this.dialogId+"-btn-submit")},t.prototype.getCancelButtonElement=function(){return document.getElementById(this.dialogId+"-btn-cancel")},t.prototype.open=function(){var t=this;this.options.beforeOpen&&this.options.beforeOpen(this),D(this.slot).show(),this.options.arrangeParents&&this.arrangeParents(!0);var e=this.slot.querySelector(".".concat(ot,"-modal-window"));this.options.height&&(e.style.height="string"==typeof this.options.height?this.options.height:"".concat(this.options.height,"px")),this.options.width&&(e.style.width="string"==typeof this.options.width?this.options.width:"".concat(this.options.width,"px")),this.options.submitOnEnter&&window.addEventListener("keydown",this.keydownHandler,!1),this.slot.querySelectorAll("input").forEach((function(e){return e.addEventListener("input",(function(){t.clearAlert(),t.options.onInput&&t.options.onInput(t)}))})),this.options.onShow&&this.options.onShow(this)},t.prototype.submit=function(){this.submitHandler()},t.prototype.cancel=function(){this.cancelHandler()},t.prototype.close=function(){this.destroy()},t.prototype.disableButtons=function(){this.slot.querySelectorAll("button").forEach((function(t){return t.disabled=!0}))},t.prototype.enableButtons=function(){this.slot.querySelectorAll("button").forEach((function(t){return t.disabled=!1}))},t.prototype.showAlert=function(t,e,n){var o=D("div").addClass("".concat(ot,"-alert ").concat(e||"")).addChild("span",(function(t){return t.addClass("".concat(ot,"-alert-closebtn")).text("×").on("click",(function(t){var e=t.target.parentElement;e.parentElement.removeChild(e)}))})).addText(t).toDOM();!0===n&&this.clearAlert(),this.alertElement.appendChild(o)},t.prototype.clearAlert=function(){this.alertElement.innerHTML=""},t.prototype.destroy=function(){document.querySelectorAll('[data-dialog-id="'.concat(this.dialogId,'"]')).length<=0||(this.options.arrangeParents&&this.arrangeParents(!1),document.body.removeChild(this.slot),this.options.submitOnEnter&&window.removeEventListener("keydown",this.keydownHandler,!1),this.options.onDestroy&&this.options.onDestroy(this))},t.prototype.isActiveDialog=function(){var t=document.documentElement.querySelectorAll(".kdlg-modal");return t[t.length-1]===this.slot},t.prototype.arrangeParents=function(t){for(var e=document.documentElement.querySelectorAll(".kdlg-modal-window"),n=0;n<e.length-1;n++)if(t){var o=0==n?20:40*n+20;D(e[n]).setStyle("margin-top","".concat(o,"px")).setStyle("margin-left","".concat(o,"px"))}else D(e[n]).removeStyle("margin-top").removeStyle("margin-left")},t}(),st=function(t){function e(e,n){var o,i,r=this,s=D("div").addChild("div",(function(t){return o=t.text(e.content||"").toDOM()})).addChild("div",(function(t){t.addClass("".concat(ot,"-progress-line")).addChild("div",(function(t){i=t.addClass("fill").toDOM(),e.determinated?t.setStyle("width","0%"):t.addClass("indeterminate")}))})).toDOM();return(r=t.call(this,{title:e.title,body:s,beforeOpen:e.beforeOpen,onSubmit:e.onSubmit,width:e.width,height:e.height,submitable:!1,cancelable:!1,closable:!1,onDestroy:e.onDestroy},n)||this).contentElement=o,r.progressElement=i,r}return nt(e,t),e.prototype.updateContent=function(t){this.contentElement.innerText=t},e.prototype.updateProgress=function(t){var e=this;t=this.in01(t),this.progressElement.style.width="".concat(100*t,"%"),1===t&&setTimeout((function(){e.submit()}),500)},e.prototype.in01=function(t){return t>1?1:t<0?0:t},e}(rt),at=function(){function t(t,e){this.options=t,this.dialogService=e,this.currentDialog=null,this.currentIndex=0,this.options=t,this.dialogService=e}return t.prototype.getCurrent=function(){return this.currentDialog},t.prototype.openNext=function(t){return this.open(this.currentIndex+1,t)},t.prototype.openPrev=function(t){return this.open(this.currentIndex-1,t)},t.prototype.open=function(t,e){if(t<0?this.currentIndex=0:t>=this.options.length?this.currentIndex=this.options.length-1:this.currentIndex=t,this.currentDialog)try{this.currentDialog.close()}catch(t){}var n=this.options[this.currentIndex];return this.currentDialog=this.dialogService.open(n,e),this.currentDialog},t.prototype.close=function(){this.currentDialog&&(this.currentDialog.close(),this.currentDialog=null)},t}();o.ag.updateDefaultTexts({GridPageInfo:"{FirstPageRecordNum} - {LastPageRecordNum} of {Total} records",GridItemsPerPage:"items per page",ButtonOK:"OK",ButtonCancel:"Cancel",ButtonApply:"Apply",ButtonNow:"Now",LblTotal:"Total"});new it},789:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){var browserUtils;(function(browserUtils){var _isFirefox=null,_isIE=null;function IsIE(){if(null===_isIE){var t=navigator.userAgent;_isIE=t.indexOf("MSIE ")>-1||t.indexOf("Trident/")>-1}return _isIE}function IsEdge(){return!IsIE()&&eval("!!window.StyleMedia")}function IsFirefox(){if(null===_isFirefox){var t=navigator.userAgent;_isFirefox=t.toLowerCase().indexOf("firefox")>-1}return _isFirefox}browserUtils.IsIE=IsIE,browserUtils.IsEdge=IsEdge,browserUtils.IsFirefox=IsFirefox;var _detectedIsMobileMode=!1,_isMobileMode=void 0,detectIsMobileMode=function(){var t=isMobileMode();_detectedIsMobileMode=window.matchMedia("only screen and (max-width: 840px)").matches||window.matchMedia("only screen and (max-height: 420px)").matches;var e=isMobileMode();e!==t&&mobileModeChangeHandler&&mobileModeChangeHandler(e)},mobileModeChangeHandler;function isMobileMode(){return void 0!==_isMobileMode?_isMobileMode:_detectedIsMobileMode}function setIsMobileMode(t){var e=isMobileMode();_isMobileMode=t;var n=isMobileMode();n!==e&&mobileModeChangeHandler&&mobileModeChangeHandler(n)}function onMobileModeChanged(t){mobileModeChangeHandler=t}function getMobileCssClass(){return isMobileMode()?"k-mobile":null}detectIsMobileMode(),window.addEventListener("resize",(function(){return detectIsMobileMode()})),browserUtils.isMobileMode=isMobileMode,browserUtils.setIsMobileMode=setIsMobileMode,browserUtils.onMobileModeChanged=onMobileModeChanged,browserUtils.getMobileCssClass=getMobileCssClass})(browserUtils||(browserUtils={}))},388:function(t){t.exports=__WEBPACK_EXTERNAL_MODULE__388__}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var n=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=function(t,e){for(var n in e)__webpack_require__.o(e,n)&&!__webpack_require__.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},__webpack_require__.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},__webpack_require__.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__={};return function(){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AddRowRenderer:function(){return dt},AdvancedSearchView:function(){return xe},AggrFuncColumnRendererCB:function(){return B},AggrFuncColumnRendererCP:function(){return v},AggrSettingsDialog:function(){return he},AggrSettingsRenderer:function(){return de},AggregationBar:function(){return fe},AttrColumnRendererCB:function(){return k},AttrColumnRendererCP:function(){return m},AttributeExpressionRenderer:function(){return at},BaseElementRenderer:function(){return K},ChartFacet:function(){return Zt},ChartJsWidget:function(){return Jt},ChartType:function(){return Nt},ChartWidget:function(){return Ut},ColumnAction:function(){return e},ColumnRendererCB:function(){return D},ColumnRendererCP:function(){return f},ColumnsBar:function(){return R},ColumnsPanel:function(){return T},ConditionAction:function(){return N},ConditionGroupRenderer:function(){return J},ConditionGroupRowRenderer:function(){return X},ConditionRenderer:function(){return W},ConstColumnRendererCP:function(){return w},CustomListExpressionRenderer:function(){return it},CustomSqlColumnRendererCP:function(){return x},DataFilterView:function(){return Ee},DataTableFacet:function(){return ie},DateTimeExpressionRenderer:function(){return gt},DomDropDownElementBuilder:function(){return z},DropDownRenderer:function(){return ct},EasyGridWidget:function(){return At},EntitiesPanel:function(){return l},EqHtmlGrid:function(){return kt},ExportDialog:function(){return qt},ExportWidget:function(){return ue},ExpressionRenderer:function(){return Z},FacetType:function(){return U},FilterBar:function(){return Et},GoogleChartWidget:function(){return Kt},Grid:function(){return Bt},HtmlContentWidget:function(){return Dt},HtmlDataFilterView:function(){return De},InputExpressionRenderer:function(){return et},ListExpressionRenderer:function(){return ot},ManageDrillDownWidget:function(){return Qt},OperatorRenderer:function(){return pt},PivotTableFacet:function(){return ne},PopupMenu:function(){return u},ProcessWidget:function(){return _t},QPEditablePart:function(){return p},QueryPanel:function(){return xt},ReportView:function(){return ke},ResultFacet:function(){return jt},ResultFacetsPanel:function(){return le},SimpleConditionRenderer:function(){return j},SortingBar:function(){return Q},SqlListExpressionRenderer:function(){return rt},StatementPanel:function(){return Lt},SubQueryExpressionRenderer:function(){return yt},TextRenderer:function(){return q},View:function(){return Ce},browserUtils:function(){return s.z},dropdown:function(){return V}});var t,e,n=__webpack_require__(902),o=__webpack_require__(388),i=__webpack_require__(514),r=__webpack_require__(974),s=__webpack_require__(903),a=(t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)},function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}),l=function(t){function e(e){var n=t.call(this,e)||this;return n.queryChangedCallbackId=null,n.group=o.WidgetGroup.Model|o.WidgetGroup.Query,n.panel=e,n}return a(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-ep"},enumerable:!1,configurable:!0}),e.prototype.getWidgetType=function(){return"entitiesPanel"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.setOptions(n),this.renderProgressBlock()},e.prototype.refreshCore=function(){this.render(),this.options.syncWithColumns&&this.refreshCheckedStateByColumns()},e.prototype.onProcessStartCore=function(){this.options.showIndicatorOnLoad&&(this.progressBlock.parentNode||this.panel.appendChild(this.progressBlock))},e.prototype.onProcessEndCore=function(){this.options.showIndicatorOnLoad&&this.progressBlock.parentNode&&this.panel.removeChild(this.progressBlock)},e.prototype.destroyCore=function(){this.slot.innerHTML=""},e.prototype.setOptions=function(t){var e=this;(this.options={showToolbar:!0,syncWithColumns:!1,showSelectAllButton:!1,showClearSelectionButton:!0,showAddColumnButton:!0,showAddConditionButton:!0,showCheckboxes:!0,showTooltips:!0,draggableAttributes:!0,showAttributes:{useInConditions:!0,useInResult:!0,useInSorting:!1},showFilterBox:!1,filterBoxMode:0,showIndicatorOnLoad:!0,attrPlacement:0,sortEntities:!1,autoClearSelection:!0,entityRenderedCallback:null,attributeRenderedCallback:null},t&&n.P6.assignDeep(this.options,t),this.queryChangedCallbackId)&&(i=this.context.getQuery()).removeChangedCallback(this.queryChangedCallbackId);if(this.options.syncWithColumns){var i=this.context.getQuery();this.queryChangedCallbackId=i.addChangedCallback((function(t){var n=t.data;!n||n.part!=o.QueryChangePart.Columns&&n.part!=o.QueryChangePart.All||e.refreshCheckedStateByColumns()}))}},e.prototype.render=function(){var t=this.context.getModel();if(this.clear(),this.panel.classList.add("".concat(this.cssPrefix,"-panel")),this.panel.classList.add(s.z.getMobileCssClass()),this.rootEntityBlock=document.createElement("div"),null!=t&&!t.isEmpty()){var e=t.getEntitiesTree({addUIC:this.options.showAttributes.useInConditions,addUIR:this.options.showAttributes.useInResult,addUIS:this.options.showAttributes.useInSorting,attrPlacement:this.options.attrPlacement,sortEntities:this.options.sortEntities,includeRootData:!0});this.entityTreeBlock=this.renderEntity(e,this.rootEntityBlock,0),this.panel.appendChild(this.entityTreeBlock)}this.options.showFilterBox?this.createFilterBox():this.rootEntityBlock.style.top="0",this.options.showToolbar&&!this.options.syncWithColumns?this.createToolPanel():this.rootEntityBlock.style.bottom="0"},e.prototype.renderEntity=function(t,e,r){var a,l=this,c=document.createElement("div");c.classList.add("".concat(this.cssPrefix,"-entity-node")),c.classList.add(s.z.getMobileCssClass());var u=document.createElement("div");u.classList.add("".concat(this.cssPrefix,"-entity-children")),u.classList.add(s.z.getMobileCssClass());var d=document.createElement("label");d.classList.add("".concat(this.cssPrefix,"-entity-node-label"));var h=document.createElement("input");h.type="checkbox",h.title=t.text;var p,f,g,m=document.createElement("a");m.href="javascript:void(0)",m.title="".concat(n.ag.getText("EntityToggle")," ").concat(t.text),m.classList.add("".concat(this.cssPrefix,"-entity-node-button"));var y=r;if(e?(a=e).innerHTML="":a=document.createElement("div"),a.classList.add("".concat(this.cssPrefix,"-entity")),a.classList.add(s.z.getMobileCssClass()),t.id&&""!=t.id){d.innerText=t.text,c.appendChild(d),this.options.showCheckboxes&&d.insertBefore(h,d.firstChild),c.insertBefore(m,c.firstChild),this.options.showTooltips&&t.description&&d.setAttribute("title",t.description);for(var v=0;v<y;v++){var C=document.createElement("div");C.classList.add("".concat(this.cssPrefix,"-entity-offset")),c.insertBefore(C,c.firstChild)}a.appendChild(c),u.hidden=!0,y++}var b=t.items?t.items.length:0,x=function(e){var n=t.items[e];if(n.isEntity)u.appendChild(w.renderEntity(n,null,y));else if(!n.lookupAttr||!function(t,e){return e.querySelectorAll(".".concat(l.cssPrefix,'-entity-attr[data-id="').concat(t,'"]')).length>0}(n.lookupAttr,u)){(f=document.createElement("label")).innerText=n.text,f.classList.add("".concat(w.cssPrefix,"-entity-attr-label")),w.options.showCheckboxes&&((g=document.createElement("input")).type="checkbox",g.title=n.text,f.insertBefore(g,f.firstChild),w.options.syncWithColumns&&g.addEventListener("change",(function(t){var e=l.context.getModel(),n=l.context.getQuery(),i=t.currentTarget,r=i.parentElement.parentElement.getAttribute("data-id");if(e.checkAttrProperty(r,"useInResult"))if(i.checked){var s=e.getAttributeById(r),a=n.addColumn({attribute:s});n.fireColumnsChangedEvent(o.QueryChangeAction.Add,a)}else{var c=n.getColumns().filter((function(t){return t.expr.tag===o.ExprTag.EntityAttribute&&t.expr.value===r}));c.length>0&&(n.removeColumn(c[0]),n.fireColumnsChangedEvent(o.QueryChangeAction.Delete,c[0]))}}))),w.options.showTooltips&&n.description&&f.setAttribute("title",n.description);for(var r=0;r<y+1;r++){var s=document.createElement("div");s.classList.add("".concat(w.cssPrefix,"-entity-offset")),f.insertBefore(s,f.firstChild)}(p=document.createElement("div")).classList.add("".concat(w.cssPrefix,"-entity-attr")),0==c.innerHTML.length&&p.classList.add("".concat(w.cssPrefix,"-entity-attr-root")),p.innerHTML="",p.appendChild(f),p.setAttribute("data-id",n.id),w.options.draggableAttributes&&i.Yy.registerDraggableItem({element:p,scope:"entityAttr",data:{attrId:n.id},renderer:function(t){t.innerHTML="";var e=document.createElement("span");e.innerText=n.text,t.appendChild(e)}}),w.options.attributeRenderedCallback&&w.options.attributeRenderedCallback(p),u.appendChild(p)}},w=this;for(v=0;v<b;v++)x(v);if(u.innerHTML.length&&(a.appendChild(u),m.addEventListener("click",(function(t){u.hidden=!u.hidden;var e=t.target,n="".concat(l.cssPrefix,"-entity-node-button-open");e.classList.contains(n)?e.classList.remove(n):e.classList.add(n),t.preventDefault()}))),u){var E=u.querySelectorAll(".".concat(this.cssPrefix,"-entity-attr > label > input"));for(v=0;v<E.length;v++){E[v].addEventListener("click",(function(t){t.target.checked&&!h.checked?h.checked=!0:0===u.querySelectorAll("input:checked").length&&(h.checked=!1),t.stopPropagation()}))}}return h.addEventListener("click",(function(t){for(var e=t.target,n=u.querySelectorAll("label input"),i=0;i<n.length;i++){n[i].checked=e.checked}if(l.options.syncWithColumns){for(var r=l.context.getQuery(),s=l.context.getModel(),a=[],c=0,d=Array.from(u.querySelectorAll(".".concat(l.cssPrefix,"-entity-attr")));c<d.length;c++){var h=d[c].getAttribute("data-id");s.checkAttrProperty(h,"useInResult")&&a.push(h)}if(e.checked)for(var p=0,f=a;p<f.length;p++){h=f[p];r.addColumn({attributeId:h})}else{var g=r.getColumns().filter((function(t){return t.expr.tag===o.ExprTag.EntityAttribute&&a.indexOf(t.expr.value)>=0}));r.removeColumns(g,null)}r.fireColumnsChangedEvent()}t.stopPropagation()})),e!=this.rootEntityBlock&&this.options.entityRenderedCallback&&this.options.entityRenderedCallback(a),a},e.prototype.createFilterBox=function(){var t=this;this.filterBoxBlock=document.createElement("div"),this.filterBoxBlock.classList.add("".concat(this.cssPrefix,"-filter-box")),this.filterBoxBlock.classList.add(s.z.getMobileCssClass()),this.filterBoxInput=document.createElement("input"),this.filterBoxInput.classList.add("".concat(this.cssPrefix,"-filter-box-input")),this.filterBoxInput.addEventListener("input",(function(e){for(var n=t.panel.querySelectorAll(".".concat(t.cssPrefix,"-entity-attr")),o=0;o<n.length;o++){var i=n[o];i.hidden=!t.checkFilterAttribute(i)}var r=t.panel.querySelectorAll(":scope > .".concat(t.cssPrefix,"-entity"));for(o=0;o<r.length;o++){for(var s=r[o],a=s.querySelectorAll(".".concat(t.cssPrefix,"-entity-attr")),l=0,c=0;c<a.length;c++)"None"!==a[c].style.display&&l++;s.hidden=0===l}""===t.filterBoxInput.value?t.collapseAll():t.expandAll()})),this.filterBoxBlock.appendChild(this.filterBoxInput),this.panel.insertBefore(this.filterBoxBlock,this.panel.firstChild)},e.prototype.createToolPanel=function(){var t=this,e="".concat(this.cssPrefix,"-tool-panel"),o=document.createElement("div");o.classList.add(e),o.classList.add(s.z.getMobileCssClass());var i=document.createElement("div");i.classList.add("".concat(e,"-select-all")),i.title="Select all";var r=document.createElement("div");r.classList.add("".concat(e,"-deselect-all")),r.title="Clear selection";var a=document.createElement("div");a.classList.add("".concat(e,"-add-columns")),a.title="Add column";var l=document.createElement("div");l.classList.add("".concat(e,"-add-cond")),l.title="Add condition";var c=document.createElement("div");c.classList.add("".concat(e,"-left-side"));var u=document.createElement("div");u.classList.add("".concat(e,"-right-side"));var d=this.context.getModel();this.options.showSelectAllButton&&(i.title=n.ag.getText("ButtonSelectAll"),c.appendChild(i),i.addEventListener("click",(function(){t.selectAll()}))),this.options.showClearSelectionButton&&(r.title=n.ag.getText("ButtonDeselectAll"),c.appendChild(r),r.addEventListener("click",(function(){t.deselectAll()}))),this.options.showAddColumnButton&&(a.title=n.ag.getText("ButtonAddColumns"),u.appendChild(a),a.addEventListener("click",(function(){var e,n=t.panel.querySelectorAll(".".concat(t.cssPrefix,"-entity-attr")),o=[],i=t.context.getQuery();i.fireProcessEvent({source:self,status:"start"});for(var r=0;r<n.length;r++){var s=n[r];s.getElementsByTagName("input")[0].checked&&(e=s.getAttribute("data-id"),d.checkAttrProperty(e,"useInResult")&&o.push(e))}for(var a=0,l=o;a<l.length;a++){var c=l[a],u=d.getAttributeById(c);i.addColumn({attribute:u},!0)}i.fireChangedEvent(),t.options.autoClearSelection&&t.deselectAll(),i.fireProcessEvent({source:self,status:"finish"})}))),this.options.showAddConditionButton&&(l.title=n.ag.getText("ButtonAddConditions"),u.appendChild(l),l.addEventListener("click",(function(){var e,n=t.panel.querySelectorAll(".".concat(t.cssPrefix,"-entity-attr")),o=[],i=t.context.getQuery();i.fireProcessEvent({source:self,status:"start"});for(var r=0;r<n.length;r++){var s=n[r];s.getElementsByTagName("input")[0].checked&&(e=s.getAttribute("data-id"),d.checkAttrProperty(e,"useInConditions")&&o.push(e))}for(var a=0,l=o;a<l.length;a++){var c=l[a];i.addSimpleCondition({attributeId:c})}i.fireChangedEvent(),t.options.autoClearSelection&&t.deselectAll(),i.fireProcessEvent({source:self,status:"finish"})}))),o.appendChild(c),o.appendChild(u),this.panel.appendChild(o)},e.prototype.checkFilterAttribute=function(t){if(t.querySelector("label input").checked)return!0;var e=t.querySelector("label").textContent;if(this.checkFilterText(e))return!0;var n=t.parentElement.parentElement.querySelector(".".concat(this.cssPrefix,"-entity-node")).querySelector("label").textContent;return!!this.checkFilterText(n)},e.prototype.checkFilterText=function(t){var e=this.filterBoxInput.value;return""==e||(0==this.options.filterBoxMode&&t.toLowerCase().indexOf(e.toLowerCase())>=0||1==this.options.filterBoxMode&&0==t.toLowerCase().indexOf(e.toLowerCase()))},e.prototype.refreshCheckedStateByColumns=function(){this.deselectAll();for(var t=0,e=this.context.getQuery().getColumns().filter((function(t){return t.expr.tag===o.ExprTag.EntityAttribute}));t<e.length;t++){var n=e[t],i=this.rootEntityBlock.querySelector(".".concat(this.cssPrefix,'-entity-attr[data-id="').concat(n.expr.value,'"]')),r=i.querySelector("label > input");r.checked=!0;for(var s=i.parentElement;s&&s.classList.contains("".concat(this.cssPrefix,"-entity-children"));){s.hidden=!1;var a=s.parentElement;if(!a||s===a.firstElementChild)break;(r=a.firstElementChild.querySelector("label > input")).checked=!0,s=a.parentElement}}},e.prototype.expandAll=function(){for(var t=0;t<this.rootEntityBlock.childNodes.length;t++)for(var e=this.rootEntityBlock.childNodes[0].querySelectorAll(".".concat(this.cssPrefix,"-entity-children")),n=0;n<e.length;n++){e[n].hidden=!1}var o=this.rootEntityBlock.querySelectorAll(".".concat(this.cssPrefix,"-entity-node-button"));for(t=0;t<o.length;t++){o[t].classList.add("".concat(this.cssPrefix,"-entity-node-button-open"))}},e.prototype.collapseAll=function(){for(var t=0;t<this.rootEntityBlock.childNodes.length;t++)for(var e=this.rootEntityBlock.childNodes[0].querySelectorAll(".".concat(this.cssPrefix,"-entity-children")),n=0;n<e.length;n++){e[n].hidden=!0}var o=this.rootEntityBlock.querySelectorAll(".".concat(this.cssPrefix,"-entity-node-button"));for(t=0;t<o.length;t++){o[t].classList.remove("".concat(this.cssPrefix,"-entity-node-button-open"))}},e.prototype.selectAll=function(){for(var t=this.entityTreeBlock.querySelectorAll("input"),e=0;e<t.length;e++){t[e].checked=!0}},e.prototype.deselectAll=function(){for(var t=this.entityTreeBlock.querySelectorAll("input"),e=0;e<t.length;e++){t[e].checked=!1}},e.prototype.renderProgressBlock=function(){this.progressBlock=document.createElement("div"),this.progressBlock.classList.add("".concat(r.YR,"-progress-win8")),this.progressBlock.classList.add(s.z.getMobileCssClass()),this.progressBlock.innerHTML='<div class="wBall" id="wBall_1"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_2"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_3"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_4"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_5"><div class="wInnerBall"></div></div>'},e.prototype.clear=function(){this.panel.innerHTML=""},e}(o.Widget),c=function(){function t(t){this.isFilteringMode=!1,this.showSelected=!1,this.parentMenu=t.menu||null,this.parentLevel=t.parent||null,this.parentElement=t.container||document.body,this.levelIndex=t.levelIndex||0,this.levelDiv=null,this.domWriteItemsId=t.domWriteItemsId||!1,this.menuId=t.menuId||"",this.itemRenderedCallback=t.itemRenderedCallback||null,this._applyItem={id:null,text:null,itemDiv:null},this.items=t.items||[],this.activeItem=null,this.selectedItem=null,this.initialized=!1,this.showSelected=t.showSelected,this.updated=0,this.renderContent()}return Object.defineProperty(t.prototype,"applyItem",{get:function(){return this._applyItem},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-menu"},enumerable:!1,configurable:!0}),t.prototype.getItems=function(){return this.items},t.prototype.setItems=function(t){this.items=t},t.prototype.renderContent=function(){var t=this;if(this.items){var e=this.parentMenu.style.colors.bgON||"white",o=this.parentMenu.style.colors.fgON||"black",r=(this.parentMenu.style.colors.bgOVER,this.parentMenu.style.itemStyle.fontFamily||""),a=this.parentMenu.style.itemStyle.fontSize||"14px",l=this.parentMenu.options.multiselect,c=this.parentMenu.options.isSubQuery,u=(0,i.uC)("div").addClass(s.z.getMobileCssClass());this.parentMenu.options.useDefaultStyles&&u.setStyle("backgroundColor",e).setStyle("border","1px solid").setStyle("borderColor",e).setStyle("backgroundColor",this.parentMenu.style.colors.border).setStyle("margin","-2px 2px 2px -2px").setStyle("width","auto").setStyle("height","auto"),u.setStyle("z-index",this.parentMenu.zIndex).setStyle("position","absolute").setStyle("display","none");var d=u.toDOM();d.menuLevel=this;var h=this._applyItem;if(l&&0===this.levelIndex&&!0!==this.parentMenu.options.hideButtons){var p=document.createElement("div");p.classList.add("".concat(this.cssPrefix,"-applyDiv")),p.menuItem=h,this.applyBtn=document.createElement("button"),this.parentMenu.options.useDefaultStyles&&(p.style.borderBottom="1px solid",p.style.padding="5px",p.style.marginBottom="5px",this.applyBtn.style.padding="0 5px",this.applyBtn.style.cursor="pointer");var f=document.createTextNode(this.parentMenu.options.buttons.submit);this.applyBtn.appendChild(f),p.appendChild(this.applyBtn);var g=document.createElement("button");g.classList.add("".concat(this.cssPrefix,"-cancel")),this.parentMenu.options.useDefaultStyles&&(g.style.padding="0 5px",g.style.cursor="pointer",g.style.marginLeft="15px");var m=document.createTextNode(this.parentMenu.options.buttons.cancel);g.appendChild(m),p.appendChild(g),d.appendChild(p),h.itemDiv=p,this.applyBtn.addEventListener("click",(function(){t.submit(t._applyItem)})),g.addEventListener("click",(function(){t.parentMenu.hideMenu()}))}if(null==this.parentLevel&&(this.parentMenu.options.searchBoxAlwaysShown||this.items.length>=this.parentMenu.options.showSearchBoxAfter)){var y=(0,i.uC)("div").addClass("".concat(this.cssPrefix,"-searchDiv"));this.parentMenu.options.useDefaultStyles&&(y.setStyle("border-bottom","1px solid #666").setStyle("background-color",e).setStyle("border-color",this.parentMenu.style.colors.border),""!=r&&y.setStyle("font-family",r),y.setStyle("font-size",a).setStyle("color",o).setStyle("cursor","pointer").setStyle("text-align","left").setStyle("padding","5px"));var v=(0,i.uC)("input").id("searchBox").name("searchBox").type("text").size(16).addClass("".concat(this.cssPrefix,"-searchBox")).on("input",(function(e){t.deactivateItem(t.activeItem),t.renderItems(t.searchBox.value)})).on("keydown",(function(e){switch(e.keyCode){case 13:t.activeItem&&t.activeItem.itemDiv.click();break;case 38:t.moveActiveItemUp();break;case 40:t.moveActiveItemDown();break;case 39:t.searchBox.value||t.openSubLevel(t.activeItem)}}));this.parentMenu.options.useDefaultStyles&&v.setStyle("font-family","monospace").setStyle("font-size","8pt").setStyle("width","100%"),c&&v.addClass("eqjs-dialog"),this.searchBox=v.toDOM(),this.searchDiv=y.toDOM(),this.searchDiv.appendChild(this.searchBox),d.appendChild(this.searchDiv)}var C=document.createElement("div");C.tabIndex=1,(0,i.uC)(C).addClass("".concat(this.cssPrefix,"-scrollDiv")).addClass(s.z.getMobileCssClass()),C.style.overflowX="hidden",C.style.overflowY="auto",C.style.position="relative",d.appendChild(C),this.levelDiv=d,this.scrollDiv=C,this.menuId&&(this.levelDiv.id=this.menuId),this.parentLevel&&(this.levelDiv.style.zIndex=this.parentLevel.levelDiv.style.zIndex),this.renderItems();C.addEventListener("keydown",(function(e){switch(e.which){case 13:t.parentMenu.options.multiselect?t.parentMenu.getRootLevel().applyBtn.click():t.activeItem&&t.activeItem.itemDiv.click();break;case 32:t.activeItem&&t.activeItem.itemDiv.click();break;case 37:t.parentLevel&&!t.isFilteringMode&&(t.deactivateItem(t.activeItem),t.parentLevel.focus());break;case 39:t.openSubLevel(t.activeItem);break;case 38:t.moveActiveItemUp();break;case 40:t.moveActiveItemDown();break;default:return}e.preventDefault()})),s.z.isMobileMode()&&(this.closeDiv=(0,i.uC)("div",d).addClass("eqjs-menu-close-btn").addText(n.ag.getText("ButtonClose")).on("click",(function(){t.parentMenu.hideMenu()})).toDOM())}},t.prototype.moveActiveItemDown=function(){var t=this.isFilteringMode?this.filteredItems:this.items;if(this.activeItem){var e=t.indexOf(this.activeItem);e<t.length-1&&this.activateItem(t[e+1],!1)}else this.activateItem(t[0],!1)},t.prototype.moveActiveItemUp=function(){var t=this.isFilteringMode?this.filteredItems:this.items;if(this.activeItem){var e=t.indexOf(this.activeItem);e>0&&this.activateItem(t[e-1],!1)}else this.activateItem(t[t.length-1],!1)},t.prototype.openSubLevel=function(t){t&&t.items&&!this.isFilteringMode&&(this.showSubLevel(t),t.subLevel.activateItem(t.subLevel.items[0]))},t.prototype.focusScrollDiv=function(){this.scrollDiv.focus()},t.prototype.turnCheckboxes=function(t){for(var e=0;e<t.length;e++){var n=t[e];n.itemCheckbox&&(n.itemCheckbox.checked=this.isItemSelected(n)),n.items&&this.turnCheckboxes(n.items)}},t.prototype.isItemSelected=function(t){if(t.items){for(var e=0;e<t.items.length;e++)if(this.isItemSelected(t.items[e]))return!0;return!1}return t.selected},t.prototype.setItemSelected=function(t,e){if(t.items)for(var n=0;n<t.items.length;n++)this.setItemSelected(t.items[n],e);else t.selected=e},t.prototype.submitItems=function(t,e){for(var n=0;n<t.length;n++)t[n].items?this.submitItems(t[n].items,e):t[n].selected&&e.push(t[n])},t.prototype.allSubitemsAreFiltered=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return!1;return!0},t.prototype.isItemDiv=function(t){return!!t.menuItem},t.prototype.isLevelDiv=function(t){return!!t.menuLevel},t.prototype.getMenuItem=function(t){for(var e=t;!this.isItemDiv(e);){if(this.isLevelDiv(e))throw"Can't get menu item";e=e.parentElement}return e.menuItem},t.prototype.renderItemsWithoutFilter=function(){var t=this;this.isFilteringMode=!1;var e=this.scrollDiv,n=this.parentMenu.options.multiselect,o=this.parentMenu.options.activateOnMouseOver,r=this.parentMenu.style.colors.fgON||"black",a=(this.parentMenu.style.colors.bgOVER,this.parentMenu.style.itemStyle.fontSize||"14px"),l=this.parentMenu.getItemFilterCallback();e.innerHTML="";for(var c=0;c<this.items.length;c++){var u=this.items[c];if(u&&u.text){if(l){if(!l(u))continue;if(u.items&&this.allSubitemsAreFiltered(u.items,l))continue}u.data=function(e){return t[e]},void 0===u.selected&&(u.selected=!1),u.selected&&null==this.selectedItem&&(this.selectedItem=u);var d=document.createElement("div");if((0,i.uC)(d).addClass("".concat(this.cssPrefix,"-itemDiv")).addClass(s.z.getMobileCssClass()),u.selected&&this.showSelected&&!n&&d.classList.add("".concat(this.cssPrefix,"-selected")),this.domWriteItemsId&&this.menuId&&(d.id="item-"+this.menuId+"-"+u.id),e.appendChild(d),d.menuItem=u,d.menuLevel=this,u.itemDiv=d,this.parentMenu.options.useDefaultStyles&&(d.style.fontSize=a,d.style.color=r,d.style.paddingLeft="15px",d.style.paddingRight="6px",d.style.cursor="pointer"),"---"==u.text)d.appendChild(document.createElement("hr"));else{if(n){var h=document.createElement("input");h.type="checkbox",h.id="cb"+u.id,h.checked=this.isItemSelected(u),h.defaultChecked=this.isItemSelected(u),d.appendChild(h),u.itemCheckbox=h,this.parentMenu.options.useDefaultStyles&&(h.style.margin="4px 10px 0 0",h.style.verticalAlign="top")}var p=u.text;this.parentMenu.options.showItemIds&&(p=u.id+":"+p);var f=document.createTextNode(p);if(d.appendChild(f),u.items&&u.items.length>0){d.classList.add("".concat(this.cssPrefix,"-itemDiv-hasChildren"));var g=document.createElement("span");g.classList.add("".concat(this.cssPrefix,"-itemDiv-arrow")),d.appendChild(g);var m=document.createTextNode(">");g.appendChild(m)}var y=function(e){var o=t.getMenuItem(e.target);if(n)if(o.items&&e.target!=o.itemCheckbox)t.activateItem(o);else{var i=t.isItemSelected(o);t.setItemSelected(o,!i),o.itemCheckbox.checked=!i,t.parentMenu.refreshCheckboxes()}else t.activateItem(o),t.submit(o);return!1};d.removeEventListener("click",y),d.addEventListener("click",y),d.addEventListener("mouseenter",(function(e){var n=t.getMenuItem(e.target);t.parentMenu.isCursorInside=!0,o&&t.activateItem(n)})),d.addEventListener("mouseleave",(function(e){var n=t.getMenuItem(e.target);t.parentMenu.isCursorInside=!1,setTimeout((function(){t.parentMenu.isCursorInside||o&&n==t.activeItem&&!n.subLevel&&t.deactivateItem(n)}),200)}))}this.itemRenderedCallback&&this.itemRenderedCallback(this.menuId,d)}}},t.prototype.renderItemsWithFilter=function(t){this.isFilteringMode=!0,this.scrollDiv.innerHTML="";var e=t.split(">"),n=e.map((function(t){return t.replace(/\*/g,"")})),o=this.filterItems(this.items,e);this.filteredItems=[];for(var i=0;i<o.length;i++)this.renderItemWithFilter(o[i],n,0)},t.prototype.matchesFilter=function(t,e){return!t||!e||e.test(t)},t.prototype.filterItems=function(t,e){for(var o=[],i=e.length>0?e[0]:"",r=e.length>1?e.slice(1):e,s=i?new RegExp(i.replace(/\*/g,".+?"),"i"):null,a=0;a<t.length;a++){var l=t[a];if(l.items){var c=n.P6.assign({},l),u=this.matchesFilter(l.text,s);e.length<2?u&&e.length<2?c.items=n.P6.createArrayFrom(l.items):c.items=this.filterItems(l.items,r):c.items=u?this.filterItems(l.items,r):[],c.items.length>0&&o.push(c)}else this.matchesFilter(l.text,s)&&o.push(l)}return o},t.prototype.renderItemWithFilter=function(t,e,n){var o=this,r=this.scrollDiv,a=n<e.length?e[n]:e[e.length-1],l=this.parentMenu.options.multiselect,c=this.parentMenu.options.activateOnMouseOver,u=this.parentMenu.style.colors.fgON||"black",d=(this.parentMenu.style.colors.bgOVER,this.parentMenu.style.itemStyle.fontSize||"14px"),h=this.parentMenu.getItemFilterCallback();if(t&&t.text){if(h){if(!h(t))return;if(t.items&&this.allSubitemsAreFiltered(t.items,h))return}t.data=function(t){return this[t]},void 0===t.selected&&(t.selected=!1),t.selected&&null==this.selectedItem&&(this.selectedItem=t);var p=document.createElement("div");if((0,i.uC)(p).addClass("".concat(this.cssPrefix,"-itemDiv")).addClass(s.z.getMobileCssClass()),p.style.marginLeft="".concat(10*n,"px"),t.selected&&!l&&p.classList.add("".concat(this.cssPrefix,"-selected")),this.domWriteItemsId&&this.menuId&&(p.id="item-"+this.menuId+"-"+t.id),r.appendChild(p),p.menuItem=t,p.menuLevel=this,t.itemDiv=p,this.parentMenu.options.useDefaultStyles&&(p.style.fontSize=d,p.style.color=u,p.style.paddingLeft="15px",p.style.paddingRight="6px",p.style.cursor="pointer"),"---"==t.text)p.appendChild(document.createElement("hr"));else{if(l){var f=document.createElement("input");f.type="checkbox",f.id="cb"+t.id,f.checked=this.isItemSelected(t),f.defaultChecked=this.isItemSelected(t),p.appendChild(f),t.itemCheckbox=f,this.parentMenu.options.useDefaultStyles&&(f.style.margin="4px 10px 0 0",f.style.verticalAlign="top")}var g=document.createElement("span");if(g.innerHTML=this.highlightText(t.text,a),p.appendChild(g),t.items&&t.items.length>0)p.classList.add("".concat(this.cssPrefix,"-itemDiv-filter-hasChildren"));else{this.filteredItems.push(t);var m=function(e){if(l)if(t.items&&e.target!=t.itemCheckbox)o.activateItem(t);else{var n=o.isItemSelected(t);o.setItemSelected(t,!n),t.itemCheckbox.checked=!n,o.parentMenu.refreshCheckboxes()}else o.activateItem(t),o.submit(t);return!1};p.removeEventListener("click",m),p.addEventListener("click",m),p.addEventListener("mouseenter",(function(e){o.parentMenu.isCursorInside=!0,c&&o.activateItem(t)})),p.addEventListener("mouseleave",(function(e){o.parentMenu.isCursorInside=!1,setTimeout((function(){o.parentMenu.isCursorInside||c&&t==o.activeItem&&!t.subLevel&&o.deactivateItem(t)}),200)}))}}if(t.items)for(var y=0;y<t.items.length;y++)this.renderItemWithFilter(t.items[y],e,n+1);this.itemRenderedCallback&&this.itemRenderedCallback(this.menuId,p)}},t.prototype.highlightText=function(t,e){if(e&&e.length>0){var n=e.toLowerCase(),o=t.toLowerCase();if(o.indexOf(n)>=0){for(var i=0,r=t,s=[];;){var a=o.indexOf(n,i);if(a>=0?(s.push(a),i=a+e.length):i++,i>=r.length-1)break}if(s.length>0){t="";for(var l=0;l<s.length;l++)0===l&&(t+=r.substring(0,s[l])),t+="<span class='eqjs-menu-itemDiv-highlight'>"+r.substring(s[l],s[l]+e.length)+"</span>",l<s.length-1?t+=r.substring(s[l]+e.length,s[l+1]):t+=r.substring(s[l]+e.length)}}}return t},t.prototype.renderItems=function(t){t||s.z.isMobileMode()?(t=t||"",this.renderItemsWithFilter(t.toLowerCase())):this.renderItemsWithoutFilter()},t.prototype.activateItem=function(t,e){void 0===e&&(e=!0),null!=this.activeItem&&this.deactivateItem(this.activeItem),this.activeItem=t;var n=t.itemDiv;if(n.classList.add("active"),this.parentMenu.options.useDefaultStyles){this.parentMenu.style.colors.bgON,this.parentMenu.style.colors.fgON;var o=this.parentMenu.style.colors.bgOVER,i=this.parentMenu.style.colors.fgOVER||"";this.parentMenu.style.itemClass;""!=(this.parentMenu.style.itemClassOver||"")?(n.style.backgroundColor="",n.style.color=""):(n.style.backgroundColor=o,n.style.color=i)}t.items&&!this.isFilteringMode&&e&&this.showSubLevel(t)},t.prototype.deactivateItem=function(t){if(t){var e=t.itemDiv;if(e.classList.remove("active"),this.parentMenu.options.useDefaultStyles){var n=this.parentMenu.style.colors.bgON,o=this.parentMenu.style.colors.fgON;""!=(this.parentMenu.style.itemClass||"")?(e.style.backgroundColor="",e.style.color=""):(e.style.backgroundColor=n,e.style.color=o)}t.subLevel&&t.subLevel.hide(),this.activeItem=null}},t.prototype.showSubLevel=function(e){if(!e.subLevel){var n="";this.menuId&&(n=this.menuId+"-"+e.id),e.subLevel=new t({showSelected:this.showSelected,menu:this.parentMenu,parent:this,container:this.parentElement,items:e.items,levelIndex:this.levelIndex+1,domWriteItemsId:this.domWriteItemsId,menuId:n,itemRenderedCallback:this.itemRenderedCallback})}var o=(0,i.lE)(e.itemDiv),r=(0,i.MX)(),s=(0,i.L8)(),a=o.x-r.left,l=s.width-a-e.itemDiv.offsetWidth;o.x+=e.itemDiv.offsetParent.offsetWidth,o.y+=1,e.subLevel.showAt(o.x,o.y,!0,!0),e.subLevel.levelDiv.style.width="",e.subLevel.levelDiv.style.right="",l>=e.subLevel.levelDiv.offsetWidth||l>=a?l<e.subLevel.levelDiv.offsetWidth&&(e.subLevel.levelDiv.style.right=-r.left+"px"):(a<e.subLevel.levelDiv.offsetWidth?e.subLevel.levelDiv.style.left=r.left+4+"px":e.subLevel.levelDiv.style.left="",e.subLevel.levelDiv.style.right=(0,i.S3)().width-o.x+e.itemDiv.offsetWidth-6+"px"),e.subLevel.levelDiv.style.visibility="visible",e.subLevel.focus()},t.prototype.adjustTopPos=function(t){var e=(0,i.L8)(),n=t-(0,i.MX)().top+this.levelDiv.offsetHeight,o=t;return n>e.height-5&&(o-=n-e.height+5)<(0,i.MX)().top&&(o=(0,i.MX)().top+10),o},t.prototype.showAt=function(t,e,n,o){if(this.items){this.initLevelDiv(),this.turnCheckboxes(this.items),this.renderItems();var r=this.levelDiv.style;o&&(this.levelDiv.style.visibility="hidden"),r.display="block",r.left=t+"px",r.top=e+"px",this.scrollDiv.style.width="auto",this.scrollDiv.style.height="auto",n&&(e=this.adjustTopPos(e),r.top=e+"px");var s=this.parentMenu.minItemWidth;if(s>0&&this.scrollDiv.offsetWidth<s)for(var a=0;a<this.items.length;a++)this.items[a].itemDiv.style.width=s+"px";var l=this.parentMenu.maxItemWidth;if(l>0&&this.scrollDiv.offsetWidth>l)for(a=0;a<this.items.length;a++)this.items[a].itemDiv.style.width=l+"px",this.items[a].itemDiv.style.overflowX="hidden";var c=(0,i.L8)().height-(e-(0,i.MX)().top)-15;if(this.parentMenu.maxHeight>0&&c>this.parentMenu.maxHeight&&(c=this.parentMenu.maxHeight),null!=this._applyItem&&null!=this._applyItem.itemDiv&&(c-=this._applyItem.itemDiv.offsetHeight+5),null!=this.searchDiv&&(c-=this.searchDiv.offsetHeight),null!=this.closeDiv&&(c-=this.closeDiv.offsetHeight),this.levelDiv.offsetHeight>c){var u=c;u<50&&(u=50),this.scrollDiv.style.height=u+"px"}else this.scrollDiv.style.height="auto";this.activeItem=null}},t.prototype.focus=function(){var t=this;window.setTimeout((function(){t.scrollDiv.focus(),null!=t.searchBox&&(t.parentMenu.options.searchBoxAutoFocus&&t.searchBox.focus(),t.searchBox.value="")}),100)},t.prototype.hide=function(){(null!==this.activeItem&&this.activeItem.subLevel&&this.activeItem.subLevel.hide(),this.levelDiv)&&(this.levelDiv.style.display="none",this.initialized&&(this.parentElement.removeChild(this.levelDiv),this.initialized=!1))},t.prototype.initLevelDiv=function(){this.initialized||(this.parentElement.appendChild(this.levelDiv),(0,i.uC)(this.levelDiv).addClass("".concat(this.cssPrefix,"-levelDiv")).addClass(s.z.getMobileCssClass()),this.initialized=!0)},t.prototype.submit=function(t){if(null!=t&&!t.items){this.parentMenu.hideMenu();var e=[];t==this._applyItem&&this.submitItems(this.items,e),this.parentMenu.submitMenu(t,e)}},t.prototype.remove=function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];e.subLevel&&e.subLevel.remove()}if(this.levelDiv){this.levelDiv.innerHTML="";var n=this.levelDiv.parentNode;null!=n&&n.removeChild(this.levelDiv)}this.levelDiv=null},t.prototype.update=function(t){this.remove(),this.items=t,this.activeItem=null,this.selectedItem=null,this._applyItem.itemDiv=null,this.initialized=!1,this.updated++,this.renderContent()},t.prototype.refreshCheckboxes=function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];e.itemCheckbox&&(e.itemCheckbox.checked=this.isItemSelected(e)),e.subLevel&&e.subLevel.refreshCheckboxes()}},t.prototype.refreshItems=function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];e.itemDiv&&(e.hidden?e.itemDiv.style.display="none":e.itemDiv.style.display="block"),e.subLevel&&e.subLevel.refreshItems()}},t.prototype.findItem=function(t){for(var e=t.toLowerCase(),n=0;n<this.items.length;n++){var o=this.items[n];if(0==o.text.toLowerCase().indexOf(e))return o}return null},t}(),u=function(){function t(e){var o=this;this.isCursorInside=!1,this.mouseIsOverBlock=!1,this.mouseIsOverLink=!1,this.toId=null,this.active=!1,this.ancorFocused=null,this.options={items:[],buttons:{submit:n.ag.getText("ButtonApply"),cancel:n.ag.getText("ButtonCancel")},itemFilterCallback:null,useDefaultStyles:!1,multiselect:!1,adjustHeight:!0,showSearchBoxAfter:30,activateOnMouseOver:!0,container:document.body,domWriteItemsId:!1,itemRenderedCallback:null,showItemIds:!1},e&&n.P6.assignDeep(this.options,e),this.options.hideButtons&&(this.options.submitOnBlur=!0),this.menuId=t.lastMenuID++,this.updateProps(),this.rootLevel=new c({menu:this,items:this.options.items,levelIndex:0,container:this.options.container,domWriteItemsId:this.options.domWriteItemsId,menuId:this.options.id,itemRenderedCallback:this.options.itemRenderedCallback,showSelected:this.options.showSelected}),this.rootLevel.levelDiv.classList.add("".concat(this.cssPrefix,"-rootLevel")),this.options.zIndex&&(this.rootLevel.levelDiv.style.zIndex="".concat(this.options.zIndex)),this.menuKeyUpHandler=function(t){27==t.which&&(o.hideMenu(),t.stopImmediatePropagation())},this.globalMouseDownHandler=function(t){if(!o.active)return!0;for(var e=window.event||t,n=e.srcElement||e.target,i=!0;n;){if(n.tagName&&"div"==n.tagName.toLowerCase()&&n.menuLevel&&n.menuLevel.parentMenu==o){i=!1;break}n=n.parentNode||n.parentElement}return i&&(o.options.submitOnBlur&&o.rootLevel.submit(o.rootLevel.applyItem),o.hideMenu()),!0},this.render()}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-menu"},enumerable:!1,configurable:!0}),t.prototype.getItems=function(){return this.rootLevel.getItems()},t.prototype.updateProps=function(){this.style={},this.style.colors={border:"#666666",shadow:"#888888",bgON:"white",fgON:"black",bgOVER:"#B6BDD2",fgOVER:"black"},this.style.itemStyle={fontSize:"14px"},this.minItemWidth=0,this.maxItemWidth=0,this.maxHeight=0,this.zIndex="".concat(this.options.zIndex),this.commandTemplate="",this.args=[],this.active=!1},t.prototype.render=function(){},t.prototype.clearItemsMenuProps=function(t){if(t)for(var e=0;e<t.length;e++)this.clearItemMenuProps(t[e])},t.prototype.clearItemMenuProps=function(t){t.subLevel&&t.subLevel.parentMenu==this||(t.subLevel&&(t.subLevel.remove(),t.subLevel=null),t.itemDiv&&(t.itemDiv=null),t.items&&this.clearItemsMenuProps(t.items))},t.prototype.setSelectedItems=function(t,e){for(var n=t?t.length:0,o=0;o<n;o++){var i=t[o];i.items?this.setSelectedItems(i.items,e):i.selected=e.indexOf(i.id)>=0}},t.prototype.getRootLevel=function(){return this.rootLevel},t.prototype.getItemFilterCallback=function(){return this.itemFilterCallback},t.prototype.showMenu=function(t){this.ancorFocused=t.anchor==document.activeElement?t.anchor:null,this.clearItemsMenuProps(this.options.items),this.itemSelectedCallback=t.itemSelectedCallback||null,this.menuClosedCallback=t.menuClosedCallback||null,this.itemFilterCallback=t.itemFilterCallback||null,t.items&&(this.options.items=t.items,this.rootLevel.setItems(t.items)),t.onMenuItemSelected&&(this.options.onMenuItemSelected=t.onMenuItemSelected);var e=t.selectedIds||null;if(e?"string"==typeof e&&(e=e.split(",")):e=[],this.active=!0,this.setSelectedItems(this.options.items,e),s.z.isMobileMode())this.rootLevel.showAt(0,0,!0,!0),this.rootLevel.levelDiv.style.top="0px",this.rootLevel.levelDiv.style.bottom="0px",this.rootLevel.levelDiv.style.right="0px",this.rootLevel.levelDiv.style.position="fixed",this.rootLevel.levelDiv.style.fontSize="20px";else{var n=t.anchor||document.documentElement,o=(0,i.lE)(n),a=n.offsetHeight,l=n.offsetWidth,c={x:o.x,y:o.y+a+2},u=(0,i.MX)(),d=(0,i.L8)(),h=c.x+l-u.left,p=d.width-h+l;c.x+=2,this.rootLevel.showAt(c.x,c.y,!0,!0),this.rootLevel.levelDiv.style.width="",this.rootLevel.levelDiv.style.right="",this.rootLevel.levelDiv.style.zIndex||(this.rootLevel.levelDiv.style.zIndex="".concat(Math.max(1e4,(0,r.X1)(n)+1))),p>=this.rootLevel.levelDiv.offsetWidth||p>=h?p<this.rootLevel.levelDiv.offsetWidth&&(this.rootLevel.levelDiv.style.right=-u.left+"px"):(h<this.rootLevel.levelDiv.offsetWidth?this.rootLevel.levelDiv.style.left=u.left+4+"px":this.rootLevel.levelDiv.style.left="",this.rootLevel.levelDiv.style.right=(0,i.S3)().width-c.x-l+"px"),this.rootLevel.levelDiv.style.fontSize="14px"}this.rootLevel.levelDiv.style.visibility="visible",this.rootLevel.focus(),document.addEventListener("keyup",this.menuKeyUpHandler),document.addEventListener("mousedown",this.globalMouseDownHandler,!0)},t.prototype.hideMenu=function(){document.removeEventListener("mousedown",this.globalMouseDownHandler,!0),document.removeEventListener("keyup",this.menuKeyUpHandler),this.rootLevel.hide(),this.ancorFocused&&this.ancorFocused.focus(),this.menuClosedCallback&&this.menuClosedCallback()},t.prototype.submitMenu=function(t,e){this.itemSelectedCallback&&this.itemSelectedCallback(t,e)},t.prototype.knockMenuStyle=function(t){t.removeAttribute("style");var e=t.querySelectorAll("ul").item(0);!1!==!(!e||!e.style)&&e.setAttribute("style","")},t.prototype.refreshItems=function(){this.rootLevel.refreshItems()},t.prototype.refreshCheckboxes=function(){this.rootLevel.refreshCheckboxes()},t.lastMenuID=0,t}(),d=function(){function t(){this.formatStr="",this.pos=0,this.token="text",this.tokenText=""}return t.prototype.start=function(t){this.formatStr=t,this.pos=0,this.tokenText=""},t.prototype.skipSpaces=function(){for(;this.pos<this.formatStr.length&&" "===this.formatStr.charAt(this.pos);)this.pos++},t.prototype.getToken=function(){return this.token},t.prototype.getTokenText=function(){return this.tokenText},t.prototype.next=function(){if(this.skipSpaces(),this.pos>=this.formatStr.length)return!1;var t=0;if("{"===this.formatStr.charAt(this.pos)){if((t=this.formatStr.indexOf("}",this.pos))<0)return!1;this.tokenText=this.formatStr.substring(this.pos,t+1),0!==this.tokenText.indexOf("{expr")&&0!==this.tokenText.indexOf("{attr")||(this.token="expression"),this.pos=t+1}else if("["===this.formatStr.charAt(this.pos)&&this.pos<this.formatStr.length-1&&"["===this.formatStr.charAt(this.pos+1))this.pos+=2,t=this.formatStr.indexOf("]]",this.pos),this.token="function",this.tokenText=this.formatStr.substring(this.pos,t),this.pos=t+2;else{this.token="text";var e=this.formatStr.indexOf("{",this.pos);e<0&&(e=this.formatStr.length);var n=this.formatStr.indexOf("[[",this.pos);n<0&&(n=this.formatStr.length),t=Math.min(e,n),this.tokenText=this.formatStr.substring(this.pos,t).trim(),this.pos=t}return!0},t}(),h=function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))};!function(t){t[t.Enable=0]="Enable",t[t.Delete=1]="Delete",t[t.Hidden=2]="Hidden",t[t.SortingNone=3]="SortingNone",t[t.SortingAsc=4]="SortingAsc",t[t.SortingDesc=5]="SortingDesc",t[t.MoveTop=6]="MoveTop",t[t.MoveUp=7]="MoveUp",t[t.MoveDown=8]="MoveDown",t[t.MoveBottom=9]="MoveBottom",t[t.Menu=10]="Menu",t[t.Type=11]="Type",t[t.Format=12]="Format"}(e||(e={}));var p,f=function(){function t(t,e,n){this.functionMenu=null,this.formatsMenu=null,this.buttonMenu=null,this.isMouseOverBlock=!1,this.keepShowingButtons=!1,this.panel=t,this.column=e,this.element=n}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-qc"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"columnEnabled",{get:function(){return this.column.enabled},set:function(t){this.column.enabled=t},enumerable:!1,configurable:!0}),t.prototype.render=function(){var t=this;this.getButtonsToShow().indexOf("sorting")>=0&&this.columnEnabled&&(this.sortingButton=this.renderSoringButton(this.column.sorting),this.column.sorting!==o.SortDirection.None&&(this.sortingButton.style.display="block"));var e=(0,i.uC)("div");return e.data("id",this.column.id),this.element&&this.element.parentNode.replaceChild(e.toDOM(),this.element),this.element=e.toDOM(),this.panel.options.allowDragDrop&&!s.z.isMobileMode()&&i.Yy.registerDraggableItem({element:this.element,scope:"entityAttrSort",data:{column:this.column},beforeDragStart:function(){t.hideButtons()},renderer:function(e){e.innerHTML="";var n=document.createElement("span");n.innerText=t.column.caption,e.classList.add("eqjs-sortable-helper"),e.appendChild(n)},onDragStart:function(e){t.element.style.display="none",e.dropEffect=i.KX.Allow},onDragEnd:function(e){e.data.finishedSuccessfully||t.element.style.removeProperty("display")}}),this.isEditable()&&(this.createFunctionMenu(),this.createFormatsMenu()),this.createButtonMenu(),e.addClass(this.getClassesToAdd()).addClass(s.z.getMobileCssClass()).addChildElement(this.renderCheckbox()).addChild("div",(function(e){return e.addClass("".concat(r.YR,"-button-placeholder"),"".concat(t.cssPrefix,"-button-placeholder"),"".concat(t.cssPrefix,"-colelement"),"".concat(t.cssPrefix,"-sortbutton-placeholder")).addChildElement(t.sortingButton)})).addChildElement(this.renderExpressionBlock()),!1===this.panel.options.showColumnTitles||s.z.isMobileMode()||e.addChildElement(this.renderCaptionBlock()),e.addChild("div",(function(e){e.addClass("".concat(r.YR,"-column-buttonsBlock"),"".concat(t.cssPrefix,"-buttonsBlock")).addClass(s.z.getMobileCssClass()),t.getButtonsToShow().indexOf("enable")>=0&&!t.column.isReadOnly()&&e.addChildElement(t.renderEnabledButton()),t.getButtonsToShow().indexOf("type")>=0&&t.columnEnabled&&e.addChildElement(t.renderColumnTypeButton()),t.getButtonsToShow().indexOf("format")>=0&&t.columnEnabled&&e.addChildElement(t.renderColumnFormatButton()),t.getButtonsToShow().indexOf("delete")>=0&&!t.column.isReadOnly()&&e.addChildElement(t.renderDeleteButton()),t.getButtonsToShow().indexOf("menu")>=0&&!t.column.isReadOnly()&&e.addChildElement(t.renderMenuButton())})),s.z.isMobileMode()||e.on("mouseenter",this.onMouseEnter.bind(this)).on("mouseleave",this.onMouseLeave.bind(this)),(this.panel.options.accentActiveColumn||s.z.isMobileMode())&&e.on("click",this.onMouseClick.bind(this)),this.panel.options.alwaysShowButtons&&this.showButtons(),this.element},t.prototype.onMouseClick=function(t){return t.stopPropagation(),this.panel.toggleColumnPicked(this.column),this.adjustButtonsVisibility(),s.z.isMobileMode()||this.element.dispatchEvent((0,i.sJ)("mouseenter")),!1},t.prototype.fireColumnChanged=function(){this.column.fireChangedEvent()},t.prototype.refresh=function(){this.render()},t.prototype.renderCaptionBlock=function(){var t=this,e=(0,i.uC)("div").addClass("".concat(this.cssPrefix,"-colelement"),"".concat(this.cssPrefix,"-captionelement")).addClass(s.z.getMobileCssClass());return this.isEditable()?e.addChild("a",(function(e){return e.attr("href","javascript:void(0)").title(t.column.caption).text(t.column.caption).on("click",(function(e){e.stopPropagation();var n=e.target,o=n.parentElement.querySelector("input");return o&&(n.style.display="none",o.style.removeProperty("display"),o.style.minWidth="".concat(n.clientWidth),o.focus(),t.element.setAttribute(i.Yy.DRAG_DISABLED_ATTR,"")),!1}))})).addChild("input",(function(e){return e.hide().value(t.column.caption).on("blur keydown",(function(e){var n=!1,o=!0;if(e instanceof KeyboardEvent?13===e.keyCode?n=!0:27===e.keyCode&&(n=!0,o=!1):e instanceof FocusEvent&&(n=!0),n){var s=e.target,a=s.parentElement.querySelector("a");a&&(a.style.removeProperty("display"),s.style.display="none"),o&&t.column.caption!==s.value?(t.column.caption=s.value,t.fireColumnChanged()):(s.value=t.column.caption,(0,r.n6)(a)),t.element.removeAttribute(i.Yy.DRAG_DISABLED_ATTR)}return!0}))})):e.addChild("span",(function(e){e.text(t.column.caption).title(t.column.caption)})),e.toDOM()},t.prototype.renderSoringButton=function(t){var n,s=this,a="".concat(r.YR,"-column-sortbutton");switch(t){case o.SortDirection.Ascending:n="".concat(a,"-asc");break;case o.SortDirection.Descending:n="".concat(a,"-desc");break;default:n="".concat(a,"-none")}return this.isEditable()?(0,i.uC)("div").addClass(a,"".concat(r.YR,"-button"),n).data("btnplaceholder","").title(o.i18n.getText("ButtonSorting")).attr("tabIndex","0").on("click",(function(t){t.stopPropagation(),s.keepShowingButtons=!0,(s.getUIS()&&s.panel.sortMenu||s.panel.moveMenu).showMenu({anchor:s.sortingButton,selectedIds:s.column.isHidden()?["IsHidden"]:null,itemSelectedCallback:function(t,n){var o;switch(t.id){case"IsHidden":o=e.Hidden;break;case"MoveTop":o=e.MoveTop;break;case"MoveDown":o=e.MoveDown;break;case"MoveUp":o=e.MoveUp;break;case"MoveBottom":o=e.MoveBottom;break;case"None":o=e.SortingNone;break;case"Ascending":o=e.SortingAsc;break;case"Descending":o=e.SortingDesc}s.buttonMenuHandler(o,null)},menuClosedCallback:function(){s.keepShowingButtons=!1,s.isMouseOverBlock||s.leaveButtonBlock()}})})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).toDOM():t===o.SortDirection.Ascending||t===o.SortDirection.Descending?(0,i.uC)("div").addClass(a,"".concat(r.YR,"-button"),n).title(o.i18n.getText("ButtonSorting")).toDOM():null},t.prototype.renderCheckbox=function(){var t=this;return this.panel.options.showCheckboxes&&!this.column.isReadOnly()?(0,i.uC)("div").title(o.i18n.getText("CmdToggleEnable")).attr("tabIndex","0").addClass("".concat(this.cssPrefix,"-colelement ").concat(this.cssPrefix,"-column-checkbox")).addClass("".concat(this.columnEnabled?"enabled":"")).on("click",(function(){return t.columnEnabled=!t.columnEnabled,t.column.fireChangedEvent(),!1})).on("keypress",(function(t){[13,32].includes(t.keyCode)&&t.target.click()})).toDOM():null},t.prototype.renderDeleteButton=function(){var t=this;return(0,i.uC)("div").addClass("".concat(r.YR,"-button-placeholder"),"".concat(this.cssPrefix,"-button-placeholder"),"".concat(this.cssPrefix,"-deletebutton-placeholder")).data("btnplaceholder","").addChild("div",(function(n){return n.addClass("".concat(r.YR,"-button"),"".concat(r.YR,"-column-button"),"".concat(r.YR,"-column-button-delete")).title(o.i18n.getText("CmdDelete")).attr("tabIndex","0").on("click",(function(n){return t.buttonMenuHandler(e.Delete,n)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()}))})).toDOM()},t.prototype.renderMenuButton=function(){var t=this;return(0,i.uC)("div").addClass("".concat(r.YR,"-button-placeholder"),"".concat(this.cssPrefix,"-button-placeholder"),"".concat(this.cssPrefix,"-menubutton-placeholder")).data("btnplaceholder","").addChild("div",(function(n){return n.addClass("".concat(r.YR,"-button"),"".concat(r.YR,"-column-button"),"".concat(r.YR,"-column-button-menu")).title(o.i18n.getText("ButtonMenu")).attr("tabIndex","0").on("click",(function(n){return t.buttonMenuHandler(e.Menu,n)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()}))})).toDOM()},t.prototype.getClassesToAdd=function(){var t="";return t+=this.columnEnabled?"":" ".concat(this.cssPrefix,"-disabled"),this.columnEnabled&&(t+=this.column.isReadOnly()?" ".concat(this.cssPrefix,"-readonly"):""),t+=this.column.isHidden()?" ".concat(this.cssPrefix,"-hidden"):""},t.prototype.renderColumnTypeButton=function(){var t=this;return this.isEditable()&&!1!==this.panel.options.allowAggrColumns?(0,i.uC)("div").addClass("".concat(r.YR,"-button-placeholder"),"".concat(this.cssPrefix,"-button-placeholder"),"".concat(this.cssPrefix,"-typebutton-placeholder"),"".concat(this.cssPrefix,"-button-active")).data("btnplaceholder","").addChild("div",(function(e){return e.addClass("".concat(r.YR,"-button"),"".concat(r.YR,"-column-button"),"".concat(r.YR,"-column-button-type")).title(o.i18n.getText("ButtonToAggr")).attr("tabIndex","0").on("click",(function(e){e.stopPropagation(),t.keepShowingButtons=!0,t.changeTypeHandler(e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()}))})).toDOM():null},t.prototype.renderColumnFormatButton=function(){var t=this,e=this.getFormatsMenuItems();return this.isEditable()&&!1!==this.panel.options.allowDisplayFormatChange&&e.length>1?(0,i.uC)("div").addClass("".concat(r.YR,"-button-placeholder"),"".concat(this.cssPrefix,"-button-placeholder"),"".concat(this.cssPrefix,"-formatbutton-placeholder"),"".concat(this.cssPrefix,"-button-active")).data("btnplaceholder","").addChild("div",(function(e){return e.addClass("".concat(r.YR,"-button"),"".concat(r.YR,"-column-button"),"".concat(r.YR,"-column-button-format")).title(o.i18n.getText("ButtonFormat")).attr("tabIndex","0").on("click",(function(e){e.stopPropagation(),t.keepShowingButtons=!0,t.changeFormatHandler(e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()}))})).toDOM():null},t.prototype.renderEnabledButton=function(){var t=this;return(0,i.uC)("div").addClass("".concat(r.YR,"-button-placeholder"),"".concat(this.cssPrefix,"-button-placeholder"),"".concat(this.cssPrefix,"-enablebutton-placeholder"),"".concat(this.cssPrefix,"-button-active")).data("btnplaceholder","").addChild("div",(function(n){return n.addClass("".concat(r.YR,"-button"),"".concat(r.YR,"-column-button"),"".concat(r.YR,"-column-button-enable")).title(o.i18n.getText("CmdToggleEnable")).addClass(t.columnEnabled?"enabled":"").attr("tabIndex","0").on("click",(function(n){return t.buttonMenuHandler(e.Enable,n)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()}))})).toDOM()},t.prototype.isEditable=function(){return this.columnEnabled&&!this.column.isReadOnly()},t.prototype.changeFormatHandler=function(t){var e=this,n=this.panel.getContext().getModel().getDisplayFormatsForType(this.column.getDataType()),o="{0:__default}";n.filter((function(t){return t.format==e.column.displayFormat})).length>0&&(o=this.column.displayFormat),this.formatsMenu.showMenu({anchor:t.target,selectedIds:o,itemSelectedCallback:function(t,n){return t.id!=o&&("{0:__default}"==t.id?e.column.displayFormat="":e.column.displayFormat=t.id,e.column.fireChangedEvent()),!1},menuClosedCallback:function(){e.keepShowingButtons=!1,e.isMouseOverBlock||e.element.dispatchEvent((0,i.sJ)("mouseleave"))}})},t.prototype.getUIS=function(){return this.panel.getContext().getModel().checkAttrProperty(this.column.expr.value,"useInSorting")},t.prototype.onMouseEnter=function(t){return this.isMouseOverBlock=!0,this.enterButtonBlock(),t.stopPropagation(),!1},t.prototype.onMouseLeave=function(t){return this.isMouseOverBlock=!1,this.leaveButtonBlock(),t.stopPropagation(),!1},t.prototype.isColumnActive=function(){return this.element.classList.contains("active")},t.prototype.hideButtons=function(){(0,i.uC)(this.element).data("show-buttons",null)},t.prototype.showButtons=function(){(0,i.uC)(this.element).data("show-buttons","")},t.prototype.adjustButtonsVisibility=function(){(this.panel.options.alwaysShowButtons||(this.panel.options.accentActiveColumn||s.z.isMobileMode())&&this.isColumnActive())&&this.showButtons()},t.prototype.enterButtonBlock=function(){this.showButtons()},t.prototype.leaveButtonBlock=function(){this.keepShowingButtons||!0===this.panel.options.alwaysShowButtons||this.isColumnActive()&&1==this.panel.options.accentActiveColumn||this.hideButtons()},t.prototype.createFunctionMenu=function(){for(var t,e=[],n=this.panel.getContext().getModel().getAggrFunctions(),i=!0,r=null,s=this.column.getDataType(),a=0,l=n;a<l.length;a++){var c=l[a];if(c){var d=c.getAppliedTypesOrDefault().indexOf(s)>=0;this.column.expr.func!==c.id||d||(i=!1),d&&(t=this.panel.getContext().getModel().getAggrFunctionCaption(c.id),r={id:c.id,text:t},e.push(r))}}i||(this.column.expr.func=e[0].id),this.panel.areCustomExpressionsAllowed()&&(r={id:"CustomSqlDivider",text:"---"},e.push(r),r={id:"CUSTOMSQL",text:t=o.i18n.getText("CustomExpression")},e.push(r));var h=this.column.id;h&&(h+="-FunctionsMenu");var p={items:e,id:h,searchBoxAlwaysShown:!1,domWriteItemsId:!0};this.functionMenu=new u(p)},t.prototype.createFormatsMenu=function(){if(0!=this.panel.options.allowDisplayFormatChange){var t=this.column.id;t&&(t+="-FormatsMenu");var e={items:this.getFormatsMenuItems(),id:t,searchBoxAlwaysShown:!1,showSelected:!0,domWriteItemsId:!0};this.formatsMenu=new u(e)}},t.prototype.getFormatsMenuItems=function(){var t=this.panel.getContext().getModel().getDisplayFormatsForType(this.column.getDataType());return[{id:"{0:__default}",text:"Default"}].concat(t.map((function(t){return{id:t.format,text:o.i18n.getText("DisplayFormats",t.name)||t.name}})))},t.prototype.getButtonsToShow=function(){return this.panel.options.buttons&&Array.isArray(this.panel.options.buttons)?this.panel.options.buttons:["enable","delete","type","sorting","format"]},t.prototype.buttonMenuHandler=function(t,n){var i=this;switch(t){case e.Delete:var r=this.column.getQuery();r.removeColumn(this.column),r.fireColumnsChangedEvent(o.QueryChangeAction.Delete,this.column);break;case e.Enable:this.columnEnabled=!this.columnEnabled,this.fireColumnChanged();break;case e.Hidden:this.column.setHidden(!this.column.isHidden()),this.fireColumnChanged();break;case e.MoveTop:this.panel.moveColumn(this.column,"MoveTop");break;case e.MoveBottom:this.panel.moveColumn(this.column,"MoveBottom");break;case e.MoveUp:this.panel.moveColumn(this.column,"MoveUp");break;case e.MoveDown:this.panel.moveColumn(this.column,"MoveDown");break;case e.SortingAsc:this.column.sorting=o.SortDirection.Ascending,this.column.fireChangedEvent();break;case e.SortingDesc:this.column.sorting=o.SortDirection.Descending,this.column.fireChangedEvent();break;case e.SortingNone:this.column.sorting=o.SortDirection.None,this.column.fireChangedEvent();break;case e.Menu:var s=this.buttonMenu;this.keepShowingButtons=!0,s.showMenu({anchor:n?n.target:null,selectedIds:this.getButtonMenuSelectedItems(),itemSelectedCallback:function(t){var o=t.id;switch(t.id){case"enable":o=e.Enable;break;case"delete":o=e.Delete;break;case"hidden":o=e.Hidden;break;case"MoveTop":o=e.MoveTop;break;case"MoveBottom":o=e.MoveBottom;break;case"MoveUp":o=e.MoveUp;break;case"MoveDown":o=e.MoveDown;break;case"None":o=e.SortingNone;break;case"Ascending":case"Descending":o=e.SortingAsc}i.buttonMenuHandler(o,n)},itemFilterCallback:function(t){return i.columnEnabled||"__group"===t.id||"enable"===t.id||"delete"===t.id},menuClosedCallback:function(){i.keepShowingButtons=!1,i.isMouseOverBlock||i.leaveButtonBlock()}});break;default:this.processFormatsButtonMenuItems(t,n)||this.processExtraButtonMenuItems(t,n)}return n&&n.stopPropagation(),!1},t.prototype.createButtonMenu=function(){if(!this.buttonMenu){var t=this.column.id;t&&(t+="-ButtonMenu");var e=[];e.push({id:"enable",text:o.i18n.getText("MenuEnable")}),this.panel.options.allowHiddenColumns&&e.push({id:"hidden",text:o.i18n.getText("CmdHiddenColumn")}),e.push({id:"delete",text:o.i18n.getText("CmdDelete")});var n=[];n.push({id:"__group",text:" ",items:e});var i=this.panel.options.allowSorting?h(h([],this.panel.getSortMenuList(),!0),this.panel.getMoveMenuList(),!0):this.panel.getMoveMenuList();n.push({id:"__group",text:o.i18n.getText("CmdGroupSort"),items:i});var r=this.getExtraButtonMenuItems();r&&Array.isArray(r)&&(n=h(h([],n,!0),r,!0));var s=this.getFormatsMenuItems();s.length>1&&n.push({id:"__group",text:o.i18n.getText("CmdGroupFormat"),items:s});var a={items:n,id:t,searchBoxAlwaysShown:!1,domWriteItemsId:!0,showSelected:!0};this.buttonMenu=new u(a)}},t.prototype.processFormatsButtonMenuItems=function(t,e){var n=this.panel.getContext().getModel().getDisplayFormatsForType(this.column.getDataType());if("{0:__default}"==t)this.column.displayFormat="";else{if(!(n.filter((function(e){return e.format==t})).length>0))return!1;this.column.displayFormat=t}return this.column.fireChangedEvent(),!0},t.prototype.getButtonMenuSelectedItems=function(){var t=this,e=[];this.columnEnabled&&e.push("enable"),this.column.isHidden()&&e.push("hidden");var n="{0:__default}";return this.panel.getContext().getModel().getDisplayFormatsForType(this.column.getDataType()).filter((function(e){return e.format==t.column.displayFormat})).length>0&&(n=this.column.displayFormat),e.push(n),e},t}(),g=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.getClassesToAdd=function(){return"".concat(t.prototype.getClassesToAdd.call(this)," ").concat(this.cssPrefix,"-row ").concat(this.cssPrefix,"-row-column-entattr")},e.prototype.renderExpressionBlock=function(){var t=this;return(0,i.uC)("div").addClass("".concat(this.cssPrefix,"-expr-block")).addClass(s.z.getMobileCssClass()).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-colelement"),"".concat(t.cssPrefix,"-attrelement")).addClass(s.z.getMobileCssClass()).addChildElement(t.renderBaseExpression())})).toDOM()},e.prototype.getAttribute=function(){return this.panel.getContext().getModel().getAttributeByIdSafe(this.column.expr.value)},e.prototype.renderBaseExpression=function(){var t=this,e=this.getAttribute(),n=this.panel.getContext().getAttributeTitle(e);return this.isEditable()?(0,i.uC)("a").attr("href","javascript:void(0)").title(n).text(n).on("click",(function(e){return e.stopPropagation(),t.panel.showEntitiesMenu({anchor:e.target,selectedIds:null,itemSelectedCallback:t.baseExpressionItemSelectedCallback.bind(t),itemFilterCallback:function(t){return"__AddAll__"!==t.id}}),!1})).toDOM():(0,i.uC)("span").text(n).title(n).toDOM()},e.prototype.baseExpressionItemSelectedCallback=function(t,e){var n=t.id,o=this.panel.getContext(),i=o.getModel().getAttributeById(n);return this.updateBaseAttr(i),this.column.caption=o.getDefaultColumnCaption(this.column),this.fireColumnChanged(),!1},e.prototype.updateBaseAttr=function(t){this.column.expr.setValue(t.id,!0),this.column.expr.baseAttrId=t.id,this.column.expr.dataType=t.dataType},e.prototype.getUIS=function(){var t=this.column.expr.args[0];return!t||this.panel.getContext().getModel().checkAttrProperty(t.value,"useInSorting")},e.prototype.changeTypeHandler=function(t){var e=this;this.keepShowingButtons=!0,this.functionMenu.showMenu({anchor:t.target,selectedIds:null,itemSelectedCallback:function(t,n){return e.processExtraButtonMenuItems(t.id,null),!1},menuClosedCallback:function(){e.keepShowingButtons=!1,e.isMouseOverBlock||e.element.dispatchEvent((0,i.sJ)("mouseleave"))}})},e.prototype.changeTypeToCustomSql=function(){var t=this;this.column.getQuery().changeColumnType(this.column,o.ExprTag.CustomSql);var e=this.element.parentElement;setTimeout((function(){var n=e.querySelector("div[data-id='".concat(t.column.id,"'] div[class*='").concat(t.cssPrefix,"-expr-block'] div[class*='").concat(t.cssPrefix,"-colelement'] a"));n&&n.click()}),500),this.fireColumnChanged()},e.prototype.changeTypeToAggr=function(t){this.column.getQuery().changeColumnType(this.column,o.ExprTag.AggregateFunction,{funcId:t}),this.fireColumnChanged()},e.prototype.processExtraButtonMenuItems=function(t,e){return"CUSTOMSQL"===t?this.changeTypeToCustomSql():this.changeTypeToAggr(t),!0},e.prototype.getExtraButtonMenuItems=function(){for(var t,e=[],o=this.panel.getContext().getModel().getAggrFunctions(),i=!0,r=!0,s=null,a=this.getAttribute(),l=0,c=o;l<c.length;l++){var u=c[l];i=u.getAppliedTypesOrDefault().indexOf(a.dataType)>=0,this.column.expr.func!==u.id||i||(r=!1),i&&(t=this.panel.getContext().getModel().getAggrFunctionCaption(u.id),s={id:u.id,text:t},e.push(s))}for(var d=0;d<o.length;d++)o[d];return r||(this.column.expr.func=e[0].id),this.panel.areCustomExpressionsAllowed()&&(s={id:"CustomSqlDivider",text:"---"},e.push(s),s={id:"CUSTOMSQL",text:t=n.ag.getText("CustomExpression")},e.push(s)),[{id:"__group",text:n.ag.getText("ColTypeGroup"),items:e}]},e}(f),y=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.displayFormatParser=new d,e}return y(e,t),e.prototype.getClassesToAdd=function(){return"".concat(t.prototype.getClassesToAdd.call(this)," ").concat(this.cssPrefix,"-row ").concat(this.cssPrefix,"-row-column-aggr")},e.prototype.getAttribute=function(){return this.panel.getContext().getModel().getAttributeByIdSafe(this.column.expr.args[0].value)},e.prototype.renderExpressionBlock=function(){var t=this,e=this.panel.getContext().getModel(),n=(0,i.uC)("div").addClass("".concat(this.cssPrefix,"-expr-block"),"".concat(this.cssPrefix,"-expr-block-aggr")).addClass(s.z.getMobileCssClass()),o=e.getAggrFunctionFormat(this.column.expr.func);if(o&&""!==o){var r=this.parseDisplayFormat(o);if(0!==r.length){for(var a=null,l=r.length,c=function(e){if(1===(a=r[e]).type)if(u.isEditable()){var o=(0,i.uC)("a").attr("href","javascript:void(0)").text(a.text).on("click",(function(e){e.stopPropagation(),t.functionMenu.showMenu({anchor:o.toDOM(),selectedIds:null,itemSelectedCallback:function(e,n){"CUSTOMSQL"===e.id?t.changeTypeToCustomSql():(t.column.expr.func=e.id,t.column.caption="",t.fireColumnChanged())}})}));n.addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-colelement"),"".concat(t.cssPrefix,"-aggrfuncelement")).addClass(s.z.getMobileCssClass()).addChildElement(o.toDOM())}))}else n.addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-colelement"),"".concat(t.cssPrefix,"-aggrfuncelement")).addClass(s.z.getMobileCssClass()).addChild("span",(function(t){return t.text(a.text).title(a.text)}))}));else 2===a.type?n.addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-colelement"),"".concat(t.cssPrefix,"-attrelement")).addClass(s.z.getMobileCssClass()).addChildElement(t.renderBaseExpression())})):3===a.type&&n.addChild("span",(function(e){return e.addClass("".concat(t.cssPrefix,"-colelement")).addClass(s.z.getMobileCssClass()).text(a.text).title(a.text)}))},u=this,d=0;d<l;d++)c(d);return n.toDOM()}}},e.prototype.renderColumnTypeButton=function(){var e=t.prototype.renderColumnTypeButton.call(this);return e&&(e.firstElementChild.classList.add("aggregated"),e.firstElementChild.setAttribute("title",n.ag.getText("ButtonToSimple"))),e},e.prototype.changeTypeToSimple=function(){this.column.getQuery().changeColumnType(this.column,o.ExprTag.EntityAttribute),this.fireColumnChanged()},e.prototype.parseDisplayFormat=function(t){if(!t)return[];var e=[],n=this.displayFormatParser;for(n.start(t);n.next();){var o=n.getToken(),i=n.getTokenText();"function"===o?e.push({type:1,text:i}):"expression"===o?e.push({type:2}):"text"===o&&e.push({type:3,text:i})}return e},e.prototype.updateBaseAttr=function(t){this.column.expr.args[0].setValue(t.id,!0),this.column.expr.baseAttrId=t.id},e.prototype.changeTypeHandler=function(t){this.changeTypeToSimple()},e.prototype.processExtraButtonMenuItems=function(t,e){return this.changeTypeToSimple(),!0},e.prototype.getExtraButtonMenuItems=function(){return[{id:"__group",text:n.ag.getText("ColTypeGroup"),items:[{id:"type",text:n.ag.getText("ColTypeSimple")}]}]},e}(m),C=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),b=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dataTypeMenu=null,e}return C(e,t),e.prototype.renderEnabledButton=function(){var e=t.prototype.renderEnabledButton.call(this);return e.children[0].title=n.ag.getText("CmdToggleEnableCustom"),e},e.prototype.getClassesToAdd=function(){return"".concat(this.cssPrefix,"-row ").concat(this.cssPrefix,"-row-column-entattr")+t.prototype.getClassesToAdd.call(this)},e.prototype.renderExpressionBlock=function(){var t=this,e=(0,i.uC)("div").addClass("".concat(this.cssPrefix,"-expr-block")).addClass(s.z.getMobileCssClass()).toDOM(),o=(0,i.uC)("div",e).addClass("".concat(this.cssPrefix,"-colelement"),"".concat(this.cssPrefix,"-attrelement")).addClass(s.z.getMobileCssClass());return this.isEditable()?o.addChild("a",(function(e){return e.attr("href","javascript:void(0)").title(t.column.caption).text(t.column.caption).on("touchstart click",(function(e){e.stopPropagation();var n=e.target,o=n.parentElement.querySelector("input");o&&(n.style.display="none",o.style.removeProperty("display"),o.style.width="100%",o.focus(),t.element.setAttribute(i.Yy.DRAG_DISABLED_ATTR,""))}))})).addChild("input",(function(e){return e.hide().value(t.getColumnValue()).on("blur keydown",(function(e){var n=!1,o=!0;if(e instanceof KeyboardEvent?13===e.keyCode?n=!0:27===e.keyCode&&(n=!0,o=!1):e instanceof FocusEvent&&(n=!0),n){var r=e.target,s=r.parentElement.querySelector("a");s&&(s.style.removeProperty("display"),r.style.display="none");var a=t.getColumnValue();o&&a!==r.value?(t.setColumnValue(r.value),t.fireColumnChanged()):r.value=a,t.element.removeAttribute(i.Yy.DRAG_DISABLED_ATTR)}}))})):o.addChild("span",(function(e){e.text(t.column.caption).title(t.column.caption)})),o=(0,i.uC)("div",e).addClass("".concat(this.cssPrefix,"-colelement")).addChild("span",(function(t){t.text(":").title(":")})),o=(0,i.uC)("div",e).addClass("".concat(this.cssPrefix,"-colelement"),"".concat(this.cssPrefix,"-attrelement")).addClass(s.z.getMobileCssClass()),this.isEditable()?(this.createDataTypeMenu(),o.addChild("a",(function(e){return e.attr("href","javascript:void(0)").title(n.g[t.column.expr.dataType]).text(n.g[t.column.expr.dataType]).on("touchstart click",(function(n){n.stopPropagation(),t.dataTypeMenu.showMenu({anchor:e.toDOM(),selectedIds:null,itemSelectedCallback:function(e,n){t.column.expr.dataType=e.id,t.fireColumnChanged()}})}))}))):(this.column.expr.dataType,o.addChild("span",(function(e){e.text(n.g[t.column.expr.dataType]).title(n.g[t.column.expr.dataType])}))),e},e.prototype.changeTypeToSimple=function(){this.column.getQuery().changeColumnType(this.column,o.ExprTag.EntityAttribute),this.fireColumnChanged()},e.prototype.getColumnValue=function(){return""},e.prototype.setColumnValue=function(t){},e.prototype.getUIS=function(){return!0},e.prototype.changeTypeHandler=function(t){this.changeTypeToSimple()},e.prototype.processExtraButtonMenuItems=function(t,e){return this.changeTypeToSimple(),!0},e.prototype.createFunctionMenu=function(){},e.prototype.getExtraButtonMenuItems=function(){return[{id:"__group",text:n.ag.getText("ColTypeGroup"),items:[{id:"type",text:n.ag.getText("ColTypeSimple")}]}]},e.prototype.createDataTypeMenu=function(){var t=[];for(var e in n.g)if(!isNaN(Number(e))){var o={id:e,text:n.g[e]};t.push(o)}var i=this.column.id;i&&(i+="-DataTypeMenu");var r={items:t,id:i,searchBoxAlwaysShown:!1,domWriteItemsId:!0};this.dataTypeMenu=new u(r)},e}(m),x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return C(e,t),Object.defineProperty(e.prototype,"columnEnabled",{get:function(){return!!this.panel.areCustomExpressionsAllowed()&&this.column.enabled},set:function(t){this.panel.areCustomExpressionsAllowed()?this.column.enabled=t:this.column.enabled=!1},enumerable:!1,configurable:!0}),e.prototype.renderColumnTypeButton=function(){var e=t.prototype.renderColumnTypeButton.call(this);return e&&(e.firstElementChild.classList.add("aggregated"),e.firstElementChild.setAttribute("title",n.ag.getText("ButtonToSimple"))),e},e.prototype.getColumnValue=function(){return this.column.expr.sql},e.prototype.setColumnValue=function(t){this.column.expr.sql=t},e.prototype.getDefaultValue=function(){return this.column.expr.sql},e}(b),w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return C(e,t),e.prototype.renderColumnTypeButton=function(){var e=t.prototype.renderColumnTypeButton.call(this);return e&&(e.firstElementChild.classList.add("aggregated"),e.firstElementChild.setAttribute("title",n.ag.getText("ButtonToSimple"))),e},e.prototype.getColumnValue=function(){return this.column.expr.value},e.prototype.setColumnValue=function(t){this.column.expr.setValue(t)},e.prototype.getDefaultValue=function(){return this.column.expr.value},e}(b),E=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),T=function(t){function e(e){var n=t.call(this,e)||this;return n.options={isSubQuery:!1,activeColumn:null,showAddRow:!0,showHeader:!0,showColumnTitles:!0,allowAggrColumns:!0,allowDuplicates:!0,allowCustomExpressions:!1,allowSorting:!0,attrElementFormat:"{entity} {attr}",titleElementFormat:null,buttons:null,alwaysShowButtons:!1,accentActiveColumn:!0,allowDragDrop:!0,menuOptions:{showSearchBoxAfter:30,searchBoxAutoFocus:!0,activateOnMouseOver:!0,adjustHeight:!0,itemRenderedCallback:null},attrPlacement:0,sortEntities:!1,columnRenderedCallback:null,customExpressionText:0,allowHiddenColumns:!1,showAddAllForEntity:!1,showIndicatorOnLoad:!0},n.landingSlot=(0,i.uC)("div").addClass("".concat(n.cssPrefix,"-col-landing-slot")).addChildElement((0,i.uC)("div").toDOM()).toDOM(),n.landingIndex=-1,n.slot.classList.add("".concat(n.cssPrefix,"-panel")),n.group=o.WidgetGroup.Query,n}return E(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-qc"},enumerable:!1,configurable:!0}),e.prototype.getWidgetType=function(){return"columnsPanel"},e.prototype.init=function(e,n){var o=this;t.prototype.init.call(this,e,n),this.setOptions(n),this.renderProgressBlock();var s=e.getModel();this.detachQueryObserver(),this.attachQueryObserver(),i.Yy.removeDropContainer(this.slot),this.options.allowDragDrop&&i.Yy.registerDropContainer({element:this.slot,scopes:["entityAttr","entityAttrSort"],onDragEnter:function(t,e){if(o.slot.classList.add("".concat(r.YR,"-drophover")),"entityAttrSort"===e.item.scope)o.showLandingSlot(e.pageX,e.pageY);else{var n=e.data.attrId;s.checkAttrProperty(n,"useInResult")||(e.dropEffect=i.KX.Forbid),e.dragImage.classList.add("eqjs-sortable-helper")}},onDragOver:function(t,e){var n=e.data.attrId;("entityAttrSort"===e.item.scope||s.checkAttrProperty(n,"useInResult"))&&o.showLandingSlot(e.pageX,e.pageY)},onDragLeave:function(t,e){"entityAttrSort"===e.item.scope?e.dropEffect=i.KX.Forbid:(e.dragImage.classList.remove("eqjs-sortable-helper"),e.dragImage.style.removeProperty("width")),o.slot.classList.remove("".concat(r.YR,"-drophover")),o.hideLandingSlot()},onDrop:function(t,e){if("entityAttrSort"==e.item.scope){var n=o.getQuery().getColumns().indexOf(e.data.column);o.moveColumnCore(n,o.landingIndex)}else{var i=e.data.attrId;o.addNewColumn(i,o.landingIndex)}}})},e.prototype.renderBaseElements=function(){var t=this,e=0;if(this.options.showHeader){var o=(0,i.uC)("div",this.slot).hide().addClass("".concat(this.cssPrefix,"-header")).addClass(s.z.getMobileCssClass()).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-header-expression")).text(n.ag.getText("HeaderExpression"))}));!1!==this.options.showColumnTitles&&o.addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-header-title")).text(n.ag.getText("HeaderTitle"))})),this.headerElement=o.toDOM(),e+=this.headerElement.offsetHeight}this.columnsBlock=(0,i.uC)("div",this.slot).addClass("".concat(this.cssPrefix,"-columns")).addClass(s.z.getMobileCssClass()).toDOM(),this.options.showAddRow&&(this.addRowElement=(0,i.uC)("div",this.slot).addClass("".concat(r.YR,"-addrow"),"".concat(this.cssPrefix,"-addrow"),"".concat(r.YR,"-addrow-empty")).addClass(s.z.getMobileCssClass()).addChild("a",(function(e){return e.attr("href","javascript:void(0)").text(n.ag.getText("CmdClickToAddColumn")).on("click",(function(e){e.preventDefault(),t.showEntitiesMenu({anchor:e.target,selectedIds:null,itemSelectedCallback:function(e,n){if("__AddAll__"===e.id&&e.extra&&Array.isArray(e.extra.ids))e.extra.ids.forEach((function(e){return t.addNewColumn(e)}));else{var o=e.id;t.addNewColumn(o)}return!1}})}))})).toDOM(),e+=this.addRowElement.offsetHeight),this.columnsBlock.style.maxHeight="".concat(this.slot.offsetHeight-e-25,"px")},e.prototype.destroyCore=function(){i.Yy.removeDropContainer(this.slot),this.detachQueryObserver(),this.slot.innerHTML=""},e.prototype.attachQueryObserver=function(){var t=this,e=this.getQuery();this.queryEventCallbackId=e.addChangedCallback((function(n){var i=n.data;if(i&&(i.part==o.QueryChangePart.Columns||i.part==o.QueryChangePart.Aggregation||i.part==o.QueryChangePart.All)){var r=document.activeElement,s=t.slot.contains(r)||r==document.body;switch(i.action){case o.QueryChangeAction.Modify:var a=i.changee,l=function(e){var n=t.columnsBlock.querySelector("div[data-id='".concat(e.id,"']"));if(n){var o=t.getColumnRenderer(e,n);if(o){var i=o.render();if(s){var r=i.querySelector("a")||i.querySelector(".eqjs-column-button");r&&r.focus()}}}};Array.isArray(a)?a.forEach((function(t){return l(t)})):l(a),t.agjustHeaderVisibility();break;case o.QueryChangeAction.Add:a=i.changee;var c=function(n){var o=e.getColumns().indexOf(n),i=t.addColumnElement(n,o);if(s){var r=i.querySelector("a");if(r)try{r.focus()}catch(t){}}};Array.isArray(a)?a.forEach((function(t){return c(t)})):c(a),t.agjustHeaderVisibility();break;case o.QueryChangeAction.Delete:a=i.changee;var u=function(e){var n=t.columnsBlock.querySelector("div[data-id='".concat(e.id,"']"));if(n){var o=n.nextSibling,i=n.previousSibling;if(t.columnsBlock.removeChild(n),s){var r=o||i||t.addRowElement,a=r.querySelector("a")||r.querySelector(".eqjs-column-button");a&&a.focus()}}};t.agjustHeaderVisibility(),Array.isArray(a)?a.forEach((function(t){return u(t)})):u(a);break;default:t.refresh()}}}))},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.getQuery=function(){return this.getContext().getQuery()},e.prototype.showLandingSlot=function(t,e){for(var n=this.columnsBlock.querySelectorAll("[class*=".concat(this.cssPrefix,"-row]")),o=[],r=0;r<n.length;r++){var s=n[r];"none"!==s.style.display&&o.push(s)}if(0===o.length)return this.landingIndex=0,void this.columnsBlock.appendChild(this.landingSlot);var a=(0,i.lE)(this.landingSlot);if(!(e>=a.y&&e<=a.y+this.landingSlot.offsetHeight)){var l=o[0],c=l.offsetHeight,u=(0,i.lE)(l),d=e>u.y+c/2?Math.round((e-u.y+c/2)/c):0;d>o.length&&(d=o.length),d!=this.landingIndex&&(this.landingIndex=d,this.landingIndex<o.length?this.columnsBlock.insertBefore(this.landingSlot,o[this.landingIndex]):this.columnsBlock.appendChild(this.landingSlot),this.landingSlot.scrollIntoView({block:"center",behavior:"smooth"}))}},e.prototype.hideLandingSlot=function(){var t=this;this.landingIndex=-1,setTimeout((function(){t.landingSlot.parentElement&&t.landingSlot.parentElement.removeChild(t.landingSlot)}),10)},e.prototype.setOptions=function(t){n.P6.assignDeep(this.options,t),this.context.options.allowCustomExpressions=t.allowCustomExpressions,t.attrElementFormat&&(this.context.options.attributeFormat=t.attrElementFormat),t.titleElementFormat&&(this.context.options.columnTitleFormat=t.titleElementFormat),s.z.isMobileMode()&&(this.options.buttons=["menu"],this.options.showHeader=!1)},e.prototype.onProcessStartCore=function(){this.options.showIndicatorOnLoad&&(this.progressBlock.parentNode||this.slot.appendChild(this.progressBlock))},e.prototype.onProcessEndCore=function(){this.options.showIndicatorOnLoad&&this.progressBlock.parentNode&&this.slot.removeChild(this.progressBlock)},e.prototype.refreshCore=function(){this.clear(),this.render()},e.prototype.clear=function(){this.slot.innerHTML=""},e.prototype.render=function(){try{this.renderBaseElements(),this.createEntitiesMenu(),this.createColumnMenus(),this.agjustHeaderVisibility(),(0,i.uC)(this.slot).removeClass(r.XD).addClass(s.z.getMobileCssClass());for(var t=this.context.getQuery().getColumns(),e=0,n=t;e<n.length;e++){var o=n[e];this.columnsBlock.appendChild(this.renderColumn(o))}}catch(t){var a=t;this.context.throwError({action:"ColumnsPanel rendering",text:a.message,sourceError:a})}},e.prototype.agjustHeaderVisibility=function(){if(this.headerElement){var t=this.context.getQuery().getColumns();this.headerElement.style.display=t.length?"":"none"}},e.prototype.renderColumn=function(t){var e=this.getColumnRenderer(t);return e?e.render():null},e.prototype.toggleColumnPicked=function(t){var e,n;t&&(e=this.columnsBlock.querySelector("div[data-id=".concat(t.id,"]")))&&(n=e.classList.contains("active"));for(var o=this.columnsBlock.querySelectorAll(".".concat(this.cssPrefix,"-row")),r=0;r<o.length;r++){var s=o[r];(0,i.uC)(s).removeClass("active"),this.options.alwaysShowButtons||(0,i.uC)(s).data("show-buttons",null)}e&&!n&&(0,i.uC)(e).addClass("active").data("show-buttons","")},e.prototype.addNewColumn=function(t,e){this.getContext().getModel();var n=this.getQuery();if(Array.isArray(t)){for(var i=null,r=[],s=0;s<t.length;s++)(i=n.addColumn({attributeId:t[s],index:e},!0))&&r.push(i);return n.fireChangedEvent({part:o.QueryChangePart.Columns,action:o.QueryChangeAction.Add,changee:r,source:this}),r}return i=n.addColumn({attributeId:t,index:e})},e.prototype.addColumnElement=function(t,e){var n=this.columnsBlock.querySelectorAll("[class*=".concat(this.cssPrefix,"-row]")),o=this.renderColumn(t);return n.length>0&&e<n.length?this.columnsBlock.insertBefore(o,n[e]):(this.columnsBlock.appendChild(o),this.scrollToBottom()),this.options.columnRenderedCallback&&this.options.columnRenderedCallback(o),o},e.prototype.scrollToBottom=function(){this.columnsBlock.scrollTop=this.columnsBlock.scrollHeight-this.columnsBlock.clientHeight},e.prototype.checkColumnsArray=function(t){for(var e=t.length,n=[],o=0;o<e;o++)this.checkColumn(t[o])&&n.push(t[o]);return n},e.prototype.checkColumn=function(t){if(!this.options.allowDuplicates)for(var e=this.getQuery().getColumns(),n=0;n<e.length;n++)if((t.expr.tag===o.ExprTag.EntityAttribute&&e[n].expr.tag===o.ExprTag.EntityAttribute||t.expr.tag===o.ExprTag.ParentEntityAttribute&&e[n].expr.tag===o.ExprTag.ParentEntityAttribute)&&t.expr.value===e[n].expr.value)return null;return t},e.prototype.getColumnsBlock=function(){return this.columnsBlock},e.prototype.getColumnRenderer=function(t,e){switch(t.expr.tag){case o.ExprTag.Constant:return new w(this,t,e);case o.ExprTag.AggregateFunction:return new v(this,t,e);case o.ExprTag.CustomSql:return new x(this,t,e);default:return new m(this,t,e)}return null},e.prototype.areCustomExpressionsAllowed=function(){return this.getQuery().isEx()&&this.getContext().options.allowCustomExpressions},e.prototype.addAllColumnsToEntitiesList=function(t){var e=this,o=t.filter((function(t){return!t.isEntity})).map((function(t){return t.id}));o.length>0&&t.unshift({id:"__AddAll__",text:n.ag.getText("AddAllForEntityText"),extra:{ids:o}}),t.forEach((function(t){t.items&&e.addAllColumnsToEntitiesList(t.items)}))},e.prototype.createEntitiesMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-EntitiesMenu");var o=t.getEntitiesTree({addUIC:!1,addUIR:!0,addUIS:!1,attrPlacement:this.options.attrPlacement,sortEntities:this.options.sortEntities});this.options.showAddAllForEntity&&this.addAllColumnsToEntitiesList(o);var i={id:e,items:o,adjustHeight:this.options.adjustEntitiesMenuHeight,domWriteItemsId:this.options.domWriteItemsId};n.P6.assign(i,this.options.menuOptions),this.entitiesMenu=new u(i)},e.prototype.getSortMenuList=function(){return[{id:"None",text:n.ag.getText("CmdNotSorted")},{id:"Ascending",text:n.ag.getText("CmdAscending")},{id:"Descending",text:n.ag.getText("CmdDescending")},{id:"---",text:"---"}]},e.prototype.getMoveMenuList=function(){return[{id:"MoveTop",text:n.ag.getText("CmdMoveToFirst")},{id:"MoveUp",text:n.ag.getText("CmdMoveToPrev")},{id:"MoveDown",text:n.ag.getText("CmdMoveToNext")},{id:"MoveBottom",text:n.ag.getText("CmdMoveToLast")}]},e.prototype.createSortMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-SortMenu");var o={id:e,items:this.getSortMenuList().concat(this.moveMenu.getItems()),domWriteItemsId:this.options.domWriteItemsId,showSelected:!0};n.P6.assign(o,this.options.menuOptions),o.searchBoxAlwaysShown=!1,this.sortMenu=new u(o)},e.prototype.createMoveMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-MoveMenu");var o=n.P6.createArrayFrom(this.getMoveMenuList());this.options.allowHiddenColumns&&(o.push({id:"---",text:"---"}),o.push({id:"IsHidden",text:n.ag.getText("CmdHiddenColumn")}));var i={items:o,id:e,domWriteItemsId:this.options.domWriteItemsId,showSelected:!0};n.P6.assign(i,this.options.menuOptions),this.moveMenu=new u(i),i.searchBoxAlwaysShown=!1},e.prototype.showEntitiesMenu=function(t){this.entitiesMenu.showMenu(t)},e.prototype.moveColumn=function(t,e){var n=this.getQuery().getColumns(),o=n.indexOf(t);if(o>=0)switch(e){case"MoveTop":if(0==o)return;this.moveColumnCore(o,0);break;case"MoveUp":if(0==o)return;this.moveColumnCore(o,o-1);break;case"MoveDown":if(o==n.length-1)return;this.moveColumnCore(o,o+1);break;case"MoveBottom":if(o==n.length-1)return;this.moveColumnCore(o,n.length-1)}},e.prototype.moveColumnCore=function(t,e){var n=this.getQuery();if(n){var o=this.columnsBlock.querySelectorAll("[class*=".concat(this.cssPrefix,"-row]")),i=o[t];0==e?this.columnsBlock.insertBefore(i,this.columnsBlock[0]):e>0&&e<o.length-1?t<e?this.columnsBlock.insertBefore(i,o[e+1]):this.columnsBlock.insertBefore(i,o[e]):this.columnsBlock.appendChild(i),n.moveColumn(t,e),n.fireColumnsChangedEvent()}},e.prototype.createColumnMenus=function(){this.createMoveMenu(),this.options.allowSorting&&this.createSortMenu()},e.prototype.renderProgressBlock=function(){this.progressBlock=document.createElement("div"),this.progressBlock.classList.add("".concat(r.YR,"-progress-win8")),this.progressBlock.classList.add(s.z.getMobileCssClass()),this.progressBlock.innerHTML='<div class="wBall" id="wBall_1"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_2"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_3"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_4"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_5"><div class="wInnerBall"></div></div>'},e}(o.Widget),D=function(){function t(t,e,n){this.functionMenu=null,this.formatsMenu=null,this.isMouseOverBlock=!1,this.keepShowingButtons=!1,this.tapedTwice=!1,this.bar=t,this.column=e,this.element=n}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-cb"},enumerable:!1,configurable:!0}),t.prototype.render=function(){var t=this,e=(0,i.uC)("div");return e.data("id",this.column.id),this.element&&this.element.parentNode.replaceChild(e.toDOM(),this.element),this.element=e.toDOM(),this.bar.options.allowDragDrop&&i.Yy.registerDraggableItem({element:this.element,scope:"entityAttrSort",beforeDragStart:function(){return t.element.dispatchEvent((0,i.sJ)("mouseleave"))},onDragStart:function(e){t.hideButtons(),t.element.style.display="none",e.dropEffect=i.KX.Allow},onDragEnd:function(e){e.data.finishedSuccessfully||t.element.removeAttribute("style")},data:{column:this.column}}),this.column.isReadOnly()||(this.createFunctionMenu(),this.createFormatsMenu()),e.addClass(this.getClassesToAdd()).addClass(s.z.getMobileCssClass()).addChildElement(this.renderCaptionBlock()).addChildElement(this.renderSortingImage()),s.z.isMobileMode()||e.addChildElement(this.renderButtonsBlock()),e.on("mouseenter",this.onMouseEnter.bind(this)).on("mouseleave",this.onMouseLeave.bind(this)),(this.bar.options.accentActiveColumn||s.z.isMobileMode())&&e.on("touchstart click",this.onMouseClick.bind(this)),this.element},t.prototype.fireColumnChanged=function(){this.column.fireChangedEvent()},t.prototype.refresh=function(){this.render()},t.prototype.isEditable=function(){return this.column.enabled&&!this.column.isReadOnly()},t.prototype.renderButtonsBlock=function(){return(0,i.uC)("div",this.element).addClass("".concat(r.YR,"-column-buttonsBlock"),"".concat(this.cssPrefix,"-buttonsBlock")).addChildElement(this.renderSortingButton()).addChildElement(this.renderColumnTypeButton()).addChildElement(this.renderColumnFormatButton()).addChildElement(this.renderDeleteButton()).toDOM()},t.prototype.renderCaptionBlock=function(){var t=this,e=this.column.caption;if(!this.isEditable())return(0,i.uC)("div").addClass("".concat(this.cssPrefix,"-colelement"),"".concat(this.cssPrefix,"-captionelement")).addClass(s.z.getMobileCssClass()).addChild("div",(function(t){return t.title(e).text(e).attr("tabIndex","0")})).toDOM();var n=!1;return(0,i.uC)(this.element).on("touchstart dblclick",(function(e){if(e instanceof TouchEvent&&!t.tapedTwice)return t.tapedTwice||(t.tapedTwice=!0,setTimeout((function(){t.tapedTwice=!1}),300)),!0;e.stopPropagation(),n=t.element.querySelector("a")==document.activeElement;var o=t.element.querySelector(".".concat(t.cssPrefix,"-captionelement input")),r=t.element.querySelector(".".concat(t.cssPrefix,"-captionelement a"));return o&&(o.style.width="".concat(t.element.clientWidth,"px"),r.style.display="none",o.style.removeProperty("display"),o.focus(),t.element.setAttribute(i.Yy.DRAG_DISABLED_ATTR,"")),!1})),(0,i.uC)("div").addClass("".concat(this.cssPrefix,"-colelement"),"".concat(this.cssPrefix,"-captionelement")).addClass(s.z.getMobileCssClass()).addChild("a",(function(n){return n.attr("href","javascript:void(0)").title(t.column.caption).text(e).on("keydown",(function(e){var n=e;if((n.ctrlKey||n.metaKey)&&(13==n.keyCode||10==n.keyCode)&&t.isColumnActive()){var o=document.createEvent("MouseEvents");return o.initEvent("dblclick",!0,!0),t.element.dispatchEvent(o),n.stopPropagation(),!1}return!0}))})).addChild("input",(function(e){return e.hide().value(t.column.caption).on("blur keydown",(function(e){var o=!1,r=!0;if(e instanceof KeyboardEvent?13===e.keyCode?o=!0:27===e.keyCode&&(o=!0,r=!1):e instanceof FocusEvent&&(o=!0),o){var s=e.target,a=s.parentElement.querySelector("a");a&&(a.style.removeProperty("display"),s.style.display="none"),r&&t.column.caption!==s.value?(t.column.caption=s.value,t.fireColumnChanged()):s.value=t.column.caption,t.element.removeAttribute(i.Yy.DRAG_DISABLED_ATTR),n&&t.element.querySelector("a").focus()}}))})).toDOM()},t.prototype.renderSortingImage=function(){var t=this,e="".concat(r.YR,"-column-sortbutton"),a=e;switch(this.column.sorting){case o.SortDirection.Ascending:a="".concat(e,"-asc");break;case o.SortDirection.Descending:a="".concat(e,"-desc")}return this.column.sorting==o.SortDirection.None?null:(0,i.uC)("div").addClass("".concat(this.cssPrefix,"-colelement"),"".concat(this.cssPrefix,"-sortimage-placeholder")).addClass(s.z.getMobileCssClass()).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-img-sorting"),a).title(n.ag.getText("ButtonSorting"))})).toDOM()},t.prototype.buttonSortingClickHandler=function(t,e){var n=this;return t.stopPropagation(),this.keepShowingButtons=!0,(this.getUIS()&&this.bar.sortMenu||this.bar.moveMenu).showMenu({anchor:e,selectedIds:null,itemSelectedCallback:function(t,e){var i;if("None"==t.id||"Ascending"==t.id||"Descending"==t.id){var r=n.bar.getQuery();n.column.sorting="None"==(i=t.id)?o.SortDirection.None:"Ascending"==i?o.SortDirection.Ascending:"Descending"==i?o.SortDirection.Descending:void 0,n.column._sortIndex=r.getColumnSortIndex(n.column),n.fireColumnChanged()}else n.bar.moveColumn(n.column,t.id)},menuClosedCallback:function(){n.keepShowingButtons=!1,n.isMouseOverBlock||n.leaveButtonBlock()}}),!1},t.prototype.renderSortingButton=function(){var t=this;if(!this.isEditable())return null;var e=(0,i.uC)("div").addClass("".concat(r.YR,"-column-button"),"".concat(r.YR,"-column-sortbutton"),"".concat(r.YR,"-column-sortbutton-none")).title(n.ag.getText("ButtonSorting")).attr("tabIndex","0").on("touchstart click",(function(n){return t.buttonSortingClickHandler(n,e.toDOM())})).on("keypress",(function(t){13==t.keyCode&&t.target.click()}));return e.toDOM()},t.prototype.buttonDeleteClickHandler=function(t){t.stopPropagation();var e=this.bar.getQuery();return e.removeColumn(this.column),e.fireColumnsChangedEvent(o.QueryChangeAction.Delete,this.column),!1},t.prototype.renderDeleteButton=function(){var t=this;return this.column.isReadOnly()?null:(0,i.uC)("div").addClass("".concat(r.YR,"-column-button"),"".concat(r.YR,"-column-button-delete")).title(n.ag.getText("CmdDelete")).attr("tabIndex","0").on("touchstart click",(function(e){return t.buttonDeleteClickHandler(e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).toDOM()},t.prototype.getClassesToAdd=function(){var t="";return t+=this.column.enabled?"":" ".concat(this.cssPrefix,"-disabled"),this.column.enabled&&(t+=this.column.isReadOnly()?" ".concat(this.cssPrefix,"-readonly"):""),t},t.prototype.buttonTypeClickHandler=function(t){return t.stopPropagation(),this.keepShowingButtons=!0,this.changeColumnTypeHandler(t),!1},t.prototype.buttonFormatClickHandler=function(t){return t.stopPropagation(),this.keepShowingButtons=!0,this.changeFormatHandler(t),!1},t.prototype.formatButtonIsShown=function(){return!1!==this.bar.options.allowDisplayFormatChange&&this.bar.getContext().getModel().getDisplayFormatsForType(this.column.getDataType()).length>0},t.prototype.changeFormatHandler=function(t){var e=this,n=this.bar.getContext().getModel().getDisplayFormatsForType(this.column.getDataType()),o="{0:__default}";n.filter((function(t){return t.format==e.column.displayFormat})).length>0&&(o=this.column.displayFormat),this.formatsMenu.showMenu({anchor:t.target,selectedIds:o,itemSelectedCallback:function(t,n){return t.id!=o&&("{0:__default}"==t.id?e.column.displayFormat="":e.column.displayFormat=t.id,e.column.fireChangedEvent()),!1},menuClosedCallback:function(){e.keepShowingButtons=!1,e.isMouseOverBlock||e.element.dispatchEvent((0,i.sJ)("mouseleave"))}})},t.prototype.renderColumnTypeButton=function(){var t=this;return this.isEditable()&&!1!==this.bar.options.allowAggrColumns?(0,i.uC)("div").addClass("".concat(r.YR,"-column-button"),"".concat(r.YR,"-column-button-type")).title(n.ag.getText("ButtonToAggr")).attr("tabIndex","0").on("touchstart click",(function(e){return t.buttonTypeClickHandler(e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).toDOM():null},t.prototype.renderColumnFormatButton=function(){var t=this;return this.isEditable()&&this.formatButtonIsShown()?(0,i.uC)("div").addClass("".concat(r.YR,"-column-button"),"".concat(r.YR,"-column-button-format")).title(n.ag.getText("ButtonFormat")).attr("tabIndex","0").on("touchstart click",(function(e){return t.buttonFormatClickHandler(e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).toDOM():null},t.prototype.getUIS=function(){return this.bar.getContext().getModel().checkAttrProperty(this.column.expr.value,"useInSorting")},t.prototype.onMouseClick=function(t){this.bar.toggleColumnPicked(this.column),this.adjustButtonsVisibility()},t.prototype.onMouseEnter=function(t){if(!s.z.isMobileMode())return this.isMouseOverBlock=!0,this.enterButtonBlock(),t.stopPropagation(),!1},t.prototype.onMouseLeave=function(t){if(!s.z.isMobileMode())return this.isMouseOverBlock=!1,this.leaveButtonBlock(),t.stopPropagation(),!1},t.prototype.isColumnActive=function(){return this.element.classList.contains("active")},t.prototype.hideButtons=function(){s.z.isMobileMode()?this.onHideButtonsMobile&&this.onHideButtonsMobile():(0,i.uC)(this.element).data("show-buttons",null)},t.prototype.showButtons=function(){s.z.isMobileMode()?this.onShowButtonsMobile&&this.onShowButtonsMobile():(0,i.uC)(this.element).data("show-buttons","")},t.prototype.adjustButtonsVisibility=function(){this.bar.options.alwaysShowButtons||(this.bar.options.accentActiveColumn||s.z.isMobileMode())&&this.isColumnActive()?this.showButtons():this.hideButtons()},t.prototype.enterButtonBlock=function(){this.showButtons()},t.prototype.leaveButtonBlock=function(){1==this.bar.options.alwaysShowButtons||this.isColumnActive()&&1==this.bar.options.accentActiveColumn||this.hideButtons()},t.prototype.createFunctionMenu=function(){for(var t,e=[],o=this.bar.getContext().getModel().getAggrFunctions(),i=!0,r=null,s=this.column.getDataType(),a=0,l=o;a<l.length;a++){var c=l[a];if(c){var d=c.getAppliedTypesOrDefault().indexOf(s)>=0;this.column.expr.func!==c.id||d||(i=!1),d&&(t=this.bar.getContext().getModel().getAggrFunctionCaption(c.id),r={id:c.id,text:t},e.push(r))}}i||(this.column.expr.func=e[0].id),this.bar.areCustomExpressionsAllowed()&&(r={id:"CustomSqlDivider",text:"---"},e.push(r),r={id:"CUSTOMSQL",text:t=n.ag.getText("CustomExpression")},e.push(r));var h=this.element.id;h&&(h+="-FunctionsMenu");var p={items:e,id:h,searchBoxAlwaysShown:!1,domWriteItemsId:!0};this.functionMenu=new u(p)},t.prototype.createFormatsMenu=function(){if(0!=this.bar.options.allowDisplayFormatChange){var t=this.column.id;t&&(t+="-FormatsMenu");var e={items:this.getFormatsMenuItems(),id:t,searchBoxAlwaysShown:!1,showSelected:!0,domWriteItemsId:!0};this.formatsMenu=new u(e)}},t.prototype.getFormatsMenuItems=function(){var t=this.bar.getContext().getModel().getDisplayFormatsForType(this.column.getDataType());return[{id:"{0:__default}",text:"Default"}].concat(t.map((function(t){return{id:t.format,text:n.ag.getText("DisplayFormats",t.name)||t.name}})))},t}(),S=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.getClassesToAdd=function(){return"".concat(t.prototype.getClassesToAdd.call(this)," ").concat(this.cssPrefix,"-row ").concat(this.cssPrefix,"-row-column-entattr")},e.prototype.baseExpressionItemSelectedCallback=function(t,e){var n=t.id,o=this.bar.getContext(),i=o.getModel().getAttributeById(n);return this.updateBaseAttr(i),this.column.caption=o.getDefaultColumnCaption(this.column),this.fireColumnChanged(),!1},e.prototype.updateBaseAttr=function(t){this.column.expr.setValue(t.id,!0),this.column.expr.baseAttrId=t.id,this.column.expr.dataType=t.dataType},e.prototype.getUIS=function(){var t=this.column.expr.args[0];return!t||this.bar.getContext().getModel().checkAttrProperty(t.value,"useInSorting")},e.prototype.changeTypeToCustomSql=function(){this.column.getQuery().changeColumnType(this.column,o.ExprTag.CustomSql),this.fireColumnChanged()},e.prototype.changeTypeToAggr=function(t){this.column.getQuery().changeColumnType(this.column,o.ExprTag.AggregateFunction,{funcId:t}),this.fireColumnChanged()},e.prototype.changeColumnTypeHandler=function(t){var e=this;this.functionMenu.showMenu({anchor:t.target,selectedIds:null,itemSelectedCallback:function(t,n){return"CUSTOMSQL"==t.id?e.changeTypeToCustomSql():e.changeTypeToAggr(t.id),!1},menuClosedCallback:function(){e.keepShowingButtons=!1,e.isMouseOverBlock||e.element.dispatchEvent((0,i.sJ)("mouseleave"))}})},e}(D),M=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return M(e,t),e.prototype.getClassesToAdd=function(){return"".concat(t.prototype.getClassesToAdd.call(this)," ").concat(this.cssPrefix,"-row ").concat(this.cssPrefix,"-row-column-aggr")},e.prototype.renderColumnTypeButton=function(){var e=t.prototype.renderColumnTypeButton.call(this);return e&&(e.classList.add("aggregated"),e.title=n.ag.getText("ButtonToSimple")),e},e.prototype.updateBaseAttr=function(t){this.column.expr.args[0].setValue(t.id,!0),this.column.expr.baseAttrId=t.id},e.prototype.changeTypeToSimple=function(){this.column.getQuery().changeColumnType(this.column,o.ExprTag.EntityAttribute),this.fireColumnChanged()},e.prototype.changeColumnTypeHandler=function(t){this.changeTypeToSimple()},e}(k),P=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),I=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return P(e,t),e.prototype.getClassesToAdd=function(){return"".concat(this.cssPrefix,"-row ").concat(this.cssPrefix,"-row-column-entattr")+t.prototype.getClassesToAdd.call(this)},e.prototype.renderColumnTypeButton=function(){var e=t.prototype.renderColumnTypeButton.call(this);return e&&(e.classList.add("aggregated"),e.title=o.i18n.getText("ButtonToSimple")),e},e.prototype.changeTypeToSimple=function(){this.column.getQuery().changeColumnType(this.column,o.ExprTag.EntityAttribute),this.fireColumnChanged()},e.prototype.getColumnValue=function(){return""},e.prototype.setColumnValue=function(t){},e.prototype.getUIS=function(){return!0},e.prototype.changeColumnTypeHandler=function(t){this.changeTypeToSimple()},e}(D),A=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return P(e,t),Object.defineProperty(e.prototype,"columnEnabled",{get:function(){return!!this.bar.areCustomExpressionsAllowed()&&this.column.enabled},set:function(t){this.bar.areCustomExpressionsAllowed()?this.column.enabled=t:this.column.enabled=!1},enumerable:!1,configurable:!0}),e.prototype.getColumnValue=function(){return this.column.expr.sql},e.prototype.setColumnValue=function(t){this.column.expr.sql=t},e.prototype.getDefaultValue=function(){return this.column.expr.sql},e}(I),O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return P(e,t),e.prototype.getColumnValue=function(){return this.column.expr.value},e.prototype.setColumnValue=function(t){this.column.expr.setValue(t)},e.prototype.getDefaultValue=function(){return this.column.expr.value},e}(I),L=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),R=function(t){function e(e,a){var l=t.call(this,e)||this;return l.options={isSubQuery:!1,activeColumn:null,showAddRow:!0,showHeader:!0,showColumnTitles:!0,allowAggrColumns:!0,allowDuplicates:!0,allowCustomExpressions:!1,allowSorting:!0,alwaysShowButtons:!1,accentActiveColumn:!0,allowDragDrop:!0,menuOptions:{showSearchBoxAfter:30,searchBoxAutoFocus:!0,activateOnMouseOver:!0,adjustHeight:!0,itemRenderedCallback:null},attrPlacement:0,sortEntities:!1,columnRenderedCallback:null,customExpressionText:0},l.landingSlot=(0,i.uC)("div").addClass("".concat(r.YR,"-highlight")).toDOM(),l.landingIndex=-1,l.sortMenuList=[{id:"None",text:n.ag.getText("CmdNotSorted")},{id:"Ascending",text:n.ag.getText("CmdAscending")},{id:"Descending",text:n.ag.getText("CmdDescending")},{id:"---",text:"---"}],l.moveMenuList=[{id:"MoveTop",text:n.ag.getText("CmdMoveToFirst")},{id:"MoveUp",text:n.ag.getText("CmdMoveToPrev")},{id:"MoveDown",text:n.ag.getText("CmdMoveToNext")},{id:"MoveBottom",text:n.ag.getText("CmdMoveToLast")}],(0,i.uC)(l.slot).addClass("".concat(l.cssPrefix,"-panel")).addClass(s.z.getMobileCssClass()),l.group=o.WidgetGroup.Query,l.customQuery=a,l}return L(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-cb"},enumerable:!1,configurable:!0}),e.prototype.getWidgetType=function(){return"columnsBar"},e.prototype.init=function(e,n){var o=this;t.prototype.init.call(this,e,n),this.setOptions(n),n.attrElementFormat&&(this.context.options.attributeFormat=n.attrElementFormat),n.titleElementFormat&&(this.context.options.columnTitleFormat=n.titleElementFormat),this.detachQueryObserver(),this.attachQueryObserver(),i.Yy.removeDropContainer(this.slot),this.options.allowDragDrop&&i.Yy.registerDropContainer({element:this.slot,scopes:["entityAttrSort"],onDragEnter:function(t,e){o.showLandingSlot(e.pageX,e.pageY)},onDragOver:function(t,e){o.showLandingSlot(e.pageX,e.pageY)},onDragLeave:function(t,e){e.dropEffect=i.KX.Forbid,o.hideLandingSlot()},onDrop:function(t,e){if(o.landingIndex>=0){var n=o.getQuery().getColumns().indexOf(e.data.column);o.moveColumnCore(n,o.landingIndex)}else e.item.element.removeAttribute("style")}})},e.prototype.attachQueryObserver=function(){var t=this,e=this.getQuery();this.queryEventCallbackId=e.addChangedCallback((function(n){var i=n.data;if(i&&(i.part==o.QueryChangePart.Columns||i.part==o.QueryChangePart.Aggregation||i.part==o.QueryChangePart.All)){var r=document.activeElement,s=t.slot.contains(r)||r==document.body;switch(i.action){case o.QueryChangeAction.Modify:var a=i.changee,l=function(e){var n=t.columnsBlock.querySelector("div[data-id='".concat(e.id,"']"));if(n){var o=t.renderColumn(e,n);if(s){var i=o.querySelector("a");i&&i.focus()}}};Array.isArray(a)?a.forEach((function(t){return l(t)})):l(a);break;case o.QueryChangeAction.Add:a=i.changee;var c=function(n){var o=e.getColumns().indexOf(n);t.addColumnElement(n,o)};Array.isArray(a)?a.forEach((function(t){return c(t)})):c(a);break;case o.QueryChangeAction.Delete:a=i.changee;var u=function(e){var n=t.columnsBlock.querySelector("div[data-id='".concat(e.id,"']"));if(n){var o=n.nextSibling,i=n.previousSibling;if(t.columnsBlock.removeChild(n),s){var r=(o||i||t.addRowButton).querySelector("a");r&&r.focus()}}};Array.isArray(a)?a.forEach((function(t){return u(t)})):u(a);break;default:t.refresh()}}}))},e.prototype.getQuery=function(){return this.customQuery?this.customQuery:this.getContext().getQuery()},e.prototype.destroyCore=function(){i.Yy.removeDropContainer(this.slot),this.detachQueryObserver(),this.slot.innerHTML=""},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.setOptions=function(t){this.options=n.P6.assignDeep(this.options,t),this.getContext().options.allowCustomExpressions=t.allowCustomExpressions},e.prototype.showLandingSlot=function(t,e){for(var n=this.columnsBlock.querySelectorAll("[class*=".concat(this.cssPrefix,"-row]")),o=[],r=0;r<n.length;r++)"none"!==n[r].style.display&&o.push(n[r]);if(0!==o.length){var s=(0,i.lE)(this.landingSlot);if(!(t>=s.x&&t<=s.x+this.landingSlot.offsetWidth&&e>=s.y&&e<=s.y+this.landingSlot.offsetHeight)){var a=this.landingIndex;for(r=0;r<o.length;r++){var l=o[r],c=(0,i.lE)(l),u=l.offsetWidth,d=l.offsetHeight,h=.2*u;if(t>=c.x+h&&t<=c.x+u-h&&e>=c.y+2&&e<=c.y+d-2){a=t>s.x?r+1:r;break}}(a!=this.landingIndex||this.landingSlot.parentElement)&&(this.landingIndex=a,this.landingIndex<=0&&this.columnsBlock.insertBefore(this.landingSlot,o[0]),this.landingIndex<o.length?this.columnsBlock.insertBefore(this.landingSlot,o[this.landingIndex]):this.columnsBlock.appendChild(this.landingSlot))}}else this.landingIndex=0},e.prototype.hideLandingSlot=function(){this.landingIndex=-1,this.landingSlot.parentElement&&this.landingSlot.parentElement.removeChild(this.landingSlot)},e.prototype.onProcessStartCore=function(){},e.prototype.onProcessEndCore=function(){},e.prototype.refreshCore=function(){this.clear(),this.render()},e.prototype.clear=function(){this.slot.innerHTML=""},e.prototype.renderAddRowButton=function(){var t=this;(0,i.uC)(this.addRowButton).addClass("".concat(r.YR,"-addrow"),"".concat(this.cssPrefix,"-addrow"),"".concat(r.YR,"-addrow-empty")).addClass(s.z.getMobileCssClass()).title(n.ag.getText("CmdClickToAddColumn")).addChild("a",(function(e){return e.attr("href","javascript:void(0)").on("click",(function(e){e.preventDefault(),t.showEntitiesMenu({anchor:e.target,selectedIds:null,itemSelectedCallback:function(e,n){var o=e.id;return t.addNewColumn(o),!1}})}))})),s.z.isMobileMode()&&(0,i.uC)(this.columnsBlock).addChildElement(this.addRowButton)},e.prototype.render=function(){var t=this;this.createEntitiesMenu(),this.options.allowSorting&&this.createSortMenu(),this.createMoveMenu(),this.columnsBlock=(0,i.uC)("div").addClass("".concat(this.cssPrefix,"-columns")).addClass(s.z.getMobileCssClass()).toDOM(),this.options.showAddRow&&(this.addRowButton=(0,i.uC)("div").toDOM(),s.z.isMobileMode()?(0,i.uC)(this.columnsBlock).addChildElement(this.addRowButton):(0,i.uC)(this.slot).addChildElement(this.addRowButton),this.renderAddRowButton()),(0,i.uC)(this.slot).addChildElement(this.columnsBlock).addChildElement(this.renderColumnButtonsBlockMobile()),this.getQuery().getColumns().forEach((function(e,n){var o=t.renderColumn(e);t.columnsBlock.appendChild(o)}))},e.prototype.renderColumnButtonsBlockMobile=function(){var t=this;return this.columnButtonsBlockMobileArrow=(0,i.uC)("i").toDOM(),this.columnButtonsBlockMobile=(0,i.uC)("div").addClass("".concat(this.cssPrefix,"-column-buttonsBlock")).addClass(s.z.getMobileCssClass()).addChildElement(this.columnButtonsBlockMobileArrow).hide().toDOM(),this.buttonsBlockSortingButton=(0,i.uC)("div",this.columnButtonsBlockMobile).addClass("".concat(this.cssPrefix,"-column-button"),"".concat(this.cssPrefix,"-column-sortbutton-none")).toDOM(),(0,i.uC)(this.buttonsBlockSortingButton).on("touchstart click",(function(e){return e.stopPropagation(),t.currentColumnRenderer.buttonSortingClickHandler.call(t.currentColumnRenderer,e,t.buttonsBlockSortingButton),t.toggleColumnPicked(null),t.hideColumnButtonsMobile(),!1})),this.buttonsBlockTypeButton=(0,i.uC)("div",this.columnButtonsBlockMobile).addClass("".concat(this.cssPrefix,"-column-button"),"".concat(this.cssPrefix,"-column-button-type")).on("touchstart click",(function(e){return e.stopPropagation(),t.currentColumnRenderer.buttonTypeClickHandler.call(t.currentColumnRenderer,e),t.toggleColumnPicked(null),t.hideColumnButtonsMobile(),!1})).toDOM(),this.buttonsBlockFormatButton=(0,i.uC)("div",this.columnButtonsBlockMobile).addClass("".concat(this.cssPrefix,"-column-button"),"".concat(this.cssPrefix,"-column-button-format")).on("touchstart click",(function(e){return e.stopPropagation(),t.currentColumnRenderer.buttonFormatClickHandler.call(t.currentColumnRenderer,e),t.toggleColumnPicked(null),t.hideColumnButtonsMobile(),!1})).toDOM(),this.buttonsBlockDeleteButton=(0,i.uC)("div",this.columnButtonsBlockMobile).addClass("".concat(this.cssPrefix,"-column-button"),"".concat(this.cssPrefix,"-column-button-delete")).on("touchstart click",(function(e){return e.stopPropagation(),t.currentColumnRenderer.buttonDeleteClickHandler.call(t.currentColumnRenderer,e),t.toggleColumnPicked(null),t.hideColumnButtonsMobile(),!1})).toDOM(),(0,i.uC)("div",this.columnButtonsBlockMobile).addClass("".concat(this.cssPrefix,"-column-button-close-block")).on("touchstart click",(function(){t.toggleColumnPicked(null),t.hideColumnButtonsMobile()})),this.columnButtonsBlockMobile},e.prototype.showColumnButtonsMobile=function(t,e,n){this.currentActiveColumn=t,this.currentColumnRenderer=e;var o=n.getBoundingClientRect(),r=n.offsetTop,s=n.offsetLeft;(0,i.uC)(this.columnButtonsBlockMobileArrow).setStyle("left",(s+o.width/2).toString()+"px"),o.top>100?(0,i.uC)(this.columnButtonsBlockMobile).removeClass("show-below").setStyle("top",(r-o.height).toString()+"px"):(0,i.uC)(this.columnButtonsBlockMobile).addClass("show-below").setStyle("top",(r+o.height).toString()+"px"),t.enabled&&!t.isReadOnly()?((0,i.uC)(this.buttonsBlockSortingButton).show(),(0,i.uC)(this.buttonsBlockTypeButton).show(),e.formatButtonIsShown()?(0,i.uC)(this.buttonsBlockFormatButton).show():(0,i.uC)(this.buttonsBlockFormatButton).hide()):((0,i.uC)(this.buttonsBlockSortingButton).hide(),(0,i.uC)(this.buttonsBlockTypeButton).hide()),t.isReadOnly()?(0,i.uC)(this.columnButtonsBlockMobile).hide():(0,i.uC)(this.columnButtonsBlockMobile).show()},e.prototype.hideColumnButtonsMobile=function(){(0,i.uC)(this.columnButtonsBlockMobile).hide()},e.prototype.renderColumn=function(t,e){var n=this,o=this.getColumnRenderer(t,e);if(o){var i=o.render();return o.onShowButtonsMobile=function(){n.showColumnButtonsMobile(t,o,i)},o.onHideButtonsMobile=function(){n.hideColumnButtonsMobile()},i}return null},e.prototype.getColumnRenderer=function(t,e){switch(t.expr.tag){case o.ExprTag.Constant:return new O(this,t,e);case o.ExprTag.AggregateFunction:return new B(this,t,e);case o.ExprTag.CustomSql:return new A(this,t,e);default:return new k(this,t,e)}return null},e.prototype.addNewColumn=function(t,e){this.getContext().getModel();var n=this.getQuery();if(Array.isArray(t)){for(var o=null,i=[],r=0;r<t.length;r++)(o=n.addColumn({attributeId:t[r],index:e},!0))&&i.push(o);return i}return o=n.addColumn({attributeId:t,index:e})},e.prototype.toggleColumnPicked=function(t){var e,n;t&&(e=this.columnsBlock.querySelector("div[data-id=".concat(t.id,"]")))&&(n=e.classList.contains("active"));for(var o=this.columnsBlock.querySelectorAll(".".concat(this.cssPrefix,"-row")),r=0;r<o.length;r++){var s=o[r];(0,i.uC)(s).removeClass("active").data("show-buttons",null)}e&&!n&&(0,i.uC)(e).addClass("active").data("show-buttons","")},e.prototype.addColumnElement=function(t,e){var n=this.columnsBlock.querySelectorAll("[class*=".concat(this.cssPrefix,"-row]")),o=this.renderColumn(t);n.length>0&&e<n.length-1?this.columnsBlock.insertBefore(o,n[e]):this.columnsBlock.appendChild(o),this.options.columnRenderedCallback&&this.options.columnRenderedCallback(o)},e.prototype.checkColumnsArray=function(t){for(var e=t.length,n=[],o=0;o<e;o++)this.checkColumn(t[o])&&n.push(t[o]);return n},e.prototype.checkColumn=function(t){if(!this.options.allowDuplicates)for(var e=this.getQuery().getColumns(),n=JSON.stringify(t.expr),o=0;o<e.length;o++){if(JSON.stringify(e[o].expr)===n)return null}return t},e.prototype.getColumnsBlock=function(){return this.columnsBlock},e.prototype.showEntitiesMenu=function(t){this.entitiesMenu&&this.entitiesMenu.showMenu(t)},e.prototype.createEntitiesMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-EntitiesMenu");var o={items:t.getEntitiesTree({addUIC:!1,addUIR:!0,addUIS:!1,attrPlacement:this.options.attrPlacement,sortEntities:this.options.sortEntities}),adjustHeight:this.options.adjustEntitiesMenuHeight,id:e,domWriteItemsId:this.options.domWriteItemsId};n.P6.assign(o,this.options.menuOptions),this.entitiesMenu=new u(o)},e.prototype.createSortMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-SortMenu");var o={items:this.sortMenuList.concat(this.moveMenuList),id:e,domWriteItemsId:this.options.domWriteItemsId};n.P6.assign(o,this.options.menuOptions),o.searchBoxAlwaysShown=!1,this.sortMenu=new u(o)},e.prototype.createMoveMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-MoveMenu");var o={items:this.moveMenuList,id:e,domWriteItemsId:this.options.domWriteItemsId};n.P6.assign(o,this.options.menuOptions),this.moveMenu=new u(o),o.searchBoxAlwaysShown=!1},e.prototype.moveColumn=function(t,e){var n=this.getQuery().getColumns(),o=n.indexOf(t);if(o>=0)switch(e){case"MoveTop":if(0==o)return;this.moveColumnCore(o,0);break;case"MoveUp":if(0==o)return;this.moveColumnCore(o,o-1);break;case"MoveDown":if(o==n.length-1)return;this.moveColumnCore(o,o+1);break;case"MoveBottom":if(o==n.length-1)return;this.moveColumnCore(o,n.length-1)}},e.prototype.moveColumnCore=function(t,e){var n=this.getQuery();if(n){var i=this.columnsBlock.querySelectorAll("[class*=".concat(this.cssPrefix,"-row]")),r=i[t];e<=0?this.columnsBlock.insertBefore(r,this.columnsBlock[0]):e<i.length?this.columnsBlock.insertBefore(r,i[e]):this.columnsBlock.appendChild(r),n.moveColumn(t,e),n.fireColumnsChangedEvent(o.QueryChangeAction.All)}},e.prototype.areCustomExpressionsAllowed=function(){return this.getQuery().isEx()&&this.getContext().options.allowCustomExpressions},e.globalCounter=0,e}(o.Widget),_=function(){function t(t,e,n){this.functionMenu=null,this.isMouseOverBlock=!1,this.keepShowingButtons=!1,this.bar=t,this.column=e,this.element=n}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-sb"},enumerable:!1,configurable:!0}),t.prototype.render=function(){var t=this,e=(0,i.uC)("div");return e.data("id",this.column.id),this.element&&this.element.parentNode.replaceChild(e.toDOM(),this.element),this.element=e.toDOM(),this.bar.options.allowDragDrop&&i.Yy.registerDraggableItem({element:this.element,scope:"entityAttrSortSB",beforeDragStart:function(){return t.element.dispatchEvent((0,i.sJ)("mouseleave"))},onDragStart:function(e){t.element.style.display="none",e.dropEffect=i.KX.Allow},onDragEnd:function(e){e.data.finishedSuccessfully||t.element.removeAttribute("style")},data:{column:this.column}}),e.addClass(this.getClassesToAdd()).addClass(s.z.getMobileCssClass()).addChildElement(this.renderCaptionBlock()),this.isEditable()&&e.addChildElement(this.renderSortingButton()),this.element},t.prototype.fireColumnChanged=function(){this.column.fireChangedEvent()},t.prototype.refresh=function(){this.render()},t.prototype.getAttribute=function(){return this.bar.getContext().getModel().getAttributeById(this.column.expr.value)},t.prototype.isEditable=function(){return this.column.enabled&&!this.column.isReadOnly()},t.prototype.renderCaptionBlock=function(){var t=this;var e=this.column.caption;return this.isEditable()||(e+=function(t){switch(t){case o.SortDirection.Ascending:return" ↑";case o.SortDirection.Descending:return" ↓";default:return""}}(this.column.sorting)),(0,i.uC)("div").addClass("".concat(this.cssPrefix,"-colelement"),"".concat(this.cssPrefix,"-captionelement")).addClass(s.z.getMobileCssClass()).addChild("div",(function(n){return n.title(t.column.caption).text(e)})).toDOM()},t.prototype.renderSortingButton=function(){var t=this,e="".concat(r.YR,"-column-sortbutton"),a=e;switch(this.column.sorting){case o.SortDirection.None:a="".concat(e,"-none");break;case o.SortDirection.Ascending:a="".concat(e,"-asc");break;case o.SortDirection.Descending:a="".concat(e,"-desc")}var l=(0,i.uC)("div").addClass("".concat(this.cssPrefix,"-colelement"),"".concat(this.cssPrefix,"-sortimage-placeholder")).addClass(s.z.getMobileCssClass()).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-img-sorting"),a).title(n.ag.getText("ButtonSorting"))})).on("touchstart click",(function(e){return t.buttonSortingClickHandler(e,l.toDOM())}));return l.toDOM()},t.prototype.buttonSortingClickHandler=function(t,e){var n=this;return t.stopPropagation(),this.keepShowingButtons=!0,this.bar.sortMenu.showMenu({anchor:e,selectedIds:null,itemSelectedCallback:function(t,e){var i;if("None"==t.id||"Ascending"==t.id||"Descending"==t.id){var r=n.bar.getContext().getQuery();n.column.isJustSorted()&&"None"==t.id?(r.removeColumn(n.column),r.fireColumnsChangedEvent(o.QueryChangeAction.Delete,n.column,!0)):(n.column.sorting="None"==(i=t.id)?o.SortDirection.None:"Ascending"==i?o.SortDirection.Ascending:"Descending"==i?o.SortDirection.Descending:void 0,n.column._sortIndex=r.getColumnSortIndex(n.column),n.fireColumnChanged())}else n.bar.moveColumn(n.column,t.id)},menuClosedCallback:function(){n.keepShowingButtons=!1}}),!1},t.prototype.getClassesToAdd=function(){return"".concat(this.cssPrefix,"-row ").concat(this.cssPrefix,"-row-column-entattr")},t.prototype.getUIS=function(){return this.bar.getContext().getModel().checkAttrProperty(this.column.expr.value,"useInSorting")},t}(),F=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Q=function(t){function e(e){var a=t.call(this,e)||this;return a.options={showAddRow:!0,allowDragDrop:!0,menuOptions:{showSearchBoxAfter:30,searchBoxAutoFocus:!0,activateOnMouseOver:!0,adjustHeight:!0,itemRenderedCallback:null}},a.sortMenuList=[{id:"None",text:n.ag.getText("CmdNotSorted")},{id:"Ascending",text:n.ag.getText("CmdAscending")},{id:"Descending",text:n.ag.getText("CmdDescending")},{id:"---",text:"---"},{id:"MoveTop",text:n.ag.getText("CmdMoveToFirst")},{id:"MoveUp",text:n.ag.getText("CmdMoveToPrev")},{id:"MoveDown",text:n.ag.getText("CmdMoveToNext")},{id:"MoveBottom",text:n.ag.getText("CmdMoveToLast")}],a.landingSlot=(0,i.uC)("div").addClass("".concat(r.YR,"-highlight")).toDOM(),a.landingIndex=-1,(0,i.uC)(a.slot).addClass("".concat(a.cssPrefix,"-panel")).addClass(s.z.getMobileCssClass()),a.group=o.WidgetGroup.Query,a}return F(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-sb"},enumerable:!1,configurable:!0}),e.prototype.getWidgetType=function(){return"sortingBar"},e.prototype.init=function(e,n){var o=this;t.prototype.init.call(this,e,n),this.setOptions(n),n.attrElementFormat&&(this.context.options.attributeFormat=n.attrElementFormat),n.titleElementFormat&&(this.context.options.columnTitleFormat=n.titleElementFormat),this.destroyCore(),this.attachQueryObserver(),i.Yy.removeDropContainer(this.slot),this.options.allowDragDrop&&i.Yy.registerDropContainer({element:this.slot,scopes:["entityAttrSortSB"],onDragEnter:function(t,e){o.showLandingSlot(e.pageX,e.pageY)},onDragOver:function(t,e){o.showLandingSlot(e.pageX,e.pageY)},onDragLeave:function(t,e){e.dropEffect=i.KX.Forbid,o.hideLandingSlot()},onDrop:function(t,e){o.landingIndex>=0?o.getQuery().setColumnSortIndex(e.data.column,o.landingIndex):e.item.element.removeAttribute("style")}})},e.prototype.setOptions=function(t){n.P6.assignDeep(this.options,t)},e.prototype.attachQueryObserver=function(){var t=this,e=this.getQuery();this.queryEventCallbackId=e.addChangedCallback((function(e){var n=e.data;!n||n.part!=o.QueryChangePart.SortingColumns&&n.part!=o.QueryChangePart.Columns&&n.part!=o.QueryChangePart.All||t.refresh()}))},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.getQuery=function(){return this.getContext().getQuery()},e.prototype.getModel=function(){return this.getContext().getModel()},e.prototype.destroyCore=function(){this.detachQueryObserver(),this.clear()},e.prototype.refreshCore=function(){this.clear(),this.render()},e.prototype.renderAddRowButton=function(){var t=this;(0,i.uC)(this.addRowButton).addClass("".concat(r.YR,"-addrow"),"".concat(this.cssPrefix,"-addrow"),"".concat(r.YR,"-addrow-empty")).addClass(s.z.getMobileCssClass()).title(n.ag.getText("CmdClickToAddColumn")).addChild("a",(function(e){return e.attr("href","javascript:void(0)").on("click",(function(e){e.preventDefault(),t.showEntitiesMenu({anchor:e.target,selectedIds:null,itemSelectedCallback:function(e,n){var o=e.id;return t.addNewColumn(o),!1}})}))})),s.z.isMobileMode()&&(0,i.uC)(this.columnsBlock).addChildElement(this.addRowButton)},e.prototype.showEntitiesMenu=function(t){this.entitiesMenu.showMenu(t)},e.prototype.createEntitiesMenu=function(){var t=this.getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-EntitiesMenu");var n={items:t.getEntitiesTree({addUIC:!1,addUIR:!1,addUIS:!0}),adjustHeight:this.options.adjustEntitiesMenuHeight,id:e,domWriteItemsId:this.options.domWriteItemsId};this.entitiesMenu=new u(n)},e.prototype.createSortMenu=function(){var t=this.getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-SortMenu");var n={items:this.sortMenuList,id:e,searchBoxAlwaysShown:!1};this.sortMenu=new u(n)},e.prototype.render=function(){var t=this;this.createEntitiesMenu(),this.createSortMenu(),this.columnsBlock=(0,i.uC)("div").addClass("".concat(this.cssPrefix,"-columns")).addClass(s.z.getMobileCssClass()).toDOM(),this.options.showAddRow&&(this.addRowButton=(0,i.uC)("div").toDOM(),s.z.isMobileMode()?(0,i.uC)(this.columnsBlock).addChildElement(this.addRowButton):(0,i.uC)(this.slot).addChildElement(this.addRowButton),this.renderAddRowButton()),(0,i.uC)(this.slot).addChildElement(this.columnsBlock),this.getQuery().getSortedColumns().forEach((function(e,n){var o=t.renderColumn(e);t.columnsBlock.appendChild(o)}))},e.prototype.addNewColumn=function(t){this.getModel();var e=this.getQuery(),n=e.addColumn({attributeId:t,justsorted:!0,sorting:o.SortDirection.Ascending});return e.fireChangedEvent({part:o.QueryChangePart.SortingColumns,action:o.QueryChangeAction.Add,changee:n,source:this}),n},e.prototype.renderColumn=function(t,e){var n=new _(this,t,e);return n?n.render():null},e.prototype.clear=function(){this.slot.innerHTML=""},e.prototype.moveColumn=function(t,e){var n=this.getQuery(),o=n.getSortedColumns(),i=n.getColumnSortIndex(t);if(i>=0)switch(e){case"MoveTop":n.setColumnSortIndex(t,0);break;case"MoveUp":n.setColumnSortIndex(t,i>0?i-1:0);break;case"MoveDown":n.setColumnSortIndex(t,i<o.length-1?i+1:o.length-1);break;case"MoveBottom":n.setColumnSortIndex(t,o.length-1)}},e.prototype.showLandingSlot=function(t,e){for(var n=this.columnsBlock.querySelectorAll("[class*=".concat(this.cssPrefix,"-row]")),o=[],r=0;r<n.length;r++)"none"!==n[r].style.display&&o.push(n[r]);if(0!==o.length){var s=(0,i.lE)(this.landingSlot);if(!(t>=s.x&&t<=s.x+this.landingSlot.offsetWidth&&e>=s.y&&e<=s.y+this.landingSlot.offsetHeight)){var a=this.landingIndex;for(r=0;r<o.length;r++){var l=o[r],c=(0,i.lE)(l),u=l.offsetWidth,d=l.offsetHeight,h=.2*u;if(t>=c.x+h&&t<=c.x+u-h&&e>=c.y+2&&e<=c.y+d-2){a=t>s.x?r+1:r;break}}(a!=this.landingIndex||this.landingSlot.parentElement)&&(this.landingIndex=a,this.landingIndex<=0&&this.columnsBlock.insertBefore(this.landingSlot,o[0]),this.landingIndex<o.length?this.columnsBlock.insertBefore(this.landingSlot,o[this.landingIndex]):this.columnsBlock.appendChild(this.landingSlot))}}else this.landingIndex=0},e.prototype.hideLandingSlot=function(){this.landingIndex=-1,this.landingSlot.parentElement&&this.landingSlot.parentElement.removeChild(this.landingSlot)},e}(o.Widget);!function(t){t[t.None=0]="None",t[t.Value=1]="Value",t[t.Attribute=2]="Attribute",t[t.Operator=4]="Operator",t[t.Addition=8]="Addition",t[t.Removal=16]="Removal",t[t.All=255]="All",t[t.NoAddition=-9]="NoAddition",t[t.NoRemoval=-17]="NoRemoval",t[t.FixedConditionList=5]="FixedConditionList"}(p||(p={}));var N,q=function(){function t(t,e,n){this.panel=t,this.text=e,this.element=n||(0,i.uC)("div").toDOM()}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-qp"},enumerable:!1,configurable:!0}),t.prototype.refresh=function(){this.render()},t.prototype.render=function(){var t=this;return(0,i.uC)(this.element).html("").addClass(this.getClassesToAdd()).addClass(s.z.getMobileCssClass()).addChild("span",(function(e){return e.text(t.text).title(t.text)})).toDOM(),this.element},t.prototype.getClassesToAdd=function(){return"".concat(this.cssPrefix,"-condelement")},t}(),H=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();!function(t){t[t.AddCondition=0]="AddCondition",t[t.AddGroup=1]="AddGroup",t[t.Enable=2]="Enable",t[t.Delete=4]="Delete",t[t.Menu=5]="Menu",t[t.Parameterized=6]="Parameterized",t[t.InJoin=7]="InJoin"}(N||(N={}));var W=function(){function t(t,e,n){this.panel=t,this.condition=e,this.element=n||(0,i.uC)("div").toDOM()}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-qp"},enumerable:!1,configurable:!0}),t.prototype.refresh=function(){this.render()},t.prototype.clear=function(){this.element&&(this.element.className="",this.element.removeAttribute("data-id"),this.element.removeAttribute("style"),(0,i.uC)(this.element).html(""))},t.prototype.render=function(t){return this.clear(),this.coreRender(t),this.panel.options.onConditionRendered&&this.panel.options.onConditionRendered(this.condition,this.element),this.element},t.prototype.isEditable=function(){return this.condition.enabled&&!this.condition.isReadOnly()},t}(),j=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return H(e,t),e.prototype.getClassesToAdd=function(){var t="".concat(this.cssPrefix,"-row ").concat(this.cssPrefix,"-row-condition");if(t+=this.condition.isInJoin()?" ".concat(this.cssPrefix,"-condition-injoin"):"",t+=this.condition.isParameterized()?" ".concat(this.cssPrefix,"-condition-parameterized"):"",!s.z.isMobileMode()){var e=this.condition.getLevel();e>0&&(t+=" ".concat(this.cssPrefix,"-level-").concat(e))}return t+=this.condition.enabled?"":" ".concat(this.cssPrefix,"-disabled"),this.condition.enabled&&(t+=this.condition.isReadOnly()?" ".concat(this.cssPrefix,"-readonly"):""),t},e.prototype.coreRender=function(t){var e=this,n=this.panel.getContext().getModel(),r=n.getOperatorById(this.condition.getOperatorId()),a=o.equtils.parseOperatorFormat(r),l=null,c=a.length,u=(0,i.uC)("div");this.element&&this.element.parentNode&&this.element.parentNode.replaceChild(u.toDOM(),this.element),this.element=u.toDOM(),u.addClass(this.getClassesToAdd()).addClass(s.z.getMobileCssClass()).data("id",this.condition.id).data("condrow","").addChildElement(this.renderCheckbox()).addChildElement(this.renderConjunction());for(var d=t,h=r==n.nullOperator?Math.min(c,this.condition.expressions.length+1):c,p=function(t){if("operator"===(l=a[t]).type){var e=f.panel.getOperatorRenderer(f.condition,l.text);e&&u.addChildElement(e.render())}else if("expression"===l.type){var n=d&&l.index>0,o=f.panel.getExpressionRenderer(f.condition.expressions[l.index]);if(o){var i=o.render(n);u.addChildElement(i),setTimeout((function(){o.adjustWidth()}),100)}d=d&&!n}else"text"===l.type&&u.addChildElement(new q(f.panel,l.text).render())},f=this,g=0;g<h;g++)p(g);(this.panel.options.accentActiveCondition||s.z.isMobileMode())&&u.on("click",(function(t){return t.stopPropagation(),e.panel.toggleConditionPicked(e.condition),e.adjustButtonsVisibility(),s.z.isMobileMode()||e.element.dispatchEvent((0,i.sJ)("mouseenter")),!1})),u.addChildElement(this.renderButtonsBlock()),s.z.isMobileMode()||u.on("mouseenter",(function(t){return e.isMouseOverBlock=!0,e.enterButtonBlock(),t.stopPropagation(),!1})).on("mouseleave",(function(t){return e.isMouseOverBlock=!1,!e.keepShowingButtons&&(0,i.uC)(e.buttonsBlock).isVisible()&&e.leaveButtonBlock(),t.stopPropagation(),!1}))},e.prototype.setConditionParameterized=function(t){this.condition.setParameterized(t),this.condition.fireChangedEvent()},e.prototype.setConditionInJoin=function(t){this.condition.setInJoin(t),this.condition.fireChangedEvent()},e.prototype.getConditionMenu=function(){return this.panel.getConditionMenu()},e.prototype.renderConjunction=function(){var t=this.condition.getParent();if(!t)return null;var e=0==n.P6.findItemIndexById(t.getConditions(),this.condition.id);if(this.panel.options.showConjunctions&&!e){var r=o.equtils.linkTypeToStr(this.condition.getParent().linkType),s=n.ag.getText("Conj"+r);return(0,i.uC)("span").text(s).title(s).addClass("".concat(this.cssPrefix,"-condelement ").concat(this.cssPrefix,"-condition-conjuction")).toDOM()}return null},e.prototype.renderCheckbox=function(){var t=this;return this.panel.options.showCheckboxes&&!this.condition.isReadOnly()?(0,i.uC)("div").title(n.ag.getText("CmdToggleEnable")).attr("tabIndex","0").addClass("".concat(this.cssPrefix,"-condelement ").concat(this.cssPrefix,"-condition-checkbox")).addClass("".concat(this.condition.enabled?"enabled":"")).on("click",(function(){return t.condition.enabled=!t.condition.enabled,t.condition.fireChangedEvent(),!1})).on("keypress",(function(t){[13,32].includes(t.keyCode)&&t.target.click()})).toDOM():null},e.prototype.isConditionActive=function(){return this.element.classList.contains("active")},e.prototype.hideButtons=function(){(0,i.uC)(this.element).data("show-buttons",null)},e.prototype.showButtons=function(){(0,i.uC)(this.element).data("show-buttons","")},e.prototype.adjustButtonsVisibility=function(){(this.panel.options.alwaysShowButtonsInConditions||this.panel.options.accentActiveCondition&&this.isConditionActive())&&this.showButtons()},e.prototype.enterButtonBlock=function(){this.showButtons()},e.prototype.leaveButtonBlock=function(){this.panel.options.alwaysShowButtonsInConditions||this.isConditionActive()&&this.panel.options.accentActiveCondition||this.hideButtons()},e.prototype.conditionMenuHandler=function(t,e){var n=this;switch(t){case N.AddCondition:if(!this.condition.isGroup())return;var i=this.panel.getEntitiesMenu();i&&i.showMenu({anchor:e.target,itemSelectedCallback:function(t){var e=n.panel.getQuery(),i={parent:n.condition,attributeId:t.id},r=e.addSimpleCondition(i);return r&&e.fireConditionsChangedEvent(o.QueryChangeAction.Add,r),!1}});break;case N.AddGroup:if(!this.condition.isGroup())return;var r=this.panel.getQuery(),s={parent:this.condition},a=this.panel.getQuery().addConditionGroup(s);a&&r.fireConditionsChangedEvent(o.QueryChangeAction.Add,a);break;case N.Enable:this.condition.enabled=!this.condition.enabled,this.condition.fireChangedEvent();break;case N.Delete:var l=this.condition.getParent();if(!l)return;var c=l.getConditions(),u=c.indexOf(this.condition);u>=0&&(c.splice(u,1),this.condition.getQuery().fireConditionsChangedEvent(o.QueryChangeAction.Delete,this.condition));break;case N.Menu:var d=this.getConditionMenu();this.keepShowingButtons=!0,d.showMenu({anchor:e.target,selectedIds:this.getConditionMenuSelectedItems(),itemSelectedCallback:function(t){var o;switch(t.id){case"enable":o=N.Enable;break;case"delete":o=N.Delete;break;case"param":o=N.Parameterized;break;case"inJoin":o=N.InJoin;break;case"addCondition":o=N.AddCondition;break;case"addGroup":o=N.AddGroup}n.conditionMenuHandler(o,e)},itemFilterCallback:function(t){var e=n.condition.enabled||"enable"===t.id||"delete"===t.id;if("enable"===t.id){var o=n.condition.getParent();e=e&&o&&o.enabled}else"delete"===t.id?e=e&&(n.panel.options.editableParts&p.Removal)===p.Removal:"addGroup"!==t.id&&"addCondition"!==t.id||(e=e&&(n.panel.options.editableParts&p.Addition)===p.Addition);return e},menuClosedCallback:function(){n.keepShowingButtons=!1,n.isMouseOverBlock||n.leaveButtonBlock()}});break;case N.Parameterized:this.condition.setParameterized(!this.condition.isParameterized()),this.condition.fireChangedEvent();break;case N.InJoin:this.condition.setInJoin(!this.condition.isInJoin()),this.condition.fireChangedEvent()}return e.stopPropagation(),!1},e.prototype.getConditionMenuSelectedItems=function(){var t=[];return this.condition.enabled&&t.push("enable"),this.condition.isParameterized()&&t.push("param"),this.condition.isInJoin()&&t.push("inJoin"),t},e.prototype.renderButtonsBlock=function(){var t=this,e=function(e){(0,i.uC)(e.target).addClass("".concat(t.cssPrefix,"-condition-button-active"))},o=function(e){(0,i.uC)(e.target).removeClass("".concat(t.cssPrefix,"-condition-button-active"))},r=(0,i.uC)("div").addClass("".concat(this.cssPrefix,"-condition-buttonsBlock")).addClass(s.z.getMobileCssClass());if(this.buttonsBlock=r.toDOM(),this.condition.isReadOnly())return this.buttonsBlock;var a=this.getButtonsToShow();return a.indexOf("addCondition")>=0&&this.condition.enabled&&(this.panel.options.editableParts&p.Addition)==p.Addition&&r.addChild("div",(function(i){i.addClass("".concat(t.cssPrefix,"-button-placeholder")).data("btnplaceholder","").addChild("div",(function(i){i.addClass("".concat(t.cssPrefix,"-condition-button ").concat(t.cssPrefix,"-condition-button-addCondition")).attr("tabIndex","0").data("button","").title(n.ag.getText("CmdAddCondition")).on("click",(function(e){return t.conditionMenuHandler(N.AddCondition,e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).on("mouseenter",e).on("mouseleave",o)}))})),(a.indexOf("addGroup")>=0||a.indexOf("addPredicate")>=0)&&this.condition.enabled&&(this.panel.options.editableParts&p.Addition)==p.Addition&&r.addChild("div",(function(i){i.addClass("".concat(t.cssPrefix,"-button-placeholder")).data("btnplaceholder","").addChild("div",(function(i){i.addClass("".concat(t.cssPrefix,"-condition-button ").concat(t.cssPrefix,"-condition-button-addPredicate")).attr("tabIndex","0").data("button","").title(n.ag.getText("CmdAddCondGroup")).on("click",(function(e){return t.conditionMenuHandler(N.AddGroup,e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).on("mouseenter",e).on("mouseleave",o)}))})),this.getButtonsToShow().indexOf("enable")>=0&&this.condition.getParent()&&this.condition.getParent().enabled&&r.addChild("div",(function(i){i.addClass("".concat(t.cssPrefix,"-button-placeholder")).data("btnplaceholder","").addChild("div",(function(i){i.addClass("".concat(t.cssPrefix,"-condition-button ").concat(t.cssPrefix,"-condition-button-enable")).attr("tabIndex","0").data("button","").title(n.ag.getText("CmdToggleEnable")).addClass(t.condition.enabled?"enabled":"").on("click",(function(e){return t.conditionMenuHandler(N.Enable,e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).on("mouseenter",e).on("mouseleave",o)}))})),this.getButtonsToShow().indexOf("delete")>=0&&this.condition.getParent()&&(this.panel.options.editableParts&p.Removal)==p.Removal&&r.addChild("div",(function(i){i.addClass("".concat(t.cssPrefix,"-button-placeholder")).data("btnplaceholder","").addChild("div",(function(i){i.addClass("".concat(t.cssPrefix,"-condition-button ").concat(t.cssPrefix,"-condition-button-delete")).attr("tabIndex","0").data("button","").title(n.ag.getText("CmdDelete")).on("click",(function(e){return t.conditionMenuHandler(N.Delete,e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).on("mouseenter",e).on("mouseleave",o)}))})),this.getButtonsToShow().indexOf("menu")>=0&&r.addChild("div",(function(i){i.addClass("".concat(t.cssPrefix,"-button-placeholder")).data("btnplaceholder","").addChild("div",(function(i){i.addClass("".concat(t.cssPrefix,"-condition-button ").concat(t.cssPrefix,"-condition-button-menu")).attr("tabIndex","0").data("button","").title(n.ag.getText("ButtonMenu")).on("click",(function(e){return t.conditionMenuHandler(N.Menu,e)})),s.z.isMobileMode()||i.on("keypress",(function(t){13==t.keyCode&&t.target.click()})).on("mouseenter",e).on("mouseleave",o)}))})),this.adjustButtonsVisibility(),this.buttonsBlock},e.prototype.getButtonsToShow=function(){return this.panel.options.buttons&&this.panel.options.buttons.condition&&Array.isArray(this.panel.options.buttons.condition)?this.panel.options.buttons.condition:["enable","delete"]},e}(W),G=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),z=function(t){function e(e){var n=t.call(this,"a",e)||this;return n.attr("href","javascript:void(0)"),n.on("click",(function(t){return t.preventDefault(),n.appear(),!1})),n}return G(e,t),e.prototype.onGetMenu=function(t){return this._onGetMenu=t,this},e.prototype.onItemSelected=function(t){return this._onItemSelected=t,this},e.prototype.appear=function(){var t=this,e=this._onGetMenu?this._onGetMenu():null;e&&e.showMenu({anchor:this.element,itemSelectedCallback:function(e){return t._onItemSelected&&t._onItemSelected(e.id),!1}})},e}(i.Hq);function V(t){return new z(t)}var U,Y=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),J=function(t){function e(e,n,o){var i=t.call(this,e,n,o)||this;return i.isRoot=!n.getParent(),i}return Y(e,t),e.prototype.getClassesToAdd=function(){var t="".concat(this.cssPrefix,"-group");return this.isRoot&&(t+=" ".concat(this.cssPrefix,"-group-root")),t},e.prototype.coreRender=function(t){(0,i.uC)(this.element).addClass(this.getClassesToAdd()).addClass(s.z.getMobileCssClass()).addChildElement(this.renderGroupRow()).addChildElement(this.renderConditions(t)).data("id",this.condition.id).data("group","")},e.prototype.renderGroupRow=function(){return this.isRoot&&!this.panel.options.showRootRow?null:new X(this.panel,this.condition).render()},e.prototype.renderConditions=function(t){var e=this,n=(0,i.uC)("div");return n.addClass("".concat(this.cssPrefix,"-conditions")).addClass("".concat(s.z.getMobileCssClass())).data("conditions",""),this.isRoot&&n.addClass("".concat(this.cssPrefix,"-conditions-root")),this.condition.getConditions().forEach((function(o,i,r){var s=e.panel.getConditionRenderer(o);s&&n.addChildElement(s.render(t&&i==r.length-1))})),n.toDOM()},e}(W),X=function(t){function e(e,n,o){var i=t.call(this,e,n,o)||this;return i.isRoot=!i.condition.getParent(),i}return Y(e,t),e.prototype.getButtonsToShow=function(){return this.panel.options.buttons&&this.panel.options.buttons.group&&Array.isArray(this.panel.options.buttons.group)?this.panel.options.buttons.group:["addCondition","addGroup","enable","delete"]},e.prototype.getClassesToAdd=function(){var t;if(this.isRoot)t="".concat(this.cssPrefix,"-row ").concat(this.cssPrefix,"-row-group ").concat(this.cssPrefix,"-row-group-root");else{t="".concat(this.cssPrefix,"-row ").concat(this.cssPrefix,"-row-group");var e=this.condition.getLevel();e>0&&(t+=" ".concat(this.cssPrefix,"-level-").concat(e)),t+=this.condition.enabled?"":" ".concat(this.cssPrefix,"-disabled"),this.condition.enabled&&(t+=this.condition.isReadOnly()?" ".concat(this.cssPrefix,"-readonly"):"")}return t},e.prototype.coreRender=function(t){var e=this,n=(0,i.uC)(this.element).addClass(this.getClassesToAdd()).addClass(s.z.getMobileCssClass()).data("group-row","").addChildElement(this.renderCheckbox()).addChildElement(this.renderConjunction()),o=this.condition.getLevel();o>0&&n.addClass("".concat(this.cssPrefix,"-level-").concat(o)),this.buildGroupElements(n,this.getGroupTitle()),this.panel.options.accentActiveCondition&&n.on("click",(function(t){e.panel.toggleConditionPicked(e.condition),e.adjustButtonsVisibility(),s.z.isMobileMode()||n.toDOM().dispatchEvent((0,i.sJ)("mouseenter"))})),n.addChildElement(this.renderButtonsBlock()),s.z.isMobileMode()||n.on("mouseenter",(function(t){return e.isMouseOverBlock=!0,e.enterButtonBlock(),t.stopPropagation(),!1})).on("mouseleave",(function(t){return e.isMouseOverBlock=!1,!e.keepShowingButtons&&(0,i.uC)(e.buttonsBlock).isVisible()&&e.leaveButtonBlock(),t.stopPropagation(),!1}))},e.prototype.getGroupTitle=function(){var t;return this.isRoot&&!s.z.isMobileMode()?(t=n.ag.getText("RootConditionGroupTitle"))||(t=n.ag.getText("RootPredicateTitle")):(t=n.ag.getText("ConditionGroupTitle"))||(t=n.ag.getText("PredicateTitle")),t},e.prototype.buildGroupElements=function(t,e){var i=this,r=e.indexOf("{lt}");if(r<0)t.addText(n.ag.getText("ErrIncorrectGroupTitleFormat")),t.addClass("".concat(this.cssPrefix,"-error"));else{r>0&&t.addChild("span",(function(t){t.addClass("".concat(i.cssPrefix,"-grelement")).addText(e.substring(0,r))}));var s=o.equtils.linkTypeToStr(this.condition.linkType),a=n.P6.findItemById(o.eqconsts.predicateLinkTypeList,s);a||(a=o.eqconsts.predicateLinkTypeList[0]),this.isEditable()?V(t.toDOM()).onGetMenu((function(){return i.getLinkTypeMenu()})).onItemSelected((function(t){i.condition.linkType=o.equtils.strToLinkType(t),i.condition.fireChangedEvent()})).addText(n.ag.getText(a.key)).title(n.ag.getText(a.key)).addClass("".concat(this.cssPrefix,"-grelement")):t.addChild("span",(function(t){t.text(n.ag.getText(a.key)).title(n.ag.getText(a.key)).addClass("".concat(i.cssPrefix,"-grelement"))})),t.addChild("span",(function(t){t.addClass("".concat(i.cssPrefix,"-grelement")).addText(e.substring(r+4))}))}},e.prototype.getConditionMenu=function(){return this.panel.getConditionGroupMenu(null==this.condition.getParent())},e.prototype.getLinkTypeMenu=function(){return this.panel.getLinkTypeMenu()},e.prototype.renderConjunction=function(){return this.isRoot?null:t.prototype.renderConjunction.call(this)},e.prototype.renderCheckbox=function(){return this.isRoot?null:t.prototype.renderCheckbox.call(this)},e.prototype.leaveButtonBlock=function(){this.panel.options.alwaysShowButtonsInGroups||this.isConditionActive()&&this.panel.options.accentActiveCondition||this.hideButtons()},e.prototype.adjustButtonsVisibility=function(){(this.panel.options.alwaysShowButtonsInGroups||this.panel.options.accentActiveCondition&&this.isConditionActive())&&this.showButtons()},e}(j),K=function(){function t(t){this.element=t||(0,i.uC)("div").toDOM()}return t.prototype.refresh=function(){this.render()},t.prototype.render=function(t){var e=this;return void 0===t&&(t=!1),this.labelElement=this.renderLabelElement(),(0,i.uC)(this.element).html("").addClass(this.getClassesToAdd()).addClass(s.z.getMobileCssClass()).addChildElement(this.labelElement),this.isEditable()&&(this.renderEditor(),t&&setTimeout((function(){return e.showEditor()}),50)),this.element},t.prototype.isEditable=function(){return!0},t.prototype.renderLabelElement=function(){var t=this,e=this.getLabelText();return this.isEditable()?(0,i.uC)("a").attr("href","javascript:void(0)").title(e).text(e).on("click",(function(e){return e.preventDefault(),t.showEditor(),!1})).toDOM():(0,i.uC)("span").title(e).text(e).toDOM()},t.prototype.getClassesToAdd=function(){return""},t.prototype.getLabelText=function(){return this.getEmptyText()},t.prototype.getEmptyText=function(){return"<empty>"},t}(),$=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Z=function(t){function e(e,n,o,i){var r=t.call(this,i)||this;return r.panel=e,r.expression=n,r.valueEditor=o,r}return $(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-qp"},enumerable:!1,configurable:!0}),e.prototype.render=function(e){return void 0===e&&(e=!1),t.prototype.render.call(this,e),this.panel.options.onExpressionRendered&&this.panel.options.onExpressionRendered(this.expression,this.element),this.element},e.prototype.getContext=function(){return this.panel.getContext()},e.prototype.isReadOnly=function(){var t=this.expression.getParent();return!t.enabled||t.isReadOnly()},e.prototype.isEditable=function(){return!this.isReadOnly()},e.prototype.getClassesToAdd=function(){return"".concat(this.cssPrefix,"-condelement ").concat(this.cssPrefix,"-valueelement")},e.prototype.getLabelText=function(){return this.expression.isEmpty()?this.getEmptyText():this.expression.value},e.prototype.getEmptyText=function(){return this.panel.options.emptyTextValue||n.ag.getText("MsgEmptyScalarValue")},e.prototype.setValue=function(t,e){this.expression.setValue(t),e||this.expression.getParent().fireChangedEvent(o.ConditionPart.Value)},e.prototype.getValue=function(){return this.expression.value},e.prototype.validateInput=function(t){return{success:!0,value:t}},e.prototype.showValidationError=function(t,e){this.getContext().throwError({action:"ui.validation",text:t})},e.prototype.isEmptyValue=function(){var t=this.getValue();return null==t||!t},e.prototype.adjustWidth=function(){},e}(K),tt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),et=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return tt(e,t),e.prototype.renderEditor=function(){var t=this;this.inputBuilder=(0,i.uC)("input").hide().addClass("".concat(this.cssPrefix,"-ve-editbox")).type("text").on("blur",(function(e){if(t.inputBuilder.isVisible()&&!t.dontProcessBlur){var n=t.validateInput(t.inputElement.value);return n.success?(t.setValue(t.inputElement.value),t.closeEditor()):(t.dontProcessBlur=!0,t.inputElement.focus(),setTimeout((function(){t.dontProcessBlur=!1}),200),t.showValidationError(n.message,e.target)),e.stopPropagation(),!1}})).on("keydown",(function(e){if(27===e.keyCode)return t.closeEditor(),e.stopPropagation(),!1;if(13===e.keyCode&&t.inputBuilder.isVisible()){t.dontProcessBlur=!0;var n=t.validateInput(t.inputElement.value);return n.success?(t.setValue(t.inputElement.value),t.closeEditor(),t.dontProcessBlur=!1):(t.inputElement.focus(),t.showValidationError(n.message,e.target),setTimeout((function(){t.dontProcessBlur=!1}),200)),e.stopPropagation(),!1}})),this.inputElement=this.inputBuilder.toDOM(),(0,i.uC)(this.element).addChildElement(this.inputElement)},e.prototype.showEditor=function(){var t=200;if(!s.z.isMobileMode()){var e=this.element.offsetLeft,n=this.element.offsetWidth>t?this.element.offsetWidth:t,o=this.element.parentElement.clientWidth-e-55;this.inputBuilder.removeStyle("left").removeStyle("right"),o<t?this.inputBuilder.setStyle("right","55px").setStyle("width","".concat(t,"px")):o<n?this.inputBuilder.setStyle("left","".concat(e,"px")).setStyle("width","".concat(o,"px")):this.inputBuilder.setStyle("left","".concat(e,"px")).setStyle("width","".concat(n,"px"))}(0,i.uC)(this.labelElement).hide(),this.inputBuilder.value(this.getValue()).show(),this.inputElement.focus()},e.prototype.closeEditor=function(){this.inputBuilder.hide(),(0,i.uC)(this.labelElement).show(),this.labelElement.focus()},e.prototype.validateInput=function(t){this.inputBuilder.removeClass("eqjs-invalid");var e={success:!0,value:t};return this.expression.kind==o.DataKind.List?this.validateListInput(t,e):this.validateScalarInput(t,e),e},e.prototype.validateListInput=function(t,e){for(var n=0,o=t.split(/\s*,\s*/);n<o.length;n++){var i=o[n];if(this.validateScalarInput(i,e),!e.success)return}},e.prototype.validateScalarInput=function(t,e){if(t&&n.P6.isNumericType(this.expression.dataType)){var o=+t;isNaN(o)&&(e.success=!1,e.message='"'+t+'" '+n.ag.getText("ErrNotNumber")),n.P6.isIntType(this.expression.dataType)&&o!=parseInt(t,10)&&(e.success=!1,e.message='"'+t+'" '+n.ag.getText("ErrIncorrectInteger"))}},e.prototype.showValidationError=function(e,n){t.prototype.showValidationError.call(this,e,n),this.inputBuilder.addClass("eqjs-invalid")},e.prototype.isEditable=function(){return t.prototype.isEditable.call(this)&&(this.panel.options.editableParts&p.Value)===p.Value},e}(Z),nt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ot=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.menuItemsList=[],e.showWhenReady=!1,e}return nt(e,t),e.prototype.isEditable=function(){return!this.isReadOnly()&&(this.panel.options.editableParts&p.Value)===p.Value},e.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.adjustNewValue(t);if(t!==this.expression.value){var i=this.getValueText(t);this.expression.setContent(n,i),e||this.expression.getParent().fireChangedEvent(o.ConditionPart.Value)}return!0},e.prototype.getValueText=function(t){var e="";if(Array.isArray(t))for(var n=0,o=this.menuItemsList;n<o.length;n++){var i=o[n];t.indexOf(i.id)>=0&&(e+=i.text+",")}else for(var r=0,s=this.menuItemsList;r<s.length;r++){(i=s[r]).id===t&&(e+=i.text+",")}return e&&(e=e.substring(0,e.length-1)),e},e.prototype.getEmptyText=function(){return this.panel.options.emptyTextList||n.ag.getText("MsgEmptyListValue")},e.prototype.getListName=function(){return this.valueEditor.name},e.prototype.renderEditor=function(){var t=this;this.fillMenuItemsList((function(){t.renderMenuBlock()}))},e.prototype.getLabelText=function(){return this.expression.isEmpty()?this.getEmptyText():this.expression.getText()},e.prototype.showLoader=function(){},e.prototype.hideLoader=function(){},e.prototype.showEditor=function(){var t=this;this.menu?this.menu.showMenu({anchor:this.labelElement,selectedIds:this.getValuesAsArray(),itemSelectedCallback:function(e,n){if(t.menu.options.multiselect){if(n){for(var o=[],i=n.length,r=0;r<i;r++)o.push(n[r].id);t.setValue(o)}}else t.setValue(e.id);return!1}}):(this.showWhenReady=!0,this.showLoader())},e.prototype.closeEditor=function(){this.menu.hideMenu()},e.prototype.renderMenuBlock=function(){var t=!1;this.expression&&(t=this.expression.kind===o.DataKind.List);var e=this.panel,i={items:this.menuItemsList,multiselect:t,container:e?e.options.menuContainer:null,showSelected:!0,showItemIds:!!e&&e.options.showIdsForListItems};e&&n.P6.assignDeep(i,e.options.menuOptions);var r=this.element.id;r&&(i.id=r+"-EditorMenu"),e&&(i.domWriteItemsId=e.options.domWriteItemsId),i.buttons={submit:n.ag.getText("ButtonApply"),cancel:n.ag.getText("ButtonCancel")},this.menu=new u(i)},e.prototype.getValuesAsArray=function(){if(this.expression.kind!==o.DataKind.List)return[this.expression.value];if(this.expression.value){var t=this.expression.value.match(/"[^"\\]*(?:\\.[^"\\]*)*"|[^,]+/g);return t?t.map((function(t){return'"'==t.charAt(0)&&'"'==t.charAt(t.length-1)?(t=t.substring(1,t.length-1)).replace(/\"/g,'"'):t})):[]}return[]},e.prototype.adjustNewValue=function(t){return Array.isArray(t)?t.map((function(t){return t.indexOf(",")>=0?'"'+(t=t.replace(/"/g,'"'))+'"':t})).join(","):t},e.prototype.fillMenuItemsList=function(t){this.menuItemsList=this.valueEditor.values,t&&t()},e.prototype.takeDefaultValue=function(){if(this.menuItemsList)for(var t=this.menuItemsList.length,e=this.valueEditor.defValue,n=0;n<t;n++){var o=this.menuItemsList[n];if(o.isDefault||e==o.id){this.setValue(o.id,!0);break}}},e}(Z),it=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isLoading=!1,e.onClickTemp=null,e}return nt(e,t),e.prototype.renderEditor=function(){var t=this;this.isLoading||(this.isLoading=!0,this.fillMenuItemsList((function(){if(t.isLoading=!1,t.isEmptyValue()&&t.takeDefaultValue(),!t.expression.isEmpty()&&t.expression._isDefaultValue){var e=t.getValueText(t.expression.value);t.expression.setContent(t.expression.value,e),t.expression.getParent().fireChangedEvent()}t.renderMenuBlock(),t.showWhenReady&&(t.showWhenReady=!1,t.hideLoader(),t.showEditor())})))},e.prototype.showLoader=function(){this.labelElement.style.display="none",this.loaderElement||(this.loaderElement=(0,i.uC)("div",this.element).addClass("".concat(this.cssPrefix,"-ve-loader")).toDOM()),this.loaderElement.style.display="block"},e.prototype.hideLoader=function(){this.loaderElement.style.display="none",this.labelElement.removeAttribute("style")},e.prototype.fillMenuItemsList=function(t){var e=this,n=this.getListName(),i=this.panel.getContext().getListRequestHandler();o.eqconsts.constLists[n]?(this.menuItemsList=o.eqconsts.constLists[n],t&&t()):i&&i({listName:n,editorId:this.valueEditor.id,editorParams:this.valueEditor.extraParams,value:this.getValue()},(function(n){e.menuItemsList=n,t&&t()}))},e}(ot),rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return nt(e,t),e.prototype.fillMenuItemsList=function(t){var e=this,n=this.panel.getContext(),o=(this.valueEditor,n.getListRequestHandler());o&&o({listName:"SQL",editorId:this.valueEditor.id,editorParams:this.valueEditor.extraParams,value:this.getValue()},(function(n){e.menuItemsList=n,t&&t()}))},e}(it),st=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),at=function(t){function e(e,n,o,i){var r=t.call(this,e,n,null,i)||this;return r.menu=o,r}return st(e,t),e.prototype.renderEditor=function(){},e.prototype.getLabelText=function(){var t=this.panel.getContext().getModel(),e=this.expression.value,n=e?t.getAttributeByIdSafe(e):null,o=this.panel.options.attrElementFormat;return n?t.getAttributeText(n,o):this.getEmptyText()},e.prototype.setValue=function(e,n){void 0===n&&(n=!1),n=n&&e!==this.expression.value;var i=t.prototype.setValue.call(this,e,!0);return n||this.expression.getParent().fireChangedEvent(o.ConditionPart.EntityAttr|o.ConditionPart.Operator),i},e.prototype.isEditable=function(){return!this.isReadOnly()&&(this.panel.options.editableParts&p.Attribute)===p.Attribute},e.prototype.getEmptyText=function(){return this.panel.options.emptyTextAttribute||n.ag.getText("MsgEmptyAttrValue")},e.prototype.getClassesToAdd=function(){return"".concat(this.cssPrefix,"-condelement ").concat(this.cssPrefix,"-attrelement")},e.prototype.adjustWidth=function(){s.z.isMobileMode()||this.element.clientWidth>this.element.parentElement.clientWidth/2&&(0,i.uC)(this.element).addClass("".concat(this.cssPrefix,"-attrelement-wide"))},e}(ot),lt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ct=function(t){function e(e){return t.call(this,e)||this}return lt(e,t),e.prototype.showEditor=function(){var t=this,e=this.getMenu();e&&e.showMenu({anchor:this.labelElement,itemSelectedCallback:function(e){return t.itemSelected(e.id),!1}})},e.prototype.closeEditor=function(){var t=this.getMenu();t&&t.hideMenu()},e}(K),ut=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),dt=function(t){function e(e,n,o){var i=t.call(this,o)||this;return i.panel=e,i.menu=n,i}return ut(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-qp"},enumerable:!1,configurable:!0}),e.prototype.getLabelText=function(){return n.ag.getText("CmdClickToAddCondition")},e.prototype.getClassesToAdd=function(){return"".concat(r.YR,"-addrow ").concat(this.cssPrefix,"-addrow")},e.prototype.isEditable=function(){return t.prototype.isEditable.call(this)&&(this.panel.options.editableParts&p.Addition)===p.Addition},e.prototype.renderLabelElement=function(){var t=this,e=this.getLabelText();return this.isEditable()?this.labelElement=(0,i.uC)("a").attr("href","javascript:void(0)").title(e).text(e).on("click",(function(e){return e.preventDefault(),t.showEditor(),!1})).toDOM():this.labelElement=(0,i.uC)("div").toDOM(),this.labelElement},e.prototype.renderEditor=function(){},e.prototype.itemSelected=function(t){var e=this.panel.getQuery(),n={parent:e.getRootCondition(),attributeId:t},i=e.addSimpleCondition(n);i&&e.fireConditionsChangedEvent(o.QueryChangeAction.Add,i)},e.prototype.getMenu=function(){return this.menu},e}(ct),ht=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),pt=function(t){function e(e,n,o,i){var r=t.call(this,i)||this;return r.panel=e,r.condition=n,r.displayedText=o,r}return ht(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-qp"},enumerable:!1,configurable:!0}),e.prototype.renderEditor=function(){var t=this,e=this.panel.getContext().getModel(),i=this.panel.getQuery(),r=[],s=(this.condition&&this.condition.expressions&&this.condition.expressions[0]?this.condition.expressions[0].value:null)?e.getAttributeById(this.condition.expressions[0].value):null;s&&s.operators&&s.operators.forEach((function(s){var a=e.getOperatorById(s),l=function(t){return t.defaultOperand.kind==o.DataKind.Query}(a);!i.isEx()&&l||!a||t.panel.options.isSubQuery&&l||r.push({id:s,text:n.ag.getText("Operators",s,"caption")||a.caption})}));var a={items:r,adjustHeight:this.panel.options.adjustEntitiesMenuHeight,id:n.P6.generateId("opmn"),domWriteItemsId:this.panel.options.domWriteItemsId};n.P6.assign(a,this.panel.options.menuOptions),this.menu=new u(a)},e.prototype.getLabelText=function(){return this.displayedText},e.prototype.getEmptyText=function(){return this.panel.options.emptyTextOperator||n.ag.getText("MsgEmptyOperator")},e.prototype.getClassesToAdd=function(){return"".concat(this.cssPrefix,"-condelement ").concat(this.cssPrefix,"-operelement")},e.prototype.isEditable=function(){return this.condition.enabled&&!this.condition.isReadOnly()&&(this.panel.options.editableParts&p.Operator)===p.Operator},e.prototype.itemSelected=function(t){this.condition.setOperatorId(t),this.condition.fireChangedEvent(o.ConditionPart.Operator)},e.prototype.getMenu=function(){return this.menu},e}(ct),ft=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),gt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dtp=null,e.internalDateFormat="yyyy-MM-dd",e.internalTimeFormat="HH:mm",e}return ft(e,t),e.prototype.renderEditor=function(){},e.prototype.showEditor=function(){var t=this;if(!this.dtp){var e={yearRange:this.panel.options.yearRange,showCalendar:this.expression.dataType!==n.g.Time,showTimePicker:this.expression.dataType!==n.g.Date,oneClickDateSelection:this.panel.options.oneClickDateSelection,showDateTimeInput:this.panel.options.showDateTimeInput,onApply:function(e){var n=t.convertToInternalFormat(e);t.setValue(n),t.dtp=null,setTimeout((function(){return t.labelElement.focus()}),100)},onCancel:function(){t.labelElement.innerText=t.getLabelText(),t.dtp=null,setTimeout((function(){return t.labelElement.focus()}),100)},onDateTimeChanged:function(e){var o=n.ag.dateTimeToStr(e,t.expression.dataType);t.labelElement.innerText=o}};this.dtp=this.panel.options.dateTimePickerResolver?this.panel.options.dateTimePickerResolver(e):new i.M(e);var o=this.expression.getModel(),r=this.expression.value,s=new Date;s=this.expression.dataType!=n.g.Time&&o.isDateMacro(r)?o.getDateMacroValue(r):this.expression.dataType==n.g.Time&&o.isTimeMacro(r)?o.getTimeMacroValue(r):this.convertFromInternalFormat(r),this.dtp.setDateTime(s),this.dtp.show(this.element)}},e.prototype.closeEditor=function(){this.dtp.cancel(),this.dtp=null},e.prototype.getLabelText=function(){if(!this.expression.value)return this.getEmptyText();var t=this.expression.value,e=this.expression.getModel();if(!e)throw new Error("DataModel is not defined for "+this.expression.value);if(e.isDateMacro(t)||e.isTimeMacro(t)){var o=t.substring(3,t.length-2),i=n.ag.getText(o);return i||"${{Today}}"}return n.ag.dateTimeToStr(this.convertFromInternalFormat(t),this.expression.dataType)},e.prototype.isEditable=function(){return t.prototype.isEditable.call(this)&&(this.panel.options.editableParts&p.Value)===p.Value},e.prototype.convertFromInternalFormat=function(t){return n.P6.strToDateTime(t,this.internalDateFormat+" "+this.internalTimeFormat)},e.prototype.convertToInternalFormat=function(t){return n.P6.dateTimeToStr(t,this.internalDateFormat+" "+this.internalTimeFormat)},e}(Z),mt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),yt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return mt(e,t),e.prototype.renderEditor=function(){this.dialogBlockBody=(0,i.uC)("div").addClass("kfrm-form").toDOM(),this.createEntitiesMenu(),this.renderColumnBlock(),this.renderQueryPanelBlock()},e.prototype.isEditable=function(){return t.prototype.isEditable.call(this)&&(this.panel.options.editableParts&p.Value)===p.Value},e.prototype.setValue=function(t,e){t instanceof o.Query&&(this.expression.subQuery=t,e||this.expression.getParent().fireChangedEvent(o.ConditionPart.Value))},e.prototype.createEntitiesMenu=function(){var t=this.getContext().getModel(),e=this.expression.dataType;if(this.colEntitiesList=t.getEntitiesTreeWithFilter((function(t,n){return n?n.useInConditions&&n.dataType===e:t.attributes&&t.useInConditions})),!t||t.isEmpty())return null;var o=this.element.getAttribute("data-id");o&&(o+="-SubColumnMenu");var i={items:this.colEntitiesList,adjustHeight:this.panel.options.adjustEntitiesMenuHeight,id:o,isSubQuery:!0,domWriteItemsId:this.panel.options.domWriteItemsId};n.P6.assign(i,this.panel.options.menuOptions),this.colEntitiesMenu=new u(i)},e.prototype.renderColumnBlock=function(){var t=this;this.columnBlock=(0,i.uC)("div",this.dialogBlockBody).addClass("kfrm-field").addChild("label",(function(t){return t.addText(n.ag.getText("SubQueryColumnTitle"))})).addChild("a",(function(e){return t.columnElement=e.attr("href","javascript:void(0)").on("click",(function(e){t.colEntitiesMenu.showMenu({anchor:t.columnElement,selectedIds:null,itemSelectedCallback:function(e,n){var o=e.id;return t.setResultAttributeId(o),!1}})})).toDOM()})).toDOM()},e.prototype.getEmptyText=function(){return this.panel.options.emptyTextValue||n.ag.getText("MsgSubQueryValue")},e.prototype.renderQueryPanelBlock=function(){var t=(0,i.uC)("div",this.dialogBlockBody).addClass("kfrm-field").addChild("label",(function(t){return t.addText(n.ag.getText("SubQueryQueryPanelCaption"))})).toDOM();this.queryPanelBlock=(0,i.uC)("div",t).toDOM();var e=this.element.getAttribute("data-id");e&&(this.queryPanelBlock.id=e+"-SubQueryPanel")},e.prototype.setResultAttributeId=function(t){var e=this.getContext().getModel().getAttributeById(t);if(e){var n=this.getSubQuery(),i=n.getColumns(),r=void 0;if(i.length>0)(r=i[0]).expr.setValue(t),r.expr.dataType=e.dataType,r.fireChangedEvent();else{(r=n.createColumn()).sorting=o.SortDirection.None,r.sortIndex=-1;var s=new o.Expression(r);s.setValue(t),s.tag=o.ExprTag.EntityAttribute,s.kind=o.DataKind.Attribute,s.dataType=e.dataType,r.expr=s,i.push(r),n.fireColumnsChangedEvent(o.QueryChangeAction.Add,r)}this.columnElement.innerText=this.getAttributeText(e)}},e.prototype.getSubQuery=function(){return this.queryPanel.getQuery()},e.prototype.getAttributeText=function(t){if(!t)return n.ag.getText("SubQueryEmptyColumn");var e=n.ag.getText("Attributes",t.id);e||(e=t.caption);var o=this.panel.options.attrElementFormat;if(!o)return e;var i=o.replace(new RegExp("{attr}","g"),e),r=this.getContext().getModel().getFullEntityPathByAttr(t.id,".");return i.replace(new RegExp("{entity}","g"),r)},e.prototype.showEditor=function(){var t=this,e=this.panel,i=this.getContext();this.queryPanelBlock.innerHTML="";var r=i.createQuery();this.expression.subQuery&&r.loadFromData(this.expression.subQuery.toJSONData());var s=n.P6.assign({},e.options);s.isSubQuery=!0,s.showAddRow=!0,s.menuContainer=document.body,s.menuOptions.isSubQuery=!0,s.entitiesListFilter=function(t,n){if(e.options.entitiesListFilter){var o=n||{};o.isSubQuery=!0,e.options.entitiesListFilter(t,o)}},this.queryPanel=new xt(this.queryPanelBlock,r),this.queryPanel.init(this.panel.getContext(),s);var a=null,l=r.getColumns();if(0==l.length){var c=this.expression.getParent();if(c.expressions.length>0){var u=c.expressions[0];a=u.tag==o.ExprTag.EntityAttribute||u.kind==o.DataKind.Attribute?u.value:null}}else a=l[0].expr.value;a?this.setResultAttributeId(a):this.columnElement.innerText=n.ag.getText("SubQueryEmptyColumn"),this.queryPanel.refresh();var d=this.queryPanelBlock.querySelector(".eqjs-qp-conditions-root");d&&(d.style.minHeight="100px"),this.panel.getContext().getServices().getDialogService().open({title:n.ag.getText("SubQueryDialogTitle"),body:this.dialogBlockBody,width:this.panel.options.subQueryDialogWidth,closable:!0,cancelable:!0,onSubmit:function(){var e=t.queryPanel.getQuery();return!!e.tryValidate({checkExpressions:!0})&&(t.setValue(e),!0)}})},e.prototype.closeEditor=function(){},e}(Z),vt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ct=function(t){function e(e,n,i,r){var s=t.call(this,e,n,i,r)||this;return s.expression.tag=o.ExprTag.ParentColumn,s}return vt(e,t),e.prototype.fillMenuItemsList=function(t){var e=this.panel.getQuery().getParentQuery(),n=this.expression.getParent().expressions[0].dataType;this.menuItemsList=e.getColumns().filter((function(t){return t.expr.dataType==n})).map((function(t){return{id:t.id,text:t.caption}})),t&&t()},e}(it),bt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),xt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.options={editableParts:p.All,isSubQuery:!1,activeCondition:null,entitiesPopupHandler:null,entitiesListFilter:null,menuContainer:document.body,showRootRow:!0,showAddRow:!0,showCheckboxes:!1,allowParameterization:!1,allowInJoinConditions:!1,showPoweredBy:!1,buttons:{condition:null,group:null},alwaysShowButtonsInGroups:!1,alwaysShowButtonsInConditions:!1,showConjunctions:!0,accentActiveCondition:!0,activateRootOnStart:!0,yearRange:"c-10:c+10",oneClickDateSelection:!0,showDateTimeInput:!1,attrElementFormat:"{entity} {attr}",menuOptions:{showSearchBoxAfter:30,searchBoxAutoFocus:!0,activateOnMouseOver:!0,itemRenderedCallback:null},allowDragDrop:!0,attrPlacement:0,sortEntities:!1,subQueryDialogWidth:600,subQueryDialogHeight:300,dialogZIndex:1e5,numberListSeparators:[",",";"],autoEditNewCondition:!1,onConditionRendered:null,onGetConditionRenderer:null,onGetExpressionRenderer:null,onGetOperatorRenderer:null,onOperatorRendered:null,onGetAddRowRenderer:null,defaultQuery:null,showIndicatorOnLoad:!0},r.customQuery=null,r.landingSlot=(0,i.uC)("div").addClass("".concat(r.cssPrefix,"-cond-landing-slot")).addChildElement((0,i.uC)("div").toDOM()).toDOM(),r.slot.classList.contains("".concat(r.cssPrefix,"-panel"))||r.slot.classList.add("".concat(r.cssPrefix,"-panel")),r.group=o.WidgetGroup.Query,n&&(r.customQuery=n),r}return bt(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-qp"},enumerable:!1,configurable:!0}),e.prototype.getWidgetType=function(){return"queryPanel"},e.prototype.init=function(e,n){var s=this;if(t.prototype.init.call(this,e,n),this.setOptions(n),this.renderProgressBlock(),this.detachQueryObserver(),this.attachQueryObserver(),i.Yy.removeDropContainer(this.slot),this.options.allowDragDrop){var a=this.getContext().getModel();i.Yy.registerDropContainer({element:this.slot,scopes:["entityAttr"],onDragEnter:function(t,e){s.slot.classList.add("".concat(r.YR,"-drophover")),e.dragImage.classList.add("eqjs-sortable-helper"),s.showLandingSlot();var n=e.data.attrId;a.checkAttrProperty(n,"useInConditions")||(e.dropEffect=i.KX.Forbid)},onDragOver:function(t,e){},onDragLeave:function(t,e){e.dragImage.classList.remove("eqjs-sortable-helper"),e.dragImage.style.removeProperty("width"),s.slot.classList.remove("".concat(r.YR,"-drophover")),s.hideLangindSlot()},onDrop:function(t,e){var n=s.getQuery(),i={parent:n.getRootCondition(),attributeId:e.data.attrId},r=n.addSimpleCondition(i);r&&n.fireConditionsChangedEvent(o.QueryChangeAction.Add,r)}})}},e.prototype.destroyCore=function(){i.Yy.removeDropContainer(this.slot),this.detachQueryObserver(),this.slot.innerHTML=""},e.prototype.getEntitiesMenu=function(){return this.entitiesMenu},e.prototype.getConditionMenu=function(){return this.conditionMenu},e.prototype.getLinkTypeMenu=function(){return this.linkTypeMenu},e.prototype.getConditionGroupMenu=function(t){return void 0===t&&(t=!1),t?this.rootGroupMenu:this.groupMenu},e.prototype.attachQueryObserver=function(){var t=this,e=this.getQuery();this.queryEventCallbackId=e.addChangedCallback((function(e){var n=e.data;if(n&&(n.part==o.QueryChangePart.Conditions||n.part==o.QueryChangePart.All)){var i=document.activeElement,s=t.slot.contains(i)||i==document.body;switch(n.action){case o.QueryChangeAction.Modify:var a=n.changee,l=function(e,i){var a=t.slot.querySelector("div[data-id=".concat(e.id,"]"));if(a){i=i&&(n.condPart&o.ConditionPart.Operator)===o.ConditionPart.Operator&&e.expressions.length>1&&(e.expressions[1]._isDefaultValue||""==e.expressions[1].value||null==e.expressions[1].value);var l=a.classList.contains("active"),c=t.getConditionRenderer(e,a);if(c){var u=c.render(i);if(l&&t.toggleConditionPicked(e),s&&!i){var d=u.querySelector("a")||u.querySelector(".eqjs-qp-condition-button");d&&(0,r.n6)(d)}}}},c=t.options.autoEditNewCondition;Array.isArray(a)?(a.forEach((function(t){return l(t,c)})),c=!1):l(a,c);break;case o.QueryChangeAction.Add:a=n.changee;var u=function(e){var n=t.getConditionRenderer(e);if(n){var o=e.getParent(),i=t.slot.querySelector("div[data-id=".concat(o.id,"]"));if(i){var r=i.lastChild;if(r){var a=n.render(t.options.autoEditNewCondition);r.appendChild(a),a.scrollIntoView(!1),s&&!t.options.autoEditNewCondition&&a.querySelector("a").focus()}}}};Array.isArray(a)?a.forEach((function(t){return u(t)})):u(a);break;case o.QueryChangeAction.Delete:a=n.changee;var d=function(e){var n=t.slot.querySelector("div[data-id=".concat(e.id,"]"));if(n){var o=t.slot.querySelector("div[data-id=".concat(e.getParent().id,"] > .eqjs-qp-row-group")),i=n.nextSibling,r=n.previousSibling;if(n.parentElement.removeChild(n),s){var a=i||r||o,l=a.querySelector("a")||a.querySelector(".eqjs-qp-condition-button");l&&l.focus()}}};Array.isArray(a)?a.forEach((function(t){return d(t)})):d(a);break;default:t.refresh()}}}))},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.getQuery=function(){return this.customQuery?this.customQuery:this.context.getQuery()},e.prototype.refreshCore=function(){this.clear(),this.render()},e.prototype.setOptions=function(t){n.P6.assignDeep(this.options,t),this.options.dateFormatValue&&n.ag.updateLocaleSettings({editDateFormat:this.options.dateFormatValue}),this.options.dateFormatDisplay&&n.ag.updateLocaleSettings({shortDateFormat:this.options.dateFormatDisplay}),void 0===this.options.editableParts&&(this.options.editableParts=p.All),s.z.isMobileMode()&&(this.options.buttons=this.options.buttons||{},this.options.buttons.condition=["menu"],this.options.buttons.group=["menu"])},e.prototype.clear=function(){this.slot.innerHTML=""},e.prototype.render=function(){try{this.entitiesMenu=this.createEntitiesMenu(),this.createConditionMenus(),this.createLinkTypeMenu(),this.rootContainer=(0,i.uC)("div",this.slot).toDOM(),(0,i.uC)(this.slot).removeClass(r.XD).addClass(s.z.getMobileCssClass());var t=this.getQuery().getRootCondition(),e=this.getConditionRenderer(t,this.rootContainer);if(e&&e.render(),this.options.showAddRow){this.addRowElement=(0,i.uC)("div",this.slot).toDOM();var n=this.getAddRowRenderer(this.addRowElement);n&&n.render()}}catch(t){var o=t;this.context.throwError({action:"QueryPanel rendering",text:o.message,sourceError:o})}},e.prototype.getConditionRenderer=function(t,e){var n;if(this.options.onGetConditionRenderer&&(n=this.options.onGetConditionRenderer(t,e)))return n;switch(t.tag){case o.CondTag.Simple:return new j(this,t,e);case o.CondTag.Group:return new J(this,t,e)}return null},e.prototype.getExpressionRenderer=function(t,e){if(!t)throw"Expression is not defined in the condition";var i,r,s=this.getContext().getModel(),a=t.getParent(),l=s.getOperatorById(a.getOperatorId()),c=s.getAttributeByIdSafe(a.expressions[0].value),u=s.getOperand(c,l,t.getIndex());r=(i=u&&u.editor&&u.editor.tag!==o.EqEditorTag.Unknown?u.editor:c&&c.defaultEditor?c.defaultEditor:new o.EqValueEditor).tag;var d=t.dataType;if(d==n.g.Unknown&&(d=c.dataType),t.kind===o.DataKind.Attribute){if(0===t.getIndex())return new at(this,t,this.entitiesMenu,e);var h=this.createEntitiesMenu((function(t,e){return!e||e.useInConditions&&e.dataType===d}));return new at(this,t,h,e)}if(t.kind===o.DataKind.Query?r=o.EqEditorTag.SubQuery:t.kind===o.DataKind.Scalar?r!=o.EqEditorTag.Unknown||t.dataType!==n.g.Date&&t.dataType!==n.g.DateTime&&t.dataType!==n.g.Time||(r=o.EqEditorTag.DateTime):t.kind==o.DataKind.ParentColumn&&(r=o.EqEditorTag.BindToParentColumn),this.options.onGetExpressionRenderer){var p=this.options.onGetExpressionRenderer(this,t,i,e);if(p)return p}switch(r){case o.EqEditorTag.List:return new ot(this,t,i,e);case o.EqEditorTag.SqlList:return new rt(this,t,i,e);case o.EqEditorTag.CustomList:return new it(this,t,i,e);case o.EqEditorTag.DateTime:return new gt(this,t,i,e);case o.EqEditorTag.SubQuery:return new yt(this,t,i,e);case o.EqEditorTag.BindToParentColumn:return new Ct(this,t,i,e);default:return new et(this,t,i,e)}},e.prototype.getOperatorRenderer=function(t,e,n){var o;return this.options.onGetOperatorRenderer&&(o=this.options.onGetOperatorRenderer(t,e,n)),o||new pt(this,t,e,n)},e.prototype.getAddRowRenderer=function(t){var e;return this.options.onGetAddRowRenderer&&(e=this.options.onGetAddRowRenderer(t)),e||new dt(this,this.entitiesMenu,t)},e.prototype.createEntitiesMenu=function(t){var e=this.getContext().getModel();if(!e||e.isEmpty())return null;var o=this.slot.id||"eq-querypanel";o+="-EntitiesMenu";var i={items:e.getEntitiesTree({addUIC:!0,addUIR:!1,addUIS:!1,attrPlacement:this.options.attrPlacement,sortEntities:this.options.sortEntities},t),adjustHeight:this.options.adjustEntitiesMenuHeight,id:o,domWriteItemsId:this.options.domWriteItemsId};return n.P6.assign(i,this.options.menuOptions),new u(i)},e.prototype.showEntitiesMenu=function(t){this.entitiesMenu.showMenu(t)},e.prototype.createConditionMenus=function(){var t=this.getQuery(),e=this.slot.id||"eq-querypanel";e+="-ConditionMenu";var o=[{id:"enable",text:n.ag.getText("MenuEnable")},{id:"delete",text:n.ag.getText("CmdDelete")}];t.isEx()&&((this.options.allowParameterization||this.options.allowInJoinConditions)&&o.push({id:"delimiter",text:"---"}),this.options.allowParameterization&&o.push({id:"param",text:n.ag.getText("MenuParameterization")}),this.options.allowInJoinConditions&&o.push({id:"inJoin",text:n.ag.getText("MenuJoinCond")}));var i={items:o,adjustHeight:this.options.adjustEntitiesMenuHeight,id:e,domWriteItemsId:this.options.domWriteItemsId,showSearchBoxAfter:100,showSelected:!0};n.P6.assign(i,this.options.menuOptions),this.conditionMenu=new u(i);e=this.slot.id||"eq-querypanel";e+="-GroupMenu";i={items:o=[{id:"enable",text:n.ag.getText("MenuEnable")},{id:"delete",text:n.ag.getText("CmdDelete")},{id:"delimiter",text:"---"},{id:"addCondition",text:n.ag.getText("CmdAddCondition")},{id:"addGroup",text:n.ag.getText("CmdAddCondGroup")}],adjustHeight:this.options.adjustEntitiesMenuHeight,id:e,domWriteItemsId:this.options.domWriteItemsId,showSearchBoxAfter:100,showSelected:!0};n.P6.assign(i,this.options.menuOptions),this.groupMenu=new u(i);e=this.slot.id||"eq-querypanel";e+="-RootGroupMenu";i={items:o=[{id:"addCondition",text:n.ag.getText("CmdAddCondition")},{id:"addGroup",text:n.ag.getText("CmdAddCondGroup")}],adjustHeight:this.options.adjustEntitiesMenuHeight,id:e,domWriteItemsId:this.options.domWriteItemsId,showSearchBoxAfter:100,showSelected:!0};n.P6.assign(i,this.options.menuOptions),this.rootGroupMenu=new u(i)},e.prototype.createLinkTypeMenu=function(){var t=this.slot.id;t&&(t+="-LinkTypeMenu");var e={items:o.eqconsts.predicateLinkTypeList.map((function(t){return{id:t.id,text:n.ag.getText(t.key)}})),adjustHeight:this.options.adjustEntitiesMenuHeight,id:t,domWriteItemsId:this.options.domWriteItemsId};n.P6.assign(e,this.options.menuOptions),this.linkTypeMenu=new u(e)},e.prototype.toggleConditionPicked=function(t,e){var n,o;void 0===e&&(e=void 0),t&&(n=this.slot.querySelector("div[data-id=".concat(t.id,"][data-condrow], div[data-id=").concat(t.id,"] > div[data-group-row]")))&&(o=n.classList.contains("active"));for(var r=this.slot.querySelectorAll(".".concat(this.cssPrefix,"-row")),s=0;s<r.length;s++){var a=r[s];a.hasAttribute("data-group-row")?this.options.alwaysShowButtonsInGroups||(0,i.uC)(a).data("show-buttons",null):this.options.alwaysShowButtonsInConditions||(0,i.uC)(a).data("show-buttons",null),(0,i.uC)(a).removeClass("active")}n&&!o&&(0,i.uC)(n).addClass("active").data("show-buttons","")},e.prototype.showLandingSlot=function(){var t=this.slot.querySelector(".eqjs-qp-conditions-root");t&&(t.appendChild(this.landingSlot),this.landingSlot.scrollIntoView({block:"center",behavior:"smooth"}))},e.prototype.hideLangindSlot=function(){this.landingSlot.parentElement&&this.landingSlot.parentElement.removeChild(this.landingSlot)},e.prototype.onProcessStartCore=function(){this.options.showIndicatorOnLoad&&(this.progressBlock.parentNode||this.slot.appendChild(this.progressBlock))},e.prototype.onProcessEndCore=function(){this.options.showIndicatorOnLoad&&this.progressBlock.parentNode&&this.slot.removeChild(this.progressBlock)},e.prototype.renderProgressBlock=function(){this.progressBlock=document.createElement("div"),this.progressBlock.classList.add("".concat(r.YR,"-progress-win8")),this.progressBlock.classList.add(s.z.getMobileCssClass()),this.progressBlock.innerHTML='<div class="wBall" id="wBall_1"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_2"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_3"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_4"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_5"><div class="wInnerBall"></div></div>'},e}(o.Widget),wt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Et=function(t){function e(e){var n=t.call(this,e)||this;return n.options={applyOnClose:!0,showApplyButton:!0,showClearButton:!0,queryPanel:{showAddRow:!0,showCheckboxes:!0,alwaysShowButtonsInGroups:!0}},n.headerClickListener=n.headerClickHandler.bind(n),n.group=o.WidgetGroup.Query,n}return wt(e,t),e.prototype.getWidgetType=function(){return"filterBar"},Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-fb"},enumerable:!1,configurable:!0}),e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.setOptions(n),this.destroyCore(),this.qpElement=(0,i.uC)("div").addClass("".concat(this.cssPrefix,"-querypanel")).toDOM(),this.queryPanel=new xt(this.qpElement),this.queryPanel.init(e,this.options.queryPanel||{}),this.attachQueryObserver()},e.prototype.setOptions=function(t){this.options=n.P6.assignDeep(this.options,t)},e.prototype.applyBtnClick=function(t){this.applyFilter()},e.prototype.clearBtnClick=function(t){this.clearFilter()},e.prototype.showQueryPanel=function(t){var e=this;(0,i.qw)(this.qpBlock,200,(function(){e.updateHeader(),t&&t()}))},e.prototype.hideQueryPanel=function(){var t=this;(0,i.iM)(this.qpBlock,200,(function(){t.updateHeader(),t.options.applyOnClose&&t.applyFilter()}))},e.prototype.headerClickHandler=function(t){t.preventDefault(),(0,i.uC)(this.qpBlock).isVisible()?this.hideQueryPanel():this.showQueryPanel()},e.prototype.updateHeader=function(){if(this.headerTextElement){var t="",e=this.getContext().getQuery();e&&(t=e.getConditionsText()),""==t&&(t=n.ag.getText("StrNoFilterDefined")),(0,i.uC)(this.headerTextElement).text(t).attr("title",t),!e||e.isEmptyConditions()?((0,i.uC)(this.headerTextElement).hide(),(0,i.uC)(this.headerLinkElement).show(),(0,i.uC)(this.qpBlock).isVisible()||((0,i.uC)(this.headerArrowBlock).hide(),this.headerElement.style.cursor="",this.headerElement.removeEventListener("click",this.headerClickListener))):(this.headerElement.style.cursor="pointer",this.headerElement.removeEventListener("click",this.headerClickListener),this.headerElement.addEventListener("click",this.headerClickListener),(0,i.uC)(this.headerTextElement).show(),(0,i.uC)(this.headerLinkElement).hide(),(0,i.uC)(this.headerArrowBlock).show()),(0,i.uC)(this.qpBlock).isVisible()?this.headerArrowElement.classList.add("".concat(this.cssPrefix,"-header-arrowUp")):this.headerArrowElement.classList.remove("".concat(this.cssPrefix,"-header-arrowUp")),this.textResize()}},e.prototype.render=function(){var t=this;(0,i.uC)(this.slot).addClass("".concat(this.cssPrefix,"-container")).addClass(s.z.getMobileCssClass()).addChild("div",(function(e){return t.headerElement=e.addClass("".concat(t.cssPrefix,"-header")).addChild("div",(function(e){return t.headerIconElement=e.addClass("".concat(t.cssPrefix,"-header-icon")).toDOM()})).addChild("div",(function(e){return t.headerTextBlock=e.addClass("".concat(t.cssPrefix,"-header-textblock")).addChild("div",(function(e){return t.headerTextElement=e.addClass("".concat(t.cssPrefix,"-header-text")).toDOM()})).addChild("div",(function(e){return t.headerLinkElement=e.addClass("".concat(t.cssPrefix,"-header-text ").concat(t.cssPrefix,"-header-link")).text(n.ag.getText("StrNoFilterClickToAdd")).hide().on("click",(function(){t.queryPanel.showEntitiesMenu({anchor:t.headerLinkElement,selectedIds:null,itemSelectedCallback:function(e,n){var i=e.id;t.showQueryPanel((function(){var e=t.getContext().getQuery(),n={parent:e.getRootCondition(),attributeId:i},r=e.addSimpleCondition(n);r&&e.fireConditionsChangedEvent(o.QueryChangeAction.Add,r)}))}})})).toDOM()})).toDOM()})).addChild("div",(function(e){return t.headerArrowBlock=e.addClass("".concat(t.cssPrefix,"-header-arrowblock")).addChild("div",(function(e){return t.headerArrowElement=e.addClass("".concat(t.cssPrefix,"-header-arrow")).toDOM()})).toDOM()})).toDOM()})).addChild("div",(function(e){return t.qpBlock=e.addClass("".concat(t.cssPrefix,"-querypanelblock")).addClass(s.z.getMobileCssClass()).hide().addChildElement(t.qpElement).toDOM()})),(this.options.showApplyButton||this.options.showClearButton)&&(this.buttonsBlock=(0,i.uC)("div",this.qpBlock).addClass("".concat(this.cssPrefix,"-buttonsblock")).addClass(s.z.getMobileCssClass()).toDOM()),this.options.showApplyButton&&(0,i.uC)("a",this.buttonsBlock).attr("href","javascript:void(0)").addClass("".concat(this.cssPrefix,"-button ").concat(this.cssPrefix,"-button-apply")).text(n.ag.getText("ButtonApply")).on("click",this.applyBtnClick.bind(this)),this.options.showClearButton&&(0,i.uC)("a",this.buttonsBlock).attr("href","javascript:void(0)").addClass("".concat(this.cssPrefix,"-button ").concat(this.cssPrefix,"-button-clear")).text(n.ag.getText("CmdClear")).on("click",this.clearBtnClick.bind(this)),window.addEventListener("resize",(function(){t.textResize()})),this.updateHeader(),this.queryPanel.refresh(),setTimeout((function(){return t.textResize()}),500)},e.prototype.refreshCore=function(){this.clear(),this.render()},e.prototype.clear=function(){this.slot.innerHTML=""},e.prototype.applyFilter=function(){this.options.applyFilterCallback&&this.options.applyFilterCallback()},e.prototype.clearFilter=function(){var t=this.getContext().getQuery();t&&(t.clearConditions(),t.fireConditionsChangedEvent(o.QueryChangeAction.All))},e.prototype.textResize=function(){this.headerTextBlock.style.width=this.slot.clientWidth-this.headerIconElement.offsetWidth-((0,i.uC)(this.headerArrowBlock).isVisible()?this.headerArrowBlock.offsetWidth:0)+"px"},e.prototype.destroyCore=function(){this.queryPanel&&this.queryPanel.destroy(),this.detachQueryObserver(),this.slot.innerHTML=""},e.prototype.attachQueryObserver=function(){var t=this,e=this.getContext().getQuery();this.queryEventCallbackId=e.addChangedCallback((function(e){t.updateHeader()}))},e.prototype.detachQueryObserver=function(){var t=this.getContext().getQuery();t&&t.removeChangedCallback(this.queryEventCallbackId)},e}(o.Widget),Tt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Dt=function(t){function e(e){var n=t.call(this,e)||this;return n.contentElement=e,n.group=o.WidgetGroup.Result,n}return Tt(e,t),e.prototype.getWidgetType=function(){return"htmlContent"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n)},e.prototype.refreshCore=function(){this.clear(),this.context.resultContent&&this.render()},e.prototype.render=function(){this.context.resultContent&&(this.contentElement.innerHTML+=this.context.resultContent)},e.prototype.clear=function(){this.contentElement.innerHTML=""},e.prototype.destroyCore=function(){this.clear()},e}(o.Widget),St=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),kt=function(t){function e(e){var n=t.call(this,e)||this;return n.options={maxButtonCount:10,useBootstrap:!1},n}return St(e,t),e.prototype.getWidgetType=function(){return"eqHtmlGrid"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.setOptions(n)},e.prototype.setOptions=function(t){n.P6.assignDeep(this.options,t)},e.prototype.refreshCore=function(){t.prototype.refreshCore.call(this),this.renderPageNavigator()},e.prototype.destroyCore=function(){this.slot.innerHTML=""},e.prototype.renderPageNavigator=function(){var t=this,e=document.getElementById("PageNavigator");if(e){var n=parseInt(e.getAttribute("data-pagecount")),i=parseInt(e.getAttribute("data-pageindex"));if(n>1){var r=function(e){var n=e.target;if(n.hasAttribute("data-page")){var i=parseInt(n.getAttribute("data-page"));t.context.fetchDataChunk({chunk:{page:i},success:function(){t.context.refreshWidgets(o.WidgetGroup.Result)}})}},s=this.options.maxButtonCount||10,a=i-1,l=a-a%s+1,c=l+s-1;c>n&&(c=n);var u=document.createElement("ul");this.options.useBootstrap?u.className="pagination":u.className="eqv-pagination",this.options.pageItemCssClass&&(u.className+=" "+this.options.pageItemCssClass);var d=document.createElement("li");this.options.useBootstrap&&(d.className="page-item");var h=document.createElement("span");if(h.setAttribute("aria-hidden","true"),this.options.useBootstrap&&(h.className="page-link"),1==l)d.className+=" disabled";else{if(this.options.useBootstrap)(h=document.createElement("a")).setAttribute("href","javascript:void(0)"),h.setAttribute("data-page","".concat(l-1)),h.className="page-link";else(f=document.createElement("a")).setAttribute("href","javascript:void(0)"),f.setAttribute("data-page","".concat(l-1)),h=f;h.addEventListener("click",r)}h.innerHTML="&laquo;",d.appendChild(h),u.appendChild(d);for(var p=l;p<=c;p++)d=document.createElement("li"),this.options.useBootstrap&&(d.className="page-item"),p==i&&(d.className+=" active"),(h=document.createElement("a")).setAttribute("href","javascript:void(0)"),h.innerHTML=p.toString(),h.setAttribute("data-page",p.toString()),h.className="page-link",h.addEventListener("click",r),d.appendChild(h),u.appendChild(d);if(d=document.createElement("li"),this.options.useBootstrap&&(d.className="page-item"),(h=document.createElement("span")).setAttribute("aria-hidden","true"),this.options.useBootstrap&&(h.className="page-link"),c==n)d.className+="disabled";else{var f;if(this.options.useBootstrap)(h=document.createElement("a")).setAttribute("href","javascript:void(0)"),h.setAttribute("data-page","".concat(c+1)),h.className+=" page-link";else(f=document.createElement("a")).setAttribute("href","javascript:void(0)"),f.setAttribute("data-page","".concat(c+1)),h=f;h.addEventListener("click",r)}h.innerHTML="&raquo;",d.appendChild(h),u.appendChild(d),e.appendChild(u)}}},e}(Dt),Mt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Bt=function(t){function e(e){var n=t.call(this,e)||this;return n.options={useCustomLocaleSettings:!1},n.slot=e,n.group=o.WidgetGroup.Result,n}return Mt(e,t),e.prototype.getWidgetType=function(){return"grid"},e.prototype.init=function(e,o){t.prototype.init.call(this,e,o),o&&n.P6.assignDeep(this.options,o)},e.prototype.refreshCore=function(){this.clear(),this.context.resultTable&&this.render()},e.prototype.render=function(){this.options.beforeTableRendering&&this.options.beforeTableRendering(this.context.resultTable),this.applyDisplayFormats()},e.prototype.applyDisplayFormats=function(){},e.prototype.clear=function(){this.slot.innerHTML=""},e}(o.Widget),Pt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),It=function(){return It=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},It.apply(this,arguments)},At=function(t){function e(e){var n=t.call(this,e)||this;return n.hasCustomTotalsSettings=!1,n.options={autoRefresh:!0},n.group=o.WidgetGroup.Result,n}return Pt(e,t),e.prototype.getWidgetType=function(){return"easyGrid"},e.prototype.init=function(e,o){var r=this;t.prototype.init.call(this,e,o);var s=It(It({},o),{slot:this.slot,dataTable:e.resultTable});this.options=n.P6.assign(this.options,o),s.onPlusButtonClick=function(t){return r.addColumnClickHandler(t)},s.onColumnMoved=function(t){return r.columnMovedHandler(t)},s.aggregates?this.hasCustomTotalsSettings=!0:s.aggregates={settings:e.getQuery().getAggregationSettings(),calculator:null},s.aggregates.calculator=this.context.getServices().getAggregatesCalculator(),this.destroy(),this.grid=new i.J1(s),this.options.autoRefresh&&this.attachQueryObserver()},e.prototype.refreshCore=function(){this.clear(),this.updateTotalsSettings(),this.render()},e.prototype.render=function(){this.createEntitiesMenu(),this.grid.refresh()},e.prototype.attachQueryObserver=function(){},e.prototype.destroyCore=function(){this.detachQueryObserver(),this.grid&&this.grid.destroy(),this.slot.innerHTML=""},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.getContext().getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.updateTotalsSettings=function(){var t=this.getContext();if(!this.hasCustomTotalsSettings){var e=t.getQuery().getAggregationSettings();this.grid.options.aggregates.settings=e}},e.prototype.createEntitiesMenu=function(){var t=this.getContext().getModel();if(t&&!t.isEmpty()){var e=this.slot.id;e&&(e+="-EntitiesMenu");var o={items:t.getEntitiesTree({addUIC:!1,addUIR:!0,addUIS:!1}),id:e};n.P6.assign(o,this.options.menuOptions),this.entitiesMenu=new u(o)}},e.prototype.getModel=function(){return this.context.getModel()},e.prototype.getQuery=function(){return this.context.getQuery()},e.prototype.clear=function(){this.grid&&this.grid.clear()},e.prototype.addColumnClickHandler=function(t){var e=this;this.entitiesMenu.showMenu({anchor:t.sourceEvent.target,selectedIds:null,itemSelectedCallback:function(t,n){var o=t.id;return e.addNewColumn(o),!1}})},e.prototype.columnMovedHandler=function(t){var e=this.getQuery(),i=n.P6.findItemIndexById(e.getColumns(),t.columnId);i>=0&&(e.moveColumn(i,t.newIndex),e.fireChangedEvent({part:o.QueryChangePart.Columns,action:o.QueryChangeAction.All,source:this}))},e.prototype.addNewColumn=function(t){this.getContext().getModel();var e=this.getContext().getQuery(),n=e.addColumn({attributeId:t});return e.fireChangedEvent({part:o.QueryChangePart.Columns,action:o.QueryChangeAction.Add,changee:n,source:this}),n},e}(Bt),Ot=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Lt=function(t){function e(e){var n=t.call(this,e)||this;return n.panel=e,n.group=o.WidgetGroup.Statement,"TEXTAREA"!==n.panel.tagName&&(n.panel.innerHTML='<div class="eqv-sql-panel-result"></div>',n.panel=n.panel.querySelector("div")),n}return Ot(e,t),e.prototype.getWidgetType=function(){return"statementPanel"},e.prototype.refreshCore=function(){this.clear(),this.render()},e.prototype.render=function(){this.panel.textContent=this.context.resultStatement?this.context.resultStatement:"";var t=this.panel.innerHTML.replace(/\r\n/g,"<br />").replace(/ /g,"&nbsp;&nbsp;");this.panel.innerHTML=t},e.prototype.destroyCore=function(){this.clear()},e.prototype.clear=function(){this.panel.innerHTML=""},e}(o.Widget),Rt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),_t=function(t){function e(e){var n=t.call(this,e)||this;return n.element=e,n.element.style.display="none",n.group=o.WidgetGroup.All,n}return Rt(e,t),e.prototype.getWidgetType=function(){return"processIndicator"},e.prototype.onProcessStartCore=function(){this.element.style.display=""},e.prototype.onProcessEndCore=function(){this.element.style.display="none"},e}(o.Widget),Ft=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Qt=function(t){function e(e){var n=t.call(this,e)||this;return n.clickHandler=function(){return n.openDialog()},n.columnsBar=null,n.queryPanel=null,n.ddQuery=null,n.cssPrefix=r.YR,n.group=o.WidgetGroup.None,n}return Ft(e,t),e.prototype.getWidgetType=function(){return"manageDrillDown"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.options=n,this.refresh(),this.slot.addEventListener("click",this.clickHandler)},e.prototype.destroyCore=function(){this.slot.removeEventListener("click",this.clickHandler)},e.prototype.openDialog=function(){var t=this,e=this.context.getServices().getDialogService(),r=this.context.getQuery(),s=this.context.getModel(),a=(0,i.uC)("div").addClass("".concat(this.cssPrefix,"-manage-drilldown")).addChildElement(this.renderColumnsBarBlock()).addChildElement(this.renderQueryPanelBlock()).toDOM(),l=s.addOrUpdateOperator({id:"BindToParentColumn",caption:"is bound to",format:"{expr1} [[is bound to]] {expr2}",paramCount:2,kind:o.DataKind.ParentColumn,appliedTypes:[n.g.String,n.g.Bool,n.g.Float,n.g.Int32,n.g.Int64,n.g.Word]});l.defaultOperand.dataType=n.g.String,l.defaultOperand.kind=o.DataKind.ParentColumn,s.runThroughEntities((function(t){var e=t.operators.indexOf(l.id);e>0&&n.P6.moveArrayItem(t.operators,e,0)}),null),this.ddQuery=new o.Query(s,null,{parent:r,context:this.context});var c=this.context.getQuery().getDrillDowns();if(c.length){var u=c[0];this.ddQuery.loadFromData(u.toJSONData())}e.open({title:"Manage Drill Down",body:a,cancelable:!0,closable:!1,beforeOpen:function(){var e=a.getElementsByClassName("".concat(t.cssPrefix,"-columnsbar-slot"))[0];t.columnsBar=new R(e,t.ddQuery),t.columnsBar.init(t.context,t.options.columnsBar);var n=a.getElementsByClassName("".concat(t.cssPrefix,"-querypanel-slot"))[0];t.queryPanel=new xt(n,t.ddQuery),t.queryPanel.init(t.context,t.options.queryPanel),t.columnsBar.refresh(),t.queryPanel.refresh()},onSubmit:function(){return t.submitDialog()},onDestroy:function(){t.destroyDialog()}})},e.prototype.renderQueryPanelBlock=function(){var t=this;return(0,i.uC)("div").addClass("".concat(this.cssPrefix,"-querypanel-block")).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-querypanel-caption"))})).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-querypanel-slot"))})).toDOM()},e.prototype.renderColumnsBarBlock=function(){var t=this;return(0,i.uC)("div").addClass("".concat(this.cssPrefix,"-columnsbar-block")).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-columnsbar-caption"))})).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-columnsbar-slot"))})).toDOM()},e.prototype.submitDialog=function(){if(this.ddQuery.tryValidate({checkExpressions:!0})){var t=this.context.getQuery().getDrillDowns();if(t.length)t[0].loadFromData(this.ddQuery.toJSONData()),this.context.getQuery().fireChangedEvent();else if(!this.ddQuery.isEmpty())this.context.getQuery().addDrillDown().loadFromData(this.ddQuery.toJSONData()),this.context.getQuery().fireChangedEvent();return!0}return!1},e.prototype.destroyDialog=function(){this.context.getModel().removeOperator("BindToParentColumn",!0),this.ddQuery=null,this.columnsBar&&this.columnsBar.destroy(),this.columnsBar=null,this.queryPanel&&this.queryPanel.destroy(),this.queryPanel=null},e}(o.Widget);!function(t){t.DataGrid="DATA_GRID",t.Chart="CHART",t.PivotTable="PIVOT_TABLE"}(U||(U={}));var Nt,qt=function(){function t(t){this.context=t,this.promise=null}return t.prototype.show=function(t){var e=this;if(void 0===t&&(t=null),!this.promise){var n=this.context.getExportFormats();if(0==n.length)throw Error("No exporter has been registered.");t=t||n[0],this.promise=new Promise((function(n,r){var s=e.context.getServices().getDialogService(),a=(0,i.uC)("div").addClass("kdlg-form-section").addChild("div",(function(n){return n.addClass("kfrm-form").addChild("div",(function(n){return n.addClass("kfrm-fields col-a-1 label-align-right").addChild("label",(function(t){return t.addClass("kdlg-form-label","kflex-20").attr("for","export_format").addText(o.i18n.getText("ExportDlgFmtLabel"))})).addChild("div",(function(n){return n.addClass("kfrm-select").addChild("select",(function(n){n.attr("name","export_format").id("exportFormat");for(var i=0,r=e.context.getExportFormats();i<r.length;i++){var s=r[i];n.addOption({value:s,title:o.i18n.getText(s)||s,selected:t==s})}}))}))}))})).toDOM();s.open({title:o.i18n.getText("ExportDlgTitle"),body:a,onSubmit:function(){var t=a.querySelector("#exportFormat").value;return e.context.exportResult({format:t,success:n,error:r}),!0}})}))}return this.promise.finally((function(){return e.promise=null}))},t}(),Ht=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{l(o.next(t))}catch(t){r(t)}}function a(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((o=o.apply(t,e||[])).next())}))},Wt=function(t,e){var n,o,i,r,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,a[0]&&(s=0)),s;)try{if(n=1,o&&(i=2&a[0]?o.return:a[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;switch(o=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,o=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],o=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},jt=function(){function t(t,e){var o=this;this.container=t,this.title=n.ag.getText("Facets","DefaultFacetTitle"),this.cssPrefix="eqjs-facet",this.dialogTitle=n.ag.getText("Facets","DefaultDlgTitle"),this.options={},this.canDisplayFlag=!0,this.downloadAllClickHandler=function(){var t=o.getContext().resultTable;if(t.elasticChunks){var e=o.getDialogService().openProgress({title:n.ag.getText("Facets","LoadDataDlgTitle"),onSubmit:function(){return o.refresh()},determinated:!1});o.loadElasticChunk().then((function(t){e.submit()})).catch((function(t){e.submit(),o.getContext().throwError(t)}))}else{var i=t.getCachedRows().length,r=t.getTotal()-t.getCachedCount(),s=o.getDialogService().openProgress({title:n.ag.getText("Facets","LoadDataDlgTitle"),content:n.ag.getText("Facets","LoadDataDlgContent").replace("{loadedRecs}","0").replace("{totalRecs}","".concat(r)),onSubmit:function(){return o.refresh()},determinated:!0}),a=0;setTimeout((function(){t.getRows({offset:i,limit:r}).then((function(t){var e=(a+=t.length)/r;s.updateContent(n.ag.getText("Facets","LoadDataDlgContent").replace("{loadedRecs}","".concat(a)).replace("{totalRecs}","".concat(r))),s.updateProgress(e)})).catch((function(t){s.submit(),o.getContext().throwError(t)}))}),10)}},n.P6.assignDeep(this.options,e)}return t.prototype.init=function(t){this.slot=t,this.contentDiv=(0,i.uC)("div",this.slot).addClass("".concat(this.cssPrefix,"-content")).toDOM(),this.displayMessageDiv=(0,i.uC)("div",this.slot).hide().toDOM()},t.prototype.showSettingsDialog=function(){var t=this;return new Promise((function(e){var n=t.getDialogService(),o=t.renderDialogContent(),i=n.open({title:t.dialogTitle,body:o,cancelable:!0,closable:!1,onSubmit:function(){var n=t.submitSettingsDialog();return n&&e(!0),n},onCancel:function(){e(!1)}});t.afterDialogOpened(i)}))},t.prototype.afterDialogOpened=function(t){},t.prototype.renderDialogContent=function(){var t,e=(0,i.uC)("div").addClass("kfrm-form").addChild("div",(function(e){return t=e.addClass("".concat(s.z.isIE()?"kfrm-fields-ie col-ie-1-4 label-align-right":"kfrm-fields col-a-1 label-align-right")).toDOM()}));return this.renderFormFields(e.toDOM(),t),e.toDOM()},t.prototype.renderFormFields=function(t,e){var o=this,r=e;s.z.isIE()&&(r=(0,i.uC)("div",e).addClass("kfrm-field-ie").toDOM()),(0,i.uC)(r).addChild("label",(function(t){return t.attr("for","tab_name").addText(n.ag.getText("Facets","TabNameLabel"))})).addChild("input",(function(t){return t.id("facetTabName").name("tab_name").type("text").attr("value",o.title)}))},t.prototype.submitSettingsDialog=function(){var t=document.querySelector("#facetTabName");return 0!=t.value.length&&(this.title=t.value,!0)},t.prototype.getDialogService=function(){return this.getContext().getServices().getDialogService()},t.prototype.canDisplay=function(){var t=this.getContext().resultTable;return t.getCachedCount()==t.getTotal()},t.prototype.showErrorMessage=function(t){this.displayMessageDiv.innerHTML=t,this.displayMessageDiv.classList.add("".concat(this.cssPrefix,"-error-message")),(0,i.uC)(this.displayMessageDiv).show()},t.prototype.showUnableDisplayMessage=function(t){var e=this.getContext().resultTable;this.displayMessageDiv.innerHTML=t||n.ag.getText("Facets","ErrNotEnoughData").replace("{totalRecs}","".concat(e.getTotal())).replace("{cachedRecs}","".concat(e.getCachedCount())).replace(/\[(.*)\]/g,"<a href='javascript:void(0)' class=\"".concat(this.cssPrefix,'-download-all-link">$1</a>'));var o=this.displayMessageDiv.querySelector("a.".concat(this.cssPrefix,"-download-all-link"));o&&o.addEventListener("click",this.downloadAllClickHandler),(0,i.uC)(this.contentDiv).hide(),(0,i.uC)(this.displayMessageDiv).show()},t.prototype.hideUnableDisplayMessage=function(){(0,i.uC)(this.displayMessageDiv).hide(),(0,i.uC)(this.contentDiv).show()},t.prototype.getContext=function(){return this.container.getContext()},t.prototype.getQuery=function(){return this.getContext().getQuery()},t.prototype.saveToData=function(){return{title:this.title,type:this.getType()}},t.prototype.loadFromData=function(t){t&&(this.title=t.title)},t.prototype.refresh=function(){this.hideUnableDisplayMessage(),this.canDisplay()?this.refreshCore():this.showUnableDisplayMessage()},t.prototype.loadElasticChunk=function(){return Ht(this,void 0,void 0,(function(){var t,e,n=this;return Wt(this,(function(o){return t=this.getContext().resultTable,e=t.getCachedRows().length,[2,t.getRows({offset:e,limit:t.chunkSize}).then((function(e){return t.totalIsKnown()?Promise.resolve():n.loadElasticChunk()}))]}))}))},t.prototype.onResize=function(){},t}();!function(t){t[t.Column=3]="Column",t[t.Histogram=4]="Histogram",t[t.Bar=5]="Bar",t[t.Combo=6]="Combo",t[t.Area=7]="Area",t[t.Line=9]="Line",t[t.Pie=10]="Pie",t[t.Polar=11]="Polar",t[t.Doughnut=12]="Doughnut",t[t.Radar=13]="Radar",t[t.SteppedLine=14]="SteppedLine"}(Nt||(Nt={}));var Gt,zt,Vt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ut=function(t){function e(e){var n=t.call(this,e)||this;return n.chartType=Nt.Pie,n.supportedChartTypes=[],n.dataTable=null,n.potentialLabelColumns=[],n.potentialDataColumns=[],n.labelColumn=-1,n.dataColumns=[],n.options={chartType:Nt.Pie,showOnPaging:!1,hideSettings:!1,legend:{show:!1,position:"right"}},n.element=e,n.group=o.WidgetGroup.Result,n}return Vt(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-chart"},enumerable:!1,configurable:!0}),e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.dataTable=e.resultTable,this.setOptions(n)},e.prototype.hasData=function(){var t=null!=this.dataTable;return t&&(t=this.dataTable.getCachedCount()>0),t},e.prototype.hasColumnsForChart=function(){return this.potentialLabelColumns.length>0&&this.potentialDataColumns.length>0},e.prototype.refreshCore=function(){this.prepareChartData(),this.render()},e.prototype.setOptions=function(t){if(n.P6.assignDeep(this.options,t),this.supportedChartTypes=this.getSupportedChartTypes(),0==this.supportedChartTypes.length)throw Error("Chart widget should support at least one chart type");t.chartType&&this.supportedChartTypes.indexOf(t.chartType)>=0?this.chartType=t.chartType:this.chartType=this.supportedChartTypes[0]},e.prototype.getOptions=function(){return this.options},e.prototype.getChartTypeName=function(t){switch(t){case Nt.Area:return n.ag.getText("ChartType","Area");case Nt.Bar:return n.ag.getText("ChartType","Bar");case Nt.Column:return n.ag.getText("ChartType","Column");case Nt.Combo:return n.ag.getText("ChartType","Combo");case Nt.Doughnut:return n.ag.getText("ChartType","Doughnut");case Nt.Polar:return n.ag.getText("ChartType","Polar");case Nt.Radar:return n.ag.getText("ChartType","Radar");case Nt.Histogram:return n.ag.getText("ChartType","Histogram");case Nt.Line:return n.ag.getText("ChartType","Line");case Nt.SteppedLine:return n.ag.getText("ChartType","SteppedLine");default:return n.ag.getText("ChartType","Pie")}},e.prototype.updateSettings=function(t,e){void 0===e&&(e=!0),void 0!==t.showLegend&&(this.options.legend=this.options.legend||{},this.options.legend.show=t.showLegend),this.chartType=t.type,this.labelColumn=t.labelColumn,this.dataColumns[0]=t.dataColumn,e&&this.updateChartColumns()},e.prototype.prepareChartData=function(){var t=this;if(this.dataTable){this.potentialLabelColumns=[],this.potentialDataColumns=[];for(var e=this.dataTable.columns.count,o=0;o<e;o++){var i=this.dataTable.columns.get(o),r=i.type,s=i.label;this.potentialLabelColumns.push({idx:o,label:s}),n.P6.isNumericType(r)&&this.potentialDataColumns.push({idx:o,label:s})}if(-1!=this.labelColumn?this.potentialLabelColumns.filter((function(e){return e.idx==t.labelColumn})).length||(this.labelColumn=-1):this.labelColumn=this.potentialLabelColumns.length>0?this.potentialLabelColumns[0].idx:-1,this.dataColumns.length){var a=this.potentialDataColumns.map((function(t){return t.idx}));this.dataColumns=this.dataColumns.filter((function(t){return a.indexOf(t)>=0})),this.dataColumns.length||(this.dataColumns=this.potentialDataColumns.length>0?[].concat(this.potentialDataColumns[0].idx):[])}else this.dataColumns=this.potentialDataColumns.length>0?[].concat(this.potentialDataColumns[0].idx):[];this.initChart()}},e.prototype.getSupportedChartTypes=function(){var t=this;return(this.options.supportedChartTypes?this.options.supportedChartTypes:Object.keys(Nt).map((function(t){return Nt[t]}))).filter((function(e){return t.hasChartTypes.indexOf(e)>=0}))},e.prototype.getCurrentChartType=function(){return this.chartType},e.prototype.render=function(){var t=this;if(this.clear(),this.hasData()&&this.hasColumnsForChart()&&this.context.resultTable.getTotal()==this.context.resultTable.getCachedCount()){var e=document.createElement("div");(0,i.bF)(e,"".concat(this.cssPrefix,"-header"));var n=document.createElement("div");if((0,i.bF)(n,"".concat(this.cssPrefix,"-main")),this.canDraw()){for(var o=document.createElement("select"),r=0,s=this.supportedChartTypes;r<s.length;r++){var a=s[r],l=document.createElement("option");l.value=a.toString(),l.text=this.getChartTypeName(a),o.appendChild(l)}o.value=this.chartType.toString(),e.appendChild(o),o.addEventListener("change",(function(e){var n=e.target.value;t.chartType=parseInt(n),t.refresh()})),this.settingsDiv=document.createElement("div"),(0,i.bF)(this.settingsDiv,"".concat(this.cssPrefix,"-settings")),(0,i.e6)(this.settingsDiv),n.appendChild(this.settingsDiv),this.chartDiv=document.createElement("div"),(0,i.bF)(this.chartDiv,"".concat(this.cssPrefix,"-content")),(0,i.e6)(this.chartDiv),n.appendChild(this.chartDiv),this.initSettingsDiv();var c=document.createElement("div");(0,i.bF)(c,"".concat(this.cssPrefix,"-settings-icon")),c.title="Settings",e.appendChild(c),c.addEventListener("click",(function(e){t.toggleSettings()})),this.drawChart(100)}else this.addContentDiv(n,"Unable to render the chart. None of the supported chart libraries (ChartJS, Google Charts, etc) is found.");this.options.hideSettings||this.element.appendChild(e),this.element.appendChild(n),this.element.style.display=""}else this.element.style.display="none"},e.prototype.addContentDiv=function(t,e){var n=document.createElement("div");(0,i.bF)(n,"".concat(this.cssPrefix,"-no-data")),n.innerText=e,t.appendChild(n)},e.prototype.clear=function(){this.element.innerHTML=""},e.prototype.drawChart=function(t){var e=this;(0,i.V_)(this.chartDiv),t>0?setTimeout((function(){return e.drawCore()}),t):this.drawCore()},e.prototype.initSettingsDiv=function(){var t=this,e=document.createElement("div");e.textContent="SETTINGS",(0,i.bF)(e,"".concat(this.cssPrefix,"-settings-header")),this.settingsDiv.appendChild(e);var n=document.createElement("div");(0,i.bF)(n,"".concat(this.cssPrefix,"-settings-single")),this.settingsDiv.appendChild(n);var o=document.createElement("span");(0,i.V_)(o),o.textContent="Label column",n.appendChild(o);var r=document.createElement("select");(0,i.V_)(r),n.appendChild(r);for(var s=0,a=this.potentialLabelColumns;s<a.length;s++){var l=a[s];(f=document.createElement("option")).value=l.idx.toString(),f.text=l.label,r.appendChild(f)}this.labelColumn>=0&&(r.value=this.labelColumn.toString()),r.addEventListener("change",(function(e){t.labelColumn=parseInt(e.target.value),t.updateChartColumns(),t.toggleSettings((function(){t.drawChart(100)}))}));var c=document.createElement("div");(0,i.bF)(c,"".concat(this.cssPrefix,"-settings-single")),this.settingsDiv.appendChild(c);var u=document.createElement("span");(0,i.V_)(u),u.textContent="Data column",c.appendChild(u);var d=document.createElement("select");(0,i.V_)(d),c.appendChild(d);for(var h=0,p=this.potentialDataColumns;h<p.length;h++){var f;l=p[h];(f=document.createElement("option")).value=l.idx.toString(),f.text=l.label,d.appendChild(f)}this.dataColumns.length>0&&this.dataColumns[0]>=0&&(d.value=this.dataColumns[0].toString()),d.addEventListener("change",(function(e){t.dataColumns[0]=parseInt(e.target.value),t.updateChartColumns(),t.toggleSettings((function(){t.drawChart(100)}))}))},e.prototype.getPotentialLabelColumns=function(){return this.potentialLabelColumns},e.prototype.getPotentialDataColumns=function(){return this.potentialDataColumns},e.prototype.getLabelColumnIndex=function(){return this.labelColumn},e.prototype.getDataColumnIndex=function(){return this.dataColumns[0]},e.prototype.toggleSettings=function(t){var e,n;(0,i.pn)(this.chartDiv)?(e=this.chartDiv,n=this.settingsDiv):(e=this.settingsDiv,n=this.chartDiv),(0,i.AN)(e,n,{complete:t})},e}(o.Widget),Yt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Jt=function(t){function e(e){var n=t.call(this,e)||this;return n.colors=["#4dc9f6","#f67019","#f53794","#537bc4","#acc236","#166a8f","#00a950","#58595b","#8549ba"],n.chartLabels=[],n.chartColumns=[],n.hasChartTypes=[Nt.Column,Nt.Bar,Nt.Area,Nt.Line,Nt.SteppedLine,Nt.Doughnut,Nt.Polar,Nt.Radar,Nt.Pie],n.options.legend={show:!1,position:"bottom"},n}return Yt(e,t),e.prototype.getWidgetType=function(){return"chartChartJs"},e.hasChartJs=function(){return"undefined"!=typeof Chart},e.prototype.canDraw=function(){return e.hasChartJs()},e.prototype.initChart=function(){e.hasChartJs()&&this.labelColumn>=0&&this.dataColumns&&this.dataColumns.length>0&&this.updateChartColumns()},e.prototype.drawCore=function(){if(e.hasChartJs()&&this.dataTable&&this.dataTable.getCachedCount()>0){var t=this.generateConfig(),n=this.getChartCanvas(this.chartDiv).getContext("2d");new Chart(n,t)}},e.prototype.updateChartColumns=function(){if(this.dataTable){this.chartLabels=[],this.chartColumns=[];for(var t=this.dataTable.getCachedRows(),e=0;e<t.length;e++)this.chartLabels.push(t[e].getValue(this.labelColumn)),this.chartColumns.push(t[e].getValue(this.dataColumns[0]))}},e.prototype.getChartCanvas=function(t){var e=t.getElementsByTagName("canvas");return e&&e.length>0?e[0]:(0,i.MN)(t,"canvas")},e.prototype.generateConfig=function(){var t,e=[],n=this.dataTable.columns.get(this.dataColumns[0]).label,o=!0;if(this.chartType==Nt.Pie||this.chartType==Nt.Doughnut||this.chartType==Nt.Polar||this.chartType==Nt.Bar||this.chartType==Nt.Column)for(var i=0;i<this.chartLabels.length;i++)e.push(this.colors[i%this.colors.length]);else e=[this.colors[3]];this.chartType!=Nt.Line&&this.chartType!=Nt.SteppedLine||(o=!1,t=this.colors[3]),this.options.legend=this.options.legend||{};var r={data:this.chartColumns,backgroundColor:e,borderColor:t,label:n,fill:o};this.chartType==Nt.SteppedLine&&(r.stepped=this.chartType===Nt.SteppedLine,r.steppedLine=this.chartType===Nt.SteppedLine);var s=this.options.legend.show&&(this.chartType==Nt.Pie||this.chartType==Nt.Radar||this.chartType==Nt.Polar||this.chartType==Nt.Doughnut);return{type:this.getChartType(),data:{datasets:[r],labels:this.chartLabels},options:{legend:{display:s,position:this.options.legend.position||"bottom"},title:{display:!0,text:n}}}},e.prototype.getChartType=function(){switch(this.chartType){case Nt.Column:return"bar";case Nt.Bar:return"horizontalBar";case Nt.Area:case Nt.SteppedLine:case Nt.Line:return"line";case Nt.Doughnut:return"doughnut";case Nt.Polar:return"polarArea";case Nt.Radar:return"radar";case Nt.Pie:default:return"pie"}},e}(Ut),Xt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Kt=function(t){function e(e){var n=t.call(this,e)||this;return n.hasChartTypes=[Nt.Column,Nt.Bar,Nt.Histogram,Nt.Combo,Nt.Area,Nt.Line,Nt.SteppedLine,Nt.Pie,Nt.Doughnut],n.options.legend={show:!0,position:"right"},n}return Xt(e,t),e.prototype.getWidgetType=function(){return"chartGoogle"},e.prototype.canDraw=function(){return e.hasGoogleCharts()},e.hasGoogleCharts=function(){return"undefined"!=typeof google&&void 0!==google.charts},e.prototype.initChart=function(){e.hasGoogleCharts()&&this.labelColumn>=0&&this.dataColumns&&this.dataColumns.length>0&&(this.googleDataView=new google.visualization.DataView(this.convertToGoogleFormat()),this.updateChartColumns())},e.prototype.convertToGoogleType=function(t){switch(t){case n.g.Date:return"date";case n.g.DateTime:return"datetime";case n.g.Time:return"timeofday";case n.g.Byte:case n.g.Word:case n.g.Int32:case n.g.Int64:case n.g.Currency:case n.g.Float:return"number";default:return"string"}},e.prototype.convertToGoogleValue=function(t,e){return e===n.g.Bool?t?t.toString():null:t},e.prototype.convertToGoogleFormat=function(){for(var t=new google.visualization.DataTable,e=this.dataTable.columns,n=0;n<e.count;n++){var o=e.get(n);t.addColumn(this.convertToGoogleType(o.type),o.label,o.id)}var i=this.dataTable.getCachedRows();t.addRows(i.length);for(n=0;n<i.length;n++)for(var r=i[n],s=0;s<e.count;s++)t.setCell(n,s,this.convertToGoogleValue(r.getValue(s),e.get(s).type));return t},e.prototype.drawCore=function(){if(null!=this.googleDataView){this.options.legend=this.options.legend||{};var t={width:"100%",height:"100%",chartArea:{width:this.getChartAreaWidth}};this.chartType==Nt.Doughnut&&(t.pieHole=.4),this.options.legend.show?t.legend={position:this.options.legend.position}:t.legend="none",this.createChart(this.chartDiv).draw(this.googleDataView,t)}},e.prototype.getChartAreaWidth=function(t){return t==Nt.Pie?"100%":"50%"},e.prototype.updateChartColumns=function(){this.googleDataView&&this.googleDataView.setColumns([].concat(this.labelColumn).concat(this.dataColumns))},e.prototype.createChart=function(t){switch(this.chartType){case Nt.Column:return new google.visualization.ColumnChart(t);case Nt.Histogram:return new google.visualization.Histogram(t);case Nt.Bar:return new google.visualization.BarChart(t);case Nt.Combo:return new google.visualization.ComboChart(t);case Nt.Area:return new google.visualization.AreaChart(t);case Nt.Line:return new google.visualization.LineChart(t);case Nt.SteppedLine:return new google.visualization.SteppedAreaChart(t);case Nt.Pie:case Nt.Doughnut:default:return new google.visualization.PieChart(t)}},e}(Ut),$t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Zt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.title=n.ag.getText("Facets","Chart","FacetTitle"),e.dialogTitle=n.ag.getText("Facets","Chart","DlgTitle"),e}return $t(e,t),e.prototype.init=function(e){t.prototype.init.call(this,e),Kt.hasGoogleCharts()?this.chart=new Kt(this.contentDiv):this.chart=new Jt(this.contentDiv);var n=this.container.options?this.container.options.supportedChartTypes:null;this.chart.init(this.getContext(),{legend:{show:!1},showOnPaging:!0,hideSettings:!0,supportedChartTypes:n}),(0,i.uC)(this.slot).hide()},e.prototype.destroy=function(){this.chart&&this.chart.destroy()},e.prototype.getType=function(){return U.Chart},e.prototype.renderFormFields=function(e,o){var r=this;t.prototype.renderFormFields.call(this,e,o);var a=s.z.isIE(),l=a?"kfrm-fields-ie is-horizontal":"kfrm-fields is-horizontal",c=document.createElement("select");c.id="chart_type_selector",c.name="chart_type_selector";for(var u=0,d=this.chart.getSupportedChartTypes();u<d.length;u++){var h=d[u];(b=document.createElement("option")).value=h.toString(),b.text=this.chart.getChartTypeName(h),c.appendChild(b)}c.value=this.chart.getCurrentChartType().toString(),this.settings||(this.chart.prepareChartData(),this.settings={type:this.chart.getCurrentChartType().toString(),labelColumn:"".concat(this.chart.getLabelColumnIndex()>=0?this.chart.getLabelColumnIndex():""),dataColumn:"".concat(this.chart.getDataColumnIndex()>=0?this.chart.getDataColumnIndex():""),showLegend:!1});var p=document.createElement("select");p.name="label_column_selector",p.id="label_column_selector";for(var f=0,g=this.chart.getPotentialLabelColumns();f<g.length;f++){var m=g[f];(b=document.createElement("option")).value=m.idx.toString(),b.text=m.label,p.appendChild(b)}p.value=this.settings.labelColumn;var y=document.createElement("select");y.id="data_column_selector",y.name="data_column_selector";for(var v=0,C=this.chart.getPotentialDataColumns();v<C.length;v++){var b;m=C[v];(b=document.createElement("option")).value=m.idx.toString(),b.text=m.label,y.appendChild(b)}y.value=this.settings.dataColumn.toString();var x=o,w=function(){return a?(0,i.uC)("div",o).addClass("kfrm-field-ie").toDOM():o};a?(0,i.uC)(e).addChildElement(w()):(0,i.uC)(o).addChild("div").addChild("div"),x=w(),(0,i.uC)(x).addChild("label",(function(t){return t.attr("for","chart_type_selector").text(n.ag.getText("Facets","Chart","ChartTypeSelectorLabel"))})).addChild("div",(function(t){return t.addClass("kfrm-select").addChildElement(c)})),x=w(),(0,i.uC)(x).addChild("label",(function(t){return t.attr("for","label_column_selector").text(n.ag.getText("Facets","Chart","LabelColumnSelectorLabel"))})).addChild("div",(function(t){return t.addClass("kfrm-select").addChildElement(p)})),x=w(),(0,i.uC)(x).addChild("label",(function(t){return t.attr("for","data_column_selector").text(n.ag.getText("Facets","Chart","DataColumnSelectorLabel"))})).addChild("div",(function(t){return t.addClass("kfrm-select").addChildElement(y)})),x=w(),(0,i.uC)(x).addChild("div").addChild("div",(function(t){return t.addClass(l).addChild("label",(function(t){return t.addClass("checkbox").addChild("input",(function(t){t.id("show_legend").type("checkbox"),r.settings.showLegend&&t.attr("checked","")})).addText(" "+n.ag.getText("Facets","Chart","ShowLegendLabel"))}))}))},e.prototype.afterDialogOpened=function(t){this.getContext().resultTable.columns.getItems().filter((function(t){return n.P6.isNumericType(t.type)})).length<=0&&(t.showAlert("The dataset should contain at least one numeric column to build a chart","error"),t.getSubmitButtonElement().disabled=!0)},e.prototype.submitSettingsDialog=function(){var e=t.prototype.submitSettingsDialog.call(this),n=document.getElementById("chart_type_selector"),o=parseInt(n.value),i=document.getElementById("label_column_selector"),r=parseInt(i.value),s=document.getElementById("data_column_selector"),a=parseInt(s.value),l=document.getElementById("show_legend").checked;return e&&(this.settings={type:o,labelColumn:r,dataColumn:a,showLegend:l},this.canDisplay()&&this.refresh()),e},e.prototype.getSettings=function(){return this.settings},e.prototype.saveToData=function(){var e=t.prototype.saveToData.call(this);return this.settings&&(e.chartType=this.settings.type,e.labelCol=this.settings.labelColumn,e.dataCol=this.settings.dataColumn,e.showLeg=this.settings.showLegend),e},e.prototype.loadFromData=function(e){t.prototype.loadFromData.call(this,e),e&&(this.settings={type:e.chartType,dataColumn:e.dataCol,labelColumn:e.labelCol,showLegend:e.showLeg})},e.prototype.refreshCore=function(){this.chart&&(this.settings&&this.chart.updateSettings(this.settings),this.chart.prepareChartData(),this.chart.refresh())},e.prototype.onResize=function(){this.refresh()},e}(jt),te=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();!function(t){t.Sum="SUM",t.Average="AVG",t.Min="MIN",t.Max="MAX",t.Count="COUNT"}(Gt||(Gt={})),function(t){t[t.ColumnField=0]="ColumnField",t[t.RowField=1]="RowField",t[t.CellData=2]="CellData"}(zt||(zt={}));var ee=/{0:(.*?)}/g,ne=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.title=n.ag.getText("Facets","Pivot","FacetTitle"),e.dialogTitle=n.ag.getText("Facets","Pivot","DlgTitle"),e.pivotTable=new n.XH,e}return te(e,t),e.prototype.init=function(e){var o=this;t.prototype.init.call(this,e),this.options.maxRowCount=this.options.maxRowCount||500,this.options.viewportRowsCount=this.options.viewportRowsCount||50,this.grid=new i.J1({slot:this.contentDiv,dataTable:this.pivotTable,paging:{enabled:!1,pageSize:this.options.maxRowCount},viewportRowsCount:this.options.viewportRowsCount,useRowNumeration:!1,showPlusButton:!1,allowDragDrop:!1,onGetCellRenderer:function(t,e){if(t.dataColumn){if("total"==t.dataColumn.id)return function(t,n,o,i){e(t,n,o,i),o.classList.add("pivot-cell-total")};if(o.settings.totalsRow)if(0===o.pivotTable.columns.getIndex(t.dataColumn.id))return function(t,i,r,s){Number.parseInt(s.getAttribute("data-row-idx"))===o.pivotTable.getCachedCount()-1&&(t=n.ag.getText("Facets","Pivot","TotalGridLabel")),e(t,i,r,s)}}}})},e.prototype.getType=function(){return U.PivotTable},e.prototype.destroy=function(){this.grid&&this.grid.destroy()},e.prototype.createAggrFuncSelectBuilder=function(t){for(var e=this.getContext().getModel(),n=(0,i.uC)("select"),o=function(t){n.addChild("option",(function(n){n.attr("value",t).text(e.getAggrFunctionCaption(t))}))},r=0,s=Object.keys(Gt).map((function(t){return Gt[t]}));r<s.length;r++){o(s[r])}var a=n.toDOM().querySelectorAll("option");return null!=t?a.forEach((function(e){e.value==t&&(e.selected=!0)})):a[0].selected=!0,n},e.prototype.createColumnsSelectBuilder=function(t,e,o){for(var r=this.getContextDataTable(),s=(0,i.uC)("select"),a=null,l=0,c=function(e){var o=r.columns.get(e),i=o.label,c=o.type,u=o.id;if(t&&t.indexOf(c)<0)return"continue";null===a&&n.P6.isNumericType(c)&&(a=l),s.addChild("option",(function(t){t.attr("value",u).text(i)})),l++},u=0;u<r.columns.count;u++)c(u);var d=Array.from(s.toDOM().querySelectorAll("option"));if(d.length>0)if(null!=e)for(var h=0,p=d;h<p.length;h++){var f=p[h];if(f.value==e){s.toDOM().value=f.value;break}}else switch(o){case zt.ColumnField:s.toDOM().value=d[0].value;break;case zt.RowField:s.toDOM().value=d.length>1?d[1].value:d[0].value;break;case zt.CellData:s.toDOM().value=null===a?d[0].value:d[a].value}return s},e.prototype.renderFormFields=function(e,o){var r=this;t.prototype.renderFormFields.call(this,e,o);var a=this.settings||{totalsRow:!0,totalsCol:!0},l=[n.g.String,n.g.Date,n.g.DateTime,n.g.Int32,n.g.Int64,n.g.Word,n.g.Byte],c=[n.g.String,n.g.Float,n.g.Int32,n.g.Int64,n.g.Word,n.g.Byte,n.g.Currency],u=s.z.isIE(),d=o,h=u?"kfrm-fields-ie is-horizontal":"kfrm-fields is-horizontal",p=function(){return u?(0,i.uC)("div",o).addClass("kfrm-field-ie").toDOM():o};u?(0,i.uC)(o).addChildElement(p()):(0,i.uC)(o).addChild("div").addChild("div"),d=p(),(0,i.uC)(d).addChild("label",(function(t){return t.attr("for","column_field").text(n.ag.getText("Facets","Pivot","ColumnFieldSelectorLabel"))})).addChild("div",(function(t){return t.addClass(h).addChild("div",(function(t){return t.addClass("kfrm-select").attr("name","column_field").addChildElement(r.createColumnsSelectBuilder(l,a.colName,zt.ColumnField).id("pivotTableColFieldSelector").toDOM())})).addChild("button",(function(t){return t.addClass("kfrm-button").addClass("eqjs-facets-button-swap").attr("title",n.ag.getText("Facets","Pivot","SwapBtnTitle")).on("click",(function(){var t=document.getElementById("pivotTableColFieldSelector"),e=document.getElementById("pivotTableRowFieldSelector"),n=t.value;t.value=e.value,e.value=n}))}))})),d=p(),(0,i.uC)(d).addChild("label",(function(t){return t.attr("for","row_field").text(n.ag.getText("Facets","Pivot","RowFieldSelectorLabel"))})).addChild("div",(function(t){return t.addClass("kfrm-select").attr("name","row_field").addChildElement(r.createColumnsSelectBuilder(l,a.rowName,zt.RowField).id("pivotTableRowFieldSelector").toDOM())})),d=p(),(0,i.uC)(d).addChild("label",(function(t){return t.attr("for","data_function").text(n.ag.getText("Facets","Pivot","CellDataSelectorLabel"))})).addChild("div",(function(t){return t.addClass(h).addChild("div",(function(t){return t.addClass("kfrm-select").attr("name","data_function").addChildElement(r.createAggrFuncSelectBuilder(a.aggrFunc).id("pivotTableAggrFuncSelector").toDOM())})).addChild("label",(function(t){return t.addText("of ")})).addChild("div",(function(t){return t.addClass("kfrm-select").attr("name","data_column").addChildElement(r.createColumnsSelectBuilder(c,a.fieldName,zt.CellData).on("change",(function(t){var e=t.target.value;r.validateSelectedField(e)})).id("pivotTableCellFieldSelector").toDOM())}))})),d=p(),(0,i.uC)(d).addChild("div").addChild("div",(function(t){return t.addClass(h).addChild("label",(function(t){return t.addClass("checkbox").addChild("input",(function(t){t.id("pivotTableHasTotalsRow").type("checkbox"),a.totalsRow&&t.attr("checked","")})).addText(" "+n.ag.getText("Facets","Pivot","TotalsRowLabel"))})).addChild("label",(function(t){return t.addClass("checkbox").addChild("input",(function(t){t.id("pivotTableHasTotalsCol").type("checkbox"),a.totalsCol&&t.attr("checked","")})).addText(" "+n.ag.getText("Facets","Pivot","TotalsColLabel"))}))}))},e.prototype.afterDialogOpened=function(t){var e=document.getElementById("pivotTableCellFieldSelector").value;e&&this.validateSelectedField(e),this.getQuery().getColumns().length<=2&&(t.showAlert("The dataset should contain at least three columns to build a pivot table","error"),t.getSubmitButtonElement().disabled=!0)},e.prototype.validateSelectedField=function(t){var e=this.getContextDataTable(),o=e.columns.getIndex(t),i=e.columns.get(o),r=document.getElementById("pivotTableAggrFuncSelector");i.type==n.g.String?(r.disabled=!0,r.value=Gt.Count):r.disabled=!1},e.prototype.submitSettingsDialog=function(){var e=t.prototype.submitSettingsDialog.call(this);return e&&(this.settings={colName:document.getElementById("pivotTableColFieldSelector").value,rowName:document.getElementById("pivotTableRowFieldSelector").value,aggrFunc:document.getElementById("pivotTableAggrFuncSelector").value,fieldName:document.getElementById("pivotTableCellFieldSelector").value,totalsRow:document.getElementById("pivotTableHasTotalsRow").checked,totalsCol:document.getElementById("pivotTableHasTotalsCol").checked},this.refresh()),e},e.prototype.saveToData=function(){var e=t.prototype.saveToData.call(this);return this.settings&&n.P6.assignDeep(e,this.settings),e},e.prototype.loadFromData=function(e){t.prototype.loadFromData.call(this,e),e&&(this.settings=n.P6.assignDeep(this.settings,e),"AVERAGE"==this.settings.aggrFunc&&(this.settings.aggrFunc=Gt.Average))},e.prototype.refreshCore=function(){if(this.updatePivotData(),this.grid){var t=this.pivotTable.getTotal();t>this.grid.options.paging.pageSize&&(this.contentDiv.classList.remove("pivot-grid-with-totals"),this.showErrorMessage(n.ag.getText("Facets","ErrTooMuchData"))),this.options.viewportRowsCount>t?this.grid.options.viewportRowsCount=t:this.grid.options.viewportRowsCount=this.options.viewportRowsCount,this.grid.refresh()}},e.prototype.getContextDataTable=function(){return this.getContext().resultTable},e.prototype.updatePivotData=function(){this.pivotTable.clear();var t=this.getContextDataTable();if(t&&0!=t.getTotal()&&this.settings){var e=this.settings.colName,o=this.settings.rowName,i=this.settings.fieldName,r=t.columns.getIndex(e),s=t.columns.getIndex(o),a=t.columns.getIndex(i);if(null!=r&&null!=s&&null!=a){for(var l=t.columns.get(a),c=t.columns.get(r),u=t.columns.get(s),d=u.label,h=u.type,p=c.label,f=[],g=[],m=t.getCachedRows(),y=0;y<m.length;y++){var v=m[y].getValue(r);f.indexOf(v)<0&&f.push(v);var C=m[y].getValue(s);g.indexOf(C)<0&&g.push(C)}this.pivotTable.columns.add({id:d+"\\"+p,label:d+"\\"+p,description:"",type:h,dfmt:u.displayFormat,style:u.style});var b=[],x=null;n.P6.isNumericType(c.type)?x=this.formatNumber:n.P6.getDateDataTypes().indexOf(c.type)>=0&&(x=this.formatDate);for(y=0;y<f.length;y++){if(v=f[y]){var w=x?x(c,v):v;this.pivotTable.columns.add({id:v,label:w,description:"",dfmt:l.displayFormat,type:this.settings.aggrFunc!==Gt.Count?l.type:n.g.Int64,style:l.style})}else b.push(y)}var E=[];for(y=0;y<g.length;y++)E.push([]),E[y].push(g[y]);for(y=0;y<g.length;y++)for(var T=0;T<f.length;T++)b.indexOf(T)>=0||E[y].push(this.calcAggrFunc(this.settings.aggrFunc,{colName:this.settings.colName,rowName:this.settings.rowName,fieldName:this.settings.fieldName,rowValue:g[y],colValue:f[T]}));if(this.settings.totalsCol){this.pivotTable.columns.add({id:"total",label:n.ag.getText("Facets","Pivot","TotalGridLabel"),description:"",dfmt:l.displayFormat,type:this.settings.aggrFunc!==Gt.Count?l.type:n.g.Int64});for(y=0;y<E.length;y++){var D=E[y],S=0;this.settings.aggrFunc!=Gt.Min&&this.settings.aggrFunc!=Gt.Max||(S=D[1]);for(T=1;T<D.length;T++){null!==(A=D[T])&&(this.settings.aggrFunc===Gt.Min?A<S&&(S=A):this.settings.aggrFunc===Gt.Max?A>S&&(S=A):S+=A)}this.settings.aggrFunc===Gt.Average&&(S/=D.length-1),D.push(S)}}for(var k=0,M=E;k<M.length;k++){D=M[k];this.pivotTable.addRow(D)}if(this.settings.totalsRow){var B=[];B.push(null);for(y=1;y<this.pivotTable.columns.count;y++){var P=this.pivotTable.getCachedRows(),I=0;this.settings.aggrFunc!=Gt.Min&&this.settings.aggrFunc!=Gt.Max||(I=P[0].getValue(y));for(T=0;T<P.length;T++){var A;null!==(A=P[T].getValue(y))&&(this.settings.aggrFunc===Gt.Min?A<I&&(I=A):this.settings.aggrFunc===Gt.Max?A>I&&(I=A):I+=A)}this.settings.aggrFunc===Gt.Average&&(I/=P.length),B.push(I)}this.pivotTable.addRow(B),this.contentDiv.classList.add("pivot-grid-with-totals")}else this.contentDiv.classList.remove("pivot-grid-with-totals")}else this.showUnableDisplayMessage(n.ag.getText("Facets","ErrQueryChanged"))}},e.prototype.calcAggrFunc=function(t,e){switch(t){case Gt.Sum:return this.sum(e);case Gt.Average:return this.average(e);case Gt.Min:return this.min(e);case Gt.Max:return this.max(e);case Gt.Count:return this.count(e);default:return 0}},e.prototype.getSettings=function(){return this.settings},e.prototype.formatDate=function(t,e){var o="[object Date]"===Object.prototype.toString.call(e),i=(e||"").toString();if(o)if(t&&t.displayFormat&&ee.test(t.displayFormat))i=t.displayFormat.replace(ee,(function(o,i){return n.ag.dateTimeToStr(e,t.type,i)}));else{var r=n.ag.getCurrentLocale(),s={hour:"numeric",minute:"numeric",second:"numeric"};switch(t.type){case n.g.Date:i=e.toLocaleDateString(r);break;case n.g.Time:i=e.toLocaleTimeString(r,s);break;case n.g.DateTime:i="".concat(e.toLocaleDateString(r)," ").concat(e.toLocaleTimeString(r,s))}}return i},e.prototype.formatNumber=function(t,e){var o=(e||"").toString();return"number"==typeof e&&(o=t&&t.displayFormat&&ee.test(t.displayFormat)?t.displayFormat.replace(ee,(function(t,o){return n.ag.numberToStr(e,o)})):e.toLocaleString()),o},e.prototype.sum=function(t){for(var e=0,n=this.getContextDataTable().getCachedRows(),o=0;o<n.length;o++){var i=n[o].getValue(t.rowName),r=n[o].getValue(t.colName);if(i===t.rowValue&&r===t.colValue)e+=n[o].getValue(t.fieldName)}return e},e.prototype.average=function(t){for(var e=0,n=0,o=this.getContextDataTable().getCachedRows(),i=0;i<o.length;i++){var r=o[i].getValue(t.rowName),s=o[i].getValue(t.colName);if(r===t.rowValue&&s===t.colValue)e+=o[i].getValue(t.fieldName),n++}return 0!=n&&(e/=n),e},e.prototype.min=function(t){for(var e=Number.MAX_SAFE_INTEGER,n=this.getContextDataTable().getCachedRows(),o=0;o<n.length;o++){var i=n[o].getValue(t.rowName),r=n[o].getValue(t.colName);if(i===t.rowValue&&r===t.colValue){var s=n[o].getValue(t.fieldName);s<e&&(e=s)}}return e==Number.MAX_SAFE_INTEGER?null:e},e.prototype.max=function(t){for(var e=Number.MIN_SAFE_INTEGER,n=this.getContextDataTable().getCachedRows(),o=0;o<n.length;o++){var i=n[o].getValue(t.rowName),r=n[o].getValue(t.colName);if(i===t.rowValue&&r===t.colValue){var s=n[o].getValue(t.fieldName);s>e&&(e=s)}}return e==Number.MIN_SAFE_INTEGER?null:e},e.prototype.count=function(t){for(var e=0,n=this.getContextDataTable().getCachedRows(),o=0;o<n.length;o++){var i=n[o].getValue(t.rowName),r=n[o].getValue(t.colName);i===t.rowValue&&r===t.colValue&&e++}return e},e}(jt),oe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ie=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.grid=null,e.title=o.i18n.getText("Facets","DataTable","FacetTitle"),e.dialogTitle=o.i18n.getText("Facets","DataTable","DlgTitle"),e}return oe(e,t),e.prototype.init=function(e){t.prototype.init.call(this,e),this.reinitGrid()},e.prototype.getSettings=function(){return this.settings},e.prototype.reinitGrid=function(){this.grid&&this.grid.destroy();var t=this.container.options||{};t.gridResolver&&(this.grid=t.gridResolver(this.contentDiv,this.getType())),null==this.grid&&(this.grid=new At(this.contentDiv)),t.grid=t.grid||{},t.grid.autoRefresh=!1,t.grid.addColumns=!1;var e=this.getContext();t.grid.totals=this.settings,this.grid.init(e,t.grid)},e.prototype.getType=function(){return U.DataGrid},e.prototype.canDisplay=function(){return!0},e.prototype.refreshCore=function(){this.grid&&this.grid.refresh()},e.prototype.destroy=function(){this.grid&&this.grid.destroy()},e}(jt),re=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),se=function(t){function e(e){var n=t.call(this,e)||this;return n.facets=[],n.options={},n.group=o.WidgetGroup.Result,n}return re(e,t),e.prototype.destroyCore=function(){for(var t=0,e=this.facets;t<e.length;t++){e[t].destroy()}this.clear()},e.prototype.createFacetTab=function(t){var e=this.options[t];switch(t){case U.Chart:return new Zt(this,e);case U.PivotTable:return new ne(this,e);default:return new ie(this,e)}},e.prototype.getQuery=function(){return this.getContext().getQuery()},e}(o.Widget),ae=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),le=function(t){function e(e){var o=t.call(this,e)||this;return o.activeFacetIndex=-1,o.firstRender=!0,o.options={showExportButton:!0,showRefreshButton:!0,showMaximizeButton:!0,maximize2Window:!1,showProcessIndicator:!0,facetTypes:[U.DataGrid,U.Chart,U.PivotTable]},o.menuItems=[{id:U.DataGrid,text:n.ag.getText("Facets","AddMenuItems","DataTable")},{id:U.Chart,text:n.ag.getText("Facets","AddMenuItems","Chart")},{id:U.PivotTable,text:n.ag.getText("Facets","AddMenuItems","Pivot")}],o.menuItemsFilter=function(t){return!(o.options.facetTypes.indexOf(t.id)<0)&&(t.id!==U.DataGrid||0===o.facets.filter((function(t){return t.getType()==U.DataGrid})).length)},o.slot.classList.contains("".concat(o.cssPrefix,"-panel"))||o.slot.classList.add("".concat(o.cssPrefix,"-panel")),o.renderProcessBlock(),o}return ae(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-facets"},enumerable:!1,configurable:!0}),e.prototype.getWidgetType=function(){return"facetsPanel"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.setOptions(n),this.destroyCore(),this.attachQueryObserver(),this.loadFacets()},e.prototype.attachQueryObserver=function(){var t=this,e=this.getQuery();this.queryEventCallbackId&&e.removeChangedCallback(this.queryEventCallbackId),this.queryEventCallbackId=e.addChangedCallback((function(e){var n=e.data;n.part==o.QueryChangePart.All&&n.source!=t&&(t.reloadFacets(),t.refreshCore(!0))}))},e.prototype.refreshCore=function(t){void 0===t&&(t=!1),(this.firstRender||t)&&(this.clear(),this.createAddMenu(),this.render()),this.validateAddFacetButton(),this.renderActiveFacet(),this.updateTotalRecords()},e.prototype.createAddMenu=function(){this.addMenu=new u({items:this.menuItems,id:"FacetType-List"})},e.prototype.updateTotalRecords=function(){var t=this.getContext().resultTable.getTotal();this.recordsDiv.innerHTML=n.ag.getText("Facets","TotalRecordsLabel")+" "+t,0==t?(0,i.uC)(this.exportDiv).hide():(0,i.uC)(this.exportDiv).show()},e.prototype.renderProcessBlock=function(){this._processBlock=(0,i.uC)("div").addClass("".concat(this.cssPrefix,"-spinner")).addChild("div",(function(t){return t.addClass("".concat(r.YR,"-progress-win8"),s.z.getMobileCssClass()).addHtml('<div class="wBall" id="wBall_1"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_2"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_3"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_4"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_5"><div class="wInnerBall"></div></div>')})).toDOM()},e.prototype.onProcessStartCore=function(){this.options.showProcessIndicator&&!this._processBlock.parentNode&&this.bodyDiv&&(this.bodyDiv.childNodes.forEach((function(t){(0,i.uC)(t).hide()})),this.bodyDiv.appendChild(this._processBlock))},e.prototype.onProcessEndCore=function(){if(this.options.showProcessIndicator&&this._processBlock.parentNode)try{this._processBlock.parentNode.removeChild(this._processBlock)}catch(t){}finally{this.renderActiveFacet(!1)}},e.prototype.render=function(){var t=this;this.firstRender=!1,this.headerDiv=(0,i.uC)("div",this.slot).addClass("".concat(this.cssPrefix,"-header")).toDOM(),this.tabsDiv=(0,i.uC)("div",this.headerDiv).addClass("".concat(this.cssPrefix,"-tabs")).toDOM(),this.tabsUl=(0,i.uC)("ul",this.tabsDiv).addClass("".concat(this.cssPrefix,"-nav-tabs")).toDOM(),this.bodyDiv=(0,i.uC)("div",this.slot).addClass("".concat(this.cssPrefix,"-body")).toDOM();for(var e=0,o=this.facets;e<o.length;e++){var r=o[e];this.renderFacet(r)}(0,i.uC)(this.tabsDiv).addChild("div",(function(e){return t.addFacetButton=e.addClass("".concat(t.cssPrefix,"-add-button")).title(n.ag.getText("Facets","NewFacetTitle")).addChild("a",(function(t){return t.attr("href","javascript:void(0)")})).on("click",(function(e){return t.addClickHandler(e)})).toDOM()}));var s=(0,i.uC)("div",this.headerDiv).addClass("".concat(this.cssPrefix,"-manage")).toDOM();if(this.recordsDiv=(0,i.uC)("div",s).addClass("".concat(this.cssPrefix,"-total-recs")).toDOM(),this.options.showRefreshButton||this.options.showExportButton||this.options.showMaximizeButton){var a=(0,i.uC)("div",s).addClass("".concat(this.cssPrefix,"-total-buttons")).toDOM();this.options.showExportButton&&(this.exportDiv=(0,i.uC)("button",a).on("click",(function(){return t.exportHandler()})).addClass("".concat(this.cssPrefix,"-button")).addClass("".concat(this.cssPrefix,"-button-export")).title(n.ag.getText("Facets","ExportBtnTitle")).toDOM()),this.options.showRefreshButton&&(0,i.uC)("button",a).on("click",(function(){return t.refreshHandler()})).addClass("".concat(this.cssPrefix,"-button")).addClass("".concat(this.cssPrefix,"-button-refresh")).title(n.ag.getText("Facets","RefreshBtnTitle")),this.options.showMaximizeButton&&(this.maximizeButton=(0,i.uC)("button",a).on("click",(function(){return t.options.maximize2Window?t.maximizeHandler(!0):t.maximizeHandler()})).addClass("".concat(this.cssPrefix,"-button")).addClass("".concat(this.cssPrefix,"-button-maximize")).title(n.ag.getText("Facets","MaximizeBtnTitle")).toDOM())}},e.prototype.refreshHandler=function(){var t=this.getContext();t.fetchData({success:function(){t.refreshWidgets(o.WidgetGroup.Result)}})},e.prototype.exportHandler=function(){var t=this.getContext();new qt(t).show()},e.prototype.maximizeHandler=function(t){var e=(0,i.uC)(this.slot);if(t)e.toggleClass("".concat(r.YR,"-maximized-2window")),this.slot.classList.contains("".concat(r.YR,"-maximized-2window"))?(this.maximizeButton.title=n.ag.getText("Facets","RestoreBtnTitle"),this.maximizeButton.classList.toggle("".concat(this.cssPrefix,"-button-maximize"),!1),this.maximizeButton.classList.toggle("".concat(this.cssPrefix,"-button-restore"),!0)):(this.maximizeButton.title=n.ag.getText("Facets","MaximizeBtnTitle"),this.maximizeButton.classList.toggle("".concat(this.cssPrefix,"-button-restore"),!1),this.maximizeButton.classList.toggle("".concat(this.cssPrefix,"-button-maximize"),!0));else{var o=!this.slot.hasAttribute("data-is-maximized");o?(this.slot.setAttribute("data-is-maximized",""),this.maximizeButton.title=n.ag.getText("Facets","RestoreBtnTitle"),this.maximizeButton.classList.toggle("".concat(this.cssPrefix,"-button-maximize"),!1),this.maximizeButton.classList.toggle("".concat(this.cssPrefix,"-button-restore"),!0)):(this.slot.removeAttribute("data-is-maximized"),this.maximizeButton.title=n.ag.getText("Facets","MaximizeBtnTitle"),this.maximizeButton.classList.toggle("".concat(this.cssPrefix,"-button-restore"),!1),this.maximizeButton.classList.toggle("".concat(this.cssPrefix,"-button-maximize"),!0)),document.querySelectorAll("[data-hide-on-max]").forEach((function(t){o?t.setAttribute("style","display: none;"):t.removeAttribute("style")}))}this.facets.forEach((function(t){return t.onResize()}))},e.prototype.renderActiveFacet=function(t){var e=this;void 0===t&&(t=!0),this.tabsUl.querySelectorAll("li").forEach((function(t,n){t.classList.contains("active")&&t.classList.remove("active"),e.activeFacetIndex===n&&t.classList.add("active")})),this.bodyDiv.querySelectorAll(".".concat(r.YR,"-facet")).forEach((function(n,o){(0,i.uC)(n).hide(),e.activeFacetIndex===o&&((0,i.uC)(n).show(),t&&e.facets[o].refresh())}))},e.prototype.renderFacet=function(t){this.renderFacetTab(t);var e=this.renderFacetSlot(t);t.init(e)},e.prototype.renderFacetTab=function(t){var e=this;return(0,i.uC)("li",this.tabsUl).addChild("span",(function(n){return n.addClass("".concat(r.YR,"-facet-settings")).on("click",(function(n){n.stopPropagation(),e.settingsClickHandler(t)}))})).addChild("a",(function(e){return e.addText(t.title).attr("href","javascript:void(0)")})).addChild("span",(function(n){return n.addClass("".concat(r.YR,"-facet-close")).on("click",(function(n){n.stopPropagation(),e.closeClickHandler(t)}))})).on("click",(function(n){return e.selectClickHandler(t)})).toDOM()},e.prototype.renderFacetSlot=function(t){return(0,i.uC)("div",this.bodyDiv).addClass("".concat(r.YR,"-facet")).hide().toDOM()},e.prototype.refreshFacetTabs=function(){var t=this;this.tabsUl.querySelectorAll("li").forEach((function(e){t.tabsUl.removeChild(e)}));for(var e=0,n=this.facets;e<n.length;e++){var o=n[e];this.renderFacetTab(o)}},e.prototype.removeFacet=function(t){var e=this.facets.indexOf(t);if(e>=0){this.facets.splice(e,1);var n=this.tabsUl.childNodes[e];this.tabsUl.removeChild(n);var o=this.bodyDiv.childNodes[e];this.bodyDiv.removeChild(o),this.facets.length>0?this.activeFacetIndex=e<this.facets.length?e:this.facets.length-1:this.activeFacetIndex=-1,this.renderActiveFacet(),this.validateAddFacetButton()}},e.prototype.addClickHandler=function(t){var e=this;this.addMenu.showMenu({anchor:t.target,itemFilterCallback:this.menuItemsFilter,itemSelectedCallback:function(t){var n=e.createFacetTab(t.id),o=e.renderFacetSlot(n);n.init(o),n.showSettingsDialog().then((function(t){t?(e.facets.push(n),e.activeFacetIndex=e.facets.length-1,e.renderFacetTab(n),e.renderActiveFacet(),e.saveFacets()):e.bodyDiv.removeChild(o)})).catch((function(t){return console.error(t)}))}})},e.prototype.selectClickHandler=function(t){var e=this.facets.indexOf(t);this.setActiveFacet(e)},e.prototype.settingsClickHandler=function(t){var e=this;t.showSettingsDialog().then((function(t){t&&(e.refreshFacetTabs(),e.renderActiveFacet(),e.saveFacets())})).catch((function(t){return console.error(t)}))},e.prototype.closeClickHandler=function(t){var e=this;this.getDialogService().openConfirm(n.ag.getText("Facets","RemoveFacetDlgTitle"),n.ag.getText("Facets","RemoveFacetDlgContent").replace("{facetTitle}",t.title)).then((function(n){n&&(e.removeFacet(t),e.saveFacets())})).catch((function(t){return console.error(t)}))},e.prototype.clear=function(){this.firstRender=!0,this.slot.innerHTML=""},e.prototype.createDefaultFacetIfNotExist=function(){if(0===this.facets.length){var t=this.createFacetTab(U.DataGrid);this.facets.push(t),this.activeFacetIndex=0}},e.prototype.validateAddFacetButton=function(){this.addFacetButton.hidden=0==this.addMenu.getItems().filter(this.menuItemsFilter).length},e.prototype.setActiveFacet=function(t){this.activeFacetIndex!=t&&(this.activeFacetIndex=t,this.renderActiveFacet(),this.saveFacets(!0))},e.prototype.setOptions=function(t){n.P6.assignDeep(this.options,t)},e.prototype.getDialogService=function(){return this.getContext().getServices().getDialogService()},e.prototype.saveFacets=function(t){void 0===t&&(t=!1);var e=this.getQuery();e.innerData=e.innerData||{},e.innerData.facets={active:this.activeFacetIndex,items:this.facets.map((function(t){return t.saveToData()}))},e.fireChangedEvent({part:o.QueryChangePart.Facets,action:t?o.QueryChangeAction.Activate:o.QueryChangeAction.All,source:this})},e.prototype.reloadFacets=function(){for(var t=0,e=this.facets;t<e.length;t++){e[t].destroy()}this.loadFacets()},e.prototype.loadFacets=function(){var t=this.getQuery();if(this.facets=[],t.innerData&&t.innerData.facets){for(var e=0,n=t.innerData.facets.items;e<n.length;e++){var o=n[e],i=this.createFacetTab(o.type);i.loadFromData(o),this.facets.push(i)}var r=t.innerData.facets.active;this.activeFacetIndex=r>=0?r:this.facets.length-1}else this.createDefaultFacetIfNotExist()},e}(se),ce=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ue=function(t){function e(e){var n=t.call(this,e)||this;return n.options={defFormat:"csv",enableExport:!0},n.clickHandler=function(t){n.slot.hasAttribute("disabled")||new qt(n.context).show(n.options.defFormat)},n.group=o.WidgetGroup.All,n}return ce(e,t),e.prototype.getWidgetType=function(){return"exportWidget"},e.prototype.init=function(e,o){t.prototype.init.call(this,e,o),this.options=n.P6.assignDeep(this.options,o),this.slot.addEventListener("click",this.clickHandler)},e.prototype.refreshCore=function(){this.options.enableExport&&this.context.resultTable&&this.context.resultTable.getCachedCount()>0?this.slot.removeAttribute("disabled"):this.slot.setAttribute("disabled","")},e.prototype.destroyCore=function(){this.slot.removeAttribute("disabled"),this.slot.removeEventListener("click",this.clickHandler)},e}(o.Widget),de=function(){function t(t){if(this.selectState={columns:[]},this.funcMap={},!t||!t.slot)throw new Error("slot is required");if(!t||!t.query)throw new Error("query is required");this.slot=t.slot,this.query=t.query,this.onChanged=t.onChanged,this.dropSelectState(),this.dropState()}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-as"},enumerable:!1,configurable:!0}),t.prototype.render=function(){this.createFunctionMenu(),this.setInitialState(),this.changed()},t.prototype.setInitialState=function(){for(var t=this.query.getAggregationSettings(),e=t.getInternalGroups(),n=t.getAggregates(),o=0,i=e;o<i.length;o++){var r=i[o];this.state.groups.push({columns:r.columns})}for(var s=0,a=n;s<a.length;s++){var l=a[s];this.state.aggregates.push({colId:l.colId,funcId:l.funcId})}this.state.grandTotals=t.hasGrandTotals(),this.state.recordCount=t.hasRecordCount()},t.prototype.getAvailableColumns=function(){return this.query.getColumns().filter((function(t){return t.enabled}))},t.prototype.renderCore=function(){var t=this;this.slot.innerHTML="";for(var e=this.getAvailableColumns(),n=(0,i.uC)(this.slot),r=null,s=null,a=null,l=this.state.aggregates,c=-1,u=function(e){if(r&&r.columns.indexOf(e.id)>=0)return d.renderColumn(s,e,!0),"continue";if(null!=(r=d.getGroupForColumn(e.id))){c++;var u=(0,i.uC)("div",d.slot).addClass("".concat(d.cssPrefix,"-group")).data("gindex","".concat(c));return s=(0,i.uC)("div",u.toDOM()).addClass("".concat(d.cssPrefix,"-columns")),d.renderColumn(s,e,!0),"continue"}var h=l.filter((function(t){return t.colId==e.id}))[0];if(h){var p=(0,i.uC)("div",d.slot).addClass("".concat(d.cssPrefix,"-aggr"));return d.renderColumn(p,e,!0,h.funcId),p.addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-buttons")).addChild("button",(function(e){return e.addClass("".concat(t.cssPrefix,"-unaggr-btn")).title(o.i18n.getText("AggrSettings","UnaggrBtn")).on("click",t.removeAggrBtnClickHandler.bind(t))}))})),"continue"}if(d.selectState.columns.indexOf(e.id)>=0){if(null==a){var f=(0,i.uC)("div",d.slot).addClass("".concat(d.cssPrefix,"-selected"));a=(0,i.uC)("div",f.toDOM()).addClass("".concat(d.cssPrefix,"-columns"))}return d.renderColumn(a,e,!1),"continue"}d.renderColumn(n,e,!1)},d=this,h=0,p=e;h<p.length;h++){u(p[h])}if(a){var f=(0,i.uC)("div",a.toDOM().parentElement).addClass("".concat(this.cssPrefix,"-buttons"));f.addChild("button",(function(e){return e.addClass("".concat(t.cssPrefix,"-group-btn")).title(o.i18n.getText("AggrSettings","GroupBtn")).on("click",t.groupBtnClickHandler.bind(t))})),1==this.selectState.columns.length&&f.addChild("button",(function(e){return e.addClass("".concat(t.cssPrefix,"-aggr-btn")).title(o.i18n.getText("AggrSettings","AggrBtn")).on("click",t.aggrBtnClickHandler.bind(t))}))}(0,i.uC)(this.slot).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-counts")).addChild("label",(function(e){return e.addClass("eqjs-ctrl-switch").addChild("input",(function(e){e.attr("type","checkbox"),t.state.recordCount&&e.attr("checked",""),e.on("change",t.countsCheckboxChangeHandler.bind(t))})).addChild("span",(function(t){return t.addClass("slider round")})).addChild("span",(function(t){return t.addClass("switch-text").addText(o.i18n.getText("AggrSettings","GroupCountsLabel"))}))}))})).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-grandtotals")).addChild("label",(function(e){return e.addClass("eqjs-ctrl-switch").addChild("input",(function(e){e.attr("type","checkbox"),t.state.grandTotals&&e.attr("checked",""),e.on("change",t.grandCheckboxChangeHandler.bind(t))})).addChild("span",(function(t){return t.addClass("slider round")})).addChild("span",(function(t){return t.addClass("switch-text").addText(o.i18n.getText("AggrSettings","GrandTotalsLabel"))}))}))})),this.slot.querySelectorAll(".".concat(this.cssPrefix,"-group")).forEach((function(e){(0,i.uC)(e).addChild("div",(function(e){return e.addClass("".concat(t.cssPrefix,"-buttons")).addChild("button",(function(e){return e.addClass("".concat(t.cssPrefix,"-ungroup-btn")).title(o.i18n.getText("AggrSettings","UngroupBtn")).on("click",t.removeGroupBtnClickHandler.bind(t))}))}))})),this.validateCheckboxes()},t.prototype.validateCheckboxes=function(){if(0!==this.selectState.columns.length){for(var t,e,n=null,o=0;o<this.slot.childNodes.length;o++){(s=this.slot.childNodes[o]).classList.contains("".concat(this.cssPrefix,"-selected"))?t&&t.classList.contains("".concat(this.cssPrefix,"-column"))&&(e=t):s.classList.contains("".concat(this.cssPrefix,"-column"))&&t&&t.classList.contains("".concat(this.cssPrefix,"-selected"))&&(n=s),t=s}for(o=0;o<this.slot.childNodes.length;o++){(s=this.slot.childNodes[o]).classList.contains("".concat(this.cssPrefix,"-column"))&&s!=e&&s!=n&&s.firstElementChild.firstElementChild.setAttribute("disabled","")}var i=".".concat(this.cssPrefix,"-selected>.").concat(this.cssPrefix,"-columns>.").concat(this.cssPrefix,"-column"),r=this.slot.querySelectorAll(i);for(o=1;o<r.length-1;o++){var s;(s=r[o]).firstElementChild.firstElementChild.setAttribute("disabled","")}}},t.prototype.isValid=function(){var t=this.selectState.columns.length,e=this.state.aggregates.length>0,n=this.state.groups.length>0,o=this.state.grandTotals,i=this.state.recordCount;return!t&&(n?e||i:!!e&&(n||o))},t.prototype.getValidationMessage=function(){var t=this.selectState.columns.length,e=this.state.aggregates.length>0,n=this.state.groups.length>0,i=this.state.grandTotals,r=this.state.recordCount;return"".concat(t?o.i18n.getText("AggrSettings","SelectedError"):!n||e||r?!e||n||i?o.i18n.getText("AggrSettings","NoGroupsOrAggrError"):o.i18n.getText("AggrSettings","NoGroupsOrGrandError"):o.i18n.getText("AggrSettings","NoAggrOrCountError")," ")},t.prototype.getSettings=function(){for(var t=new n.$h(this.query),e=0,o=this.state.groups;e<o.length;e++){var i=o[e];t.addGroup({columns:i.columns})}for(var r=0,s=this.state.aggregates;r<s.length;r++){var a=s[r];t.addAggregateColumn(a.colId,a.funcId)}return this.state.grandTotals&&t.addGrandTotals(),this.state.recordCount&&t.addCounts(),t},t.prototype.renderColumn=function(t,e,n,o){var i=this;void 0===o&&(o=null),t.addChild("div",(function(t){t.data("colid",e.id);var r=o?"".concat(e.caption," (").concat(i.funcMap[o].caption,")"):e.caption;n?t.addClass("".concat(i.cssPrefix,"-column-used")).addText(r):t.addClass("".concat(i.cssPrefix,"-column")).addChild("label",(function(t){return t.addClass("checkbox").addChild("input",(function(t){t.attr("type","checkbox"),i.selectState.columns.indexOf(e.id)>=0&&t.attr("checked",""),t.on("change",i.colCheckboxChangeHandler.bind(i))})).addText(r)}))}))},t.prototype.getGroupForColumn=function(t){var e=this.getGroupIndexForColumn(t);return e>=0?this.state.groups[e]:null},t.prototype.getGroupIndexForColumn=function(t){for(var e=0;e<this.state.groups.length;e++){if(this.state.groups[e].columns.indexOf(t)>=0)return e}return-1},t.prototype.grandCheckboxChangeHandler=function(t){this.state.grandTotals=!this.state.grandTotals,this.onChanged&&this.onChanged()},t.prototype.countsCheckboxChangeHandler=function(t){this.state.recordCount=!this.state.recordCount,this.onChanged&&this.onChanged()},t.prototype.colCheckboxChangeHandler=function(t){var e=t.target.parentElement.parentElement.getAttribute("data-colid"),n=this.selectState.columns.indexOf(e);if(n>=0)this.selectState.columns.splice(n,1);else{this.selectState.columns.push(e);var o=this.getAvailableColumns();this.selectState.columns=this.selectState.columns.sort((function(t,e){return o.findIndex((function(e){return e.id==t}))-o.findIndex((function(t){return t.id==e}))}))}this.changed()},t.prototype.groupBtnClickHandler=function(){this.state.groups.push({columns:this.selectState.columns});var t=this.getAvailableColumns();this.state.groups=this.state.groups.sort((function(e,n){return t.findIndex((function(t){return t.id==e.columns[0]}))-t.findIndex((function(t){return t.id==n.columns[0]}))})),this.dropSelectState(),this.changed()},t.prototype.removeGroupBtnClickHandler=function(t){var e=t.target,n=Number.parseInt(e.parentElement.parentElement.getAttribute("data-gindex"));this.state.groups.splice(n,1),this.changed()},t.prototype.removeAggrBtnClickHandler=function(t){var e=t.target.parentElement.parentElement.querySelector(".".concat(this.cssPrefix,"-column-used")).getAttribute("data-colid"),n=this.state.aggregates.findIndex((function(t){return t.colId==e}));n>=0&&(this.state.aggregates.splice(n,1),this.changed())},t.prototype.aggrBtnClickHandler=function(t){var e=this,n=(this.query.getModel(),this.selectState.columns[0]),o=this.getAvailableColumns().filter((function(t){return t.id==n}))[0];this.functionMenu.showMenu({anchor:t.target,itemFilterCallback:function(t){return e.funcMap[t.id].appliedTypes.indexOf(o.expr.dataType)>=0},itemSelectedCallback:function(t){e.state.aggregates.push({colId:n,funcId:t.id}),e.dropSelectState(),e.changed()}})},t.prototype.clear=function(){this.dropSelectState(),this.dropState(),this.changed()},t.prototype.dropSelectState=function(){this.selectState={columns:[]}},t.prototype.dropState=function(){this.state={groups:[],aggregates:[],recordCount:!0,grandTotals:!1}},t.prototype.changed=function(){this.onChanged&&this.onChanged(),this.renderCore()},t.prototype.createFunctionMenu=function(){for(var t=this.query.getModel(),e=[],n=0,o=this.query.getModel().getAggrFunctions();n<o.length;n++){var i=o[n];if(i){this.funcMap[i.id]=i;var r=t.getAggrFunctionCaption(i.id),s={id:i.id,text:r};e.push(s)}}var a=this.slot.id;a&&(a+="-FunctionsMenu");var l={items:e,id:a,searchBoxAlwaysShown:!1,domWriteItemsId:!0};this.functionMenu=new u(l)},t}(),he=function(){function t(t){this.context=t,this.promise=null}return t.prototype.show=function(t){var e=this,n=t||this.context.getQuery();return this.query=this.context.createQuery(),this.query.loadFromData(n.toJSONData()),this.promise||(this.promise=new Promise((function(t,i){var r=e.context.getServices().getDialogService();e.body=e.renderBody();var s=r.open({title:o.i18n.getText("AggrSettings","AggrDialogTitle"),body:e.body,onSubmit:function(){return!(e.query.enableAggregation&&!e.renderer.isValid())&&(n.enableAggregation=e.query.enableAggregation,n.enableAggregation&&n.useAggregation((function(t){var n=e.renderer.getSettings();t.loadFromData(n.saveToData())})),n.fireChangedEvent({part:o.QueryChangePart.Aggregation,wasModified:!1}),t(),!0)},onCancel:function(){t()}});e.renderer=new de({slot:e.body.querySelector("#AggrSettingsComponent"),query:e.query,onChanged:function(){s.clearAlert();var t=e.renderer.isValid();if(!t){var n=e.renderer.getValidationMessage();s.showAlert(n,"warning")}s.getRootElement().querySelector(".kfrm-button.is-info").disabled=!t&&e.query.enableAggregation}}),e.query.enableAggregation&&e.renderer.render()}))),this.promise.catch((function(t){return console.error(t)})).finally((function(){return e.promise=null}))},t.prototype.renderBody=function(){var t=this;return(0,i.uC)("div").addChild("div",(function(e){return e.addClass("eqjs-as-enableaggr").addChild("label",(function(e){return e.addClass("eqjs-ctrl-switch").addChild("input",(function(e){e.attr("type","checkbox"),t.query.enableAggregation&&e.attr("checked",""),e.on("change",t.enableAggrCheckBoxChangeHandler.bind(t))})).addChild("span",(function(t){return t.addClass("slider round")})).addChild("span",(function(t){return t.addClass("switch-text").addText(o.i18n.getText("AggrSettings","EnableAggrLabel"))}))}))})).addChild("div",(function(t){return t.id("AggrSettingsComponent")})).toDOM()},t.prototype.enableAggrCheckBoxChangeHandler=function(t){if(this.query.enableAggregation=!this.query.enableAggregation,this.body.querySelector("#AggrSettingsComponent").innerHTML="",this.query.enableAggregation)this.renderer.render();else{var e=this.body?this.body.closest(".kdlg-modal").querySelector("footer .kfrm-button.is-info"):null;e&&(e.disabled=!1)}},t}(),pe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),fe=function(t){function e(e,n){var i=t.call(this,e)||this;return i.linkClickCallback=function(){new he(i.context).show(i.getQuery())},i.queryEventCallbackId=null,i.customQuery=n,i.group=o.WidgetGroup.Query|o.WidgetGroup.QueryStatus,i}return pe(e,t),e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.destroyCore(),this.attachQueryObserver()},Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-aggrb"},enumerable:!1,configurable:!0}),e.prototype.getWidgetType=function(){return"aggregationBar"},e.prototype.refreshCore=function(){this.render()},e.prototype.getLinkText=function(){var t=this.getQuery();if(t.enableAggregation){for(var e=t.getAggregationSettings(),n=e.getInternalGroups(),i=e.getAggregates(),r=[],s=t.getColumns(),a=0,l=n;a<l.length;a++){var c=l[a].columns.map((function(t){var e=s.find((function(e){return e.id==t}));return e?e.caption:""}));r.push("[".concat(c.join(", "),"]"))}for(var u=r.join(", "),d=[],h=t.getModel().getAggrFunctions(),p=function(t){var e=s.find((function(e){return e.id==t.colId})),n=h.find((function(e){return e.id==t.funcId}));e&&n&&d.push("".concat(e.caption," (").concat(n.caption,")"))},f=0,g=i;f<g.length;f++){p(g[f])}var m=d.join(", ");return"".concat(u||o.i18n.getText("AggrSettings","NoGroupsLabel")," ::: ").concat(m?"<".concat(m,">"):o.i18n.getText("AggrSettings","NoAggrsLabel"))}return o.i18n.getText("AggrSettings","EmptySettingsLabel")},e.prototype.render=function(){this.slot.classList.add("".concat(this.cssPrefix,"-panel"));var t=s.z.getMobileCssClass();t&&this.slot.classList.add(t),this.dialogLink||(this.dialogLink=document.createElement("a"),this.dialogLink.setAttribute("href","javascript:void(0)"),this.slot.appendChild(this.dialogLink)),this.dialogLink.textContent=this.getLinkText(),this.dialogLink.removeEventListener("click",this.linkClickCallback),this.dialogLink.addEventListener("click",this.linkClickCallback)},e.prototype.clear=function(){this.slot.innerHTML="",this.dialogLink=null},e.prototype.attachQueryObserver=function(){var t=this,e=this.getQuery();this.queryEventCallbackId=e.addChangedCallback((function(e){t.refreshCore()}))},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.destroyCore=function(){this.clear(),this.detachQueryObserver()},e.prototype.getQuery=function(){return this.customQuery||this.context.getQuery()},e}(o.Widget),ge=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),me=function(t){function e(e){var i=t.call(this,e)||this;return i.changeLocale=function(){var t=i.selectEl.value;n.ag.setCurrentLocale(t),i.context.refreshWidgets(o.WidgetGroup.All)},i.group=o.WidgetGroup.None,i}return ge(e,t),e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.clear(),this.render()},e.prototype.getWidgetType=function(){return"changeLocale"},e.prototype.render=function(){var t=n.ag.getLocales();if(t.length>1){this.selectEl=document.createElement("select");for(var e=0,o=t;e<o.length;e++){var i=o[e],r=document.createElement("option");r.value=i.locale,r.innerHTML=this.displayLocaleName(i),this.selectEl.appendChild(r)}this.selectEl.value=n.ag.getCurrentLocale(),this.selectEl.classList.add("eqv-select"),this.selectEl.addEventListener("change",this.changeLocale),this.slot.appendChild(this.selectEl)}},e.prototype.displayLocaleName=function(t){return t.englishName&&t.displayName?"".concat(t.englishName," - ").concat(t.displayName):t.englishName?t.englishName:t.displayName?t.displayName:t.locale},e.prototype.clear=function(){this.slot.innerHTML=""},e.prototype.destroyCore=function(){this.clear()},e}(o.Widget),ye=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ve=function(t){function e(e){var n=t.call(this,e)||this;return n.queryEventCallbackId=null,n.group=o.WidgetGroup.Query|o.WidgetGroup.QueryStatus,n.nameTemplate="{name}",n}return ye(e,t),e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),n&&n.nameTemplate&&(this.nameTemplate=n.nameTemplate),this.destroyCore(),this.attachQueryObserver()},Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-query-name"},enumerable:!1,configurable:!0}),e.prototype.getWidgetType=function(){return"queryName"},e.prototype.refreshCore=function(){this.render()},e.prototype.render=function(){this.slot.classList.add("".concat(this.cssPrefix));var t=s.z.getMobileCssClass();t&&this.slot.classList.add(t),this.nameSlot||(this.nameSlot=document.createElement("div"),this.nameSlot.classList.add("".concat(this.cssPrefix,"-text")),this.nameSlot.classList.add("".concat(this.cssPrefix,"-theme")),this.slot.appendChild(this.nameSlot)),this.asteriskSlot||(this.asteriskSlot=document.createElement("span"),this.asteriskSlot.innerHTML="*",this.asteriskSlot.classList.add("".concat(this.cssPrefix,"-asterisk")),this.slot.appendChild(this.asteriskSlot)),this.tooltipSlot||(this.tooltipSlot=document.createElement("span"),this.tooltipSlot.classList.add("".concat(this.cssPrefix,"-tooltip")),this.tooltipSlot.classList.add("".concat(this.cssPrefix,"-theme")),this.slot.appendChild(this.tooltipSlot));var e=this.context.getQuery(),n=e.getName(),o=e.getDescription()||"",i=this.nameTemplate.replace("{name}",n).replace("{description}",o);this.nameSlot.textContent=i,this.tooltipSlot.textContent=i,this.asteriskSlot.style.visibility=e.isModified()?"visible":"hidden"},e.prototype.clear=function(){this.slot.innerHTML="",this.nameSlot=null,this.tooltipSlot=null,this.asteriskSlot=null},e.prototype.attachQueryObserver=function(){var t=this,e=this.context.getQuery();this.queryEventCallbackId=e.addChangedCallback((function(e){t.refreshCore()}))},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.context.getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.destroyCore=function(){this.clear(),this.detachQueryObserver()},e}(o.Widget),Ce=function(){function t(){this.domRoots=[document],this.defaultViewOptions={enableExport:!0,disableConfirmationOnQueryChange:!1,queryFileExtensions:"text/xml,application/json",result:{clearResultOnQueryChange:!0,showChart:!0,showProcessIndicator:!0},widgets:{resultGrid:{addColumns:!1}},handlers:{}},this.viewOptions={},this.resultOptions={},this.enableExport=!1,this.resetContext(),this.renderSpinner()}return t.prototype.resetContext=function(){this.context=new o.EqContext,this.context.getServices().registerDialogServiceResolver((function(){return new i.w4}))},t.prototype.init=function(t){try{this.context.initStart(),t&&t.shadowRoots&&(this.domRoots=this.domRoots.concat(t.shadowRoots)),this.viewOptions=this.initOptions(t),this.resultOptions=n.P6.assignDeep(this.defaultViewOptions.result,this.viewOptions.result),this.initWidgets(this.viewOptions),this.context.init(this.viewOptions),this.initDone()}catch(t){this.context.throwError({action:"Init",sourceError:t})}},t.prototype.initOptions=function(t){return(t=n.P6.assignDeep(this.defaultViewOptions,t)).widgets.easyGrid||(t.widgets.easyGrid=t.widgets.resultGrid||{}),t.columnTitleFormat&&(this.context.options.columnTitleFormat=t.columnTitleFormat),t.widgets.easyGrid.paging=n.P6.assignDeep({},t.result.paging,t.widgets.easyGrid.paging),this.enableExport=t.enableExport||!1,t.widgets.exportWidget||(t.widgets.exportWidget={}),t.widgets.exportWidget.enableExport=this.enableExport,t},t.prototype.initWidgets=function(t){var e="QueryPanel",n="ColumnsPanel",o="EntitiesPanel",r="ResultPanel",s="ColumnsBar",a="FilterBar",l="ProcessBar",c="StatementPanel",u="ChangeLocale",d="QueryNameLabel",h="ResultFacetsPanel",p="ResultCount",f="ExportButton",g="AggregationBar";t.slots&&(d=t.slots.queryNameLabel||d,e=t.slots.queryPanel||e,n=t.slots.columnsPanel||n,s=t.slots.columnsBar||s,o=t.slots.entitiesPanel||o,r=t.slots.resultPanel||r,c=t.slots.statementPanel||c,l=t.slots.processBar||l,u=t.slots.changeLocale||u,h=t.slots.facetsPanel||h,p=t.slots.resultCountSpan||p,a=t.slots.filterBar||a,f=t.slots.exportButtons||f,g=t.slots.aggregationBar||g);var m=this.resolveElement(o);m&&!this.entitiesPanelWidget&&(this.entitiesPanelWidget=this.createEntitiesPanelWidget(m),this.context.addWidget(this.entitiesPanelWidget));var y=this.resolveElement(n);y&&!this.columnsPanelWidget&&(this.columnsPanelWidget=this.createColumnsPanelWidget(y),this.context.addWidget(this.columnsPanelWidget));var v=this.resolveElement(s);v&&!this.columnsBarWidget&&(this.columnsBarWidget=this.createColumnsBarWidget(v),this.context.addWidget(this.columnsBarWidget));var C=this.resolveElement(e);if(C&&!this.queryPanelWidget&&(this.queryPanelWidget=this.createQueryPanelWidget(C),this.context.addWidget(this.queryPanelWidget)),this.resultPanelSlot=this.resolveElement(r),this.resultPanelSlot){if(!this.resultGridWidget){var b=(0,i.MN)(this.resultPanelSlot,"div",{cssClass:"eqv-result-grid"});this.resultGridWidget=this.createResultGridWidget(b),this.context.addWidget(this.resultGridWidget)}if(this.resultOptions.showChart&&!this.chartWidget){var x=(0,i.MN)(this.resultPanelSlot,"div",{cssClass:"eqv-chart-panel"});x.style.display="none",this.chartWidget=this.createChartWidget(x),this.context.addWidget(this.chartWidget)}}var w=this.resolveElement(d);w&&!this.queryNameWidget&&(this.queryNameWidget=this.createQueryNameWidget(w),this.context.addWidget(this.queryNameWidget));var E=this.resolveElement(a);E&&!this.filterBarWidget&&(this.filterBarWidget=this.createFilterBarWidget(E),this.context.addWidget(this.filterBarWidget));var T=this.resolveElement("SortingBar");T&&!this.sortingBarWidget&&(this.sortingBarWidget=this.createSortingBarWidget(T),this.context.addWidget(this.sortingBarWidget));var D=this.resolveElement(l);D&&!this.processWidget&&(this.processWidget=this.createProcessWidget(D),this.context.addWidget(this.processWidget));var S=this.resolveElement(c);S&&!this.statementPanelWidget&&(this.statementPanelWidget=this.createStatementPanelWidget(S),this.context.addWidget(this.statementPanelWidget));var k=this.resolveElement(u);if(k){var M=this.createLocaleWidget(k);this.context.addWidget(M)}var B=this.resolveElement(h);B&&!this.resultFacetPanelWidget&&(this.resultFacetPanelWidget=this.createResultFacetsPanel(B),this.context.addWidget(this.resultFacetPanelWidget));var P=this.resolveElement(f);P&&!this.exportWidget&&(this.exportWidget=this.createExportWidget(P),this.context.addWidget(this.exportWidget)),this.resultCountSlot=this.resolveElement(p);var I=this.resolveElement(g);I&&!this.aggregationBarWidget&&(this.aggregationBarWidget=this.createAggregationBarWidget(I),this.context.addWidget(this.aggregationBarWidget))},t.prototype.initDone=function(){},t.prototype.resolveElement=function(t){if("string"==typeof t){for(var e=0,n=this.domRoots;e<n.length;e++){var o=n[e].getElementById(t);if(o)return o}return null}return t},t.prototype.resolveElementsByClassName=function(t){for(var e=[],n=0,o=this.domRoots;n<o.length;n++)for(var i=o[n].querySelectorAll("."+t),r=0;r<i.length;r++)e.push(i[r]);return e},t.prototype.displayRecordsCount=function(t){this.resultCountSlot&&void 0!==t&&(this.resultCountSlot.style.display="inline",this.resultCountSlot.innerHTML=n.ag.getText("MsgResultCount").replace("{0}",t.toString()))},t.prototype.getContext=function(){return this.context},t.prototype.setDialogService=function(t){this.context.getServices().registerDialogServiceResolver((function(){return t}))},t.prototype.executeQuery=function(t){console.warn("`executeQuery` is deprecated. Use `fetchData` instead"),this.fetchData(t)},t.prototype.fetchData=function(t){var e=this;t=t||{refresh:!0},this.context.clearResult(),this.context.getQuery().isEmpty()&&!this.resultOptions.fetchEmptyQueries||(this.showResultSpinner(),this.context.fetchData({elasticPaging:t.elasticPaging,success:function(n){e.hideResultSpinner(),e.toggleExportButtons(),e.displayRecordsCount(e.context.resultTable.getTotal()),!0===t.refresh&&e.context.refreshWidgets(o.WidgetGroup.Result),t.callback&&t.callback(),t.success&&t.success()},error:function(){e.hideResultSpinner()}}))},t.prototype.toggleExportButtons=function(){this.enableExport&&this.context.resultTable&&this.context.resultTable.getCachedCount()>0?this.enableExportButtons():this.disableExportButtons()},t.prototype.enableExportButtons=function(){},t.prototype.disableExportButtons=function(){},t.prototype.renderSpinner=function(){this._spinnerDiv=(0,i.uC)("div").addClass("eqjs-result-spinner").addChild("div",(function(t){return t.addClass("".concat(r.YR,"-progress-win8"),s.z.getMobileCssClass()).addHtml('<div class="wBall" id="wBall_1"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_2"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_3"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_4"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_5"><div class="wInnerBall"></div></div>')})).toDOM()},t.prototype.showResultSpinner=function(){if(this.resultOptions.showProcessIndicator&&this.resultPanelSlot&&!this._spinnerDiv.parentNode){for(var t=0;t<this.resultPanelSlot.children.length;t++){var e=this.resultPanelSlot.children[t];(0,i.uC)(e).hide()}this.resultPanelSlot.appendChild(this._spinnerDiv)}},t.prototype.hideResultSpinner=function(){if(this.resultOptions.showProcessIndicator&&this.resultPanelSlot&&this._spinnerDiv.parentNode){this._spinnerDiv.parentNode.removeChild(this._spinnerDiv);for(var t=0;t<this.resultPanelSlot.children.length;t++){var e=this.resultPanelSlot.children[t];(0,i.uC)(e).show()}}},t.prototype.createChartWidget=function(t){return this.resultOptions.chartWidgetResolver?this.resultOptions.chartWidgetResolver(t):new Jt(t)},t.prototype.createResultGridWidget=function(t){return this.resultOptions.resultGridResolver?this.resultOptions.resultGridResolver(t):new At(t)},t.prototype.createEntitiesPanelWidget=function(t){return new l(t)},t.prototype.createColumnsPanelWidget=function(t){return new T(t)},t.prototype.createQueryPanelWidget=function(t){return new xt(t)},t.prototype.createLocaleWidget=function(t){return new me(t)},t.prototype.createProcessWidget=function(t){return new _t(t)},t.prototype.createColumnsBarWidget=function(t){return new R(t)},t.prototype.createFilterBarWidget=function(t){return new Et(t)},t.prototype.createSortingBarWidget=function(t){return new Q(t)},t.prototype.createQueryNameWidget=function(t){return new ve(t)},t.prototype.createStatementPanelWidget=function(t){return new Lt(t)},t.prototype.createResultFacetsPanel=function(t){return new le(t)},t.prototype.createExportWidget=function(t){return new ue(t)},t.prototype.createAggregationBarWidget=function(t){return new fe(t)},t.prototype.detach=function(){this.entitiesPanelWidget&&(this.entitiesPanelWidget.destroy(),this.entitiesPanelWidget=null),this.columnsPanelWidget&&(this.columnsPanelWidget.destroy(),this.columnsPanelWidget=null),this.queryPanelWidget&&(this.queryPanelWidget.destroy(),this.queryPanelWidget=null),this.columnsBarWidget&&(this.columnsBarWidget.destroy(),this.columnsBarWidget=null),this.resultGridWidget&&(this.resultGridWidget.destroy(),this.resultGridWidget=null),this.chartWidget&&(this.chartWidget.destroy(),this.chartWidget=null),this.queryNameWidget&&(this.queryNameWidget.destroy(),this.queryNameWidget=null),this.processWidget&&(this.processWidget.destroy(),this.processWidget=null),this.localeWidget&&(this.localeWidget.destroy(),this.localeWidget=null),this.statementPanelWidget&&(this.statementPanelWidget.destroy(),this.statementPanelWidget=null),this.filterBarWidget&&(this.filterBarWidget.destroy(),this.filterBarWidget=null),this.sortingBarWidget&&(this.sortingBarWidget.destroy(),this.sortingBarWidget=null),this.statementWidget&&(this.statementWidget.destroy(),this.statementWidget=null),this.exportWidget&&(this.exportWidget.destroy(),this.exportWidget=null),this.resultFacetPanelWidget&&(this.resultFacetPanelWidget.destroy(),this.resultFacetPanelWidget=null),this.resultCountSlot&&(this.resultCountSlot.innerHTML="",this.resultCountSlot=null),this.resultPanelSlot&&(this.resultPanelSlot.innerHTML="",this.resultPanelSlot=null),this.domRoots=[document],this.resetContext()},t}(),be=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),xe=function(t){function e(){var e=t.call(this)||this;e.exportButtons=[],e.disabledClass="eqjs-disabled",e.dropdownContainerClass="eqv-dropdown-container",e.dropdownButtonClass="eqv-drop-button",e.dropdownContentClass="eqv-dropdown-content",e.dropdownShowClass="eqv-dropdown-show",e._querySaveTemplate='<div id="kdlg-dialog-form" class="kfrm-form">\n <div class="kfrm-fields label-above">\n <label for="kdlg-dialog-form-input" id="kdlg-dialog-form-content"></label>\n <input type="text" name="kdlg-dialog-form-input" id="kdlg-dialog-form-input" />\n </div>\n </div>',e.queryListMenu=null,e.fetchDataButtonClickHandler=e.fetchDataButtonClick.bind(e),e.clearQueryButtonClickHandler=e.clearQueryButtonClick.bind(e),e.newQueryButtonClickHandler=e.newQueryButtonClick.bind(e),e.loadQueryButtonClickHandler=e.loadQueryButtonClick.bind(e),e.saveQueryButtonClickHandler=e.saveQueryButtonClick.bind(e),e.copyQueryButtonClickHandler=e.copyQueryButtonClick.bind(e),e.removeQueryButtonClickHandler=e.removeQueryButtonClick.bind(e),e.storageButtonClickHandler=e.storageDropButtonClick.bind(e),e.saveQueryToFileButtonClickHandler=e.saveQueryToFileButtonClick.bind(e),e.loadQueryFromFileButtonClickHandler=e.loadQueryFromFileButtonClick.bind(e);var n=e;return e.exportButtonClickHandler=function(t){if(!this.classList.contains(n.disabledClass)){var e=this.getAttribute("data-format");n.getContext().exportResult({format:e})}},e.queryChangedHandler=function(t){var n=t.data;e.resultOptions.clearResultOnQueryChange&&(e.context.clearResult(),e.context.refreshWidgets(o.WidgetGroup.Result)),e.disableExportButtons(),e.resultCountSlot&&(e.resultCountSlot.style.display="none"),e.viewOptions.syncQueryOnChange&&e.syncQuery(),e.viewOptions.fetchDataOnChange&&(!n||n.part!=o.QueryChangePart.ExtraData&&n.part!=o.QueryChangePart.Facets)&&e.fetchData()},e.outsideClickHandler=function(t){var n=null;t.target.matches(".".concat(e.dropdownButtonClass))?n=t.target.parentElement.querySelector(".".concat(e.dropdownContentClass)):t.target.matches(".".concat(e.dropdownButtonClass," > span"))&&(n=t.target.parentElement.parentElement.querySelector(".".concat(e.dropdownContentClass)));for(var o=e.resolveElementsByClassName(e.dropdownContentClass),i=0;i<o.length;i++){var r=o[i];n!=r&&r.classList.contains(e.dropdownShowClass)&&r.classList.remove(e.dropdownShowClass)}},e}return be(e,t),e.prototype.refreshQueryList=function(){var t=this;this.queryListPanel&&(this.queryListPanel.innerHTML="",this.context.loadQueryList({success:function(e){var n=(0,i.uC)("ul",t.queryListPanel).addClass("list-group list-group-flush");e.map((function(e){n.addChild("li",(function(n){n.addClass("list-group-item").setStyle("cursor","pointer").data("id",e.id).text(e.name).on("click",(function(){t.checkIfQueryModified((function(){return t.loadQuery(e.id)}))}))}))}))}}))},e.prototype.initOptions=function(e){return void 0===(e=t.prototype.initOptions.call(this,e)).syncQueryOnChange&&(e.syncQueryOnChange=!0),e},e.prototype.initWidgets=function(e){var n=this;t.prototype.initWidgets.call(this,e);var o="eqjs-export",i="QueryContentJson",r="ClearQueryButton",s="NewQueryButton",a="LoadQueryButton",l="SaveQueryButton",c="CopyQueryButton",u="RemoveQueryButton",d="StorageDropButton",h="FetchDataButton",p="LoadQueryFromFileButton",f="SaveQueryToFileButton",g="QueryListPanel";e.slots&&(i=e.slots.queryContentInput||i,h=e.slots.fetchDataButton||h,r=e.slots.clearQueryButton||r,s=e.slots.newQueryButton||s,a=e.slots.loadQueryButton||a,l=e.slots.saveQueryButton||l,c=e.slots.copyQueryButton||c,u=e.slots.removeQueryButton||u,d=e.slots.storageButton||d,o=e.slots.exportClass||o,p=e.slots.loadQueryFromFileButton||p,f=e.slots.saveQueryToFileButton||f,g=e.slots.queryListPanel||g),this.exportButtons=this.domRoots.reduce((function(t,e){return t.concat(Array.from(e.querySelectorAll(".".concat(o))))}),[]),e.enableExport||this.hideExportButtons(),this.disableExportButtons();this.exportButtons.forEach((function(t){t.addEventListener("click",n.exportButtonClickHandler)})),this.fetchDataButton||(this.fetchDataButton=this.resolveElement(h),this.fetchDataButton||(this.fetchDataButton=this.resolveElement("ExecuteQueryButton")),this.fetchDataButton&&this.fetchDataButton.addEventListener("click",this.fetchDataButtonClickHandler)),this.clearQueryButton||(this.clearQueryButton=this.resolveElement(r),this.clearQueryButton&&this.clearQueryButton.addEventListener("click",this.clearQueryButtonClickHandler)),this.newQueryButton||(this.newQueryButton=this.resolveElement(s),this.newQueryButton&&this.newQueryButton.addEventListener("click",this.newQueryButtonClickHandler)),this.loadQueryButton||(this.loadQueryButton=this.resolveElement(a),this.loadQueryButton&&this.loadQueryButton.addEventListener("click",this.loadQueryButtonClickHandler)),this.saveQueryButton||(this.saveQueryButton=this.resolveElement(l),this.saveQueryButton&&this.saveQueryButton.addEventListener("click",this.saveQueryButtonClickHandler)),this.copyQueryButton||(this.copyQueryButton=this.resolveElement(c),this.copyQueryButton&&this.copyQueryButton.addEventListener("click",this.copyQueryButtonClickHandler)),this.removeQueryButton||(this.removeQueryButton=this.resolveElement(u),this.removeQueryButton&&this.removeQueryButton.addEventListener("click",this.removeQueryButtonClickHandler)),this.storageDropButton||(this.storageDropButton=this.resolveElement(d),this.storageDropButton&&this.storageDropButton.addEventListener("click",this.storageButtonClickHandler)),this.saveQueryToFileButton||(this.saveQueryToFileButton=this.resolveElement(f),this.saveQueryToFileButton&&this.saveQueryToFileButton.addEventListener("click",this.saveQueryToFileButtonClickHandler)),this.queryListPanel||(this.queryListPanel=this.resolveElement(g),this.queryListPanel||(this.queryListPanel=this.resolveElement("QueryListSlot")),this.queryListPanel&&this.context.addEventListener("ready",(function(){n.refreshQueryList()}))),this.loadQueryFromFileButton||(this.loadQueryFromFileButton=this.resolveElement(p),this.loadQueryFromFileButton&&(this.loadQueryFromFileInput=document.createElement("input"),this.loadQueryFromFileInput.type="file",this.loadQueryFromFileInput.accept=e.queryFileExtensions,this.loadQueryFromFileInput.style.display="none",document.body.appendChild(this.loadQueryFromFileInput),this.loadQueryFromFileInput.addEventListener("change",this.loadQueryFromFileInputSelect.bind(this)),this.loadQueryFromFileButton.addEventListener("click",this.loadQueryFromFileButtonClickHandler))),window.addEventListener("click",this.outsideClickHandler)},e.prototype.initDone=function(){t.prototype.initDone.call(this),this.context.getQuery().addChangedCallback(this.queryChangedHandler)},e.prototype.syncQuery=function(){var t=this;this.context.syncQuery({success:function(e){e.statement&&t.context.refreshWidgets(o.WidgetGroup.Statement)}})},e.prototype.disableExportButtons=function(){var t=this;this.exportButtons.forEach((function(e){e.disabled=!0,e.classList.contains(t.disabledClass)||e.classList.add(t.disabledClass)}))},e.prototype.enableExportButtons=function(){var t=this;this.exportButtons.forEach((function(e){e.disabled=!1,e.classList.contains(t.disabledClass)&&e.classList.remove(t.disabledClass)}))},e.prototype.hideExportButtons=function(){this.exportButtons.forEach((function(t){t.style.display="none"}))},e.prototype.clearQueryButtonClick=function(){this.context.clearQuery(),this.context.refreshWidgets(o.WidgetGroup.Statement)},e.prototype.createNewQuery=function(t){return this.context.newQuery(t)},e.prototype.loadQuery=function(t){t&&this.context.loadQuery({queryId:t,silent:!1})},e.prototype.saveQuery=function(t,e){var n=this;this.context.saveQuery({success:function(){t&&t(),n.context.getQuery().fireChangedEvent({part:o.QueryChangePart.Properties,wasModified:!1}),n.refreshQueryList()},error:e})},e.prototype.saveCurrentQuery=function(t,e){var n=this;void 0===t&&(t=!1);var i=this.context.getQuery();i.isNewbie||t?this.showSaveQueryDialog((function(t){return new Promise((function(e){t&&(i.regenerateId(),i.setName(t),i.fireChangedEvent({part:o.QueryChangePart.Properties,wasModified:!0}),n.saveQuery((function(){e({success:!0})}),(function(t){return e({success:!1,message:t})})))}))})):this.saveQuery(e)},e.prototype.checkIfQueryModified=function(t){var e=this;this.context.getQuery().isModified()&&!this.viewOptions.disableConfirmationOnQueryChange?this.showQueryChangedDialog((function(n){n?e.saveCurrentQuery(!1,t):t()})):t()},e.prototype.removeCurrentQuery=function(){var t=this;this.context.removeQuery({success:function(){t.createNewQuery({useStorage:!1}),t.resultCountSlot&&(t.resultCountSlot.style.display="none"),t.context.clearResult(),t.refreshQueryList()}})},e.prototype.showNewQueryDialog=function(t){var e=this.context.getServices().getDialogService(),o=n.ag.getText("NewQueryDefName"),r=e.open({title:n.ag.getText("NewQueryTitle"),body:this._querySaveTemplate,submitable:!0,closable:!0,cancelable:!0,submitOnEnter:!0,arrangeParents:!1,beforeOpen:function(){var t=document.getElementById("kdlg-dialog-form-input");o&&(t.value=o),document.getElementById("kdlg-dialog-form-content").innerHTML=n.ag.getText("NewQueryContent"),t.focus()},onSubmit:function(){var e=document.getElementById("kdlg-dialog-form-input").value;if(e&&e.replace(/\s/g,"").length>0){if(!t)return!0;r.disableButtons();var n=r.getRootElement().querySelector("header"),o=(0,i.uC)("div",n).addClass("eqjs-process-bar local").toDOM();t(e).then((function(t){n.removeChild(o),r.enableButtons(),t.success?r.close():r.showAlert(t.message,"error")}))}return!1}})},e.prototype.showQueryChangedDialog=function(t){this.context.getServices().getDialogService().openConfirm(n.ag.getText("QueryChangedTitle"),n.ag.getText("QueryChangedContent"),t)},e.prototype.showSaveQueryDialog=function(t){var e=this.context.getServices().getDialogService(),o=this.context.getQuery(),r=o.isNewbie?o.getName():n.ag.getText("SaveQueryDefName").replace("{queryName}",o.getName()),s=e.open({title:n.ag.getText("SaveQueryTitle"),body:this._querySaveTemplate,submitable:!0,closable:!0,cancelable:!0,submitOnEnter:!0,arrangeParents:!1,beforeOpen:function(){var t=document.getElementById("kdlg-dialog-form-input");t.value=r,document.getElementById("kdlg-dialog-form-content").innerHTML=n.ag.getText("SaveQueryContent"),t.focus()},onSubmit:function(){var e=document.getElementById("kdlg-dialog-form-input").value;if(e&&e.replace(/\s/g,"").length>0){if(!t)return!0;s.disableButtons();var n=s.getRootElement().querySelector("header"),o=(0,i.uC)("div",n).addClass("eqjs-process-bar local").toDOM();t(e).then((function(t){s.enableButtons(),n.removeChild(o),t.success?s.close():s.showAlert(t.message,"error")}))}return!1}})},e.prototype.showRemoveQueryDialog=function(t){var e=this.context.getServices().getDialogService(),o=this.context.getQuery();e.openConfirm(n.ag.getText("RemoveQueryTitle"),n.ag.getText("RemoveQueryContent").replace("{queryName}",o.getName()),t)},e.prototype.showSaveQueryToFileDialog=function(t){var e=this.getContext().getServices().getDialogService(),o=this.context.getQuery(),r=this.renderSaveToFileDialogBody(o.getName()),s=e.open({title:n.ag.getText("SaveQueryToFileDlgTitle"),body:r,onSubmit:function(){var e=r.querySelector("#kdlgFileNameInput"),n=e?e.value:"Query",o=r.querySelector("#kdlgFileFormatSelector"),a=o?o.value:"json";if(t){s.disableButtons();var l=s.getRootElement().querySelector("header"),c=(0,i.uC)("div",l).addClass("eqjs-process-bar local").toDOM();return t(n,a).then((function(t){s.enableButtons(),l.removeChild(c),t.success?s.close():s.showAlert(t.message,"error")})),!1}return!0}})},e.prototype.renderSaveToFileDialogBody=function(t,e){void 0===e&&(e="json");var o=s.z.isIE(),r=o?"kfrm-fields-ie col-ie-1-4 label-align-right":"kfrm-fields col-a-1 label-align-right",a=o?"kfrm-fields-ie is-horizontal":"kfrm-fields is-horizontal";return(0,i.uC)("div").addClass("kfrm-form").addChild("div",(function(o){o.addClass(r).addChild("label",(function(t){return t.attr("for","file_name").addText(n.ag.getText("FileNameLabel"))})).addChild("div",(function(n){return n.addClass(a).addChild("input",(function(e){return e.id("kdlgFileNameInput").name("file_name").type("text").attr("value",t)})).addChild("label",(function(t){return t.addText(".")})).addChild("div",(function(t){return t.addClass("kfrm-select").addChild("select",(function(t){return t.id("kdlgFileFormatSelector").addClass("kdlg-form-control").addOption({value:"xml",selected:"xml"===e}).addOption({value:"json",selected:"json"===e})}))}))}))})).toDOM()},e.prototype.newQueryButtonClick=function(){var t=this;this.checkIfQueryModified((function(){t.createNewQuery()}))},e.prototype.saveQueryToFileButtonClick=function(){var t=this;this.showSaveQueryToFileDialog((function(e,n){return new Promise((function(o){t.context.getQueryFile({fileName:e,format:n,success:function(){return o({success:!0})},error:function(t){return o({success:!1,message:t})}})}))}))},e.prototype.loadQueryFromFileButtonClick=function(){var t=this;this.checkIfQueryModified((function(){t.showLoadQueryFromFileDialog()}))},e.prototype.showLoadQueryFromFileDialog=function(){this.loadQueryFromFileInput.click()},e.prototype.loadQueryFromFileInputSelect=function(){var t=this,e=this.loadQueryFromFileInput.files.item(0),n=new FormData;n.append(e.name,e),this.loadQueryFromFileInput.value="",this.context.uploadQueryFile({data:n,success:function(){t.syncQuery(),t.refreshQueryList()}})},e.prototype.loadQueryButtonClick=function(){var t=this;this.context.loadQueryList({success:function(e){t.fillLoadQueryButtonMenu(e),t.queryListMenu.showMenu({anchor:t.loadQueryButton,adjustHeight:!1,itemSelectedCallback:function(e){t.checkIfQueryModified((function(){return t.loadQuery(e.id)}))}})}})},e.prototype.fillLoadQueryButtonMenu=function(t){var e=this.getContext().getQuery();this.queryListMenu=new u({items:t.map((function(t){return{id:t.id,text:t.name}})),selectedIds:e.getId()})},e.prototype.saveQueryButtonClick=function(){this.saveCurrentQuery()},e.prototype.copyQueryButtonClick=function(){this.saveCurrentQuery(!0)},e.prototype.removeQueryButtonClick=function(){var t=this;this.showRemoveQueryDialog((function(e){e&&t.removeCurrentQuery()}))},e.prototype.storageDropButtonClick=function(){var t=this,e=this.storageDropButton.parentElement.querySelector(".".concat(this.dropdownContentClass));e&&window.setTimeout((function(){return e.classList.toggle(t.dropdownShowClass)}),100)},e.prototype.fetchDataButtonClick=function(){this.fetchData()},e.prototype.detach=function(){var e=this;this.enableExportButtons(),this.exportButtons.forEach((function(t){t.removeEventListener("click",e.exportButtonClickHandler)})),this.exportButtons=[],this.fetchDataButton&&(this.fetchDataButton.removeEventListener("click",this.fetchDataButtonClickHandler),this.fetchDataButton=null),this.clearQueryButton&&(this.clearQueryButton.removeEventListener("click",this.clearQueryButtonClickHandler),this.clearQueryButton=null),this.newQueryButton&&(this.newQueryButton.removeEventListener("click",this.newQueryButtonClickHandler),this.newQueryButton=null),this.loadQueryButton&&(this.loadQueryButton.removeEventListener("click",this.loadQueryButtonClickHandler),this.loadQueryButton=null),this.saveQueryButton&&(this.saveQueryButton.removeEventListener("click",this.saveQueryButtonClickHandler),this.saveQueryButton=null),this.copyQueryButton&&(this.copyQueryButton.removeEventListener("click",this.copyQueryButtonClickHandler),this.copyQueryButton=null),this.removeQueryButton&&(this.removeQueryButton.removeEventListener("click",this.removeQueryButtonClickHandler),this.removeQueryButton=null),this.storageDropButton&&(this.storageDropButton.removeEventListener("click",this.storageButtonClickHandler),this.storageDropButton=null),this.saveQueryToFileButton&&(this.saveQueryToFileButton.removeEventListener("click",this.saveQueryToFileButtonClickHandler),this.saveQueryToFileButton=null),this.queryListPanel&&(this.queryListPanel=null),this.loadQueryFromFileButton&&(this.loadQueryFromFileInput&&document.body.removeChild(this.loadQueryFromFileInput),this.loadQueryFromFileButton.removeEventListener("click",this.loadQueryFromFileButtonClickHandler),this.loadQueryFromFileButton=null),t.prototype.detach.call(this)},e}(Ce),we=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ee=function(t){function e(){return t.call(this)||this}return we(e,t),e.prototype.initOptions=function(e){var n=this;return(e=t.prototype.initOptions.call(this,e)).result.fetchEmptyQueries=!0,this.context.getQuery().addChangedCallback((function(){n.resultOptions.clearResultOnQueryChange&&n.context.clearResult(),e.syncQueryOnChange&&n.context.syncQuery()})),this.context.addEventListener("ready",this.fetchData.bind(this)),e},e.prototype.initWidgets=function(e){var n=this;if(t.prototype.initWidgets.call(this,e),this.sortingBarWidget&&this.context.getQuery().addChangedCallback((function(t){var e=t.data;!e||e.part!=o.QueryChangePart.SortingColumns&&e.part!=o.QueryChangePart.Columns&&e.part!=o.QueryChangePart.All||n.fetchData()})),this.filterBarWidget){var i=this.filterBarWidget.getWidgetType();e.widgets[i]=e.widgets[i]||{},e.widgets[i].applyFilterCallback||(e.widgets[i].applyFilterCallback=function(){n.fetchData()})}},e.prototype.applyQueryFilter=function(){console.warn("applyQueryFilter is obsolete. Use fetchData instead"),this.fetchData()},e.prototype.fetchData=function(){t.prototype.fetchData.call(this,{refresh:!0})},e}(Ce),Te=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),De=function(t){function e(){return t.call(this)||this}return Te(e,t),e.prototype.createResultGridWidget=function(t){return new kt(t)},e.prototype.applyQueryFilter=function(){console.warn("applyQueryFilter is obsolete. Use fetchData instead"),this.fetchData()},e}(Ee),Se=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ke=function(t){function e(){var e=t.call(this)||this;return e.reports=[],e.reportCache=[],e.exportButtons=[],e.exportClass="eqjs-export",e.disabledClass="eqjs-disabled",e.enableExport=!1,e.useReportCache=!0,e.syncReportOnChange=!0,e._reportSaveTemplate='<div id="kdlg-dialog-form" class="kfrm-form">\n <div class="kfrm-fields label-above">\n <label for="kdlg-dialog-form-input" id="kdlg-dialog-form-content"></label>\n <input type="text" name="kdlg-dialog-form-input" id="kdlg-dialog-form-input" />\n <label for="kdlg-dialog-form-textarea" id="kdlg-dialog-form-desc-label"></label>\n <textarea type="text" name="kdlg-dialog-form-textarea" id="kdlg-dialog-form-textarea"></textarea>\n </div>\n </div>',e.context.useStoredQueryOnFetch=!0,e.exportButtonClickHandler=function(t,n){if(!t.classList.contains(e.disabledClass)){var o=t.getAttribute("data-format");e.context.exportResult({format:o})}},e.clearReportButtonClickHandler=e.clearReportButtonClick.bind(e),e.newReportButtonClickHandler=e.newReportButtonClick.bind(e),e.loadReportButtonClickHandler=e.loadReportButtonClick.bind(e),e.saveReportButtonClickHandler=e.saveReportButtonClick.bind(e),e.removeReportButtonClickHandler=e.removeReportButtonClick.bind(e),e.reloadReportDataButtonClickHandler=e.reloadReportDataButtonClick.bind(e),s.z.onMobileModeChanged((function(t){document.location.reload()})),e}return Se(e,t),e.prototype.initOptions=function(e){return void 0!==(e=t.prototype.initOptions.call(this,e)).syncQueryOnChange&&(this.syncReportOnChange=e.syncQueryOnChange),void 0!==e.syncReportOnChange&&(this.syncReportOnChange=e.syncReportOnChange),e.syncQueryOnChange=this.syncReportOnChange,void 0!==e.useReportCache&&(this.useReportCache=e.useReportCache),this.defaultReportId=e.defaultReportId,e},e.prototype.initDone=function(){var e=this;t.prototype.initDone.call(this),this.context.getQuery().addChangedCallback((function(t){var n=t.data;n&&("query.switched"==n.changeType?(e.context.clearResult(),e.context.refreshWidgets(o.WidgetGroup.Result),e.context.refreshWidgets(o.WidgetGroup.Query)):(e.disableExportButtons(),e.resultCountSlot&&(e.resultCountSlot.style.display="none")));var i=!n||"query.switched"==n.changeType||n.part==o.QueryChangePart.ExtraData||n.part==o.QueryChangePart.Facets,r=!1;e.syncReportOnChange&&(n&&"query.switched"!=n.changeType&&!n.noSync&&(r=!0,e.syncReport({success:function(){!i&&e.viewOptions.fetchDataOnChange&&e.fetchData()}})));!i&&e.resultOptions.clearResultOnQueryChange&&(e.context.clearResult(),e.context.refreshWidgets(o.WidgetGroup.Result)),i||r||!e.viewOptions.fetchDataOnChange||e.fetchData()})),window.setTimeout((function(){e.context.loadQueryList({success:function(t){Array.isArray(t)&&(e.reports=t,e.reports.filter((function(t){return t.id==e.defaultReportId})).length>0?e.renderReportList({reportId:e.defaultReportId}):e.renderReportList())}})}),100)},e.prototype.initWidgets=function(e){var n=this;t.prototype.initWidgets.call(this,e);var o="ClearReportButton",i="NewReportButton",r="LoadReportButton",s="SaveReportButton",a="RemoveReportButton",l="ReloadReportDataButton",c="ResultCount",u="ResultExportButtons",d=this.exportClass;e.slots&&(c=e.slots.resultCountSpan||c,u=e.slots.exportButtons||u,o=e.slots.clearReportButton||o,i=e.slots.newReportButton||i,r=e.slots.loadReportButton||r,s=e.slots.saveReportButton||s,a=e.slots.removeReportButton||a,l=e.slots.reloadReportDataButton||l,d=e.slots.exportClass||d),this.exportButtons=this.domRoots.reduce((function(t,e){return t.concat(Array.from(e.querySelectorAll(".".concat(d))))}),[]),this.enableExport=e.enableExport,this.enableExport?this.exportButtons.forEach((function(t){t.addEventListener("click",n.exportButtonClickHandler)})):this.hideExportButtons(),this.exportButtonsContainer=this.resolveElement(u),this.clearReportButton||(this.clearReportButton=this.resolveElement(o),this.clearReportButton&&this.clearReportButton.addEventListener("click",this.clearReportButtonClickHandler)),this.newReportButton||(this.newReportButton=this.resolveElement(i),this.newReportButton&&this.newReportButton.addEventListener("click",this.newReportButtonClickHandler)),this.loadReportButton||(this.loadReportButton=this.resolveElement(r),this.loadReportButton&&this.loadReportButton.addEventListener("click",this.loadReportButtonClickHandler)),this.saveReportButton||(this.saveReportButton=this.resolveElement(s),this.saveReportButton&&this.saveReportButton.addEventListener("click",this.saveReportButtonClickHandler)),this.removeReportButton||(this.removeReportButton=this.resolveElement(a),this.removeReportButton&&this.removeReportButton.addEventListener("click",this.removeReportButtonClickHandler)),this.reloadReportDataButton||(this.reloadReportDataButton=this.resolveElement(l),this.reloadReportDataButton||(this.reloadReportDataButton=this.resolveElement("UpdateReportButton")),this.reloadReportDataButton&&this.reloadReportDataButton.addEventListener("click",this.reloadReportDataButtonClickHandler)),this.reportListSlot=document.getElementById("ReportList"),this.resultCountSlot=this.resolveElement(c)},e.prototype.newReport=function(){var t=this,e=this.context.getServices().getDialogService().open({title:n.ag.getText("NewReportDlgTitle"),body:this._reportSaveTemplate,submitable:!0,closable:!0,cancelable:!0,submitOnEnter:!0,arrangeParents:!1,beforeOpen:function(){var t=document.getElementById("kdlg-dialog-form-input");t.value=n.ag.getText("NewReportDefName"),document.getElementById("kdlg-dialog-form-content").innerHTML=n.ag.getText("SaveReportDlgLabel"),document.getElementById("kdlg-dialog-form-desc-label").innerHTML=n.ag.getText("ReportDescLabel"),t.focus()},onSubmit:function(){var n=document.getElementById("kdlg-dialog-form-input").value;if(n&&n.replace(/\s/g,"").length>0){e.clearAlert(),e.disableButtons();var o=e.getRootElement().querySelector("header"),r=(0,i.uC)("div",o).addClass("eqjs-process-bar local").toDOM(),s=document.getElementById("kdlg-dialog-form-textarea").value;t.context.newQuery({name:n,description:s,success:function(){e.close();var n=t.context.getQuery(),o=n.getId();t.insertIntoReportList({id:o,name:n.getName(),description:n.getDescription()}),t.renderReportList({reportId:o})},error:function(t){o.removeChild(r),e.enableButtons(),e.showAlert(t,"error")}})}return!1}})},e.prototype.loadReport=function(t){var e=this;if(!t)throw"Empty report ID!";var n=this.findReportById(t);if(n){var i=this.context.getQuery(),r=function(){e.renderReportProps(),e.context.resultTable.clear(),i.fireChangedEvent({part:o.QueryChangePart.All,noSync:!0,changeType:"query.switched"}),e.fetchData()},s=this.useReportCache?this.getReportContentFromCache(n):null;s?(i.clear(),i.loadFromJson(s,{validate:!1}),r()):this.context.loadQuery({queryId:t,silent:!0,success:function(){e.saveReportContentInCache(n,i.toJSON()),r()}}),this.setActiveReport(t)}},e.prototype.saveCurrentReportAs=function(){var t=this,e=this.context.getQuery(),r=this.context.getServices().getDialogService().open({title:n.ag.getText("SaveReportDlgTitle"),body:this._reportSaveTemplate,submitable:!0,closable:!0,cancelable:!0,submitOnEnter:!0,arrangeParents:!1,beforeOpen:function(){var t=document.getElementById("kdlg-dialog-form-input");t.value=e.getName(),document.getElementById("kdlg-dialog-form-content").innerHTML=n.ag.getText("SaveReportDlgLabel"),document.getElementById("kdlg-dialog-form-desc-label").innerHTML=n.ag.getText("ReportDescLabel"),document.getElementById("kdlg-dialog-form-textarea").value=e.getDescription(),t.focus()},onSubmit:function(){var s=document.getElementById("kdlg-dialog-form-input").value;if(s&&s.replace(/\s/g,"").length>0){e.setId(n.P6.generateId(s.replace(/\s/g,""))),r.clearAlert(),r.disableButtons();var a=r.getRootElement().querySelector("header"),l=(0,i.uC)("div",a).addClass("eqjs-process-bar local").toDOM(),c=document.getElementById("kdlg-dialog-form-textarea").value;e.setDescription(c),t.context.newQuery({clearQuery:!1,name:s,success:function(){r.close(),t.context.refreshWidgets(o.WidgetGroup.Query);var n=t.context.getQuery().getId();t.fetchData(),t.insertIntoReportList({id:n,name:e.getName(),description:e.getDescription()}),t.renderReportList({reportId:n}),t.setActiveReport(n),t.renderReportProps()},error:function(t){a.removeChild(l),r.enableButtons(),r.showAlert(t,"error")}})}return!1}})},e.prototype.removeCurrentReport=function(){var t=this,e=this.context.getQuery();this.context.getServices().getDialogService().openConfirm(n.ag.getText("RemoveReportDlgTitle"),n.ag.getText("RemoveReportContent").replace("{reportName}",e.getName())).then((function(n){if(n){var o=e.getId();t.context.removeQuery({queryId:o,success:function(){var e=t.removeFromReportList(o);t.renderReportList({reportIndex:e})}})}}))},e.prototype.syncReport=function(t){var e=this;if(this.useReportCache){var n=this.context.getQuery(),i=this.findReportById(n.getId());i&&(i.lastUpdated=Date.now(),this.saveReportContentInCache(i,n.toJSON()))}this.context.syncQuery({success:function(n){n.query&&e.context.refreshWidgets(o.WidgetGroup.Query),n.statement&&e.context.refreshWidgets(o.WidgetGroup.Statement),t&&t.success&&t.success(n)}})},e.prototype.setActiveReport=function(t){for(var e=this.reportListSlot.querySelectorAll("li"),n=0;n<e.length;n++){var o=e[n];o.classList.remove("active"),o.getAttribute("data-rid")===t&&o.classList.add("active")}},e.prototype.renderReportProps=function(){var t=this.context.getQuery();document.getElementById("ReportTitle").innerHTML=t.getName();var e=document.querySelector(".columns-bar");if(e){e.innerHTML="<strong>Columns:</strong>";for(var n=0,o=t.getColumns();n<o.length;n++){var i=o[n];e.innerHTML+='<span class="label label-default">'+i.caption+"</span> "}}},e.prototype.renderReportList=function(t){if(this.renderReportPanels(),!this.reportListSlot.matches("li")){this.reportListSlot.innerHTML="",t=t||{reportId:this.reports.length>0?this.reports[0].id:null};var e=document.createElement("ul");e.className="list-group list-group-flush",this.reportListSlot.appendChild(e);for(var n=0,o=this.reports;n<o.length;n++){var i=o[n];this.renderReportItemInList(i,e)}if(t.reportId&&this.loadReport(t.reportId),void 0!==t.reportIndex){var r=t.reportIndex;r>=this.reports.length&&(r=this.reports.length-1),r<0&&this.reports.length>0&&(r=0),r>=0&&this.loadReport(this.reports[r].id)}}},e.prototype.detach=function(){var e=this;this.exportButtonsContainer&&(this.showExportButtons(),this.exportButtons.forEach((function(t){t.removeEventListener("click",e.exportButtonClickHandler)})),this.exportButtons=[],this.exportButtonsContainer=null),this.clearReportButton&&(this.clearReportButton.removeEventListener("click",this.clearReportButtonClickHandler),this.clearReportButton=null),this.newReportButton&&(this.newReportButton.removeEventListener("click",this.newReportButtonClickHandler),this.newReportButton=null),this.loadReportButton&&(this.loadReportButton.removeEventListener("click",this.loadReportButtonClickHandler),this.loadReportButton=null),this.saveReportButton&&(this.saveReportButton.addEventListener("click",this.saveReportButtonClickHandler),this.saveReportButton=null),this.removeReportButton&&(this.removeReportButton.removeEventListener("click",this.removeReportButtonClickHandler),this.removeReportButton=null),this.reloadReportDataButton&&(this.reloadReportDataButton.removeEventListener("click",this.reloadReportDataButtonClickHandler),this.removeReportButton=null),this.reportListSlot&&(this.reportListSlot.innerHTML="",this.reportListSlot=null),this.resultCountSlot&&(this.resultCountSlot.innerHTML="",this.resultCountSlot=null),t.prototype.detach.call(this)},e.prototype.renderReportItemInList=function(t,e){var n=this;e||(e=this.reportListSlot.querySelector("ul"));var o=t.name||t.description||"",i=document.createElement("li");i.className="list-group-item",i.style.cursor="pointer",i.setAttribute("data-rid",t.id),i.innerText=o,t.description&&(i.title=t.description),i.addEventListener("click",(function(t){var e=t.target.getAttribute("data-rid");n.loadReport(e)})),e.appendChild(i)},e.prototype.renderReportPanels=function(){var t=document.getElementById("ReportsContainer"),e=document.getElementById("NoReportPanel");this.reports.length>0?(this.hideElement(e),this.showElement(t)):(this.hideElement(t),this.showElement(e))},e.prototype.hideElement=function(t){t&&(t.style.visibility="hidden")},e.prototype.showElement=function(t){t&&t.style.removeProperty("visibility")},e.prototype.insertIntoReportList=function(t){this.reports.push(t)},e.prototype.removeFromReportList=function(t){var e=this.indexOfReportById(t);return e>=0&&this.reports.splice(e,1),e},e.prototype.indexOfReportById=function(t){for(var e=0;e<this.reports.length;e++)if(this.reports[e].id===t)return e;return-1},e.prototype.clearReportButtonClick=function(){this.clearErrors(),this.context.clearQuery()},e.prototype.reloadReportDataButtonClick=function(){this.fetchData()},e.prototype.saveReportButtonClick=function(){this.saveCurrentReportAs()},e.prototype.loadReportButtonClick=function(){this.loadReport("LastQuery")},e.prototype.removeReportButtonClick=function(){this.removeCurrentReport()},e.prototype.newReportButtonClick=function(){this.newReport()},e.prototype.errorHandler=function(t){},e.prototype.clearErrors=function(){},e.prototype.disableExportButtons=function(){this.hideExportButtons()},e.prototype.enableExportButtons=function(){this.showExportButtons()},e.prototype.hideExportButtons=function(){this.exportButtonsContainer&&(this.exportButtonsContainer.style.display="none")},e.prototype.showExportButtons=function(){this.exportButtonsContainer&&(this.exportButtonsContainer.style.display="initial")},e.prototype.saveReportContentInCache=function(t,e){var n=this.findReportCacheItem(t.id);n||(n={id:t.id},this.reportCache.push(n)),n.lastUpdated=t.lastUpdated,n.content=e},e.prototype.getReportContentFromCache=function(t){var e=this.findReportCacheItem(t.id);return e&&e.lastUpdated===t.lastUpdated?e.content:null},e.prototype.findReportById=function(t){for(var e=0,n=this.reports;e<n.length;e++){var o=n[e];if(o.id===t)return o}return null},e.prototype.findReportCacheItem=function(t){for(var e=0,n=this.reportCache;e<n.length;e++){var o=n[e];if(o.id===t)return o}return null},e}(Ce);n.ag.addMapper((function(t){if(t||t.texts)for(var e in t.texts)switch(e){case"PredicateTitle":t.texts.ConditionGroupTitle=t.texts[e];break;case"RootPredicateTitle":t.texts.RootConditionGroupTitle=t.texts[e];break;case"ErrIncorrectPredicateTitleFormat":t.texts.ErrIncorrectGroupTitleFormat=t.texts[e];break;case"ButtonAddPredicate":t.texts.ButtonAddGroup=t.texts[e];break;case"ButtonDelete":t.texts.CmdDelete=t.texts[e];break;case"ButtonClear":t.texts.CmdClear=t.texts[e];break;case"ButtonEnable":t.texts.CmdToggleEnable=t.texts[e];break;case"ButtonAddCondition":t.texts.CmdAddCondition=t.texts[e];break;case"ButtonAddGroup":t.texts.CmdAddCondGroup=t.texts[e]}})),n.ag.updateDefaultTexts({AltMenuAttribute:"Attribute",AltMenuConstantExpression:"Constant expression",ButtonApply:"Apply",ButtonCancel:"Cancel",ButtonClose:"Close",ButtonNext:"Next",ButtonPrev:"Prev",ButtonNow:"Now",ButtonOK:"OK",MenuEnable:"Enabled",MenuParameterization:"Parameterized",MenuJoinCond:"Use in JOIN",CmdClear:"Clear",CmdDelete:"Delete",CmdToggleEnable:"Toggle enable",CmdToggleEnableCustom:"Custom Expression columns are not supported",CmdAddCondition:"Add condition",CmdAddCondGroup:"Add group of conditions",ButtonSelectAll:"Select all",ButtonDeselectAll:"Clear selection",ButtonAddColumns:"Add column(s)",ButtonAddConditions:"Add condition(s)",CmdClickToAddCondition:"[Add new condition]",CmdDeleteRow:"Delete this row",ErrIncorrectGroupTitleFormat:"Incorrect condition group title format",ErrNotNumber:" is not a number",ErrIncorrectInteger:"Incorrect integer value",ErrIncorrectNumberList:"Incorrect list format",False:"False",LinkTypeAll:"all",LinkTypeAny:"any",LinkTypeNone:"none",LinkTypeNotAll:"not all",ConjAll:"and",ConjAny:"or",ConjNotAll:"and",ConjNone:"or",MsgApplySelection:"[Apply selection]",MsgAs:"as",MsgEmptyList:"(empty list)",MsgEmptyListValue:"[select value]",MsgEmptyScalarValue:"[enter value]",MsgSubQueryValue:"[edit sub-query]",MsgEmptyAttrValue:"[select attribute]",MsgEmptyOperator:"[Unrecognized operator]",MsgEmptyCustomSql:"[enter SQL expression]",MsgCustomSql:"[Custom SQL]",MsgNoResult:"No result",MsgResultCount:"{0} records found",MsgOf:"of",ConditionGroupTitle:"{lt} of the following apply",RootConditionGroupTitle:"Select records where {lt} of the following apply",StrAddConditions:"Add conditions",SubQueryDialogTitle:"Edit sub-query",SubQueryColumnTitle:"Column:",SubQueryEmptyColumn:"[select column]",SubQueryQueryPanelCaption:"Conditions",True:"True",ButtonSorting:"Sorting",ButtonToAggr:"Change to aggregate column",ButtonToSimple:"Change to simple column",ButtonFormat:"Display format",CmdAscending:"Ascending",CmdClickToAddColumn:"[Add new column]",CmdDeleteColumn:"Delete column",CmdDeleteSorting:"Delete sorting",CmdDescending:"Descending",CmdGroupSort:"Sorting",CmdGroupFormat:"Display format",CmdNotSorted:"Not sorted",ColTypeAggrFunc:"Aggregate function",ColTypeCompound:"Calculated",ColTypeGroup:"Column type",ColTypeSimple:"Simple column",HeaderExpression:"Expression",HeaderSorting:"Sorting",HeaderTitle:"Title",SortHeaderColumn:"Column",SortHeaderSorting:"Sorting",StrAddColumns:"Add columns",CustomExpression:"Custom Expression",AddAllForEntityText:"[Add all attributes]",CmdMoveToStart:"Move to start",CmdMoveRight:"Move right",CmdMoveLeft:"Move left",CmdMoveToEnd:"Move to the end",CmdMoveUp:"Move up",CmdMoveDown:"Move down",ButtonMenu:"Show menu",CmdToSimple:"Not aggregated",CmdMoveToFirst:"Move to the first",CmdMoveToPrev:"Move to the previous",CmdMoveToNext:"Move to the next",CmdMoveToLast:"Move to the last",CmdHiddenColumn:"Hidden",RowButtonTitle:"Click to see the available options",EntityToggle:"Toggle entity",StrNoFilterDefined:"No filter defined",StrNoFilterClickToAdd:"No filter defined. Click to add a new condition",HintHours:"Hours",HintMinutes:"Minutes",RemoveQueryTitle:"Confirmation",RemoveQueryContent:"Remove query [{queryName}]?",NewQueryTitle:"New query",NewQueryContent:"New query name: ",NewQueryDefName:"New query",SaveQueryTitle:"Save query",SaveQueryContent:"Query name: ",SaveQueryDefName:"{queryName} copy",QueryChangedTitle:"Confirmation",QueryChangedContent:"The query was changed. Do you want to save it first?",UpdateQuerySelector:"[click here to load the query]",FileNameLabel:"File name: ",SaveQueryToFileDlgTitle:"Save query to file",NewReportDefName:"New report",NewReportDlgTitle:"New report",SaveReportDlgTitle:"Save report",SaveReportDlgLabel:"Report name:",ReportDescLabel:"Description: ",RemoveReportDlgTitle:"Remove report",RemoveReportContent:"Are you sure you want to remove '{reportName}'?",Facets:{TotalRecordsLabel:"Total records:",AddMenuItems:{Chart:"Chart",Pivot:"Pivot table",DataTable:"Data table"},LoadDataDlgTitle:"Downloading data",LoadDataDlgContent:"Records loaded: {loadedRecs}/{totalRecs}",RefreshBtnTitle:"Refresh",ExportBtnTitle:"Export",MaximizeBtnTitle:"Maximize",RestoreBtnTitle:"Restore Down",RemoveFacetDlgTitle:"Remove facet",RemoveFacetDlgContent:"Are you sure, that you want to delete {facetTitle} tab?",DefaultDlgTitle:"Setup facet",DefaultFacetTitle:"",NewFacetTitle:"New Facet",TabNameLabel:"Tab name",ErrQueryChanged:"FAILED TO DISPLAY. QUERY WAS CHANGED",ErrNotEnoughData:"We can't display the graph because not all data for this query is loaded. \n The total number of records: {totalRecs}, currently loaded: {cachedRecs}. \n You can [download the result]. Please note: this may take some time and consume a lot of memory.",ErrTooMuchData:"Too much data. The grid is not able to display it",Chart:{FacetTitle:"Chart",DlgTitle:"Chart settings",DataColumnSelectorLabel:"Data column",LabelColumnSelectorLabel:"Label column",ChartTypeSelectorLabel:"Chart type",ShowLegendLabel:"Show legend (if available)"},Pivot:{FacetTitle:"Pivot table",DlgTitle:"Pivot settings",SwapBtnTitle:"Swap column and row fields",ColumnFieldSelectorLabel:"Column field",RowFieldSelectorLabel:"Row field",CellDataSelectorLabel:"Cell data",TotalsRowLabel:"Totals row",TotalsColLabel:"Totals column",TotalGridLabel:"Total"},DataTable:{FacetTitle:"Result table",DlgTitle:"Table facet settings"}},TotalsDlgLabel:"Totals",GrandTotalsLabel:"Grand totals",TotalsDlgTitle:"Select totals",ExportDlgTitle:"Export result",ExportDlgFmtLabel:"Format",csv:"CSV",excel:"Excel",pdf:"PDF","excel-html":"HTML (Excel-compatible)",AggrSettings:{GroupBtn:"Group selected column(s)",UngroupBtn:"Ungroup columns",AggrBtn:"Aggregate selected column",UnaggrBtn:"Remove column aggregation",GrandTotalsLabel:"Show grand totals",GroupCountsLabel:"Show record count for groups",AggrDialogTitle:"Aggregation/grouping",EnableAggrLabel:"Enable aggregation",SelectedError:"Complete the action with selected column(s)",NoGroupsOrAggrError:"Add at least one group or aggregation",NoGroupsOrGrandError:"Add at least one group, or enable grand totals",NoAggrOrCountError:"Add at least one aggregation, or enable records count",NoGroupsLabel:"No groups",NoAggrsLabel:"No aggregations",EmptySettingsLabel:"[ Click to setup ]"},ChartType:{Area:"Area chart",Bar:"Bar chart",Column:"Column chart",Combo:"Combo chart",Doughnut:"Doughnut chart",Polar:"Polar chart",Radar:"Radar chart",Histogram:"Histogram chart",Line:"Line chart",SteppedLine:"Stepped line chart",Pie:"Pie chart"}}),o.EqServiceProvider.prototype.registerDialogServiceResolver=function(t){this.dialogServiceResolver=t},o.EqServiceProvider.prototype.getDialogService=function(){if(!this.dialogService){if(!this.dialogServiceResolver)throw"DialogServiceResolver is not defined";this.dialogService=this.dialogServiceResolver()}return this.dialogService},Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),window.NodeList&&!window.NodeList.prototype.forEach&&(window.NodeList.prototype.forEach=Array.prototype.forEach),Array.prototype.findIndex||(Array.prototype.findIndex=function(t){if(null==this)throw new TypeError("Array.prototype.findIndex called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,n=Object(this),o=n.length>>>0,i=arguments[1],r=0;r<o;r++)if(e=n[r],t.call(i,e,r,n))return r;return-1})}(),__webpack_exports__}()}));
3
- //# sourceMappingURL=easyquery.ui.min.js.map