cronapp-framework-js 2.9.0 → 2.9.1-SNAPSHOT.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (366) hide show
  1. package/components/crn-enterprise-combobox-multiple.components.json +1 -1
  2. package/components/crn-enterprise-dynamic-combobox.components.json +1 -1
  3. package/components/cron-breadcrumbs.components.json +2 -2
  4. package/components/cron-ordered-list.components.json +8 -8
  5. package/components/templates/accordion.template.html +6 -6
  6. package/components/templates/cron-breadcrumbs.template.html +5 -3
  7. package/components/templates/cron-dynamic-menu.template.html +1 -1
  8. package/components/templates/cron-grid.designtime.html +63 -64
  9. package/components/templates/list.template.html +1 -1
  10. package/components/templates/radiogroup.template.html +1 -1
  11. package/css/themes/aquamarine.min.css +6 -0
  12. package/css/themes/cerulean.min.css +4 -3
  13. package/css/themes/custom/aquamarine/custom-aquamarine.min.css +3085 -0
  14. package/css/themes/custom/aquamarine/font/WorkSans-Black.woff +0 -0
  15. package/css/themes/custom/aquamarine/font/WorkSans-Black.woff2 +0 -0
  16. package/css/themes/custom/aquamarine/font/WorkSans-BlackItalic.woff +0 -0
  17. package/css/themes/custom/aquamarine/font/WorkSans-BlackItalic.woff2 +0 -0
  18. package/css/themes/custom/aquamarine/font/WorkSans-Bold.woff +0 -0
  19. package/css/themes/custom/aquamarine/font/WorkSans-Bold.woff2 +0 -0
  20. package/css/themes/custom/aquamarine/font/WorkSans-BoldItalic.woff +0 -0
  21. package/css/themes/custom/aquamarine/font/WorkSans-BoldItalic.woff2 +0 -0
  22. package/css/themes/custom/aquamarine/font/WorkSans-ExtraBold.woff +0 -0
  23. package/css/themes/custom/aquamarine/font/WorkSans-ExtraBold.woff2 +0 -0
  24. package/css/themes/custom/aquamarine/font/WorkSans-ExtraBoldItalic.woff +0 -0
  25. package/css/themes/custom/aquamarine/font/WorkSans-ExtraBoldItalic.woff2 +0 -0
  26. package/css/themes/custom/aquamarine/font/WorkSans-ExtraLight.woff +0 -0
  27. package/css/themes/custom/aquamarine/font/WorkSans-ExtraLight.woff2 +0 -0
  28. package/css/themes/custom/aquamarine/font/WorkSans-ExtraLightItalic.woff +0 -0
  29. package/css/themes/custom/aquamarine/font/WorkSans-ExtraLightItalic.woff2 +0 -0
  30. package/css/themes/custom/aquamarine/font/WorkSans-Italic.woff +0 -0
  31. package/css/themes/custom/aquamarine/font/WorkSans-Italic.woff2 +0 -0
  32. package/css/themes/custom/aquamarine/font/WorkSans-Light.woff +0 -0
  33. package/css/themes/custom/aquamarine/font/WorkSans-Light.woff2 +0 -0
  34. package/css/themes/custom/aquamarine/font/WorkSans-LightItalic.woff +0 -0
  35. package/css/themes/custom/aquamarine/font/WorkSans-LightItalic.woff2 +0 -0
  36. package/css/themes/custom/aquamarine/font/WorkSans-Medium.woff +0 -0
  37. package/css/themes/custom/aquamarine/font/WorkSans-Medium.woff2 +0 -0
  38. package/css/themes/custom/aquamarine/font/WorkSans-MediumItalic.woff +0 -0
  39. package/css/themes/custom/aquamarine/font/WorkSans-MediumItalic.woff2 +0 -0
  40. package/css/themes/custom/aquamarine/font/WorkSans-Regular.woff +0 -0
  41. package/css/themes/custom/aquamarine/font/WorkSans-Regular.woff2 +0 -0
  42. package/css/themes/custom/aquamarine/font/WorkSans-SemiBold.woff +0 -0
  43. package/css/themes/custom/aquamarine/font/WorkSans-SemiBold.woff2 +0 -0
  44. package/css/themes/custom/aquamarine/font/WorkSans-SemiBoldItalic.woff +0 -0
  45. package/css/themes/custom/aquamarine/font/WorkSans-SemiBoldItalic.woff2 +0 -0
  46. package/css/themes/custom/aquamarine/font/WorkSans-Thin.woff +0 -0
  47. package/css/themes/custom/aquamarine/font/WorkSans-Thin.woff2 +0 -0
  48. package/css/themes/custom/aquamarine/font/WorkSans-ThinItalic.woff +0 -0
  49. package/css/themes/custom/aquamarine/font/WorkSans-ThinItalic.woff2 +0 -0
  50. package/css/themes/custom/aquamarine/font/fonts.css +162 -0
  51. package/css/themes/custom/aquamarine/img/arrow-gray.svg +3 -0
  52. package/css/themes/custom/aquamarine/img/arrow-white.svg +3 -0
  53. package/css/themes/custom/cerulean/button-cerulean.css +277 -0
  54. package/css/themes/custom/cerulean/custom-cerulean.css +322 -0
  55. package/css/themes/custom/cerulean/img/arrow-gray.svg +10 -0
  56. package/css/themes/custom/cerulean/img/arrow-white.svg +10 -0
  57. package/css/themes/custom/cerulean/navbar-cerulean.css +42 -0
  58. package/css/themes/custom/cerulean/panel-cerulean.css +51 -0
  59. package/css/themes/custom/darkly/custom-darkly.css +348 -0
  60. package/css/themes/custom/darkly/navbar-darkly.css +49 -0
  61. package/css/themes/custom/darkly/panel-darkly.css +90 -0
  62. package/css/themes/custom/dsgov/custom-dsgov.min.css +293 -43
  63. package/css/themes/custom/flatly/custom-flatly.css +317 -0
  64. package/css/themes/custom/flatly/navbar-flatly.css +48 -0
  65. package/css/themes/custom/flatly/panel-flatly.css +83 -0
  66. package/css/themes/custom/fuse/custom-fuse.min.css +1 -1
  67. package/css/themes/custom/lumen/custom-lumen.min.css +2989 -1085
  68. package/css/themes/custom/lumen/font/SourceSansPro-Black.woff +0 -0
  69. package/css/themes/custom/lumen/font/SourceSansPro-Black.woff2 +0 -0
  70. package/css/themes/custom/lumen/font/SourceSansPro-BlackIt.woff +0 -0
  71. package/css/themes/custom/lumen/font/SourceSansPro-BlackIt.woff2 +0 -0
  72. package/css/themes/custom/lumen/font/SourceSansPro-Bold.woff +0 -0
  73. package/css/themes/custom/lumen/font/SourceSansPro-Bold.woff2 +0 -0
  74. package/css/themes/custom/lumen/font/SourceSansPro-BoldIt.woff +0 -0
  75. package/css/themes/custom/lumen/font/SourceSansPro-BoldIt.woff2 +0 -0
  76. package/css/themes/custom/lumen/font/SourceSansPro-ExtraLight.woff +0 -0
  77. package/css/themes/custom/lumen/font/SourceSansPro-ExtraLight.woff2 +0 -0
  78. package/css/themes/custom/lumen/font/SourceSansPro-ExtraLightIt.woff +0 -0
  79. package/css/themes/custom/lumen/font/SourceSansPro-ExtraLightIt.woff2 +0 -0
  80. package/css/themes/custom/lumen/font/SourceSansPro-It.woff +0 -0
  81. package/css/themes/custom/lumen/font/SourceSansPro-It.woff2 +0 -0
  82. package/css/themes/custom/lumen/font/SourceSansPro-Light.woff +0 -0
  83. package/css/themes/custom/lumen/font/SourceSansPro-Light.woff2 +0 -0
  84. package/css/themes/custom/lumen/font/SourceSansPro-LightIt.woff +0 -0
  85. package/css/themes/custom/lumen/font/SourceSansPro-LightIt.woff2 +0 -0
  86. package/css/themes/custom/lumen/font/SourceSansPro-Regular.woff +0 -0
  87. package/css/themes/custom/lumen/font/SourceSansPro-Regular.woff2 +0 -0
  88. package/css/themes/custom/lumen/font/SourceSansPro-Semibold.woff +0 -0
  89. package/css/themes/custom/lumen/font/SourceSansPro-Semibold.woff2 +0 -0
  90. package/css/themes/custom/lumen/font/SourceSansPro-SemiboldIt.woff +0 -0
  91. package/css/themes/custom/lumen/font/SourceSansPro-SemiboldIt.woff2 +0 -0
  92. package/css/themes/custom/lumen/font/fonts.css +108 -0
  93. package/css/themes/custom/lumen/img/arrow-gray.svg +11 -0
  94. package/css/themes/custom/lumen/img/arrow-white.svg +11 -0
  95. package/css/themes/custom/material/custom-material.css +3311 -172
  96. package/css/themes/custom/material/font/Roboto-Black.woff +0 -0
  97. package/css/themes/custom/material/font/Roboto-Black.woff2 +0 -0
  98. package/css/themes/custom/material/font/Roboto-BlackItalic.woff +0 -0
  99. package/css/themes/custom/material/font/Roboto-BlackItalic.woff2 +0 -0
  100. package/css/themes/custom/material/font/Roboto-Bold.woff +0 -0
  101. package/css/themes/custom/material/font/Roboto-Bold.woff2 +0 -0
  102. package/css/themes/custom/material/font/Roboto-BoldItalic.woff +0 -0
  103. package/css/themes/custom/material/font/Roboto-BoldItalic.woff2 +0 -0
  104. package/css/themes/custom/material/font/Roboto-Italic.woff +0 -0
  105. package/css/themes/custom/material/font/Roboto-Italic.woff2 +0 -0
  106. package/css/themes/custom/material/font/Roboto-Light.woff +0 -0
  107. package/css/themes/custom/material/font/Roboto-Light.woff2 +0 -0
  108. package/css/themes/custom/material/font/Roboto-LightItalic.woff +0 -0
  109. package/css/themes/custom/material/font/Roboto-LightItalic.woff2 +0 -0
  110. package/css/themes/custom/material/font/Roboto-Medium.woff +0 -0
  111. package/css/themes/custom/material/font/Roboto-Medium.woff2 +0 -0
  112. package/css/themes/custom/material/font/Roboto-MediumItalic.woff +0 -0
  113. package/css/themes/custom/material/font/Roboto-MediumItalic.woff2 +0 -0
  114. package/css/themes/custom/material/font/Roboto-Regular.woff +0 -0
  115. package/css/themes/custom/material/font/Roboto-Regular.woff2 +0 -0
  116. package/css/themes/custom/material/font/Roboto-Thin.woff +0 -0
  117. package/css/themes/custom/material/font/Roboto-Thin.woff2 +0 -0
  118. package/css/themes/custom/material/font/Roboto-ThinItalic.woff +0 -0
  119. package/css/themes/custom/material/font/Roboto-ThinItalic.woff2 +0 -0
  120. package/css/themes/custom/material/font/fonts.css +108 -0
  121. package/css/themes/custom/material/img/arrow-gray.svg +11 -0
  122. package/css/themes/custom/material/img/arrow-white.svg +11 -0
  123. package/css/themes/custom/material_raiz/components_css/crn-scheduler.css +1 -1
  124. package/css/themes/custom/spacelab/button-spacelab.css +274 -0
  125. package/css/themes/custom/spacelab/custom-spacelab.css +253 -0
  126. package/css/themes/custom/spacelab/font/OpenSans-Bold.woff +0 -0
  127. package/css/themes/custom/spacelab/font/OpenSans-Bold.woff2 +0 -0
  128. package/css/themes/custom/spacelab/font/OpenSans-BoldItalic.woff +0 -0
  129. package/css/themes/custom/spacelab/font/OpenSans-BoldItalic.woff2 +0 -0
  130. package/css/themes/custom/spacelab/font/OpenSans-Extrabold.woff +0 -0
  131. package/css/themes/custom/spacelab/font/OpenSans-Extrabold.woff2 +0 -0
  132. package/css/themes/custom/spacelab/font/OpenSans-ExtraboldItalic.woff +0 -0
  133. package/css/themes/custom/spacelab/font/OpenSans-ExtraboldItalic.woff2 +0 -0
  134. package/css/themes/custom/spacelab/font/OpenSans-Italic.woff +0 -0
  135. package/css/themes/custom/spacelab/font/OpenSans-Italic.woff2 +0 -0
  136. package/css/themes/custom/spacelab/font/OpenSans-Light.woff +0 -0
  137. package/css/themes/custom/spacelab/font/OpenSans-Light.woff2 +0 -0
  138. package/css/themes/custom/spacelab/font/OpenSans-Semibold.woff +0 -0
  139. package/css/themes/custom/spacelab/font/OpenSans-Semibold.woff2 +0 -0
  140. package/css/themes/custom/spacelab/font/OpenSans-SemiboldItalic.woff +0 -0
  141. package/css/themes/custom/spacelab/font/OpenSans-SemiboldItalic.woff2 +0 -0
  142. package/css/themes/custom/spacelab/font/OpenSans.woff +0 -0
  143. package/css/themes/custom/spacelab/font/OpenSans.woff2 +0 -0
  144. package/css/themes/custom/spacelab/font/OpenSansLight-Italic.woff +0 -0
  145. package/css/themes/custom/spacelab/font/OpenSansLight-Italic.woff2 +0 -0
  146. package/css/themes/custom/spacelab/font/fonts.css +89 -0
  147. package/css/themes/custom/spacelab/navbar-spacelab.css +32 -0
  148. package/css/themes/custom/spacelab/panel-spacelab.css +109 -0
  149. package/css/themes/custom/superhero/custom-superhero.css +340 -0
  150. package/css/themes/custom/superhero/navbar-superhero.css +33 -0
  151. package/css/themes/custom/superhero/panel-superhero.css +58 -0
  152. package/css/themes/custom/superhero/tabs-superhero.css +25 -0
  153. package/css/themes/custom/theme-general/button.css +223 -0
  154. package/css/themes/custom/theme-general/carousel.css +5 -0
  155. package/css/themes/custom/theme-general/cookies.css +34 -0
  156. package/css/themes/custom/theme-general/forms.css +18 -0
  157. package/css/themes/custom/theme-general/login.css +21 -0
  158. package/css/themes/custom/theme-general/menu.css +23 -0
  159. package/css/themes/custom/theme-general/modal.css +13 -0
  160. package/css/themes/custom/theme-general/notification.css +27 -0
  161. package/css/themes/custom/theme-general/report-viewer.css +63 -0
  162. package/css/themes/custom/theme-general/scheduler.css +10 -0
  163. package/css/themes/custom/theme-general/slider.css +15 -0
  164. package/css/themes/custom/theme-general/table-grid.css +32 -0
  165. package/css/themes/custom/theme-general/tabs.css +49 -0
  166. package/css/themes/custom/theme-general/theme-general.css +180 -0
  167. package/css/themes/custom/theme-general/timeline.css +40 -0
  168. package/css/themes/custom/theme-general/treeview.css +74 -0
  169. package/css/themes/darkly.min.css +4 -3
  170. package/css/themes/flatly.min.css +4 -3
  171. package/css/themes/spacelab.min.css +5 -3
  172. package/css/themes/superhero.min.css +4 -3
  173. package/dist/components/js/format.min.js +1 -1
  174. package/dist/components/js/jquery.inputmask.bundle.js +1 -1
  175. package/dist/components/js/jquery.mask.min.js +1 -1
  176. package/dist/components/js/qrcode.js +1 -1
  177. package/dist/components/templates/accordion.template.html +1 -1
  178. package/dist/components/templates/cron-breadcrumbs.template.html +1 -1
  179. package/dist/components/templates/cron-dynamic-menu.template.html +1 -1
  180. package/dist/components/templates/cron-grid.designtime.html +1 -1
  181. package/dist/components/templates/list.template.html +1 -1
  182. package/dist/components/templates/radiogroup.template.html +1 -1
  183. package/dist/css/themes/aquamarine.min.css +1 -0
  184. package/dist/css/themes/custom/aquamarine/custom-aquamarine.min.css +1 -0
  185. package/dist/css/themes/custom/aquamarine/font/WorkSans-Black.woff +0 -0
  186. package/dist/css/themes/custom/aquamarine/font/WorkSans-Black.woff2 +0 -0
  187. package/dist/css/themes/custom/aquamarine/font/WorkSans-BlackItalic.woff +0 -0
  188. package/dist/css/themes/custom/aquamarine/font/WorkSans-BlackItalic.woff2 +0 -0
  189. package/dist/css/themes/custom/aquamarine/font/WorkSans-Bold.woff +0 -0
  190. package/dist/css/themes/custom/aquamarine/font/WorkSans-Bold.woff2 +0 -0
  191. package/dist/css/themes/custom/aquamarine/font/WorkSans-BoldItalic.woff +0 -0
  192. package/dist/css/themes/custom/aquamarine/font/WorkSans-BoldItalic.woff2 +0 -0
  193. package/dist/css/themes/custom/aquamarine/font/WorkSans-ExtraBold.woff +0 -0
  194. package/dist/css/themes/custom/aquamarine/font/WorkSans-ExtraBold.woff2 +0 -0
  195. package/dist/css/themes/custom/aquamarine/font/WorkSans-ExtraBoldItalic.woff +0 -0
  196. package/dist/css/themes/custom/aquamarine/font/WorkSans-ExtraBoldItalic.woff2 +0 -0
  197. package/dist/css/themes/custom/aquamarine/font/WorkSans-ExtraLight.woff +0 -0
  198. package/dist/css/themes/custom/aquamarine/font/WorkSans-ExtraLight.woff2 +0 -0
  199. package/dist/css/themes/custom/aquamarine/font/WorkSans-ExtraLightItalic.woff +0 -0
  200. package/dist/css/themes/custom/aquamarine/font/WorkSans-ExtraLightItalic.woff2 +0 -0
  201. package/dist/css/themes/custom/aquamarine/font/WorkSans-Italic.woff +0 -0
  202. package/dist/css/themes/custom/aquamarine/font/WorkSans-Italic.woff2 +0 -0
  203. package/dist/css/themes/custom/aquamarine/font/WorkSans-Light.woff +0 -0
  204. package/dist/css/themes/custom/aquamarine/font/WorkSans-Light.woff2 +0 -0
  205. package/dist/css/themes/custom/aquamarine/font/WorkSans-LightItalic.woff +0 -0
  206. package/dist/css/themes/custom/aquamarine/font/WorkSans-LightItalic.woff2 +0 -0
  207. package/dist/css/themes/custom/aquamarine/font/WorkSans-Medium.woff +0 -0
  208. package/dist/css/themes/custom/aquamarine/font/WorkSans-Medium.woff2 +0 -0
  209. package/dist/css/themes/custom/aquamarine/font/WorkSans-MediumItalic.woff +0 -0
  210. package/dist/css/themes/custom/aquamarine/font/WorkSans-MediumItalic.woff2 +0 -0
  211. package/dist/css/themes/custom/aquamarine/font/WorkSans-Regular.woff +0 -0
  212. package/dist/css/themes/custom/aquamarine/font/WorkSans-Regular.woff2 +0 -0
  213. package/dist/css/themes/custom/aquamarine/font/WorkSans-SemiBold.woff +0 -0
  214. package/dist/css/themes/custom/aquamarine/font/WorkSans-SemiBold.woff2 +0 -0
  215. package/dist/css/themes/custom/aquamarine/font/WorkSans-SemiBoldItalic.woff +0 -0
  216. package/dist/css/themes/custom/aquamarine/font/WorkSans-SemiBoldItalic.woff2 +0 -0
  217. package/dist/css/themes/custom/aquamarine/font/WorkSans-Thin.woff +0 -0
  218. package/dist/css/themes/custom/aquamarine/font/WorkSans-Thin.woff2 +0 -0
  219. package/dist/css/themes/custom/aquamarine/font/WorkSans-ThinItalic.woff +0 -0
  220. package/dist/css/themes/custom/aquamarine/font/WorkSans-ThinItalic.woff2 +0 -0
  221. package/dist/css/themes/custom/aquamarine/font/fonts.css +1 -0
  222. package/dist/css/themes/custom/aquamarine/img/arrow-gray.svg +1 -0
  223. package/dist/css/themes/custom/aquamarine/img/arrow-white.svg +1 -0
  224. package/dist/css/themes/custom/cerulean/button-cerulean.css +1 -0
  225. package/dist/css/themes/custom/cerulean/custom-cerulean.css +1 -0
  226. package/dist/css/themes/custom/cerulean/custom-cerulean.min.css +1 -1
  227. package/dist/css/themes/custom/cerulean/img/arrow-gray.svg +1 -0
  228. package/dist/css/themes/custom/cerulean/img/arrow-white.svg +1 -0
  229. package/dist/css/themes/custom/cerulean/navbar-cerulean.css +1 -0
  230. package/dist/css/themes/custom/cerulean/panel-cerulean.css +1 -0
  231. package/dist/css/themes/custom/darkly/custom-darkly.css +1 -0
  232. package/dist/css/themes/custom/darkly/navbar-darkly.css +1 -0
  233. package/dist/css/themes/custom/darkly/panel-darkly.css +1 -0
  234. package/dist/css/themes/custom/dsgov/custom-dsgov.min.css +1 -1
  235. package/dist/css/themes/custom/flatly/custom-flatly.css +1 -0
  236. package/dist/css/themes/custom/flatly/navbar-flatly.css +1 -0
  237. package/dist/css/themes/custom/flatly/panel-flatly.css +1 -0
  238. package/dist/css/themes/custom/fuse/custom-fuse.min.css +1 -1
  239. package/dist/css/themes/custom/lumen/font/SourceSansPro-Black.woff +0 -0
  240. package/dist/css/themes/custom/lumen/font/SourceSansPro-Black.woff2 +0 -0
  241. package/dist/css/themes/custom/lumen/font/SourceSansPro-BlackIt.woff +0 -0
  242. package/dist/css/themes/custom/lumen/font/SourceSansPro-BlackIt.woff2 +0 -0
  243. package/dist/css/themes/custom/lumen/font/SourceSansPro-Bold.woff +0 -0
  244. package/dist/css/themes/custom/lumen/font/SourceSansPro-Bold.woff2 +0 -0
  245. package/dist/css/themes/custom/lumen/font/SourceSansPro-BoldIt.woff +0 -0
  246. package/dist/css/themes/custom/lumen/font/SourceSansPro-BoldIt.woff2 +0 -0
  247. package/dist/css/themes/custom/lumen/font/SourceSansPro-ExtraLight.woff +0 -0
  248. package/dist/css/themes/custom/lumen/font/SourceSansPro-ExtraLight.woff2 +0 -0
  249. package/dist/css/themes/custom/lumen/font/SourceSansPro-ExtraLightIt.woff +0 -0
  250. package/dist/css/themes/custom/lumen/font/SourceSansPro-ExtraLightIt.woff2 +0 -0
  251. package/dist/css/themes/custom/lumen/font/SourceSansPro-It.woff +0 -0
  252. package/dist/css/themes/custom/lumen/font/SourceSansPro-It.woff2 +0 -0
  253. package/dist/css/themes/custom/lumen/font/SourceSansPro-Light.woff +0 -0
  254. package/dist/css/themes/custom/lumen/font/SourceSansPro-Light.woff2 +0 -0
  255. package/dist/css/themes/custom/lumen/font/SourceSansPro-LightIt.woff +0 -0
  256. package/dist/css/themes/custom/lumen/font/SourceSansPro-LightIt.woff2 +0 -0
  257. package/dist/css/themes/custom/lumen/font/SourceSansPro-Regular.woff +0 -0
  258. package/dist/css/themes/custom/lumen/font/SourceSansPro-Regular.woff2 +0 -0
  259. package/dist/css/themes/custom/lumen/font/SourceSansPro-Semibold.woff +0 -0
  260. package/dist/css/themes/custom/lumen/font/SourceSansPro-Semibold.woff2 +0 -0
  261. package/dist/css/themes/custom/lumen/font/SourceSansPro-SemiboldIt.woff +0 -0
  262. package/dist/css/themes/custom/lumen/font/SourceSansPro-SemiboldIt.woff2 +0 -0
  263. package/dist/css/themes/custom/lumen/font/fonts.css +1 -0
  264. package/dist/css/themes/custom/lumen/img/arrow-gray.svg +1 -0
  265. package/dist/css/themes/custom/lumen/img/arrow-white.svg +1 -0
  266. package/dist/css/themes/custom/material/custom-material.css +1 -1
  267. package/dist/css/themes/custom/material/custom-material.min.css +1 -0
  268. package/dist/css/themes/custom/material/font/Roboto-Black.woff +0 -0
  269. package/dist/css/themes/custom/material/font/Roboto-Black.woff2 +0 -0
  270. package/dist/css/themes/custom/material/font/Roboto-BlackItalic.woff +0 -0
  271. package/dist/css/themes/custom/material/font/Roboto-BlackItalic.woff2 +0 -0
  272. package/dist/css/themes/custom/material/font/Roboto-Bold.woff +0 -0
  273. package/dist/css/themes/custom/material/font/Roboto-Bold.woff2 +0 -0
  274. package/dist/css/themes/custom/material/font/Roboto-BoldItalic.woff +0 -0
  275. package/dist/css/themes/custom/material/font/Roboto-BoldItalic.woff2 +0 -0
  276. package/dist/css/themes/custom/material/font/Roboto-Italic.woff +0 -0
  277. package/dist/css/themes/custom/material/font/Roboto-Italic.woff2 +0 -0
  278. package/dist/css/themes/custom/material/font/Roboto-Light.woff +0 -0
  279. package/dist/css/themes/custom/material/font/Roboto-Light.woff2 +0 -0
  280. package/dist/css/themes/custom/material/font/Roboto-LightItalic.woff +0 -0
  281. package/dist/css/themes/custom/material/font/Roboto-LightItalic.woff2 +0 -0
  282. package/dist/css/themes/custom/material/font/Roboto-Medium.woff +0 -0
  283. package/dist/css/themes/custom/material/font/Roboto-Medium.woff2 +0 -0
  284. package/dist/css/themes/custom/material/font/Roboto-MediumItalic.woff +0 -0
  285. package/dist/css/themes/custom/material/font/Roboto-MediumItalic.woff2 +0 -0
  286. package/dist/css/themes/custom/material/font/Roboto-Regular.woff +0 -0
  287. package/dist/css/themes/custom/material/font/Roboto-Regular.woff2 +0 -0
  288. package/dist/css/themes/custom/material/font/Roboto-Thin.woff +0 -0
  289. package/dist/css/themes/custom/material/font/Roboto-Thin.woff2 +0 -0
  290. package/dist/css/themes/custom/material/font/Roboto-ThinItalic.woff +0 -0
  291. package/dist/css/themes/custom/material/font/Roboto-ThinItalic.woff2 +0 -0
  292. package/dist/css/themes/custom/material/font/fonts.css +1 -0
  293. package/dist/css/themes/custom/material/img/arrow-gray.svg +1 -0
  294. package/dist/css/themes/custom/material/img/arrow-white.svg +1 -0
  295. package/dist/css/themes/custom/material_raiz/components_css/crn-scheduler.css +1 -1
  296. package/dist/css/themes/custom/spacelab/button-spacelab.css +1 -0
  297. package/dist/css/themes/custom/spacelab/custom-spacelab.css +1 -0
  298. package/dist/css/themes/custom/spacelab/font/OpenSans-Bold.woff +0 -0
  299. package/dist/css/themes/custom/spacelab/font/OpenSans-Bold.woff2 +0 -0
  300. package/dist/css/themes/custom/spacelab/font/OpenSans-BoldItalic.woff +0 -0
  301. package/dist/css/themes/custom/spacelab/font/OpenSans-BoldItalic.woff2 +0 -0
  302. package/dist/css/themes/custom/spacelab/font/OpenSans-Extrabold.woff +0 -0
  303. package/dist/css/themes/custom/spacelab/font/OpenSans-Extrabold.woff2 +0 -0
  304. package/dist/css/themes/custom/spacelab/font/OpenSans-ExtraboldItalic.woff +0 -0
  305. package/dist/css/themes/custom/spacelab/font/OpenSans-ExtraboldItalic.woff2 +0 -0
  306. package/dist/css/themes/custom/spacelab/font/OpenSans-Italic.woff +0 -0
  307. package/dist/css/themes/custom/spacelab/font/OpenSans-Italic.woff2 +0 -0
  308. package/dist/css/themes/custom/spacelab/font/OpenSans-Light.woff +0 -0
  309. package/dist/css/themes/custom/spacelab/font/OpenSans-Light.woff2 +0 -0
  310. package/dist/css/themes/custom/spacelab/font/OpenSans-Semibold.woff +0 -0
  311. package/dist/css/themes/custom/spacelab/font/OpenSans-Semibold.woff2 +0 -0
  312. package/dist/css/themes/custom/spacelab/font/OpenSans-SemiboldItalic.woff +0 -0
  313. package/dist/css/themes/custom/spacelab/font/OpenSans-SemiboldItalic.woff2 +0 -0
  314. package/dist/css/themes/custom/spacelab/font/OpenSans.woff +0 -0
  315. package/dist/css/themes/custom/spacelab/font/OpenSans.woff2 +0 -0
  316. package/dist/css/themes/custom/spacelab/font/OpenSansLight-Italic.woff +0 -0
  317. package/dist/css/themes/custom/spacelab/font/OpenSansLight-Italic.woff2 +0 -0
  318. package/dist/css/themes/custom/spacelab/font/fonts.css +1 -0
  319. package/dist/css/themes/custom/spacelab/navbar-spacelab.css +1 -0
  320. package/dist/css/themes/custom/spacelab/panel-spacelab.css +1 -0
  321. package/dist/css/themes/custom/superhero/custom-superhero.css +1 -0
  322. package/dist/css/themes/custom/superhero/navbar-superhero.css +1 -0
  323. package/dist/css/themes/custom/superhero/panel-superhero.css +1 -0
  324. package/dist/css/themes/custom/superhero/tabs-superhero.css +1 -0
  325. package/dist/css/themes/custom/theme-general/button.css +1 -0
  326. package/dist/css/themes/custom/theme-general/carousel.css +1 -0
  327. package/dist/css/themes/custom/theme-general/cookies.css +1 -0
  328. package/dist/css/themes/custom/theme-general/forms.css +1 -0
  329. package/dist/css/themes/custom/theme-general/login.css +1 -0
  330. package/dist/css/themes/custom/theme-general/menu.css +1 -0
  331. package/dist/css/themes/custom/theme-general/modal.css +1 -0
  332. package/dist/css/themes/custom/theme-general/notification.css +1 -0
  333. package/dist/css/themes/custom/theme-general/report-viewer.css +1 -0
  334. package/dist/css/themes/custom/theme-general/scheduler.css +1 -0
  335. package/dist/css/themes/custom/theme-general/slider.css +1 -0
  336. package/dist/css/themes/custom/theme-general/table-grid.css +1 -0
  337. package/dist/css/themes/custom/theme-general/tabs.css +1 -0
  338. package/dist/css/themes/custom/theme-general/theme-general.css +1 -0
  339. package/dist/css/themes/custom/theme-general/timeline.css +1 -0
  340. package/dist/css/themes/custom/theme-general/treeview.css +1 -0
  341. package/dist/js/LanguageSelectDirective.js +1 -1
  342. package/dist/js/LocaleService.js +1 -1
  343. package/dist/js/app.js +1 -1
  344. package/dist/js/dashboard/dashboard.service.js +1 -1
  345. package/dist/js/directives.js +1 -1
  346. package/dist/js/reports/parameters.controller.js +1 -1
  347. package/js/app.js +1 -1
  348. package/js/dashboard/dashboard.service.js +10 -10
  349. package/js/directives.js +200 -165
  350. package/package.json +1 -1
  351. package/postupdate.json +10 -6
  352. package/cronapp-framework-js.iml +0 -9
  353. package/css/themes/custom/cerulean/custom-cerulean.min.css +0 -2411
  354. package/css/themes/custom/darkly/custom-darkly.min.css +0 -3001
  355. package/css/themes/custom/flatly/custom-flatly.min.css +0 -2983
  356. package/css/themes/custom/material/components_css/crn-button.css +0 -177
  357. package/css/themes/custom/material/components_css/crn-carousel.css +0 -11
  358. package/css/themes/custom/material/components_css/crn-cron-calendar.css +0 -176
  359. package/css/themes/custom/material/components_css/crn-cron-grid.css +0 -243
  360. package/css/themes/custom/material/components_css/crn-enterprise.css +0 -58
  361. package/css/themes/custom/material/components_css/crn-navbar.css +0 -166
  362. package/css/themes/custom/material/components_css/crn-scheduler.css +0 -98
  363. package/css/themes/custom/material/components_css/login.css +0 -38
  364. package/css/themes/custom/material/components_css/ui-notification.css +0 -27
  365. package/css/themes/custom/spacelab/custom-spacelab.min.css +0 -2497
  366. package/css/themes/custom/superhero/custom-superhero.min.css +0 -3114
@@ -1 +1 @@
1
- maskDirectiveAsDate.$inject=["$compile","$translate","$parse"],maskDirectiveMask.$inject=["$compile","$translate","$parse"],function($app){var _Mathfloor=Math.floor;app.common={generateId:function(){var e=_Mathfloor(65536*(1+Math.random())).toString(16).substring(1);return-1<"0123456789".indexOf(e.substr(0,1))?this.generateId():e}};var isoDate=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,ISO_PATTERN=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/;Number.MAX_SAFE_INTEGER_32=2147483647;var patternFormat=function(e){return e?$(e).attr("format")||"DD/MM/YYYY":"DD/MM/YYYY"},parsePermission=function(e){var t={visible:{public:!0},enabled:{public:!0},notvisible:{public:!1},notenabled:{public:!1}};if(e)for(var a,n=e.toLowerCase().trim().split(","),o=0;o<n.length;o++)if(a=n[o].trim(),a){var d=a.split(":");if(2==d.length){var l=d[0].trim(),r=d[1].trim();if(r){for(var s,c=r.split(";"),u={},g=0;g<c.length;g++)s=c[g].trim(),s&&(u[s]=!0);t[l]=u}}}return t};app.directive("cronCalendar",["$timeout",function(){return{restrict:"E",link:async function(e,t,a,n){let i={};try{i=JSON.parse(a.options)}catch(t){console.error(t)}const o=$(t),d=navigator.language||navigator.userLanguage,l=i.expressionInitialDate,r=i.expressionSelectDates,s=i.expressionDisableDates,c=i.expressionMinDate,p=i.expressionMaxDate,u=i.expressionOnChange,g=i.expressionOnNavigate,m=l?await e.$eval(generateBlocklyCall(l)):new Date,f=r&&i.isSelectableMultiple?await e.$eval(generateBlocklyCall(r)):[],h=s?await e.$eval(generateBlocklyCall(s)):null,b=c?await e.$eval(generateBlocklyCall(c)):new Date(1900,0,1),v=p?await e.$eval(generateBlocklyCall(p)):new Date(2099,11,31);o.kendoCalendar({culture:d.startsWith("pt")?"pt-BR":"en-US",componentType:i.isClassicType?"classic":"modern",selectable:i.isSelectableSingle?"single":"multiple",weekNumber:i.showWeekNumbers,value:m,selectDates:f,disableDates:h,min:b,max:v});let y=o.data("kendoCalendar");y.bind("change",function(){this.value();u&&e.$eval(generateBlocklyCall(u))}),y.bind("navigate",function(){let t=this.view(),a=this.current();u&&e.$eval(generateBlocklyCall(g))})}}}]),app.directive("justGage",["$timeout",function(e){return{restrict:"EA",scope:{id:"@",class:"@",min:"=",max:"=",title:"@",label:"@",value:"@",options:"="},template:"<div id=\"{{id}}-justgage\" class=\"{{class}}\"></div>",link:function(t){e(function(){var e={id:t.id+"-justgage",min:t.min||0,max:t.max||100,title:t.title,label:t.label||"",value:t.value};if(t.options)for(var a in t.options)e[a]=t.options[a];var n=new JustGage(e);t.$watch("max",function(e){e!==void 0&&n.refresh(t.value,e)},!0),t.$watch("value",function(e){e!==void 0&&n.refresh(e)},!0)})}}}]),app.directive("crnAnchor",["$rootScope","$location","$anchorScroll",function(e,t,a){return{restrict:"A",link:function(e,t,n){t.bind("click",function(){let e=n.crnAnchor;a(e),$("#"+e).get(0).focus()})}}}]),app.directive("input",transformText),app.directive("textarea",transformText);var generateBlocklyCall=function(e){var t="";if(!e)return t;if("client"==e.type){t="cronapi.client('"+e.blocklyClass+"."+e.blocklyMethod+"')";var a="";e.blocklyParams.forEach(function(e){0<a.length&&(a+=", "),a+=e.value?e.value:"null"}),t+=".run("+a+")"}else if("server"==e.type){var n=e.blocklyClass+"."+e.blocklyMethod;t="cronapi.server('"+n+"')";var a="";e.blocklyParams.forEach(function(e){0<a.length&&(a+=", "),a+=e.value?e.value:"null"}),t+=".run("+a+")"}return t};app.directive("asDate",maskDirectiveAsDate).directive("ngDestroy",function(){return{restrict:"A",link:function(scope,element,attrs,ctrl){element.on("$destroy",function(){attrs.ngDestroy&&0<attrs.ngDestroy.length&&(-1<attrs.ngDestroy.indexOf("app.")||-1<attrs.ngDestroy.indexOf("blockly.")?scope.$eval(attrs.ngDestroy):eval(attrs.ngDestroy))})}}}).directive("dynamicImage",["$compile",function(e){return{restrict:"E",replace:!0,scope:{ngModel:"@",width:"@",height:"@",style:"@",class:"@"},require:"ngModel",template:"<div></div>",init:function(e){e.ngModel||(e.ngModel=""),e.width||(e.width="128"),e.height||(e.height="128"),e.style||(e.style=""),e.class||(e.class=""),this.containsLetter(e.width)||(e.width+="px"),this.containsLetter(e.height)||(e.height+="px")},containsLetter:function(e){for(var t,a=0;a<e.length;a++){t=!0;for(var n=0;10>n;n++)parseInt(e[a])==n&&(t=!1);if(t)break}return t},link:function(t,a,n){this.init(t);var i=t,o=n.ngRequired&&"true"==n.ngRequired?"required":"";a.append("<div class=\"form-group upload-image-component\" ngf-drop=\"\" ngf-drag-over-class=\"dragover\"> <img class=\"$class$\" style=\"$style$; height: $height$; width: $width$;\" ng-if=\"$ngModel$\" data-ng-src=\"{{$ngModel$.startsWith('http') || ($ngModel$.startsWith('/') && $ngModel$.length < 1000)? $ngModel$ : 'data:image/png;base64,' + $ngModel$}}\"> <img class=\"$class$\" style=\"$style$; height: $height$; width: $width$;\" ng-if=\"!$ngModel$\" data-ng-src=\"/plugins/cronapp-framework-js/img/selectImg.svg\" class=\"btn\" ng-if=\"!$ngModel$\" ngf-drop=\"\" ngf-select=\"\" ngf-change=\"cronapi.internal.setFile('$ngModel$', $file)\" accept=\"image/*;capture=camera\"> <button class=\"remove btn btn-danger btn-xs\" ng-if=\"$ngModel$\" ng-click=\"$ngModel$=null\"> <span class=\"glyphicon glyphicon-remove\"></span> <span class=\"sr-only\">{{\"Remove\" | translate}}</span> </button> <button class=\"btn btn-info btn-xs start-camera-button\" ng-if=\"!$ngModel$\" ng-click=\"cronapi.internal.startCamera('$ngModel$')\"> <span class=\"glyphicon glyphicon-facetime-video\"></span> <span class=\"sr-only\">{{\"Upload.camera\" | translate}}</span> </button> <input ng-if=\"!$ngModel$\" autocomplete=\"off\" tabindex=\"-1\" class=\"uiSelectRequired ui-select-offscreen\" style=\"top: inherit !important; margin-left: 85px !important;margin-top: 50px !important;\" type=text ng-model=\"$ngModel$\" $required$> </div>".split("$height$").join(i.height).split("$width$").join(i.width).split("$ngModel$").join(i.ngModel).split("$style$").join(i.style).split("$class$").join(i.class).split("$required$").join(o)),e(a)(a.scope())}}}]).directive("dynamicImage",["$compile","$translate",function(e,t){return{restrict:"A",scope:!0,require:"ngModel",link:function(a,n,i){var o=i.ngRequired&&"true"==i.ngRequired?"required":"",d=n.html(),l="<div ngf-drop=\"\" ngf-drag-over-class=\"dragover\"> <img alt=\"$picture$\" style=\"width: 100%;\" ng-if=\"$ngModel$\" data-ng-src=\"{{$ngModel$.startsWith('http') || ($ngModel$.startsWith('/') && $ngModel$.length < 1000)? $ngModel$ : 'data:image/png;base64,' + $ngModel$}}\"> <input id=\"$id$\" aria-label=\"$userHtml$\" ng-if=\"!$ngModel$\" autocomplete=\"off\" tabindex=\"-1\" class=\"uiSelectRequired ui-select-offscreen\" style=\"top: inherit !important; margin-left: 85px !important;margin-top: 50px !important; display: none;\" type=text ng-model=\"$ngModel$\" $required$> <button id=\"$idbutton$\" class=\"btn\" ng-if=\"!$ngModel$\" ngf-drop=\"\" ngf-select=\"\" ngf-change=\"cronapi.internal.setFile('$ngModel$', $file)\" ngf-pattern=\"'image/*'\" ngf-max-size=\"$maxFileSize$\"> $userHtml$ </button> <button class=\"remove-image-button btn btn-danger btn-xs\" ng-if=\"$ngModel$\" ng-click=\"$ngModel$=null\"> <span class=\"glyphicon glyphicon-remove\"></span> <span class=\"sr-only\">{{\"Remove\" | translate}}</span> </button> <button class=\"btn btn-info btn-xs start-camera-button-attribute\" ng-if=\"!$ngModel$\" ng-click=\"cronapi.internal.startCamera('$ngModel$')\"> <span class=\"glyphicon glyphicon-facetime-video\"></span> <span class=\"sr-only\">{{\"Upload.camera\" | translate}}</span> </button> </div>",r="";i.maxFileSize&&(r=i.maxFileSize);var s="";s=i.imgAltText?i.imgAltText:"Admin.view.Picture",l=$(l.split("$id$").join(i.id?i.id+"-input":"textinput-picture").split("$idbutton$").join(i.id?i.id+"-button":"textinput-picture-button").split("$ngModel$").join(i.ngModel).split("$required$").join(o).split("$userHtml$").join(d).split("$maxFileSize$").join(r).split("$picture$").join(t.instant(s))),n.html(l),e(l)(n.scope())}}}]).directive("dynamicFile",["$compile","$translate",function(e,t){return{restrict:"A",scope:!0,require:"ngModel",link:function(a,n,i){var o=i.ngRequired&&"true"==i.ngRequired?"required":"",d=i.ngModel.split("."),l=d[0],r=d[d.length-1],s=_Mathfloor(1e3*Math.random()+20),c=n.html(),p="";i.maxFileSize&&(p=i.maxFileSize);let u=i.fileInfo?`'${i.fileInfo}'`:"undefined";var g=" <div ng-show=\"!$ngModel$\" ngf-drop=\"\" ngf-drag-over-class=\"dragover\"> <input id=\"$id$\" aria-label=\"$userHtml$\" ng-if=\"!$ngModel$\" autocomplete=\"off\" tabindex=\"-1\" class=\"uiSelectRequired ui-select-offscreen\" style=\"top: inherit !important;margin-left: 85px !important;margin-top: 50px !important; display: none;\" type=text ng-model=\"$ngModel$\" $required$> <button id=\"$idbutton$\" class=\"btn\" ngf-drop=\"\" ngf-select=\"\" ngf-change=\"cronapi.internal.uploadFile('$ngModel$', $file, 'uploadprogress$number$', $fileInfo$, $invalidFiles)\" ngf-max-size=\"$maxFileSize$\"> $userHtml$ </button> <div class=\"progress\" data-type=\"bootstrapProgress\" id=\"uploadprogress$number$\" style=\"display:none\"> <div class=\"progress-bar\" role=\"progressbar\" aria-valuenow=\"70\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width:0%\"> <span class=\"sr-only\"></span> </div> </div> </div> <div ng-show=\"$ngModel$\" class=\"upload-image-component-attribute\"> <button class=\"btn btn-danger btn-xs ng-scope\" style=\"float:right;\" ng-if=\"$ngModel$\" ng-click=\"$ngModel$=null\"> <span class=\"glyphicon glyphicon-remove\"></span> <span class=\"sr-only\">{{\"Remove\" | translate}}</span> </button> <div> <div ng-bind-html=\"cronapi.internal.generatePreviewDescriptionByte($ngModel$, $fileInfo$)\"></div> <a href=\"javascript:void(0)\" ng-click=\"cronapi.internal.downloadFileEntity($datasource$,'$field$', undefined, $fileInfo$)\">$lblDownload$</a> </div> </div> ";g=$(g.split("$id$").join(i.id?i.id+"-input":"textinput-file").split("$idbutton$").join(i.id?i.id+"-button":"textinput-file-button").split("$ngModel$").join(i.ngModel).split("$datasource$").join(l).split("$field$").join(r).split("$number$").join(s).split("$required$").join(o).split("$userHtml$").join(c).split("$maxFileSize$").join(p).split("$lblDownload$").join(t.instant("download")).split("$fileInfo$").join(u)),n.html(g),e(g)(n.scope())}}}]).directive("dynamicFile",["$compile",function(e){return{restrict:"E",replace:!0,scope:{ngModel:"@"},require:"ngModel",template:"<div></div>",init:function(e){e.ngModel||(e.ngModel="")},link:function(t,a,n){this.init(t);var i=t,o=n.ngRequired&&"true"==n.ngRequired?"required":"",d=i.ngModel.split("."),l=d[0],r=d[d.length-1],s=_Mathfloor(1e3*Math.random()+20);a.append(" <div ng-show=\"!$ngModel$\"> <input ng-if=\"!$ngModel$\" autocomplete=\"off\" tabindex=\"-1\" class=\"uiSelectRequired ui-select-offscreen\" style=\"top: inherit !important;margin-left: 85px !important;margin-top: 50px !important;\" type=text ng-model=\"$ngModel$\" $required$> <div class=\"form-group upload-image-component\" ngf-drop=\"\" ngf-drag-over-class=\"dragover\"> <img class=\"ng-scope\" style=\"height: 128px; width: 128px;\" ng-if=\"!$ngModel$\" data-ng-src=\"/plugins/cronapp-framework-js/img/selectFile.png\" ngf-drop=\"\" ngf-select=\"\" ngf-change=\"cronapi.internal.uploadFile('$ngModel$', $file, 'uploadprogress$number$')\" accept=\"*\"> <progress id=\"uploadprogress$number$\" max=\"100\" value=\"0\" style=\"position: absolute; width: 128px; margin-top: -134px;\">0</progress> </div> </div> <div ng-show=\"$ngModel$\" class=\"form-group upload-image-component\"> <div class=\"btn btn-danger btn-xs ng-scope\" style=\"float:right;\" ng-if=\"$ngModel$\" ng-click=\"$ngModel$=null\"> <span class=\"glyphicon glyphicon-remove\"></span> </div> <div> <div ng-bind-html=\"cronapi.internal.generatePreviewDescriptionByte($ngModel$)\"></div> <a href=\"javascript:void(0)\" ng-click=\"cronapi.internal.downloadFileEntity($datasource$,'$field$')\">download</a> </div> </div> ".split("$ngModel$").join(i.ngModel).split("$datasource$").join(l).split("$field$").join(r).split("$number$").join(s).split("$required$").join(o)),e(a)(a.scope())}}}]).directive("pwCheck",[function(){'use strict';return{require:"ngModel",link:function(e,t,a,n){var i="#"+a.pwCheck;t.add(i).on("keyup",function(){e.$apply(function(){var e=t.val()===$(i).val();n.$setValidity("pwmatch",e)})})}}}]).directive("ngClick",[function(){'use strict';return{link:function(scope,elem,attrs,ctrl){if(scope.rowData){var crnDatasource=elem.closest("[crn-datasource]");0<crnDatasource.length&&elem.on("click",function(){scope.$apply(function(){var datasource=eval(crnDatasource.attr("crn-datasource"));datasource.active=scope.rowData})})}}}}]).directive("valid",function(){return{require:"?ngModel",restrict:"A",link:function(e,t,a,n){var i={cpf:CPF,cnpj:CNPJ};if(n)n.$validators[a.valid]=function(e,n){var o=e||n,d=i[a.valid].isValid(o);return d||null===o?t[0].setCustomValidity(""):t.scope().$applyAsync(function(){t[0].setCustomValidity(t[0].dataset.errorMessage)}),d||!o};else{let e=function(){setTimeout(()=>{var e=t.data("rawvalue"),n=i[a.valid].isValid(e);n||null===e?t.removeClass("k-invalid"):t.addClass("k-invalid")})};t.on("keydown",e).on("keyup",e)}}}}).directive("cronappSecurity",["$rootScope",function(e){return{restrict:"A",priority:Number.MIN_SAFE_INTEGER,link:function(t,a,n){var o=[],d=JSON.parse(localStorage.getItem("_u"));d&&d.roles&&(o=d.roles.toLowerCase().split(","));for(var l,r=parsePermission(n.cronappSecurity),s=!1,c=!1,p=0;p<o.length;p++)l=o[p].trim(),l&&(r.visible[l]&&(s=!0),r.enabled[l]&&(c=!0));for(var l,p=0;p<o.length;p++)l=o[p].trim(),l&&(r.notvisible[l]&&(s=!1),r.notenabled[l]&&(c=!1));let u=$(a),g=()=>{s||u.hide(),c||u.find("*").addBack().attr("disabled",!0).off("click").on("click",t=>t.preventDefault())},m=setInterval(()=>{e.renderFinished&&(g(),clearInterval(m))})}}}]).directive("qr",["$window",function(e){return{restrict:"A",require:"^ngModel",template:"<canvas ng-hide=\"image\"></canvas><img ng-if=\"image\" ng-src=\"{{canvasImage}}\"/>",link:function(t,a,n,i){t.size===void 0&&n.size&&(t.text=n.size);var o=function(){return i.$modelValue||""},d=function(e){return /^[0-9]*$/.test(e)},l=function(e){return /^[0-9A-Z $%*+\-./:]*$/.test(e)},r=function(e){for(var t,a=0;a<e.length;a++)if(t=e.charCodeAt(a),255<t)return!1;return!0},s=function(e,t){if("NUMBER"===e&&!d(t))throw new Error("The `NUMBER` input mode is invalid for text.");else if("ALPHA_NUM"===e&&!l(t))throw new Error("The `ALPHA_NUM` input mode is invalid for text.");else if("8bit"===e&&!r(t))throw new Error("The `8bit` input mode is invalid for text.");else if(!r(t))throw new Error("Input mode is invalid for text.");return!0},c=function(e){var a=t.inputMode;return a=a||(d(e)?"NUMBER":void 0),a=a||(l(e)?"ALPHA_NUM":void 0),a=a||(r(e)?"8bit":""),s(a,e)?a:""},p=a.find("canvas")[0],u=!!e.CanvasRenderingContext2D;t.TYPE_NUMBER=function(){return t.typeNumber||0}(),t.TEXT=o(),t.CORRECTION=function(){var e=t.correctionLevel||0;return{L:1,M:0,Q:3,H:2}[e]||0}(),t.SIZE=function(){let e=$(a).outerWidth(),n=$(a).outerHeight(),i=e<n?e:n;return t.size||i}(),t.INPUT_MODE=c(t.TEXT),t.canvasImage="";var g=function(e,t,a,n){for(var i=Math.round,o=Math.ceil,d=0;d<a;d++)for(var l=0;l<a;l++){var r=o((l+1)*n)-_Mathfloor(l*n),s=o((d+1)*n)-_Mathfloor(d*n);e.fillStyle=t.isDark(d,l)?"#000":"#fff",e.fillRect(i(l*n),i(d*n),r,s)}},m=function(e,a,n,i,o,d){var l=a.replace(/^\s+|\s+$/g,""),r=new QRCode(n,i,d);r.addData(l),r.make();var s=e.getContext("2d"),c=r.getModuleCount();e.width=e.height=o,u&&(g(s,r,c,o/c),t.canvasImage=e.toDataURL()||"")};t.$watch(function(){return i.$modelValue},function(e,a){(e!==a||e!==t.TEXT)&&(t.text=i.$modelValue,t.TEXT=o(),t.INPUT_MODE=c(t.TEXT),m(p,t.TEXT,t.TYPE_NUMBER,t.CORRECTION,t.SIZE,t.INPUT_MODE))}),m(p,t.TEXT,t.TYPE_NUMBER,t.CORRECTION,t.SIZE,t.INPUT_MODE)}}}]).directive("uiSelect",["$compile",function(e){return{restrict:"E",require:"ngModel",link:function(t,a,n){let i=()=>{"$apply"!==t.$$phase&&"$digest"!==t.$$phase?a.find("i").remove():setTimeout(()=>i(),200)};if(i(),null!=n.required||"true"===n.ngRequired){$(a).append("<input autocomplete=\"off\" tabindex=\"-1\" class=\"uiSelectRequired ui-select-offscreen\" style=\"left: 50%!important; top: 100%!important;\" type=text ng-model=\""+n.ngModel+"\" required>");var o=$(a).find("input.uiSelectRequired");e(o)(a.scope())}}}}]).filter("raw",["$translate",function(){return function(e){return null!=e&&void 0!==e?"number"==typeof e?e+"":"boolean"==typeof e?e+"":e instanceof Date?"datetimeoffset'"+e.toISOString()+"'":10<=e.length&&e.match(ISO_PATTERN)?"datetimeoffset'"+e+"'":"'"+e+"'":""}}]).filter("js",["$translate",function(){return function(e){return null!=e&&void 0!==e?"number"==typeof e||"boolean"==typeof e?e+"":e instanceof Date?cronapi.toDate(e.toISOString()):10<=e.length&&e.match(ISO_PATTERN)?cronapi.toDate(e):"'"+e+"'":"undefined"}}]).filter("mask",["$translate",function(e){return function(t,a,n){if(a=parseMaskType(a,e),!a)return t;var i;if(void 0===n?i=window.fixedTimeZone:(i="date"==n||"datetime"==n||"time"==n,!window.fixedTimeZone&&(i=!1)),0<a.indexOf(";local")&&(i=!1),a=a.replace(";1","").replace(";0","").replace(";local","").trim(),"string"==typeof t&&t.match(isoDate)||t instanceof Date)return i?moment(t).utcOffset(window.timeZoneOffset).format(a):moment(t).format(a);if("number"==typeof t)return format(a,t);if(null!=t&&null!=t&&""!=t&&""!=a){var o=$("<input type=\"text\">");return o.mask(a),o.masked(t)}return t}}]).directive("screenParams",[function(){'use strict';return{link:function(scope,elem,attrs,ctrl){var screenParams=eval(attrs.screenParams);screenParams&&screenParams.length&&screenParams.forEach(function(e){scope.params&&!scope.params[e.key]&&(scope.params[e.key]=e.value||"")})}}}]).directive("mask",maskDirectiveMask).directive("cronappFilter",["$compile",function($compile){return{restrict:"A",require:"?ngModel",setFilterInButton:function(e,t){var a=e.closest("fieldset");if(a){var n=a.find("button[cronapp-filter]");if(n){var i=n.data("filters");i||(i=[]);var o=-1,d=e.attr("ng-model");if($(i).each(function(e){this.ngModel==d&&(o=e)}),-1<o&&i.splice(o,1),0<t.length){i.push({ngModel:d,bindedFilter:t})}n.data("filters",i)}}},makeAutoPostSearch:function(e,t,a,n){var i=e.closest("fieldset");if(i&&0<i.length){var o=i.find("button[cronapp-filter]");if(o&&0<o.length){var d=o.data("filters");d&&0<d.length&&(t="",$(d).each(function(){t+=this.bindedFilter+";"}))}}a.search(t,"true"==n.cronappFilterCaseinsensitive)},inputBehavior:function(scope,element,attrs,ngModelCtrl,$element,typeElement,operator,autopost){var datasource,filterTemplate="",filtersSplited=attrs.cronappFilter.split(";");if(attrs.crnDatasource)datasource=eval(attrs.crnDatasource);else{var fieldset=$element.closest("fieldset");if(!fieldset)return;var button=fieldset.find("button[cronapp-filter]");if(!button)return;if(!button.attr("crn-datasource"))return;datasource=eval(button.attr("crn-datasource"))}var isOData=datasource.isOData();$(filtersSplited).each(function(){0<this.length&&(""!=filterTemplate&&(isOData?filterTemplate+=" or ":filterTemplate+=";"),isOData?"="==operator&&"text"==typeElement?filterTemplate+="substringof({value.lower}, tolower("+this+"))":"="==operator?filterTemplate+=this+" eq {value}":"!="==operator?filterTemplate+=this+" ne {value}":">"==operator?filterTemplate+=this+" gt {value}":">="==operator?filterTemplate+=this+" ge {value}":"<"==operator?filterTemplate+=this+" lt {value}":"<="==operator&&(filterTemplate+=this+" le {value}"):"text"==typeElement?filterTemplate+=this+"@"+operator+"%{value}%":filterTemplate+=this+operator+"{value}")}),0==filterTemplate.length&&(isOData?filterTemplate="{value}":filterTemplate="%{value}%");var selfDirective=this;ngModelCtrl?scope.$watch(attrs.ngModel,function(e,t){if(!angular.equals(e,t)){var a=$element.data("type")||$element.attr("type"),n=ngModelCtrl.$modelValue;isOData?n instanceof Date?"datetime-local"==a?n="datetimeoffset'"+n.toISOString()+"'":n="datetime'"+n.toISOString().substring(0,23)+"'":"number"==typeof n?n+="M":"boolean"==typeof n?n=n:n="'"+n+"'":n instanceof Date?(n=n.toISOString(),n+="date"==a?"@@date":"time"==a||"time-local"==a?"@@time":"@@datetime"):"number"==typeof n?n+="@@number":"boolean"==typeof n&&(n+="@@boolean");var i=filterTemplate.split("{value}").join(n);if("string"!=typeof n)i=i.split("{value.lower}").join(n);else if(i.startsWith("substringof({")){var o=n.split("'").join("").toLowerCase().trim().split(" "),d="";o.forEach(function(e,t){d+=i.split("{value.lower}").join("'"+e+"'"),t<o.length-1&&(d+=" or ")}),i=d}else i=i.split("{value.lower}").join(n.toLowerCase());0==ngModelCtrl.$viewValue.length&&(i=""),selfDirective.setFilterInButton($element,i,operator),autopost&&selfDirective.makeAutoPostSearch($element,i,datasource,attrs)}}):"text"==typeElement?$element.on("keyup",function(){var datasource=eval(attrs.crnDatasource),value=void 0;value=ngModelCtrl&&null!=ngModelCtrl?ngModelCtrl.$viewValue:this.value;var bindedFilter=filterTemplate.split("{value}").join(value);0==this.value.length&&(bindedFilter=""),selfDirective.setFilterInButton($element,bindedFilter,operator),autopost&&selfDirective.makeAutoPostSearch($element,bindedFilter,datasource,attrs)}):$element.on("change",function(){var datasource=eval(attrs.crnDatasource),value=void 0,typeElement=$(this).attr("type");if(null!=attrs.asDate&&(typeElement="date"),ngModelCtrl&&null!=ngModelCtrl)value=ngModelCtrl.$viewValue;else if("checkbox"==typeElement)value=$(this).is(":checked");else if("date"!=typeElement)value=this.value;else if(value=this.value,0<this.value.length){var momentDate=moment(this.value,patternFormat(this));value=momentDate.toDate().toISOString()}var bindedFilter=filterTemplate.split("{value}").join(value);0==value.toString().length&&(bindedFilter=""),selfDirective.setFilterInButton($element,bindedFilter,operator),autopost&&selfDirective.makeAutoPostSearch($element,bindedFilter,datasource,attrs)})},forceDisableDatasource:function(datasourceName,scope){var disableDatasource=setInterval(function(){try{var datasourceInstance=eval(datasourceName);datasourceInstance&&($(document).ready(function(){var e=0,t=setInterval(function(){10>e?(scope.$apply(function(){datasourceInstance.enabled=!1,datasourceInstance.data=[]}),e++):clearInterval(t)},20)}),clearInterval(disableDatasource))}catch(t){}},10)},buttonBehavior:function(scope,element,attrs,ngModelCtrl,$element,typeElement,operator,autopost){var datasourceName="";datasourceName=attrs.crnDatasource?attrs.crnDatasource:$element.parent().attr("crn-datasource");var datasource=eval(datasourceName),isOData=datasource.isOData(),requiredFilter=attrs.requiredFilter&&"true"==attrs.requiredFilter.toString();requiredFilter&&this.forceDisableDatasource(datasourceName,scope),$element.on("click",function(){var $this=$(this),filters=$this.data("filters");if(datasourceName&&0<datasourceName.length&&filters){var bindedFilter="";$(filters).each(function(){""!=bindedFilter&&(bindedFilter+=isOData?" and ":";"),bindedFilter+=this.bindedFilter});var datasourceToFilter=eval(datasourceName);requiredFilter?(datasourceToFilter.enabled=0<bindedFilter.length,datasourceToFilter.enabled?datasourceToFilter.search(bindedFilter,"true"==attrs.cronappFilterCaseinsensitive):scope.$apply(function(){datasourceToFilter.data=[]})):datasourceToFilter.search(bindedFilter,"true"==attrs.cronappFilterCaseinsensitive)}})},link:function(e,t,a,n){var i=$(t),o=i.data("type")||i.attr("type");a.asDate!=null&&(o="date");var d="=";a.cronappFilterOperator&&0<a.cronappFilterOperator.length&&(d=a.cronappFilterOperator);var l=!0;a.cronappFilterAutopost&&"false"==a.cronappFilterAutopost&&(l=!1),setTimeout(function(){"INPUT"==i[0].tagName?this.inputBehavior(e,t,a,n,i,o,d,l):this.buttonBehavior(e,t,a,n,i,o,d,l)}.bind(this),100)}}}]).directive("cronRichEditor",["$compile",function(e){return{restrict:"E",replace:!0,require:"ngModel",parseToTinyMCEOptions:function(e){var t={allowFullScreen:"fullscreen |",allowPage:"fullpage newdocument code pagebreak |",allowPrint:"preview print |",allowTransferArea:"cut copy paste |",allowDoUndo:"undo redo |",allowSymbol:"charmap |",allowEmbeddedImage:"bdesk_photo |",allowFont:"formatselect fontselect fontsizeselect strikethrough bold italic underline removeformat |",allowLinks:"link unlink anchor |",allowParagraph:"alignleft aligncenter alignright alignjustify numlist bullist outdent indent blockquote hr |",allowFormulas:"tiny_mce_wiris_formulaEditor tiny_mce_wiris_formulaEditorChemistry tiny_mce_wiris_CAS |"},a={menubar:!1,statusbar:!1,plugins:"bdesk_photo advlist anchor autolink autoresize autosave charmap code colorpicker contextmenu directionality emoticons fullpage fullscreen hr image imagetools importcss insertdatetime legacyoutput link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace tabfocus table template toc visualblocks visualchars wordcount tiny_mce_wiris",toolbar:"",content_style:""};for(var n in e)n.startsWith("allow")&&e[n]&&(a.toolbar+=" "+t[n]);return a.menubar=e.showMenuBar,a.statusbar=e.showStatusBar,a.content_style=e.contentStyle,a.readonly=e.allowReadonly,JSON.stringify(a)},link:function(t,a,n){var i=JSON.parse(n.options),o=this.parseToTinyMCEOptions(i),d=" <textarea ui-tinymce=\"$options$\" ng-model=\"$ngModel$\" id=\"$id$\" aria-label=\"cronRichEditor\" ng-cron-click=\"$ngClick$\" ng-cron-dblclick=\"$ngDblclick$\" ng-cron-mousedown=\"$ngMouseDown$\" ng-cron-mouseup=\"$ngMouseUp$\" ng-cron-mousemove=\"$ngMouseMove$\" ng-cron-mouseover=\"$ngMouseOver$\" ng-cron-mouseenter=\"$ngMouseEnter$\" ng-cron-mouseleave=\"$ngMouseLeave$\" ng-cron-keydown=\"$ngKeydown$\" ng-cron-keyup=\"$ngKeyup$\" ng-cron-keypress=\"$ngKeypress$\" ng-context-menu=\"$ngContextMenu$\" ng-cron-paste=\"$ngPaste$\" ng-cron-init=\"$ngInit$\" ng-cron-focus=\"$ngFocus$\" ng-cron-blur=\"$ngBlur$\" ng-before-set-content=\"$ngBeforeSetContent$\" ng-set-content=\"$ngSetContent$\" ng-get-content=\"$ngGetContent$\" ng-pre-process=\"$ngPreProcess$\" ng-post-process\"$ngPostProcess$\" ng-node-change=\"$ngNodeChange$\" ng-cron-undo=\"$ngUndo$\" ng-cron-redo=\"$ngRedo$\" ng-cron-change=\"$ngChange$\" ng-cron-dirty=\"$ngDirty$\" ng-cron-remove=\"$ngRemove$\" ng-exec-command=\"$ngExecCommand$\" ng-paste-pre-process=\"$ngPastePreProcess$\" ng-paste-post-process=\"$ngPastePostProcess$\" ng-add-editor=\"$ngAddEditor$\" ng-remove-editor=\"$ngRemoveEditor$\"> </textarea> ";d=$(d.split("$ngModel$").join(n.ngModel).split("$ngClick$").join(n.ngCronClick||"").split("$ngDblclick$").join(n.ngCronDblclick||"").split("$ngMouseDown$").join(n.ngCronMouseDown||"").split("$ngMouseUp$").join(n.ngCronMouseUp||"").split("$ngMouseMove$").join(n.ngCronMousemove||"").split("$ngMouseOver$").join(n.ngCronMouseOver||"").split("$ngMouseEnter$").join(n.ngCronMouseenter||"").split("$ngMouseLeave$").join(n.ngCronMouseleave||"").split("$ngKeydown$").join(n.ngCronKeydown||"").split("$ngKeyup$").join(n.ngCronKeyup||"").split("$ngKeypress$").join(n.ngCronKeypress||"").split("$ngContextMenu$").join(n.ngContextMenu||"").split("$ngPaste$").join(n.ngCronPaste||"").split("$ngInit$").join(n.ngCronInit||"").split("$ngFocus$").join(n.ngCronFocus||"").split("$ngBlur$").join(n.ngCronBlur||"").split("$ngBeforeSetContent$").join(n.ngBeforeSetContent||"").split("$ngSetContent$").join(n.ngSetContent||"").split("$ngGetContent$").join(n.ngGetContent||"").split("$ngPreProcess$").join(n.ngPreProcess||"").split("$ngPostProcess$").join(n.ngPostProcess||"").split("$ngNodeChange$").join(n.ngNodeChange||"").split("$ngUndo$").join(n.ngCronUndo||"").split("$ngRedo$").join(n.ngCronRedo||"").split("$ngChange$").join(n.ngCronChange||"").split("$ngDirty$").join(n.ngCronDirty||"").split("$ngRemove$").join(n.ngRemove||"").split("$ngExecCommand$").join(n.ngExecCommand||"").split("$ngPastePreProcess$").join(n.ngPastePreProcess||"").split("$ngPastePostProcess$").join(n.ngPastePostProcess||"").split("$ngAddEditor$").join(n.ngAddEditor||"").split("$ngRemoveEditor$").join(n.ngRemoveEditor||"").split("$id$").join(n.id||app.common.generateId()).split("$options$").join(escape(o)));var l=angular.element(d);a.html(""),a.append(l),a.attr("id",null),e(l)(t);let r=$(`cron-rich-editor[ng-model="${n.ngModel}"]`),s=setInterval(()=>{r.find(".mce-container").length&&(r.find("button").each((e,t)=>{let a=$(t),n=a.parent().attr("aria-label")||"";a.attr("aria-label",n)}),clearInterval(s))},100)}}}]).directive("cronDashboardViewer",["$compile",function(){return{restrict:"E",replace:!0,require:"ngModel",link:function(e,t,a){function n(a){var n=JSON.parse(a);e.$eval(n.dashboardCommand,{element:t})}n(a.options);var i=null;e.$watch(function(){return a.options},function(e,t){e!==t&&(i&&(clearInterval(i),i=null),i=setTimeout(function(){n(e)}.bind(this),500))})}}}]).directive("cronReportViewer",["$compile",function(){return{restrict:"E",replace:!0,require:"ngModel",link:function(e,t,a){function n(a){var n=JSON.parse(a);e.$eval(n.reportCommand,{element:t})}n(a.options);var i=null;e.$watch(function(){return a.options},function(e,t){e!==t&&(i&&(clearInterval(i),i=null),i=setTimeout(function(){n(e)}.bind(this),500))})}}}]).directive("cronTimeline",["$compile","$parse",function($compile,$parse){'use strict';var defaultAdvancedTemplate="<ul class=\"timeline\">\r\n <timeline-event side=\"\" class=\"ng-scope\" ng-repeat=\"rowData in datasource\">\r\n <li class=\"timeline-event {{rowData[options.fields.field4] == '2' ? 'timeline-inverted' : ''}}\">\r\n <timeline-badge class=\"{{$odd ? 'info' : 'warning'}} bounce-in\">\r\n <div class=\"timeline-badge\">\r\n <i class=\"glyphicon {{rowData[options.fields.field3] ? rowData[options.fields.field3] : 'glyphicon-check'}}\"></i>\r\n </div>\r\n </timeline-badge>\r\n <timeline-panel class=\"info bounce-in\">\r\n <div class=\"timeline-panel\">\r\n <timeline-heading class=\"ng-scope\">\r\n <div class=\"timeline-heading\">\r\n <h4 class=\"ng-binding ng-scope\">{{rowData[options.fields.field0]}}</h4>\r\n <p class=\"ng-scope\">\r\n <small class=\"text-muted ng-binding\"><i class=\"glyphicon glyphicon-time\"></i>{{rowData[options.fields.field1]|mask:options.fields.mask2:options.fields.type1}}</small>\r\n </p>\r\n </div>\r\n </timeline-heading>\r\n <p ng-if=\"rowData[options.fields.field2]\" class=\"ng-binding ng-scope\">{{rowData[options.fields.field2]}}</p>\r\n </div>\r\n </timeline-panel>\r\n </li>\r\n </timeline-event>\r\n</ul>",getExpression=function(e){return"rowData in ".concat(e).concat(".data")};return{restrict:"E",require:"?ngModel",scope:!0,priority:9999998,terminal:!0,link:function(scope,element,attrs,ngModelCtrl){scope.hasValue=e=>null!==e&&e!==void 0;var optionsList={},dataSourceName="";try{optionsList=JSON.parse(attrs.options),dataSourceName=optionsList.dataSourceScreen.name;var dataSource=eval(optionsList.dataSourceScreen.name);scope.options=optionsList,attrs.ngModel&&(scope.changeRowDataField=function(e){e=dataSource.getKeyValues(e);var t=Object.keys(e);return 1===t.length&&(e=e[t]),e}),scope.options=optionsList,scope.options.fields={},scope.options.randomModel=_Mathfloor(9e3*Math.random())+1e3;for(var column,visibleColumns=[],i=0;i<optionsList.columns.length;i++)column=optionsList.columns[i],column.visible&&visibleColumns.push(optionsList.columns[i]);for(var column,i=0;i<visibleColumns.length;i++)column=visibleColumns[i],column.field&&"Database"==column.dataType&&(scope.options.fields["security"+i]=column.security,scope.options.fields["field"+i]=column.field,scope.options.fields["type"+i]=column.type,scope.options.fields["mask"+i]=column.format)}catch(e){console.log("CronTimeline invalid configuration! "+e)}scope.options.fields.image&&"do-not-show"!=scope.options.imageType&&(scope.options.imageClassPosition="item-"+scope.options.imageType+"-"+scope.options.imagePosition),scope.options.advancedTemplate||(scope.options.advancedTemplate="<ul class=\"timeline\">\r\n <timeline-event side=\"\" class=\"ng-scope\" ng-repeat=\"rowData in datasource\">\r\n <li class=\"timeline-event {{rowData[options.fields.field4] == '2' ? 'timeline-inverted' : ''}}\">\r\n <timeline-badge class=\"{{$odd ? 'info' : 'warning'}} bounce-in\">\r\n <div class=\"timeline-badge\">\r\n <i class=\"glyphicon {{rowData[options.fields.field3] ? rowData[options.fields.field3] : 'glyphicon-check'}}\"></i>\r\n </div>\r\n </timeline-badge>\r\n <timeline-panel class=\"info bounce-in\">\r\n <div class=\"timeline-panel\">\r\n <timeline-heading class=\"ng-scope\">\r\n <div class=\"timeline-heading\">\r\n <h4 class=\"ng-binding ng-scope\">{{rowData[options.fields.field0]}}</h4>\r\n <p class=\"ng-scope\">\r\n <small class=\"text-muted ng-binding\"><i class=\"glyphicon glyphicon-time\"></i>{{rowData[options.fields.field1]|mask:options.fields.mask2:options.fields.type1}}</small>\r\n </p>\r\n </div>\r\n </timeline-heading>\r\n <p ng-if=\"rowData[options.fields.field2]\" class=\"ng-binding ng-scope\">{{rowData[options.fields.field2]}}</p>\r\n </div>\r\n </timeline-panel>\r\n </li>\r\n </timeline-event>\r\n</ul>");var templateDyn=scope.options.advancedTemplate;for(let e,t=0;t<visibleColumns.length;t++)if(e=visibleColumns[t],e.field&&"Database"===e.dataType&&scope.options.fields[`security${t}`]){let e=`ng-if="rowData[options.fields.field${t}]"`,a=`${e} cronapp-security="${scope.options.fields["security"+t]}"`;templateDyn=templateDyn.replace(e,a)}templateDyn=$(templateDyn),scope.options.xattrTextPosition=attrs.xattrTextPosition,$(element).replaceWith(templateDyn);var $element=templateDyn,eventItem=$element.find("timeline-event");"rowData in datasource"===$(eventItem).attr("ng-repeat")&&eventItem.attr("ng-repeat",getExpression(dataSourceName)),$compile(templateDyn,null,9999998)(scope)}}}]).directive("cronScheduler",["$compile","$translate",function($compile,$translate){return{estrict:"E",replace:!0,initCulture:function(){var e=$translate.use();e=e.replace(/_/gm,"-");var t=e.split("-");t[t.length-1]=t[t.length-1].toUpperCase(),e=t.join("-"),kendo.culture(e)},getSchedulerModel:function(e){let t={id:"id",fields:{}};for(let a in e)t.fields[a]={from:e[a].name,validation:{required:!e[a].nullable}};return t},mergeSchedulerEventWithDatasourceActive:(e,t)=>Object.assign(e.active,t),setDatasourceActiveItem:function(e,t,a){if(t){for(let n in e.data){let i=e.data[n][a];if(null!==i&&i===t[a])return e.active=e.copy(e.data[n],{}),e.active}return e.startEditing({}),e.active}},getSchedulerProperties:function(t,a,n){let i="Expression"===t.initialDateStrategy?n.$eval(generateBlocklyCall(t.initialDateBlocklyInfo)):t.initialDate,o={start:null,end:null},d=function(e){return!angular.equals(o,e)},l=[];if(t.views)for(let e in t.views){let a=t.views[e];a.visible&&l.push(a)}else t.showDayTab&&l.push("day"),t.showAgendaTab&&l.push("agenda"),t.showMonthTab&&l.push("month"),t.showTimelineTab&&l.push("timeline"),t.showWeekTab&&l.push("week"),t.showWorkWeekTab&&l.push("workWeek");let r={dateHeaderTemplate:kendo.template(`#=kendo.toString(date, ${kendo.culture().name.toLowerCase().includes("pt")?"'ddd dd/M'":"'ddd M/dd'"})#`),showWorkHours:t.showWorkHours,selectable:!0,date:i,mobile:!0,allDaySlot:t.allDaySlot,messages:{editor:{timezone:$translate.instant("TimezoneEvent")}},currentTimeMarker:t.currentTimeMarker?{updateInterval:1e4,useLocalTimezone:!1}:t.currentTimeMarker,views:l,navigate:function(t){t.sender.view()},dataBound:function(t){t.sender.view()},change:t=>{t&&t.events&&t.events.length?this.setDatasourceActiveItem(a,t.events[0],"id"):a.startInserting({}),console.log("Active: ",a.active)},edit:function(a){if(t&&t.allowCustomAction){let e=a.container,i=t.customActionLabel?t.customActionLabel:$translate.instant(Details),o=$("<a class=\"k-button\">"+i+"</a>");o.click(function(){n.safeApply(()=>{n.$eval(generateBlocklyCall(t.customActionBlockly))})});let d=e.find(".k-edit-buttons");d.append(o)}},dataSource:{batch:!1,transport:{read:function(e){if(e.data=e.data||{},d(e.data)){o=e.data,jQuery.isEmptyObject(e.data)&&(e.data[t.schedulerDataModel.start.name]=i);let n=kendo.data.transports.odata.parameterMap(e.data,"read"),d={};d.params=n,a.fetch(d,{success:function(t){e.success(angular.copy(t))},canceled:function(t){e.error(angular.copy(t))}},!1)}else e.error()}.bind(this),update:e=>{let n=this.parseToDatasourceSchema(a,e.data,t);a.startEditing(a.active),this.mergeSchedulerEventWithDatasourceActive(a,n),a.update(a.active,t=>{let n=angular.copy(t);e.success(n),a.fetch({},{success:()=>{this.setDatasourceActiveItem(a,n,"id")},canceled:()=>{}},!1)},t=>{e.error(angular.copy(t))})},create:e=>{let n=this.parseToDatasourceSchema(a,e.data,t);this.mergeSchedulerEventWithDatasourceActive(a,n),a.insert(a.active,t=>{let n=angular.copy(t);e.success(n),a.fetch({},{success:()=>{this.setDatasourceActiveItem(a,n,"id")},canceled:function(){}},!1)},t=>{e.error(angular.copy(t))})},destroy:function(e){a.removeSilent(this.parseToDatasourceSchema(a,e.data,t),function(t){e.success(angular.copy(t))},function(t){e.error(angular.copy(t))})}.bind(this)},schema:{model:this.getSchedulerModel(t.schedulerDataModel)}}};return t.views||(r.editable=t.editable),window.fixedTimeZone&&window.timeZone&&(r.timezone=window.timeZone),r},showError:function(e,t,a){e.Notification.error({message:a,title:t,delay:null})},parseToDatasourceSchema:function(e,t,a){let n={};for(let i in e.schema){let a=e.schema[i].name;n[a]=t[a]}return n[a.schedulerDataModel.isAllDay.name]=!0===n[a.schedulerDataModel.isAllDay.name],n[a.schedulerDataModel.id.name]||delete n[a.schedulerDataModel.id.name],n},link:function(scope,element,attrs,ngModelCtrl){let datasource,schedulerElement=$("<div></div>"),options=JSON.parse(attrs.options||"{}");if(options.dataSourceScreen&&options.dataSourceScreen.entityDataSource&&(datasource=eval(options.dataSourceScreen.entityDataSource.name)),!datasource){let e={};return void $translate("DatasourceNotFoundMessage").then(t=>(e.message=t,$translate("Scheduler"))).then(t=>(e.component=t,$translate("DatasourceNotFoundTitle"))).then(t=>{e.title=t,this.showError(scope,e.title,e.message.replace("{0}",e.component))})}if(jQuery.isEmptyObject(options.schedulerDataModel))return;let baseUrl="node_modules/cronapp-lib-js/dist/js/kendo-ui/js/messages/kendo.messages.";baseUrl+="pt_br"===$translate.use()?"pt-BR.min.js":"en-US.min.js",this.initCulture(),$.getScript(baseUrl,function(){function e(e,t){if(!e||!t)return;let a;return e.forEach(e=>t.forEach(t=>{a=e.getTime()===t.getTime()})),a}let t=app.kendoHelper.getDataSource(options.dataSourceScreen.entityDataSource,scope,!0,options.dataSourceScreen.rowsPerPage),a=this.getSchedulerProperties(options,datasource,scope);schedulerElement.kendoScheduler(a);let n=schedulerElement.data("kendoScheduler");n.bind("navigate",function(t){n._previousView=t.sender.view()}),n.bind("dataBound",function(t){if(n._currentView=t.sender.view(),n._previousView){let t=e(n._previousView._dates,n._currentView._dates);if(!t){let e={};e[options.schedulerDataModel.start.name]=n._currentView._startDate,e[options.schedulerDataModel.end.name]=n._currentView._endDate,n.dataSource.read(e),n._previousView=n._currentView}}})}.bind(this)),element.html(schedulerElement),$compile(schedulerElement)(element.scope())}}}]).directive("cronGrid",["$compile","$translate",function($compile,$translate){return{restrict:"E",replace:!0,require:"ngModel",initCulture:function(){var e=$translate.use();e=e.replace(/_/gm,"-");var t=e.split("-");t[t.length-1]=t[t.length-1].toUpperCase(),e=t.join("-"),kendo.culture(e)},changeObjectField:function(e,t){t=e.getKeyValues(t);var a=Object.keys(t);return 1===a.length&&(t=t[a]),t},generateToolbarButtonCall:function(toolbarButton,scope,options){var buttonCall,generateObjTemplate=function(e,t,a){var n={template:function(){var n=app.common.generateId();return createTemplateButton(n,e,t,a)}.bind(this)};return n}.bind(this),createTemplateButton=function(buttonId,functionToCall,title,iconClass){var template="";let security=toolbarButton.security?`cronapp-security="${toolbarButton.security}"`:"";"SaveOrCancelChanges"==toolbarButton.type?toolbarButton.saveButton?template="<a #SECURITY# role=\"button\" class=\"saveorcancelchanges k-button k-button-icontext k-grid-save-changes\" id=\"#BUTTONID#\" href=\"javascript:void(0)\"><span class=\"k-icon k-i-check\"></span>#TITLE#</a>":template="<a #SECURITY# role=\"button\" class=\"saveorcancelchanges k-button k-button-icontext k-grid-cancel-changes\" id=\"#BUTTONID#\" href=\"javascript:void(0)\"><span class=\"k-icon k-i-cancel\" ></span>#TITLE#</a>":"Blockly"==toolbarButton.type||"Customized"==toolbarButton.type?template="<a #SECURITY# class=\"k-button k-grid-custom\" id=\"#BUTTONID#\" href=\"javascript:void(0)\"><span class=\"#ICONCLASS#\" ></span>#TITLE#</a>":"Native"==toolbarButton.type&&"create"==toolbarButton.title?template="<a #SECURITY# role=\"button\" id=\"#BUTTONID#\" class=\"k-button k-button-icontext k-grid-add\" href=\"javascript:void(0)\"><span class=\"k-icon k-i-plus\"></span>{{\"Add\" | translate}}</a>":"Native"==toolbarButton.type&&"excel"==toolbarButton.title?template="<a #SECURITY# role=\"button\" id=\"#BUTTONID#\" class=\"k-button k-button-icontext k-grid-excel\" href=\"javascript:void(0)\"><span class=\"k-icon k-i-file-excel\"></span>{{\"exportExcel\" | translate}}</a>":"Native"==toolbarButton.type&&"pdf"==toolbarButton.title&&(template="<a #SECURITY# role=\"button\" id=\"#BUTTONID#\" class=\"k-button k-button-icontext k-grid-pdf\" href=\"javascript:void(0)\"><span class=\"k-icon k-i-file-pdf\"></span>{{\"exportPDF\" | translate}}</a>"),template=template.split("#BUTTONID#").join(buttonId).split("#FUNCTIONCALL#").join(this.encodeHTML(functionToCall)).split("#TITLE#").join(title).split("#ICONCLASS#").join(iconClass).split("#SECURITY#").join(security);var cronappDatasource=eval(options.dataSourceScreen.entityDataSource.name),waitRender=setInterval(function(){0<$("#"+buttonId).length&&(scope.safeApply(function(){var e=angular.element($("#"+buttonId));$compile(e)(scope)}),$("#"+buttonId).click(function(){var e=options.refComponent,t=[];e.select().each(function(){var a=e.dataItem(this);cronappDatasource.data.forEach(function(e){e.__$id==a.__$id&&t.push(e)})});var a={item:t.length?cronappDatasource.active:null,index:t.length?cronappDatasource.cursor:null};let n=[];options.fieldType&&"key"===options.fieldType?t.forEach(e=>{n.push(this.changeObjectField(cronappDatasource,cronappDatasource.findObjInDs(e)))}):n=t;var i={currentData:cronappDatasource.data,datasource:cronappDatasource.copyWithoutAngularObj(),selectedIndex:t.length?cronappDatasource.cursor:null,index:t.length?cronappDatasource.cursor:null,selectedRow:t.length?cronappDatasource.active:null,consolidated:a,item:t.length?cronappDatasource.active:null,selectedKeys:t.length?cronappDatasource.getKeyValues(cronappDatasource.findObjInDs(t[0]),!0):null,selectedRows:n};scope.$eval(functionToCall,i)}.bind(this)),clearInterval(waitRender))}.bind(this),200);return template}.bind(this),call="";call="Customized"==toolbarButton.type?toolbarButton.execute:toolbarButton.methodCall?toolbarButton.methodCall:generateBlocklyCall(toolbarButton.blocklyInfo);var title=null==toolbarButton.title?"":toolbarButton.title;return buttonCall=generateObjTemplate(call,title,toolbarButton.iconClass),buttonCall},generateModalSaveOrCancelButtonCall:function(e,t,a,n,i){var o=app.common.generateId();return buttonCall=function(e,t,a,n){var d;d="save"==e?"<button id=\"#BUTTONID#\" aria-label=\"#ARIALABELSAVE#\" class=\"btn btn-primary btn-fab ng-binding grid-save-button-modal k-button\" data-component=\"crn-button\" ng-click=\"#FUNCTIONCALL#\" onclick=\"(!#DATASOURCENAME#.missingRequiredField(true)?$('##MODALID#').modal('hide'):void(0))\"><span class=\"k-icon k-i-check\"></span></button>":"saveAdd"==e?"<button id=\"#BUTTONID#\" aria-label=\"#ARIALABELSAVEADD#\" class=\"btn btn-primary btn-fab ng-binding grid-save-add-button-modal k-button\" data-component=\"crn-button\" ng-click=\"#FUNCTIONCALL#\"><span class=\"k-icon k-i-plus\"></span></button>":"<button id=\"#BUTTONID#\" aria-label=\"#ARIALABELCANCEL#\" type=\"button\" class=\"btn btn-default btn-fab ng-binding k-button\" data-component=\"crn-button\" data-dismiss=\"modal\"><span class=\"k-icon k-i-cancel\"></span></button>",d=d.split("#BUTTONID#").join(o).split("#FUNCTIONCALL#").join(t).split("#DATASOURCENAME#").join(a).split("#ARIALABELSAVE#").join($translate.instant("SaveChanges")).split("#ARIALABELSAVEADD#").join($translate.instant("SaveAddChanges")).split("#ARIALABELCANCEL#").join($translate.instant("CancelChanges")).split("#MODALID#").join(n);var l=setInterval(function(){0<$("#"+o).length&&i.safeApply(function(){var e=angular.element($("#"+o));$compile(e)(i),clearInterval(l)})},200);return d}(e,t,a,n),buttonCall},addButtonsInModal:function(e,t,a,n){var i=$("#"+e).find(".modal-footer");if(!i.find(".grid-save-button-modal").length){var o=t+".post();",d=this.generateModalSaveOrCancelButtonCall("save",o,t,e,a);if(i.append(d),n){let n=this.generateModalSaveOrCancelButtonCall("saveAdd",o+t+".startInserting();",t,e,a);i.append(n)}var l=this.generateModalSaveOrCancelButtonCall("cancel",null,null,null,a);i.append(l)}},getObjectId:function(e){if(!e)e="";else if(e instanceof Date){var t=moment.utc(e);e=new Date(t.format("YYYY-MM-DDTHH:mm:ss"))}else if("object"==typeof e)if(e.id)e=e.id;else for(var a in e){e=e[a];break}return e},encodeHTML:function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},decodeHTML:function(e){return e.replace(/&apos;/g,"'").replace(/&quot;/g,"\"").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&")},getColumnByField:function(e,t){var a=null;return e.columns.forEach(function(e){e.field==t&&(a=e)}),a},resizeGridUsingWidthForDevice:function(e){for(let t,a=0;a<e.columns.length;a++)t=this.getWidthForDevice(e.columns[a]),e.columns[a].width=t.width,t.visible?e.showColumn(a):e.hideColumn(a);if(e.options.hasSecurity){let t=$(e.element.find("col")).last();t.css("width","0px")}},getWidthForDevice:function(e){let t=1002,a=$(window).width(),n=function(t){let a;return e.widthDevices.forEach(e=>{e.device===t&&(a=e)}),void 0===a&&("deviceSmall"===t?a=n("deviceMedium"):"deviceMedium"===t?a=n("deviceDesktop"):"deviceDesktop"===t?a=n("deviceBig"):a=e.widthDevices[0]),a},i={width:e.width};return i.visible=void 0!==e.visible&&null!==e.visible?e.visible:!e.hidden,null!==e.widthDevices&&void 0!==e.widthDevices&&0<e.widthDevices.length&&(1210<=a?i=n("deviceBig"):a>=t&&1210>a?i=n("deviceDesktop"):a>=778&&a<t?i=n("deviceMedium"):i=n("deviceSmall")),i},getColumns:function(options,datasource,scope,tooltips){function getTemplate(column){var template="#=showTreatedValue("+column.field+")#";return"switch"==column.inputType?template="<span class=\"k-switch km-switch k-widget km-widget k-switch-off km-switch-off\" style=\"width: 100%\"> <span class=\"k-switch-wrapper km-switch-wrapper\"> <span class=\"k-switch-background km-switch-background\" style=\"margin-left: #="+column.field+" ? \"80%\": \"0%\" #\"></span> </span> <span class=\"k-switch-container km-switch-container\"> <span class=\"k-switch-handle km-switch-handle\" style=#="+column.field+" ? \"float:right;margin-right:-1px\": \"margin-left:0%\" #> </span> </span> </span>":"checkbox"==column.inputType||"boolean"==column.type?template="<input crn-set-indeterminate=#="+column.field+"# type='checkbox' class='k-checkbox' #="+column.field+" ? \"checked='checked'\": '' # /><label class='k-checkbox-label k-no-text'></label>":column.displayField&&0<column.displayField.length?hasMask(column.type)||column.format&&"null"!=column.format?template="#= useMask("+column.displayField+",'"+column.format+"','"+column.type+"') #":template="#="+column.displayField+"#":hasMask(column.type)||column.format&&"null"!=column.format?template="#= useMask("+column.field+",'"+column.format+"','"+column.type+"') #":column.showAsImage&&(template=column.showAsImageTemplate?column.showAsImageTemplate:"<img src='#:${column.field}#'/>",template=eval("`"+template+"`")),template}function hasMask(e){return!!(e&&"string"==typeof e)&&(e.startsWith("date")||e.startsWith("month")||e.startsWith("time")||e.startsWith("week")||e.startsWith("money")||e.startsWith("number")||e.startsWith("tel")||e.startsWith("integer"))}function getFormat(e){return hasMask(e.type)?void 0:e.format}function isRequired(e){var t=!1,a=null;return datasource.schema.model.fields[e]&&(a=datasource.schema.model.fields[e]),a&&(t=!a.nullable),t}function getEditor(){return editor.bind(this)}async function editor(e,t){let a=e=>{e!==t.model[t.field]&&(t.model[t.field]=e,t.model.dirty=!0,t.model.dirtyFields[t.field]=!0)};var n=this.getColumnByField(options,t.field);null==n.visibleCrud||n.visibleCrud||(e.parent().find(".k-edit-label [for="+n.field+"]").parent().remove(),e.remove());var i=isRequired(t.field)?"required":"",o=app.common.generateId();let d=`${options.dataSourceScreen.name}.active.${t.field}`;var l=$(`<input ${i} name="${t.field}" id="${o}" from-grid=true ng-model="${d}" />`);if(l.data("change-grid-model",a),l.data("column-type",n.type),"dynamicComboBox"==n.inputType||"comboBox"==n.inputType){var r=app.kendoHelper.getConfigComboboxSync(n.comboboxOptions,scope);r.autoBind=!0,r.optionLabel=void 0,n.displayField&&(r.change=function(){t.model.set(n.displayField,this.text()),t.model.dirty=!0,t.model.dirtyFields[n.displayField]=!0});let a=l.appendTo(e).kendoDropDownList(r,scope).data("kendoDropDownList");l.data("kendoDropDownList",a)}else if("slider"==n.inputType){var r=app.kendoHelper.getConfigSlider(n.sliderOptions);r.change=t=>scope.$apply(()=>scope.$eval(`${d}=${t.value}`));let t=l.appendTo(e).kendoSlider(r,scope).data("kendoSlider");l.data("kendoSlider",t)}else if("switch"==n.inputType){var r=app.kendoHelper.getConfigSwitch(n.switchOptions);l.appendTo(e).kendoMobileSwitch(r,scope)}else"checkbox"==n.inputType||"boolean"==n.type?(l=$(`<input id="${o}" name="${t.field}" ng-false-value="false" ng-true-value="true" crn-allow-null-values="${!i}" class="k-checkbox" type="checkbox" from-grid=true ng-model="${d}"><label class="k-checkbox-label" for="${o}"></label>`),l.data("change-grid-model",a),l.appendTo(e)):"date"==n.inputType?(l.attr("cron-date",""),l.attr("options",JSON.stringify(n.dateOptions)),l.data("initial-date",t.model[t.field]),l.attr("type","datetime"),l.appendTo(e).off("change")):(l.attr("type",n.type),l.attr("mask",n.format?n.format:""),("999.999.999-99;0"===n.format||"99.999.999/9999-99;0"===n.format)&&(l.attr("valid","999.999.999-99;0"===n.format?"cpf":"cnpj"),l.attr("data-"+n.field.toLocaleLowerCase()+"validation-msg",$translate.instant("invalid."+l.attr("valid")))),l.css("text-align",n.alignment),l.attr("class","k-input k-textbox"),l.data("initial-value",t.model[t.field]),l.appendTo(e));(e=>new Promise(t=>{let a=setInterval(function(){let n=$("#"+e);if(0<n.length){let i=n.closest("td"),o=angular.element(i||n);$compile(o)(scope),clearInterval(a),t(e)}},10)}))(o).then(e=>{$(`#${e}`).data("alreadycompiled",!0),$(`#${e}`).data("$compile",$compile),$(`#${e}`).data("ref-component",options.refComponent)})}function getCommandForEditButtonDatabase(e,t){var a;let n=app.common.generateId(),i=$translate.instant("Edit"),o=`<a href class='k-button k-grid-edit k-grid-${n}' aria-label='${i}'><span class='k-icon k-i-edit'></span></a>`;return a="popupCustom"==e.editable||"datasource"==e.editable?{name:n,template:o,click:function(t){t.preventDefault();var a=$(t.target).closest("tr"),n=a.closest("table"),i=this.dataItem(a),o=this.dataSource.transport.options.cronappDatasource;scope.safeApply(function(){options.hideModalButtons||helperDirective.addButtonsInModal(options.popupEdit,o.name,scope,!1);var t=o.goTo(i);o.startEditing(t,function(){}),"datasource"==e.editable?cronapi.internal.focusFormInput():cronapi.screen.showModal(options.popupEdit)})}}:{name:t,template:o,text:{edit:" ",update:" ",cancel:" "}},a}function getCommandForRemoveButtonDatabase(e,t){var a;let n=app.common.generateId(),i=$translate.instant("Remove"),o=`<a href class='k-button k-grid-delete k-grid-${n}' aria-label='${i}'><span class='k-icon k-i-close'></span></a>`;return a="popupCustom"==e.editable||"datasource"==e.editable?{name:n,template:o,click:function(t){t.preventDefault();var e=$(t.target).closest("tr"),a=this.dataItem(e),n=this.dataSource.transport.options.cronappDatasource,i=this;scope.safeApply(function(){var e=n.goTo(a);n.remove(e)})}}:{name:t,template:o},a}function getAggregate(e){if(e&&e.aggregates){var t=[];if(e.aggregates.forEach(function(e){t.push(e.type)}),0<t.length)return t}}function getAggregateFooter(e,t){if(e&&e.aggregates){var n=[];return e.aggregates.forEach(function(i){var a="#=data."+e.field+" ? data."+e.field+"."+i.type+" : 0 #";("average"==i.type||"sum"==i.type)&&(a="#=useMask(data."+e.field+" ? data."+e.field+"."+i.type+" : 0,'"+e.format+"','"+e.type+"')#");var o=t?i.groupFooterTemplate:i.footerTemplate;o?o+=": ":o="";var d=o+a;e.alignment&&("right"!==e.alignment||t?d="<div style=\"text-align: "+e.alignment+"\">"+d+"</div>":d="<div style=\"text-align: "+e.alignment+"\" class=\"k-fix-margin\">"+d+"</div>"),n.push(d)}),n.join("<br/>")}}function getAggregateHeader(e){return hasMask(e.type)||e.format&&"null"!=e.format?e.headerText+": #=useMask(value,'"+e.format+"','"+e.type+"')#":void 0}function getAttributes(e){let t={};return e&&(e.alignment&&(t.style="text-align: "+e.alignment+";"),e.security&&(t["cronapp-security"]=e.security)),t}var helperDirective=this,columns=[];return options.columns&&options.columns.forEach(function(t){let a=this.getWidthForDevice(t);if("Database"==t.dataType){var n={field:t.field,title:t.headerText,type:t.type,width:a.width,sortable:t.sortable,filterable:t.filterable,hidden:!a.visible};n.template=getTemplate(t),n.format=getFormat(t),n.editor=getEditor.bind(this)(t),n.aggregates=getAggregate(t),n.footerTemplate=getAggregateFooter(t,!1),n.groupFooterTemplate=getAggregateFooter(t,!0),n.groupHeaderTemplate=getAggregateHeader(t),n.attributes=getAttributes(t),n.headerAttributes=n.attributes,n.widthDevices=t.widthDevices,columns.push(n)}else if("Command"==t.dataType){if("no"!=options.editable){var i=t.command.split("|"),o=[];i.forEach(function(e){var t;t="edit"==e?getCommandForEditButtonDatabase.bind(this)(options,e):getCommandForRemoveButtonDatabase.bind(this)(options,e),o.push(t)}.bind(this));var n={command:o,title:t.headerText,width:a.width?a.width:155,hidden:!a.visible,attributes:getAttributes(t)};columns.push(n)}}else if("Blockly"==t.dataType||"Customized"==t.dataType||"CustomizedLink"==t.dataType){var d=null==t.label?"":t.label;t.iconClass&&d&&(d="&nbsp;"+d);var l="";l="CustomizedLink"==t.dataType?"k-custom-link":"k-custom-command"+(d?" k-button-with-label":""),t.theme&&(l+=" "+t.theme);var r="";if(t.tooltip&&t.tooltip.length&&(r=t.tooltip),r){var s=app.common.generateId();tooltips[s]=r,l+=" "+s}let e=app.common.generateId(),i=r||d||e,o=`<a href class='k-button ${l} k-grid-${e}' aria-label='${i}'><span class='${t.iconClass}'></span>${d}</a>`;var n={command:[{name:e,template:o,click:function(a){a.preventDefault();var e=$(a.target).closest("tr"),n=e.closest("table"),i=this.dataItem(e),o=this.dataItem(e),d=$(n.find("tbody")[0]).children().index(e),l=void 0;l="Customized"==t.dataType||"CustomizedLink"==t.dataType?t.execute:generateBlocklyCall(t.blocklyInfo);var r=this.dataSource.transport.options.cronappDatasource,s=options.refComponent,c=[];if(s.select().each(function(){var e=s.dataItem(this);r.data.forEach(function(t){t.__$id==e.__$id&&c.push(t)})}),!(r.inserting||r.editing)){var e=a.currentTarget.parentElement.parentElement;this.select(e)}let p=[];options.fieldType&&"key"===options.fieldType?(o=helperDirective.changeObjectField(r,r.findObjInDs(o)),c.forEach(e=>{p.push(helperDirective.changeObjectField(r,r.findObjInDs(e)))})):p=c;var u={item:o,index:d},g={currentData:r.data,datasource:r.copyWithoutAngularObj(),selectedIndex:d,index:d,selectedRow:o,consolidated:u,item:o,selectedKeys:r.getKeyValues(r.findObjInDs(i),!0),selectedRows:p};return r.goTo(i),void scope.$eval(l,g)}}],width:a.width,title:t.headerText?t.headerText:"",hidden:!a.visible,attributes:getAttributes(t)};columns.push(n)}else if("Selectable"==t.dataType){var c={selectable:!0,attributes:getAttributes(t)};columns.push(c)}}.bind(this)),columns},getPageAble:function(e){var t={refresh:e.allowRefreshGrid,pageSizes:e.allowSelectionTotalPageToShow,buttonCount:5};return e.allowPaging||(t=e.allowPaging),t},getToolbar:function(e,t){function a(e){let t=e.security?`cronapp-security="${e.security}" class`:"class";e.template&&(e.template=e.template.split("class").join(t));let a={template:e.template};return a}var n=[];return e.toolBarButtons.forEach(function(i){if("Native"==i.type){if("no"==e.editable)("pdf"==i.title||"excel"==i.title)&&n.push(i.title);else if(("datasource"==e.editable||"popupCustom"==e.editable)&&"create"==i.title){var o=e.dataSourceScreen.name,d=e.popupInsert;i.methodCall=o+".startInserting();","popupCustom"==e.editable?i.methodCall=i.methodCall+" cronapi.screen.showModal('"+d+"');":i.methodCall+="cronapi.internal.focusFormInput();";var l=this.generateToolbarButtonCall(i,t,e);n.push(l),e.hideModalButtons||this.addButtonsInModal(d,o,t,e.enableModalSaveAdd)}else{let a=this.generateToolbarButtonCall(i,t,e);n.push(a)}}else if("Blockly"==i.type||"Customized"==i.type){var r=this.generateToolbarButtonCall(i,t,e);n.push(r)}else if("SaveOrCancelChanges"==i.type){if("no"!=e.editable){var s=this.generateToolbarButtonCall(i,t,e);n.push(s)}}else if("Template"==i.type||"Title"==i.type){let e=a(i);n.push(e)}}.bind(this)),0==n.length&&(n=void 0),n},getEditable:function(e){var t={mode:e.editable,confirmation:!1};return"batch"==e.editable?t=!0:("no"==e.editable||"popupCustom"==e.editable||"datasource"==e.editable)&&(t=!1),t},getTooltipsDefault:function(){var e={k_grid_edit:$translate.instant("Edit"),k_grid_delete:$translate.instant("Remove"),k_grid_update:$translate.instant("Save"),k_grid_cancel:$translate.instant("Cancel")};return e},setTooltips:function(e,t){for(var a in t){var n="."+a.replace(/_/g,"-");e.kendoTooltip({filter:n,content:function(a){var e=a.sender.options.filter.substr(1).replace(/-/g,"_");return t[e]}})}},generateKendoGridInit:function(t,a,n,i,o){var d=this,l=function(e,t,a){var n=e.table.find(".k-master-row");n.each(function(){(null==a||this!=a[0])&&e.collapseRow(this)});var i=e.table.find(".k-detail-row");i.each(function(){(null==t||this!=t[0])&&$(this).remove()})},r=function(e,t,a){var n=e.table.find(".k-master-row");n.each(function(){(null!=a||this==a[0])&&e.collapseRow(this)});var i=e.table.find(".k-detail-row");i.each(function(){(null!=t||this==t[0])&&$(this).remove()})},s=function(e){var t=this.dataSource.transport.options.cronappDatasource;t.inserting||t.editing||a.safeApply(t.goTo(e))},c=function(n){if(n.sender.tbody&&n.sender.tbody.length){var e=n.sender.tbody;$(n.sender.tbody).find(".k-grid-edit-row").length?e=$(n.sender.tbody).find("tr:not(.k-grid-edit-row)"):e.parent()&&e.parent().parent()&&e.parent().parent().parent()&&(e=e.parent().parent().parent()),a.safeApply(function(){var n=$(e),i=angular.element(n);$compile(i)(a),t.refComponent&&d.resizeGridUsingWidthForDevice(t.refComponent)})}},p=function(e){var a,n=0;return t.columns.forEach(function(t){"Database"==t.dataType&&(n==e&&t.visible&&(a=t),t.visible&&n++)}),a},u=app.kendoHelper.getDataSource(t.dataSourceScreen.entityDataSource,a,t.allowPaging,t.pageCount,t.columns,t.groupings),g=this.getColumns(t,u,a,o),m=this.getPageAble(t),f=this.getToolbar(t,a),h=this.getEditable(t),b=function(e){var t=!1;if(e.columns)for(var a=0;a<e.columns.length;a++)if("Database"==e.columns[a].dataType&&e.columns[a].filterable){t=!0;break}return t}(t),v={hasSecurity:t.columns.filter(e=>e.security).length,toolbar:f,pdf:{allPages:!0,avoidLinks:!0,paperSize:"A4",margin:{top:"2cm",left:"1cm",right:"1cm",bottom:"1cm"},landscape:!0,repeatHeaders:!0,scale:.8},dataSource:u,editable:h,height:t.height,groupable:t.allowGrouping,sortable:t.allowSorting,filterable:!0,pageable:m,columns:g,selectable:t.allowSelectionRow,detailInit:t.details&&0<t.details.length?function(t){if(t.masterRow.find("a").hasClass("k-i-expand"))return void r(this,t.detailRow,t.masterRow);var e=this.dataSource.transport.options.cronappDatasource;e.inserting||e.editing?l(this,null,null):(this.selectable?this.select(t.masterRow):(s.bind(this)(t.data),l(this,t.detailRow,t.masterRow)),t.sender.options.listCurrentOptions.forEach(function(e){var n=d.generateKendoGridInit(e,a,void 0,void 0,o),i=$("<div/>"),l=i.appendTo(t.detailCell).kendoGrid(n).data("kendoGrid");app.kendoHelper.receivePushData(l),e.refComponent=l,window.addEventListener("resize",()=>{d.resizeGridUsingWidthForDevice(l)}),d.setTooltips(i,o)}))}:void 0,listCurrentOptions:t.details&&0<t.details.length?t.details:void 0,excelExport:function(t){let e=t.workbook.sheets[0];for(let n,i=1;i<e.rows.length;i++){n=e.rows[i];for(let e,t=0;t<n.cells.length;t++){if(e=p(t),e&&n.cells[t].value instanceof Date){let a=new Date(n.cells[t].value.getTime());a.setMinutes(a.getMinutes()+a.getTimezoneOffset()),a.setSeconds(a.getSeconds()),n.cells[t].value=a,"time"==e.type?n.cells[t].format="[$-x-systime]hh:mm:ss":"datetime"==e.type&&(n.cells[t].format="dd/mm/yyyy hh:mm:ss;@")}if("footer"===n.type&&n.cells[t].value){let e=n.cells[t].value,i=$(e)[0].innerHTML,o=/{{(.*?)}}/.exec(i);if(o&&1<o.length){i=i.replace(o[0],"");let e=a.$eval(o[1]);n.cells[t].value=`${i}${e}`}}}}},edit:function(t){this.dataSource.transport.options.disableAndSelect(t);var e=t.container,n=this.dataSource.transport.options.cronappDatasource;if(t.model.isNew()){var o=t.model;n.startInserting(null,function(t){for(var a in t)if(o.fields[a]){if(o.fields[a].validation&&o.fields[a].validation.required){var n=e.find("input[name='"+a+"']");n.length&&n.val(t[a]).trigger("change")}o.set(a,t[a])}})}else t.model.isNew()||t.model.dirty||a.safeApply(function(){var e=n.goTo(t.model);n.startEditing(e,function(){})});i&&i.ngEdit&&a.$eval(i.ngEdit),c(t)},change:function(o){var e=this.dataItem(this.select());s.bind(this)(e);var r=this.dataSource.transport.options.cronappDatasource;if(t.fieldType&&"key"===t.fieldType&&(r.active=d.changeObjectField(r,r.active)),n)if("multiple"===t.allowSelectionRowType){let e=[];this.select().each((a,n)=>{let i=this.dataItem(n),o=r.findObjInDs(i,!1);t.fieldType&&"key"===t.fieldType&&(o=d.changeObjectField(r,o)),null!==o&&e.push(o)}),n.$setViewValue(e)}else e?n.$setViewValue(r.active):n.$setViewValue(null);l(this,this.select().next(),this.select()),i&&i.ngChange&&a.$eval(i.ngChange),c(o)},cancel:function(t){var e=this.dataSource.transport.options.cronappDatasource;a.safeApply(e.cancel()),this.dataSource.transport.options.enableAndSelect(t),setTimeout(function(){i&&i.ngCancel&&a.$eval(i.ngCancel),c(t)}.bind(this))},dataBound:function(n){setTimeout(()=>this.dataSource.transport.options.selectActiveInGrid(),100),i&&i.ngDataBound&&a.$eval(i.ngDataBound);for(let e,a=0;a<this.columns.length;a++)e=d.getColumnByField(t,this.columns[a].field),e.visible&&this.showColumn(a);0==$("div.k-grouping-header").length?t.groupings&&t.groupings.forEach(e=>this.hideColumn(e.field)):$("div.k-group-indicator").each((e,t)=>{this.hideColumn($(t).data("field"))});let e=this;setTimeout(function(){e.pager&&e.pager.element.find("a").not(".k-state-disabled").attr("tabindex","0")}),c(n)}};return v.selectable&&"multiple"==t.allowSelectionRowType&&(v.selectable="multiple"),v.originalSelectable=v.selectable,i&&i.ngBeforeEdit&&(v.beforeEdit=function(){a.$eval(i.ngBeforeEdit)}),i&&i.ngDataBinding&&(v.dataBinding=function(){a.$eval(i.ngDataBinding)}),i&&i.ngSave&&(v.save=function(){a.$eval(i.ngSave)}),i&&i.ngSaveChanges&&(v.saveChanges=function(){a.$eval(i.ngSaveChanges)}),i&&i.ngRemove&&(v.remove=function(){a.$eval(i.ngRemove)}),v},link:function(e,t,a,n){if(!t.children().length){var i=$("<div></div>"),o="node_modules/cronapp-lib-js/dist/js/kendo-ui/js/messages/kendo.messages.";o+="pt_br"==$translate.use()?"pt-BR.min.js":"en-US.min.js",this.initCulture();var d=this;$.getScript(o,function(){var t=JSON.parse(a.options||"{}");app.kendoHelper.getCorrectlyDS(t.dataSourceScreen.entityDataSource.name,e).batchPost=!1;var o=null==t.batchMode||t.batchMode;o&&"datasource"!=t.editable&&app.kendoHelper.getCorrectlyDS(t.dataSourceScreen.entityDataSource.name,e)&&!app.kendoHelper.getCorrectlyDS(t.dataSourceScreen.entityDataSource.name,e).dependentLazyPost&&(app.kendoHelper.getCorrectlyDS(t.dataSourceScreen.entityDataSource.name,e).batchPost=!0,t.toolBarButtons=t.toolBarButtons||[],t.toolBarButtons.push({type:"SaveOrCancelChanges",title:$translate.instant("SaveChanges"),methodCall:t.dataSourceScreen.entityDataSource.name+".postBatchData()",saveButton:!0}),t.toolBarButtons.push({type:"SaveOrCancelChanges",title:$translate.instant("CancelChanges"),methodCall:t.dataSourceScreen.entityDataSource.name+".cancelBatchData()",saveButton:!1}));var l=d.getTooltipsDefault(),r=d.generateKendoGridInit(t,e,n,a,l);r.scrollable="true"===a.scrollable;var s=i.kendoGrid(r).data("kendoGrid");app.kendoHelper.receivePushData(s),t.refComponent=s,window.addEventListener("resize",()=>{d.resizeGridUsingWidthForDevice(s)}),d.setTooltips(i,l),e.safeApply(function(){app.kendoHelper.getCorrectlyDS(t.dataSourceScreen.entityDataSource.name,e)&&(i.find(".k-filter-row").show(),i.find(".k-pager-sizes").show(),i.find(".k-pager-nav").show(),i.find(".k-pager-numbers").show(),i.find(".k-pager-refresh.k-link").show(),i.find(".saveorcancelchanges").hide(),app.kendoHelper.getCorrectlyDS(t.dataSourceScreen.entityDataSource.name,e).addDataSourceEvents({pendingchanges:function(e){e?(i.find(".k-filter-row").hide(),i.find(".k-pager-sizes").hide(),i.find(".k-pager-nav").hide(),i.find(".k-pager-numbers").hide(),i.find(".k-pager-refresh.k-link").hide(),i.find(".saveorcancelchanges").show()):(i.find(".k-filter-row").show(),i.find(".k-pager-sizes").show(),i.find(".k-pager-nav").show(),i.find(".k-pager-numbers").show(),i.find(".k-pager-refresh.k-link").show(),i.find(".saveorcancelchanges").hide())}}),app.kendoHelper.getCorrectlyDS(t.dataSourceScreen.entityDataSource.name,e).addDataSourceEvents({afterchanges:function(){}}))})}),t.html(i),$compile(i)(t.scope())}}}}]).directive("src",["$compile",function(){return{restrict:"A",link:function(e,t,a){"IMG"===t[0].tagName&&cronapi.internal.isBase64(a.src)&&setTimeout(()=>$(t[0]).attr("src","data:image/png;base64,"+a.src))}}}]).directive("cronTreeView",["$compile","$translate",function($compile,$translate){return{restrict:"E",replace:!0,require:"ngModel",scope:!0,getDataSource:function(options,scope,ngModelCtrl){let id=options.dataSourceScreen.schema.filter(e=>!0===e.key)[0].name,schema={model:{id:id,hasChildren:function(e){return e.hasChildren}}},getAllParent=function(e,t,a,n,i){t[schema.model.id]&&a.push(t[schema.model.id]);let o=`${e.entity}?$filter=${schema.model.id} eq '${t[options.selfRelationshipField]}'&$format=json&$inlinecount=allpages`;t[options.selfRelationshipField]?$.ajax({url:o,success:t=>{getAllParent(e,t.d.results[0],a,n,i)},beforeSend:e=>{window.uToken&&e.setRequestHeader("X-AUTH-TOKEN",window.uToken)},error:()=>i(),type:"GET"}):n(a)},reloadAndExpand=function(e){this.options.kendoObj.dataSource.bind("requestEnd",()=>{let t=new Promise((t,a)=>{getAllParent(this.options.cronappDatasource,e,[],t,a)});t.then(e=>{this.options.kendoObj.expandPath(e.reverse())})}),this.options.kendoObj.dataSource.read()},helperDirective=this,waitingPromise=!1,datasource=new kendo.data.HierarchicalDataSource({transport:{push:function(){!helperDirective.dataSourceEventsPush&&this.options.cronappDatasource&&(helperDirective.dataSourceEventsPush={create:function(e){reloadAndExpand.bind(this)(e)}.bind(this),update:function(e){reloadAndExpand.bind(this)(e)}.bind(this),delete:function(e){reloadAndExpand.bind(this)(e),ngModelCtrl.$setViewValue(null)}.bind(this),overRideRefresh:function(){this.options.fromRefresh=!0,this.options.kendoObj.dataSource.read(),ngModelCtrl.$setViewValue(null)}.bind(this),read:function(){waitingPromise||(this.options.kendoObj.dataSource.read(),ngModelCtrl.$setViewValue(null))}.bind(this)},this.options.cronappDatasource.addDataSourceEvents(helperDirective.dataSourceEventsPush))},read:function(e){let conditionIsEmpty=e=>{let t=!0;if(e){let a=JSON.parse(e);a.expression&&a.expression.args&&a.expression.args.forEach(e=>{""!==e.right&&"''"!==e.right&&e.right!==void 0&&(t=!1)})}return t},cronappDatasource=this.options.cronappDatasource;for(key in e.data)null==e.data[key]&&delete e.data[key];let logicFilter={filter:{logic:"and",filters:[]}};for(let t in e.data){let a={field:options.selfRelationshipField,operator:"eq",value:e.data[t]};logicFilter.filter.filters.push(a)}let condition=cronappDatasource.condition,conditionEmpty=conditionIsEmpty(condition),paramsOData={$inlinecount:"allpages",$format:"json",$filter:`${options.selfRelationshipField} eq null`};logicFilter.filter.filters.length?(cronappDatasource.condition="",paramsOData=kendo.data.transports.odata.parameterMap(logicFilter,"read")):this.options.fromRefresh&&(this.options.fromRefresh=!1,!conditionEmpty&&(cronappDatasource.cleanup(),paramsOData={$inlinecount:"allpages",$format:"json"})),cronappDatasource.rowsPerPage=e.data.pageSize,cronappDatasource.offset=e.data.page-1;let fetchData={};fetchData.params=paramsOData,helperKendoDs=this,cronappDatasource.fetch(fetchData,{success:function(data){let all=data.map(item=>{let odataUrl=`${this.entity}/$count?$filter=${options.selfRelationshipField} eq '${item[schema.model.id]}'`;return new Promise((resolve,reject)=>{$.ajax({url:odataUrl,success:count=>{item.hasChildren=0<eval(count),resolve()},beforeSend:e=>{window.uToken&&e.setRequestHeader("X-AUTH-TOKEN",window.uToken)},error:()=>reject(),type:"GET"})})});waitingPromise=!0,Promise.all(all).then(()=>{e.success(data),waitingPromise=!1})},canceled:function(){e.error("canceled","canceled","canceled")}},!0),condition&&(cronappDatasource.condition=condition)},options:{fromRead:!1,cronappDatasource:app.kendoHelper.getCorrectlyDS(options.dataSourceScreen.name,scope)}},schema:schema});return datasource},link:function(e,t,a,n){let i=$("<div></div>"),o=JSON.parse(a.options),d=this,l=function(e,t){t=e.getKeyValues(t);var a=Object.keys(t);return 1===a.length&&(t=t[a]),t},r=i.kendoTreeView({dataSource:d.getDataSource(o,e,n),dataTextField:o.textField,dataImageUrlField:o.imageUrlField,change:function(){let t=this.dataItem(this.select()),a=this.dataSource.transport.options.cronappDatasource;e.safeApply(a.goTo(t)),o.fieldType&&"key"===o.fieldType&&(a.active=l(a,a.active)),n.$setViewValue(a.active)}}).data("kendoTreeView");r.dataSource.transport.options.kendoObj=r,t.html(i),$compile(i)(t.scope())}}}]).directive("cronSelect",["$compile",function(){return{restrict:"E",replace:!0,require:"ngModel",link:async function(e,t,a,n){var i={};try{i=JSON.parse(a.options)}catch(e){console.log("ComboBox invalid configuration! "+e)}var o=a.id?" id=\""+a.id+"\"":"",d=a.name?" name=\""+a.name+"\"":"",l=t.parent();$(l).append("<input style=\"width: 100%;\" "+o+d+" class=\"cronSelect\"/>");var r=$(l).find("input.cronSelect"),s=a.cronDisabled?a.cronDisabled:"true",c=await app.kendoHelper.getConfigCombobox(i,e);c.close=a.ngClose?function(){e.$eval(a.ngClose)}:void 0,c.dataBound=a.ngDataBound?function(){e.$eval(a.ngDataBound)}:void 0,c.filtering=a.ngFiltering?function(){e.$eval(a.ngFiltering)}:void 0,c.select=a.ngSelect?function(){e.$eval(a.ngSelect)}:void 0,c.change=function(){m.$apply(function(){f.$setViewValue(this.value())}.bind(p))};var p;p=!0===i.dontAllowOutsideList?r.kendoDropDownList(c).data("kendoDropDownList"):r.kendoComboBox(c).data("kendoComboBox"),$(t).remove();let u,g=()=>{if(u=$(l).find(".k-input.cronSelect"),u.length){u.attr("ng-required",a.ngRequired),"true"===a.ngRequired&&u.attr("required","required"),u.attr("ng-model",a.ngModel),u.attr("id",a.id),u.attr("validationmessage",a.validationmessage);let e=u.parent();u.on("change",()=>{"true"===a.ngRequired&&(0==u.val().length?(e.addClass("ng-invalid-required"),u.addClass("ng-invalid-required")):(e.removeClass("ng-invalid-required"),u.removeClass("ng-invalid-required")))})}else setTimeout(()=>g())};g(),s?p.enable(!1):p.enable(!0);var m=e,f=n,h=!0;n&&(n.$formatters.push(function(t){var n="";return("boolean"==typeof t||t)&&(n=t),p.value(n),!h&&a.ngChange&&e.$eval(a.ngChange),h=!1,p.value(n),n}),n.$parsers.push(function(e){return u&&u.trigger("change"),"boolean"==typeof e||e?e:null}))}}}]).directive("cronDynamicSelect",["$compile","$timeout","$parse","$translate",function($compile,$timeout,$parse,$translate){return{restrict:"E",replace:!0,require:"?ngModel",goTo:function(e,t,a){if(dataSourceScreen=$(t).data("dataSourceScreen"),null!=dataSourceScreen)return dataSourceScreen.goTo(a,!0)},compileAngular:function(e,t){var a=$(t),n=angular.element(a);$compile(n)(e)},getActive:function(active){if(active&&active.indexOf(".active."))try{return eval(active.substr(0,active.indexOf(".active.")))}catch(t){}return null},getFieldText:function(e,t){if(e&&e.indexOf(".active.")&&t.dataTextField)try{var a=e.substr(e.indexOf(".active.")+8);return a+"_"+t.dataTextField}catch(t){}return null},isDefaultEntity:function(e){if(e&&e.entity){var t=e.entity.split("/");if(t&&0<t.length)return-1==t.pop().indexOf("query")}return!1},getModelParent:function(e){if("string"==typeof e&&9<e.length&&0<e.indexOf("|raw}}")){e=e.trim();var t=e.substr(e.indexOf("{{")+2);return t=t.substr(0,t.indexOf("|raw}}")),t.trim()}return null},link:async function(scope,element,attrs,ngModelCtrl){await cronapi.internal.skipIterationLoop();var modelGetter=$parse(attrs.ngModel),modelSetter=modelGetter.assign,select={},self=this,parentDS={},textField=null,cronDisabled=attrs.cronDisabled?attrs.cronDisabled:"true";try{select=JSON.parse(attrs.options),parentDS=this.getActive(attrs.ngModel),textField=this.getFieldText(attrs.ngModel,select)}catch(e){console.log("DynamicComboBox invalid configuration! "+e)}let lastFieldInModel=attrs.ngModel.split(".");lastFieldInModel=lastFieldInModel[lastFieldInModel.length-1];let modelForTextField=attrs.ngModel.replace(lastFieldInModel,textField),modelTextFieldGetter=$parse(modelForTextField),modelTextFieldSetter=modelTextFieldGetter.assign;var options=await app.kendoHelper.getConfigCombobox(select,scope);options.autoBind=!0;var dataSourceScreen=null;try{delete options.dataSource.schema.model.id,dataSourceScreen=eval(select.dataSourceScreen.name),dataSourceScreen.rowsPerPage=dataSourceScreen.rowsPerPage?dataSourceScreen.rowsPerPage:100,options.dataSource.transport.origin="combobox"}catch(t){}var _scope=scope,_goTo=this.goTo,_compileAngular=this.compileAngular;if(options.virtual={},options.virtual.itemHeight=26,options.dataSource.pageSize&&0<options.dataSource.pageSize){options.height=options.dataSource.pageSize*options.virtual.itemHeight/4,options.virtual.mapValueTo="dataItem";var _options=options;options.virtual.valueMapper=async function(e){let t=setInterval(()=>{var a=_options.combobox;if(a)if(clearInterval(t),!(e.value||""===e.value))e.success(null);else if(null!==a.options.optionLabel[a.options.dataValueField]&&""===e.value)e.success(null);else{a.isEvaluating=!0;var n=_options.dataSource.transport.options.cronappDatasource;void 0===e.value||null===e.value||""===e.value?(e.success(null),a.isEvaluating=!1):n.findObj([e.value],!1,function(t){e.success(t),a.isEvaluating=!1,select.changeCursor?scope.safeApply(function(){if(null!=t){var e=_goTo(_scope,a,t);e||(n.data.push(t),e=_goTo(_scope,a,t)),e&&modelSetter(_scope,e[select.dataValueField])}else modelSetter(_scope,null)}):null==t&&modelSetter(_scope,null)},function(){e.success(null),a.isEvaluating=!1},[combobox.options.dataValueField])}})}}options.messages={noData:attrs.noResultsMessage?attrs.noResultsMessage:"NO DATA FOUND"},options.change=attrs.ngChange?function(){scope.$eval(attrs.ngChange)}:void 0,options.close=attrs.ngClose?function(){scope.$eval(attrs.ngClose)}:void 0,options.dataBound=attrs.ngDataBound?function(){scope.$eval(attrs.ngDataBound)}:void 0,options.filtering=attrs.ngFiltering?function(){scope.$eval(attrs.ngFiltering)}:void 0,options.open=function(){(!dataSourceScreen.fetched||dataSourceScreen.data.length>combobox.dataSource.data().length)&&(combobox.options.firstLazyRead=!0,combobox.dataSource.read())},options.select=attrs.ngSelect?function(){scope.$eval(attrs.ngSelect)}:void 0;var parent=element.parent(),id=attrs.id?" id=\""+attrs.id+"\"":"",name=attrs.name?" name=\""+attrs.name+"\"":"",validationmessage=attrs.validationmessage?" validationmessage=\""+attrs.validationmessage+"\"":"",inputSelect=$("<input style=\"width: 100%;\""+id+name+validationmessage+" class=\"cronDynamicSelect\" ng-model=\""+attrs.ngModel+"\"/>");attrs.$observe("required",function(e){inputSelect.prop("required",e)}),$(parent).append(inputSelect);var $element=$(parent).find("input.cronDynamicSelect");dataSourceScreen&&(dataSourceScreen.__ignoreFirstFetch=!0);var combobox=$element.kendoDropDownList(options).data("kendoDropDownList");options.combobox=combobox,$(combobox.element[0]).attr("tabindex","-1"),null!=dataSourceScreen&&null!=dataSourceScreen&&$(combobox).data("dataSourceScreen",dataSourceScreen),(attrs.ngRequired||attrs.required)&&($(combobox.element[0]).attr("style",""),$(combobox.element[0]).attr("class","cron-select-offscreen")),$(combobox.wrapper).children(".k-dropdown-wrap").children(".k-select").before(inputSelect);var forceChangeModel=function(e){if(combobox.isEvaluating)return void setTimeout(function(){forceChangeModel(e)},100);if(void 0===e&&(e=null),combobox.value(e),select.changeCursor&&!combobox.isEvaluating)if(null==e||null==e)dataSourceScreen.active={},dataSourceScreen.cursor=-1,modelSetter(_scope,null);else{var t=_goTo(_scope,combobox,combobox.dataItem());t||(dataItem=objectClone(combobox.dataItem(),combobox.dataSource.options.schema.model.fields),dataSourceScreen.data.push(dataItem),_goTo(_scope,combobox,dataItem))}},defineInitialValue=function(){if(!combobox.definingInitialValue)if(!combobox.isEvaluating){var e=combobox.value(),t=null,a=dataSourceScreen.goTo(e);a||((combobox.options.lazyFirstInitialValue||!dataSourceScreen.lazy)&&null!=select.initValue&&null!=select.initValue&&(combobox.options.lazyFirstInitialValue=!1,a=dataSourceScreen.goTo(select.initValue),a&&(t=select.initValue)),null==t&&select.firstValue?dataSourceScreen&&(combobox.definingInitialValue=!0,dataSourceScreen.fetch({params:{$top:1}},{success:function(e){e.length&&(dataSourceScreen.data.push(e[0]),t=e[0][select.dataValueField]),modelSetter(_scope,t),forceChangeModel(t),combobox.definingInitialValue=!1},error:function(){combobox.definingInitialValue=!1},canceled:function(){combobox.definingInitialValue=!1}},void 0,{lookup:!0})):(modelSetter(_scope,t),forceChangeModel(t),combobox.definingInitialValue=!1))}else setTimeout(()=>defineInitialValue(),300)},_ngModelCtrl=ngModelCtrl;null!=dataSourceScreen&&null!=dataSourceScreen&&dataSourceScreen.addDataSourceEvents({overRideRefresh:function(){dataSourceScreen.fetched=!1,dataSourceScreen.cleanup(),defineInitialValue()}});var _isDefaultEntity=this.isDefaultEntity;if($element.on("change",function(event){let applyChange=function(){return combobox.isEvaluating?void setTimeout(applyChange,100):void _scope.$apply(function(){if(modelSetter(_scope,combobox.dataItem()[select.dataValueField]),modelTextFieldSetter(_scope,combobox.dataItem()[select.dataTextField]),select.changeValueBasedOnLabel){let comboLabelValue=combobox.dataItem()[select.dataTextField];try{eval(select.changeValueBasedOnLabel+"=\""+comboLabelValue+"\"")}catch(t){try{_scope.$eval(select.changeValueBasedOnLabel+"=\""+comboLabelValue+"\"")}catch(t){console.error("N\xE3o foi poss\xEDvel atribuir o texto do combobox ",comboLabelValue," no compo informado ",select.changeValueBasedOnLabel)}}}_compileAngular(scope,options.combobox.element[0])})};applyChange()}),ngModelCtrl&&(ngModelCtrl.$formatters.push(function(e){combobox.value();return void 0===e&&(e=null),forceChangeModel(e)}),ngModelCtrl.$parsers.push(function(e){if("boolean"==typeof e||e)if(!0===combobox.options.valuePrimitive){if("string"==typeof e)return e;if("boolean"==typeof e[select.dataValueField]||e[select.dataValueField])return e[select.dataValueField]}else try{return objectClone(e,combobox.dataSource.options.schema.model.fields)}catch(t){}return null})),!select.initValue)select.initValue=null;else if(select.initValue.startsWith("params.")){var type=combobox.dataSource.options.schema.model.fields[select.dataValueField].type;select.initValue=scope.$eval(select.initValue),"string"!=type&&(select.initValue=dataSourceScreen.normalizeValue(select.initValue,!0))}else select.initValue=scope.$eval(select.initValue);""==select.initValue&&(select.initValue=null),combobox.dataSource.transport&&combobox.dataSource.transport.options&&(combobox.dataSource.transport.options.combobox=combobox,combobox.dataSource.transport.options.$compile=$compile,combobox.dataSource.transport.options.scope=scope,combobox.dataSource.transport.options.ngModelCtrl=ngModelCtrl,combobox.dataSource.transport.options.initRead=!0,null!=select.initValue&&null!=select.initValue?(modelSetter(_scope,select.initValue),combobox.options.lazyFirstInitialValue=!0):select.firstValue&&defineInitialValue()),$(combobox.span).on("DOMSubtreeModified",function(t){_compileAngular(scope,t.target)}),$(combobox.ul).on("DOMSubtreeModified",function(t){$timeout(function(){_compileAngular(scope,t.target)})}),_compileAngular(scope,combobox.span),_compileAngular(scope,combobox.ul),$(element).remove(),cronDisabled?combobox.enable(!1):combobox.enable(!0),$("[aria-owns='"+`${attrs.id}_listbox`+"']").attr("aria-label",$translate.instant("template.crud.search"))}}}]).directive("cronMultiSelect",["$compile","$parse",function($compile,$parse){return{restrict:"E",require:"ngModel",link:async function(scope,element,attrs,ngModelCtrl){var modelGetter=$parse(attrs.ngModel),modelSetter=modelGetter.assign,model=attrs.ngModel,cronDisabled=attrs.cronDisabled?attrs.cronDisabled:"true",_self=this,select={};try{select=JSON.parse(attrs.options)}catch(e){console.log("MultiSelect invalid configuration! "+e)}var _scope=scope,_ngModelCtrl=ngModelCtrl,relactionDS={relationDataSource:null==select.relationDataSource?null:eval(select.relationDataSource.name),relationField:null==select.relationField?"":select.relationField},options=await app.kendoHelper.getConfigCombobox(select,scope);try{delete options.dataSource.schema.model.id}catch(t){}var parent=element.parent(),id=attrs.id?" id=\""+attrs.id+"\"":"",name=attrs.name?" name=\""+attrs.name+"\"":"";let required=attrs.ngRequired&&eval(attrs.ngRequired)?`required="required"`:"";$(parent).append(`<div style="width: 100%;"> <input style="width: 100%;" ${id} ${name} ${required} class="cronMultiSelect" ng-model="${attrs.ngModel}"/> </div>`),$(parent).find("label").attr("for",attrs.id);let $inp=$(`${attrs.id}`);$compile($inp)(scope);var $element=$(parent).find("input.cronMultiSelect");$(element).remove();var evtSelect,deselect;options.deselect=function(e){var dataItem=e.dataItem,relation=this.relationDataSource,dataValueField=e.sender.options.dataValueField,selectItem=null;if(relation&&relation.data&&dataItem[dataValueField]){for(key in relation.data){var item=relation.data[key];if(item[this.relationField]&&item[this.relationField]==dataItem[dataValueField]){selectItem=item;break}}null!=selectItem&&($(combobox).data("silent",!0),this.relationDataSource.removeSilent(selectItem,null,null))}else model&&_scope.$apply(function(){try{var data=eval("_scope."+model);data=data.filter(e=>"object"==typeof e?e[dataValueField]!==dataItem[dataValueField]:e!==dataItem[dataValueField]),$(combobox).data("silent",!0),modelSetter(_scope,data)}catch(t){}});deselect&&deselect()}.bind(relactionDS),options.select=function(e){var dataItem=e.dataItem,dataValueField=e.sender.options.dataValueField,combobox=e.sender;if(this.relationDataSource&&dataItem[dataValueField]){var obj={};obj[this.relationField]=dataItem[dataValueField],$(combobox).data("silent",!0),this.relationDataSource.startInserting(obj,function(){this.postSilent()}.bind(this.relationDataSource))}else model&&_scope.$apply(function(){try{var data=eval("_scope."+model);if(data||(data=[]),select.fieldType&&"key"===select.fieldType){var keyValues=combobox.dataSource.options.transport.options.cronappDatasource.getKeyValues(dataItem),keys=Object.keys(keyValues);1===keys.length&&(keyValues=keyValues[keys]),data.push(keyValues)}else data.push(objectClone(dataItem,combobox.dataSource.options.schema.model.fields));$(combobox).data("silent",!0),modelSetter(_scope,data)}catch(t){}});evtSelect&&evtSelect()}.bind(relactionDS),options.change=attrs.ngChange?function(){_scope.$eval(attrs.ngChange)}:void 0,options.close=attrs.ngClose?function(){_scope.$eval(attrs.ngClose)}:void 0,options.dataBound=attrs.ngDatabound?function(){_scope.$eval(attrs.ngDatabound)}:void 0,options.filtering=attrs.ngFiltering?function(){_scope.$eval(attrs.ngFiltering)}:void 0,options.open=attrs.ngOpen?function(){_scope.$eval(attrs.ngOpen)}:void 0,options.cascade=attrs.ngCascade?function(){_scope.$eval(attrs.ngCascade)}:void 0,evtSelect=attrs.ngSelect?function(){_scope.$eval(attrs.ngSelect)}:void 0,deselect=attrs.ngDeselect?function(){_scope.$eval(attrs.ngDeselect)}:void 0;var combobox=$element.kendoMultiSelect(options).data("kendoMultiSelect");cronDisabled?combobox.enable(!1):combobox.enable(!0),app.kendoHelper.receivePushData(combobox),$("[aria-describedby='"+`${attrs.id}_taglist`+"']").attr("id",`${attrs.id}-container`),attrs.crnReadonly&&_scope.$watch(attrs.crnReadonly,()=>{combobox.readonly(_scope.$eval(attrs.crnReadonly))});var convertArray=function(e){var t=[];if(e)for(var a in e)t.push(e[a][relactionDS.relationField]);return t};scope.$watchCollection(function(){return ngModelCtrl.$modelValue},function(value,old){var silent=$(combobox).data("silent");0===value.length?($(`#${attrs.id}`).addClass("ng-empty"),attrs.ngRequired&&eval(attrs.ngRequired)&&$(`#${attrs.id}`).attr("required","required")):($(`#${attrs.id}`).removeClass("ng-empty"),$(`#${attrs.id}`).removeAttr("required")),$(combobox).data("silent",!1),silent||JSON.stringify(value)===JSON.stringify(old)||(relactionDS.relationDataSource&&relactionDS.relationField?combobox.value(convertArray(value)):combobox.value(value))})}}}]).directive("cronAutoComplete",["$compile",function(){return{restrict:"E",require:"ngModel",link:async function(e,t,a,n){var i={};try{i=JSON.parse(a.options)}catch(e){console.log("AutoComplete invalid configuration! "+e)}try{delete o.dataSource.schema.model.id}catch(t){}var o=await app.kendoHelper.getConfigCombobox(i,e);o.change=a.ngChange?function(){e.$eval(a.ngChange)}:void 0,o.close=a.ngClose?function(){e.$eval(a.ngClose)}:void 0,o.dataBound=a.ngDataBound?function(){e.$eval(a.ngDataBound)}:void 0,o.filtering=a.ngFiltering?function(){e.$eval(a.ngFiltering)}:void 0,o.select=a.ngSelect?function(){e.$eval(a.ngSelect)}:void 0;var d=t.parent(),l=a.id?" id=\""+a.id+"\"":"",r=a.cronDisabled?a.cronDisabled:"true",s=a.name?" name=\""+a.name+"\"":"",c=a.validationmessage?" validationmessage=\""+a.validationmessage+"\"":"",p="";(a.ngRequired||a.required)&&(p=" required "),$(d).append("<input style=\"width: 100%;\" "+l+s+p+c+" class=\"cronAutoComplete\" ng-model=\""+a.ngModel+"\"/>");var u=$(d).find("input.cronAutoComplete");$(t).remove(),o.change=function(){e.$apply(function(){n.$setViewValue(u.val())})},"true"==a.autoExpand&&u.on("focus",function(){g.search()}),o.messages={noData:a.noResultsMessage?a.noResultsMessage:"NO DATA FOUND"},"false"==a.firstOptionOnBlur&&(o.suggest=!1);var g=u.kendoAutoComplete(o).data("kendoAutoComplete");r?g.enable(!1):g.enable(!0),n&&(n.$formatters.push(function(e){return g.value(e),e}),n.$parsers.push(function(e){if(e){if("string"==typeof e)return e;if(e[i.dataTextField])return e[i.dataTextField]}return null}))}}}]).directive("cronDate",["$compile","$translate","$window",function(e,t){return{restrict:"AE",require:"?ngModel",link:function(a,n,i,o){var d={},l={};try{if(i.options)l=JSON.parse(i.options);else{var r=window.buildElementOptions(n);l=JSON.parse(r)}l.format||(l.format=parseMaskType(l.type,t)),d=app.kendoHelper.getConfigDate(t,l)}catch(e){console.log("AutoComplete invalid configuration! "+e)}var s="date"==d.type||"datetime"==d.type||"time"==d.type;window.fixedTimeZone||(s=!1);var c=$(n);if(!c.data("alreadycompiled")){if(c.data("alreadycompiled",!0),c.data("$compile",e),i.fromGrid)c=$(n);else{var p=n.parent(),u=$("<input style=\"width: 100%;\" class=\"cronDate\" ng-model=\""+i.ngModel+"\"/>");$(p).append(u),c=$(p).find("input.cronDate"),c.data("type",d.type),c.attr("type","date")}var g=app.kendoHelper.buildKendoMomentPicker(c,d,a,o);i.fromGrid||(o&&(o.$formatters.push(function(e){var t=null;if(e){var a=null;a=s?moment(e).utcOffset(window.timeZoneOffset):moment(e),t=a.format(d.momentFormat)}return g.value(t),t}),o.$parsers.push(function(e){if(e){var t=null;return t=s?moment(g._oldText,d.momentFormat).utcOffset(window.timeZoneOffset):moment(g._oldText,d.momentFormat),t.toDate()}return null})),$(n).remove())}}}}]).directive("cronSlider",["$compile",function(e){return{restrict:"E",require:"ngModel",getActive:function(e,t){if(e&&e.indexOf(".active."))try{return t.$eval(e.substr(0,e.indexOf(".active.")))}catch(t){}},link:function(t,a,n,i){var o={};try{o=JSON.parse(n.options)}catch(e){console.log("Slider invalid configuration! "+e)}var d=app.kendoHelper.getConfigSlider(o),l=this.getActive(n.ngModel,t);d.change=function(){t.$apply(function(){var e=$(a).val();l&&(e=l.normalizeValue(e,!0)),i.$setViewValue(e),n.ngChange&&t.$eval(n.ngChange)})},d.slide=n.ngSlide?function(){t.$eval(n.ngSlide)}:void 0;var o=$(a).kendoSlider(d).data("kendoSlider");const r=new ResizeObserver(()=>{o.resize()});if(r.observe(o.wrapper[0]),n.ngRequired||n.required){var s=n.id?" id=\"input"+app.common.generateId()+"\"":"",c=n.name?" name=\"input"+app.common.generateId()+"\"":"",p=a.parent();$(p).append("<input aria-label=\"slider\" autocomplete=\"off\" tabindex=\"-1\" style=\"width: 100%;\""+s+c+" required class=\"cronSlider cron-select-offscreen\" ng-model=\""+n.ngModel+"\"/>");var u=$(p).find("input.cronSlider");e(u)(a.scope())}t.$watch(function(){return i.$modelValue},function(e,t){e!==t&&(e?o.value(e):o.value(o.min()))}),i&&(i.$formatters.push(function(e){var t=null;return!e&&o.min?t=o.min:e&&(t=e),o.value(t),t}),i.$parsers.push(function(e){return e?e:null}))}}}]).directive("cronSwitch",["$compile",function(){return{restrict:"E",require:"ngModel",link:function(e,t,a,n){var i={};try{var o=window.buildElementOptions(t);i=JSON.parse(o)}catch(e){console.log("Switch invalid configuration! "+e)}var d=app.kendoHelper.getConfigSwitch(i),l=t.parent();$(l).append("<input style=\"width: 100%;\" class=\"cronSwitch\" ng-model=\""+a.ngModel+"\"/>");var r=$(l).find("input.cronSwitch");d.change=function(){e.$apply(function(){n.$setViewValue(this.value())}.bind(this))};var s=r.kendoMobileSwitch(d).data("kendoMobileSwitch");$(t).remove(),n&&(n.$formatters.push(function(e){var t=!1;return null!=e&&(t=e),s.value(t),t}),n.$parsers.push(function(e){return null!=e&&e}))}}}]).directive("cronBarcode",["$compile",function(){return{restrict:"E",require:"ngModel",link:function(e,t,a,n){var i={};try{var o=window.buildElementOptions(t);i=JSON.parse(o)}catch(e){console.log("Barcode invalid configuration! "+e)}var d=app.kendoHelper.getConfigBarcode(i),l=t.parent();$(l).append("<span class=\"cronBarcode\" ng-model=\""+a.ngModel+"\"></span>");var r=$(l).find("span.cronBarcode"),s=r.kendoBarcode(d).data("kendoBarcode");$(t).remove(),e.$watch(function(){return n.$modelValue},function(e,t){var a="";e!==t&&(a=e),d.value=a,s.setOptions(d)})}}}]).directive("cronQrcode",["$compile",function(){return{restrict:"E",require:"ngModel",link:function(e,t,a,n){var i={};try{var o=window.buildElementOptions(t);i=JSON.parse(o)}catch(e){console.log("Qrcode invalid configuration! "+e)}var d=app.kendoHelper.getConfigQrcode(i),l=t.parent();$(l).append("<span class=\"cronQrcode\" ng-model=\""+a.ngModel+"\"></span>");var r=$(l).find("span.cronQrcode"),s=r.kendoQRCode().data("kendoQRCode");$(t).remove(),e.$watch(function(){return n.$modelValue},function(e,t){var a="";e!==t&&(a=e),d.value=a,s.setOptions(d)})}}}]).directive("cronappRating",function(){'use strict';return{restrict:"E",require:"ngModel",link:function(e,t,a,n){function o(e){for(var t=1;5>=t;t++)c[t-1].removeClass(a.iconOff||"fa fa-star-o"),c[t-1].removeClass(a.iconOn),c[t-1].removeClass(a.theme),t<=e?(c[t-1].addClass(a.iconOn),c[t-1].addClass(a.theme)):(c[t-1].addClass(a.iconOff||"fa fa-star-o"),c[t-1].addClass(a.theme));return e}a.theme=$(t).find("i").attr("xattr-theme"),a.iconOn=$(t).find("i").attr("class");var d=$(t),l=[];a.xattrDefaultValue&&(n.$viewValue=0,n.$commitViewValue());for(var r=1;5>=r;r++)l.push($(t).find("i").get(r-1)),$(l[r-1]).addClass(a.iconOff||"fa fa-star-o");d.html("");for(var s,c=[],r=1;5>=r;r++)s=$(l[r-1]).clone(),d.append(s),s.attr("idx",r),s.click(function(){e.$apply(function(){let e=parseInt($(this).attr("idx"));n.$viewValue=n.$viewValue===e?0:e,n.$commitViewValue()}.bind(this))}),c.push(s);n.$parsers.push(o),n.$formatters.push(o)}}}).directive("cronDynamicMenu",["$compile","$translate",function(e,t){'use strict';const a=e=>{var a=e.menuItems,i="";return a.forEach(e=>{var a=e.security&&null!=e.security?" cronapp-security=\""+e.security+"\" ":"",o=e.action&&null!=e.action?" ng-click=\""+e.action+"\" ":"",d=e.hide&&null!=e.hide?" ng-hide=\""+e.hide+"\" ":"",l=e.iconClass&&null!=e.iconClass?"<i class=\""+e.iconClass+"\"></i>&nbsp;":"",r="<span></span>",s=e.menuItems&&Array.isArray(e.menuItems)&&0<e.menuItems.length?"<span class=\"caret submenu\"></span>":"";e.title&&(r="<span>"+t.instant(e.title)+"</span>"),i=0<e.menuItems.length?i+"<li class=\"dropdown-submenu\"> <a class=\"dropdown-item dropdown-toggle\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\" href=\"\""+a+o+">"+l+r+s+"</a> "+n(e.menuItems)+" </li>":i+"<li class=\"dropdown-submenu\"> <a role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\" href=\"\""+a+o+">"+l+r+s+"</a> </li>"}),""!=i&&(i="<ul class=\"dropdown-menu\">"+i+"</ul>"),i},n=e=>{var n="";return e&&0<e.length&&Array.isArray(e)&&(e.forEach(function(e){var i=e.security&&null!=e.security?" cronapp-security=\""+e.security+"\" ":"",o=e.action&&null!=e.action?" ng-click=\""+e.action+"\" ":"",d=e.hide&&null!=e.hide?" ng-hide=\""+e.hide+"\" ":"",l=e.iconClass&&null!=e.iconClass?"<i class=\""+e.iconClass+"\"></i>&nbsp;":"",r="<span></span>",s=e.menuItems&&Array.isArray(e.menuItems)&&0<e.menuItems.length?"<span class=\"caret submenu\"></span>":"";e.title&&(r="<span>"+t.instant(e.title)+"</span>"),n=0<e.menuItems.length?n+" <li class=\"dropdown-submenu\" "+i+d+"> <a href=\"\" "+o+" class=\"dropdown-item dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">"+l+r+s+" </a> "+a(e)+" </li>":n+" <li class=\"dropdown-submenu\" "+i+d+"> <a href=\"\" "+o+" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">"+l+r+s+" </a> </li>"}),""!=n&&(n="<ul class=\"dropdown-menu\">"+n+"</ul>")),n};return{restrict:"EA",populateMenu:function(e,a){var i="";return e&&null!=e&&e.subMenuOptions&&null!=e.subMenuOptions&&Array.isArray(e.subMenuOptions)&&e.subMenuOptions.forEach(function(e){var o=e.security&&null!=e.security?" cronapp-security=\""+e.security+"\" ":"",d=e.action&&null!=e.action?" ng-click=\""+e.action+"\" ":"",l=e.menuItems&&Array.isArray(e.menuItems)&&0<e.menuItems.length?"<span class=\"caret\"></span>":"",r=e.hide&&null!=e.hide?" ng-hide=\""+e.hide+"\" ":"",s=e.iconClass&&null!=e.iconClass?"<i class=\""+e.iconClass+"\"></i>&nbsp;":"",c="<span></span>";e.title&&(c="<span>"+t.instant(e.title)+"</span>"),i=i+" <li class=\"dropdown nav-item "+(a?"col-md-12 padding-0":"")+"\""+o+r+"> <a href=\"\" "+d+" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\"> "+s+c+l+" </a> "+n(e.menuItems)+" </li>"}),i},link:function(a,n,i){t.onReady(()=>{let t=n.closest(".crn-navigator-vertical").length;var o="<ul class=\"nav navbar-nav "+(t?"col-md-12 padding-0":"")+" \"></ul>",d={};try{d=JSON.parse(i.options)}catch(t){console.log("CronDynamicMenu: Invalid configuration!")}var l=$(o);l.attr("id",i.id);var r=this.populateMenu(d,t);l.append(r),t&&l.append($("#navbar2 li:first").addClass("col-md-12 padding-0"));var s=angular.element(l);n.html(""),n.append(l),n.attr("id",null),e(s)(a);var c=i.multilevelAction;"hover"===c&&($(".dropdown-menu .dropdown-submenu").on("mouseover",function(){var e=$(this).children("ul.dropdown-menu");e.addClass("displayBlock")}),$(".dropdown-menu .dropdown-submenu").on("mouseout",function(){var e=$(this).children("ul.dropdown-menu");e.removeClass("displayBlock")})),"click"===c&&$(".dropdown-menu a.dropdown-toggle").on("click",function(){$(this).next().hasClass("show")||$(this).parents(".dropdown-menu").first().find(".show").removeClass("show");var e=$(this).next(".dropdown-menu");return e.toggleClass("show"),$(this).parents("li.nav-item.dropdown").on("hidden.bs.dropdown",function(){$(".dropdown-submenu .show").removeClass("show")}),!1})})}}}]).directive("cronBreadcrumbs",function(){'use strict';return{restrict:"E",replace:!0,link:function(e,t,a){async function n(){let t=r.replace("cronapi.client('js.","blockly.js.");r=t.replace("').run()",""),r=e.$eval(r),l=await r(),$(`#${s}`).kendoBreadcrumb({items:l,delimiterIcon:i,navigational:!0})}let i=a.crnDelimiterIcon,o=a.typeMenu,d=a.idMenu?a.idMenu:null,l=[],r=a.ngInit?a.ngInit:null,s=a.id,c=[],p=a.breadcrumbIcon?a.breadcrumbIcon:null;r&&"idBloco"===o?n():setTimeout(()=>{function e(t){let a=!1;for(let o in t){let i=t[o].action;if(i&&""!=i?(i=i.replace("cronapi.screen.changeView('",""),i=i.replace("', [])",""),i=i.split("/")):i=null,1===t[o].level&&(c=[]),i?i&&c.push({level:t[o].level,title:t[o].title,href:document.location.origin+"/"+i.join("/")}):c.push({level:t[o].level,title:t[o].title,href:"#"}),0<t[o].menuItems.length?e(t[o].menuItems):i&&i[i.length-1]===n[n.length-1]&&(a=!0),a){for(let e in c)0==e&&1==c[e].level?l.push({type:"rootitem",href:c[e].href,text:c[e].title,showText:!0,showIcon:!1}):0==e&&1!=c[e].level?l.push({type:"rootitem",href:c[e].href,text:c[e].title,showText:!0,showIcon:!1}):l.push({type:"item",href:c[e].href,text:c[e].title,showText:!0,showIcon:!1});return l}}}let t=$(`#${d}`)[0].children[0].attributes.options;t=JSON.parse(t.value);let a=t.subMenuOptions,n=document.location.hash;n=n.split("/"),e(a),$(`#${s}`).kendoBreadcrumb({items:l,delimiterIcon:i,navigational:!0})},800)}}}).directive("ngInitialValue",["$parse",function(e){return{restrict:"A",require:"ngModel",link:async function(t,a,n){if(n.ngInitialValue){var i,o=e(n.ngModel),d=o.assign;try{if(-1!=n.ngInitialValue.indexOf("cronapi.client('js.")){let e=n.ngInitialValue.replace("cronapi.client('js.","blockly.js."),a=e.split("').names")[0];a=a.split("').attr()")[0];let o=e.split(".run")[1];i=await t.$eval(a+o)}else i=t.$eval(n.ngInitialValue)}catch(t){i=n.ngInitialValue}"checkbox"==a[0].type&&i&&(i="true"==(""+i).toLowerCase()),d(t,i)}}}}]).directive("crnSetIndeterminate",["$parse",function($parse){return{restrict:"A",link:function(scope,element,attrs){let value=eval(attrs.crnSetIndeterminate);null===value&&$(element).prop("indeterminate",!0)}}}]).directive("crnAllowNullValues",[function(){return{restrict:"A",require:"?ngModel",link:function(e,t,a,n){n.$formatters=[],n.$parsers=[];let i=!!a.ngFalseValue&&a.ngFalseValue.split("'").join(""),o=!a.ngTrueValue||a.ngTrueValue.split("'").join("");n.$render="false"==a.crnAllowNullValues?function(){let d=n.$viewValue;if((void 0===n.$viewValue||null===n.$viewValue)&&(n.$setViewValue(!1),d=!1),d===i){let n=`${t.attr("ng-model")}=${a.ngFalseValue}`;e.$eval(n)}switch(t.data("checked",d),d){case!0:case o:t.prop("indeterminate",!1),t.prop("checked",!0),d=o;break;default:t.prop("indeterminate",!1),t.prop("checked",!1),d=i;}setTimeout(()=>n.$setViewValue(d))}:function(){let e=n.$viewValue;t.data("checked",e),!0===e||e===o?(t.prop("indeterminate",!1),t.prop("checked",!0),e=o):!1===e||e===i?(t.prop("indeterminate",!1),t.prop("checked",!1),e=i):(e=null,t.prop("indeterminate",!0)),setTimeout(()=>n.$setViewValue(e))},t.bind("click",function(){let d;switch(t.data("checked")){case!1:case i:d=!a.ngTrueValue||o;break;default:d=!!a.ngFalseValue&&i;}n.$setViewValue(d),e.$apply(n.$render)})}}}]).directive("signaturePad",["$compile","$window",function(e,t){'use strict';var a,n;return{restrict:"E",require:"ngModel",scope:!0,replace:!0,template:"<div><canvas style=\"width:100%\" ng-click=\"mouseup()\" ng-mouseup=\"mouseup()\"></canvas><div><button type=\"button\" class=\"btn btn-warning\" style=\"margin-right:5px;margin-bottom:5px;\" ng-click=\"clear()\">{{\"clear\"|translate}}</button></div></div>",scope:{clear:"=",dataurl:"=",height:"@",width:"@",ngClick:"@",ngModel:"="},controller:["$scope",function(e){e.mouseup=function(){var t={};if(e.signaturePad.isEmpty()?(t.dataUrl=null,t.isEmpty=!0):(t.dataUrl=e.signaturePad.toDataURL(),t.isEmpty=!1),null!=t.dataUrl){var a=t.dataUrl.split(",")[1];e.ngModel=a}},e.$watch("ngModel",function(t,n){var i=e.signaturePad,o=e.ngModel;t!==n&&(a.clear(),i.fromDataURL("data:image/png;base64,"+t,{ratio:1}),e.ngModel=t)},!0),e.clear=function(){e.signaturePad.clear(),e.ngModel=null}}],link:function(a,i){n=i.find("canvas")[0],a.onResize=function(){var e=i.find("canvas")[0],a=Math.max(t.devicePixelRatio||1,1);e.width=e.offsetWidth*a,e.height=e.offsetHeight*a,e.getContext("2d").scale(a,a)},a.onResize(),a.signaturePad=new SignaturePad(n),angular.element(t).bind("resize",function(){a.onResize()}),e(i)(i.scope())}}}]).directive("cronChat",["$compile","$translate",function(){return{restrict:"E",replace:!0,link:function(e,t,a){var n=JSON.parse(a.options||"{}");if(n.token&&n.urlCronchat){var i=n.urlCronchat.endsWith("/")?n.urlCronchat:n.urlCronchat+"/",o=n.token,d=$(`<script src="${i}get-chat?token=${o}" type="text/javascript"></script>`);t.html(d)}}}}]).directive("updateLanguage",["$rootScope",function(e){return{link:function(t,a){e.$on("$translateChangeSuccess",function(e,t){var n=t.language;"pt_br"===n?n="pt-br":n.startsWith("en")&&(n="en"),a.attr("lang",n||"en")})}}}]).directive("cronFrame",["$compile","$sce","$parse",function(e,t,a){'use strict';return{restrict:"AE",require:"ngModel",link:function(n,i,o,d){d&&n.$watch(o.ngModel,function(d){if(d!==o.origin){o.$set("origin",d==null?o.origin:d);const r=a(o.ngModel);let s=r.assign,c="";if("include"==o.type)c=$(`<div class="cronframeOption" ng-include="'${o.origin}'"></div>`);else if("frame"==o.type){var l=t.trustAsResourceUrl(o.origin);c=$(`<iframe class="cronframeOption" ng-src="${l}" width="100%" height="100%" loading="lazy"></iframe>`)}s(n,o.origin),i.html(c),e(c)(n)}})}}}]).directive("fromGrid",["$compile",e=>({restrict:"A",priority:-999999,exist:e=>{let t=e.attr("id");return $(`#${t}`).length},isFromGrid:e=>"true"===e.fromGrid,isCompiled:e=>e.data("alreadycompiled"),getDateAs:function(e,t,a){let n=e.data("mask"),i=e.data("useUTC");return formatWithMomentAs(n,i,t,a)},prepareValue:function(e,t){let a=e.data("column-type")||"";return a.startsWith("date")&&(t=this.getDateAs(e,t,"date")),t},formatComponent:function(e,t){let a=e.data("kendoDropDownList")||e.data("kendoSlider"),n=e.data("column-type")||"";n.startsWith("date")?e.val(this.getDateAs(e,t,"string")):a&&a.value(t)},compileGridListing:function(t,a){let n=t.data("ref-component");if(n&&n.tbody&&n.tbody.length&&!$(n.tbody).find(".k-grid-edit-row").length){var i=n.tbody;setTimeout(()=>{a.safeApply(()=>{var t=$(i),n=angular.element(t);e(n)(a)})})}},link:function(e,t,a){e.$watch(a.ngModel,n=>{this.isFromGrid(a)&&this.exist(t)&&this.isCompiled(t)&&(n=this.prepareValue(t,n),this.formatComponent(t,n),this.compileGridListing(t,e),call=t.data("change-grid-model"),call&&call(n))})}})]).directive("cronOrderedList",["$compile","$sce","$parse",function(e){'use strict';return{restrict:"EA",replace:!0,link:function(t,a,n){let i=n.attributeValue,o=n.orderedAttributeValue,d=n.listType,l=a[0].children[0].children;l=$(l);let r="",s="";$.each(l,function(e,t){s+=t.outerHTML});"numbered-list"===d?r=`<ol style="list-style-type: ${i}">${s}</ol>`:"ordered-list"===d?r=`<ul style="list-style-type: ${o}">${s}</ul>`:void 0;r=$(r),$(a).replaceWith(r),e(r)(t)}}}])}(app);function maskDirectiveAsDate(e,t,a){return maskDirective(e,t,a,"as-date")}function maskDirectiveMask(e,t,a){return maskDirective(e,t,a,"mask")}function maskDirective(e,t,a,n){return{restrict:"A",require:"?ngModel",link:function(i,o,d,l){if("as-date"!=n||void 0===d.mask){var r=a(d.ngModel),s=r.assign,c=$(o);if(!c.data("alreadycompiled")){c.data("alreadycompiled",!0),c.data("$compile",e);var p=c.attr("type");if("checkbox"!=p&&"password"!=p&&"url"!=p){if("color"==p||"range"==p)return c[0].classList.remove("form-control"),void c[0].classList.remove("k-textbox");c.data("type",p),c.attr("type","text"),l&&(l.$formatters=[],l.$parsers=[]),void 0!==d.asDate&&"text"==p&&(p="date");var u=!1,g=d.mask||d.format;g=g?parseMaskType(g,t):parseMaskType(p,t),g.endsWith(";0")&&(u=!0);var m=g.replace(";1","").replace(";0","").trim();if(null!=m&&0!=m.length)if("date"==p||"datetime"==p||"datetime-local"==p||"month"==p||"time"==p||"time-local"==p||"week"==p){var f={format:m,locale:t.use(),showTodayButton:!0,useStrict:!0,tooltips:{today:t.instant("DatePicker.today"),clear:t.instant("DatePicker.clear"),close:t.instant("DatePicker.close"),selectMonth:t.instant("DatePicker.selectMonth"),prevMonth:t.instant("DatePicker.prevMonth"),nextMonth:t.instant("DatePicker.nextMonth"),selectYear:t.instant("DatePicker.selectYear"),prevYear:t.instant("DatePicker.prevYear"),nextYear:t.instant("DatePicker.nextYear"),selectDecade:t.instant("DatePicker.selectDecade"),prevDecade:t.instant("DatePicker.prevDecade"),nextDecade:t.instant("DatePicker.nextDecade"),prevCentury:t.instant("DatePicker.prevCentury"),nextCentury:t.instant("DatePicker.nextCentury")}};"DD/MM/YYYY"!=m&&"MM/DD/YYYY"!=m&&(f.sideBySide=!0);var h="date"==p||"datetime"==p||"time"==p;if(window.fixedTimeZone||(h=!1),c.data("mask",m),c.data("useUTC",h),c.attr("from-grid")){var b=function(){var e=$(this).offset(),t=!0,a=$(this).parent().find(".bootstrap-datetimepicker-widget.dropdown-menu.usetwentyfour.bottom");if(a.length||(t=!1,a=$(this).parent().find(".bootstrap-datetimepicker-widget.dropdown-menu.usetwentyfour.top")),$(a).offset()){var n=$(a).offset().left,i=$("body");a.appendTo(i);var o=0;o=t?e.top+35:e.top-($(a).height()+15),a.css("top",o),a.css("bottom","auto"),a.css("left",n),a.css("z-index",999999)}};if(c.on("click",b),c.on("focus",function(){setTimeout(b.bind(this),100)}),c.on("dp.change",function(){i.safeApply(function(){var e=null;e=h?moment(c.val(),m).utcOffset(window.timeZoneOffset,!0):moment(c.val(),m),("time"==p||"time-local"==p)&&(e=e.year(1970).dayOfYear(1).month(0)),e.isValid()&&l&&s(i,e.toDate())})}),c.data("initial-value")){var v=c.data("initial-value"),y=null;y=h?moment(v).utcOffset(window.timeZoneOffset):moment(v),c.val(y.format(m)),c.data("initial-value",null)}}else c.wrap("<div style=\"position:relative\"></div>");c.datetimepicker(f),"true"!==d.fromGrid&&c.on("dp.change",function(){$(this).is(":visible")&&($(this).trigger("change"),i.safeApply(function(){var e=c.val(),t=null;t=h?moment(e,m).utcOffset(window.timeZoneOffset,!0):moment(e,m),("time"==p||"time-local"==p)&&(t=t.year(1970).dayOfYear(1).month(0)),t.isValid()&&l&&s(i,t.toDate())}))}),l&&(l.$formatters.push(function(e){if(e)return formatWithMomentAs(m,h,e,"string");if(null===e){var t=c.datetimepicker(f).data("DateTimePicker");t.date(null)}return null}),l.$parsers.push(function(e){if(e){if(e instanceof Date)return e;var t=null;return t=h?moment(e,m).utcOffset(window.timeZoneOffset,!0):moment(e,m),("time"==p||"time-local"==p)&&(t=t.year(1970).dayOfYear(1).month(0)),t.toDate()}return null}))}else if("number"==p||"money"==p||"integer"==p||"money-decimal"==p){u=!0;var k=m.trim().replace(/\./g,"").replace(/\,/g,"").replace(/#/g,"").replace(/0/g,"").replace(/9/g,""),w="",S="",C="",D=",",T=0;m.startsWith(k)?w=k:m.endsWith(k)&&(S=k);var x=m.trim().replace(w,"").replace(S,"").trim();x.startsWith("#.")?C=".":x.startsWith("#,")&&(C=",");var M=null;if(-1==x.indexOf(",0")?-1!=x.indexOf(".0")&&(D=".",M=".0"):(D=",",M=",0"),null!=M){var I=x.substring(x.indexOf(M)+1);T=I.length}var E="numeric";0==T&&(E="integer"),"money-decimal"==p&&(E="currency");var F={rightAlign:"money"==p||"money-decimal"==p,unmaskAsNumber:!0,allowMinus:!0,prefix:w,suffix:S,radixPoint:D,digits:T,numericInput:"money-decimal"==p};C&&(F.autoGroup=!0,F.groupSeparator=C),$(o).inputmask(E,F),useInputMaskPlugin(o,l,i,s,m)}else("text"==p||"tel"==p||"string"==p)&&(d.maskPlaceholder?(f={},f.placeholder=d.maskPlaceholder,$(o).inputmask(m,f),u&&useInputMaskPlugin(o,l,i,s,m)):(c.mask(m),useMaskPlugin(o,l,i,s,u)))}}}}}}function useInputMaskPlugin(e,t,a,n,i){var o=$(e),d=function(){$(this).data("rawvalue",$(this).inputmask("unmaskedvalue"))};$(e).on("keydown",d).on("keyup",d),t&&(t.$formatters.push(function(e){return null!=e&&null!=e&&""!==e?format(i,e):null}),t.$parsers.push(function(e){if(e!=null&&null!=e&&""!==e){var t=o.inputmask("unmaskedvalue");if(""!==t)return t}return null}))}function useMaskPlugin(e,t,a,n,i){var o=$(e),d=function(){i&&$(this).data("rawvalue",$(this).cleanVal())};$(e).on("keydown",d).on("keyup",d),i&&t&&(t.$formatters.push(function(e){return e?o.masked(e):null}),t.$parsers.push(function(e){return e?o.cleanVal():null}))}function parseMaskType(e,t){return"datetime"==e||"datetime-local"==e?(e=t.instant("Format.DateTime"),"Format.DateTime"==e&&(e="DD/MM/YYYY HH:mm:ss")):"date"==e?(e=t.instant("Format.Date"),"Format.Date"==e&&(e="DD/MM/YYYY")):"time"==e||"time-local"==e?(e=t.instant("Format.Hour"),"Format.Hour"==e&&(e="HH:mm:ss")):"month"==e?e="MMMM":"number"==e?(e=t.instant("Format.Decimal"),"Format.Decimal"==e&&(e="#.#00,00")):"money"==e||"money-decimal"==e?(e=t.instant("Format.Money"),"Format.Money"==e&&(e="#.#00,00")):"integer"==e?(e=t.instant("Format.Integer"),"Format.Integer"==e&&(e="#,##0.####")):"week"==e?e="dddd":"tel"==e?e="(00) 00000-0000;0":"text"==e?e="":"string"==e&&(e=""),e}function transformText(){return{restrict:"E",require:"?ngModel",link:function(e,t,a,n){var i=function(e,t){if(e){if(t!==void 0&&null!==t){if("uppercase"===e.css("text-transform"))return t.toUpperCase();if("lowercase"===e.css("text-transform"))return t.toLowerCase()}return t}};n&&(n.$formatters.push(function(e){return i(t,e)}),n.$parsers.push(function(e){return i(t,e)}))}}}app.kendoHelper={getCorrectlyDS:(e,t)=>{if(t[e].apiVersion)return t[e];else{let a=t.$parent[e];return t[e]=a,a}},receivePushData:e=>!e||!e.dataSource||(e.dataSource.transport.options.refComponent=e),getSchema:function(e){var t=[{kendoType:"string",entityType:["string","character","uuid","guid"]},{kendoType:"number",entityType:["integer","long","double","int","float","bigdecimal","single","int32","int64","decimal","byte"]},{kendoType:"date",entityType:["date","time","datetime"]},{kendoType:"boolean",entityType:["boolean"]}],a=function(e){for(var a=0;a<t.length;a++)if(t[a].entityType.includes(e.toLocaleLowerCase()))return t[a].kendoType;return"string"},n={model:{id:"__$id",fields:{}}};return e&&e.schemaFields&&(e.schemaFields.forEach(function(e){n.model.fields[e.name]={type:a(e.type),editable:!0,nullable:e.nullable,validation:{required:!e.nullable}}}),n.model.fields.__$id={type:"string",editable:!0,nullable:!0,validation:{required:!1}}),n},getDataSource:function(t,a,n,i,o,d){var l=Number.MAX_SAFE_INTEGER_32;function r(e){for(var t=0;t<e.length;t++)o&&o.forEach(function(a){if("Database"==a.dataType){var n="datetime-local"==a.type||"month"==a.type||"time-local"==a.type||"week"==a.type;n&&e[t][a.field]&&(e[t][a.field]=e[t][a.field].replace(/\d+/,function(e){return parseInt(e)+u}))}})}var s=this.getSchema(t);o&&o.forEach(function(e){for(var t in s.model.fields)if("Database"==e.dataType&&e.field==t){if(s.model.fields[t].nullable=!e.required,s.model.fields[t].validation.required=e.required,"999.999.999-99;0"===e.format||"99.999.999/9999-99;0"===e.format){let a="999.999.999-99;0"===e.format?"cpf":"cnpj",n={cpf:CPF,cnpj:CNPJ},i=t.toLocaleLowerCase()+"validation";s.model.fields[t].validation[i]=function(e){return!(e.is("[name='"+t+"']")&&""!=e.val())||n[a].isValid(e.val())}}break}});var c=function(e){for(var t in e)if(s.model.fields.hasOwnProperty(t)){var a=s.model.fields[t];"string"==a.type&&null!=e[t]?e[t]+="":"number"==a.type&&null!=e[t]?e[t]=parseFloat(e[t]):"date"==a.type&&null!=e[t]?e[t]="/Date("+e[t].getTime()+")/":"boolean"==a.type&&(null==e[t]?e[t]=!1:e[t]="true"==e[t].toString().toLowerCase()),s.model.id==t&&null!=e[t]&&0==e[t].toString().length&&delete e[t]}return e},p=10;app.kendoHelper.getCorrectlyDS(t.name,a)&&(p=app.kendoHelper.getCorrectlyDS(t.name,a).rowsPerPage);var u=6e4*new Date().getTimezoneOffset(),g=app.common.generateId(),m={transport:{setActiveAndPost:function(t){var e=this.options.cronappDatasource;a.safeApply(e.updateActive(c(t.data))),e.active.__sender=g,e.postSilent(function(e){this.options.enableAndSelect(t),t.success(e),this.options.refComponent.dataSource._pristineTotal=this.options.refComponent.dataSource._pristineData.push(e)}.bind(this),function(e){this.options.enableAndSelect(t),t.error(e,e,e)}.bind(this))},pushAction:function(e,t){return a=>{if(this.options.isComponentInDocument(this.options.refComponent)){let n=this.options.getCurrentCallbackForPush(t,this.options.refComponent),i=n[e];i?i(a):(this.options.fromRead="read"===e,this.options.refComponent.dataSource.read())}else["read","memorydelete","overRideRefresh"].includes(e)||this.options.cronappDatasource.removeDataSourceEvents(this.options.dataSourceEventsPush)}},push:function(e){!this.options.dataSourceEventsPush&&this.options.cronappDatasource&&(this.options.dataSourceEventsPush={create:this.pushAction.bind(this)("pushUpdate",e),update:this.pushAction.bind(this)("pushUpdate",e),delete:this.pushAction.bind(this)("pushDestroy",e),overRideRefresh:this.pushAction.bind(this)("overRideRefresh",e),read:this.pushAction.bind(this)("read",e),memorycreate:this.pushAction.bind(this)("pushUpdate",e),memoryupdate:this.pushAction.bind(this)("pushUpdate",e),memorydelete:this.pushAction.bind(this)("pushDestroy",e)},"combobox"==this.origin&&delete this.options.dataSourceEventsPush.overRideRefresh,this.options.cronappDatasource.addDataSourceEvents(this.options.dataSourceEventsPush))},read:function(a){var e=!1;try{var n=this.options.cronappDatasource;this.options.kendoCallback?this.options.fromRead?this.options.kendoCallback.success(n.data):e=!0:(this.options.kendoCallback=a,e=!0)}finally{this.options.fromRead=!1}if(e){for(key in a.data)null==a.data[key]&&delete a.data[key];var i=kendo.data.transports.odata.parameterMap(a.data,"read"),o="";this.options.refComponent&&this.options.refComponent.dataSource.group().forEach(function(e){o+=e.field+" "+e.dir+","}),0<o.length&&(o=o.substr(0,o.length-1),i.$orderby=i.$orderby?o+","+i.$orderby:o);var n=this.options.cronappDatasource;if(n.rowsPerPage=a.data.pageSize,n.offset=a.data.page-1,!a.data.pageSize&&(n.rowsPerPage=l,n.offset=void 0,i.$skip=0,this.options.refComponent&&1!=this.options.refComponent.dataSource.page()))return this.options.refComponent.dataSource.page(1),void a.error("canceled","canceled","canceled");var d=!1;t.append&&(d=t.append);var r={};"button"===n.loadDataStrategy&&0<n.data.length&&(r.origin=n.loadDataStrategy),n.append=d,n.fetch({params:i},{success:function(e){a.success(e)},canceled:function(){a.error("canceled","canceled","canceled")},error:function(){a.error("canceled","canceled","canceled")}},d,r)}},update:function(t){this.setActiveAndPost(t)},create:function(t){this.setActiveAndPost(t)},destroy:function(t){cronappDatasource=this.options.cronappDatasource,cronappDatasource.removeSilent(t.data,function(e){t.success(e)},function(){t.error("canceled","canceled","canceled")})},batch:function(){},options:{fromRead:!1,disableAndSelect:function(t){this.isComponentInDocument(this.refComponent)&&(this.refComponent.select(t.container),this.refComponent.options.selectable=!1,this.refComponent.selectable&&this.refComponent.selectable.element&&(this.refComponent.selectable.destroy(),this.refComponent.selectable=null))},enableAndSelect:function(t){this.isComponentInDocument(this.refComponent)&&(this.refComponent.options.selectable=this.refComponent.options.originalSelectable,this.refComponent._selectable(),this.refComponent.select(t.container))},selectActiveInGrid:function(){if(this.isComponentInDocument(this.refComponent)&&this.refComponent.selectable&&0<this.refComponent.dataItems().length&&this.cronappDatasource.active&&this.cronappDatasource.active.__$id){for(var e=this.refComponent.dataItems(),t=-1,a=0;a<e.length;a++)if(this.cronappDatasource.active.__$id==e[a].__$id){t=a;break}-1<t&&!this.refComponent.selectable.options.multiple&&this.refComponent.select(this.refComponent.table.find("tr")[t])}},isComponentInDocument:function(e){return!!e&&$(document).has(e.element[0]).length},getCurrentCallbackForPush:function(e,t){return e?e:t},cronappDatasource:app.kendoHelper.getCorrectlyDS(t.name,a)}},pageSize:p,serverPaging:!0,serverFiltering:!0,serverSorting:!0,batch:!1,schema:s,requestEnd:function(t){if(t.response&&t.response.d){var e=null;e=t.response.d.results?t.response.d.results:[t.response.d],this.group().length?o.forEach(function(t){if("Database"==t.dataType){var a="datetime-local"==t.type||"month"==t.type||"time-local"==t.type||"week"==t.type;if(a)for(var n,o=0;o<e.length;o++)n=e[o],t.field==n.Member&&(n.Key=n.Key.replace(/\d+/,function(e){return parseInt(e)+u})),r.bind(this)(n.Items)}}):r.bind(this)(e)}}};return m.aggregate=function(e){var t=[];return e&&e.forEach(function(e){e.aggregates&&e.aggregates.forEach(function(a){t.push({field:e.field,aggregate:a.type})})}),t}(o),m.schema.total=function(){return m.transport.options.cronappDatasource.getRowsCount()},d&&(m.group=[],d.forEach(function(e){var t={field:e.field,aggregates:m.aggregate};m.group.push(t)})),m},getEventReadCombo:function(t){var e=this.options.cronappDatasource;if(!e)return void t.error("canceled","canceled","canceled");this.options.kendoCallback||(this.options.kendoCallback=t);var a;if(this.options.combobox&&this.options.combobox.options.readData)return t.success(this.options.combobox.options.readData),this.options.combobox.options.readData=null,void(this.options.alreadyLoaded=!0);this.options.combobox?a=!this.options.alreadyLoaded:e.__ignoreFirstFetch?(a=!0,delete e.__ignoreFirstFetch):a=!1,this.options.alreadyLoaded=!0;var n=!0;if(a&&(n=!1,e.lazy?t.success([{}]):t.success([])),this.options.fromRead&&(this.options.fromRead=!1,this.options.kendoCallback.success(e.data),n=!1),n){for(key in t.data)null==t.data[key]&&delete t.data[key];var i=kendo.data.transports.odata.parameterMap(t.data,"read");e.rowsPerPage=t.data.pageSize,e.offset=t.data.page-1;var o=this,d={};d.params=i,o.options.combobox&&(o.options.combobox.options.fromCombo=!0),e.fetch(d,{success:function(e){if(t.success&&(o.options.combobox&&(o.options.combobox.options.expanded=!0),t.success(e),o.options.kendoCallback=t,o.options&&o.options.combobox&&o.options.combobox.element[0].id)){var a=angular.element($(" .k-animation-container"));o.options.$compile(a)(o.options.scope)}},canceled:function(){o.options.combobox&&(o.options.combobox.options.fromCombo=!1),t.success&&t.error("canceled","canceled","canceled")},error:function(){o.options.combobox&&(o.options.combobox.options.fromCombo=!1),t.success&&t.error("error","error","error")}},!1,{ignoreAtive:!0})}},parseOptionsCronToConfigKendo:function(e,t,a){let n=!1;e.dynamic&&"false"!=e.dynamic?e.dataSourceScreen&&e.dataSourceScreen.entityDataSource&&(e.dataSourceScreen.entityDataSource.append=!0,t=app.kendoHelper.getDataSource(e.dataSourceScreen.entityDataSource,a,!0,e.dataSourceScreen.rowsPerPage),t.transport.read=app.kendoHelper.getEventReadCombo,n=!0):(n=!0,e.dataValueField=e.dataValueField||"value",e.dataTextField=e.dataTextField||"key"),e.dataValueField&&""!=e.dataValueField.trim()||(e.dataValueField=null==e.dataTextField?void 0:e.dataTextField);var i=function(t){var a=e.dataSourceScreen.entityDataSource.schemaFields;for(count=0;count<a.length;count++)if(t==a[count].name){return a[count].type.toLowerCase()}return null};!e.customTemplate&&e.dataSourceScreen&&e.dataSourceScreen.entityDataSource&&e.dataSourceScreen.entityDataSource.schemaFields&&(e.format||function(e){return-1<["date","time","datetime"].indexOf(e)?e:null}(i(e.dataTextField)))&&(e.template="#= useMask("+e.dataTextField+",'"+e.format+"','"+i(e.dataTextField)+"') #",e.valueTemplate="#= useMask("+e.dataTextField+",'"+e.format+"','"+i(e.dataTextField)+"') #");var o={dataTextField:null==e.dataTextField?void 0:e.dataTextField,dataValueField:null==e.dataValueField?void 0:e.dataValueField,dataSource:t,headerTemplate:null==e.headerTemplate?void 0:e.headerTemplate,template:null==e.template?void 0:e.template,placeholder:null==e.placeholder?void 0:e.placeholder,footerTemplate:null==e.footerTemplate?void 0:e.footerTemplate,filter:null==e.filter?void 0:e.filter,valuePrimitive:n,valueTemplate:null==e.valueTemplate?void 0:e.valueTemplate,suggest:!0};return e.optionLabel&&(e.optionLabelText=e.optionLabel,e.optionLabelValue=""),o.optionLabel={},o.optionLabel[o.dataTextField]=void 0===e.optionLabelText?"":e.optionLabelText,o.optionLabel[o.dataValueField]=void 0===e.optionLabelValue?null:e.optionLabelValue,o},getConfigComboboxSync:function(e,t){var a={};if(e){if(!e.dynamic||"false"==e.dynamic){a.data=null==e.staticDataSource?void 0:e.staticDataSource;for(let n=0;n<a.data.length;n++)try{a.data[n].key&&a.data[n].key.startsWith("cronapi.server(")&&(a.data[n].key=a.data[n].key.replace(".run(",".notAsync().run("));let e=t.$eval(a.data[n].key);a.data[n].key=void 0!==e&&null!==e?e:a.data[n].key}catch(t){a.data[n].key=a.data[n].key}}return config=this.parseOptionsCronToConfigKendo(e,a,t),config}return{}},getConfigCombobox:async function(e,t){var a={};if(e){if(!e.dynamic||"false"==e.dynamic){a.data=null==e.staticDataSource?void 0:e.staticDataSource;for(let n=0;n<a.data.length;n++)try{a.data[n].key&&a.data[n].key.startsWith("cronapi.server(")&&(a.data[n].key=a.data[n].key.replace(".run(",".toPromise().run("));let e=await t.$eval(a.data[n].key);a.data[n].key=void 0!==e&&null!==e?e:a.data[n].key}catch(t){a.data[n].key=a.data[n].key}}return config=this.parseOptionsCronToConfigKendo(e,a,t),config}return{}},getConfigDate:function(e,t){var a={};if(a){var n=function(e){e=e.replace(/_/gm,"-");var t=e.split("-");return t[t.length-1]=t[t.length-1].toUpperCase(),t.join("-")},i=function(e){return e&&(e=e.replace(/:MM/gm,":mm"),e=e.replace(/:M/gm,":m"),e=e.replace(/S/gm,"s"),e=e.replace(/D/gm,"d"),e=e.replace(/Y/gm,"y")),e},o=function(t,a){return null==a&&(a=parseMaskType(t,e)),a},d={};if(t.animation)try{d=JSON.parse(t.animation)}catch(e){console.log("DateAnimation invalid configuration! "+e)}var l=o(t.type,t.format),r=i(l),s=i(t.timeFormat),c=n(e.use());a={value:null,format:r,timeFormat:s,momentFormat:l,culture:c,type:null==t.type?void 0:t.type,weekNumber:null==t.weekNumber?void 0:t.weekNumber,dateInput:null==t.dateInput?void 0:t.dateInput,animation:d,footer:null==t.footer?void 0:t.footer,start:null==t.start?void 0:t.start,depth:null==t.start?void 0:t.start}}return a},buildKendoMomentPicker:function(e,t,a,n){var i="date"==t.type||"datetime"==t.type||"time"==t.type;window.fixedTimeZone||(i=!1),e.data("mask",t.momentFormat),e.data("useUTC",i);var o=function(){var a=e.val();if(!a||""==a.trim())n&&n.$setViewValue("");else{var o=formatWithMomentAs(t.momentFormat,i,a,"date");n&&(n.$setViewValue(o),e.data("changed",!0))}};return(t.change=a?function(){a.$apply(function(){o()})}:o,"date"==t.type)?e.kendoDatePicker(t).data("kendoDatePicker"):"datetime"==t.type||"datetime-local"==t.type?e.kendoDateTimePicker(t).data("kendoDateTimePicker"):"time"==t.type||"time-local"==t.type?e.kendoTimePicker(t).data("kendoTimePicker"):void 0},getConfigSlider:function(e){e=e||{};var t={increaseButtonTitle:e.increaseButtonTitle,decreaseButtonTitle:e.decreaseButtonTitle,dragHandleTitle:e.dragHandleTitle};try{t.min=e.min?parseInt(e.min):1,t.max=e.max?parseInt(e.max):1,t.smallStep=e.smallStep?parseInt(e.smallStep):1,t.largeStep=e.largeStep?parseInt(e.largeStep):1}catch(e){console.log("Slider invalid configuration! "+e)}return t},getConfigSwitch:function(e){e=e||{};var t={onLabel:null==e.onLabel?void 0:e.onLabel,offLabel:null==e.offLabel?void 0:e.offLabel};return t},getConfigBarcode:function(e){var t={type:null==e.type?void 0:e.type,width:null==e.width?void 0:parseInt(e.width),height:null==e.height?void 0:parseInt(e.height)};return t.type||(t.type="EAN8"),t},getConfigQrcode:function(e){var t={errorCorrection:null==e.errorCorrection?void 0:e.errorCorrection,size:null==e.size?void 0:parseInt(e.size),color:null==e.color?void 0:e.color};return(e.borderColor||e.borderSize)&&(t.border={size:null==e.size?void 0:parseInt(e.size),color:null==e.color?void 0:e.color}),t}},window.showTreatedValue=function(e){return e||!1===e?e:""},window.useMask=function(e,t,a){var n="";t="null"==t||"undefined"==t?void 0:t;var i=e,o=t||a;if(null!=e&&e!=null){if(e instanceof Date){var d=moment(e).utcOffset(window.timeZoneOffset);i="\""+d.format()+"\""}else i="number"==typeof e?e:"\""+e+"\"";n="{{ "+i+" | mask:\""+o+"\":\""+a+"\"}}"}return n},window.formatWithMomentAs=function(e,t,a,n){if(!a)return;let i=null;return i=a instanceof Date||a.startsWith("/Date")?t?moment(a).utcOffset(window.timeZoneOffset):moment(a):t?moment(a,e).utcOffset(window.timeZoneOffset,!0):moment(a,e),"string"===n?i.format(e):i.toDate()};
1
+ maskDirectiveAsDate.$inject=["$compile","$translate","$parse"],maskDirectiveMask.$inject=["$compile","$translate","$parse"],function($app){var _Mathfloor=Math.floor;app.common={generateId:function(){var e=_Mathfloor(65536*(1+Math.random())).toString(16).substring(1);return-1<"0123456789".indexOf(e.substr(0,1))?this.generateId():e}};var isoDate=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,ISO_PATTERN=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/;Number.MAX_SAFE_INTEGER_32=2147483647;var patternFormat=function(e){return e?$(e).attr("format")||"DD/MM/YYYY":"DD/MM/YYYY"},parsePermission=function(e){var t={visible:{public:!0},enabled:{public:!0},notvisible:{public:!1},notenabled:{public:!1}};if(e)for(var a,n=e.toLowerCase().trim().split(","),o=0;o<n.length;o++)if(a=n[o].trim(),a){var l=a.split(":");if(2==l.length){var d=l[0].trim(),r=l[1].trim();if(r){for(var s,c=r.split(";"),u={},g=0;g<c.length;g++)s=c[g].trim(),s&&(u[s]=!0);t[d]=u}}}return t};app.directive("cronCalendar",["$timeout",function(){return{restrict:"E",link:async function(e,t,a,n){let i={};try{i=JSON.parse(a.options)}catch(t){console.error(t)}const o=$(t),l=navigator.language||navigator.userLanguage,d=i.expressionInitialDate,r=i.expressionSelectDates,s=i.expressionDisableDates,c=i.expressionMinDate,p=i.expressionMaxDate,u=i.expressionOnChange,g=i.expressionOnNavigate,m=d?await e.$eval(generateBlocklyCall(d)):new Date,f=r&&i.isSelectableMultiple?await e.$eval(generateBlocklyCall(r)):[],h=s?await e.$eval(generateBlocklyCall(s)):null,v=c?await e.$eval(generateBlocklyCall(c)):new Date(1900,0,1),b=p?await e.$eval(generateBlocklyCall(p)):new Date(2099,11,31);o.kendoCalendar({culture:l.startsWith("pt")?"pt-BR":"en-US",componentType:i.isClassicType?"classic":"modern",selectable:i.isSelectableSingle?"single":"multiple",weekNumber:i.showWeekNumbers,value:m,selectDates:f,disableDates:h,min:v,max:b});let y=o.data("kendoCalendar");y.bind("change",function(){this.value();u&&e.$eval(generateBlocklyCall(u))}),y.bind("navigate",function(){let t=this.view(),a=this.current();u&&e.$eval(generateBlocklyCall(g))})}}}]),app.directive("justGage",["$timeout",function(e){return{restrict:"EA",scope:{id:"@",class:"@",min:"=",max:"=",title:"@",label:"@",value:"@",options:"="},template:"<div id=\"{{id}}-justgage\" class=\"{{class}}\"></div>",link:function(t){e(function(){var e={id:t.id+"-justgage",min:t.min||0,max:t.max||100,title:t.title,label:t.label||"",value:t.value};if(t.options)for(var a in t.options)e[a]=t.options[a];var n=new JustGage(e);t.$watch("max",function(e){e!==void 0&&n.refresh(t.value,e)},!0),t.$watch("value",function(e){e!==void 0&&n.refresh(e)},!0)})}}}]),app.directive("crnAnchor",["$rootScope","$location","$anchorScroll",function(e,t,a){return{restrict:"A",link:function(e,t,n){t.bind("click",function(){let e=n.crnAnchor;a(e),$("#"+e).get(0).focus()})}}}]),app.directive("input",transformText),app.directive("textarea",transformText);var generateBlocklyCall=function(e){var t="";if(!e)return t;if("client"==e.type){t="cronapi.client('"+e.blocklyClass+"."+e.blocklyMethod+"')";var a="";e.blocklyParams.forEach(function(e){0<a.length&&(a+=", "),a+=e.value?e.value:"null"}),t+=".run("+a+")"}else if("server"==e.type){var n=e.blocklyClass+"."+e.blocklyMethod;t="cronapi.server('"+n+"')";var a="";e.blocklyParams.forEach(function(e){0<a.length&&(a+=", "),a+=e.value?e.value:"null"}),t+=".run("+a+")"}return t};app.directive("asDate",maskDirectiveAsDate).directive("ngDestroy",function(){return{restrict:"A",link:function(scope,element,attrs,ctrl){element.on("$destroy",function(){attrs.ngDestroy&&0<attrs.ngDestroy.length&&(-1<attrs.ngDestroy.indexOf("app.")||-1<attrs.ngDestroy.indexOf("blockly.")?scope.$eval(attrs.ngDestroy):eval(attrs.ngDestroy))})}}}).directive("dynamicImage",["$compile",function(e){return{restrict:"E",replace:!0,scope:{ngModel:"@",width:"@",height:"@",style:"@",class:"@"},require:"ngModel",template:"<div></div>",init:function(e){e.ngModel||(e.ngModel=""),e.width||(e.width="128"),e.height||(e.height="128"),e.style||(e.style=""),e.class||(e.class=""),this.containsLetter(e.width)||(e.width+="px"),this.containsLetter(e.height)||(e.height+="px")},containsLetter:function(e){for(var t,a=0;a<e.length;a++){t=!0;for(var n=0;10>n;n++)parseInt(e[a])==n&&(t=!1);if(t)break}return t},link:function(t,a,n){this.init(t);var i=t,o=n.ngRequired&&"true"==n.ngRequired?"required":"";a.append("<div class=\"form-group upload-image-component\" ngf-drop=\"\" ngf-drag-over-class=\"dragover\"> <img class=\"$class$\" style=\"$style$; height: $height$; width: $width$;\" ng-if=\"$ngModel$\" data-ng-src=\"{{$ngModel$.startsWith('http') || ($ngModel$.startsWith('/') && $ngModel$.length < 1000)? $ngModel$ : 'data:image/png;base64,' + $ngModel$}}\"> <img class=\"$class$\" style=\"$style$; height: $height$; width: $width$;\" ng-if=\"!$ngModel$\" data-ng-src=\"/plugins/cronapp-framework-js/img/selectImg.svg\" class=\"btn\" ng-if=\"!$ngModel$\" ngf-drop=\"\" ngf-select=\"\" ngf-change=\"cronapi.internal.setFile('$ngModel$', $file)\" accept=\"image/*;capture=camera\"> <button class=\"remove btn btn-danger btn-xs\" ng-if=\"$ngModel$\" ng-click=\"$ngModel$=null\"> <span class=\"glyphicon glyphicon-remove\"></span> <span class=\"sr-only\">{{\"Remove\" | translate}}</span> </button> <button class=\"btn btn-info btn-xs start-camera-button\" ng-if=\"!$ngModel$\" ng-click=\"cronapi.internal.startCamera('$ngModel$')\"> <span class=\"glyphicon glyphicon-facetime-video\"></span> <span class=\"sr-only\">{{\"Upload.camera\" | translate}}</span> </button> <input ng-if=\"!$ngModel$\" autocomplete=\"off\" tabindex=\"-1\" class=\"uiSelectRequired ui-select-offscreen\" style=\"top: inherit !important; margin-left: 85px !important;margin-top: 50px !important;\" type=text ng-model=\"$ngModel$\" $required$> </div>".split("$height$").join(i.height).split("$width$").join(i.width).split("$ngModel$").join(i.ngModel).split("$style$").join(i.style).split("$class$").join(i.class).split("$required$").join(o)),e(a)(a.scope())}}}]).directive("dynamicImage",["$compile","$translate",function(e,t){return{restrict:"A",scope:!0,require:"ngModel",link:function(a,n,i){var o=i.ngRequired&&"true"==i.ngRequired?"required":"",l=n.html(),d="<div ngf-drop=\"\" ngf-drag-over-class=\"dragover\"> <img alt=\"$picture$\" style=\"width: 100%;\" ng-if=\"$ngModel$\" data-ng-src=\"{{$ngModel$.startsWith('http') || ($ngModel$.startsWith('/') && $ngModel$.length < 1000)? $ngModel$ : 'data:image/png;base64,' + $ngModel$}}\"> <input id=\"$id$\" aria-label=\"$userHtml$\" ng-if=\"!$ngModel$\" autocomplete=\"off\" tabindex=\"-1\" class=\"uiSelectRequired ui-select-offscreen\" style=\"top: inherit !important; margin-left: 85px !important;margin-top: 50px !important; display: none;\" type=text ng-model=\"$ngModel$\" $required$> <button id=\"$idbutton$\" class=\"btn\" ng-if=\"!$ngModel$\" ngf-drop=\"\" ngf-select=\"\" ngf-change=\"cronapi.internal.setFile('$ngModel$', $file)\" ngf-pattern=\"'image/*'\" ngf-max-size=\"$maxFileSize$\"> $userHtml$ </button> <button class=\"remove-image-button btn btn-danger btn-xs\" ng-if=\"$ngModel$\" ng-click=\"$ngModel$=null\"> <span class=\"glyphicon glyphicon-remove\"></span> <span class=\"sr-only\">{{\"Remove\" | translate}}</span> </button> <button class=\"btn btn-info btn-xs start-camera-button-attribute\" ng-if=\"!$ngModel$\" ng-click=\"cronapi.internal.startCamera('$ngModel$')\"> <span class=\"glyphicon glyphicon-facetime-video\"></span> <span class=\"sr-only\">{{\"Upload.camera\" | translate}}</span> </button> </div>",r="";i.maxFileSize&&(r=i.maxFileSize);var s="";s=i.imgAltText?i.imgAltText:"Admin.view.Picture",d=$(d.split("$id$").join(i.id?i.id+"-input":"textinput-picture").split("$idbutton$").join(i.id?i.id+"-button":"textinput-picture-button").split("$ngModel$").join(i.ngModel).split("$required$").join(o).split("$userHtml$").join(l).split("$maxFileSize$").join(r).split("$picture$").join(t.instant(s))),n.html(d),e(d)(n.scope())}}}]).directive("dynamicFile",["$compile","$translate",function(e,t){return{restrict:"A",scope:!0,require:"ngModel",link:function(a,n,i){var o=i.ngRequired&&"true"==i.ngRequired?"required":"",l=i.ngModel.split("."),d=l[0],r=l[l.length-1],s=_Mathfloor(1e3*Math.random()+20),c=n.html(),p="";i.maxFileSize&&(p=i.maxFileSize);let u=i.fileInfo?`'${i.fileInfo}'`:"undefined";var g=" <div ng-show=\"!$ngModel$\" ngf-drop=\"\" ngf-drag-over-class=\"dragover\"> <input id=\"$id$\" aria-label=\"$userHtml$\" ng-if=\"!$ngModel$\" autocomplete=\"off\" tabindex=\"-1\" class=\"uiSelectRequired ui-select-offscreen\" style=\"top: inherit !important;margin-left: 85px !important;margin-top: 50px !important; display: none;\" type=text ng-model=\"$ngModel$\" $required$> <button id=\"$idbutton$\" class=\"btn\" ngf-drop=\"\" ngf-select=\"\" ngf-change=\"cronapi.internal.uploadFile('$ngModel$', $file, 'uploadprogress$number$', $fileInfo$, $invalidFiles)\" ngf-max-size=\"$maxFileSize$\"> $userHtml$ </button> <div class=\"progress\" data-type=\"bootstrapProgress\" id=\"uploadprogress$number$\" style=\"display:none\"> <div class=\"progress-bar\" role=\"progressbar\" aria-valuenow=\"70\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width:0%\"> <span class=\"sr-only\"></span> </div> </div> </div> <div ng-show=\"$ngModel$\" class=\"upload-image-component-attribute\"> <button class=\"btn btn-danger btn-xs ng-scope\" style=\"float:right;\" ng-if=\"$ngModel$\" ng-click=\"$ngModel$=null\"> <span class=\"glyphicon glyphicon-remove\"></span> <span class=\"sr-only\">{{\"Remove\" | translate}}</span> </button> <div> <div ng-bind-html=\"cronapi.internal.generatePreviewDescriptionByte($ngModel$, $fileInfo$)\"></div> <a href=\"javascript:void(0)\" ng-click=\"cronapi.internal.downloadFileEntity($datasource$,'$field$', undefined, $fileInfo$)\">$lblDownload$</a> </div> </div> ";g=$(g.split("$id$").join(i.id?i.id+"-input":"textinput-file").split("$idbutton$").join(i.id?i.id+"-button":"textinput-file-button").split("$ngModel$").join(i.ngModel).split("$datasource$").join(d).split("$field$").join(r).split("$number$").join(s).split("$required$").join(o).split("$userHtml$").join(c).split("$maxFileSize$").join(p).split("$lblDownload$").join(t.instant("download")).split("$fileInfo$").join(u)),n.html(g),e(g)(n.scope())}}}]).directive("dynamicFile",["$compile",function(e){return{restrict:"E",replace:!0,scope:{ngModel:"@"},require:"ngModel",template:"<div></div>",init:function(e){e.ngModel||(e.ngModel="")},link:function(t,a,n){this.init(t);var i=t,o=n.ngRequired&&"true"==n.ngRequired?"required":"",l=i.ngModel.split("."),d=l[0],r=l[l.length-1],s=_Mathfloor(1e3*Math.random()+20);a.append(" <div ng-show=\"!$ngModel$\"> <input ng-if=\"!$ngModel$\" autocomplete=\"off\" tabindex=\"-1\" class=\"uiSelectRequired ui-select-offscreen\" style=\"top: inherit !important;margin-left: 85px !important;margin-top: 50px !important;\" type=text ng-model=\"$ngModel$\" $required$> <div class=\"form-group upload-image-component\" ngf-drop=\"\" ngf-drag-over-class=\"dragover\"> <img class=\"ng-scope\" style=\"height: 128px; width: 128px;\" ng-if=\"!$ngModel$\" data-ng-src=\"/plugins/cronapp-framework-js/img/selectFile.png\" ngf-drop=\"\" ngf-select=\"\" ngf-change=\"cronapi.internal.uploadFile('$ngModel$', $file, 'uploadprogress$number$')\" accept=\"*\"> <progress id=\"uploadprogress$number$\" max=\"100\" value=\"0\" style=\"position: absolute; width: 128px; margin-top: -134px;\">0</progress> </div> </div> <div ng-show=\"$ngModel$\" class=\"form-group upload-image-component\"> <div class=\"btn btn-danger btn-xs ng-scope\" style=\"float:right;\" ng-if=\"$ngModel$\" ng-click=\"$ngModel$=null\"> <span class=\"glyphicon glyphicon-remove\"></span> </div> <div> <div ng-bind-html=\"cronapi.internal.generatePreviewDescriptionByte($ngModel$)\"></div> <a href=\"javascript:void(0)\" ng-click=\"cronapi.internal.downloadFileEntity($datasource$,'$field$')\">download</a> </div> </div> ".split("$ngModel$").join(i.ngModel).split("$datasource$").join(d).split("$field$").join(r).split("$number$").join(s).split("$required$").join(o)),e(a)(a.scope())}}}]).directive("pwCheck",[function(){"use strict";return{require:"ngModel",link:function(e,t,a,n){var i="#"+a.pwCheck;t.add(i).on("keyup",function(){e.$apply(function(){var e=t.val()===$(i).val();n.$setValidity("pwmatch",e)})})}}}]).directive("ngClick",[function(){"use strict";return{link:function(scope,elem,attrs,ctrl){if(scope.rowData){var crnDatasource=elem.closest("[crn-datasource]");0<crnDatasource.length&&elem.on("click",function(){scope.$apply(function(){var datasource=eval(crnDatasource.attr("crn-datasource"));datasource.active=scope.rowData})})}}}}]).directive("valid",function(){return{require:"?ngModel",restrict:"A",link:function(e,t,a,n){var i={cpf:CPF,cnpj:CNPJ};if(n)n.$validators[a.valid]=function(e,n){var o=e||n,l=i[a.valid].isValid(o);return l||null===o?t[0].setCustomValidity(""):t.scope().$applyAsync(function(){t[0].setCustomValidity(t[0].dataset.errorMessage)}),l||!o};else{let e=function(){setTimeout(()=>{var e=t.data("rawvalue"),n=i[a.valid].isValid(e);n||null===e?t.removeClass("k-invalid"):t.addClass("k-invalid")})};t.on("keydown",e).on("keyup",e)}}}}).directive("cronappSecurity",["$rootScope",function(e){return{restrict:"A",priority:Number.MIN_SAFE_INTEGER,link:function(t,a,n){var o=[],l=JSON.parse(localStorage.getItem("_u"));l&&l.roles&&(o=l.roles.toLowerCase().split(","));for(var d,r=parsePermission(n.cronappSecurity),s=!1,c=!1,p=0;p<o.length;p++)d=o[p].trim(),d&&(r.visible[d]&&(s=!0),r.enabled[d]&&(c=!0));for(var d,p=0;p<o.length;p++)d=o[p].trim(),d&&(r.notvisible[d]&&(s=!1),r.notenabled[d]&&(c=!1));let u=$(a),g=()=>{s||u.hide(),c||u.find("*").addBack().attr("disabled",!0).off("click").on("click",t=>t.preventDefault())},m=setInterval(()=>{e.renderFinished&&(g(),clearInterval(m))})}}}]).directive("qr",["$window",function(e){return{restrict:"A",require:"^ngModel",template:"<canvas ng-hide=\"image\"></canvas><img ng-if=\"image\" ng-src=\"{{canvasImage}}\"/>",link:function(t,a,n,i){t.size===void 0&&n.size&&(t.text=n.size);var o=function(){return i.$modelValue||""},l=function(e){return /^[0-9]*$/.test(e)},d=function(e){return /^[0-9A-Z $%*+\-./:]*$/.test(e)},r=function(e){for(var t,a=0;a<e.length;a++)if(t=e.charCodeAt(a),255<t)return!1;return!0},s=function(e,t){if("NUMBER"===e&&!l(t))throw new Error("The `NUMBER` input mode is invalid for text.");else if("ALPHA_NUM"===e&&!d(t))throw new Error("The `ALPHA_NUM` input mode is invalid for text.");else if("8bit"===e&&!r(t))throw new Error("The `8bit` input mode is invalid for text.");else if(!r(t))throw new Error("Input mode is invalid for text.");return!0},c=function(e){var a=t.inputMode;return a=a||(l(e)?"NUMBER":void 0),a=a||(d(e)?"ALPHA_NUM":void 0),a=a||(r(e)?"8bit":""),s(a,e)?a:""},p=a.find("canvas")[0],u=!!e.CanvasRenderingContext2D;t.TYPE_NUMBER=function(){return t.typeNumber||0}(),t.TEXT=o(),t.CORRECTION=function(){var e=t.correctionLevel||0;return{L:1,M:0,Q:3,H:2}[e]||0}(),t.SIZE=function(){let e=$(a).outerWidth(),n=$(a).outerHeight(),i=e<n?e:n;return t.size||i}(),t.INPUT_MODE=c(t.TEXT),t.canvasImage="";var g=function(e,t,a,n){for(var i=Math.round,o=Math.ceil,l=0;l<a;l++)for(var d=0;d<a;d++){var r=o((d+1)*n)-_Mathfloor(d*n),s=o((l+1)*n)-_Mathfloor(l*n);e.fillStyle=t.isDark(l,d)?"#000":"#fff",e.fillRect(i(d*n),i(l*n),r,s)}},m=function(e,a,n,i,o,l){var d=a.replace(/^\s+|\s+$/g,""),r=new QRCode(n,i,l);r.addData(d),r.make();var s=e.getContext("2d"),c=r.getModuleCount();e.width=e.height=o,u&&(g(s,r,c,o/c),t.canvasImage=e.toDataURL()||"")};t.$watch(function(){return i.$modelValue},function(e,a){(e!==a||e!==t.TEXT)&&(t.text=i.$modelValue,t.TEXT=o(),t.INPUT_MODE=c(t.TEXT),m(p,t.TEXT,t.TYPE_NUMBER,t.CORRECTION,t.SIZE,t.INPUT_MODE))}),m(p,t.TEXT,t.TYPE_NUMBER,t.CORRECTION,t.SIZE,t.INPUT_MODE)}}}]).directive("uiSelect",["$compile",function(e){return{restrict:"E",require:"ngModel",link:function(t,a,n){let i=()=>{"$apply"!==t.$$phase&&"$digest"!==t.$$phase?a.find("i").remove():setTimeout(()=>i(),200)};if(i(),null!=n.required||"true"===n.ngRequired){$(a).append("<input autocomplete=\"off\" tabindex=\"-1\" class=\"uiSelectRequired ui-select-offscreen\" style=\"left: 50%!important; top: 100%!important;\" type=text ng-model=\""+n.ngModel+"\" required>");var o=$(a).find("input.uiSelectRequired");e(o)(a.scope())}}}}]).filter("raw",["$translate",function(){return function(e){return null!=e&&void 0!==e?"number"==typeof e?e+"":"boolean"==typeof e?e+"":e instanceof Date?"datetimeoffset'"+e.toISOString()+"'":10<=e.length&&e.match(ISO_PATTERN)?"datetimeoffset'"+e+"'":"'"+e.replaceAll("'","''")+"'":""}}]).filter("js",["$translate",function(){return function(e){return null!=e&&void 0!==e?"number"==typeof e||"boolean"==typeof e?e+"":e instanceof Date?cronapi.toDate(e.toISOString()):10<=e.length&&e.match(ISO_PATTERN)?cronapi.toDate(e):"'"+e+"'":"undefined"}}]).filter("mask",["$translate",function(e){return function(t,a,n){if(a=parseMaskType(a,e),!a)return t;var i;if(void 0===n?i=window.fixedTimeZone:(i="date"==n||"datetime"==n||"time"==n,!window.fixedTimeZone&&(i=!1)),0<a.indexOf(";local")&&(i=!1),a=a.replace(";1","").replace(";0","").replace(";local","").trim(),"string"==typeof t&&t.match(isoDate)||t instanceof Date)return i?moment(t).utcOffset(window.timeZoneOffset).format(a):moment(t).format(a);if("number"==typeof t)return format(a,t);if(null!=t&&null!=t&&""!=t&&""!=a){var o=$("<input type=\"text\">");return o.mask(a),o.masked(t)}return t}}]).directive("screenParams",[function(){"use strict";return{link:function(scope,elem,attrs,ctrl){var screenParams=eval(attrs.screenParams);screenParams&&screenParams.length&&screenParams.forEach(function(e){scope.params&&!scope.params[e.key]&&(scope.params[e.key]=e.value||"")})}}}]).directive("mask",maskDirectiveMask).directive("cronappFilter",["$compile",function($compile){return{restrict:"A",require:"?ngModel",setFilterInButton:function(e,t){var a=e.closest("fieldset");if(a){var n=a.find("button[cronapp-filter]");if(n){var i=n.data("filters");i||(i=[]);var o=-1,l=e.attr("ng-model");if($(i).each(function(e){this.ngModel==l&&(o=e)}),-1<o&&i.splice(o,1),0<t.length){i.push({ngModel:l,bindedFilter:t})}n.data("filters",i)}}},makeAutoPostSearch:function(e,t,a,n){var i=e.closest("fieldset");if(i&&0<i.length){var o=i.find("button[cronapp-filter]");if(o&&0<o.length){var l=o.data("filters");l&&0<l.length&&(t="",$(l).each(function(){t+=this.bindedFilter+";"}))}}a.search(t,"true"==n.cronappFilterCaseinsensitive)},inputBehavior:function(scope,element,attrs,ngModelCtrl,$element,typeElement,operator,autopost){var datasource,filterTemplate="",filtersSplited=attrs.cronappFilter.split(";");if(attrs.crnDatasource)datasource=eval(attrs.crnDatasource);else{var fieldset=$element.closest("fieldset");if(!fieldset)return;var button=fieldset.find("button[cronapp-filter]");if(!button)return;if(!button.attr("crn-datasource"))return;datasource=eval(button.attr("crn-datasource"))}var isOData=datasource.isOData();$(filtersSplited).each(function(){0<this.length&&(""!=filterTemplate&&(isOData?filterTemplate+=" or ":filterTemplate+=";"),isOData?"="==operator&&"text"==typeElement?filterTemplate+="substringof({value.lower}, tolower("+this+"))":"="==operator?filterTemplate+=this+" eq {value}":"!="==operator?filterTemplate+=this+" ne {value}":">"==operator?filterTemplate+=this+" gt {value}":">="==operator?filterTemplate+=this+" ge {value}":"<"==operator?filterTemplate+=this+" lt {value}":"<="==operator&&(filterTemplate+=this+" le {value}"):"text"==typeElement?filterTemplate+=this+"@"+operator+"%{value}%":filterTemplate+=this+operator+"{value}")}),0==filterTemplate.length&&(isOData?filterTemplate="{value}":filterTemplate="%{value}%");var selfDirective=this;ngModelCtrl?scope.$watch(attrs.ngModel,function(e,t){if(!angular.equals(e,t)){var a=$element.data("type")||$element.attr("type"),n=ngModelCtrl.$modelValue;isOData?n instanceof Date?"datetime-local"==a?n="datetimeoffset'"+n.toISOString()+"'":n="datetime'"+n.toISOString().substring(0,23)+"'":"number"==typeof n?n+="M":"boolean"==typeof n?n=n:n="'"+n+"'":n instanceof Date?(n=n.toISOString(),n+="date"==a?"@@date":"time"==a||"time-local"==a?"@@time":"@@datetime"):"number"==typeof n?n+="@@number":"boolean"==typeof n&&(n+="@@boolean");var i=filterTemplate.split("{value}").join(n);if("string"!=typeof n)i=i.split("{value.lower}").join(n);else if(i.startsWith("substringof({")){var o=n.split("'").join("").toLowerCase().trim().split(" "),l="";o.forEach(function(e,t){l+=i.split("{value.lower}").join("'"+e+"'"),t<o.length-1&&(l+=" or ")}),i=l}else i=i.split("{value.lower}").join(n.toLowerCase());0==ngModelCtrl.$viewValue.length&&(i=""),selfDirective.setFilterInButton($element,i,operator),autopost&&selfDirective.makeAutoPostSearch($element,i,datasource,attrs)}}):"text"==typeElement?$element.on("keyup",function(){var datasource=eval(attrs.crnDatasource),value=void 0;value=ngModelCtrl&&null!=ngModelCtrl?ngModelCtrl.$viewValue:this.value;var bindedFilter=filterTemplate.split("{value}").join(value);0==this.value.length&&(bindedFilter=""),selfDirective.setFilterInButton($element,bindedFilter,operator),autopost&&selfDirective.makeAutoPostSearch($element,bindedFilter,datasource,attrs)}):$element.on("change",function(){var datasource=eval(attrs.crnDatasource),value=void 0,typeElement=$(this).attr("type");if(null!=attrs.asDate&&(typeElement="date"),ngModelCtrl&&null!=ngModelCtrl)value=ngModelCtrl.$viewValue;else if("checkbox"==typeElement)value=$(this).is(":checked");else if("date"!=typeElement)value=this.value;else if(value=this.value,0<this.value.length){var momentDate=moment(this.value,patternFormat(this));value=momentDate.toDate().toISOString()}var bindedFilter=filterTemplate.split("{value}").join(value);0==value.toString().length&&(bindedFilter=""),selfDirective.setFilterInButton($element,bindedFilter,operator),autopost&&selfDirective.makeAutoPostSearch($element,bindedFilter,datasource,attrs)})},forceDisableDatasource:function(datasourceName,scope){var disableDatasource=setInterval(function(){try{var datasourceInstance=eval(datasourceName);datasourceInstance&&($(document).ready(function(){var e=0,t=setInterval(function(){10>e?(scope.$apply(function(){datasourceInstance.enabled=!1,datasourceInstance.data=[]}),e++):clearInterval(t)},20)}),clearInterval(disableDatasource))}catch(t){}},10)},buttonBehavior:function(scope,element,attrs,ngModelCtrl,$element,typeElement,operator,autopost){var datasourceName="";datasourceName=attrs.crnDatasource?attrs.crnDatasource:$element.parent().attr("crn-datasource");var datasource=eval(datasourceName),isOData=datasource.isOData(),requiredFilter=attrs.requiredFilter&&"true"==attrs.requiredFilter.toString();requiredFilter&&this.forceDisableDatasource(datasourceName,scope),$element.on("click",function(){var $this=$(this),filters=$this.data("filters");if(datasourceName&&0<datasourceName.length&&filters){var bindedFilter="";$(filters).each(function(){""!=bindedFilter&&(bindedFilter+=isOData?" and ":";"),bindedFilter+=this.bindedFilter});var datasourceToFilter=eval(datasourceName);requiredFilter?(datasourceToFilter.enabled=0<bindedFilter.length,datasourceToFilter.enabled?datasourceToFilter.search(bindedFilter,"true"==attrs.cronappFilterCaseinsensitive):scope.$apply(function(){datasourceToFilter.data=[]})):datasourceToFilter.search(bindedFilter,"true"==attrs.cronappFilterCaseinsensitive)}})},link:function(e,t,a,n){var i=$(t),o=i.data("type")||i.attr("type");a.asDate!=null&&(o="date");var l="=";a.cronappFilterOperator&&0<a.cronappFilterOperator.length&&(l=a.cronappFilterOperator);var d=!0;a.cronappFilterAutopost&&"false"==a.cronappFilterAutopost&&(d=!1),setTimeout(function(){"INPUT"==i[0].tagName?this.inputBehavior(e,t,a,n,i,o,l,d):this.buttonBehavior(e,t,a,n,i,o,l,d)}.bind(this),100)}}}]).directive("cronRichEditor",["$compile",function(e){return{restrict:"E",replace:!0,require:"ngModel",parseToTinyMCEOptions:function(e){var t={allowFullScreen:"fullscreen |",allowPage:"fullpage newdocument code pagebreak |",allowPrint:"preview print |",allowTransferArea:"cut copy paste |",allowDoUndo:"undo redo |",allowSymbol:"charmap |",allowEmbeddedImage:"bdesk_photo |",allowFont:"formatselect fontselect fontsizeselect strikethrough bold italic underline removeformat |",allowLinks:"link unlink anchor |",allowParagraph:"alignleft aligncenter alignright alignjustify numlist bullist outdent indent blockquote hr |",allowFormulas:"tiny_mce_wiris_formulaEditor tiny_mce_wiris_formulaEditorChemistry tiny_mce_wiris_CAS |"},a={menubar:!1,statusbar:!1,plugins:"bdesk_photo advlist anchor autolink autoresize autosave charmap code colorpicker contextmenu directionality emoticons fullpage fullscreen hr image imagetools importcss insertdatetime legacyoutput link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace tabfocus table template toc visualblocks visualchars wordcount tiny_mce_wiris",toolbar:"",content_style:""};for(var n in e)n.startsWith("allow")&&e[n]&&(a.toolbar+=" "+t[n]);return a.menubar=e.showMenuBar,a.statusbar=e.showStatusBar,a.content_style=e.contentStyle,a.readonly=e.allowReadonly,JSON.stringify(a)},link:function(t,a,n){var i=JSON.parse(n.options),o=this.parseToTinyMCEOptions(i),l=" <textarea ui-tinymce=\"$options$\" ng-model=\"$ngModel$\" id=\"$id$\" aria-label=\"cronRichEditor\" ng-cron-click=\"$ngClick$\" ng-cron-dblclick=\"$ngDblclick$\" ng-cron-mousedown=\"$ngMouseDown$\" ng-cron-mouseup=\"$ngMouseUp$\" ng-cron-mousemove=\"$ngMouseMove$\" ng-cron-mouseover=\"$ngMouseOver$\" ng-cron-mouseenter=\"$ngMouseEnter$\" ng-cron-mouseleave=\"$ngMouseLeave$\" ng-cron-keydown=\"$ngKeydown$\" ng-cron-keyup=\"$ngKeyup$\" ng-cron-keypress=\"$ngKeypress$\" ng-context-menu=\"$ngContextMenu$\" ng-cron-paste=\"$ngPaste$\" ng-cron-init=\"$ngInit$\" ng-cron-focus=\"$ngFocus$\" ng-cron-blur=\"$ngBlur$\" ng-before-set-content=\"$ngBeforeSetContent$\" ng-set-content=\"$ngSetContent$\" ng-get-content=\"$ngGetContent$\" ng-pre-process=\"$ngPreProcess$\" ng-post-process\"$ngPostProcess$\" ng-node-change=\"$ngNodeChange$\" ng-cron-undo=\"$ngUndo$\" ng-cron-redo=\"$ngRedo$\" ng-cron-change=\"$ngChange$\" ng-cron-dirty=\"$ngDirty$\" ng-cron-remove=\"$ngRemove$\" ng-exec-command=\"$ngExecCommand$\" ng-paste-pre-process=\"$ngPastePreProcess$\" ng-paste-post-process=\"$ngPastePostProcess$\" ng-add-editor=\"$ngAddEditor$\" ng-remove-editor=\"$ngRemoveEditor$\"> </textarea> ";l=$(l.split("$ngModel$").join(n.ngModel).split("$ngClick$").join(n.ngCronClick||"").split("$ngDblclick$").join(n.ngCronDblclick||"").split("$ngMouseDown$").join(n.ngCronMouseDown||"").split("$ngMouseUp$").join(n.ngCronMouseUp||"").split("$ngMouseMove$").join(n.ngCronMousemove||"").split("$ngMouseOver$").join(n.ngCronMouseOver||"").split("$ngMouseEnter$").join(n.ngCronMouseenter||"").split("$ngMouseLeave$").join(n.ngCronMouseleave||"").split("$ngKeydown$").join(n.ngCronKeydown||"").split("$ngKeyup$").join(n.ngCronKeyup||"").split("$ngKeypress$").join(n.ngCronKeypress||"").split("$ngContextMenu$").join(n.ngContextMenu||"").split("$ngPaste$").join(n.ngCronPaste||"").split("$ngInit$").join(n.ngCronInit||"").split("$ngFocus$").join(n.ngCronFocus||"").split("$ngBlur$").join(n.ngCronBlur||"").split("$ngBeforeSetContent$").join(n.ngBeforeSetContent||"").split("$ngSetContent$").join(n.ngSetContent||"").split("$ngGetContent$").join(n.ngGetContent||"").split("$ngPreProcess$").join(n.ngPreProcess||"").split("$ngPostProcess$").join(n.ngPostProcess||"").split("$ngNodeChange$").join(n.ngNodeChange||"").split("$ngUndo$").join(n.ngCronUndo||"").split("$ngRedo$").join(n.ngCronRedo||"").split("$ngChange$").join(n.ngCronChange||"").split("$ngDirty$").join(n.ngCronDirty||"").split("$ngRemove$").join(n.ngRemove||"").split("$ngExecCommand$").join(n.ngExecCommand||"").split("$ngPastePreProcess$").join(n.ngPastePreProcess||"").split("$ngPastePostProcess$").join(n.ngPastePostProcess||"").split("$ngAddEditor$").join(n.ngAddEditor||"").split("$ngRemoveEditor$").join(n.ngRemoveEditor||"").split("$id$").join(n.id||app.common.generateId()).split("$options$").join(escape(o)));var d=angular.element(l);a.html(""),a.append(d),a.attr("id",null),e(d)(t);let r=$(`cron-rich-editor[ng-model="${n.ngModel}"]`),s=setInterval(()=>{r.find(".mce-container").length&&(r.find("button").each((e,t)=>{let a=$(t),n=a.parent().attr("aria-label")||"";a.attr("aria-label",n)}),clearInterval(s))},100)}}}]).directive("cronDashboardViewer",["$compile",function(){return{restrict:"E",replace:!0,require:"ngModel",link:function(e,t,a){function n(a){var n=JSON.parse(a);e.$eval(n.dashboardCommand,{element:t})}n(a.options);var i=null;e.$watch(function(){return a.options},function(e,t){e!==t&&(i&&(clearInterval(i),i=null),i=setTimeout(function(){n(e)}.bind(this),500))})}}}]).directive("cronReportViewer",["$compile",function(){return{restrict:"E",replace:!0,require:"ngModel",link:function(e,t,a){function n(a){var n=JSON.parse(a);e.$eval(n.reportCommand,{element:t})}n(a.options);var i=null;e.$watch(function(){return a.options},function(e,t){e!==t&&(i&&(clearInterval(i),i=null),i=setTimeout(function(){n(e)}.bind(this),500))})}}}]).directive("cronTimeline",["$compile","$parse",function($compile,$parse){"use strict";var defaultAdvancedTemplate="<ul class=\"timeline\">\r\n <timeline-event side=\"\" class=\"ng-scope\" ng-repeat=\"rowData in datasource\">\r\n <li class=\"timeline-event {{rowData[options.fields.field4] == '2' ? 'timeline-inverted' : ''}}\">\r\n <timeline-badge class=\"{{$odd ? 'info' : 'warning'}} bounce-in\">\r\n <div class=\"timeline-badge\">\r\n <i class=\"glyphicon {{rowData[options.fields.field3] ? rowData[options.fields.field3] : 'glyphicon-check'}}\"></i>\r\n </div>\r\n </timeline-badge>\r\n <timeline-panel class=\"info bounce-in\">\r\n <div class=\"timeline-panel\">\r\n <timeline-heading class=\"ng-scope\">\r\n <div class=\"timeline-heading\">\r\n <h4 class=\"ng-binding ng-scope\">{{rowData[options.fields.field0]}}</h4>\r\n <p class=\"ng-scope\">\r\n <small class=\"text-muted ng-binding\"><i class=\"glyphicon glyphicon-time\"></i>{{rowData[options.fields.field1]|mask:options.fields.mask2:options.fields.type1}}</small>\r\n </p>\r\n </div>\r\n </timeline-heading>\r\n <p ng-if=\"rowData[options.fields.field2]\" class=\"ng-binding ng-scope\">{{rowData[options.fields.field2]}}</p>\r\n </div>\r\n </timeline-panel>\r\n </li>\r\n </timeline-event>\r\n</ul>",getExpression=function(e){return"rowData in ".concat(e).concat(".data")};return{restrict:"E",require:"?ngModel",scope:!0,priority:9999998,terminal:!0,link:function(scope,element,attrs,ngModelCtrl){scope.hasValue=e=>null!==e&&e!==void 0;var optionsList={},dataSourceName="";try{optionsList=JSON.parse(attrs.options),dataSourceName=optionsList.dataSourceScreen.name;var dataSource=eval(optionsList.dataSourceScreen.name);scope.options=optionsList,attrs.ngModel&&(scope.changeRowDataField=function(e){e=dataSource.getKeyValues(e);var t=Object.keys(e);return 1===t.length&&(e=e[t]),e}),scope.options=optionsList,scope.options.fields={},scope.options.randomModel=_Mathfloor(9e3*Math.random())+1e3;for(var column,visibleColumns=[],i=0;i<optionsList.columns.length;i++)column=optionsList.columns[i],column.visible&&visibleColumns.push(optionsList.columns[i]);for(var column,i=0;i<visibleColumns.length;i++)column=visibleColumns[i],column.field&&"Database"==column.dataType&&(scope.options.fields["security"+i]=column.security,scope.options.fields["field"+i]=column.field,scope.options.fields["type"+i]=column.type,scope.options.fields["mask"+i]=column.format)}catch(e){console.log("CronTimeline invalid configuration! "+e)}scope.options.fields.image&&"do-not-show"!=scope.options.imageType&&(scope.options.imageClassPosition="item-"+scope.options.imageType+"-"+scope.options.imagePosition),scope.options.advancedTemplate||(scope.options.advancedTemplate="<ul class=\"timeline\">\r\n <timeline-event side=\"\" class=\"ng-scope\" ng-repeat=\"rowData in datasource\">\r\n <li class=\"timeline-event {{rowData[options.fields.field4] == '2' ? 'timeline-inverted' : ''}}\">\r\n <timeline-badge class=\"{{$odd ? 'info' : 'warning'}} bounce-in\">\r\n <div class=\"timeline-badge\">\r\n <i class=\"glyphicon {{rowData[options.fields.field3] ? rowData[options.fields.field3] : 'glyphicon-check'}}\"></i>\r\n </div>\r\n </timeline-badge>\r\n <timeline-panel class=\"info bounce-in\">\r\n <div class=\"timeline-panel\">\r\n <timeline-heading class=\"ng-scope\">\r\n <div class=\"timeline-heading\">\r\n <h4 class=\"ng-binding ng-scope\">{{rowData[options.fields.field0]}}</h4>\r\n <p class=\"ng-scope\">\r\n <small class=\"text-muted ng-binding\"><i class=\"glyphicon glyphicon-time\"></i>{{rowData[options.fields.field1]|mask:options.fields.mask2:options.fields.type1}}</small>\r\n </p>\r\n </div>\r\n </timeline-heading>\r\n <p ng-if=\"rowData[options.fields.field2]\" class=\"ng-binding ng-scope\">{{rowData[options.fields.field2]}}</p>\r\n </div>\r\n </timeline-panel>\r\n </li>\r\n </timeline-event>\r\n</ul>");var templateDyn=scope.options.advancedTemplate;for(let e,t=0;t<visibleColumns.length;t++)if(e=visibleColumns[t],e.field&&"Database"===e.dataType&&scope.options.fields[`security${t}`]){let e=`ng-if="rowData[options.fields.field${t}]"`,a=`${e} cronapp-security="${scope.options.fields["security"+t]}"`;templateDyn=templateDyn.replace(e,a)}templateDyn=$(templateDyn),scope.options.xattrTextPosition=attrs.xattrTextPosition,$(element).replaceWith(templateDyn);var $element=templateDyn,eventItem=$element.find("timeline-event");"rowData in datasource"===$(eventItem).attr("ng-repeat")&&eventItem.attr("ng-repeat",getExpression(dataSourceName)),$compile(templateDyn,null,9999998)(scope)}}}]).directive("cronScheduler",["$compile","$translate",function($compile,$translate){return{estrict:"E",replace:!0,initCulture:function(){var e=$translate.use();e=e.replace(/_/gm,"-");var t=e.split("-");t[t.length-1]=t[t.length-1].toUpperCase(),e=t.join("-"),kendo.culture(e)},getSchedulerModel:function(e){let t={id:"id",fields:{}};for(let a in e)t.fields[a]={from:e[a].name,validation:{required:!e[a].nullable}};return t},mergeSchedulerEventWithDatasourceActive:(e,t)=>Object.assign(e.active,t),setDatasourceActiveItem:function(e,t,a){if(t){for(let n in e.data){let i=e.data[n][a];if(null!==i&&i===t[a])return e.active=e.copy(e.data[n],{}),e.active}return e.startEditing({}),e.active}},getSchedulerProperties:function(t,a,n){let i="Expression"===t.initialDateStrategy?n.$eval(generateBlocklyCall(t.initialDateBlocklyInfo)):t.initialDate,o={start:null,end:null},l=function(e){return!angular.equals(o,e)},d=[];if(t.views)for(let e in t.views){let a=t.views[e];a.visible&&d.push(a)}else t.showDayTab&&d.push("day"),t.showAgendaTab&&d.push("agenda"),t.showMonthTab&&d.push("month"),t.showTimelineTab&&d.push("timeline"),t.showWeekTab&&d.push("week"),t.showWorkWeekTab&&d.push("workWeek");let r={dateHeaderTemplate:kendo.template(`#=kendo.toString(date, ${kendo.culture().name.toLowerCase().includes("pt")?"'ddd dd/M'":"'ddd M/dd'"})#`),showWorkHours:t.showWorkHours,selectable:!0,date:i,mobile:!0,allDaySlot:t.allDaySlot,messages:{editor:{timezone:$translate.instant("TimezoneEvent")}},currentTimeMarker:t.currentTimeMarker?{updateInterval:1e4,useLocalTimezone:!1}:t.currentTimeMarker,views:d,navigate:function(t){t.sender.view()},dataBound:function(t){t.sender.view()},change:t=>{t&&t.events&&t.events.length?this.setDatasourceActiveItem(a,t.events[0],"id"):a.startInserting({}),console.log("Active: ",a.active)},edit:function(a){if(t&&t.allowCustomAction){let e=a.container,i=t.customActionLabel?t.customActionLabel:$translate.instant(Details),o=$("<a class=\"k-button\">"+i+"</a>");o.click(function(){n.safeApply(()=>{n.$eval(generateBlocklyCall(t.customActionBlockly))})});let l=e.find(".k-edit-buttons");l.append(o)}},dataSource:{batch:!1,transport:{read:function(e){if(e.data=e.data||{},l(e.data)){o=e.data,jQuery.isEmptyObject(e.data)&&(e.data[t.schedulerDataModel.start.name]=i);let n=kendo.data.transports.odata.parameterMap(e.data,"read"),l={};l.params=n,a.fetch(l,{success:function(t){e.success(angular.copy(t))},canceled:function(t){e.error(angular.copy(t))}},!1)}else e.error()}.bind(this),update:e=>{let n=this.parseToDatasourceSchema(a,e.data,t);a.startEditing(a.active),this.mergeSchedulerEventWithDatasourceActive(a,n),a.update(a.active,t=>{let n=angular.copy(t);e.success(n),a.fetch({},{success:()=>{this.setDatasourceActiveItem(a,n,"id")},canceled:()=>{}},!1)},t=>{e.error(angular.copy(t))})},create:e=>{let n=this.parseToDatasourceSchema(a,e.data,t);this.mergeSchedulerEventWithDatasourceActive(a,n),a.insert(a.active,t=>{let n=angular.copy(t);e.success(n),a.fetch({},{success:()=>{this.setDatasourceActiveItem(a,n,"id")},canceled:function(){}},!1)},t=>{e.error(angular.copy(t))})},destroy:function(e){a.removeSilent(this.parseToDatasourceSchema(a,e.data,t),function(t){e.success(angular.copy(t))},function(t){e.error(angular.copy(t))})}.bind(this)},schema:{model:this.getSchedulerModel(t.schedulerDataModel)}}};return t.views||(r.editable=t.editable),window.fixedTimeZone&&window.timeZone&&(r.timezone=window.timeZone),r},showError:function(e,t,a){e.Notification.error({message:a,title:t,delay:null})},parseToDatasourceSchema:function(e,t,a){let n={};for(let i in e.schema){let a=e.schema[i].name;n[a]=t[a]}return n[a.schedulerDataModel.isAllDay.name]=!0===n[a.schedulerDataModel.isAllDay.name],n[a.schedulerDataModel.id.name]||delete n[a.schedulerDataModel.id.name],n},link:function(scope,element,attrs,ngModelCtrl){let datasource,schedulerElement=$("<div></div>"),options=JSON.parse(attrs.options||"{}");if(options.dataSourceScreen&&options.dataSourceScreen.entityDataSource&&(datasource=eval(options.dataSourceScreen.entityDataSource.name)),!datasource){let e={};return void $translate("DatasourceNotFoundMessage").then(t=>(e.message=t,$translate("Scheduler"))).then(t=>(e.component=t,$translate("DatasourceNotFoundTitle"))).then(t=>{e.title=t,this.showError(scope,e.title,e.message.replace("{0}",e.component))})}if(jQuery.isEmptyObject(options.schedulerDataModel))return;let baseUrl="node_modules/cronapp-lib-js/dist/js/kendo-ui/js/messages/kendo.messages.";baseUrl+="pt_br"===$translate.use()?"pt-BR.min.js":"en-US.min.js",this.initCulture(),$.getScript(baseUrl,function(){function e(e,t){if(!e||!t)return;let a;return e.forEach(e=>t.forEach(t=>{a=e.getTime()===t.getTime()})),a}let t=app.kendoHelper.getDataSource(options.dataSourceScreen.entityDataSource,scope,!0,options.dataSourceScreen.rowsPerPage),a=this.getSchedulerProperties(options,datasource,scope);schedulerElement.kendoScheduler(a);let n=schedulerElement.data("kendoScheduler");n.bind("navigate",function(t){n._previousView=t.sender.view()}),n.bind("dataBound",function(t){if(n._currentView=t.sender.view(),n._previousView){let t=e(n._previousView._dates,n._currentView._dates);if(!t){let e={};e[options.schedulerDataModel.start.name]=n._currentView._startDate,e[options.schedulerDataModel.end.name]=n._currentView._endDate,n.dataSource.read(e),n._previousView=n._currentView}}})}.bind(this)),element.html(schedulerElement),$compile(schedulerElement)(element.scope())}}}]).directive("cronGrid",["$compile","$translate",function($compile,$translate){return{restrict:"E",replace:!0,require:"ngModel",initCulture:function(){var e=$translate.use();e=e.replace(/_/gm,"-");var t=e.split("-");t[t.length-1]=t[t.length-1].toUpperCase(),e=t.join("-"),kendo.culture(e)},changeObjectField:function(e,t){t=e.getKeyValues(t);var a=Object.keys(t);return 1===a.length&&(t=t[a]),t},generateToolbarButtonCall:function(toolbarButton,scope,options){var buttonCall,generateObjTemplate=function(e,t,a){var n={template:function(){var n=app.common.generateId();return createTemplateButton(n,e,t,a)}.bind(this)};return n}.bind(this),createTemplateButton=function(buttonId,functionToCall,title,iconClass){var template="";let security=toolbarButton.security?`cronapp-security="${toolbarButton.security}"`:"";"SaveOrCancelChanges"==toolbarButton.type?toolbarButton.saveButton?template="<a #SECURITY# role=\"button\" class=\"saveorcancelchanges k-button k-button-icontext k-grid-save-changes\" id=\"#BUTTONID#\" href=\"javascript:void(0)\"><span class=\"k-icon k-i-check\"></span>#TITLE#</a>":template="<a #SECURITY# role=\"button\" class=\"saveorcancelchanges k-button k-button-icontext k-grid-cancel-changes\" id=\"#BUTTONID#\" href=\"javascript:void(0)\"><span class=\"k-icon k-i-cancel\" ></span>#TITLE#</a>":"Blockly"==toolbarButton.type||"Customized"==toolbarButton.type?template="<a #SECURITY# class=\"k-button k-grid-custom\" id=\"#BUTTONID#\" href=\"javascript:void(0)\"><span class=\"#ICONCLASS#\" ></span>#TITLE#</a>":"Native"==toolbarButton.type&&"create"==toolbarButton.title?template="<a #SECURITY# role=\"button\" id=\"#BUTTONID#\" class=\"k-button k-button-icontext k-grid-add\" href=\"javascript:void(0)\"><span class=\"k-icon k-i-plus\"></span>{{\"Add\" | translate}}</a>":"Native"==toolbarButton.type&&"excel"==toolbarButton.title?template="<a #SECURITY# role=\"button\" id=\"#BUTTONID#\" class=\"k-button k-button-icontext k-grid-excel\" href=\"javascript:void(0)\"><span class=\"k-icon k-i-file-excel\"></span>{{\"exportExcel\" | translate}}</a>":"Native"==toolbarButton.type&&"pdf"==toolbarButton.title&&(template="<a #SECURITY# role=\"button\" id=\"#BUTTONID#\" class=\"k-button k-button-icontext k-grid-pdf\" href=\"javascript:void(0)\"><span class=\"k-icon k-i-file-pdf\"></span>{{\"exportPDF\" | translate}}</a>"),template=template.split("#BUTTONID#").join(buttonId).split("#FUNCTIONCALL#").join(this.encodeHTML(functionToCall)).split("#TITLE#").join(title).split("#ICONCLASS#").join(iconClass).split("#SECURITY#").join(security);var cronappDatasource=eval(options.dataSourceScreen.entityDataSource.name),waitRender=setInterval(function(){0<$("#"+buttonId).length&&(scope.safeApply(function(){var e=angular.element($("#"+buttonId));$compile(e)(scope)}),$("#"+buttonId).click(function(){var e=options.refComponent,t=[];e.select().each(function(){var a=e.dataItem(this);cronappDatasource.data.forEach(function(e){e.__$id==a.__$id&&t.push(e)})});var a={item:t.length?cronappDatasource.active:null,index:t.length?cronappDatasource.cursor:null};let n=[];options.fieldType&&"key"===options.fieldType?t.forEach(e=>{n.push(this.changeObjectField(cronappDatasource,cronappDatasource.findObjInDs(e)))}):n=t;var i={currentData:cronappDatasource.data,datasource:cronappDatasource.copyWithoutAngularObj(),selectedIndex:t.length?cronappDatasource.cursor:null,index:t.length?cronappDatasource.cursor:null,selectedRow:t.length?cronappDatasource.active:null,consolidated:a,item:t.length?cronappDatasource.active:null,selectedKeys:t.length?cronappDatasource.getKeyValues(cronappDatasource.findObjInDs(t[0]),!0):null,selectedRows:n};scope.$eval(functionToCall,i)}.bind(this)),clearInterval(waitRender))}.bind(this),200);return template}.bind(this),call="";call="Customized"==toolbarButton.type?toolbarButton.execute:toolbarButton.methodCall?toolbarButton.methodCall:generateBlocklyCall(toolbarButton.blocklyInfo);var title=null==toolbarButton.title?"":toolbarButton.title;return buttonCall=generateObjTemplate(call,title,toolbarButton.iconClass),buttonCall},generateModalSaveOrCancelButtonCall:function(e,t,a,n,i){var o=app.common.generateId();return buttonCall=function(e,t,a,n){var l;l="save"==e?"<button id=\"#BUTTONID#\" aria-label=\"#ARIALABELSAVE#\" class=\"btn btn-primary btn-fab ng-binding grid-save-button-modal k-button\" data-component=\"crn-button\" ng-click=\"#FUNCTIONCALL#\" onclick=\"(!#DATASOURCENAME#.missingRequiredField(true)?$('##MODALID#').modal('hide'):void(0))\"><span class=\"k-icon k-i-check\"></span></button>":"saveAdd"==e?"<button id=\"#BUTTONID#\" aria-label=\"#ARIALABELSAVEADD#\" class=\"btn btn-primary btn-fab ng-binding grid-save-add-button-modal k-button\" data-component=\"crn-button\" ng-click=\"#FUNCTIONCALL#\"><span class=\"k-icon k-i-plus\"></span></button>":"<button id=\"#BUTTONID#\" aria-label=\"#ARIALABELCANCEL#\" type=\"button\" class=\"btn btn-default btn-fab ng-binding k-button\" data-component=\"crn-button\" data-dismiss=\"modal\"><span class=\"k-icon k-i-cancel\"></span></button>",l=l.split("#BUTTONID#").join(o).split("#FUNCTIONCALL#").join(t).split("#DATASOURCENAME#").join(a).split("#ARIALABELSAVE#").join($translate.instant("SaveChanges")).split("#ARIALABELSAVEADD#").join($translate.instant("SaveAddChanges")).split("#ARIALABELCANCEL#").join($translate.instant("CancelChanges")).split("#MODALID#").join(n);var d=setInterval(function(){0<$("#"+o).length&&i.safeApply(function(){var e=angular.element($("#"+o));$compile(e)(i),clearInterval(d)})},200);return l}(e,t,a,n),buttonCall},addButtonsInModal:function(e,t,a,n){var i=$("#"+e).find(".modal-footer");if(!i.find(".grid-save-button-modal").length){var o=t+".post();",l=this.generateModalSaveOrCancelButtonCall("save",o,t,e,a);if(i.append(l),n){let n=this.generateModalSaveOrCancelButtonCall("saveAdd",o+t+".startInserting();",t,e,a);i.append(n)}var d=this.generateModalSaveOrCancelButtonCall("cancel",null,null,null,a);i.append(d)}},getObjectId:function(e){if(!e)e="";else if(e instanceof Date){var t=moment.utc(e);e=new Date(t.format("YYYY-MM-DDTHH:mm:ss"))}else if("object"==typeof e)if(e.id)e=e.id;else for(var a in e){e=e[a];break}return e},encodeHTML:function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},decodeHTML:function(e){return e.replace(/&apos;/g,"'").replace(/&quot;/g,"\"").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&")},getColumnByField:function(e,t){var a=null;return e.columns.forEach(function(e){e.field==t&&(a=e)}),a},resizeGridUsingWidthForDevice:function(e){for(let t,a=0;a<e.columns.length;a++)t=this.getWidthForDevice(e.columns[a]),e.columns[a].width=t.width,t.visible?e.showColumn(a):e.hideColumn(a);if(e.options.hasSecurity){let t=$(e.element.find("col")).last();t.css("width","0px")}},getWidthForDevice:function(e){let t=1002,a=$(window).width(),n=function(t){let a;return e.widthDevices.forEach(e=>{e.device===t&&(a=e)}),void 0===a&&("deviceSmall"===t?a=n("deviceMedium"):"deviceMedium"===t?a=n("deviceDesktop"):"deviceDesktop"===t?a=n("deviceBig"):a=e.widthDevices[0]),a},i={width:e.width};return i.visible=void 0!==e.visible&&null!==e.visible?e.visible:!e.hidden,null!==e.widthDevices&&void 0!==e.widthDevices&&0<e.widthDevices.length&&(1210<=a?i=n("deviceBig"):a>=t&&1210>a?i=n("deviceDesktop"):a>=778&&a<t?i=n("deviceMedium"):i=n("deviceSmall")),i},getColumns:function(options,datasource,scope,tooltips){function getTemplate(column){var template="#=showTreatedValue("+column.field+")#";return"switch"==column.inputType?template="<span class=\"k-switch km-switch k-widget km-widget k-switch-off km-switch-off\" style=\"width: 100%\"> <span class=\"k-switch-wrapper km-switch-wrapper\"> <span class=\"k-switch-background km-switch-background\" style=\"margin-left: #="+column.field+" ? \"80%\": \"0%\" #\"></span> </span> <span class=\"k-switch-container km-switch-container\"> <span class=\"k-switch-handle km-switch-handle\" style=#="+column.field+" ? \"float:right;margin-right:-1px\": \"margin-left:0%\" #> </span> </span> </span>":"checkbox"==column.inputType||"boolean"==column.type?template="<input crn-set-indeterminate=#="+column.field+"# type='checkbox' class='k-checkbox' #="+column.field+" ? \"checked='checked'\": '' # /><label class='k-checkbox-label k-no-text'></label>":column.displayField&&0<column.displayField.length?hasMask(column.type)||column.format&&"null"!=column.format?template="#= useMask("+column.displayField+",'"+column.format+"','"+column.type+"') #":template="#="+column.displayField+"#":hasMask(column.type)||column.format&&"null"!=column.format?template="#= useMask("+column.field+",'"+column.format+"','"+column.type+"') #":column.showAsImage&&(template=column.showAsImageTemplate?column.showAsImageTemplate:"<img src='#:${column.field}#'/>",template=eval("`"+template+"`")),template}function hasMask(e){return!!(e&&"string"==typeof e)&&(e.startsWith("date")||e.startsWith("month")||e.startsWith("time")||e.startsWith("week")||e.startsWith("money")||e.startsWith("number")||e.startsWith("tel")||e.startsWith("integer"))}function getFormat(e){return hasMask(e.type)?void 0:e.format}function isRequired(e){var t=!1,a=null;return datasource.schema.model.fields[e]&&(a=datasource.schema.model.fields[e]),a&&(t=!a.nullable),t}function getEditor(){return editor.bind(this)}async function editor(e,t){let a=e=>{e!==t.model[t.field]&&(t.model[t.field]=e,t.model.dirty=!0,t.model.dirtyFields[t.field]=!0)};var n=this.getColumnByField(options,t.field);null==n.visibleCrud||n.visibleCrud||(e.parent().find(".k-edit-label [for="+n.field+"]").parent().remove(),e.remove());var i=isRequired(t.field)?"required":"",o=app.common.generateId();let l=`${options.dataSourceScreen.name}.active.${t.field}`;var d=$(`<input ${i} name="${t.field}" id="${o}" from-grid=true ng-model="${l}" />`);if(d.data("change-grid-model",a),d.data("column-type",n.type),"dynamicComboBox"==n.inputType||"comboBox"==n.inputType){var r=app.kendoHelper.getConfigComboboxSync(n.comboboxOptions,scope);r.autoBind=!0,r.optionLabel=void 0,n.displayField&&(r.change=function(){t.model.set(n.displayField,this.text()),t.model.dirty=!0,t.model.dirtyFields[n.displayField]=!0});let a=d.appendTo(e).kendoDropDownList(r,scope).data("kendoDropDownList");d.data("kendoDropDownList",a)}else if("slider"==n.inputType){var r=app.kendoHelper.getConfigSlider(n.sliderOptions);r.change=t=>scope.$apply(()=>scope.$eval(`${l}=${t.value}`));let t=d.appendTo(e).kendoSlider(r,scope).data("kendoSlider");d.data("kendoSlider",t)}else if("switch"==n.inputType){var r=app.kendoHelper.getConfigSwitch(n.switchOptions);d.appendTo(e).kendoMobileSwitch(r,scope)}else"checkbox"==n.inputType||"boolean"==n.type?(d=$(`<input id="${o}" name="${t.field}" ng-false-value="false" ng-true-value="true" crn-allow-null-values="${!i}" class="k-checkbox" type="checkbox" from-grid=true ng-model="${l}"><label class="k-checkbox-label" for="${o}"></label>`),d.data("change-grid-model",a),d.appendTo(e)):"date"==n.inputType?(d.attr("cron-date",""),d.attr("options",JSON.stringify(n.dateOptions)),d.data("initial-date",t.model[t.field]),d.attr("type","datetime"),d.appendTo(e).off("change")):(d.attr("type",n.type),d.attr("mask",n.format?n.format:""),("999.999.999-99;0"===n.format||"99.999.999/9999-99;0"===n.format)&&(d.attr("valid","999.999.999-99;0"===n.format?"cpf":"cnpj"),d.attr("data-"+n.field.toLocaleLowerCase()+"validation-msg",$translate.instant("invalid."+d.attr("valid")))),d.css("text-align",n.alignment),d.attr("class","k-input k-textbox"),d.data("initial-value",t.model[t.field]),d.appendTo(e));(e=>new Promise(t=>{let a=setInterval(function(){let n=$("#"+e);if(0<n.length){let i=n.closest("td"),o=angular.element(i||n);$compile(o)(scope),clearInterval(a),t(e)}},10)}))(o).then(e=>{$(`#${e}`).data("alreadycompiled",!0),$(`#${e}`).data("$compile",$compile),$(`#${e}`).data("ref-component",options.refComponent)})}function getCommandForEditButtonDatabase(e,t){var a;let n=app.common.generateId(),i=$translate.instant("Edit"),o=`<a href class='k-button k-grid-edit k-grid-${n}' aria-label='${i}'><span class='k-icon k-i-edit'></span></a>`;return a="popupCustom"==e.editable||"datasource"==e.editable?{name:n,template:o,click:function(t){t.preventDefault();var a=$(t.target).closest("tr"),n=a.closest("table"),i=this.dataItem(a),o=this.dataSource.transport.options.cronappDatasource;scope.safeApply(function(){options.hideModalButtons||helperDirective.addButtonsInModal(options.popupEdit,o.name,scope,!1);var t=o.goTo(i);o.startEditing(t,function(){}),"datasource"==e.editable?cronapi.internal.focusFormInput():cronapi.screen.showModal(options.popupEdit)})}}:{name:t,template:o,text:{edit:" ",update:" ",cancel:" "}},a}function getCommandForRemoveButtonDatabase(e,t){var a;let n=app.common.generateId(),i=$translate.instant("Remove"),o=`<a href class='k-button k-grid-delete k-grid-${n}' aria-label='${i}'><span class='k-icon k-i-close'></span></a>`;return a="popupCustom"==e.editable||"datasource"==e.editable?{name:n,template:o,click:function(t){t.preventDefault();var e=$(t.target).closest("tr"),a=this.dataItem(e),n=this.dataSource.transport.options.cronappDatasource,i=this;scope.safeApply(function(){var e=n.goTo(a);n.remove(e)})}}:{name:t,template:o},a}function getAggregate(e){if(e&&e.aggregates){var t=[];if(e.aggregates.forEach(function(e){t.push(e.type)}),0<t.length)return t}}function getAggregateFooter(e,t){if(e&&e.aggregates){var n=[];return e.aggregates.forEach(function(i){var a="#=data."+e.field+" ? data."+e.field+"."+i.type+" : 0 #";("average"==i.type||"sum"==i.type)&&(a="#=useMask(data."+e.field+" ? data."+e.field+"."+i.type+" : 0,'"+e.format+"','"+e.type+"')#");var o=t?i.groupFooterTemplate:i.footerTemplate;o?o+=": ":o="";var l=o+a;e.alignment&&("right"!==e.alignment||t?l="<div style=\"text-align: "+e.alignment+"\">"+l+"</div>":l="<div style=\"text-align: "+e.alignment+"\" class=\"k-fix-margin\">"+l+"</div>"),n.push(l)}),n.join("<br/>")}}function getAggregateHeader(e){return hasMask(e.type)||e.format&&"null"!=e.format?e.headerText+": #=useMask(value,'"+e.format+"','"+e.type+"')#":void 0}function getAttributes(e){let t={};return e&&(e.alignment&&(t.style="text-align: "+e.alignment+";"),e.security&&(t["cronapp-security"]=e.security)),t}var helperDirective=this,columns=[];return options.columns&&options.columns.forEach(function(t){let a=this.getWidthForDevice(t);if("Database"==t.dataType){var n={field:t.field,title:t.headerText,type:t.type,width:a.width,sortable:t.sortable,filterable:t.filterable,hidden:!a.visible};n.template=getTemplate(t),n.format=getFormat(t),n.editor=getEditor.bind(this)(t),n.aggregates=getAggregate(t),n.footerTemplate=getAggregateFooter(t,!1),n.groupFooterTemplate=getAggregateFooter(t,!0),n.groupHeaderTemplate=getAggregateHeader(t),n.attributes=getAttributes(t),n.headerAttributes=n.attributes,n.widthDevices=t.widthDevices,columns.push(n)}else if("Command"==t.dataType){if("no"!=options.editable){var i=t.command.split("|"),o=[];i.forEach(function(e){var t;t="edit"==e?getCommandForEditButtonDatabase.bind(this)(options,e):getCommandForRemoveButtonDatabase.bind(this)(options,e),o.push(t)}.bind(this));var n={command:o,title:t.headerText,width:a.width?a.width:155,hidden:!a.visible,attributes:getAttributes(t)};columns.push(n)}}else if("Blockly"==t.dataType||"Customized"==t.dataType||"CustomizedLink"==t.dataType){var l=null==t.label?"":t.label;t.iconClass&&l&&(l="&nbsp;"+l);var d="";d="CustomizedLink"==t.dataType?"k-custom-link":"k-custom-command"+(l?" k-button-with-label":""),t.theme&&(d+=" "+t.theme);var r="";if(t.tooltip&&t.tooltip.length&&(r=t.tooltip),r){var s=app.common.generateId();tooltips[s]=r,d+=" "+s}let e=app.common.generateId(),i=r||l||e,o=`<a href class='k-button ${d} k-grid-${e}' aria-label='${i}'><span class='${t.iconClass}'></span>${l}</a>`;var n={command:[{name:e,template:o,click:function(a){a.preventDefault();var e=$(a.target).closest("tr"),n=e.closest("table"),i=this.dataItem(e),o=this.dataItem(e),l=$(n.find("tbody")[0]).children().index(e),d=void 0;d="Customized"==t.dataType||"CustomizedLink"==t.dataType?t.execute:generateBlocklyCall(t.blocklyInfo);var r=this.dataSource.transport.options.cronappDatasource,s=options.refComponent,c=[];if(s.select().each(function(){var e=s.dataItem(this);r.data.forEach(function(t){t.__$id==e.__$id&&c.push(t)})}),!(r.inserting||r.editing)){var e=a.currentTarget.parentElement.parentElement;this.select(e)}let p=[];options.fieldType&&"key"===options.fieldType?(o=helperDirective.changeObjectField(r,r.findObjInDs(o)),c.forEach(e=>{p.push(helperDirective.changeObjectField(r,r.findObjInDs(e)))})):p=c;var u={item:o,index:l},g={currentData:r.data,datasource:r.copyWithoutAngularObj(),selectedIndex:l,index:l,selectedRow:o,consolidated:u,item:o,selectedKeys:r.getKeyValues(r.findObjInDs(i),!0),selectedRows:p};return r.goTo(i),void scope.$eval(d,g)}}],width:a.width,title:t.headerText?t.headerText:"",hidden:!a.visible,attributes:getAttributes(t)};columns.push(n)}else if("Selectable"==t.dataType){var c={selectable:!0,attributes:getAttributes(t)};columns.push(c)}}.bind(this)),columns},getPageAble:function(e){var t={refresh:e.allowRefreshGrid,pageSizes:e.allowSelectionTotalPageToShow,buttonCount:5};return e.allowPaging||(t=e.allowPaging),t},getToolbar:function(e,t){function a(e){let t=e.security?`cronapp-security="${e.security}" class`:"class";e.template&&(e.template=e.template.split("class").join(t));let a={template:e.template};return a}var n=[];return e.toolBarButtons.forEach(function(i){if("Native"==i.type){if("no"==e.editable)("pdf"==i.title||"excel"==i.title)&&n.push(i.title);else if(("datasource"==e.editable||"popupCustom"==e.editable)&&"create"==i.title){var o=e.dataSourceScreen.name,l=e.popupInsert;i.methodCall=o+".startInserting();","popupCustom"==e.editable?i.methodCall=i.methodCall+" cronapi.screen.showModal('"+l+"');":i.methodCall+="cronapi.internal.focusFormInput();";var d=this.generateToolbarButtonCall(i,t,e);n.push(d),e.hideModalButtons||this.addButtonsInModal(l,o,t,e.enableModalSaveAdd)}else{let a=this.generateToolbarButtonCall(i,t,e);n.push(a)}}else if("Blockly"==i.type||"Customized"==i.type){var r=this.generateToolbarButtonCall(i,t,e);n.push(r)}else if("SaveOrCancelChanges"==i.type){if("no"!=e.editable){var s=this.generateToolbarButtonCall(i,t,e);n.push(s)}}else if("Template"==i.type||"Title"==i.type){let e=a(i);n.push(e)}}.bind(this)),0==n.length&&(n=void 0),n},getEditable:function(e){var t={mode:e.editable,confirmation:!1};return"batch"==e.editable?t=!0:("no"==e.editable||"popupCustom"==e.editable||"datasource"==e.editable)&&(t=!1),t},getTooltipsDefault:function(){var e={k_grid_edit:$translate.instant("Edit"),k_grid_delete:$translate.instant("Remove"),k_grid_update:$translate.instant("Save"),k_grid_cancel:$translate.instant("Cancel")};return e},setTooltips:function(e,t){for(var a in t){var n="."+a.replace(/_/g,"-");e.kendoTooltip({filter:n,content:function(a){var e=a.sender.options.filter.substr(1).replace(/-/g,"_");return t[e]}})}},generateKendoGridInit:function(t,a,n,i,o){var l=this,d=function(e,t,a){var n=e.table.find(".k-master-row");n.each(function(){(null==a||this!=a[0])&&e.collapseRow(this)});var i=e.table.find(".k-detail-row");i.each(function(){(null==t||this!=t[0])&&$(this).remove()})},r=function(e,t,a){var n=e.table.find(".k-master-row");n.each(function(){(null!=a||this==a[0])&&e.collapseRow(this)});var i=e.table.find(".k-detail-row");i.each(function(){(null!=t||this==t[0])&&$(this).remove()})},s=function(e){var t=this.dataSource.transport.options.cronappDatasource;t.inserting||t.editing||a.safeApply(t.goTo(e))},c=function(n){if(n.sender.tbody&&n.sender.tbody.length){var e=n.sender.tbody;$(n.sender.tbody).find(".k-grid-edit-row").length?e=$(n.sender.tbody).find("tr:not(.k-grid-edit-row)"):e.parent()&&e.parent().parent()&&e.parent().parent().parent()&&(e=e.parent().parent().parent()),a.safeApply(function(){var n=$(e),i=angular.element(n);$compile(i)(a),t.refComponent&&l.resizeGridUsingWidthForDevice(t.refComponent)})}},p=function(e){var a,n=0;return t.columns.forEach(function(t){"Database"==t.dataType&&(n==e&&t.visible&&(a=t),t.visible&&n++)}),a},u=app.kendoHelper.getDataSource(t.dataSourceScreen.entityDataSource,a,t.allowPaging,t.pageCount,t.columns,t.groupings),g=this.getColumns(t,u,a,o),m=this.getPageAble(t),f=this.getToolbar(t,a),h=this.getEditable(t),v=function(e){var t=!1;if(e.columns)for(var a=0;a<e.columns.length;a++)if("Database"==e.columns[a].dataType&&e.columns[a].filterable){t=!0;break}return t}(t),b={hasSecurity:t.columns.filter(e=>e.security).length,toolbar:f,pdf:{allPages:!0,avoidLinks:!0,paperSize:"A4",margin:{top:"2cm",left:"1cm",right:"1cm",bottom:"1cm"},landscape:!0,repeatHeaders:!0,scale:.8},dataSource:u,editable:h,height:t.height,groupable:t.allowGrouping,sortable:t.allowSorting,filterable:!0,pageable:m,columns:g,selectable:t.allowSelectionRow,detailInit:t.details&&0<t.details.length?function(t){if(t.masterRow.find("a").hasClass("k-i-expand"))return void r(this,t.detailRow,t.masterRow);var e=this.dataSource.transport.options.cronappDatasource;e.inserting||e.editing?d(this,null,null):(this.selectable?this.select(t.masterRow):(s.bind(this)(t.data),d(this,t.detailRow,t.masterRow)),t.sender.options.listCurrentOptions.forEach(function(e){var n=l.generateKendoGridInit(e,a,void 0,void 0,o),i=$("<div/>"),d=i.appendTo(t.detailCell).kendoGrid(n).data("kendoGrid");app.kendoHelper.receivePushData(d),e.refComponent=d,window.addEventListener("resize",()=>{l.resizeGridUsingWidthForDevice(d)}),l.setTooltips(i,o)}))}:void 0,listCurrentOptions:t.details&&0<t.details.length?t.details:void 0,excelExport:function(t){let e=t.workbook.sheets[0];for(let n,i=1;i<e.rows.length;i++){n=e.rows[i];for(let e,t=0;t<n.cells.length;t++){if(e=p(t),e&&n.cells[t].value instanceof Date){let a=new Date(n.cells[t].value.getTime());a.setMinutes(a.getMinutes()+a.getTimezoneOffset()),a.setSeconds(a.getSeconds()),n.cells[t].value=a,"time"==e.type?n.cells[t].format="[$-x-systime]hh:mm:ss":"datetime"==e.type&&(n.cells[t].format="dd/mm/yyyy hh:mm:ss;@")}if("footer"===n.type&&n.cells[t].value){let e=n.cells[t].value,i=$(e)[0].innerHTML,o=/{{(.*?)}}/.exec(i);if(o&&1<o.length){i=i.replace(o[0],"");let e=a.$eval(o[1]);n.cells[t].value=`${i}${e}`}}}}},edit:function(t){this.dataSource.transport.options.disableAndSelect(t);var e=t.container,n=this.dataSource.transport.options.cronappDatasource;if(t.model.isNew()){var o=t.model;n.startInserting(null,function(t){for(var a in t)if(o.fields[a]){if(o.fields[a].validation&&o.fields[a].validation.required){var n=e.find("input[name='"+a+"']");n.length&&n.val(t[a]).trigger("change")}o.set(a,t[a])}})}else t.model.isNew()||t.model.dirty||a.safeApply(function(){var e=n.goTo(t.model);n.startEditing(e,function(){})});i&&i.ngEdit&&a.$eval(i.ngEdit),c(t)},change:function(o){var e=this.dataItem(this.select());s.bind(this)(e);var r=this.dataSource.transport.options.cronappDatasource;if(t.fieldType&&"key"===t.fieldType&&(r.active=l.changeObjectField(r,r.active)),n)if("multiple"===t.allowSelectionRowType){let e=[];this.select().each((a,n)=>{let i=this.dataItem(n),o=r.findObjInDs(i,!1);t.fieldType&&"key"===t.fieldType&&(o=l.changeObjectField(r,o)),null!==o&&e.push(o)}),n.$setViewValue(e)}else e?n.$setViewValue(r.active):n.$setViewValue(null);d(this,this.select().next(),this.select()),i&&i.ngChange&&a.$eval(i.ngChange),c(o)},cancel:function(t){var e=this.dataSource.transport.options.cronappDatasource;a.safeApply(e.cancel()),this.dataSource.transport.options.enableAndSelect(t),setTimeout(function(){i&&i.ngCancel&&a.$eval(i.ngCancel),c(t)}.bind(this))},dataBound:function(n){setTimeout(()=>this.dataSource.transport.options.selectActiveInGrid(),100),i&&i.ngDataBound&&a.$eval(i.ngDataBound);for(let e,a=0;a<this.columns.length;a++)e=l.getColumnByField(t,this.columns[a].field),e.visible&&this.showColumn(a);0==$("div.k-grouping-header").length?t.groupings&&t.groupings.forEach(e=>this.hideColumn(e.field)):$("div.k-group-indicator").each((e,t)=>{this.hideColumn($(t).data("field"))});let e=this;setTimeout(function(){e.pager&&e.pager.element.find("a").not(".k-state-disabled").attr("tabindex","0")}),c(n)}};return b.selectable&&"multiple"==t.allowSelectionRowType&&(b.selectable="multiple"),b.originalSelectable=b.selectable,i&&i.ngBeforeEdit&&(b.beforeEdit=function(){a.$eval(i.ngBeforeEdit)}),i&&i.ngDataBinding&&(b.dataBinding=function(){a.$eval(i.ngDataBinding)}),i&&i.ngSave&&(b.save=function(){a.$eval(i.ngSave)}),i&&i.ngSaveChanges&&(b.saveChanges=function(){a.$eval(i.ngSaveChanges)}),i&&i.ngRemove&&(b.remove=function(){a.$eval(i.ngRemove)}),b},link:function(e,t,a,n){if(!t.children().length){var i=$("<div></div>"),o="node_modules/cronapp-lib-js/dist/js/kendo-ui/js/messages/kendo.messages.";o+="pt_br"==$translate.use()?"pt-BR.min.js":"en-US.min.js",this.initCulture();var l=this;$.getScript(o,function(){var t=JSON.parse(a.options||"{}");app.kendoHelper.getCorrectlyDS(t.dataSourceScreen.entityDataSource.name,e).batchPost=!1;var o=null==t.batchMode||t.batchMode;o&&"datasource"!=t.editable&&app.kendoHelper.getCorrectlyDS(t.dataSourceScreen.entityDataSource.name,e)&&!app.kendoHelper.getCorrectlyDS(t.dataSourceScreen.entityDataSource.name,e).dependentLazyPost&&(app.kendoHelper.getCorrectlyDS(t.dataSourceScreen.entityDataSource.name,e).batchPost=!0,t.toolBarButtons=t.toolBarButtons||[],t.toolBarButtons.push({type:"SaveOrCancelChanges",title:$translate.instant("SaveChanges"),methodCall:t.dataSourceScreen.entityDataSource.name+".postBatchData()",saveButton:!0}),t.toolBarButtons.push({type:"SaveOrCancelChanges",title:$translate.instant("CancelChanges"),methodCall:t.dataSourceScreen.entityDataSource.name+".cancelBatchData()",saveButton:!1}));var d=l.getTooltipsDefault(),r=l.generateKendoGridInit(t,e,n,a,d);r.scrollable="true"===a.scrollable;var s=i.kendoGrid(r).data("kendoGrid");app.kendoHelper.receivePushData(s),t.refComponent=s,window.addEventListener("resize",()=>{l.resizeGridUsingWidthForDevice(s)}),l.setTooltips(i,d),e.safeApply(function(){app.kendoHelper.getCorrectlyDS(t.dataSourceScreen.entityDataSource.name,e)&&(i.find(".k-filter-row").show(),i.find(".k-pager-sizes").show(),i.find(".k-pager-nav").show(),i.find(".k-pager-numbers").show(),i.find(".k-pager-refresh.k-link").show(),i.find(".saveorcancelchanges").hide(),app.kendoHelper.getCorrectlyDS(t.dataSourceScreen.entityDataSource.name,e).addDataSourceEvents({pendingchanges:function(e){e?(i.find(".k-filter-row").hide(),i.find(".k-pager-sizes").hide(),i.find(".k-pager-nav").hide(),i.find(".k-pager-numbers").hide(),i.find(".k-pager-refresh.k-link").hide(),i.find(".saveorcancelchanges").show()):(i.find(".k-filter-row").show(),i.find(".k-pager-sizes").show(),i.find(".k-pager-nav").show(),i.find(".k-pager-numbers").show(),i.find(".k-pager-refresh.k-link").show(),i.find(".saveorcancelchanges").hide())}}),app.kendoHelper.getCorrectlyDS(t.dataSourceScreen.entityDataSource.name,e).addDataSourceEvents({afterchanges:function(){}}))})}),t.html(i),$compile(i)(t.scope())}}}}]).directive("src",["$compile",function(){return{restrict:"A",link:function(e,t,a){"IMG"===t[0].tagName&&cronapi.internal.isBase64(a.src)&&setTimeout(()=>$(t[0]).attr("src","data:image/png;base64,"+a.src))}}}]).directive("cronTreeView",["$compile","$translate",function($compile,$translate){return{restrict:"E",replace:!0,require:"ngModel",scope:!0,getDataSource:function(options,scope,ngModelCtrl){let id=options.dataSourceScreen.schema.filter(e=>!0===e.key)[0].name,schema={model:{id:id,hasChildren:function(e){return e.hasChildren}}},getAllParent=function(e,t,a,n,i){t[schema.model.id]&&a.push(t[schema.model.id]);let o=`${e.entity}?$filter=${schema.model.id} eq '${t[options.selfRelationshipField]}'&$format=json&$inlinecount=allpages`;t[options.selfRelationshipField]?$.ajax({url:o,success:t=>{getAllParent(e,t.d.results[0],a,n,i)},beforeSend:e=>{window.uToken&&e.setRequestHeader("X-AUTH-TOKEN",window.uToken)},error:()=>i(),type:"GET"}):n(a)},reloadAndExpand=function(e){this.options.kendoObj.dataSource.bind("requestEnd",()=>{let t=new Promise((t,a)=>{getAllParent(this.options.cronappDatasource,e,[],t,a)});t.then(e=>{this.options.kendoObj.expandPath(e.reverse())})}),this.options.kendoObj.dataSource.read()},helperDirective=this,waitingPromise=!1,datasource=new kendo.data.HierarchicalDataSource({transport:{push:function(){!helperDirective.dataSourceEventsPush&&this.options.cronappDatasource&&(helperDirective.dataSourceEventsPush={create:function(e){reloadAndExpand.bind(this)(e)}.bind(this),update:function(e){reloadAndExpand.bind(this)(e)}.bind(this),delete:function(e){reloadAndExpand.bind(this)(e),ngModelCtrl.$setViewValue(null)}.bind(this),overRideRefresh:function(){this.options.fromRefresh=!0,this.options.kendoObj.dataSource.read(),ngModelCtrl.$setViewValue(null)}.bind(this),read:function(){waitingPromise||(this.options.kendoObj.dataSource.read(),ngModelCtrl.$setViewValue(null))}.bind(this)},this.options.cronappDatasource.addDataSourceEvents(helperDirective.dataSourceEventsPush))},read:function(e){let conditionIsEmpty=e=>{let t=!0;if(e){let a=JSON.parse(e);a.expression&&a.expression.args&&a.expression.args.forEach(e=>{""!==e.right&&"''"!==e.right&&e.right!==void 0&&(t=!1)})}return t},cronappDatasource=this.options.cronappDatasource;for(key in e.data)null==e.data[key]&&delete e.data[key];let logicFilter={filter:{logic:"and",filters:[]}};for(let t in e.data){let a={field:options.selfRelationshipField,operator:"eq",value:e.data[t]};logicFilter.filter.filters.push(a)}let condition=cronappDatasource.condition,conditionEmpty=conditionIsEmpty(condition),paramsOData={$inlinecount:"allpages",$format:"json",$filter:`${options.selfRelationshipField} eq null`};logicFilter.filter.filters.length?(cronappDatasource.condition="",paramsOData=kendo.data.transports.odata.parameterMap(logicFilter,"read")):this.options.fromRefresh&&(this.options.fromRefresh=!1,!conditionEmpty&&(cronappDatasource.cleanup(),paramsOData={$inlinecount:"allpages",$format:"json"})),cronappDatasource.rowsPerPage=e.data.pageSize,cronappDatasource.offset=e.data.page-1;let fetchData={};fetchData.params=paramsOData,helperKendoDs=this,cronappDatasource.fetch(fetchData,{success:function(data){let all=data.map(item=>{let odataUrl=`${this.entity}/$count?$filter=${options.selfRelationshipField} eq '${item[schema.model.id]}'`;return new Promise((resolve,reject)=>{$.ajax({url:odataUrl,success:count=>{item.hasChildren=0<eval(count),resolve()},beforeSend:e=>{window.uToken&&e.setRequestHeader("X-AUTH-TOKEN",window.uToken)},error:()=>reject(),type:"GET"})})});waitingPromise=!0,Promise.all(all).then(()=>{e.success(data),waitingPromise=!1})},canceled:function(){e.error("canceled","canceled","canceled")}},!0),condition&&(cronappDatasource.condition=condition)},options:{fromRead:!1,cronappDatasource:app.kendoHelper.getCorrectlyDS(options.dataSourceScreen.name,scope)}},schema:schema});return datasource},link:function(e,t,a,n){let i=$("<div></div>"),o=JSON.parse(a.options),l=this,d=function(e,t){t=e.getKeyValues(t);var a=Object.keys(t);return 1===a.length&&(t=t[a]),t},r=i.kendoTreeView({dataSource:l.getDataSource(o,e,n),dataTextField:o.textField,dataImageUrlField:o.imageUrlField,change:function(){let t=this.dataItem(this.select()),a=this.dataSource.transport.options.cronappDatasource;e.safeApply(a.goTo(t)),o.fieldType&&"key"===o.fieldType&&(a.active=d(a,a.active)),n.$setViewValue(a.active)}}).data("kendoTreeView");r.dataSource.transport.options.kendoObj=r,t.html(i),$compile(i)(t.scope())}}}]).directive("cronSelect",["$compile",function(){return{restrict:"E",replace:!0,require:"ngModel",link:async function(e,t,a,n){var i={};try{i=JSON.parse(a.options)}catch(e){console.log("ComboBox invalid configuration! "+e)}var o=a.id?" id=\""+a.id+"\"":"",l=a.name?" name=\""+a.name+"\"":"",d=t.parent();$(d).append("<input style=\"width: 100%;\" "+o+l+" class=\"cronSelect\"/>");var r=$(d).find("input.cronSelect"),s=a.cronDisabled,c=await app.kendoHelper.getConfigCombobox(i,e);c.close=a.ngClose?function(){e.$eval(a.ngClose)}:void 0,c.dataBound=a.ngDataBound?function(){e.$eval(a.ngDataBound)}:void 0,c.filtering=a.ngFiltering?function(){e.$eval(a.ngFiltering)}:void 0,c.select=a.ngSelect?function(){e.$eval(a.ngSelect)}:void 0,c.change=function(){m.$apply(function(){f.$setViewValue(this.value())}.bind(p))};var p;p=!0===i.dontAllowOutsideList?r.kendoDropDownList(c).data("kendoDropDownList"):r.kendoComboBox(c).data("kendoComboBox"),$(t).remove();let u,g=()=>{if(u=$(d).find(".k-input.cronSelect"),u.length){u.attr("ng-required",a.ngRequired),"true"===a.ngRequired&&u.attr("required","required"),u.attr("ng-model",a.ngModel),u.attr("id",a.id),u.attr("validationmessage",a.validationmessage);let e=u.parent();u.on("change",()=>{"true"===a.ngRequired&&(0==u.val().length?(e.addClass("ng-invalid-required"),u.addClass("ng-invalid-required")):(e.removeClass("ng-invalid-required"),u.removeClass("ng-invalid-required")))})}else setTimeout(()=>g())};g(),s?p.enable(!1):p.enable(!0);var m=e,f=n,h=!0;n&&(n.$formatters.push(function(t){var n="";return("boolean"==typeof t||t)&&(n=t),p.value(n),!h&&a.ngChange&&e.$eval(a.ngChange),h=!1,p.value(n),n}),n.$parsers.push(function(e){return u&&u.trigger("change"),"boolean"==typeof e||e?e:null}))}}}]).directive("cronDynamicSelect",["$compile","$timeout","$parse","$translate",function($compile,$timeout,$parse,$translate){return{restrict:"E",replace:!0,require:"?ngModel",goTo:function(e,t,a){if(dataSourceScreen=$(t).data("dataSourceScreen"),null!=dataSourceScreen)return dataSourceScreen.goTo(a,!0)},compileAngular:function(e,t){var a=$(t),n=angular.element(a);$compile(n)(e)},getActive:function(active){if(active&&active.indexOf(".active."))try{return eval(active.substr(0,active.indexOf(".active.")))}catch(t){}return null},getFieldText:function(e,t){if(e&&e.indexOf(".active.")&&t.dataTextField)try{var a=e.substr(e.indexOf(".active.")+8);return a+"_"+t.dataTextField}catch(t){}return null},isDefaultEntity:function(e){if(e&&e.entity){var t=e.entity.split("/");if(t&&0<t.length)return-1==t.pop().indexOf("query")}return!1},getModelParent:function(e){if("string"==typeof e&&9<e.length&&0<e.indexOf("|raw}}")){e=e.trim();var t=e.substr(e.indexOf("{{")+2);return t=t.substr(0,t.indexOf("|raw}}")),t.trim()}return null},link:async function(scope,element,attrs,ngModelCtrl){await cronapi.internal.skipIterationLoop();var modelGetter=$parse(attrs.ngModel),modelSetter=modelGetter.assign,select={},self=this,parentDS={},textField=null,cronDisabled=attrs.cronDisabled;try{select=JSON.parse(attrs.options),parentDS=this.getActive(attrs.ngModel),textField=this.getFieldText(attrs.ngModel,select)}catch(e){console.log("DynamicComboBox invalid configuration! "+e)}let lastFieldInModel=attrs.ngModel.split(".");lastFieldInModel=lastFieldInModel[lastFieldInModel.length-1];let modelForTextField=attrs.ngModel.replace(lastFieldInModel,textField),modelTextFieldGetter=$parse(modelForTextField),modelTextFieldSetter=modelTextFieldGetter.assign;var options=await app.kendoHelper.getConfigCombobox(select,scope);options.autoBind=!0;var dataSourceScreen=null;try{delete options.dataSource.schema.model.id,dataSourceScreen=eval(select.dataSourceScreen.name),dataSourceScreen.rowsPerPage=dataSourceScreen.rowsPerPage?dataSourceScreen.rowsPerPage:100,options.dataSource.transport.origin="combobox"}catch(t){}var _scope=scope,_goTo=this.goTo,_compileAngular=this.compileAngular;if(options.virtual={},options.virtual.itemHeight=26,options.dataSource.pageSize&&0<options.dataSource.pageSize){options.height=options.dataSource.pageSize*options.virtual.itemHeight/4,options.virtual.mapValueTo="dataItem";var _options=options;options.virtual.valueMapper=async function(e){let t=setInterval(()=>{var a=_options.combobox;if(a)if(clearInterval(t),!(e.value||""===e.value))e.success(null);else if(null!==a.options.optionLabel[a.options.dataValueField]&&""===e.value)e.success(null);else{a.isEvaluating=!0;var n=_options.dataSource.transport.options.cronappDatasource;void 0===e.value||null===e.value||""===e.value?(e.success(null),a.isEvaluating=!1):n.findObj([e.value],!1,function(t){Array.isArray(t)&&(t=t[0]),e.success(t),a.isEvaluating=!1,select.changeCursor?scope.safeApply(function(){if(null!=t){var e=_goTo(_scope,a,t);e||(n.data.push(t),e=_goTo(_scope,a,t)),e&&modelSetter(_scope,e[select.dataValueField])}else modelSetter(_scope,null)}):null==t&&modelSetter(_scope,null)},function(){e.success(null),a.isEvaluating=!1},[combobox.options.dataValueField])}})}}options.messages={noData:attrs.noResultsMessage?attrs.noResultsMessage:"NO DATA FOUND"},options.change=attrs.ngChange?function(){scope.$eval(attrs.ngChange)}:void 0,options.close=attrs.ngClose?function(){scope.$eval(attrs.ngClose)}:void 0,options.dataBound=attrs.ngDataBound?function(){scope.$eval(attrs.ngDataBound)}:void 0,options.filtering=attrs.ngFiltering?function(){scope.$eval(attrs.ngFiltering)}:void 0,options.open=function(){(!dataSourceScreen.fetched||dataSourceScreen.data.length>combobox.dataSource.data().length)&&(combobox.options.firstLazyRead=!0,combobox.dataSource.read())},options.select=attrs.ngSelect?function(){scope.$eval(attrs.ngSelect)}:void 0;var parent=element.parent(),id=attrs.id?" id=\""+attrs.id+"\"":"",name=attrs.name?" name=\""+attrs.name+"\"":"",validationmessage=attrs.validationmessage?" validationmessage=\""+attrs.validationmessage+"\"":"",inputSelect=$("<input style=\"width: 100%;\""+id+name+validationmessage+" class=\"cronDynamicSelect\" ng-model=\""+attrs.ngModel+"\"/>");attrs.$observe("required",function(e){inputSelect.prop("required",e)}),$(parent).append(inputSelect);var $element=$(parent).find("input.cronDynamicSelect");dataSourceScreen&&(dataSourceScreen.__ignoreFirstFetch=!0);var combobox=$element.kendoDropDownList(options).data("kendoDropDownList");options.combobox=combobox,$(combobox.element[0]).attr("tabindex","-1"),null!=dataSourceScreen&&null!=dataSourceScreen&&$(combobox).data("dataSourceScreen",dataSourceScreen),(attrs.ngRequired||attrs.required)&&($(combobox.element[0]).attr("style",""),$(combobox.element[0]).attr("class","cron-select-offscreen")),$(combobox.wrapper).children(".k-dropdown-wrap").children(".k-select").before(inputSelect);var forceChangeModel=function(e){if(combobox.isEvaluating)return void setTimeout(function(){forceChangeModel(e)},100);if(void 0===e&&(e=null),combobox.value(e),select.changeCursor&&!combobox.isEvaluating)if(null==e||null==e)dataSourceScreen.active={},dataSourceScreen.cursor=-1,modelSetter(_scope,null);else{var t=_goTo(_scope,combobox,combobox.dataItem());t||dataSourceScreen.findObj([e],!1,t=>{Array.isArray(t)&&(t=t[0]),t&&(dataSourceScreen.data.push(t),_goTo(_scope,combobox,t),modelSetter(_scope,e))})}},defineInitialValue=function(){if(!combobox.definingInitialValue)if(!combobox.isEvaluating){var e=combobox.value(),t=null,a=dataSourceScreen.goTo(e);a||((combobox.options.lazyFirstInitialValue||!dataSourceScreen.lazy)&&null!=select.initValue&&null!=select.initValue&&(combobox.options.lazyFirstInitialValue=!1,a=dataSourceScreen.goTo(select.initValue),a&&(t=select.initValue)),null==t&&select.firstValue?dataSourceScreen&&(combobox.definingInitialValue=!0,dataSourceScreen.fetch({params:{$top:1}},{success:function(e){e.length&&(dataSourceScreen.data.push(e[0]),t=e[0][select.dataValueField]),modelSetter(_scope,t),forceChangeModel(t),combobox.definingInitialValue=!1},error:function(){combobox.definingInitialValue=!1},canceled:function(){combobox.definingInitialValue=!1}},void 0,{lookup:!0})):(modelSetter(_scope,t),forceChangeModel(t),combobox.definingInitialValue=!1))}else setTimeout(()=>defineInitialValue(),300)},_ngModelCtrl=ngModelCtrl;null!=dataSourceScreen&&null!=dataSourceScreen&&dataSourceScreen.addDataSourceEvents({overRideRefresh:function(){dataSourceScreen.fetched=!1,dataSourceScreen.cleanup(),defineInitialValue()}});var _isDefaultEntity=this.isDefaultEntity;if($element.on("change",function(event){let applyChange=function(){return combobox.isEvaluating?void setTimeout(applyChange,100):void _scope.$apply(function(){if(modelSetter(_scope,combobox.dataItem()[select.dataValueField]),modelTextFieldSetter(_scope,combobox.dataItem()[select.dataTextField]),select.changeValueBasedOnLabel){let comboLabelValue=combobox.dataItem()[select.dataTextField];try{eval(select.changeValueBasedOnLabel+"=\""+comboLabelValue+"\"")}catch(t){try{_scope.$eval(select.changeValueBasedOnLabel+"=\""+comboLabelValue+"\"")}catch(t){console.error("N\xE3o foi poss\xEDvel atribuir o texto do combobox ",comboLabelValue," no compo informado ",select.changeValueBasedOnLabel)}}}_compileAngular(scope,options.combobox.element[0])})};applyChange()}),ngModelCtrl&&(ngModelCtrl.$formatters.push(function(e){combobox.value();return void 0===e&&(e=null),forceChangeModel(e)}),ngModelCtrl.$parsers.push(function(e){if("boolean"==typeof e||e)if(!0===combobox.options.valuePrimitive){if("string"==typeof e)return e;if("boolean"==typeof e[select.dataValueField]||e[select.dataValueField])return e[select.dataValueField]}else try{return objectClone(e,combobox.dataSource.options.schema.model.fields)}catch(t){}return null})),!select.initValue)select.initValue=null;else if(select.initValue.startsWith("params.")){var type=combobox.dataSource.options.schema.model.fields[select.dataValueField].type;select.initValue=scope.$eval(select.initValue),"string"!=type&&(select.initValue=dataSourceScreen.normalizeValue(select.initValue,!0))}else select.initValue=scope.$eval(select.initValue);""==select.initValue&&(select.initValue=null),combobox.dataSource.transport&&combobox.dataSource.transport.options&&(combobox.dataSource.transport.options.combobox=combobox,combobox.dataSource.transport.options.$compile=$compile,combobox.dataSource.transport.options.scope=scope,combobox.dataSource.transport.options.ngModelCtrl=ngModelCtrl,combobox.dataSource.transport.options.initRead=!0,null!=select.initValue&&null!=select.initValue?(modelSetter(_scope,select.initValue),combobox.options.lazyFirstInitialValue=!0):select.firstValue&&defineInitialValue()),$(combobox.span).on("DOMSubtreeModified",function(t){_compileAngular(scope,t.target)}),$(combobox.ul).on("DOMSubtreeModified",function(t){$timeout(function(){_compileAngular(scope,t.target)})}),_compileAngular(scope,combobox.span),_compileAngular(scope,combobox.ul),$(element).remove(),cronDisabled?combobox.enable(!1):combobox.enable(!0),$("[aria-owns='"+`${attrs.id}_listbox`+"']").attr("aria-label",$translate.instant("template.crud.search"))}}}]).directive("cronMultiSelect",["$compile","$parse",function($compile,$parse){return{restrict:"E",require:"ngModel",link:async function(scope,element,attrs,ngModelCtrl){var modelGetter=$parse(attrs.ngModel),modelSetter=modelGetter.assign,model=attrs.ngModel,cronDisabled=attrs.cronDisabled,_self=this,select={};try{select=JSON.parse(attrs.options)}catch(e){console.log("MultiSelect invalid configuration! "+e)}var _scope=scope,_ngModelCtrl=ngModelCtrl,relactionDS={relationDataSource:null==select.relationDataSource?null:eval(select.relationDataSource.name),relationField:null==select.relationField?"":select.relationField},options=await app.kendoHelper.getConfigCombobox(select,scope);try{delete options.dataSource.schema.model.id}catch(t){}var parent=element.parent(),id=attrs.id?" id=\""+attrs.id+"\"":"",name=attrs.name?" name=\""+attrs.name+"\"":"";let required=attrs.ngRequired&&eval(attrs.ngRequired)?`required="required"`:"";$(parent).append(`<div style="width: 100%;"> <input style="width: 100%;" ${id} ${name} ${required} class="cronMultiSelect" ng-model="${attrs.ngModel}"/> </div>`),$(parent).find("label").attr("for",attrs.id);let $inp=$(`${attrs.id}`);$compile($inp)(scope);var $element=$(parent).find("input.cronMultiSelect");$(element).remove();var evtSelect,deselect;options.deselect=function(e){var dataItem=e.dataItem,relation=this.relationDataSource,dataValueField=e.sender.options.dataValueField,selectItem=null;if(relation&&relation.data&&dataItem[dataValueField]){for(key in relation.data){var item=relation.data[key];if(item[this.relationField]&&item[this.relationField]==dataItem[dataValueField]){selectItem=item;break}}null!=selectItem&&($(combobox).data("silent",!0),this.relationDataSource.removeSilent(selectItem,null,null))}else model&&_scope.$apply(function(){try{var data=eval("_scope."+model);data=data.filter(e=>"object"==typeof e?e[dataValueField]!==dataItem[dataValueField]:e!==dataItem[dataValueField]),$(combobox).data("silent",!0),modelSetter(_scope,data)}catch(t){}});deselect&&deselect()}.bind(relactionDS),options.select=function(e){var dataItem=e.dataItem,dataValueField=e.sender.options.dataValueField,combobox=e.sender;if(this.relationDataSource&&dataItem[dataValueField]){var obj={};obj[this.relationField]=dataItem[dataValueField],$(combobox).data("silent",!0),this.relationDataSource.startInserting(obj,function(){this.postSilent()}.bind(this.relationDataSource))}else model&&_scope.$apply(function(){try{var data=eval("_scope."+model);if(data||(data=[]),select.fieldType&&"key"===select.fieldType){var keyValues=combobox.dataSource.options.transport.options.cronappDatasource.getKeyValues(dataItem),keys=Object.keys(keyValues);1===keys.length&&(keyValues=keyValues[keys]),data.push(keyValues)}else data.push(objectClone(dataItem,combobox.dataSource.options.schema.model.fields));$(combobox).data("silent",!0),modelSetter(_scope,data)}catch(t){}});evtSelect&&evtSelect()}.bind(relactionDS),options.change=attrs.ngChange?function(){_scope.$eval(attrs.ngChange)}:void 0,options.close=attrs.ngClose?function(){_scope.$eval(attrs.ngClose)}:void 0,options.dataBound=attrs.ngDatabound?function(){_scope.$eval(attrs.ngDatabound)}:void 0,options.filtering=attrs.ngFiltering?function(){_scope.$eval(attrs.ngFiltering)}:void 0,options.open=attrs.ngOpen?function(){_scope.$eval(attrs.ngOpen)}:void 0,options.cascade=attrs.ngCascade?function(){_scope.$eval(attrs.ngCascade)}:void 0,evtSelect=attrs.ngSelect?function(){_scope.$eval(attrs.ngSelect)}:void 0,deselect=attrs.ngDeselect?function(){_scope.$eval(attrs.ngDeselect)}:void 0;var combobox=$element.kendoMultiSelect(options).data("kendoMultiSelect");cronDisabled?combobox.enable(!1):combobox.enable(!0),app.kendoHelper.receivePushData(combobox),$("[aria-describedby='"+`${attrs.id}_taglist`+"']").attr("id",`${attrs.id}-container`),attrs.crnReadonly&&_scope.$watch(attrs.crnReadonly,()=>{combobox.readonly(_scope.$eval(attrs.crnReadonly))});var convertArray=function(e){var t=[];if(e)for(var a in e)t.push(e[a][relactionDS.relationField]);return t};scope.$watchCollection(function(){return ngModelCtrl.$modelValue},function(value,old){var silent=$(combobox).data("silent");0===value.length?($(`#${attrs.id}`).addClass("ng-empty"),attrs.ngRequired&&eval(attrs.ngRequired)&&$(`#${attrs.id}`).attr("required","required")):($(`#${attrs.id}`).removeClass("ng-empty"),$(`#${attrs.id}`).removeAttr("required")),$(combobox).data("silent",!1),silent||JSON.stringify(value)===JSON.stringify(old)||(relactionDS.relationDataSource&&relactionDS.relationField?combobox.value(convertArray(value)):combobox.value(value))})}}}]).directive("cronAutoComplete",["$compile",function(){return{restrict:"E",require:"ngModel",link:async function(e,t,a,n){var i={};try{i=JSON.parse(a.options)}catch(e){console.log("AutoComplete invalid configuration! "+e)}try{delete o.dataSource.schema.model.id}catch(t){}var o=await app.kendoHelper.getConfigCombobox(i,e);o.change=a.ngChange?function(){e.$eval(a.ngChange)}:void 0,o.close=a.ngClose?function(){e.$eval(a.ngClose)}:void 0,o.dataBound=a.ngDataBound?function(){e.$eval(a.ngDataBound)}:void 0,o.filtering=a.ngFiltering?function(){e.$eval(a.ngFiltering)}:void 0,o.select=a.ngSelect?function(){e.$eval(a.ngSelect)}:void 0;var l=t.parent(),d=a.id?" id=\""+a.id+"\"":"",r=a.cronDisabled,s=a.name?" name=\""+a.name+"\"":"",c=a.validationmessage?" validationmessage=\""+a.validationmessage+"\"":"",p="";(a.ngRequired||a.required)&&(p=" required "),$(l).append("<input style=\"width: 100%;\" "+d+s+p+c+" class=\"cronAutoComplete\" ng-model=\""+a.ngModel+"\"/>");var u=$(l).find("input.cronAutoComplete");$(t).remove(),o.change=function(){e.$apply(function(){n.$setViewValue(u.val())})},"true"==a.autoExpand&&u.on("focus",function(){g.search()}),o.messages={noData:a.noResultsMessage?a.noResultsMessage:"NO DATA FOUND"},"false"==a.firstOptionOnBlur&&(o.suggest=!1);var g=u.kendoAutoComplete(o).data("kendoAutoComplete");r?g.enable(!1):g.enable(!0),n&&(n.$formatters.push(function(e){return g.value(e),e}),n.$parsers.push(function(e){if(e){if("string"==typeof e)return e;if(e[i.dataTextField])return e[i.dataTextField]}return null}))}}}]).directive("cronDate",["$compile","$translate","$window",function(e,t){return{restrict:"AE",require:"?ngModel",link:function(a,n,i,o){var l={},d={};try{if(i.options)d=JSON.parse(i.options);else{var r=window.buildElementOptions(n);d=JSON.parse(r)}d.format||(d.format=parseMaskType(d.type,t)),l=app.kendoHelper.getConfigDate(t,d)}catch(e){console.log("AutoComplete invalid configuration! "+e)}var s="date"==l.type||"datetime"==l.type||"time"==l.type;window.fixedTimeZone||(s=!1);var c=$(n);if(!c.data("alreadycompiled")){if(c.data("alreadycompiled",!0),c.data("$compile",e),i.fromGrid)c=$(n);else{var p=n.parent(),u=$("<input style=\"width: 100%;\" class=\"cronDate\" ng-model=\""+i.ngModel+"\"/>");$(p).append(u),c=$(p).find("input.cronDate"),c.data("type",l.type),c.attr("type","date")}var g=app.kendoHelper.buildKendoMomentPicker(c,l,a,o);i.fromGrid||(o&&(o.$formatters.push(function(e){var t=null;if(e){var a=null;a=s?moment(e).utcOffset(window.timeZoneOffset):moment(e),t=a.format(l.momentFormat)}return g.value(t),t}),o.$parsers.push(function(e){if(e){var t=null;return t=s?moment(g._oldText,l.momentFormat).utcOffset(window.timeZoneOffset):moment(g._oldText,l.momentFormat),t.toDate()}return null})),$(n).remove())}}}}]).directive("cronSlider",["$compile",function(e){return{restrict:"E",require:"ngModel",getActive:function(e,t){if(e&&e.indexOf(".active."))try{return t.$eval(e.substr(0,e.indexOf(".active.")))}catch(t){}},link:function(t,a,n,i){var o={};try{o=JSON.parse(n.options)}catch(e){console.log("Slider invalid configuration! "+e)}var l=app.kendoHelper.getConfigSlider(o),d=this.getActive(n.ngModel,t);l.change=function(){t.$apply(function(){var e=$(a).val();d&&(e=d.normalizeValue(e,!0)),i.$setViewValue(e),n.ngChange&&t.$eval(n.ngChange)})},l.slide=n.ngSlide?function(){t.$eval(n.ngSlide)}:void 0;var o=$(a).kendoSlider(l).data("kendoSlider");const r=new ResizeObserver(()=>{o.resize()});if(r.observe(o.wrapper[0]),"true"===n.ngRequired||n.required){var s=n.id?" id=\"input"+app.common.generateId()+"\"":"",c=n.name?" name=\"input"+app.common.generateId()+"\"":"",p=a.parent();$(p).append("<input aria-label=\"slider\" autocomplete=\"off\" tabindex=\"-1\" style=\"width: 100%;\""+s+c+" required class=\"cronSlider cron-select-offscreen\" ng-model=\""+n.ngModel+"\"/>");var u=$(p).find("input.cronSlider");e(u)(a.scope())}t.$watch(function(){return i.$modelValue},function(e,t){e!==t&&(e?o.value(e):o.value(o.min()))}),i&&(i.$formatters.push(function(e){var t=null;return!e&&o.min?t=o.min:e&&(t=e),o.value(t),t}),i.$parsers.push(function(e){return e?e:null}))}}}]).directive("cronSwitch",["$compile",function(){return{restrict:"E",require:"ngModel",link:function(e,t,a,n){var i={};try{var o=window.buildElementOptions(t);i=JSON.parse(o)}catch(e){console.log("Switch invalid configuration! "+e)}var l=app.kendoHelper.getConfigSwitch(i),d=t.parent();$(d).append("<input style=\"width: 100%;\" class=\"cronSwitch\" ng-model=\""+a.ngModel+"\"/>");var r=$(d).find("input.cronSwitch");l.change=function(){e.$apply(function(){n.$setViewValue(this.value())}.bind(this))};var s=r.kendoMobileSwitch(l).data("kendoMobileSwitch");$(t).remove(),n&&(n.$formatters.push(function(e){var t=!1;return null!=e&&(t=e),s.value(t),t}),n.$parsers.push(function(e){return null!=e&&e}))}}}]).directive("cronBarcode",["$compile",function(){return{restrict:"E",require:"ngModel",link:function(e,t,a,n){var i={};try{var o=window.buildElementOptions(t);i=JSON.parse(o)}catch(e){console.log("Barcode invalid configuration! "+e)}var l=app.kendoHelper.getConfigBarcode(i),d=t.parent();$(d).append("<span class=\"cronBarcode\" ng-model=\""+a.ngModel+"\"></span>");var r=$(d).find("span.cronBarcode"),s=r.kendoBarcode(l).data("kendoBarcode");$(t).remove(),e.$watch(function(){return n.$modelValue},function(e,t){var a="";e!==t&&(a=e),l.value=a,s.setOptions(l)})}}}]).directive("cronQrcode",["$compile",function(){return{restrict:"E",require:"ngModel",link:function(e,t,a,n){var i={};try{var o=window.buildElementOptions(t);i=JSON.parse(o)}catch(e){console.log("Qrcode invalid configuration! "+e)}var l=app.kendoHelper.getConfigQrcode(i),d=t.parent();$(d).append("<span class=\"cronQrcode\" ng-model=\""+a.ngModel+"\"></span>");var r=$(d).find("span.cronQrcode"),s=r.kendoQRCode().data("kendoQRCode");$(t).remove(),e.$watch(function(){return n.$modelValue},function(e,t){var a="";e!==t&&(a=e),l.value=a,s.setOptions(l)})}}}]).directive("cronappRating",function(){"use strict";return{restrict:"E",require:"ngModel",link:function(e,t,a,n){function o(e){for(var t=1;5>=t;t++)c[t-1].removeClass(a.iconOff||"fa fa-star-o"),c[t-1].removeClass(a.iconOn),c[t-1].removeClass(a.theme),t<=e?(c[t-1].addClass(a.iconOn),c[t-1].addClass(a.theme)):(c[t-1].addClass(a.iconOff||"fa fa-star-o"),c[t-1].addClass(a.theme));return e}a.theme=$(t).find("i").attr("xattr-theme"),a.iconOn=$(t).find("i").attr("class");var l=$(t),d=[];a.xattrDefaultValue&&(n.$viewValue=0,n.$commitViewValue());for(var r=1;5>=r;r++)d.push($(t).find("i").get(r-1)),$(d[r-1]).addClass(a.iconOff||"fa fa-star-o");l.html("");for(var s,c=[],r=1;5>=r;r++)s=$(d[r-1]).clone(),l.append(s),s.attr("idx",r),s.click(function(){e.$apply(function(){let e=parseInt($(this).attr("idx"));n.$viewValue=n.$viewValue===e?0:e,n.$commitViewValue()}.bind(this))}),c.push(s);n.$parsers.push(o),n.$formatters.push(o)}}}).directive("cronDynamicMenu",["$compile","$translate",function(e,t){"use strict";const a=e=>{var a=e.menuItems,i="";return a.forEach(e=>{var a=e.security&&null!=e.security?" cronapp-security=\""+e.security+"\" ":"",o=e.action&&null!=e.action?" ng-click=\""+e.action+"\" ":"",l=e.hide&&null!=e.hide?" ng-hide=\""+e.hide+"\" ":"",d=e.iconClass&&null!=e.iconClass?"<i class=\""+e.iconClass+"\"></i>&nbsp;":"",r="<span></span>",s=e.menuItems&&Array.isArray(e.menuItems)&&0<e.menuItems.length?"<span class=\"caret submenu\"></span>":"";e.title&&(r="<span>"+t.instant(e.title)+"</span>"),i=0<e.menuItems.length?i+"<li class=\"dropdown-submenu\"> <a class=\"dropdown-item dropdown-toggle\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\" href=\"\""+a+o+">"+d+r+s+"</a> "+n(e.menuItems)+" </li>":i+"<li class=\"dropdown-submenu\"> <a role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\" href=\"\""+a+o+">"+d+r+s+"</a> </li>"}),""!=i&&(i="<ul class=\"dropdown-menu\">"+i+"</ul>"),i},n=e=>{var n="";return e&&0<e.length&&Array.isArray(e)&&(e.forEach(function(e){var i=e.security&&null!=e.security?" cronapp-security=\""+e.security+"\" ":"",o=e.action&&null!=e.action?" ng-click=\""+e.action+"\" ":"",l=e.hide&&null!=e.hide?" ng-hide=\""+e.hide+"\" ":"",d=e.iconClass&&null!=e.iconClass?"<i class=\""+e.iconClass+"\"></i>&nbsp;":"",r="<span></span>",s=e.menuItems&&Array.isArray(e.menuItems)&&0<e.menuItems.length?"<span class=\"caret submenu\"></span>":"";e.title&&(r="<span>"+t.instant(e.title)+"</span>"),n=0<e.menuItems.length?n+" <li class=\"dropdown-submenu\" "+i+l+"> <a href=\"\" "+o+" class=\"dropdown-item dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">"+d+r+s+" </a> "+a(e)+" </li>":n+" <li class=\"dropdown-submenu\" "+i+l+"> <a href=\"\" "+o+" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">"+d+r+s+" </a> </li>"}),""!=n&&(n="<ul class=\"dropdown-menu\">"+n+"</ul>")),n};return{restrict:"EA",populateMenu:function(e,a){var i="";return e&&null!=e&&e.subMenuOptions&&null!=e.subMenuOptions&&Array.isArray(e.subMenuOptions)&&e.subMenuOptions.forEach(function(e){var o=e.security&&null!=e.security?" cronapp-security=\""+e.security+"\" ":"",l=e.action&&null!=e.action?" ng-click=\""+e.action+"\" ":"",d=e.menuItems&&Array.isArray(e.menuItems)&&0<e.menuItems.length?"<span class=\"caret\"></span>":"",r=e.hide&&null!=e.hide?" ng-hide=\""+e.hide+"\" ":"",s=e.iconClass&&null!=e.iconClass?"<i class=\""+e.iconClass+"\"></i>&nbsp;":"",c="<span></span>";e.title&&(c="<span>"+t.instant(e.title)+"</span>"),i=i+" <li class=\"dropdown nav-item "+(a?"col-md-12 padding-0":"")+"\""+o+r+"> <a href=\"\" "+l+" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\"> "+s+c+d+" </a> "+n(e.menuItems)+" </li>"}),i},link:function(a,n,i){t.onReady(()=>{let t=n.closest(".crn-navigator-vertical").length;var o="<ul class=\"nav navbar-nav "+(t?"col-md-12 padding-0":"")+" \"></ul>",l={};try{l=JSON.parse(i.options)}catch(t){console.log("CronDynamicMenu: Invalid configuration!")}var d=$(o);d.attr("id",i.id);var r=this.populateMenu(l,t);d.append(r),t&&d.append($("#navbar2 li:first").addClass("col-md-12 padding-0"));var s=angular.element(d);n.html(""),n.append(d),n.attr("id",null),e(s)(a);var c=i.multilevelAction;"hover"===c&&($(".dropdown-menu .dropdown-submenu").on("mouseover",function(){var e=$(this).children("ul.dropdown-menu");e.addClass("displayBlock")}),$(".dropdown-menu .dropdown-submenu").on("mouseout",function(){var e=$(this).children("ul.dropdown-menu");e.removeClass("displayBlock")})),"click"===c&&$(".dropdown-menu a.dropdown-toggle").on("click",function(){$(this).next().hasClass("show")||$(this).parents(".dropdown-menu").first().find(".show").removeClass("show");var e=$(this).next(".dropdown-menu");return e.toggleClass("show"),$(this).parents("li.nav-item.dropdown").on("hidden.bs.dropdown",function(){$(".dropdown-submenu .show").removeClass("show")}),!1})})}}}]).directive("cronBreadcrumbs",function(){"use strict";return{restrict:"E",replace:!0,link:function(e,t,a){async function n(){let t=r.replace("cronapi.client('js.","blockly.js.");r=t.replace("').run()",""),r=e.$eval(r),d=await r(),$(`#${s}`).kendoBreadcrumb({items:d,delimiterIcon:i,navigational:!0})}let i=a.crnDelimiterIcon,o=a.typeMenu,l=a.idMenu?a.idMenu:null,d=[],r=a.ngInit?a.ngInit:null,s=a.id,c=[],p=a.breadcrumbIcon?a.breadcrumbIcon:null;r&&"idBloco"===o?n():setTimeout(()=>{function e(t){let a=!1;for(let o in t){let i=t[o].action;if(i&&""!=i?(i=i.replace("cronapi.screen.changeView('",""),i=i.replace("', [])",""),i=i.split("/")):i=null,1===t[o].level&&(c=[]),0!=c.length&&t[o].level===c[c.length-1].level?i?i&&(c[c.length-1]={level:t[o].level,title:t[o].title,href:document.location.origin+"/"+i.join("/")}):c[c.length-1]={level:t[o].level,title:t[o].title,href:"#"}:i?i&&c.push({level:t[o].level,title:t[o].title,href:document.location.origin+"/"+i.join("/")}):c.push({level:t[o].level,title:t[o].title,href:"#"}),0<t[o].menuItems.length?e(t[o].menuItems):i&&i[i.length-1]===n[n.length-1]&&(a=!0),a){for(let e in c)0==e&&1==c[e].level?d.push({type:"rootitem",href:c[e].href,text:c[e].title,showText:!0,showIcon:!1}):0==e&&1!=c[e].level?d.push({type:"rootitem",href:c[e].href,text:c[e].title,showText:!0,showIcon:!1}):d.push({type:"item",href:c[e].href,text:c[e].title,showText:!0,showIcon:!1});return d}}}let t=$(`#${l}`)[0].children[0].attributes.options;t=JSON.parse(t.value);let a=t.subMenuOptions,n=document.location.hash;n=n.split("/"),e(a),$(`#${s}`).kendoBreadcrumb({items:d,delimiterIcon:i,navigational:!0})},800)}}}).directive("ngInitialValue",["$parse",function(e){return{restrict:"A",require:"ngModel",link:async function(t,a,n){if(n.ngInitialValue){var i,o=e(n.ngModel),l=o.assign;try{if(-1!=n.ngInitialValue.indexOf("cronapi.client('js.")){let e=n.ngInitialValue.replace("cronapi.client('js.","blockly.js."),a=e.split("').names")[0];a=a.split("').attr()")[0];let o=e.split(".run")[1];i=await t.$eval(a+o)}else i=t.$eval(n.ngInitialValue)}catch(t){i=n.ngInitialValue}"checkbox"==a[0].type&&i&&(i="true"==(""+i).toLowerCase()),l(t,i)}}}}]).directive("crnSetIndeterminate",["$parse",function($parse){return{restrict:"A",link:function(scope,element,attrs){let value=eval(attrs.crnSetIndeterminate);null===value&&$(element).prop("indeterminate",!0)}}}]).directive("crnAllowNullValues",[function(){return{restrict:"A",require:"?ngModel",link:function(e,t,a,n){n.$formatters=[],n.$parsers=[];let i=!!a.ngFalseValue&&a.ngFalseValue.split("'").join(""),o=!a.ngTrueValue||a.ngTrueValue.split("'").join("");n.$render=(e=>"true"===e||void 0===e||null===e||0==e.length)(a.crnAllowNullValues)?function(){let e=n.$viewValue;t.data("checked",e),!0===e||e===o?(t.prop("indeterminate",!1),t.prop("checked",!0),e=o):!1===e||e===i?(t.prop("indeterminate",!1),t.prop("checked",!1),e=i):(e=null,t.prop("indeterminate",!0)),setTimeout(()=>n.$setViewValue(e))}:function(){let l=n.$viewValue;if((void 0===n.$viewValue||null===n.$viewValue)&&(n.$setViewValue(!1),l=!1),l===i){let n=a.ngFalseValue?`${t.attr("ng-model")}=${a.ngFalseValue}`:`${t.attr("ng-model")}=${i}`;e.$eval(n)}switch(t.data("checked",l),l){case!0:case o:t.prop("indeterminate",!1),t.prop("checked",!0),l=o;break;default:t.prop("indeterminate",!1),t.prop("checked",!1),l=i;}setTimeout(()=>n.$setViewValue(l))},t.bind("click",function(){let l;switch(t.data("checked")){case!1:case i:l=!a.ngTrueValue||o;break;default:l=!!a.ngFalseValue&&i;}n.$setViewValue(l),e.$apply(n.$render)})}}}]).directive("signaturePad",["$compile","$window",function(e,t){"use strict";var a,n;return{restrict:"E",require:"ngModel",scope:!0,replace:!0,template:"<div><canvas style=\"width:100%\" ng-click=\"mouseup()\" ng-mouseup=\"mouseup()\"></canvas><div><button type=\"button\" class=\"btn btn-warning\" style=\"margin-right:5px;margin-bottom:5px;\" ng-click=\"clear()\">{{\"clear\"|translate}}</button></div></div>",scope:{clear:"=",dataurl:"=",height:"@",width:"@",ngClick:"@",ngModel:"="},controller:["$scope",function(e){e.mouseup=function(){var t={};if(e.signaturePad.isEmpty()?(t.dataUrl=null,t.isEmpty=!0):(t.dataUrl=e.signaturePad.toDataURL(),t.isEmpty=!1),null!=t.dataUrl){var a=t.dataUrl.split(",")[1];e.ngModel=a}},e.$watch("ngModel",function(t,n){var i=e.signaturePad,o=e.ngModel;t!==n&&(a.clear(),i.fromDataURL("data:image/png;base64,"+t,{ratio:1}),e.ngModel=t)},!0),e.clear=function(){e.signaturePad.clear(),e.ngModel=null}}],link:function(a,i){n=i.find("canvas")[0],a.onResize=function(){var e=i.find("canvas")[0],a=Math.max(t.devicePixelRatio||1,1);e.width=e.offsetWidth*a,e.height=e.offsetHeight*a,e.getContext("2d").scale(a,a)},a.onResize(),a.signaturePad=new SignaturePad(n),angular.element(t).bind("resize",function(){a.onResize()}),e(i)(i.scope())}}}]).directive("cronChat",["$compile","$translate",function(){return{restrict:"E",replace:!0,link:function(e,t,a){var n=JSON.parse(a.options||"{}");if(n.token&&n.urlCronchat){var i=n.urlCronchat.endsWith("/")?n.urlCronchat:n.urlCronchat+"/",o=n.token,l=$(`<script src="${i}get-chat?token=${o}" type="text/javascript"></script>`);t.html(l)}}}}]).directive("updateLanguage",["$rootScope",function(e){return{link:function(t,a){e.$on("$translateChangeSuccess",function(e,t){var n=t.language;"pt_br"===n?n="pt-br":n.startsWith("en")&&(n="en"),a.attr("lang",n||"en")})}}}]).directive("cronFrame",["$compile","$sce","$parse",function(e,t,a){"use strict";return{restrict:"AE",require:"ngModel",link:function(n,i,o,l){l&&n.$watch(o.ngModel,function(l){if(l!==o.origin){o.$set("origin",l==null?o.origin:l);const r=a(o.ngModel);let s=r.assign,c="";if("include"==o.type)c=$(`<div class="cronframeOption" ng-include="'${o.origin}'"></div>`);else if("frame"==o.type){var d=t.trustAsResourceUrl(o.origin);c=$(`<iframe class="cronframeOption" ng-src="${d}" width="100%" height="100%" loading="lazy"></iframe>`)}s(n,o.origin),i.html(c),e(c)(n)}})}}}]).directive("fromGrid",["$compile",e=>({restrict:"A",priority:-999999,exist:e=>{let t=e.attr("id");return $(`#${t}`).length},isFromGrid:e=>"true"===e.fromGrid,isCompiled:e=>e.data("alreadycompiled"),getDateAs:function(e,t,a){let n=e.data("mask"),i=e.data("useUTC");return formatWithMomentAs(n,i,t,a)},prepareValue:function(e,t){let a=e.data("column-type")||"";return a.startsWith("date")&&(t=this.getDateAs(e,t,"date")),t},formatComponent:function(e,t){let a=e.data("kendoDropDownList")||e.data("kendoSlider"),n=e.data("column-type")||"";n.startsWith("date")?e.val(this.getDateAs(e,t,"string")):a&&a.value(t)},compileGridListing:function(t,a){let n=t.data("ref-component");if(n&&n.tbody&&n.tbody.length&&!$(n.tbody).find(".k-grid-edit-row").length){var i=n.tbody;setTimeout(()=>{a.safeApply(()=>{var t=$(i),n=angular.element(t);e(n)(a)})})}},link:function(e,t,a){e.$watch(a.ngModel,n=>{this.isFromGrid(a)&&this.exist(t)&&this.isCompiled(t)&&(n=this.prepareValue(t,n),this.formatComponent(t,n),this.compileGridListing(t,e),call=t.data("change-grid-model"),call&&call(n))})}})]).directive("cronOrderedList",["$compile","$sce","$parse",function(e){"use strict";return{restrict:"EA",replace:!0,link:function(t,a,n){let i=n.attributeValue,o=n.orderedAttributeValue,l=n.listType,d=a[0].children[0].children;d=$(d);let r="",s="";$.each(d,function(e,t){s+=t.outerHTML});"numbered-list"===l?r=`<ol style="list-style-type: ${i}">${s}</ol>`:"ordered-list"===l?r=`<ul style="list-style-type: ${o}">${s}</ul>`:void 0;r=$(r),$(a).replaceWith(r),e(r)(t)}}}])}(app);function maskDirectiveAsDate(e,t,a){return maskDirective(e,t,a,"as-date")}function maskDirectiveMask(e,t,a){return maskDirective(e,t,a,"mask")}function maskDirective(e,t,a,n){return{restrict:"A",require:"?ngModel",link:function(i,o,l,d){if("as-date"!=n||void 0===l.mask){var r=a(l.ngModel),s=r.assign,c=$(o);if(!c.data("alreadycompiled")){c.data("alreadycompiled",!0),c.data("$compile",e);var p=c.attr("type");if("checkbox"!=p&&"password"!=p&&"url"!=p){if("color"==p||"range"==p)return c[0].classList.remove("form-control"),void c[0].classList.remove("k-textbox");c.data("type",p),c.attr("type","text"),d&&(d.$formatters=[],d.$parsers=[]),void 0!==l.asDate&&"text"==p&&(p="date");var u=!1,g=l.mask||l.format;g=g?parseMaskType(g,t):parseMaskType(p,t),g.endsWith(";0")&&(u=!0);var m=g.replace(";1","").replace(";0","").trim();if(null!=m&&0!=m.length)if("date"==p||"datetime"==p||"datetime-local"==p||"month"==p||"time"==p||"time-local"==p||"week"==p){var f={format:m,locale:t.use(),showTodayButton:!0,useStrict:!0,tooltips:{today:t.instant("DatePicker.today"),clear:t.instant("DatePicker.clear"),close:t.instant("DatePicker.close"),selectMonth:t.instant("DatePicker.selectMonth"),prevMonth:t.instant("DatePicker.prevMonth"),nextMonth:t.instant("DatePicker.nextMonth"),selectYear:t.instant("DatePicker.selectYear"),prevYear:t.instant("DatePicker.prevYear"),nextYear:t.instant("DatePicker.nextYear"),selectDecade:t.instant("DatePicker.selectDecade"),prevDecade:t.instant("DatePicker.prevDecade"),nextDecade:t.instant("DatePicker.nextDecade"),prevCentury:t.instant("DatePicker.prevCentury"),nextCentury:t.instant("DatePicker.nextCentury")}};"DD/MM/YYYY"!=m&&"MM/DD/YYYY"!=m&&(f.sideBySide=!0);var h="date"==p||"datetime"==p||"time"==p;if(window.fixedTimeZone||(h=!1),c.data("mask",m),c.data("useUTC",h),c.attr("from-grid")){var v=function(){var e=$(this).offset(),t=!0,a=$(this).parent().find(".bootstrap-datetimepicker-widget.dropdown-menu.usetwentyfour.bottom");if(a.length||(t=!1,a=$(this).parent().find(".bootstrap-datetimepicker-widget.dropdown-menu.usetwentyfour.top")),$(a).offset()){var n=$(a).offset().left,i=$("body");a.appendTo(i);var o=0;o=t?e.top+35:e.top-($(a).height()+15),a.css("top",o),a.css("bottom","auto"),a.css("left",n),a.css("z-index",999999)}};if(c.on("click",v),c.on("focus",function(){setTimeout(v.bind(this),100)}),c.on("dp.change",function(){i.safeApply(function(){var e=null;e=h?moment(c.val(),m).utcOffset(window.timeZoneOffset,!0):moment(c.val(),m),("time"==p||"time-local"==p)&&(e=e.year(1970).dayOfYear(1).month(0)),e.isValid()&&d&&s(i,e.toDate())})}),c.data("initial-value")){var b=c.data("initial-value"),y=null;y=h?moment(b).utcOffset(window.timeZoneOffset):moment(b),c.val(y.format(m)),c.data("initial-value",null)}}else c.wrap("<div style=\"position:relative\"></div>");c.datetimepicker(f),"true"!==l.fromGrid&&c.on("dp.change",function(){$(this).is(":visible")&&($(this).trigger("change"),i.safeApply(function(){var e=c.val(),t=null;t=h?moment(e,m).utcOffset(window.timeZoneOffset,!0):moment(e,m),("time"==p||"time-local"==p)&&(t=t.year(1970).dayOfYear(1).month(0)),t.isValid()&&d&&s(i,t.toDate())}))}),d&&(d.$formatters.push(function(e){if(e)return formatWithMomentAs(m,h,e,"string");if(null===e){var t=c.datetimepicker(f).data("DateTimePicker");t.date(null)}return null}),d.$parsers.push(function(e){if(e){if(e instanceof Date)return e;var t=null;return t=h?moment(e,m).utcOffset(window.timeZoneOffset,!0):moment(e,m),("time"==p||"time-local"==p)&&(t=t.year(1970).dayOfYear(1).month(0)),t.toDate()}return null}))}else if("number"==p||"money"==p||"integer"==p||"money-decimal"==p){u=!0;var k=m.trim().replace(/\./g,"").replace(/\,/g,"").replace(/#/g,"").replace(/0/g,"").replace(/9/g,""),w="",S="",C="",D=",",T=0;m.startsWith(k)?w=k:m.endsWith(k)&&(S=k);var x=m.trim().replace(w,"").replace(S,"").trim();x.startsWith("#.")?C=".":x.startsWith("#,")&&(C=",");var M=null;if(-1==x.indexOf(",0")?-1!=x.indexOf(".0")&&(D=".",M=".0"):(D=",",M=",0"),null!=M){var I=x.substring(x.indexOf(M)+1);T=I.length}var E="numeric";0==T&&(E="integer"),"money-decimal"==p&&(E="currency");var F={rightAlign:"money"==p||"money-decimal"==p,unmaskAsNumber:!0,allowMinus:!0,prefix:w,suffix:S,radixPoint:D,digits:T,numericInput:"money-decimal"==p};C&&(F.autoGroup=!0,F.groupSeparator=C),$(o).inputmask(E,F),useInputMaskPlugin(o,d,i,s,m)}else("text"==p||"tel"==p||"string"==p)&&(l.maskPlaceholder?(f={},f.placeholder=l.maskPlaceholder,$(o).inputmask(m,f),u&&useInputMaskPlugin(o,d,i,s,m)):(c.mask(m),useMaskPlugin(o,d,i,s,u)))}}}}}}function useInputMaskPlugin(e,t,a,n,i){var o=$(e),l=function(){$(this).data("rawvalue",$(this).inputmask("unmaskedvalue"))};$(e).on("keydown",l).on("keyup",l),t&&(t.$formatters.push(function(e){return null!=e&&null!=e&&""!==e?format(i,e):null}),t.$parsers.push(function(e){if(e!=null&&null!=e&&""!==e){var t=o.inputmask("unmaskedvalue");if(""!==t)return t}return null}))}function useMaskPlugin(e,t,a,n,i){var o=$(e),l=function(){i&&$(this).data("rawvalue",$(this).cleanVal())};$(e).on("keydown",l).on("keyup",l),i&&t&&(t.$formatters.push(function(e){return e?o.masked(e):null}),t.$parsers.push(function(e){return e?o.cleanVal():null}))}function parseMaskType(e,t){return"datetime"==e||"datetime-local"==e?(e=t.instant("Format.DateTime"),"Format.DateTime"==e&&(e="DD/MM/YYYY HH:mm:ss")):"date"==e?(e=t.instant("Format.Date"),"Format.Date"==e&&(e="DD/MM/YYYY")):"time"==e||"time-local"==e?(e=t.instant("Format.Hour"),"Format.Hour"==e&&(e="HH:mm:ss")):"month"==e?e="MMMM":"number"==e?(e=t.instant("Format.Decimal"),"Format.Decimal"==e&&(e="#.#00,00")):"money"==e||"money-decimal"==e?(e=t.instant("Format.Money"),"Format.Money"==e&&(e="#.#00,00")):"integer"==e?(e=t.instant("Format.Integer"),"Format.Integer"==e&&(e="#,##0.####")):"week"==e?e="dddd":"tel"==e?e="(00) 00000-0000;0":"text"==e?e="":"string"==e&&(e=""),e}function transformText(){return{restrict:"E",require:"?ngModel",link:function(e,t,a,n){var i=function(e,t){if(e){if(t!==void 0&&null!==t){if("uppercase"===e.css("text-transform"))return t.toUpperCase();if("lowercase"===e.css("text-transform"))return t.toLowerCase()}return t}};n&&(n.$formatters.push(function(e){return i(t,e)}),n.$parsers.push(function(e){return i(t,e)}))}}}app.kendoHelper={getCorrectlyDS:(e,t)=>{if(t[e].apiVersion)return t[e];else{let a=t.$parent[e];return t[e]=a,a}},receivePushData:e=>!e||!e.dataSource||(e.dataSource.transport.options.refComponent=e),getSchema:function(e){var t=[{kendoType:"string",entityType:["string","character","uuid","guid"]},{kendoType:"number",entityType:["integer","long","double","int","float","bigdecimal","single","int32","int64","decimal","byte"]},{kendoType:"date",entityType:["date","time","datetime"]},{kendoType:"boolean",entityType:["boolean"]}],a=function(e){for(var a=0;a<t.length;a++)if(t[a].entityType.includes(e.toLocaleLowerCase()))return t[a].kendoType;return"string"},n={model:{id:"__$id",fields:{}}};return e&&e.schemaFields&&(e.schemaFields.forEach(function(e){n.model.fields[e.name]={type:a(e.type),editable:!0,nullable:e.nullable,validation:{required:!e.nullable}}}),n.model.fields.__$id={type:"string",editable:!0,nullable:!0,validation:{required:!1}}),n},getDataSource:function(t,a,n,i,o,l){var d=Number.MAX_SAFE_INTEGER_32;function r(e){for(var t=0;t<e.length;t++)o&&o.forEach(function(a){if("Database"==a.dataType){var n="datetime-local"==a.type||"month"==a.type||"time-local"==a.type||"week"==a.type;n&&e[t][a.field]&&(e[t][a.field]=e[t][a.field].replace(/\d+/,function(e){return parseInt(e)+u}))}})}var s=this.getSchema(t);o&&o.forEach(function(e){for(var t in s.model.fields)if("Database"==e.dataType&&e.field==t){if(s.model.fields[t].nullable=!e.required,s.model.fields[t].validation.required=e.required,"999.999.999-99;0"===e.format||"99.999.999/9999-99;0"===e.format){let a="999.999.999-99;0"===e.format?"cpf":"cnpj",n={cpf:CPF,cnpj:CNPJ},i=t.toLocaleLowerCase()+"validation";s.model.fields[t].validation[i]=function(e){return!(e.is("[name='"+t+"']")&&""!=e.val())||n[a].isValid(e.val())}}break}});var c=function(e){for(var t in e)if(s.model.fields.hasOwnProperty(t)){var a=s.model.fields[t];"string"==a.type&&null!=e[t]?e[t]+="":"number"==a.type&&null!=e[t]?e[t]=parseFloat(e[t]):"date"==a.type&&null!=e[t]?e[t]="/Date("+e[t].getTime()+")/":"boolean"==a.type&&(null==e[t]?e[t]=!1:e[t]="true"==e[t].toString().toLowerCase()),s.model.id==t&&null!=e[t]&&0==e[t].toString().length&&delete e[t]}return e},p=10;app.kendoHelper.getCorrectlyDS(t.name,a)&&(p=app.kendoHelper.getCorrectlyDS(t.name,a).rowsPerPage);var u=6e4*new Date().getTimezoneOffset(),g=app.common.generateId(),m={transport:{setActiveAndPost:function(t){var e=this.options.cronappDatasource;a.safeApply(e.updateActive(c(t.data))),e.active.__sender=g,e.postSilent(function(e){this.options.enableAndSelect(t),t.success(e),this.options.refComponent.dataSource._pristineTotal=this.options.refComponent.dataSource._pristineData.push(e)}.bind(this),function(e){this.options.enableAndSelect(t),t.error(e,e,e)}.bind(this))},pushAction:function(e,t){return a=>{if(this.options.isComponentInDocument(this.options.refComponent)){let n=this.options.getCurrentCallbackForPush(t,this.options.refComponent),i=n[e];i?i(a):(this.options.fromRead="read"===e,this.options.refComponent.dataSource.read())}else["read","memorydelete","overRideRefresh"].includes(e)||this.options.cronappDatasource.removeDataSourceEvents(this.options.dataSourceEventsPush)}},push:function(e){!this.options.dataSourceEventsPush&&this.options.cronappDatasource&&(this.options.dataSourceEventsPush={create:this.pushAction.bind(this)("pushUpdate",e),update:this.pushAction.bind(this)("pushUpdate",e),delete:this.pushAction.bind(this)("pushDestroy",e),overRideRefresh:this.pushAction.bind(this)("overRideRefresh",e),read:this.pushAction.bind(this)("read",e),memorycreate:this.pushAction.bind(this)("pushUpdate",e),memoryupdate:this.pushAction.bind(this)("pushUpdate",e),memorydelete:this.pushAction.bind(this)("pushDestroy",e)},"combobox"==this.origin&&delete this.options.dataSourceEventsPush.overRideRefresh,this.options.cronappDatasource.addDataSourceEvents(this.options.dataSourceEventsPush))},read:function(a){var e=!1;try{var n=this.options.cronappDatasource;this.options.kendoCallback?this.options.fromRead?this.options.kendoCallback.success(n.data):e=!0:(this.options.kendoCallback=a,e=!0)}finally{this.options.fromRead=!1}if(e){for(key in a.data)null==a.data[key]&&delete a.data[key];var i=kendo.data.transports.odata.parameterMap(a.data,"read"),o="";this.options.refComponent&&this.options.refComponent.dataSource.group().forEach(function(e){o+=e.field+" "+e.dir+","}),0<o.length&&(o=o.substr(0,o.length-1),i.$orderby=i.$orderby?o+","+i.$orderby:o);var n=this.options.cronappDatasource;if(n.rowsPerPage=a.data.pageSize,n.offset=a.data.page-1,!a.data.pageSize&&(n.rowsPerPage=d,n.offset=void 0,i.$skip=0,this.options.refComponent&&1!=this.options.refComponent.dataSource.page()))return this.options.refComponent.dataSource.page(1),void a.error("canceled","canceled","canceled");var l=!1;t.append&&(l=t.append);var r={};"button"===n.loadDataStrategy&&0<n.data.length&&(r.origin=n.loadDataStrategy),n.append=l,n.fetch({params:i},{success:function(e){a.success(e)},canceled:function(){a.error("canceled","canceled","canceled")},error:function(){a.error("canceled","canceled","canceled")}},l,r)}},update:function(t){this.setActiveAndPost(t)},create:function(t){this.setActiveAndPost(t)},destroy:function(t){cronappDatasource=this.options.cronappDatasource,cronappDatasource.removeSilent(t.data,function(e){t.success(e)},function(){t.error("canceled","canceled","canceled")})},batch:function(){},options:{fromRead:!1,disableAndSelect:function(t){this.isComponentInDocument(this.refComponent)&&(this.refComponent.select(t.container),this.refComponent.options.selectable=!1,this.refComponent.selectable&&this.refComponent.selectable.element&&(this.refComponent.selectable.destroy(),this.refComponent.selectable=null))},enableAndSelect:function(t){this.isComponentInDocument(this.refComponent)&&(this.refComponent.options.selectable=this.refComponent.options.originalSelectable,this.refComponent._selectable(),this.refComponent.select(t.container))},selectActiveInGrid:function(){if(this.isComponentInDocument(this.refComponent)&&this.refComponent.selectable&&0<this.refComponent.dataItems().length&&this.cronappDatasource.active&&this.cronappDatasource.active.__$id){for(var e=this.refComponent.dataItems(),t=-1,a=0;a<e.length;a++)if(this.cronappDatasource.active.__$id==e[a].__$id){t=a;break}-1<t&&!this.refComponent.selectable.options.multiple&&this.refComponent.select(this.refComponent.table.find("tr")[t])}},isComponentInDocument:function(e){return!!e&&$(document).has(e.element[0]).length},getCurrentCallbackForPush:function(e,t){return e?e:t},cronappDatasource:app.kendoHelper.getCorrectlyDS(t.name,a)}},pageSize:p,serverPaging:!0,serverFiltering:!0,serverSorting:!0,batch:!1,schema:s,requestEnd:function(t){if(t.response&&t.response.d){var e=null;e=t.response.d.results?t.response.d.results:[t.response.d],this.group().length?o.forEach(function(t){if("Database"==t.dataType){var a="datetime-local"==t.type||"month"==t.type||"time-local"==t.type||"week"==t.type;if(a)for(var n,o=0;o<e.length;o++)n=e[o],t.field==n.Member&&(n.Key=n.Key.replace(/\d+/,function(e){return parseInt(e)+u})),r.bind(this)(n.Items)}}):r.bind(this)(e)}}};return m.aggregate=function(e){var t=[];return e&&e.forEach(function(e){e.aggregates&&e.aggregates.forEach(function(a){t.push({field:e.field,aggregate:a.type})})}),t}(o),m.schema.total=function(){return m.transport.options.cronappDatasource.getRowsCount()},l&&(m.group=[],l.forEach(function(e){var t={field:e.field,aggregates:m.aggregate};m.group.push(t)})),m},getEventReadCombo:function(t){var e=this.options.cronappDatasource;if(!e)return void t.error("canceled","canceled","canceled");this.options.kendoCallback||(this.options.kendoCallback=t);var a;if(this.options.combobox&&this.options.combobox.options.readData)return t.success(this.options.combobox.options.readData),this.options.combobox.options.readData=null,void(this.options.alreadyLoaded=!0);this.options.combobox?a=!this.options.alreadyLoaded:e.__ignoreFirstFetch?(a=!0,delete e.__ignoreFirstFetch):a=!1,this.options.alreadyLoaded=!0;var n=!0;if(a&&(n=!1,e.lazy?t.success([{}]):t.success([])),this.options.fromRead&&(this.options.fromRead=!1,this.options.kendoCallback.success(e.data),n=!1),n){for(key in t.data)null==t.data[key]&&delete t.data[key];var i=kendo.data.transports.odata.parameterMap(t.data,"read");e.rowsPerPage=t.data.pageSize,e.offset=t.data.page-1;var o=this,l={};l.params=i,o.options.combobox&&(o.options.combobox.options.fromCombo=!0),e.fetch(l,{success:function(e){if(t.success&&(o.options.combobox&&(o.options.combobox.options.expanded=!0),t.success(e),o.options.kendoCallback=t,o.options&&o.options.combobox&&o.options.combobox.element[0].id)){var a=angular.element($(" .k-animation-container"));o.options.$compile(a)(o.options.scope)}},canceled:function(){o.options.combobox&&(o.options.combobox.options.fromCombo=!1),t.success&&t.error("canceled","canceled","canceled")},error:function(){o.options.combobox&&(o.options.combobox.options.fromCombo=!1),t.success&&t.error("error","error","error")}},!1,{ignoreAtive:!0})}},parseOptionsCronToConfigKendo:function(e,t,a){let n=!1;e.dynamic&&"false"!=e.dynamic?e.dataSourceScreen&&e.dataSourceScreen.entityDataSource&&(e.dataSourceScreen.entityDataSource.append=!0,t=app.kendoHelper.getDataSource(e.dataSourceScreen.entityDataSource,a,!0,e.dataSourceScreen.rowsPerPage),t.transport.read=app.kendoHelper.getEventReadCombo,n=!0):(n=!0,e.dataValueField=e.dataValueField||"value",e.dataTextField=e.dataTextField||"key"),e.dataValueField&&""!=e.dataValueField.trim()||(e.dataValueField=null==e.dataTextField?void 0:e.dataTextField);var i=function(t){var a=e.dataSourceScreen.entityDataSource.schemaFields;for(count=0;count<a.length;count++)if(t==a[count].name){return a[count].type.toLowerCase()}return null};!e.customTemplate&&e.dataSourceScreen&&e.dataSourceScreen.entityDataSource&&e.dataSourceScreen.entityDataSource.schemaFields&&(e.format||function(e){return-1<["date","time","datetime"].indexOf(e)?e:null}(i(e.dataTextField)))&&(e.template="#= useMask("+e.dataTextField+",'"+e.format+"','"+i(e.dataTextField)+"') #",e.valueTemplate="#= useMask("+e.dataTextField+",'"+e.format+"','"+i(e.dataTextField)+"') #");var o={dataTextField:null==e.dataTextField?void 0:e.dataTextField,dataValueField:null==e.dataValueField?void 0:e.dataValueField,dataSource:t,headerTemplate:null==e.headerTemplate?void 0:e.headerTemplate,template:null==e.template?void 0:e.template,placeholder:null==e.placeholder?void 0:e.placeholder,footerTemplate:null==e.footerTemplate?void 0:e.footerTemplate,filter:null==e.filter?void 0:e.filter,valuePrimitive:n,valueTemplate:null==e.valueTemplate?void 0:e.valueTemplate,suggest:!0};return e.optionLabel&&(e.optionLabelText=e.optionLabel,e.optionLabelValue=""),o.optionLabel={},o.optionLabel[o.dataTextField]=void 0===e.optionLabelText?"":e.optionLabelText,o.optionLabel[o.dataValueField]=void 0===e.optionLabelValue?null:e.optionLabelValue,o},getConfigComboboxSync:function(e,t){var a={};if(e){if(!e.dynamic||"false"==e.dynamic){a.data=null==e.staticDataSource?void 0:e.staticDataSource;for(let n=0;n<a.data.length;n++)try{a.data[n].key&&a.data[n].key.startsWith("cronapi.server(")&&(a.data[n].key=a.data[n].key.replace(".run(",".notAsync().run("));let e=t.$eval(a.data[n].key);a.data[n].key=void 0!==e&&null!==e?e:a.data[n].key}catch(t){a.data[n].key=a.data[n].key}}return config=this.parseOptionsCronToConfigKendo(e,a,t),config}return{}},getConfigCombobox:async function(e,t){var a={};if(e){if(!e.dynamic||"false"==e.dynamic){a.data=null==e.staticDataSource?void 0:e.staticDataSource;for(let n=0;n<a.data.length;n++)try{a.data[n].key&&a.data[n].key.startsWith("cronapi.server(")&&(a.data[n].key=a.data[n].key.replace(".run(",".toPromise().run("));let e=await t.$eval(a.data[n].key);a.data[n].key=void 0!==e&&null!==e?e:a.data[n].key}catch(t){a.data[n].key=a.data[n].key}}return config=this.parseOptionsCronToConfigKendo(e,a,t),config}return{}},getConfigDate:function(e,t){var a={};if(a){var n=function(e){e=e.replace(/_/gm,"-");var t=e.split("-");return t[t.length-1]=t[t.length-1].toUpperCase(),t.join("-")},i=function(e){return e&&(e=e.replace(/:MM/gm,":mm"),e=e.replace(/:M/gm,":m"),e=e.replace(/S/gm,"s"),e=e.replace(/D/gm,"d"),e=e.replace(/Y/gm,"y")),e},o=function(t,a){return null==a&&(a=parseMaskType(t,e)),a},l={};if(t.animation)try{l=JSON.parse(t.animation)}catch(e){console.log("DateAnimation invalid configuration! "+e)}var d=o(t.type,t.format),r=i(d),s=i(t.timeFormat),c=n(e.use());a={value:null,format:r,timeFormat:s,momentFormat:d,culture:c,type:null==t.type?void 0:t.type,weekNumber:null==t.weekNumber?void 0:t.weekNumber,dateInput:null==t.dateInput?void 0:t.dateInput,animation:l,footer:null==t.footer?void 0:t.footer,start:null==t.start?void 0:t.start,depth:null==t.start?void 0:t.start}}return a},buildKendoMomentPicker:function(e,t,a,n){var i="date"==t.type||"datetime"==t.type||"time"==t.type;window.fixedTimeZone||(i=!1),e.data("mask",t.momentFormat),e.data("useUTC",i);var o=function(){var a=e.val();if(!a||""==a.trim())n&&n.$setViewValue("");else{var o=formatWithMomentAs(t.momentFormat,i,a,"date");n&&(n.$setViewValue(o),e.data("changed",!0))}};return(t.change=a?function(){a.$apply(function(){o()})}:o,"date"==t.type)?e.kendoDatePicker(t).data("kendoDatePicker"):"datetime"==t.type||"datetime-local"==t.type?e.kendoDateTimePicker(t).data("kendoDateTimePicker"):"time"==t.type||"time-local"==t.type?e.kendoTimePicker(t).data("kendoTimePicker"):void 0},getConfigSlider:function(e){e=e||{};var t={increaseButtonTitle:e.increaseButtonTitle,decreaseButtonTitle:e.decreaseButtonTitle,dragHandleTitle:e.dragHandleTitle};try{t.min=e.min?parseInt(e.min):1,t.max=e.max?parseInt(e.max):1,t.smallStep=e.smallStep?parseInt(e.smallStep):1,t.largeStep=e.largeStep?parseInt(e.largeStep):1}catch(e){console.log("Slider invalid configuration! "+e)}return t},getConfigSwitch:function(e){e=e||{};var t={onLabel:null==e.onLabel?void 0:e.onLabel,offLabel:null==e.offLabel?void 0:e.offLabel};return t},getConfigBarcode:function(e){var t={type:null==e.type?void 0:e.type,width:null==e.width?void 0:parseInt(e.width),height:null==e.height?void 0:parseInt(e.height)};return t.type||(t.type="EAN8"),t},getConfigQrcode:function(e){var t={errorCorrection:null==e.errorCorrection?void 0:e.errorCorrection,size:null==e.size?void 0:parseInt(e.size),color:null==e.color?void 0:e.color};return(e.borderColor||e.borderSize)&&(t.border={size:null==e.size?void 0:parseInt(e.size),color:null==e.color?void 0:e.color}),t}},window.showTreatedValue=function(e){return e||!1===e?e:""},window.useMask=function(e,t,a){var n="";t="null"==t||"undefined"==t?void 0:t;var i=e,o=t||a;if(null!=e&&e!=null){if(e instanceof Date){var l=moment(e).utcOffset(window.timeZoneOffset);i="\""+l.format()+"\""}else i="number"==typeof e?e:"\""+e+"\"";n="{{ "+i+" | mask:\""+o+"\":\""+a+"\"}}"}return n},window.formatWithMomentAs=function(e,t,a,n){if(!a)return;let i=null;return i=a instanceof Date||a.startsWith("/Date")?t?moment(a).utcOffset(window.timeZoneOffset):moment(a):t?moment(a,e).utcOffset(window.timeZoneOffset,!0):moment(a,e),"string"===n?i.format(e):i.toDate()};