@syncfusion/ej2-inputs 27.2.4 → 28.1.33

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 (194) hide show
  1. package/README.md +2 -2
  2. package/dist/ej2-inputs.min.js +3 -3
  3. package/dist/ej2-inputs.umd.min.js +3 -3
  4. package/dist/ej2-inputs.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-inputs.es2015.js +61 -64
  6. package/dist/es6/ej2-inputs.es2015.js.map +1 -1
  7. package/dist/es6/ej2-inputs.es5.js +62 -65
  8. package/dist/es6/ej2-inputs.es5.js.map +1 -1
  9. package/dist/global/ej2-inputs.min.js +3 -3
  10. package/dist/global/ej2-inputs.min.js.map +1 -1
  11. package/dist/global/index.d.ts +2 -2
  12. package/package.json +10 -10
  13. package/src/common/signature-base.js +21 -11
  14. package/src/numerictextbox/numerictextbox.js +1 -1
  15. package/src/otp-input/otp-input.js +35 -49
  16. package/src/slider/slider.d.ts +1 -0
  17. package/src/slider/slider.js +5 -4
  18. package/styles/bds-lite.css +5293 -0
  19. package/styles/bds-lite.scss +37 -0
  20. package/styles/bds.css +8139 -0
  21. package/styles/bds.scss +46 -0
  22. package/styles/bootstrap-dark-lite.css +4 -0
  23. package/styles/bootstrap-dark.css +4 -0
  24. package/styles/bootstrap-lite.css +4 -0
  25. package/styles/bootstrap.css +4 -0
  26. package/styles/bootstrap4-lite.css +4 -1
  27. package/styles/bootstrap4.css +4 -1
  28. package/styles/bootstrap5-dark-lite.css +7 -4
  29. package/styles/bootstrap5-dark.css +7 -4
  30. package/styles/bootstrap5-lite.css +5 -2
  31. package/styles/bootstrap5.3-lite.css +4 -1
  32. package/styles/bootstrap5.3.css +4 -1
  33. package/styles/bootstrap5.css +5 -2
  34. package/styles/color-picker/_bigger.scss +46 -7
  35. package/styles/color-picker/_layout.scss +41 -3
  36. package/styles/color-picker/_tailwind3-definition.scss +152 -0
  37. package/styles/color-picker/_theme.scss +13 -2
  38. package/styles/color-picker/bds.css +1080 -0
  39. package/styles/color-picker/bds.scss +12 -0
  40. package/styles/color-picker/bootstrap-dark.css +3 -0
  41. package/styles/color-picker/bootstrap.css +3 -0
  42. package/styles/color-picker/bootstrap4.css +3 -0
  43. package/styles/color-picker/bootstrap5-dark.css +3 -0
  44. package/styles/color-picker/bootstrap5.3.css +3 -0
  45. package/styles/color-picker/bootstrap5.css +3 -0
  46. package/styles/color-picker/fabric-dark.css +3 -0
  47. package/styles/color-picker/fabric.css +3 -0
  48. package/styles/color-picker/fluent-dark.css +3 -0
  49. package/styles/color-picker/fluent.css +3 -0
  50. package/styles/color-picker/fluent2.css +3 -0
  51. package/styles/color-picker/highcontrast-light.css +3 -0
  52. package/styles/color-picker/highcontrast.css +3 -0
  53. package/styles/color-picker/icons/_tailwind3.scss +9 -0
  54. package/styles/color-picker/material-dark.css +3 -0
  55. package/styles/color-picker/material.css +3 -0
  56. package/styles/color-picker/material3-dark.css +3 -0
  57. package/styles/color-picker/material3.css +3 -0
  58. package/styles/color-picker/tailwind-dark.css +3 -0
  59. package/styles/color-picker/tailwind.css +3 -0
  60. package/styles/color-picker/tailwind3.css +880 -0
  61. package/styles/color-picker/tailwind3.scss +12 -0
  62. package/styles/data-form/_tailwind3-definition.scss +41 -0
  63. package/styles/data-form/bds.css +236 -0
  64. package/styles/data-form/bds.scss +3 -0
  65. package/styles/data-form/tailwind3.css +236 -0
  66. package/styles/data-form/tailwind3.scss +3 -0
  67. package/styles/fabric-dark-lite.css +4 -0
  68. package/styles/fabric-dark.css +4 -0
  69. package/styles/fabric-lite.css +4 -0
  70. package/styles/fabric.css +4 -0
  71. package/styles/fluent-dark-lite.css +8 -5
  72. package/styles/fluent-dark.css +8 -5
  73. package/styles/fluent-lite.css +6 -3
  74. package/styles/fluent.css +6 -3
  75. package/styles/fluent2-lite.css +10 -6
  76. package/styles/fluent2.css +11 -7
  77. package/styles/highcontrast-light-lite.css +3 -0
  78. package/styles/highcontrast-light.css +3 -0
  79. package/styles/highcontrast-lite.css +3 -0
  80. package/styles/highcontrast.css +3 -0
  81. package/styles/input/_bigger.scss +127 -120
  82. package/styles/input/_layout.scss +143 -121
  83. package/styles/input/_tailwind3-definition.scss +511 -0
  84. package/styles/input/_theme.scss +67 -40
  85. package/styles/input/bds.css +4537 -0
  86. package/styles/input/bds.scss +5 -0
  87. package/styles/input/fluent2.css +2 -2
  88. package/styles/input/icons/_tailwind3.scss +17 -0
  89. package/styles/input/tailwind-dark.css +2 -0
  90. package/styles/input/tailwind.css +2 -0
  91. package/styles/input/tailwind3.css +8925 -0
  92. package/styles/input/tailwind3.scss +5 -0
  93. package/styles/maskedtextbox/_tailwind3-definition.scss +7 -0
  94. package/styles/maskedtextbox/bds.css +180 -0
  95. package/styles/maskedtextbox/bds.scss +5 -0
  96. package/styles/maskedtextbox/fluent2.css +1 -1
  97. package/styles/maskedtextbox/tailwind3.css +47 -0
  98. package/styles/maskedtextbox/tailwind3.scss +5 -0
  99. package/styles/material-dark-lite.css +4 -0
  100. package/styles/material-dark.css +4 -0
  101. package/styles/material-lite.css +4 -0
  102. package/styles/material.css +4 -0
  103. package/styles/material3-dark-lite.css +8 -4
  104. package/styles/material3-dark.css +8 -4
  105. package/styles/material3-lite.css +8 -4
  106. package/styles/material3.css +8 -4
  107. package/styles/numerictextbox/_tailwind3-definition.scss +3 -0
  108. package/styles/numerictextbox/bds.css +197 -0
  109. package/styles/numerictextbox/bds.scss +6 -0
  110. package/styles/numerictextbox/icons/_tailwind3.scss +11 -0
  111. package/styles/numerictextbox/tailwind3.css +64 -0
  112. package/styles/numerictextbox/tailwind3.scss +6 -0
  113. package/styles/otp-input/_tailwind3-definition.scss +59 -0
  114. package/styles/otp-input/bds.css +230 -0
  115. package/styles/otp-input/bds.scss +4 -0
  116. package/styles/otp-input/tailwind3.css +230 -0
  117. package/styles/otp-input/tailwind3.scss +4 -0
  118. package/styles/rating/_tailwind3-definition.scss +47 -0
  119. package/styles/rating/bds.css +323 -0
  120. package/styles/rating/bds.scss +5 -0
  121. package/styles/rating/tailwind3.css +319 -0
  122. package/styles/rating/tailwind3.scss +5 -0
  123. package/styles/signature/_layout.scss +4 -0
  124. package/styles/signature/_tailwind3-definition.scss +3 -0
  125. package/styles/signature/bds.css +13 -0
  126. package/styles/signature/bds.scss +3 -0
  127. package/styles/signature/tailwind3.css +16 -0
  128. package/styles/signature/tailwind3.scss +3 -0
  129. package/styles/slider/_layout.scss +29 -15
  130. package/styles/slider/_tailwind3-definition.scss +92 -0
  131. package/styles/slider/_theme.scss +4 -2
  132. package/styles/slider/bds.css +620 -0
  133. package/styles/slider/bds.scss +6 -0
  134. package/styles/slider/bootstrap-dark.css +1 -0
  135. package/styles/slider/bootstrap.css +1 -0
  136. package/styles/slider/bootstrap4.css +1 -1
  137. package/styles/slider/bootstrap5.3.css +1 -1
  138. package/styles/slider/fabric-dark.css +1 -0
  139. package/styles/slider/fabric.css +1 -0
  140. package/styles/slider/fluent-dark.css +1 -1
  141. package/styles/slider/fluent.css +1 -1
  142. package/styles/slider/fluent2.css +3 -2
  143. package/styles/slider/material-dark.css +1 -0
  144. package/styles/slider/material.css +1 -0
  145. package/styles/slider/material3-dark.css +1 -0
  146. package/styles/slider/material3.css +1 -0
  147. package/styles/slider/tailwind3.css +442 -0
  148. package/styles/slider/tailwind3.scss +6 -0
  149. package/styles/smart-textarea/_bootstrap5-definition.scss +3 -3
  150. package/styles/smart-textarea/_fluent-definition.scss +3 -3
  151. package/styles/smart-textarea/_material3-definition.scss +3 -3
  152. package/styles/smart-textarea/_tailwind-definition.scss +3 -3
  153. package/styles/smart-textarea/_tailwind3-definition.scss +3 -0
  154. package/styles/smart-textarea/_theme.scss +2 -29
  155. package/styles/smart-textarea/bds.css +67 -0
  156. package/styles/smart-textarea/bds.scss +4 -0
  157. package/styles/smart-textarea/bootstrap5-dark.css +4 -4
  158. package/styles/smart-textarea/bootstrap5.css +2 -2
  159. package/styles/smart-textarea/fluent-dark.css +4 -4
  160. package/styles/smart-textarea/fluent.css +2 -2
  161. package/styles/smart-textarea/material3-dark.css +4 -4
  162. package/styles/smart-textarea/material3.css +4 -4
  163. package/styles/smart-textarea/tailwind-dark.css +4 -4
  164. package/styles/smart-textarea/tailwind.css +2 -2
  165. package/styles/smart-textarea/tailwind3.css +67 -0
  166. package/styles/smart-textarea/tailwind3.scss +4 -0
  167. package/styles/tailwind-dark-lite.css +9 -4
  168. package/styles/tailwind-dark.css +9 -4
  169. package/styles/tailwind-lite.css +7 -2
  170. package/styles/tailwind.css +7 -2
  171. package/styles/tailwind3-lite.css +7247 -0
  172. package/styles/tailwind3-lite.scss +37 -0
  173. package/styles/tailwind3.css +12253 -0
  174. package/styles/tailwind3.scss +46 -0
  175. package/styles/textarea/_tailwind3-definition.scss +1 -0
  176. package/styles/textarea/bds.css +183 -0
  177. package/styles/textarea/bds.scss +5 -0
  178. package/styles/textarea/tailwind3.css +50 -0
  179. package/styles/textarea/tailwind3.scss +5 -0
  180. package/styles/textbox/_tailwind3-definition.scss +4 -0
  181. package/styles/textbox/bds.css +177 -0
  182. package/styles/textbox/bds.scss +5 -0
  183. package/styles/textbox/tailwind3.css +44 -0
  184. package/styles/textbox/tailwind3.scss +5 -0
  185. package/styles/uploader/_bigger.scss +3 -0
  186. package/styles/uploader/_layout.scss +4 -0
  187. package/styles/uploader/_tailwind3-definition.scss +211 -0
  188. package/styles/uploader/_theme.scss +21 -0
  189. package/styles/uploader/bds.css +1124 -0
  190. package/styles/uploader/bds.scss +7 -0
  191. package/styles/uploader/fluent2.css +2 -2
  192. package/styles/uploader/icons/_tailwind3.scss +34 -0
  193. package/styles/uploader/tailwind3.css +1037 -0
  194. package/styles/uploader/tailwind3.scss +7 -0
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * filename: ej2-inputs.umd.min.js
3
- * version : 27.2.4
4
- * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
3
+ * version : 28.1.33
4
+ * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
7
7
  * licensing@syncfusion.com. Any infringement will be prosecuted under
8
8
  * applicable laws.
9
9
  */
10
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-splitbuttons")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-splitbuttons"],e):e((t=t||self).ej={},t.ej2Base,t.ej2Popups,t.ej2Splitbuttons)}(this,function(o,C,h,I){"use strict";var n,V,u={RTL:"e-rtl",DISABLE:"e-disabled",INPUT:"e-input",TEXTAREA:"e-multi-line-input",INPUTGROUP:"e-input-group",FLOATINPUT:"e-float-input",FLOATLINE:"e-float-line",FLOATTEXT:"e-float-text",FLOATTEXTCONTENT:"e-float-text-content",CLEARICON:"e-clear-icon",CLEARICONHIDE:"e-clear-icon-hide",LABELTOP:"e-label-top",LABELBOTTOM:"e-label-bottom",NOFLOATLABEL:"e-no-float-label",INPUTCUSTOMTAG:"e-input-custom-tag",FLOATCUSTOMTAG:"e-float-custom-tag"},F=["title","style","class"],M="e-input-focus";function D(i){z(i.floatLabelType,i.element);function t(){var t,e;((e=J((t=i).element)).classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.add("e-input-focus"),"Never"!==t.floatLabelType&&setTimeout(function(){n.calculateWidth(t.element,e)},80)}function e(){var t,e;((e=J((t=i).element)).classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.remove("e-input-focus"),"Never"!==t.floatLabelType&&setTimeout(function(){n.calculateWidth(t.element,e)},80)}function s(){z(i.floatLabelType,i.element)}i.element.addEventListener("focus",t),i.element.addEventListener("blur",e),i.element.addEventListener("input",s),i.element.__eventHandlers.inputFocusHandler={focusHandler:t},i.element.__eventHandlers.inputBlurHandler={blurHandler:e},i.element.__eventHandlers.inputHandler={inputHandler:s}}function z(t,e){var i=e.value,e=e.parentElement,s=e&&e.parentElement;""===i||C.isNullOrUndefined(i)?"Always"!==t&&(e&&e.classList.contains("e-input-group")?e.classList.remove("e-valid-input"):s&&s.classList.contains("e-input-group")&&s.classList.remove("e-valid-input")):e&&e.classList.contains("e-input-group")?e.classList.add("e-valid-input"):s&&s.classList.contains("e-input-group")&&s.classList.add("e-valid-input")}function W(){var t=J(this).getElementsByClassName("e-float-text")[0];C.isNullOrUndefined(t)||(C.addClass([t],u.LABELTOP),t.classList.contains(u.LABELBOTTOM)&&C.removeClass([t],u.LABELBOTTOM))}function q(){var t=J(this);(t.getElementsByTagName("textarea")[0]?""===t.getElementsByTagName("textarea")[0].value:""===t.getElementsByTagName("input")[0].value)&&(t=t.getElementsByClassName("e-float-text")[0],C.isNullOrUndefined(t)||(t.classList.contains(u.LABELTOP)&&C.removeClass([t],u.LABELTOP),C.addClass([t],u.LABELBOTTOM)))}function j(t){t.addEventListener("focus",W),t.addEventListener("blur",q)}function _(t){C.isNullOrUndefined(t)||(t.removeEventListener("focus",W),t.removeEventListener("blur",q))}function X(t,e,i){var s,i=C.isNullOrUndefined(i)?C.createElement:i,n=("Auto"===t.floatLabelType&&j(t.element),C.isNullOrUndefined(e.container)?(e.container=tt(t,u.FLOATINPUT,u.FLOATCUSTOMTAG,"div",i),e.container.classList.add(u.INPUTGROUP),t.element.parentNode&&t.element.parentNode.insertBefore(e.container,t.element)):(C.isNullOrUndefined(t.customTag)||e.container.classList.add(u.FLOATCUSTOMTAG),e.container.classList.add(u.FLOATINPUT)),i("span",{className:u.FLOATLINE})),i=i("label",{className:u.FLOATTEXT});C.isNullOrUndefined(t.element.id)||""===t.element.id||(i.id="label_"+t.element.id.replace(/ /g,"_"),C.attributes(t.element,{"aria-labelledby":i.id})),C.isNullOrUndefined(t.element.placeholder)||""===t.element.placeholder||(i.innerText=et(t.element.placeholder),t.element.removeAttribute("placeholder")),C.isNullOrUndefined(t.properties)||C.isNullOrUndefined(t.properties.placeholder)||""===t.properties.placeholder||(i.innerText=et(t.properties.placeholder)),i.innerText||e.container.classList.add(u.NOFLOATLABEL),(e.container.classList.contains("e-float-icon-left")?((s=e.container.querySelector(".e-input-in-wrap")).appendChild(t.element),s.appendChild(n),s):(e.container.appendChild(t.element),e.container.appendChild(n),e.container)).appendChild(i),G(t.element.value,i),"Always"===t.floatLabelType&&(i.classList.contains(u.LABELBOTTOM)&&C.removeClass([i],u.LABELBOTTOM),C.addClass([i],u.LABELTOP)),"Auto"===t.floatLabelType?(s=function(){Q(t.element,t.floatLabelType)},t.element.addEventListener("input",n=function(){Q(t.element,t.floatLabelType)}),t.element.addEventListener("blur",s),t.element.__eventHandlers.floatInputHandler={inputFloatHandler:n},t.element.__eventHandlers.floatBlurHandler={blurFloatHandler:s}):K(t),C.isNullOrUndefined(t.element.getAttribute("id"))||i.setAttribute("for",t.element.getAttribute("id"))}function K(t){var e,i;C.isNullOrUndefined(t.element)||C.isNullOrUndefined(t.element.__eventHandlers)||C.isNullOrUndefined(t.element.__eventHandlers.floatInputHandler)||C.isNullOrUndefined(t.element.__eventHandlers.floatBlurHandler)||(e=t.element.__eventHandlers.floatInputHandler.inputFloatHandler,i=t.element.__eventHandlers.floatBlurHandler.blurFloatHandler,t.element.removeEventListener("input",e),t.element.removeEventListener("blur",i),delete t.element.__eventHandlers.floatInputHandler,delete t.element.__eventHandlers.floatBlurHandler)}function Y(t,e){"Always"===t&&e.classList.contains("e-outline")&&e.classList.add("e-valid-input")}function Z(t,e,i){C.isNullOrUndefined(e)||(t&&!i?C.removeClass([e],u.CLEARICONHIDE):C.addClass([e],u.CLEARICONHIDE))}function G(t,e,i){void 0===i&&(i=null),t?(C.addClass([e],u.LABELTOP),e.classList.contains(u.LABELBOTTOM)&&C.removeClass([e],u.LABELBOTTOM)):null!=i&&i===document.activeElement||(e.classList.contains(u.LABELTOP)&&C.removeClass([e],u.LABELTOP),C.addClass([e],u.LABELBOTTOM))}function J(t){t=C.isNullOrUndefined(t.parentNode)?t:t.parentNode;return t=t&&t.classList.contains("e-input-in-wrap")?t.parentNode:t}function $(s,n,t){function e(){Z(s.value,n)}function i(){Z(s.value,n,s.readOnly)}function a(){var t,e;t=s,e=n,setTimeout(function(){C.isNullOrUndefined(e)||(C.addClass([e],u.CLEARICONHIDE),e=!C.isNullOrUndefined(t)&&t.classList.contains("e-combobox")?null:e)},200)}var r;void 0!==V&&!V||(n.addEventListener("click",r=function(t){var e,i;t=t,i=n,(e=s).classList.contains(u.DISABLE)||e.readOnly||(t.preventDefault(),e!==document.activeElement&&e.focus(),e.value="",C.addClass([i],u.CLEARICONHIDE))}),s.__eventHandlers.clearClickHandler={clickHandlerEvent:r});s.addEventListener("input",e),s.addEventListener("focus",i),s.addEventListener("blur",a),s.__eventHandlers.clearInputHandler={inputHandlerEvent:e},s.__eventHandlers.clearFocusHandler={focusHandlerEvent:i},s.__eventHandlers.clearBlurHandler={blurHandlerEvent:a}}function Q(t,e){J(t).classList.contains(u.FLOATINPUT)&&"Auto"===e&&(e=J(t).getElementsByClassName("e-float-text")[0],G(t.value,e,t))}function tt(t,e,i,s,n){var a,n=C.isNullOrUndefined(n)?C.createElement:n;return C.isNullOrUndefined(t.customTag)?a=n(s,{className:e}):(a=n(t.customTag,{className:e})).classList.add(i),a.classList.add("e-control-wrapper"),a}function et(t){var e,i="";return C.isNullOrUndefined(t)||""===t||((e=document.createElement("span")).innerHTML='<input placeholder="'+t+'"/>',i=e.children[0].placeholder),i}function it(t,e,i){C.isNullOrUndefined(i)||""===i||C.removeClass(e,i.split(" ")),C.isNullOrUndefined(t)||""===t||C.addClass(e,t.split(" "))}function st(t,e,i){("multiselect"===i||function(t){if(!t)return;var e=t;for(;e&&e!==document.body;){if("none"===window.getComputedStyle(e).display)return;e=e.parentElement}return 1}(t))&&(i="multiselect"===i?t:t.clientWidth-parseInt(getComputedStyle(t,null).getPropertyValue("padding-left"),10),!C.isNullOrUndefined(e))&&!C.isNullOrUndefined(e.getElementsByClassName("e-float-text-content")[0])&&(e.getElementsByClassName("e-float-text-content")[0].classList.contains("e-float-text-overflow")&&e.getElementsByClassName("e-float-text-content")[0].classList.remove("e-float-text-overflow"),i<e.getElementsByClassName("e-float-text-content")[0].clientWidth||i===e.getElementsByClassName("e-float-text-content")[0].clientWidth)&&e.getElementsByClassName("e-float-text-content")[0].classList.add("e-float-text-overflow")}function nt(t,e){t=et(t);var i,s=J(e);s.classList.contains(u.FLOATINPUT)?C.isNullOrUndefined(t)||""===t?(s.classList.add(u.NOFLOATLABEL),(i=s.getElementsByClassName("e-float-text-content")[0])?i.children[0].textContent="":s.getElementsByClassName(u.FLOATTEXT)[0].textContent=""):((i=s.getElementsByClassName("e-float-text-content")[0])&&i.children[0]?i.children[0].textContent=t:s.getElementsByClassName(u.FLOATTEXT)[0].textContent=t,s.classList.remove(u.NOFLOATLABEL),e.removeAttribute("placeholder")):C.isNullOrUndefined(t)||""===t?e.removeAttribute("placeholder"):C.attributes(e,{placeholder:t})}function at(t,e,i){t?C.attributes(e,{readonly:""}):e.removeAttribute("readonly"),C.isNullOrUndefined(i)||Q(e,i)}function rt(t,e){t?C.addClass(e,u.RTL):C.removeClass(e,u.RTL)}function lt(t,e,i,s){var n={disabled:"","aria-disabled":"true"},a=!C.isNullOrUndefined(s);t?(e.classList.remove(u.DISABLE),ht(n,e),a&&C.removeClass([s],u.DISABLE)):(e.classList.add(u.DISABLE),ut(n,e),a&&C.addClass([s],u.DISABLE)),C.isNullOrUndefined(i)||Q(e,i)}function ot(t,e,i,s,n){var a,n=C.isNullOrUndefined(n)?C.createElement:n;t?i.clearButton=(t=e,e=i,s=s,n=n,n=(C.isNullOrUndefined(n)?C.createElement:n)("span",{className:u.CLEARICON}),a=e.container,C.isNullOrUndefined(s)?(e.container.classList.contains(u.FLOATINPUT)?e.container.querySelector("."+u.FLOATTEXT):t).insertAdjacentElement("afterend",n):a.appendChild(n),C.addClass([n],u.CLEARICONHIDE),$(t,n),n.setAttribute("aria-label","close"),n):(C.remove(i.clearButton),i.clearButton=null)}function ht(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],a=J(e);"disabled"===n&&e.classList.remove(u.DISABLE),"disabled"===n&&a.classList.contains(u.INPUTGROUP)&&a.classList.remove(u.DISABLE),"placeholder"===n&&a.classList.contains(u.FLOATINPUT)?a.getElementsByClassName(u.FLOATTEXT)[0].textContent="":e.removeAttribute(n)}}function ut(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],a=J(e);"disabled"===n&&e.classList.add(u.DISABLE),"disabled"===n&&a.classList.contains(u.INPUTGROUP)&&a.classList.add(u.DISABLE),"placeholder"===n&&a.classList.contains(u.FLOATINPUT)?a.getElementsByClassName(u.FLOATTEXT)[0].textContent=t[""+n]:e.setAttribute(n,t[""+n])}}function pt(t,e){t.classList.contains("e-outline")&&t.getElementsByClassName("e-float-text")[0]&&((e=e("span",{className:u.FLOATTEXTCONTENT})).innerHTML=t.getElementsByClassName("e-float-text")[0].innerHTML,t.getElementsByClassName("e-float-text")[0].innerHTML="",t.getElementsByClassName("e-float-text")[0].appendChild(e))}function dt(t,e,i){var s=[],n=(s.push(i),C.isNullOrUndefined(i)?e.querySelectorAll(".e-input-group-icon"):s);if(t&&0<n.length)for(var a=0;a<n.length;a++)n[parseInt(a.toString(),10)].addEventListener("mousedown",ct,!1),n[parseInt(a.toString(),10)].addEventListener("mouseup",mt,!1);else if(0<n.length)for(a=0;a<n.length;a++)n[parseInt(a.toString(),10)].removeEventListener("mousedown",ct,this),n[parseInt(a.toString(),10)].removeEventListener("mouseup",mt,this)}function ct(){for(var t,e,i=this.parentElement;!i.classList.contains("e-input-group");)i=i.parentElement;e=this,(t=i).classList.contains("e-disabled")||t.querySelector("input").readOnly||e.classList.add("e-input-btn-ripple")}function mt(){var t=this;setTimeout(function(){t.classList.remove("e-input-btn-ripple")},500)}function vt(t,e){e=e("span",{className:t});return e.classList.add("e-input-group-icon"),e}function ft(t,e,i,s){var s=C.isNullOrUndefined(s)?C.createElement:s,t=vt(t,s),n=(e.classList.add("e-float-icon-left"),e.querySelector(".e-input-in-wrap"));if(C.isNullOrUndefined(n)){n=s("span",{className:"e-input-in-wrap"}),i.parentNode.insertBefore(n,i);var a=e.querySelectorAll(i.tagName+" ~ *");n.appendChild(i);for(var r=0;r<a.length;r++){var l=a[parseInt(r.toString(),10)],o=n.parentElement;l.classList.contains("e-float-line")&&(o&&o.classList.contains("e-filled")||!o)||n.appendChild(l)}}return n.parentNode.insertBefore(t,n),dt(!0,e,t),t}function gt(t,e,i){t=vt(t,C.isNullOrUndefined(i)?C.createElement:i);return(e.classList.contains("e-float-icon-left")?e.querySelector(".e-input-in-wrap"):e).appendChild(t),dt(!0,e,t),t}function yt(t,e){"hidden"===e.type?t.classList.add("e-hidden"):t.classList.contains("e-hidden")&&t.classList.remove("e-hidden")}function bt(t){var e=t;return e=C.isNullOrUndefined(t)||""===t?e:t.replace(/\s+/g," ").trim()}n=o.Input||(o.Input={}),V=!0,n.createInput=function(t,e){t.element.__eventHandlers={};var i=C.isNullOrUndefined(e)?C.createElement:e,s={container:null,buttons:[],clearButton:null};if(t.floatLabelType,V=t.bindClearAction,C.isNullOrUndefined(t.floatLabelType)||"Never"===t.floatLabelType?(s.container=tt(t,u.INPUTGROUP,u.INPUTCUSTOMTAG,"span",i),t.element.parentNode.insertBefore(s.container,t.element),C.addClass([t.element],u.INPUT),s.container.appendChild(t.element)):X(t,s,i),D(t),C.isNullOrUndefined(t.properties)||C.isNullOrUndefined(t.properties.showClearButton)||!t.properties.showClearButton||(ot(t.properties.showClearButton,t.element,s,!0,i),s.clearButton.setAttribute("role","button"),s.container.classList.contains(u.FLOATINPUT)&&C.addClass([s.container],u.INPUTGROUP)),!C.isNullOrUndefined(t.buttons))for(var n=0;n<t.buttons.length;n++)s.buttons.push(gt(t.buttons[n],s.container,i));return C.isNullOrUndefined(t.element)||"TEXTAREA"!==t.element.tagName||C.addClass([s.container],u.TEXTAREA),yt(s.container,t.element),pt((s=function(t,e){if(!C.isNullOrUndefined(t.properties))for(var i=0,s=Object.keys(t.properties);i<s.length;i++)switch(s[i]){case"cssClass":it(t.properties.cssClass,[e.container]),Y(t.floatLabelType,e.container);break;case"enabled":lt(t.properties.enabled,t.element,t.floatLabelType,e.container);break;case"enableRtl":rt(t.properties.enableRtl,[e.container]);break;case"placeholder":nt(t.properties.placeholder,t.element);break;case"readonly":at(t.properties.readonly,t.element)}return e}(t,s)).container,i),s},n.bindInitialEvent=D,n.wireFloatingEvents=j,n.wireClearBtnEvents=$,n.destroy=function(t,e){var i,s,n,a,r;void 0===e&&(e=null),i=t,C.isNullOrUndefined(i.element)||C.isNullOrUndefined(i.element.__eventHandlers)||C.isNullOrUndefined(i.element.__eventHandlers.inputFocusHandler)||C.isNullOrUndefined(i.element.__eventHandlers.inputBlurHandler)||C.isNullOrUndefined(i.element.__eventHandlers.inputHandler)||(s=i.element.__eventHandlers.inputFocusHandler.focusHandler,n=i.element.__eventHandlers.inputBlurHandler.blurHandler,r=i.element.__eventHandlers.inputHandler.inputHandler,i.element.removeEventListener("focus",s),i.element.removeEventListener("blur",n),i.element.removeEventListener("input",r),delete i.element.__eventHandlers.inputFocusHandler,delete i.element.__eventHandlers.inputBlurHandler,delete i.element.__eventHandlers.inputHandler),"Auto"===t.floatLabelType&&K(t),t.properties.showClearButton&&(s=t.element,n=e,C.isNullOrUndefined(s)||C.isNullOrUndefined(s.__eventHandlers)||(C.isNullOrUndefined(s.__eventHandlers.clearClickHandler)||(a=s.__eventHandlers.clearClickHandler.clickHandlerEvent,void 0!==V&&!V||C.isNullOrUndefined(n)||n.removeEventListener("click",a),delete s.__eventHandlers.clearClickHandler),C.isNullOrUndefined(s.__eventHandlers.clearInputHandler))||C.isNullOrUndefined(s.__eventHandlers.clearFocusHandler)||C.isNullOrUndefined(s.__eventHandlers.clearBlurHandler)||(n=s.__eventHandlers.clearInputHandler.inputHandlerEvent,a=s.__eventHandlers.clearFocusHandler.focusHandlerEvent,r=s.__eventHandlers.clearBlurHandler.blurHandlerEvent,s.removeEventListener("input",n),s.removeEventListener("focus",a),s.removeEventListener("blur",r),delete s.__eventHandlers.clearInputHandler,delete s.__eventHandlers.clearFocusHandler,delete s.__eventHandlers.clearBlurHandler)),C.isNullOrUndefined(t.buttons)||dt(!1,null,t.buttons),_(t.element),C.isNullOrUndefined(t.element)||(delete t.element.__eventHandlers,t.element.classList.contains(u.INPUT)&&t.element.classList.remove(u.INPUT))},n.setValue=function(t,e,i,s){e.value=t,"Never"!==i&&st(e,e.parentElement),C.isNullOrUndefined(i)||"Auto"!==i||Q(e,i),!C.isNullOrUndefined(s)&&s&&(t=J(e),C.isNullOrUndefined(t)||(s=t.getElementsByClassName(u.CLEARICON)[0],C.isNullOrUndefined(s))||(e.value&&!C.isNullOrUndefined(t)&&t.classList.contains("e-input-focus")?C.removeClass([s],u.CLEARICONHIDE):C.addClass([s],u.CLEARICONHIDE))),z(i,e)},n.setCssClass=it,n.calculateWidth=st,n.setWidth=function(t,e){"number"==typeof t?e.style.width=C.formatUnit(t):"string"==typeof t&&(e.style.width=t.match(/px|%|em/)?t:C.formatUnit(t)),st(e.firstChild,e)},n.setPlaceholder=nt,n.setReadonly=at,n.setEnableRtl=rt,n.setEnabled=lt,n.setClearButton=ot,n.removeAttributes=ht,n.addAttributes=ut,n.removeFloating=function(t){var e,i,s,t=t.container;!C.isNullOrUndefined(t)&&t.classList.contains(u.FLOATINPUT)&&(e=t.querySelector("textarea")?t.querySelector("textarea"):t.querySelector("input"),i=t.querySelector("."+u.FLOATTEXT).textContent,s=null!==t.querySelector(".e-clear-icon"),C.detach(t.querySelector("."+u.FLOATLINE)),C.detach(t.querySelector("."+u.FLOATTEXT)),C.classList(t,[u.INPUTGROUP],[u.FLOATINPUT]),_(e),C.attributes(e,{placeholder:i}),e.classList.add(u.INPUT),s||"INPUT"!==e.tagName||e.removeAttribute("required"))},n.addFloating=function(t,e,i,s){var n,a,s=C.isNullOrUndefined(s)?C.createElement:s,r=C.closest(t,"."+u.INPUTGROUP),l=r.tagName,l={element:t,floatLabelType:e,customTag:"DIV"!==l&&"SPAN"!==l?l:null,properties:{placeholder:i}};"Never"!==e?(i=r.querySelector(".e-clear-icon"),n={container:r},t.classList.remove(u.INPUT),X(l,n,s),pt(n.container,s),st(l.element,n.container),s=r.classList.contains("e-float-icon-left"),C.isNullOrUndefined(i)&&(i=(s?r.querySelector(".e-input-in-wrap"):r).querySelector(".e-input-group-icon")),C.isNullOrUndefined(i)?s&&(i=r.querySelector(".e-input-group-icon")):(n=r.querySelector("."+u.FLOATLINE),a=r.querySelector("."+u.FLOATTEXT),(s=s?r.querySelector(".e-input-in-wrap"):r).insertBefore(t,i),s.insertBefore(n,i),s.insertBefore(a,i))):K(l),Y(e,t.parentElement)},n.createSpanElement=pt,n.setRipple=function(t,e){for(var i=0;i<e.length;i++)dt(t,e[parseInt(i.toString(),10)].container)},n.addIcon=function(t,e,i,s,n){if(e="string"==typeof e?e.split(","):e,"append"===t.toLowerCase())for(var a=0,r=e;a<r.length;a++)gt(r[a],i,n);else for(var l=0,o=e;l<o.length;l++)ft(o[l],i,s,n);i.getElementsByClassName("e-input-group-icon")[0]&&i.getElementsByClassName("e-float-text-overflow")[0]&&i.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon")},n.prependSpan=ft,n.appendSpan=gt,n.validateInputType=yt,n.updateHTMLAttributesToElement=function(t,e){if(!C.isNullOrUndefined(t))for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i];F.indexOf(n)<0&&e.setAttribute(n,t[""+n])}},n.updateCssClass=function(t,e,i){it(bt(t),[i],bt(e))},n.getInputValidClassList=bt,n.updateHTMLAttributesToWrapper=function(t,e){if(!C.isNullOrUndefined(t))for(var i=0,s=Object.keys(t);i<s.length;i++){var n,a=s[i];-1<F.indexOf(a)&&("class"===a?""!==(n=this.getInputValidClassList(t[""+a]))&&C.addClass([e],n.split(" ")):"style"===a?(n=e.getAttribute(a),n=C.isNullOrUndefined(n)?t[""+a]:n+t[""+a],e.setAttribute(a,n)):e.setAttribute(a,t[""+a]))}},n.isBlank=function(t){return!t||/^\s*$/.test(t)};Ct=function(t,e){return(Ct=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Ct,Et,xt=function(t,e){function i(){this.constructor=t}Ct(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},t=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},St="e-input-group-icon",Tt="e-spin-up",Pt="e-error",kt="increment",Ot="decrement",Lt=new RegExp("^(-)?(\\d*)$"),wt="e-input-focus",At=["title","style","class"],Nt=0,Ht=(Et=C.Component,xt(e,Et),e.prototype.preRender=function(){this.isPrevFocused=!1,this.decimalSeparator=".",this.intRegExp=new RegExp("/^(-)?(d*)$/"),this.isCalled=!1;var t=C.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),C.removeClass([this.cloneElement],["e-control","e-numerictextbox","e-lib"]),this.angularTagName=null,this.formEle=C.closest(this.element,"form"),"EJS-NUMERICTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;for(var e=this.createElement("input"),i=0;i<this.element.attributes.length;i++){var s=this.element.attributes[i].nodeName;"id"!==s&&"class"!==s?(e.setAttribute(this.element.attributes[i].nodeName,this.element.attributes[i].nodeValue),e.innerHTML=this.element.innerHTML):"class"===s&&e.setAttribute(s,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "))}this.element.hasAttribute("name")&&this.element.removeAttribute("name"),this.element.classList.remove("e-control","e-numerictextbox"),this.element.appendChild(e),this.element=e,C.setValue("ej2_instances",t,this.element)}C.attributes(this.element,{role:"spinbutton",tabindex:"0",autocomplete:"off"});t={incrementTitle:"Increment value",decrementTitle:"Decrement value",placeholder:this.placeholder};this.l10n=new C.L10n("numerictextbox",t,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",C.getUniqueID("numerictextbox")),this.isValidState=!0,this.inputStyle=null,this.inputName=null,this.cultureInfo={},this.initCultureInfo(),this.initCultureFunc(),this.prevValue=this.value,this.updateHTMLAttrToElement(),this.checkAttributes(!1),this.formEle&&(this.inputEleValue=this.value),this.validateMinMax(),this.validateStep(),null===this.placeholder&&this.updatePlaceholder()},e.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&(this.createWrapper(),this.showSpinButton&&this.spinBtnCreation(),this.setElementWidth(this.width),this.container.classList.contains("e-input-group")||this.container.classList.add("e-input-group"),this.changeValue(null===this.value||isNaN(this.value)?null:this.strictMode?this.trimValue(this.value):this.value),this.wireEvents(),null===this.value||isNaN(this.value)||this.decimals&&this.setProperties({value:this.roundNumber(this.value,this.decimals)},!0),(this.element.getAttribute("value")||this.value)&&(this.element.setAttribute("value",this.element.value),this.hiddenInput.setAttribute("value",this.hiddenInput.value)),this.elementPrevValue=this.element.value,this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","numerictextbox"),!C.isNullOrUndefined(C.closest(this.element,"fieldset"))&&C.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete())},e.prototype.checkAttributes=function(t){for(var e=0,i=t?C.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","step","disabled","readonly","style","name","placeholder"];e<i.length;e++){var s,n,a,r=i[e];if(!C.isNullOrUndefined(this.element.getAttribute(r)))switch(r){case"disabled":(C.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(r)&&""!==this.element.getAttribute(r)&&"true"!==this.element.getAttribute(r),this.setProperties({enabled:s},!t));break;case"readonly":(C.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.readonly||t)&&(s="readonly"===this.element.getAttribute(r)||""===this.element.getAttribute(r)||"true"===this.element.getAttribute(r),this.setProperties({readonly:s},!t));break;case"placeholder":(C.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"value":(C.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.value||t)&&(n=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r)),this.setProperties(C.setValue(r,n,{}),!t));break;case"min":!C.isNullOrUndefined(this.numericOptions)&&void 0!==this.numericOptions.min&&!t||null===(n=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r)))||isNaN(n)||this.setProperties(C.setValue(r,n,{}),!t);break;case"max":!C.isNullOrUndefined(this.numericOptions)&&void 0!==this.numericOptions.max&&!t||null===(a=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r)))||isNaN(a)||this.setProperties(C.setValue(r,a,{}),!t);break;case"step":!C.isNullOrUndefined(this.numericOptions)&&void 0!==this.numericOptions.step&&!t||null===(a=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r)))||isNaN(a)||this.setProperties(C.setValue(r,a,{}),!t);break;case"style":this.inputStyle=this.element.getAttribute(r);break;case"name":this.inputName=this.element.getAttribute(r);break;default:var l=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r));(null===l||isNaN(l))&&"value"!==r||this.setProperties(C.setValue(r,l,{}),!0)}}},e.prototype.updatePlaceholder=function(){this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0)},e.prototype.initCultureFunc=function(){this.instance=new C.Internationalization(this.locale)},e.prototype.initCultureInfo=function(){this.cultureInfo.format=this.format,null!==C.getValue("currency",this)&&(C.setValue("currency",this.currency,this.cultureInfo),this.setProperties({currencyCode:this.currency},!0))},e.prototype.createWrapper=function(){var t=this.cssClass,t=(C.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=this.getNumericValidClassList(this.cssClass)),o.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:t,enableRtl:this.enableRtl,showClearButton:this.showClearButton,enabled:this.enabled}},this.createElement));this.inputWrapper=t,this.container=t.container,this.container.setAttribute("class","e-control-wrapper e-numeric "+this.container.getAttribute("class")),this.updateHTMLAttrToWrapper(),this.readonly&&C.attributes(this.element,{"aria-readonly":"true"}),this.hiddenInput=this.createElement("input",{attrs:{type:"text",validateHidden:"true","aria-label":"hidden",class:"e-numeric-hidden"}}),this.inputName=null!==this.inputName?this.inputName:this.element.id,this.element.removeAttribute("name"),this.isAngular&&"EJS-NUMERICTEXTBOX"===this.angularTagName&&0<this.cloneElement.id.length?C.attributes(this.hiddenInput,{name:this.cloneElement.id}):C.attributes(this.hiddenInput,{name:this.inputName}),this.container.insertBefore(this.hiddenInput,this.container.childNodes[1]),this.updateDataAttribute(!1),null!==this.inputStyle&&C.attributes(this.container,{style:this.inputStyle})},e.prototype.updateDataAttribute=function(t){var e={};if(t)e=this.htmlAttributes;else for(var i=0;i<this.element.attributes.length;i++)e[this.element.attributes[i].name]=this.element.getAttribute(this.element.attributes[i].name);for(var s=0,n=Object.keys(e);s<n.length;s++){var a=n[s];0===a.indexOf("data")&&this.hiddenInput.setAttribute(a,e[""+a])}},e.prototype.updateHTMLAttrToElement=function(){if(!C.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i=e[t];At.indexOf(i)<0&&this.element.setAttribute(i,this.htmlAttributes[""+i])}},e.prototype.updateCssClass=function(t,e){o.Input.setCssClass(this.getNumericValidClassList(t),[this.container],this.getNumericValidClassList(e))},e.prototype.getNumericValidClassList=function(t){var e=t;return e=C.isNullOrUndefined(t)||""===t?e:t.replace(/\s+/g," ").trim()},e.prototype.updateHTMLAttrToWrapper=function(){if(!C.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i,s=e[t];-1<At.indexOf(s)&&("class"===s?""!==(i=this.getNumericValidClassList(this.htmlAttributes[""+s]))&&C.addClass([this.container],i.split(" ")):"style"===s?(i=this.container.getAttribute(s),i=C.isNullOrUndefined(i)?this.htmlAttributes[""+s]:i+this.htmlAttributes[""+s],this.container.setAttribute(s,i)):this.container.setAttribute(s,this.htmlAttributes[""+s]))}},e.prototype.setElementWidth=function(t){C.isNullOrUndefined(t)||("number"==typeof t?this.container.style.width=C.formatUnit(t):"string"==typeof t&&(this.container.style.width=t.match(/px|%|em/)?t:C.formatUnit(t)))},e.prototype.spinBtnCreation=function(){this.spinDown=o.Input.appendSpan(St+" e-spin-down",this.container,this.createElement),C.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle")}),this.spinUp=o.Input.appendSpan(St+" "+Tt,this.container,this.createElement),C.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle")}),this.wireSpinBtnEvents()},e.prototype.validateMinMax=function(){"number"==typeof this.min&&!isNaN(this.min)||this.setProperties({min:-Number.MAX_VALUE},!0),"number"==typeof this.max&&!isNaN(this.max)||this.setProperties({max:Number.MAX_VALUE},!0),null!==this.decimals&&(this.min!==-Number.MAX_VALUE&&this.setProperties({min:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.min))},!0),this.max!==Number.MAX_VALUE)&&this.setProperties({max:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.max))},!0),this.setProperties({min:this.min>this.max?this.max:this.min},!0),this.min!==-Number.MAX_VALUE&&C.attributes(this.element,{"aria-valuemin":this.min.toString()}),this.max!==Number.MAX_VALUE&&C.attributes(this.element,{"aria-valuemax":this.max.toString()})},e.prototype.formattedValue=function(t,e){return this.instance.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(e)},e.prototype.validateStep=function(){null!==this.decimals&&this.setProperties({step:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.step))},!0)},e.prototype.action=function(t,e){this.isInteract=!0;var i=this.isFocused?this.instance.getNumberParser({format:"n"})(this.element.value):this.value;this.changeValue(this.performAction(i,this.step,t)),this.raiseChangeEvent(e)},e.prototype.checkErrorClass=function(){this.isValidState?C.removeClass([this.container],Pt):C.addClass([this.container],Pt),C.attributes(this.element,{"aria-invalid":this.isValidState?"false":"true"})},e.prototype.bindClearEvent=function(){this.showClearButton&&C.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},e.prototype.resetHandler=function(t){t.preventDefault(),this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&!this.inputWrapper.container.classList.contains("e-static-clear")||this.clear(t),this.isInteract=!0,this.raiseChangeEvent(t)},e.prototype.clear=function(t){var e,i;this.setProperties({value:null},!0),this.setElementValue(""),this.hiddenInput.value="",C.closest(this.element,"form")&&(e=this.element.nextElementSibling,(i=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(i))},e.prototype.resetFormHandler=function(){"EJS-NUMERICTEXTBOX"===this.element.tagName?this.updateValue(null):this.updateValue(this.inputEleValue)},e.prototype.setSpinButton=function(){C.isNullOrUndefined(this.spinDown)||C.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),C.isNullOrUndefined(this.spinUp)||C.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")})},e.prototype.wireEvents=function(){C.EventHandler.add(this.element,"focus",this.focusHandler,this),C.EventHandler.add(this.element,"blur",this.focusOutHandler,this),C.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),C.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),C.EventHandler.add(this.element,"input",this.inputHandler,this),C.EventHandler.add(this.element,"keypress",this.keyPressHandler,this),C.EventHandler.add(this.element,"change",this.changeHandler,this),C.EventHandler.add(this.element,"paste",this.pasteHandler,this),this.enabled&&(this.bindClearEvent(),this.formEle)&&C.EventHandler.add(this.formEle,"reset",this.resetFormHandler,this)},e.prototype.wireSpinBtnEvents=function(){C.EventHandler.add(this.spinUp,C.Browser.touchStartEvent,this.mouseDownOnSpinner,this),C.EventHandler.add(this.spinDown,C.Browser.touchStartEvent,this.mouseDownOnSpinner,this),C.EventHandler.add(this.spinUp,C.Browser.touchEndEvent,this.mouseUpOnSpinner,this),C.EventHandler.add(this.spinDown,C.Browser.touchEndEvent,this.mouseUpOnSpinner,this),C.EventHandler.add(this.spinUp,C.Browser.touchMoveEvent,this.touchMoveOnSpinner,this),C.EventHandler.add(this.spinDown,C.Browser.touchMoveEvent,this.touchMoveOnSpinner,this)},e.prototype.unwireEvents=function(){C.EventHandler.remove(this.element,"focus",this.focusHandler),C.EventHandler.remove(this.element,"blur",this.focusOutHandler),C.EventHandler.remove(this.element,"keyup",this.keyUpHandler),C.EventHandler.remove(this.element,"input",this.inputHandler),C.EventHandler.remove(this.element,"keydown",this.keyDownHandler),C.EventHandler.remove(this.element,"keypress",this.keyPressHandler),C.EventHandler.remove(this.element,"change",this.changeHandler),C.EventHandler.remove(this.element,"paste",this.pasteHandler),this.formEle&&C.EventHandler.remove(this.formEle,"reset",this.resetFormHandler)},e.prototype.unwireSpinBtnEvents=function(){C.EventHandler.remove(this.spinUp,C.Browser.touchStartEvent,this.mouseDownOnSpinner),C.EventHandler.remove(this.spinDown,C.Browser.touchStartEvent,this.mouseDownOnSpinner),C.EventHandler.remove(this.spinUp,C.Browser.touchEndEvent,this.mouseUpOnSpinner),C.EventHandler.remove(this.spinDown,C.Browser.touchEndEvent,this.mouseUpOnSpinner),C.EventHandler.remove(this.spinUp,C.Browser.touchMoveEvent,this.touchMoveOnSpinner),C.EventHandler.remove(this.spinDown,C.Browser.touchMoveEvent,this.touchMoveOnSpinner)},e.prototype.changeHandler=function(t){t.stopPropagation(),this.element.value.length||this.setProperties({value:null},!0);var e=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(e,t)},e.prototype.raiseChangeEvent=function(t){var e;this.inputValue=C.isNullOrUndefined(this.inputValue)||isNaN(this.inputValue)?null:this.inputValue,this.prevValue===this.value&&this.prevValue===this.inputValue||(e={},this.changeEventArgs={value:this.value,previousValue:this.prevValue,isInteracted:this.isInteract,isInteraction:this.isInteract,event:t},t&&(this.changeEventArgs.event=t),void 0===this.changeEventArgs.event&&(this.changeEventArgs.isInteracted=!1,this.changeEventArgs.isInteraction=!1),C.merge(e,this.changeEventArgs),this.prevValue=this.value,this.isInteract=!1,this.elementPrevValue=this.element.value,this.preventChange=!1,this.trigger("change",e))},e.prototype.pasteHandler=function(){var t,e=this;this.enabled&&!this.readonly&&(t=this.element.value,setTimeout(function(){e.numericRegex().test(e.element.value)||e.setElementValue(t)}))},e.prototype.preventHandler=function(){var a=this,r=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);setTimeout(function(){var t,e,i,s,n;0<a.element.selectionStart&&(t=a.element.selectionStart,e=a.element.selectionStart-1,i=a.element.value.split(""),s=C.getNumericObject(a.locale),n=(s=C.getValue("decimal",s)).charCodeAt(0)," "===a.element.value[e]&&0<a.element.selectionStart&&!r?(C.isNullOrUndefined(a.prevVal)?a.element.value=a.element.value.trim():0!=e?a.element.value=a.prevVal:0==e&&(a.element.value=a.element.value.trim()),a.element.setSelectionRange(e,e)):isNaN(parseFloat(a.element.value[a.element.selectionStart-1]))&&45!==a.element.value[a.element.selectionStart-1].charCodeAt(0)?(i.indexOf(a.element.value[a.element.selectionStart-1])!==i.lastIndexOf(a.element.value[a.element.selectionStart-1])&&a.element.value[a.element.selectionStart-1].charCodeAt(0)===n||a.element.value[a.element.selectionStart-1].charCodeAt(0)!==n)&&(a.element.value=a.element.value.substring(0,e)+a.element.value.substring(t,a.element.value.length),a.element.setSelectionRange(e,e),isNaN(parseFloat(a.element.value[a.element.selectionStart-1])))&&0<a.element.selectionStart&&a.element.value.length&&a.preventHandler():isNaN(parseFloat(a.element.value[a.element.selectionStart-2]))&&1<a.element.selectionStart&&45!==a.element.value[a.element.selectionStart-2].charCodeAt(0)&&(i.indexOf(a.element.value[a.element.selectionStart-2])!==i.lastIndexOf(a.element.value[a.element.selectionStart-2])&&a.element.value[a.element.selectionStart-2].charCodeAt(0)===n||a.element.value[a.element.selectionStart-2].charCodeAt(0)!==n)&&(a.element.setSelectionRange(e,e),a.nextEle=a.element.value[a.element.selectionStart],a.cursorPosChanged=!0,a.preventHandler()),!0===a.cursorPosChanged&&a.element.value[a.element.selectionStart]===a.nextEle&&isNaN(parseFloat(a.element.value[a.element.selectionStart-1]))&&(a.element.setSelectionRange(a.element.selectionStart+1,a.element.selectionStart+1),a.cursorPosChanged=!1,a.nextEle=null),""===a.element.value.trim()&&a.element.setSelectionRange(0,0),0<a.element.selectionStart&&(45===a.element.value[a.element.selectionStart-1].charCodeAt(0)&&1<a.element.selectionStart&&(C.isNullOrUndefined(a.prevVal)||(a.element.value=a.prevVal),a.element.setSelectionRange(a.element.selectionStart,a.element.selectionStart)),a.element.value[a.element.selectionStart-1]===s)&&0===a.decimals&&a.validateDecimalOnType&&(a.element.value=a.element.value.substring(0,e)+a.element.value.substring(t,a.element.value.length)),a.prevVal=a.element.value)})},e.prototype.keyUpHandler=function(){var t,e;this.enabled&&!this.readonly&&(!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)||!C.Browser.isDevice||this.preventHandler(),t=null===(t=this.instance.getNumberParser({format:"n"})(this.element.value))||isNaN(t)?null:t,this.hiddenInput.value=t||0===t?t.toString():null,C.closest(this.element,"form"))&&(t=this.element.nextElementSibling,(e=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),t.dispatchEvent(e))},e.prototype.inputHandler=function(t){var e,i;this.enabled&&!this.readonly&&(e=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),(-1<navigator.userAgent.toLowerCase().indexOf("firefox")||e)&&C.Browser.isDevice&&this.preventHandler(),this.isAngular&&this.element.value!==C.getValue("decimal",C.getNumericObject(this.locale))&&this.element.value!==C.getValue("minusSign",C.getNumericObject(this.locale))&&(e=this.instance.getNumberParser({format:"n"})(this.element.value),e=isNaN(e)?null:e,this.localChange({value:e}),this.preventChange=!0),this.isVue)&&(e=this.instance.getNumberParser({format:"n"})(this.element.value),i=this.instance.getNumberParser({format:"n"})(this.elementPrevValue),t={event:t,value:null===(e=!new RegExp("[^0-9]+$").test(this.element.value)&&(-1===this.elementPrevValue.indexOf(".")&&-1===this.elementPrevValue.indexOf("-")||"0"!==this.element.value[this.element.value.length-1])?e:this.value)||isNaN(e)?null:e,previousValue:null===i||isNaN(i)?null:i},this.preventChange=!0,this.elementPrevValue=this.element.value,this.trigger("input",t))},e.prototype.keyDownHandler=function(t){if(!this.readonly)switch(t.keyCode){case 38:t.preventDefault(),this.action(kt,t);break;case 40:t.preventDefault(),this.action(Ot,t)}},e.prototype.performAction=function(t,e,i){null!==t&&!isNaN(t)||(t=0);i=this.correctRounding(t,e,i===kt?t+e:t-e);return this.strictMode?this.trimValue(i):i},e.prototype.correctRounding=function(t,e,i){var s=new RegExp("[,.](.*)"),n=s.test(t.toString()),a=s.test(e.toString());return n||a?(n=n?s.exec(t.toString())[0].length:0,t=a?s.exec(e.toString())[0].length:0,a=Math.max(n,t),this.roundValue(i,a)):i},e.prototype.roundValue=function(t,e){e=e||0;e=Math.pow(10,e);return t*=e,Math.round(t)/e},e.prototype.updateValue=function(t,e){e&&(this.isInteract=!0),null===t||isNaN(t)||this.decimals&&(t=this.roundNumber(t,this.decimals)),this.inputValue=t,this.changeValue(null===t||isNaN(t)?null:this.strictMode?this.trimValue(t):t),this.isDynamicChange||this.raiseChangeEvent(e)},e.prototype.updateCurrency=function(t,e){C.setValue(t,e,this.cultureInfo),this.updateValue(this.value)},e.prototype.changeValue=function(t){var e;t||0===t?(e=this.getNumberOfDecimals(t),this.setProperties({value:this.roundNumber(t,e)},!0)):this.setProperties({value:t=null},!0),this.modifyText(),this.strictMode||this.validateState()},e.prototype.modifyText=function(){var t,e;this.value||0===this.value?(t=this.formatNumber(),e=this.isFocused?t:this.instance.getNumberFormat(this.cultureInfo)(this.value),this.setElementValue(e),C.attributes(this.element,{"aria-valuenow":t}),this.hiddenInput.value=this.value.toString(),C.isNullOrUndefined(this.hiddenInput)||null!==this.value&&this.serverDecimalSeparator&&(this.hiddenInput.value=this.hiddenInput.value.replace(".",this.serverDecimalSeparator))):(this.setElementValue(""),this.element.removeAttribute("aria-valuenow"),this.hiddenInput.value=null)},e.prototype.setElementValue=function(t,e){o.Input.setValue(t,e||this.element,this.floatLabelType,this.showClearButton)},e.prototype.validateState=function(){this.isValidState=!0,!this.value&&0!==this.value||(this.isValidState=!(this.value>this.max||this.value<this.min)),this.checkErrorClass()},e.prototype.getNumberOfDecimals=function(t){var e=new RegExp("[eE][-+]?([0-9]+)"),i=t.toString(),t=(e.test(i)&&(e=e.exec(i),C.isNullOrUndefined(e)||(i=t.toFixed(Math.min(parseInt(e[1],10),20)))),i.split(".")[1]),e=t&&t.length?t.length:0;return e=null!==this.decimals?e<this.decimals?e:this.decimals:e},e.prototype.formatNumber=function(){var t=this.getNumberOfDecimals(this.value);return this.instance.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(this.value)},e.prototype.trimValue=function(t){return t>this.max?this.max:t<this.min?this.min:t},e.prototype.roundNumber=function(t,e){var e=e||0,i=t.toString().split("e"),i=(t=Math.round(Number(i[0]+"e"+(i[1]?Number(i[1])+e:e)))).toString().split("e");return t=Number(i[0]+"e"+(i[1]?Number(i[1])-e:-e)),Number(t.toFixed(e))},e.prototype.cancelEvent=function(t){return t.preventDefault(),!1},e.prototype.keyPressHandler=function(t){if(!this.enabled||this.readonly)return!0;if(!C.Browser.isDevice&&"11.0"===C.Browser.info.version&&13===t.keyCode)return e=this.instance.getNumberParser({format:"n"})(this.element.value),this.updateValue(e,t),!0;if(0===t.which||t.metaKey||t.ctrlKey||8===t.keyCode||13===t.keyCode)return!0;var e=String.fromCharCode(t.which),i=C.getValue("decimal",C.getNumericObject(this.locale)),s="NumpadDecimal"===t.code&&e!==i;s&&(e=i);i=(i=this.element.value).substring(0,this.element.selectionStart)+e+i.substring(this.element.selectionEnd);return this.numericRegex().test(i)?(s&&(e=this.element.selectionStart+1,this.element.value=i,this.element.setSelectionRange(e,e),t.preventDefault(),t.stopPropagation()),!0):(t.preventDefault(),t.stopPropagation(),!1)},e.prototype.numericRegex=function(){var t=C.getNumericObject(this.locale),t=C.getValue("decimal",t),e="*";return"."===t&&(t="\\"+t),0===this.decimals&&this.validateDecimalOnType?Lt:(this.decimals&&this.validateDecimalOnType&&(e="{0,"+this.decimals+"}"),new RegExp("^\\s*(-)?(((\\d+("+t+"\\d"+e+")?)|("+t+"\\d"+e+")))?$"))},e.prototype.mouseWheel=function(t){var e;t.preventDefault(),t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),0<e?this.action(kt,t):e<0&&this.action(Ot,t),this.cancelEvent(t)},e.prototype.focusHandler=function(t){var e,i=this;clearTimeout(Nt),this.focusEventArgs={event:t,value:this.value,container:this.container},this.trigger("focus",this.focusEventArgs),!this.enabled||this.readonly||(this.isFocused=!0,this.prevValue=this.value,!this.value&&0!==this.value||(e=this.formatNumber(),this.setElementValue(e),this.isPrevFocused)||(C.Browser.isDevice||"11.0"!==C.Browser.info.version?(t=C.Browser.isDevice&&C.Browser.isIos?600:0,Nt=setTimeout(function(){i.element.setSelectionRange(0,e.length)},t)):this.element.setSelectionRange(0,e.length)),C.Browser.isDevice)||C.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this)},e.prototype.focusOutHandler=function(t){var e,i,s,n=this;this.blurEventArgs={event:t,value:this.value,container:this.container},this.trigger("blur",this.blurEventArgs),this.enabled&&!this.readonly&&(this.isPrevFocused?(t.preventDefault(),C.Browser.isDevice&&(e=this.element.value,this.element.focus(),this.isPrevFocused=!1,i=this.element,setTimeout(function(){n.setElementValue(e,i)},200))):(this.isFocused=!1,this.element.value.length||this.setProperties({value:null},!0),t=this.instance.getNumberParser({format:"n"})(this.element.value),this.updateValue(t),C.Browser.isDevice||C.EventHandler.remove(this.element,"mousewheel DOMMouseScroll",this.mouseWheel)),C.closest(this.element,"form"))&&(t=this.element.nextElementSibling,(s=document.createEvent("FocusEvent")).initEvent("focusout",!1,!0),t.dispatchEvent(s))},e.prototype.mouseDownOnSpinner=function(t){var e,i,s=this;this.isFocused&&(this.isPrevFocused=!0,t.preventDefault()),this.getElementData(t)&&(this.getElementData(t),e=t.currentTarget,i=e.classList.contains(Tt)?kt:Ot,C.EventHandler.add(e,"mouseleave",this.mouseUpClick,this),this.timeOut=setInterval(function(){s.isCalled=!0,s.action(i,t)},150),C.EventHandler.add(document,"mouseup",this.mouseUpClick,this))},e.prototype.touchMoveOnSpinner=function(t){var e;("touchmove"===t.type?(e=t.touches).length&&document.elementFromPoint(e[0].pageX,e[0].pageY):document.elementFromPoint(t.clientX,t.clientY)).classList.contains(St)||clearInterval(this.timeOut)},e.prototype.mouseUpOnSpinner=function(t){var e,i;this.prevValue=this.value,this.isPrevFocused&&(this.element.focus(),C.Browser.isDevice||(this.isPrevFocused=!1)),C.Browser.isDevice||t.preventDefault(),this.getElementData(t)&&(i=(e=t.currentTarget).classList.contains(Tt)?kt:Ot,C.EventHandler.remove(e,"mouseleave",this.mouseUpClick),this.isCalled||this.action(i,t),this.isCalled=!1,C.EventHandler.remove(document,"mouseup",this.mouseUpClick),C.closest(this.element,"form"))&&(e=this.element.nextElementSibling,(i=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(i))},e.prototype.getElementData=function(t){return!(t.which&&3===t.which||t.button&&2===t.button||!this.enabled||this.readonly||(clearInterval(this.timeOut),0))},e.prototype.floatLabelTypeUpdate=function(){o.Input.removeFloating(this.inputWrapper);var t=this.hiddenInput;this.hiddenInput.remove(),o.Input.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement),this.container.insertBefore(t,this.container.childNodes[1])},e.prototype.mouseUpClick=function(t){t.stopPropagation(),clearInterval(this.timeOut),this.isCalled=!1,this.spinUp&&C.EventHandler.remove(this.spinUp,"mouseleave",this.mouseUpClick),this.spinDown&&C.EventHandler.remove(this.spinDown,"mouseleave",this.mouseUpClick)},e.prototype.increment=function(t){void 0===t&&(t=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,t,kt)),this.raiseChangeEvent()},e.prototype.decrement=function(t){void 0===t&&(t=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,t,Ot)),this.raiseChangeEvent()},e.prototype.destroy=function(){this.unwireEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),C.detach(this.hiddenInput),this.showSpinButton&&(this.unwireSpinBtnEvents(),C.detach(this.spinUp),C.detach(this.spinDown));for(var t=["aria-labelledby","role","autocomplete","aria-readonly","aria-disabled","autocapitalize","spellcheck","aria-autocomplete","tabindex","aria-valuemin","aria-valuemax","aria-valuenow","aria-invalid"],e=0;e<t.length;e++)this.element.removeAttribute(t[e]);this.element.classList.remove("e-input"),this.container.insertAdjacentElement("afterend",this.element),C.detach(this.container),this.spinUp=null,this.spinDown=null,this.container=null,this.hiddenInput=null,this.changeEventArgs=null,this.blurEventArgs=null,this.focusEventArgs=null,this.inputWrapper=null,o.Input.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),Et.prototype.destroy.call(this)},e.prototype.getText=function(){return this.element.value},e.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),C.addClass([this.container],[wt]))},e.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),C.removeClass([this.container],[wt]))},e.prototype.getPersistData=function(){return this.addOnPersist(["value"])},e.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i];switch(n){case"width":this.setElementWidth(t.width),o.Input.calculateWidth(this.element,this.container);break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"enabled":o.Input.setEnabled(t.enabled,this.element),this.bindClearEvent();break;case"enableRtl":o.Input.setEnableRtl(t.enableRtl,[this.container]);break;case"readonly":o.Input.setReadonly(t.readonly,this.element),this.readonly?C.attributes(this.element,{"aria-readonly":"true"}):this.element.removeAttribute("aria-readonly");break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.updateDataAttribute(!0),this.checkAttributes(!0),o.Input.validateInputType(this.container,this.element);break;case"placeholder":o.Input.setPlaceholder(t.placeholder,this.element),o.Input.calculateWidth(this.element,this.container);break;case"step":this.step=t.step,this.validateStep();break;case"showSpinButton":this.updateSpinButton(t);break;case"showClearButton":this.updateClearButton(t);break;case"floatLabelType":this.floatLabelType=t.floatLabelType,this.floatLabelTypeUpdate();break;case"value":this.isDynamicChange=(this.isAngular||this.isVue)&&this.preventChange,this.updateValue(t.value),this.isDynamicChange&&(this.preventChange=!1,this.isDynamicChange=!1);break;case"min":case"max":C.setValue(n,C.getValue(n,t),this),this.validateMinMax(),this.updateValue(this.value);break;case"strictMode":this.strictMode=t.strictMode,this.updateValue(this.value),this.validateState();break;case"locale":this.initCultureFunc(),this.l10n.setLocale(this.locale),this.setSpinButton(),this.updatePlaceholder(),o.Input.setPlaceholder(this.placeholder,this.element),this.updateValue(this.value);break;case"currency":var a=C.getValue(n,t);this.setProperties({currencyCode:a},!0),this.updateCurrency(n,a);break;case"currencyCode":a=C.getValue(n,t);this.setProperties({currency:a},!0),this.updateCurrency("currency",a);break;case"format":C.setValue(n,C.getValue(n,t),this),this.initCultureInfo(),this.updateValue(this.value);break;case"decimals":this.decimals=t.decimals,this.updateValue(this.value)}}},e.prototype.updateClearButton=function(t){o.Input.setClearButton(t.showClearButton,this.element,this.inputWrapper,void 0,this.createElement),this.bindClearEvent()},e.prototype.updateSpinButton=function(t){t.showSpinButton?this.spinBtnCreation():(C.detach(this.spinUp),C.detach(this.spinDown))},e.prototype.getModuleName=function(){return"numerictextbox"},t([C.Property("")],e.prototype,"cssClass",void 0),t([C.Property(null)],e.prototype,"value",void 0),t([C.Property(-Number.MAX_VALUE)],e.prototype,"min",void 0),t([C.Property(Number.MAX_VALUE)],e.prototype,"max",void 0),t([C.Property(1)],e.prototype,"step",void 0),t([C.Property(null)],e.prototype,"width",void 0),t([C.Property(null)],e.prototype,"placeholder",void 0),t([C.Property({})],e.prototype,"htmlAttributes",void 0),t([C.Property(!0)],e.prototype,"showSpinButton",void 0),t([C.Property(!1)],e.prototype,"readonly",void 0),t([C.Property(!0)],e.prototype,"enabled",void 0),t([C.Property(!1)],e.prototype,"showClearButton",void 0),t([C.Property(!1)],e.prototype,"enablePersistence",void 0),t([C.Property("n2")],e.prototype,"format",void 0),t([C.Property(null)],e.prototype,"decimals",void 0),t([C.Property(null)],e.prototype,"currency",void 0),t([C.Property(null)],e.prototype,"currencyCode",void 0),t([C.Property(!0)],e.prototype,"strictMode",void 0),t([C.Property(!1)],e.prototype,"validateDecimalOnType",void 0),t([C.Property("Never")],e.prototype,"floatLabelType",void 0),t([C.Event()],e.prototype,"created",void 0),t([C.Event()],e.prototype,"destroyed",void 0),t([C.Event()],e.prototype,"change",void 0),t([C.Event()],e.prototype,"focus",void 0),t([C.Event()],e.prototype,"blur",void 0),t([C.NotifyPropertyChanges],e));function e(t,e){e=Et.call(this,t,e)||this;return e.preventChange=!1,e.isDynamicChange=!1,e.numericOptions=t,e}var Bt="e-error",Ut="e-input-group",Rt="e-float-input",It="e-utility-mask",Vt="e-label-top",Ft="e-label-bottom",Mt={0:"[0-9]",9:"[0-9 ]","#":"[0-9 +-]",L:"[A-Za-z]","?":"[A-Za-z ]","&":"[^ ]+",C:"[^]+",A:"[A-Za-z0-9]",a:"[A-Za-z0-9 ]"};function Dt(){if(C.attributes(this.element,{role:"textbox",autocomplete:"off",autocapitalize:"off",spellcheck:"false","aria-live":"assertive"}),this.mask){for(var t=this.mask.split("]"),e=0;e<t.length;e++)if("\\"===t[e][t[e].length-1]){t[e]=t[e]+"]";for(var i=t[e].split("["),s=0;s<i.length;s++)"\\"===i[s][i[s].length-1]&&(i[s]=i[s]+"["),Yt.call(this,i[s])}else if(1<(i=t[e].split("[")).length)for(var n=!1,s=0;s<i.length;s++)"\\"===i[s]?(this.customRegExpCollec.push("["),this.hiddenMask+=i[s]+"["):""===i[s]?n=!0:""!==i[s]&&n||s===i.length-1?(this.customRegExpCollec.push("["+i[s]+"]"),this.hiddenMask+=this.promptChar,n=!1):Yt.call(this,i[s]);else Yt.call(this,i[0]);if(this.escapeMaskValue=this.hiddenMask,this.promptMask=this.hiddenMask.replace(/[09?LCAa#&]/g,this.promptChar),!C.isNullOrUndefined(this.customCharacters))for(e=0;e<this.promptMask.length;e++)C.isNullOrUndefined(this.customCharacters[this.promptMask[e]])||(this.promptMask=this.promptMask.replace(new RegExp(this.promptMask[e],"g"),this.promptChar));if(this.hiddenMask.match(new RegExp(/\\/)))for(e=0;e<this.hiddenMask.length;e++){var a,s=1<=e?e:0;s-=a=this.hiddenMask.length-this.promptMask.length,0<e&&"\\"!==this.hiddenMask[e-1]&&(">"===this.hiddenMask[e]||"<"===this.hiddenMask[e]||"|"===this.hiddenMask[e])&&(this.promptMask=this.promptMask.substring(0,s)+this.promptMask.substring(e+1-a,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,s)+this.escapeMaskValue.substring(e+1-a,this.escapeMaskValue.length)),"\\"===this.hiddenMask[e]&&(this.promptMask=this.promptMask.substring(0,s)+this.hiddenMask[e+1]+this.promptMask.substring(e+2-a,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,s)+this.escapeMaskValue[e+1]+this.escapeMaskValue.substring(e+2-a,this.escapeMaskValue.length))}else this.promptMask=this.promptMask.replace(/[>|<]/g,""),this.escapeMaskValue=this.hiddenMask.replace(/[>|<]/g,"");C.attributes(this.element,{"aria-invalid":"false"})}}function zt(){b.call(this,this.promptMask),ye.call(this,this.value)}function Wt(){C.EventHandler.add(this.element,"keydown",ae,this),C.EventHandler.add(this.element,"keypress",he,this),C.EventHandler.add(this.element,"keyup",pe,this),C.EventHandler.add(this.element,"input",ne,this),C.EventHandler.add(this.element,"focus",Jt,this),C.EventHandler.add(this.element,"blur",te,this),C.EventHandler.add(this.element,"paste",ee,this),C.EventHandler.add(this.element,"cut",ie,this),C.EventHandler.add(this.element,"drop",se,this),C.EventHandler.add(this.element,"mousedown",Zt,this),C.EventHandler.add(this.element,"mouseup",Gt,this),this.enabled&&(jt.call(this),this.formElement)&&C.EventHandler.add(this.formElement,"reset",Xt,this)}function qt(){C.EventHandler.remove(this.element,"keydown",ae),C.EventHandler.remove(this.element,"keypress",he),C.EventHandler.remove(this.element,"keyup",pe),C.EventHandler.remove(this.element,"input",ne),C.EventHandler.remove(this.element,"focus",Jt),C.EventHandler.remove(this.element,"blur",te),C.EventHandler.remove(this.element,"paste",ee),C.EventHandler.remove(this.element,"cut",ie),C.EventHandler.remove(this.element,"drop",se),C.EventHandler.remove(this.element,"mousedown",Zt),C.EventHandler.remove(this.element,"mouseup",Gt),this.formElement&&C.EventHandler.remove(this.formElement,"reset",Xt)}function jt(){this.showClearButton&&C.EventHandler.add(this.inputObj.clearButton,"mousedown touchstart",_t,this)}function _t(t){t.preventDefault(),this.inputObj.clearButton.classList.contains("e-clear-icon-hide")&&!this.inputObj.container.classList.contains("e-static-clear")||(function(t){var e=this.element.value;b.call(this,this.promptMask),this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),ue.call(this,t,e),this.element.setSelectionRange(0,0)}.call(this,t),this.value="")}function Xt(){"EJS-MASKEDTEXTBOX"===this.element.tagName?b.call(this,this.promptMask):this.value=this.initInputValue}function Kt(t){return t.value}function p(t,e){var i="",s=0,n=!1,a=!C.isNullOrUndefined(e)||C.isNullOrUndefined(t)||C.isNullOrUndefined(this)?e:t.value;if(a!==this.promptMask)for(var r=0;r<this.customRegExpCollec.length;r++)n=n&&!1,">"!==this.customRegExpCollec[s]&&"<"!==this.customRegExpCollec[s]&&"|"!==this.customRegExpCollec[s]&&"\\"!==this.customRegExpCollec[s]||(--r,n=!0),n||a[r]!==this.promptChar&&!C.isNullOrUndefined(this.customRegExpCollec[s])&&(this._callPasteHandler||!C.isNullOrUndefined(this.regExpCollec[this.customRegExpCollec[s]])&&!this.maskedRegExp.includes(this.customRegExpCollec[s])||2<this.customRegExpCollec[s].length&&"["===this.customRegExpCollec[s][0]&&"]"===this.customRegExpCollec[s][this.customRegExpCollec[s].length-1]||!C.isNullOrUndefined(this.customCharacters)&&!C.isNullOrUndefined(this.customCharacters[this.customRegExpCollec[s]]))&&""!==a&&(i+=a[r]),++s;return i=null===this.mask||""===this.mask&&void 0!==this.value?a:i}function Yt(t){for(var e=0;e<t.length;e++)this.hiddenMask+=t[e],"\\"!==t[e]?this.customRegExpCollec.push(t[e]):"\\"!==t[e]||C.isNullOrUndefined(this.regExpCollec[t[e+1]])||this.maskedRegExp.push(t[e+1])}function Zt(){this.isClicked=!0}function Gt(){this.isClicked=!1}function Jt(t){var i=this,s=this.element,e=0,n=p.call(this,s),a=!1,r=!1,l={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:C.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd};if(this.isClicked||$t.call(this,l,s),this.mask&&(null!==n&&""!==n||"Always"===this.floatLabelType||null===this.placeholder||""===this.placeholder||(s.value=this.promptMask),setTimeout(function(){if(s.selectionStart===i.promptMask.length||s.value[s.selectionStart]===i.promptChar)a=!0;else for(var t=s.selectionStart;t<i.promptMask.length;t++){if(s.value[t]===i.promptChar){a=!0;break}if(s.value[t]!==i.promptMask[t]){a=!1;break}}}),setTimeout(function(){var t=s.selectionStart-1;if(t==i.promptMask.length-1||s.value[t]===i.promptChar)r=!0;else for(var e=t;0<=e;e--){if(s.value[e]===i.promptChar){r=!0;break}if(s.value[e]!==i.promptMask[e]){r=!1;break}}}),this.isClicked||"Always"!==this.floatLabelType&&(null===n||""===n)&&null!==this.placeholder&&""!==this.placeholder)){for(e=0;e<this.promptMask.length;e++)if(s.value[e]===this.promptChar){setTimeout(function(){(a||r)&&(s.selectionEnd=e,s.selectionStart=e),l={selectionStart:s.selectionStart,event:t,value:i.value,maskedValue:s.value,container:C.isNullOrUndefined(i.inputObj)?i.inputObj:i.inputObj.container,selectionEnd:s.selectionEnd},$t.call(i,l,s)},110);break}C.isNullOrUndefined(s.value.match(Qt(this.promptChar)))&&(l={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:C.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd},$t.call(this,l,s)),this.isClicked=!1}}function $t(t,e){this.trigger("focus",t,function(t){e.selectionStart=t.selectionStart,e.selectionEnd=t.selectionEnd})}function Qt(t){return C.isNullOrUndefined(t)?t:t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function te(t){this.blurEventArgs={event:t,value:this.value,maskedValue:this.element.value,container:C.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container},this.trigger("blur",this.blurEventArgs),this.mask&&(this.isFocus=!1,this.placeholder)&&this.element.value===this.promptMask&&"Always"!==this.floatLabelType&&(b.call(this,""),t=this.element.parentNode.querySelector(".e-float-text"),"Auto"===this.floatLabelType)&&!C.isNullOrUndefined(t)&&t.classList.contains(Vt)&&C.removeClass([t],Vt)}function ee(s){var n,a,r,l=this;this.mask&&!this.readonly&&(n=this.element.selectionStart,a=this.element.selectionEnd,r=this.element.value,b.call(this,""),this._callPasteHandler=!0,setTimeout(function(){var t=l.element.value.replace(/ /g,""),e=(0<l.redoCollec.length&&l.redoCollec[0].value===l.element.value&&(t=p.call(l,l.element)),b.call(l,r),l.element.selectionStart=n,l.element.selectionEnd=a,0);for(l.maskKeyPress=!0;ce.call(l,t[e],!1,null),++e<t.length;);if(l.maskKeyPress=!1,l._callPasteHandler=!1,l.element.value===r){var i=0;for(l.maskKeyPress=!0;ce.call(l,t[i],!1,null),++i<t.length;);l.maskKeyPress=!1}else ue.call(l,s,r)},1))}function ie(t){var e,i,s,n,a=this;this.mask&&!this.readonly&&(e=this.element.value,i=this.element.selectionStart,s=this.element.selectionEnd,this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),n=this.element.value.substring(0,i)+this.promptMask.substring(i,s)+this.element.value.substring(s),setTimeout(function(){b.call(a,n),a.element.selectionStart=a.element.selectionEnd=i,a.element.value!==e&&ue.call(a,t,null)},0))}function se(t){t.preventDefault()}function ne(t){if(!0!==C.Browser.isIE||""!==this.element.value||"Never"!==this.floatLabelType)if(C.extend(t,{ctrlKey:!1,keyCode:229}),this.mask){if(""===this.element.value&&this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),1===this.element.value.length&&(this.element.value=this.element.value+this.promptMask,this.element.setSelectionRange(1,1)),this._callPasteHandler||oe.call(this,t),this.element.value.length>this.promptMask.length){for(var e=this.element.selectionStart,i=this.element.value.length-this.promptMask.length,s=this.element.value.substring(e-i,e),n=(this.maskKeyPress=!1,0);ce.call(this,s[n],t.ctrlKey,t),++n<s.length;);this.element.value!==this.preEleVal&&ue.call(this,t,null)}i=p.call(this,this.element);this.prevValue=i,""===(this.value=i)&&(b.call(this,this.promptMask),this.element.setSelectionRange(0,0))}}function ae(t){var e,i;this.mask&&!this.readonly&&(229!==t.keyCode&&(!t.ctrlKey||89!==t.keyCode&&90!==t.keyCode||t.preventDefault(),oe.call(this,t)),e=this.element.value,!t.ctrlKey||89!==t.keyCode&&90!==t.keyCode||(i=void 0,90===t.keyCode&&0<this.undoCollec.length&&e!==this.undoCollec[this.undoCollec.length-1].value?(i=this.undoCollec[this.undoCollec.length-1],this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),b.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.undoCollec.splice(this.undoCollec.length-1,1)):89===t.keyCode&&0<this.redoCollec.length&&e!==this.redoCollec[0].value&&(i=this.redoCollec[0],this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),b.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.redoCollec.splice(0,1))))}function re(){var t,e=this.element.selectionStart,i=this.element.selectionEnd;0<this.redoCollec.length?(t=this.redoCollec[0],b.call(this,t.value),t.startIndex-e==1?(this.element.selectionStart=t.startIndex,this.element.selectionEnd=t.endIndex):(this.element.selectionStart=e+1,this.element.selectionEnd=i+1)):(b.call(this,this.promptMask),this.element.selectionStart=this.element.selectionEnd=e)}function le(t,e,i){return"input"===i.type&&(t=!1,e=this.element.value,b.call(this,this.promptMask),ye.call(this,e)),t}function oe(t){var e,i=!1,s=!1,n=(this.element.value.length<this.promptMask.length&&(e=this.element.value,i=le.call(this,i=!0,e,t),re.call(this)),this.element.value.length>=this.promptMask.length&&"input"===t.type&&(i=le.call(this,i,e,t)),this.element.selectionStart),a=this.element.selectionEnd,r=this.element.selectionStart,l=this.element.selectionEnd,o=this.hiddenMask.replace(/[>|\\<]/g,""),h=o[r-1],u=this.element.selectionEnd;if(i||8===t.keyCode||46===t.keyCode){this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:l});var p=!1,d=this.element.value;if(0<r||(8===t.keyCode||46===t.keyCode)&&r<this.element.value.length&&this.element.selectionEnd-r!==this.element.value.length){var c=r;r!==l?(r=l,46===t.keyCode&&(p=!0)):46===t.keyCode?++c:--c;for(var m=r;8===t.keyCode||i||p?c<m:m<c;8===t.keyCode||i||p?m--:m++)for(var v=r;8===t.keyCode||i||p?0<v:v<this.element.value.length;8===t.keyCode||i||p?v--:v++){var f,g,y=void 0;(8===t.keyCode||p)&&(n!==a&&n!==r||n===a)||i?(h=o[v-1],y=r-1):(h=o[v],y=r,++r),this.element.value[y];if(C.isNullOrUndefined(this.regExpCollec[""+h])&&!C.isNullOrUndefined(this.customCharacters)&&C.isNullOrUndefined(this.customCharacters[""+h])&&this.hiddenMask[y]!==this.promptChar&&"["!==this.customRegExpCollec[y][0]&&"]"!==this.customRegExpCollec[y][this.customRegExpCollec[y].length-1]||this.promptMask[y]!==this.promptChar&&C.isNullOrUndefined(this.customCharacters)?(this.element.selectionStart=this.element.selectionEnd=y,t.preventDefault(),46!==t.keyCode||p||++this.element.selectionStart):(f=this.element.value,g=this.promptChar,g=f.substring(0,y)+g+f.substring(r,f.length),b.call(this,g),t.preventDefault(),46!==t.keyCode||p||y++,this.element.selectionStart=this.element.selectionEnd=y,s=!0),r=this.element.selectionStart,!s&&8===t.keyCode||p||!s&&46!==t.keyCode?y=r-1:(y=r,s=!1),f=this.element.value[y],n!==a&&this.element.selectionStart===n||this.promptMask[y]===this.promptChar||f!==this.promptMask[y]&&this.promptMask[y]!==this.promptChar&&!C.isNullOrUndefined(this.customCharacters))break}}46===t.keyCode&&p&&s&&(this.element.selectionStart=this.element.selectionEnd=u),0===this.element.selectionStart&&this.element.selectionEnd===this.element.value.length&&(b.call(this,this.promptMask),t.preventDefault(),this.element.selectionStart=this.element.selectionEnd=r),this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),this.element.value!==d&&ue.call(this,t,e)}}function he(t){var e,i;this.mask&&!this.readonly&&(e=this.element.value,(!t.ctrlKey&&!t.metaKey||(t.ctrlKey||t.metaKey)&&"KeyA"!==t.code&&"KeyY"!==t.code&&"KeyZ"!==t.code&&"KeyX"!==t.code&&"KeyC"!==t.code&&"KeyV"!==t.code)&&(this.maskKeyPress=!0,(i="Spacebar"===(i=t.key)?String.fromCharCode(t.keyCode):i)?1===i.length&&(ce.call(this,i,t.ctrlKey,t),t.preventDefault()):(this.isIosInvalid=!0,ce.call(this,String.fromCharCode(t.keyCode),t.ctrlKey,t),t.preventDefault(),this.isIosInvalid=!1),32===t.keyCode)&&" "===i&&" "===this.promptChar&&(this.element.selectionStart=this.element.selectionEnd=this.element.selectionStart-i.length),this.element.value!==e)&&ue.call(this,t,e)}function ue(t,e){var i,s=this.isProtectedOnChange;C.isNullOrUndefined(this.changeEventArgs)||this.isInitial||(this.changeEventArgs={value:this.element.value,maskedValue:this.element.value,isInteraction:!(i={}),isInteracted:!1},this.mask&&(this.changeEventArgs.value=p.call(this,this.element)),C.isNullOrUndefined(t)||(this.changeEventArgs.isInteracted=!0,this.changeEventArgs.isInteraction=!0,this.changeEventArgs.event=t),this.isProtectedOnChange=!0,this.value=this.changeEventArgs.value,this.isProtectedOnChange=s,C.merge(i,this.changeEventArgs),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",i)),this.preEleVal=this.element.value,this.prevValue=p.call(this,this.element)}function pe(t){var e,i,s,n,a,r,l,o;this.mask&&!this.readonly?(s=void 0,this.maskKeyPress||229!==t.keyCode?ge.call(this):(a=void 0,1===this.element.value.length&&(this.element.value=this.element.value+this.promptMask,this.element.setSelectionRange(1,1)),this.element.value.length>this.promptMask.length&&(i=this.element.selectionStart,e=this.element.value.length-this.promptMask.length,i=this.element.value.substring(i-e,i),0<this.undoCollec.length?(s=this.undoCollec[this.undoCollec.length-1],n=this.element.selectionStart,a=s.value,l=s.value.substring(n-e,n),s=this.redoCollec[0],i=i.trim(),(r=C.Browser.isAndroid&&""===i)||l===i||s.value.substring(n-e,n)===i?r&&ve.call(this,t,n-1,this.element.selectionEnd-1,i,t.ctrlKey,!1):ce.call(this,i,t.ctrlKey,t)):(a=this.promptMask,ce.call(this,i,t.ctrlKey,t)),this.maskKeyPress=!1,ue.call(this,t,a))),l=p.call(this,this.element),(0!==this.element.selectionStart||this.promptMask!==this.element.value||""!==l||""===l&&this.value!==l)&&(this.prevValue=l,this.value=l)):ue.call(this,t),0===this.element.selectionStart&&0===this.element.selectionEnd&&(o=this.element,setTimeout(function(){o.setSelectionRange(0,0)},0))}function de(t){this.maskKeyPress||!function(t){var e;1<t.length&&this.promptMask.length+t.length<this.element.value.length&&(e=this.redoCollec[0].value.substring(0,this.redoCollec[0].startIndex)+t+this.redoCollec[0].value.substring(this.redoCollec[0].startIndex,this.redoCollec[0].value.length),b.call(this,e),this.element.selectionStart=this.element.selectionEnd=this.redoCollec[0].startIndex+t.length),this.element.selectionStart=this.element.selectionStart-t.length,this.element.selectionEnd=this.element.selectionEnd-t.length}.call(this,t)}function ce(t,e,i){if(de.call(this,t),!C.isNullOrUndefined(this)&&!C.isNullOrUndefined(t))for(var s,n=p=this.element.selectionStart,a=!1,r=this.element.value,l=!1,o=!1,h=0;h<t.length;h++){var u=t[h],p=this.element.selectionStart;if(this.maskKeyPress||n!==p||(p+=h),!this.maskKeyPress||p<this.promptMask.length){for(var d,c,m=p;m<this.promptMask.length;m++){var v=this.escapeMaskValue[p];"\\"===this.hiddenMask[p]&&this.hiddenMask[p+1]===t&&(o=!0),(C.isNullOrUndefined(this.regExpCollec[""+v])&&(C.isNullOrUndefined(this.customCharacters)||!C.isNullOrUndefined(this.customCharacters)&&C.isNullOrUndefined(this.customCharacters[""+v]))&&this.hiddenMask[p]!==this.promptChar&&"["!==this.customRegExpCollec[p][0]&&"]"!==this.customRegExpCollec[p][this.customRegExpCollec[p].length-1]||this.promptMask[p]!==this.promptChar&&C.isNullOrUndefined(this.customCharacters)||this.promptChar===v&&this.escapeMaskValue===this.mask)&&(this.element.selectionStart=this.element.selectionEnd=p+1,p=this.element.selectionStart,v=this.hiddenMask[p])}if(C.isNullOrUndefined(this.customCharacters)||C.isNullOrUndefined(this.customCharacters[""+v]))(!C.isNullOrUndefined(this.regExpCollec[""+v])&&u.match(new RegExp(this.regExpCollec[""+v]))&&this.promptMask[p]===this.promptChar||this.promptMask[p]===this.promptChar&&"["===this.customRegExpCollec[p][0]&&"]"===this.customRegExpCollec[p][this.customRegExpCollec[p].length-1]&&u.match(new RegExp(this.customRegExpCollec[p])))&&(a=!0);else for(var f=this.customCharacters[""+v].split(","),m=0;m<f.length;m++)if(u.match(new RegExp("["+f[m]+"]"))){a=!0;break}(!this.maskKeyPress||p<this.hiddenMask.length)&&a?(0===h&&(this.maskKeyPress?this.undoCollec.push({value:r,startIndex:p,endIndex:p}):(d=this.element.selectionStart,c=this.element.selectionEnd,0<this.redoCollec.length?(s=this.redoCollec[0].value,b.call(this,s),this.undoCollec.push(this.redoCollec[0])):(this.undoCollec.push({value:this.promptMask,startIndex:p,endIndex:p}),s=this.promptMask,b.call(this,s)),this.element.selectionStart=d,this.element.selectionEnd=c)),p=this.element.selectionStart,me.call(this,i,p,u,s,o),l=!0,h===t.length-1&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),a=!1):(p=this.element.selectionStart,ve.call(this,i,p,n,t,e,l)),h!==t.length-1||a||(!C.Browser.isAndroid||C.Browser.isAndroid&&p<this.promptMask.length)&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd})}else 1!==t.length||e||C.isNullOrUndefined(i)||fe.call(this)}}function me(t,e,i,s,n){this.hiddenMask.length>this.promptMask.length&&(i=function(t,e){var i,s,n=e,a=0;for(s=0;s<this.hiddenMask.length;s++)if("\\"===this.hiddenMask[s]&&(i=n.substring(0,s)+"\\"+n.substring(s,n.length)),">"!==this.hiddenMask[s]&&"<"!==this.hiddenMask[s]&&"|"!==this.hiddenMask[s]||(this.hiddenMask[s]!==n[s]&&(i=n.substring(0,s)+this.hiddenMask[s]+n.substring(s,n.length)),++a),i){if(i[s]===this.promptChar&&s>this.element.selectionStart||this.element.value.indexOf(this.promptChar)<0&&this.element.selectionStart+a===s){a=0;break}n=i}for(;0<=s&&i;){if(0===s||"\\"!==i[s-1]){if(">"===i[s]){t=t.toUpperCase();break}if("<"===i[s]){t=t.toLowerCase();break}if("|"===i[s])break}--s}return t}.call(this,i,this.element.value)),n||(i=(n=this.element.value).substring(0,e)+i+n.substring(e+1,n.length),b.call(this,i),this.element.selectionStart=this.element.selectionEnd=e+1)}function ve(t,e,i,s,n,a){var r;this.maskKeyPress||(r=this.element.value,e>=this.promptMask.length?b.call(this,r.substring(0,e)):(i===e?b.call(this,r.substring(0,e)+r.substring(e+1,r.length)):this.promptMask.length===this.element.value.length?b.call(this,r.substring(0,e)+r.substring(e,r.length)):b.call(this,r.substring(0,i)+r.substring(i+1,r.length)),this.element.selectionStart=this.element.selectionEnd=a||this.element.value[i]!==this.promptChar?e:i),fe.call(this)),1!==s.length||n||C.isNullOrUndefined(t)||fe.call(this)}function fe(){var t=this,e=this.element.parentNode,i=200;e.classList.contains(Ut)||e.classList.contains(Rt)?C.addClass([e],Bt):C.addClass([this.element],Bt),!0===this.isIosInvalid&&(i=400),C.attributes(this.element,{"aria-invalid":"true"}),setTimeout(function(){t.maskKeyPress||ge.call(t)},i)}function ge(){var t=this.element.parentNode;C.isNullOrUndefined(t)||C.removeClass([t],Bt),C.removeClass([this.element],Bt),C.attributes(this.element,{"aria-invalid":"false"})}function ye(t){if(this.mask&&void 0!==t&&(void 0===this.prevValue||this.prevValue!==t)){if(this.maskKeyPress=!0,b.call(this,this.promptMask),""===t||null===t&&"Never"===this.floatLabelType&&this.placeholder||(this.element.selectionStart=0,this.element.selectionEnd=0),null!==t)for(var e=0;e<t.length;e++)ce.call(this,t[e],!1,null);var i=p.call(this,this.element),i=(this.prevValue=i,this.value=i,ue.call(this,null,null),this.maskKeyPress=!1,this.element.parentNode.querySelector(".e-float-text"));this.element.value===this.promptMask&&"Auto"===this.floatLabelType&&this.placeholder&&!C.isNullOrUndefined(i)&&i.classList.contains(Vt)&&!this.isFocus&&(C.removeClass([i],Vt),C.addClass([i],Ft),b.call(this,""))}(null===this.mask||""===this.mask&&void 0!==this.value)&&b.call(this,this.value)}function b(t,e){!this.isFocus&&"Auto"===this.floatLabelType&&this.placeholder&&C.isNullOrUndefined(this.value)&&(t="");var i=p.call(this,e||this.element,t);null===i||""===i?(o.Input.setValue(t,e||this.element,this.floatLabelType,!1),this.showClearButton&&this.inputObj.clearButton.classList.add("e-clear-icon-hide")):o.Input.setValue(t,e||this.element,this.floatLabelType,this.showClearButton)}function be(t){C.addClass([t.element],It);t={element:t.element,mask:t.mask,promptMask:"",hiddenMask:"",escapeMaskValue:"",promptChar:t.promptChar?1<t.promptChar.length?t.promptChar=t.promptChar[0]:t.promptChar:"_",value:t.value||null,regExpCollec:Mt,customRegExpCollec:[],customCharacters:t.customCharacters,undoCollec:[],redoCollec:[],maskKeyPress:!1,prevValue:""};return Dt.call(t),t}function Ce(t){var e;return e=!C.isNullOrUndefined(t)&&t.element.classList.contains(It)?be(t):e}function Ee(){}xe=function(t,e){return(xe=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var xe,Se,xt=function(t,e){function i(){this.constructor=t}xe(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},t=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Te="e-input-focus",Pe=["title","style","class"],xt=(Se=C.Component,xt(i,Se),i.prototype.getModuleName=function(){return"maskedtextbox"},i.prototype.preRender=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.regExpCollec=Mt,this.customRegExpCollec=[],this.maskedRegExp=[],this.undoCollec=[],this.redoCollec=[],this.changeEventArgs={},this.focusEventArgs={},this.blurEventArgs={},this.maskKeyPress=!1,this.isFocus=!1,this.isInitial=!1,this.isIosInvalid=!1;var t=C.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),C.removeClass([this.cloneElement],["e-control","e-maskedtextbox","e-lib"]),this.angularTagName=null,this.formElement=C.closest(this.element,"form"),"EJS-MASKEDTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;for(var e=this.createElement("input"),i=0;i<this.element.attributes.length;i++)e.setAttribute(this.element.attributes[i].nodeName,this.element.attributes[i].nodeValue),e.innerHTML=this.element.innerHTML;this.element.hasAttribute("id")&&this.element.removeAttribute("id"),this.element.hasAttribute("name")&&this.element.removeAttribute("name"),this.element.classList.remove("e-control","e-maskedtextbox"),this.element.classList.add("e-mask-container"),this.element.appendChild(e),this.element=e,C.setValue("ej2_instances",t,this.element)}this.updateHTMLAttrToElement(),this.checkHtmlAttributes(!1),this.formElement&&(this.initInputValue=this.value)},i.prototype.getPersistData=function(){return this.addOnPersist(["value"])},i.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&("Never"===this.floatLabelType&&C.addClass([this.element],"e-input"),this.createWrapper(),this.updateHTMLAttrToWrapper(),""===this.element.name&&this.element.setAttribute("name",this.element.id),this.isInitial=!0,this.resetMaskedTextBox(),this.isInitial=!1,this.setMaskPlaceholder(!0,!1),this.setWidth(this.width),this.preEleVal=this.element.value,C.Browser.isDevice||"11.0"!==C.Browser.info.version&&"edge"!==C.Browser.info.name||this.element.blur(),C.Browser.isDevice&&C.Browser.isIos&&this.element.blur(),(this.element.getAttribute("value")||this.value)&&this.element.setAttribute("value",this.element.value),!C.isNullOrUndefined(C.closest(this.element,"fieldset"))&&C.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","maskedtextbox"),this.renderComplete())},i.prototype.updateHTMLAttrToElement=function(){if(!C.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i=e[t];Pe.indexOf(i)<0&&this.element.setAttribute(i,this.htmlAttributes[""+i])}},i.prototype.updateCssClass=function(t,e){o.Input.setCssClass(this.getValidClassList(t),[this.inputObj.container],this.getValidClassList(e))},i.prototype.getValidClassList=function(t){var e=t;return e=C.isNullOrUndefined(t)||""===t?e:t.replace(/\s+/g," ").trim()},i.prototype.updateHTMLAttrToWrapper=function(){if(!C.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i,s=e[t];-1<Pe.indexOf(s)&&("class"===s?""!==(i=this.htmlAttributes[""+s].replace(/\s+/g," ").trim())&&C.addClass([this.inputObj.container],i.split(" ")):"style"===s?(i=this.inputObj.container.getAttribute(s),i=C.isNullOrUndefined(i)?this.htmlAttributes[""+s]:i+this.htmlAttributes[""+s],this.inputObj.container.setAttribute(s,i)):this.inputObj.container.setAttribute(s,this.htmlAttributes[""+s]))}},i.prototype.resetMaskedTextBox=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.customRegExpCollec=[],this.undoCollec=[],this.redoCollec=[],this.promptChar&&1<this.promptChar.length&&(this.promptChar=this.promptChar[0]),Dt.call(this),zt.call(this),(null===this.mask||""===this.mask&&void 0!==this.value)&&b.call(this,this.value);var t=p.call(this,this.element);this.prevValue=t,this.value=t,this.isInitial||qt.call(this),Wt.call(this)},i.prototype.setMaskPlaceholder=function(t,e){(e||this.placeholder)&&(o.Input.setPlaceholder(this.placeholder,this.element),this.element.value===this.promptMask&&t&&"Always"!==this.floatLabelType||this.element.value===this.promptMask&&"Never"===this.floatLabelType)&&b.call(this,"")},i.prototype.setWidth=function(t){C.isNullOrUndefined(t)||("number"==typeof t?(this.inputObj.container.style.width=C.formatUnit(t),this.element.style.width=C.formatUnit(t)):"string"==typeof t&&(t=t.match(/px|%|em/)?t:C.formatUnit(t),this.inputObj.container.style.width=t,this.element.style.width=t))},i.prototype.checkHtmlAttributes=function(t){for(var e=0,i=t?C.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"];e<i.length;e++){var s,n=i[e];if(!C.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"placeholder":(C.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"disabled":(C.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n),this.setProperties({enabled:s},!t));break;case"value":(C.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.value||t)&&this.setProperties({value:this.element.value},!t);break;case"readonly":(C.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.readonly||t)&&(s="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n),this.setProperties({readonly:s},!t))}}},i.prototype.createWrapper=function(){var t=this.cssClass;C.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=this.getValidClassList(this.cssClass)),this.inputObj=o.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{enableRtl:this.enableRtl,cssClass:t,enabled:this.enabled,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}},this.createElement),this.inputObj.container.setAttribute("class","e-control-wrapper e-mask "+this.inputObj.container.getAttribute("class"))},i.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"value":ye.call(this,this.value),this.placeholder&&!this.isFocus&&this.setMaskPlaceholder(!1,!1),""===this.value&&null!=e.value&&(this.element.selectionStart=0,this.element.selectionEnd=0);break;case"placeholder":this.setMaskPlaceholder(!0,!0);break;case"width":this.setWidth(t.width),o.Input.calculateWidth(this.element,this.inputObj.container);break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"enabled":o.Input.setEnabled(t.enabled,this.element,this.floatLabelType,this.inputObj.container);break;case"readonly":o.Input.setReadonly(t.readonly,this.element);break;case"enableRtl":o.Input.setEnableRtl(t.enableRtl,[this.inputObj.container]);break;case"customCharacters":this.customCharacters=t.customCharacters,this.resetMaskedTextBox();break;case"showClearButton":o.Input.setClearButton(t.showClearButton,this.element,this.inputObj,void 0,this.createElement),jt.call(this);break;case"floatLabelType":this.floatLabelType=t.floatLabelType,o.Input.removeFloating(this.inputObj),o.Input.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement);break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkHtmlAttributes(!0);break;case"mask":var n=this.value;this.mask=t.mask,this.maskedRegExp=[],this.updateValue(n);break;case"promptChar":1<t.promptChar.length&&(t.promptChar=t.promptChar[0]),t.promptChar?this.promptChar=t.promptChar:this.promptChar="_";n=this.element.value.replace(new RegExp("["+e.promptChar+"]","g"),this.promptChar);this.promptMask===this.element.value&&(n=this.promptMask.replace(new RegExp("["+e.promptChar+"]","g"),this.promptChar)),this.promptMask=this.promptMask.replace(new RegExp("["+e.promptChar+"]","g"),this.promptChar),this.undoCollec=this.redoCollec=[],b.call(this,n)}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},i.prototype.updateValue=function(t){this.resetMaskedTextBox(),ye.call(this,t)},i.prototype.getMaskedValue=function(){return Kt.call(this,this.element)},i.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.isFocus=!0,this.element.focus(),C.addClass([this.inputObj.container],[Te]))},i.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.isFocus=!1,this.element.blur(),C.removeClass([this.inputObj.container],[Te]))},i.prototype.destroy=function(){qt.call(this),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]);for(var t=["aria-labelledby","role","autocomplete","aria-readonly","aria-disabled","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-invalid"],e=0;e<t.length;e++)this.element.removeAttribute(t[e]);this.element.classList.remove("e-input"),this.inputObj&&(this.inputObj.container.insertAdjacentElement("afterend",this.element),C.detach(this.inputObj.container)),this.blurEventArgs=null,o.Input.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),this.changeEventArgs=null,this.inputObj=null,Se.prototype.destroy.call(this)},t([C.Property(null)],i.prototype,"cssClass",void 0),t([C.Property(null)],i.prototype,"width",void 0),t([C.Property(null)],i.prototype,"placeholder",void 0),t([C.Property("Never")],i.prototype,"floatLabelType",void 0),t([C.Property({})],i.prototype,"htmlAttributes",void 0),t([C.Property(!0)],i.prototype,"enabled",void 0),t([C.Property(!1)],i.prototype,"readonly",void 0),t([C.Property(!1)],i.prototype,"showClearButton",void 0),t([C.Property(!1)],i.prototype,"enablePersistence",void 0),t([C.Property(null)],i.prototype,"mask",void 0),t([C.Property("_")],i.prototype,"promptChar",void 0),t([C.Property(null)],i.prototype,"value",void 0),t([C.Property(null)],i.prototype,"customCharacters",void 0),t([C.Event()],i.prototype,"created",void 0),t([C.Event()],i.prototype,"destroyed",void 0),t([C.Event()],i.prototype,"change",void 0),t([C.Event()],i.prototype,"focus",void 0),t([C.Event()],i.prototype,"blur",void 0),t([C.NotifyPropertyChanges],i));function i(t,e){e=Se.call(this,t,e)||this;return e.initInputValue="",e.preventChange=!1,e.isClicked=!1,e.maskOptions=t,e}ke=function(t,e){return(ke=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var ke,Oe,t=function(t,e){function i(){this.constructor=t}ke(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},s=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Le=(Oe=C.ChildProperty,t(we,Oe),s([C.Property("None")],we.prototype,"placement",void 0),s([C.Property(10)],we.prototype,"largeStep",void 0),s([C.Property(1)],we.prototype,"smallStep",void 0),s([C.Property(!1)],we.prototype,"showSmallTicks",void 0),s([C.Property(null)],we.prototype,"format",void 0),we);function we(){return null!==Oe&&Oe.apply(this,arguments)||this}Ae=C.ChildProperty,t(He,Ae),s([C.Property(null)],He.prototype,"color",void 0),s([C.Property(null)],He.prototype,"start",void 0),s([C.Property(null)],He.prototype,"end",void 0);var Ae,Ne=He;function He(){return null!==Ae&&Ae.apply(this,arguments)||this}Be=C.ChildProperty,t(Re,Be),s([C.Property(!1)],Re.prototype,"enabled",void 0),s([C.Property(null)],Re.prototype,"minStart",void 0),s([C.Property(null)],Re.prototype,"minEnd",void 0),s([C.Property(null)],Re.prototype,"maxStart",void 0),s([C.Property(null)],Re.prototype,"maxEnd",void 0),s([C.Property(!1)],Re.prototype,"startHandleFixed",void 0),s([C.Property(!1)],Re.prototype,"endHandleFixed",void 0);var Be,Ue=Re;function Re(){return null!==Be&&Be.apply(this,arguments)||this}Ie=C.ChildProperty,t(Fe,Ie),s([C.Property("")],Fe.prototype,"cssClass",void 0),s([C.Property("Before")],Fe.prototype,"placement",void 0),s([C.Property("Focus")],Fe.prototype,"showOn",void 0),s([C.Property(!1)],Fe.prototype,"isVisible",void 0),s([C.Property(null)],Fe.prototype,"format",void 0);var Ie,Ve=Fe;function Fe(){return null!==Ie&&Ie.apply(this,arguments)||this}var Me,De="e-slider",ze="e-rtl",We="e-slider-input",qe="e-control-wrapper",je="e-handle",_e="e-range",Xe="e-slider-button",Ke="e-first-button",Ye="e-second-button",Ze="e-scale",Ge="e-tick",Je="e-large",$e="e-tick-value",Qe="e-slider-tooltip",ti="e-slider-hover",ei="e-handle-first",ii="e-handle-second",si="e-disabled",ni="e-slider-container",ai="e-slider-horizontal-before",ri="e-slider-horizontal-after",li="e-slider-vertical-before",oi="e-slider-vertical-after",hi="e-material-tooltip-open",ui="e-tooltip-active",pi="e-material-slider",di="e-slider-track",ci="e-slider-horizantal-color",mi="e-slider-vertical-color",vi="e-handle-focused",fi="e-vertical",gi="e-horizontal",yi="e-handle-start",bi="e-material-tooltip-start",a="e-tab-handle",Ci="e-button-icon",Ei="e-small-size",xi="e-tick-pos",Si="e-first-tick",Ti="e-last-tick",Pi="e-slider-btn",ki="e-tab-track",Oi="e-tab-range",Li="e-handle-active",wi="e-material-handle",Ai="e-material-range",Ni="e-material-default",Hi="e-material-tooltip-show",Bi="e-material-tooltip-hide",Ui="e-read-only",Ri="e-limits",Ii="e-limit-bar",Vi="e-limit-first",Fi="e-limit-second",Mi="e-drag-horizontal",Di="e-drag-vertical",zi=(Me=C.Component,t(r,Me),r.prototype.preRender=function(){this.l10n=new C.L10n("slider",{incrementTitle:"Increase",decrementTitle:"Decrease"},this.locale),this.isElementFocused=!1,this.tickElementCollection=[],this.tooltipFormatInfo={},this.ticksFormatInfo={},this.initCultureInfo(),this.initCultureFunc(),this.formChecker()},r.prototype.formChecker=function(){var t=C.closest(this.element,"form");t?(this.isForm=!0,C.isNullOrUndefined(this.formResetValue)||this.setProperties({value:this.formResetValue},!0),this.formResetValue=this.value,"Range"!==this.type||!C.isNullOrUndefined(this.formResetValue)&&"object"==typeof this.formResetValue?C.isNullOrUndefined(this.formResetValue)&&(this.formResetValue=parseFloat(C.formatUnit(this.min))):this.formResetValue=[parseFloat(C.formatUnit(this.min)),parseFloat(C.formatUnit(this.max))],this.formElement=t):this.isForm=!1},r.prototype.initCultureFunc=function(){this.internationalization=new C.Internationalization(this.locale)},r.prototype.initCultureInfo=function(){this.tooltipFormatInfo.format=C.isNullOrUndefined(this.tooltip.format)?null:this.tooltip.format,this.ticksFormatInfo.format=C.isNullOrUndefined(this.ticks.format)?null:this.ticks.format},r.prototype.formatString=function(t,e){var i,s=null,n=null;return!t&&0!==t||(s=this.formatNumber(t),i=this.numberOfDecimals(t),n=this.internationalization.getNumberFormat(e)(this.makeRoundNumber(t,i))),{elementVal:s,formatString:n}},r.prototype.formatNumber=function(t){var e=this.numberOfDecimals(t);return this.internationalization.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(t)},r.prototype.numberOfDecimals=function(t){t=t.toString().split(".")[1];return t&&t.length?t.length:0},r.prototype.makeRoundNumber=function(t,e){return Number(t.toFixed(e||0))},r.prototype.fractionalToInteger=function(t){t=0===this.numberOfDecimals(t)?Number(t).toFixed(this.noOfDecimals):t;for(var e=1,i=0;i<this.noOfDecimals;i++)e*=10;return t=Number((t*e).toFixed(0))},r.prototype.render=function(){var t=this;this.initialize(),this.initRender(),this.wireEvents(),this.setZindex(),this.renderComplete(),"EJS-SLIDER"===this.element.tagName&&"none"===this.getTheme(this.sliderContainer)&&setTimeout(function(){t.refresh()},0)},r.prototype.initialize=function(){C.addClass([this.element],De),this.setCSSClass()},r.prototype.setElementWidth=function(t){C.isNullOrUndefined(t)||C.isNullOrUndefined(this.sliderContainer)||("number"==typeof t?this.sliderContainer.style.width=C.formatUnit(t):"string"==typeof t&&(this.sliderContainer.style.width=t.match(/px|%|em/)?t:C.formatUnit(t)))},r.prototype.setCSSClass=function(t){t&&C.removeClass([this.element],t.split(" ")),this.cssClass&&C.addClass([this.element],this.cssClass.split(" "))},r.prototype.setEnabled=function(){this.enabled?(C.removeClass([this.sliderContainer],[si]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.remove(si),this.wireEvents()):(C.addClass([this.sliderContainer],[si]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.add(si),this.unwireEvents())},r.prototype.getTheme=function(t){return window.getComputedStyle(t,":after").getPropertyValue("content").replace(/['"]+/g,"")},r.prototype.initRender=function(){this.sliderContainer=this.createElement("div",{className:ni+" "+qe}),this.element.parentNode.insertBefore(this.sliderContainer,this.element),this.sliderContainer.appendChild(this.element),this.sliderTrack=this.createElement("div",{className:di}),this.element.appendChild(this.sliderTrack),this.setElementWidth(this.width),this.element.tabIndex=-1,this.getThemeInitialization(),this.setHandler(),this.createRangeBar(),this.limits.enabled&&this.createLimitBar(),this.setOrientClass(),this.hiddenInput=this.createElement("input",{attrs:{type:"hidden",value:C.isNullOrUndefined(this.value)?C.isNullOrUndefined(this.min)?"0":this.min.toString():this.value.toString(),name:this.element.getAttribute("name")||this.element.getAttribute("id")||"_"+(1e3*Math.random()).toFixed(0)+"slider",class:We}}),this.hiddenInput.tabIndex=-1,this.sliderContainer.appendChild(this.hiddenInput),this.showButtons&&this.setButtons(),this.setEnableRTL(),"Range"===this.type?this.rangeValueUpdate():this.value=C.isNullOrUndefined(this.value)?C.isNullOrUndefined(this.min)?0:parseFloat(C.formatUnit(this.min.toString())):this.value,this.previousVal="Range"!==this.type?this.checkHandleValue(parseFloat(C.formatUnit(this.value.toString()))):[this.checkHandleValue(parseFloat(C.formatUnit(this.value[0].toString()))),this.checkHandleValue(parseFloat(C.formatUnit(this.value[1].toString())))],this.previousChanged=this.previousVal,C.isNullOrUndefined(this.element.hasAttribute("name"))||this.element.removeAttribute("name"),this.setValue(),this.limits.enabled&&this.setLimitBar(),"None"!==this.ticks.placement&&this.renderScale(),this.tooltip.isVisible&&this.renderTooltip(),this.enabled?C.removeClass([this.sliderContainer],[si]):C.addClass([this.sliderContainer],[si]),this.readonly?C.addClass([this.sliderContainer],[Ui]):C.removeClass([this.sliderContainer],[Ui])},r.prototype.getThemeInitialization=function(){this.isMaterial="material"===this.getTheme(this.sliderContainer)||"material-dark"===this.getTheme(this.sliderContainer),this.isMaterial3="Material3"===this.getTheme(this.sliderContainer)||"Material3-dark"===this.getTheme(this.sliderContainer),this.isBootstrap="bootstrap"===this.getTheme(this.sliderContainer)||"bootstrap-dark"===this.getTheme(this.sliderContainer),this.isBootstrap4="bootstrap4"===this.getTheme(this.sliderContainer),this.isTailwind="tailwind"===this.getTheme(this.sliderContainer)||"tailwind-dark"===this.getTheme(this.sliderContainer),this.isBootstrap5="bootstrap5"===this.getTheme(this.sliderContainer),this.isFluent="FluentUI"===this.getTheme(this.sliderContainer),this.isFluent2="fluent2"===this.getTheme(this.sliderContainer),this.isBootstrap5Dot3="bootstrap5.3"===this.getTheme(this.sliderContainer),this.isMaterialTooltip=(this.isMaterial||this.isMaterial3)&&"Range"!==this.type&&this.tooltip.isVisible},r.prototype.createRangeBar=function(){"Default"!==this.type&&(this.rangeBar=this.createElement("div",{attrs:{class:_e}}),this.element.appendChild(this.rangeBar),this.drag)&&"Range"===this.type&&("Horizontal"===this.orientation?this.rangeBar.classList.add(Mi):this.rangeBar.classList.add(Di))},r.prototype.createLimitBar=function(){var t="Range"!==this.type?Ii:Vi;t+=" "+Ri,this.limitBarFirst=this.createElement("div",{attrs:{class:t}}),this.element.appendChild(this.limitBarFirst),"Range"===this.type&&(this.limitBarSecond=this.createElement("div",{attrs:{class:Fi+" "+Ri}}),this.element.appendChild(this.limitBarSecond))},r.prototype.setOrientClass=function(){"Vertical"!==this.orientation?(this.sliderContainer.classList.remove(fi),this.sliderContainer.classList.add(gi),this.firstHandle.setAttribute("aria-orientation","horizontal"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","horizontal")):(this.sliderContainer.classList.remove(gi),this.sliderContainer.classList.add(fi),this.firstHandle.setAttribute("aria-orientation","vertical"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","vertical"))},r.prototype.setAriaAttributes=function(t){var i=this,e=this.min,s=this.max;!C.isNullOrUndefined(this.customValues)&&0<this.customValues.length&&(e=this.customValues[0],s=this.customValues[this.customValues.length-1]),"Range"!==this.type?C.attributes(t,{"aria-valuemin":C.isNullOrUndefined(e)?"0":e.toString(),"aria-valuemax":C.isNullOrUndefined(s)?"100":s.toString()}):(!C.isNullOrUndefined(this.customValues)&&0<this.customValues.length?[[e.toString(),this.customValues[this.value[1]].toString()],[this.customValues[this.value[0]].toString(),s.toString()]]:[[e.toString(),this.value[1].toString()],[this.value[0].toString(),s.toString()]]).forEach(function(t,e){e=0===e?i.firstHandle:i.secondHandle;e&&C.attributes(e,{"aria-valuemin":t[0],"aria-valuemax":t[1]})})},r.prototype.createSecondHandle=function(){this.secondHandle=this.createElement("div",{attrs:{class:je,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.secondHandle.classList.add(ii),this.element.appendChild(this.secondHandle)},r.prototype.createFirstHandle=function(){this.firstHandle=this.createElement("div",{attrs:{class:je,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.firstHandle.classList.add(ei),this.element.appendChild(this.firstHandle),this.isMaterialTooltip&&(this.materialHandle=this.createElement("div",{attrs:{class:je+" "+wi}}),this.element.appendChild(this.materialHandle))},r.prototype.wireFirstHandleEvt=function(t){t?(C.EventHandler.remove(this.firstHandle,"mousedown touchstart",this.handleFocus),C.EventHandler.remove(this.firstHandle,"transitionend",this.transitionEnd),C.EventHandler.remove(this.firstHandle,"mouseenter touchenter",this.handleOver),C.EventHandler.remove(this.firstHandle,"mouseleave touchend",this.handleLeave)):(C.EventHandler.add(this.firstHandle,"mousedown touchstart",this.handleFocus,this),C.EventHandler.add(this.firstHandle,"transitionend",this.transitionEnd,this),C.EventHandler.add(this.firstHandle,"mouseenter touchenter",this.handleOver,this),C.EventHandler.add(this.firstHandle,"mouseleave touchend",this.handleLeave,this))},r.prototype.wireSecondHandleEvt=function(t){t?(C.EventHandler.remove(this.secondHandle,"mousedown touchstart",this.handleFocus),C.EventHandler.remove(this.secondHandle,"transitionend",this.transitionEnd),C.EventHandler.remove(this.secondHandle,"mouseenter touchenter",this.handleOver),C.EventHandler.remove(this.secondHandle,"mouseleave touchend",this.handleLeave)):(C.EventHandler.add(this.secondHandle,"mousedown touchstart",this.handleFocus,this),C.EventHandler.add(this.secondHandle,"transitionend",this.transitionEnd,this),C.EventHandler.add(this.secondHandle,"mouseenter touchenter",this.handleOver,this),C.EventHandler.add(this.secondHandle,"mouseleave touchend",this.handleLeave,this))},r.prototype.handleStart=function(){"Range"!==this.type&&(this.firstHandle.classList[0===this.handlePos1?"add":"remove"](yi),this.isMaterialTooltip)&&(this.materialHandle.classList[0===this.handlePos1?"add":"remove"](yi),this.tooltipElement)&&this.tooltipElement.classList[0===this.handlePos1?"add":"remove"](bi)},r.prototype.transitionEnd=function(t){"transform"!==t.propertyName&&(this.handleStart(),this.enableAnimation||(this.getHandle().style.transition="none"),"Default"!==this.type&&(this.rangeBar.style.transition="none"),(this.isMaterial||this.isMaterial3)&&this.tooltip.isVisible&&"Default"===this.type&&(this.tooltipElement.style.transition=this.transition.handle),this.tooltipToggle(this.getHandle()),this.closeTooltip())},r.prototype.handleFocusOut=function(){this.firstHandle.classList.contains(vi)&&this.firstHandle.classList.remove(vi),"Range"===this.type&&this.secondHandle.classList.contains(vi)&&this.secondHandle.classList.remove(vi)},r.prototype.handleFocus=function(t){this.focusSliderElement(),this.sliderBarClick(t),(t.currentTarget===this.firstHandle?(this.firstHandle.classList.add(vi),this.firstHandle):(this.secondHandle.classList.add(vi),this.secondHandle)).classList.add(a),C.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),C.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},r.prototype.handleOver=function(t){this.tooltip.isVisible&&"Hover"===this.tooltip.showOn&&this.tooltipToggle(t.currentTarget),"Default"===this.type&&this.tooltipToggle(this.getHandle())},r.prototype.handleLeave=function(t){!this.tooltip.isVisible||"Hover"!==this.tooltip.showOn||t.currentTarget.classList.contains(vi)||t.currentTarget.classList.contains(a)||this.closeTooltip()},r.prototype.setHandler=function(){this.createFirstHandle(),"Range"===this.type&&this.createSecondHandle()},r.prototype.setEnableRTL=function(){this.enableRtl&&"Vertical"!==this.orientation?C.addClass([this.sliderContainer],ze):C.removeClass([this.sliderContainer],ze);var t="Vertical"!==this.orientation?this.horDir:this.verDir;this.enableRtl?this.horDir="right":this.horDir="left",this.verDir="bottom",t!==("Vertical"!==this.orientation?this.horDir:this.verDir)&&"Horizontal"===this.orientation&&(C.setStyleAttribute(this.firstHandle,{right:"",left:"auto"}),"Range"===this.type)&&C.setStyleAttribute(this.secondHandle,{top:"",left:"auto"}),this.setBarColor()},r.prototype.tooltipValue=function(){var e,i=this,t={value:this.value,text:""};this.initialTooltip&&(this.initialTooltip=!1,this.setTooltipContent(),t.text=e="function"==typeof this.tooltipObj.content?this.tooltipObj.content():this.tooltipObj.content,this.trigger("tooltipChange",t,function(t){i.addTooltipClass(t.text),e!==t.text&&(i.customAriaText=t.text,i.enableHtmlSanitizer?t.text=C.SanitizeHtmlHelper.sanitize(t.text.toString()):t.text=t.text.toString(),i.tooltipObj.content=C.initializeCSPTemplate(function(){return t.text}),i.setAriaAttrValue(i.firstHandle),"Range"===i.type)&&i.setAriaAttrValue(i.secondHandle)}),this.isMaterialTooltip)&&this.setPreviousVal("change",this.value)},r.prototype.setTooltipContent=function(){var t=this.formatContent(this.tooltipFormatInfo,!1);this.tooltipObj.content=C.initializeCSPTemplate(function(){return t})},r.prototype.formatContent=function(t,e){var i="",s=this.handleVal1,n=this.handleVal2;return!C.isNullOrUndefined(this.customValues)&&0<this.customValues.length&&(s=this.customValues[this.handleVal1],n=this.customValues[this.handleVal2]),e?"Range"===this.type?i=this.enableRtl&&"Vertical"!==this.orientation?C.isNullOrUndefined(this.tooltip)||C.isNullOrUndefined(this.tooltip.format)?n.toString()+" - "+s.toString():this.formatString(n,t).elementVal+" - "+this.formatString(s,t).elementVal:C.isNullOrUndefined(this.tooltip)||C.isNullOrUndefined(this.tooltip.format)?s.toString()+" - "+n.toString():this.formatString(s,t).elementVal+" - "+this.formatString(n,t).elementVal:C.isNullOrUndefined(s)||(i=C.isNullOrUndefined(this.tooltip)||C.isNullOrUndefined(this.tooltip.format)?s.toString():this.formatString(s,t).elementVal):"Range"===this.type?i=this.enableRtl&&"Vertical"!==this.orientation?C.isNullOrUndefined(t.format)?n.toString()+" - "+s.toString():this.formatString(n,t).formatString+" - "+this.formatString(s,t).formatString:C.isNullOrUndefined(t.format)?s.toString()+" - "+n.toString():this.formatString(s,t).formatString+" - "+this.formatString(n,t).formatString:C.isNullOrUndefined(s)||(i=C.isNullOrUndefined(t.format)?s.toString():this.formatString(s,t).formatString),i},r.prototype.addTooltipClass=function(t){var e;this.isMaterialTooltip&&(t=t.toString().length,this.tooltipElement?(e=4<t?{oldCss:Ni,newCss:Ai}:{oldCss:Ai,newCss:Ni},this.tooltipElement.classList.remove(e.oldCss),this.tooltipElement.classList.contains(e.newCss)||(this.tooltipElement.classList.add(e.newCss),this.tooltipElement.style.transform=4<t?"scale(1)":this.getTooltipTransformProperties(this.previousTooltipClass).rotate)):(e=4<t?Ai:Ni,this.tooltipObj.cssClass=Qe+" "+e))},r.prototype.tooltipPlacement=function(){return"Horizontal"===this.orientation?"Before"===this.tooltip.placement?"TopCenter":"BottomCenter":"Before"===this.tooltip.placement?"LeftCenter":"RightCenter"},r.prototype.tooltipBeforeOpen=function(t){this.tooltipElement=t.element,this.tooltip.cssClass&&C.addClass([this.tooltipElement],this.tooltip.cssClass.split(" ").filter(function(t){return t})),t.target.removeAttribute("aria-describedby"),this.isMaterialTooltip&&(this.tooltipElement.firstElementChild.classList.add(Bi),this.handleStart(),this.setTooltipTransform())},r.prototype.tooltipCollision=function(t){if(this.isBootstrap||this.isBootstrap4||(this.isMaterial||this.isMaterial3)&&!this.isMaterialTooltip){var e=this.isBootstrap4?3:6;switch(t){case"TopCenter":this.tooltipObj.setProperties({offsetY:-e},!1);break;case"BottomCenter":this.tooltipObj.setProperties({offsetY:e},!1);break;case"LeftCenter":this.tooltipObj.setProperties({offsetX:-e},!1);break;case"RightCenter":this.tooltipObj.setProperties({offsetX:e},!1)}}},r.prototype.materialTooltipEventCallBack=function(t){this.sliderBarClick(t),C.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),C.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},r.prototype.wireMaterialTooltipEvent=function(t){this.isMaterialTooltip&&(t?C.EventHandler.remove(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack):C.EventHandler.add(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack,this))},r.prototype.tooltipPositionCalculation=function(t){var e;switch(t){case"TopCenter":e=ai;break;case"BottomCenter":e=ri;break;case"LeftCenter":e=li;break;case"RightCenter":e=oi}return e},r.prototype.getTooltipTransformProperties=function(t){var e;return this.tooltipElement&&(e="Horizontal"===this.orientation?this.tooltipElement.clientHeight+14-this.tooltipElement.clientHeight/2:this.tooltipElement.clientWidth+14-this.tooltipElement.clientWidth/2,e="Horizontal"===this.orientation?t===ai?{rotate:"rotate(45deg)",translate:"translateY("+e+"px)"}:{rotate:"rotate(225deg)",translate:"translateY("+-e+"px)"}:t===li?{rotate:"rotate(-45deg)",translate:"translateX("+e+"px)"}:{rotate:"rotate(-225deg)",translate:"translateX("+-e+"px)"}),e},r.prototype.openMaterialTooltip=function(){var t,e=this;this.isMaterialTooltip&&(this.refreshTooltip(this.firstHandle),(t=this.tooltipElement.firstElementChild).classList.remove(Bi),t.classList.add(Hi),this.firstHandle.style.cursor="default",this.tooltipElement.style.transition=this.scaleTransform,this.tooltipElement.classList.add(hi),this.materialHandle.style.transform="scale(0)",4<t.innerText.length?this.tooltipElement.style.transform="scale(1)":this.tooltipElement.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate,"Default"===this.type?setTimeout(function(){e.tooltipElement&&(e.tooltipElement.style.transition=e.transition.handle)},2500):setTimeout(function(){e.tooltipElement&&(e.tooltipElement.style.transition="none")},2500))},r.prototype.closeMaterialTooltip=function(){var t,e=this;this.isMaterialTooltip&&(t=this.tooltipElement.firstElementChild,this.tooltipElement.style.transition=this.scaleTransform,t.classList.remove(Hi),t.classList.add(Bi),this.firstHandle.style.cursor="-webkit-grab",this.firstHandle.style.cursor="grab",this.materialHandle&&(this.materialHandle.style.transform="scale(1)"),this.tooltipElement.classList.remove(hi),this.setTooltipTransform(),this.tooltipTarget=void 0,setTimeout(function(){e.tooltipElement&&(e.tooltipElement.style.transition="none")},2500))},r.prototype.checkTooltipPosition=function(t){var e=this.tooltipPositionCalculation(t.collidedPosition);void 0!==this.tooltipCollidedPosition&&this.tooltipCollidedPosition===t.collidedPosition&&t.element.classList.contains(e)||(this.isMaterialTooltip&&(void 0!==e&&(t.element.classList.remove(this.previousTooltipClass),t.element.classList.add(e),this.previousTooltipClass=e),t.element.style.transform)&&t.element.classList.contains(hi)&&t.element.firstElementChild.innerText.length<=4&&(t.element.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate),this.tooltipCollidedPosition=t.collidedPosition),this.isMaterialTooltip&&this.tooltipElement&&-1!==this.tooltipElement.style.transform.indexOf("translate")&&this.setTooltipTransform()},r.prototype.setTooltipTransform=function(){var t=this.getTooltipTransformProperties(this.previousTooltipClass);C.isNullOrUndefined(this.tooltipElement)||(4<this.tooltipElement.firstElementChild.innerText.length?this.tooltipElement.style.transform=t.translate+" scale(0.01)":this.tooltipElement.style.transform=t.translate+" "+t.rotate+" scale(0.01)")},r.prototype.renderTooltip=function(){this.tooltipObj=new h.Tooltip({showTipPointer:this.isBootstrap||this.isMaterial||this.isMaterial3||this.isBootstrap4||this.isTailwind||this.isBootstrap5||this.isFluent||this.isFluent2||this.isBootstrap5Dot3,cssClass:Qe,height:this.isMaterial||this.isMaterial3?30:"auto",animation:{open:{effect:"None"},close:{effect:"FadeOut",duration:500}},opensOn:"Custom",beforeOpen:this.tooltipBeforeOpen.bind(this),beforeCollision:this.checkTooltipPosition.bind(this),beforeClose:this.tooltipBeforeClose.bind(this),enableHtmlSanitizer:this.enableHtmlSanitizer}),this.tooltipObj.appendTo(this.firstHandle),this.initializeTooltipProps()},r.prototype.initializeTooltipProps=function(){var t="Auto"===this.tooltip.showOn?"Hover":this.tooltip.showOn;this.setProperties({tooltip:{showOn:t}},!0),this.tooltipObj.position=this.tooltipPlacement(),this.tooltipCollision(this.tooltipObj.position),[this.firstHandle,this.rangeBar,this.secondHandle].forEach(function(t){C.isNullOrUndefined(t)||(t.style.transition="none")}),this.isMaterialTooltip&&(this.sliderContainer.classList.add(pi),this.tooltipValue(),this.tooltipObj.animation.close.effect="None",this.tooltipObj.open(this.firstHandle))},r.prototype.tooltipBeforeClose=function(){this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0},r.prototype.setButtons=function(){this.firstBtn=this.createElement("div",{className:Xe+" "+Ke}),this.firstBtn.appendChild(this.createElement("span",{className:Ci})),this.isTailwind&&this.firstBtn.querySelector("span").classList.add("e-icons"),this.firstBtn.tabIndex=-1,this.secondBtn=this.createElement("div",{className:Xe+" "+Ye}),this.secondBtn.appendChild(this.createElement("span",{className:Ci})),this.isTailwind&&this.secondBtn.querySelector("span").classList.add("e-icons"),this.secondBtn.tabIndex=-1,this.sliderContainer.classList.add(Pi),this.sliderContainer.appendChild(this.firstBtn),this.sliderContainer.appendChild(this.secondBtn),this.sliderContainer.appendChild(this.element),this.buttonTitle()},r.prototype.buttonTitle=function(){var t=this.enableRtl&&"Vertical"!==this.orientation,e=(this.l10n.setLocale(this.locale),this.l10n.getConstant("decrementTitle")),i=this.l10n.getConstant("incrementTitle");C.attributes(t?this.secondBtn:this.firstBtn,{"aria-label":e,title:e}),C.attributes(t?this.firstBtn:this.secondBtn,{"aria-label":i,title:i})},r.prototype.buttonFocusOut=function(){(this.isMaterial||this.isMaterial3)&&this.getHandle().classList.remove("e-large-thumb-size")},r.prototype.repeatButton=function(t){var e,i=this.handleValueUpdate(),s=this.enableRtl&&"Vertical"!==this.orientation;t.target.parentElement.classList.contains(Ke)||t.target.classList.contains(Ke)?e=s?this.add(i,parseFloat(this.step.toString()),!0):this.add(i,parseFloat(this.step.toString()),!1):(t.target.parentElement.classList.contains(Ye)||t.target.classList.contains(Ye))&&(e=s?this.add(i,parseFloat(this.step.toString()),!1):this.add(i,parseFloat(this.step.toString()),!0)),(e=this.limits.enabled?this.getLimitCorrectedValues(e):e)>=this.min&&e<=this.max&&(this.changeHandleValue(e),this.tooltipToggle(this.getHandle()))},r.prototype.repeatHandlerMouse=function(t){t.preventDefault(),"mousedown"!==t.type&&"touchstart"!==t.type||(this.buttonClick(t),this.repeatInterval=setInterval(this.repeatButton.bind(this),180,t))},r.prototype.materialChange=function(){this.getHandle().classList.contains("e-large-thumb-size")||this.getHandle().classList.add("e-large-thumb-size")},r.prototype.focusHandle=function(){this.getHandle().classList.contains(a)||this.getHandle().classList.add(a)},r.prototype.repeatHandlerUp=function(t){this.changeEvent("changed",t),this.closeTooltip(),clearInterval(this.repeatInterval),this.getHandle().focus()},r.prototype.customTickCounter=function(t){var e=4;return e=!C.isNullOrUndefined(this.customValues)&&0<this.customValues.length&&(4<t&&(e=3),7<t&&(e=2),14<t&&(e=1),28<t)?0:e},r.prototype.renderScale=function(){var t="Vertical"===this.orientation?"v":"h",e=(this.noOfDecimals=this.numberOfDecimals(this.step),this.ul=this.createElement("ul",{className:Ze+" e-"+t+"-scale "+Ge+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation","aria-hidden":"true"}}),this.ul.style.zIndex="-1",C.Browser.isAndroid&&"h"==t&&this.ul.classList.add(xi),this.ticks.smallStep),i=(this.ticks.showSmallTicks?e<=0&&(e=parseFloat(C.formatUnit(this.step))):e=0<this.ticks.largeStep?this.ticks.largeStep:parseFloat(C.formatUnit(this.max))-parseFloat(C.formatUnit(this.min)),this.fractionalToInteger(this.min)),s=this.fractionalToInteger(this.max),n=this.fractionalToInteger(e),a=!C.isNullOrUndefined(this.customValues)&&0<this.customValues.length&&this.customValues.length-1,r=this.customTickCounter(a),l=!C.isNullOrUndefined(this.customValues)&&0<this.customValues.length?a*r+a:Math.abs((s-i)/n),o=(this.element.appendChild(this.ul),parseFloat(this.min.toString())),h=("v"==t&&(o=parseFloat(this.max.toString())),0),u=100/l;u===1/0&&(u=5);for(var p=0,d=!C.isNullOrUndefined(this.customValues)&&0<this.customValues.length?this.customValues.length-1:0,c=0;p<=l;p++){var m,v,f=this.createElement("li",{attrs:{class:Ge,role:"presentation","aria-hidden":"true"}}),g=(!C.isNullOrUndefined(this.customValues)&&0<this.customValues.length?(v=p%(r+1)==0)&&("h"==t?(o=this.customValues[c],c++):(o=this.customValues[d],d--),f.setAttribute("title",o.toString())):(f.setAttribute("title",o.toString()),v=0===this.numberOfDecimals(this.max)&&0===this.numberOfDecimals(this.min)&&0===this.numberOfDecimals(this.step)?"h"==t?(o-parseFloat(this.min.toString()))%this.ticks.largeStep==0:Math.abs(o-parseFloat(this.max.toString()))%this.ticks.largeStep==0:(m=this.fractionalToInteger(this.ticks.largeStep),b=this.fractionalToInteger(o),"h"==t?(b-i)%m==0:Math.abs(b-parseFloat(s.toString()))%m==0)),v&&f.classList.add(Je),"h"==t?f.style.width=u+"%":f.style.height=u+"%",v?"Both"===this.ticks.placement?2:1:0);if(v)for(var y=0;y<g;y++)this.createTick(f,o);else C.isNullOrUndefined(this.customValues)&&this.formatTicksValue(f,o);this.ul.appendChild(f),this.tickElementCollection.push(f);var b=void 0;C.isNullOrUndefined(this.customValues)&&(b=this.numberOfDecimals(e)>this.numberOfDecimals(o)?this.numberOfDecimals(e):this.numberOfDecimals(o),o="h"==t||this.min>this.max?this.makeRoundNumber(o+e,b):this.makeRoundNumber(o-e,b),h=this.makeRoundNumber(h+e,b))}this.ticksAlignment(t,u)},r.prototype.ticksAlignment=function(t,e,i){void 0===i&&(i=!0),this.firstChild=this.ul.firstElementChild,this.lastChild=this.ul.lastElementChild,this.firstChild.classList.add(Si),this.lastChild.classList.add(Ti),this.sliderContainer.classList.add(Ze+"-"+this.ticks.placement.toLowerCase()),"h"===t?(this.firstChild.style.width=e/2+"%",this.lastChild.style.width=e/2+"%"):(this.firstChild.style.height=e/2+"%",this.lastChild.style.height=e/2+"%");t={ticksWrapper:this.ul,tickElements:this.tickElementCollection};i&&this.trigger("renderedTicks",t),this.scaleAlignment()},r.prototype.createTick=function(t,e){var i=this.createElement("span",{className:$e+" "+Ge+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation","aria-hidden":"true"}});t.appendChild(i),C.isNullOrUndefined(this.customValues)?this.formatTicksValue(t,e,i):this.enableHtmlSanitizer?i.innerHTML=C.SanitizeHtmlHelper.sanitize(e.toString()):i.innerHTML=e.toString()},r.prototype.formatTicksValue=function(e,t,i){var s=this,n=this.formatNumber(t),n=C.isNullOrUndefined(this.ticks)||C.isNullOrUndefined(this.ticks.format)?n:this.formatString(t,this.ticksFormatInfo).formatString;this.trigger("renderingTicks",{value:t,text:n,tickElement:e},function(t){e.setAttribute("title",t.text.toString()),i&&(s.enableHtmlSanitizer?i.innerHTML=C.SanitizeHtmlHelper.sanitize(t.text.toString()):i.innerHTML=t.text.toString())})},r.prototype.scaleAlignment=function(){this.tickValuePosition(),"Vertical"===this.orientation?this.element.getBoundingClientRect().width<=15?this.sliderContainer.classList.add(Ei):this.sliderContainer.classList.remove(Ei):this.element.getBoundingClientRect().height<=15?this.sliderContainer.classList.add(Ei):this.sliderContainer.classList.remove(Ei)},r.prototype.tickValuePosition=function(){this.firstChild=this.element.querySelector("ul").children[0];for(var t,e,i=this.firstChild.getBoundingClientRect(),s=this.ticks.smallStep,s=Math.abs(parseFloat(C.formatUnit(this.max))-parseFloat(C.formatUnit(this.min)))/s,n=(0<this.firstChild.children.length&&(t=this.firstChild.children[0].getBoundingClientRect()),[this.sliderContainer.querySelectorAll("."+Ge+"."+Je+" ."+$e)]),a="Both"===this.ticks.placement?[].slice.call(n[0],2):[].slice.call(n[0],1),r="Vertical"===this.orientation?2*i.height:2*i.width,l=0;l<this.firstChild.children.length;l++)"Vertical"===this.orientation?this.firstChild.children[l].style.top=-t.height/2+"px":this.enableRtl?this.firstChild.children[l].style.left=(r-this.firstChild.children[l].getBoundingClientRect().width)/2+"px":this.firstChild.children[l].style.left=-t.width/2+"px";for(l=0;l<a.length;l++)e=a[l].getBoundingClientRect(),"Vertical"===this.orientation?C.setStyleAttribute(a[l],{top:(r-e.height)/2+"px"}):C.setStyleAttribute(a[l],{left:(r-e.width)/2+"px"});this.enableRtl&&this.lastChild.children.length&&0!=s&&(this.lastChild.children[0].style.left=-this.lastChild.getBoundingClientRect().width/2+"px","Both"===this.ticks.placement)&&(this.lastChild.children[1].style.left=-this.lastChild.getBoundingClientRect().width/2+"px"),0==s&&("Horizontal"===this.orientation&&(this.enableRtl?(this.firstChild.classList.remove(Ti),this.firstChild.style.right=this.firstHandle.style.right,this.firstChild.children[0].style.left=this.firstChild.getBoundingClientRect().width/2+2+"px","Both"===this.ticks.placement&&(this.firstChild.children[1].style.left=this.firstChild.getBoundingClientRect().width/2+2+"px")):(this.firstChild.classList.remove(Ti),this.firstChild.style.left=this.firstHandle.style.left)),"Vertical"===this.orientation)&&this.firstChild.classList.remove(Ti)},r.prototype.setAriaAttrValue=function(t){var e=!C.isNullOrUndefined(this.ticks)&&!C.isNullOrUndefined(this.ticks.format),i=e?this.formatContent(this.tooltipFormatInfo,!1):this.formatContent(this.ticksFormatInfo,!1),e=e?this.formatContent(this.ticksFormatInfo,!0):this.formatContent(this.tooltipFormatInfo,!0),s=2===(i=this.customAriaText||i).split(" - ").length?i.split(" - "):[i,i];this.setAriaAttributes(t),"Range"!==this.type?C.attributes(t,{"aria-valuenow":e,"aria-valuetext":i}):this.enableRtl?t===this.firstHandle?C.attributes(t,{"aria-valuenow":e.split(" - ")[1],"aria-valuetext":s[1]}):C.attributes(t,{"aria-valuenow":e.split(" - ")[0],"aria-valuetext":s[0]}):t===this.firstHandle?C.attributes(t,{"aria-valuenow":e.split(" - ")[0],"aria-valuetext":s[0]}):C.attributes(t,{"aria-valuenow":e.split(" - ")[1],"aria-valuetext":s[1]})},r.prototype.handleValueUpdate=function(){var t="Range"!==this.type||1===this.activeHandle?this.handleVal1:this.handleVal2;return t},r.prototype.getLimitCorrectedValues=function(t){return t=("MinRange"===this.type||"Default"===this.type||1===this.activeHandle?this.getLimitValueAndPosition(t,this.limits.minStart,this.limits.minEnd):this.getLimitValueAndPosition(t,this.limits.maxStart,this.limits.maxEnd))[0]},r.prototype.focusSliderElement=function(){this.isElementFocused||(this.element.focus(),this.isElementFocused=!0)},r.prototype.buttonClick=function(t){this.focusSliderElement();var e,i=this.enableRtl&&"Vertical"!==this.orientation,s=this.handleValueUpdate();40===t.keyCode||37===t.keyCode||t.currentTarget.classList.contains(Ke)?e=i?this.add(s,parseFloat(this.step.toString()),!0):this.add(s,parseFloat(this.step.toString()),!1):38===t.keyCode||39===t.keyCode||t.currentTarget.classList.contains(Ye)?e=i?this.add(s,parseFloat(this.step.toString()),!1):this.add(s,parseFloat(this.step.toString()),!0):33===t.keyCode||t.currentTarget.classList.contains(Ke)?e=i?this.add(s,parseFloat(this.ticks.largeStep.toString()),!1):this.add(s,parseFloat(this.ticks.largeStep.toString()),!0):34===t.keyCode||t.currentTarget.classList.contains(Ye)?e=i?this.add(s,parseFloat(this.ticks.largeStep.toString()),!0):this.add(s,parseFloat(this.ticks.largeStep.toString()),!1):36===t.keyCode?e=parseFloat((this.min<this.max?this.min:this.max).toString()):35===t.keyCode&&(e=parseFloat((this.min<this.max?this.max:this.min).toString())),this.limits.enabled&&(e=this.getLimitCorrectedValues(e)),this.changeHandleValue(e),!this.isMaterial&&!this.isMaterial3||this.tooltip.isVisible||this.getHandle().classList.contains(a)||this.materialChange(),this.tooltipToggle(this.getHandle()),this.getHandle().focus(),this.focusHandle(),t.currentTarget.classList.contains(Ke)&&C.EventHandler.add(this.firstBtn,"mouseup touchend",this.buttonUp,this),t.currentTarget.classList.contains(Ye)&&C.EventHandler.add(this.secondBtn,"mouseup touchend",this.buttonUp,this)},r.prototype.tooltipToggle=function(t){this.isMaterialTooltip?this.tooltipElement.classList.contains(hi)?this.refreshTooltip(this.firstHandle):this.openMaterialTooltip():this.tooltipElement?this.refreshTooltip(t):this.openTooltip(t)},r.prototype.buttonUp=function(t){t.currentTarget.classList.contains(Ke)&&C.EventHandler.remove(this.firstBtn,"mouseup touchend",this.buttonUp),t.currentTarget.classList.contains(Ye)&&C.EventHandler.remove(this.secondBtn,"mouseup touchend",this.buttonUp)},r.prototype.setRangeBar=function(){"Horizontal"!==this.orientation||C.isNullOrUndefined(this.rangeBar)?C.isNullOrUndefined(this.rangeBar)||("MinRange"===this.type?(this.rangeBar.style.bottom=this.min>this.max?this.handlePos1+"px":"0px",C.setStyleAttribute(this.rangeBar,{height:C.isNullOrUndefined(this.handlePos1)?0:this.min>this.max?this.element.clientHeight-this.handlePos1+"px":this.handlePos1+"px"})):(this.rangeBar.style.bottom=this.min>this.max?this.handlePos2+"px":this.handlePos1+"px",C.setStyleAttribute(this.rangeBar,{height:this.min>this.max?this.handlePos1-this.handlePos2+"px":this.handlePos2-this.handlePos1+"px"}))):"MinRange"===this.type?(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",C.setStyleAttribute(this.rangeBar,{width:C.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):(this.enableRtl?this.rangeBar.style.right=this.handlePos1+"px":this.rangeBar.style.left=this.handlePos1+"px",C.setStyleAttribute(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"}))},r.prototype.checkValidValueAndPos=function(t){return t=this.checkHandleValue(t),t=this.checkHandlePosition(t)},r.prototype.setLimitBarPositions=function(t,e,i,s){"Horizontal"===this.orientation?(this.enableRtl?this.limitBarFirst.style.right=t+"px":this.limitBarFirst.style.left=t+"px",this.limitBarFirst.style.width=e-t+"px"):(this.limitBarFirst.style.bottom=(this.min<this.max?t:e)+"px",this.limitBarFirst.style.height=(this.min<this.max?e-t:t-e)+"px"),"Range"===this.type&&("Horizontal"===this.orientation?(this.enableRtl?this.limitBarSecond.style.right=i+"px":this.limitBarSecond.style.left=i+"px",this.limitBarSecond.style.width=s-i+"px"):(this.limitBarSecond.style.bottom=(this.min<this.max?i:s)+"px",this.limitBarSecond.style.height=(this.min<this.max?s-i:i-s)+"px"))},r.prototype.setLimitBar=function(){var t,e,i,s;"Default"===this.type||"MinRange"===this.type?(t=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0],t=this.checkValidValueAndPos(t),e=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0],e=this.checkValidValueAndPos(e),this.setLimitBarPositions(t,e)):"Range"===this.type&&(t=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0],t=this.checkValidValueAndPos(t),e=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0],e=this.checkValidValueAndPos(e),i=this.getLimitValueAndPosition(this.limits.maxStart,this.limits.maxStart,this.limits.maxEnd,!0)[0],i=this.checkValidValueAndPos(i),s=this.getLimitValueAndPosition(this.limits.maxEnd,this.limits.maxStart,this.limits.maxEnd,!0)[0],s=this.checkValidValueAndPos(s),this.setLimitBarPositions(t,e,i,s))},r.prototype.getLimitValueAndPosition=function(t,e,i,s){return C.isNullOrUndefined(e)&&(e=this.min<this.max?this.min:this.max,C.isNullOrUndefined(t))&&s&&(t=e),C.isNullOrUndefined(i)&&(i=this.min<this.max?this.max:this.min,C.isNullOrUndefined(t))&&s&&(t=i),[t=i<(t=t<e?e:t)?i:t,this.checkHandlePosition(t)]},r.prototype.setValue=function(){var t;!C.isNullOrUndefined(this.customValues)&&0<this.customValues.length&&(this.min=0,this.max=this.customValues.length-1,this.setBarColor()),this.setAriaAttributes(this.firstHandle),this.handleVal1=C.isNullOrUndefined(this.value)?this.checkHandleValue(parseFloat(this.min.toString())):this.checkHandleValue(parseFloat(this.value.toString())),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.preHandlePos1=this.handlePos1,C.isNullOrUndefined(this.activeHandle)&&(this.activeHandle="Range"===this.type?2:1),"Default"===this.type||"MinRange"===this.type?(this.limits.enabled&&(t=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd),this.handleVal1=t[0],this.handlePos1=t[1],this.preHandlePos1=this.handlePos1),this.setHandlePosition(null),this.handleStart(),this.value=this.handleVal1,this.setAriaAttrValue(this.firstHandle),this.changeEvent("changed",null)):this.validateRangeValue(),"Default"!==this.type&&this.setRangeBar(),this.limits.enabled&&this.setLimitBar()},r.prototype.rangeValueUpdate=function(){null!==this.value&&"object"==typeof this.value||(this.value=[parseFloat(C.formatUnit(this.min)),parseFloat(C.formatUnit(this.max))])},r.prototype.validateRangeValue=function(){this.rangeValueUpdate(),this.setRangeValue()},r.prototype.modifyZindex=function(){"Range"!==this.type||C.isNullOrUndefined(this.firstHandle)||C.isNullOrUndefined(this.secondHandle)?this.isMaterialTooltip&&this.tooltipElement&&(this.tooltipElement.style.zIndex=h.getZindexPartial(this.element)+""):1===this.activeHandle?(this.firstHandle.style.zIndex=this.zIndex+4+"",this.secondHandle.style.zIndex=this.zIndex+3+""):(this.firstHandle.style.zIndex=this.zIndex+3+"",this.secondHandle.style.zIndex=this.zIndex+4+"")},r.prototype.setHandlePosition=function(t){var e=this,i=1===this.activeHandle?this.handlePos1:this.handlePos2,s=this.isMaterialTooltip?[this.firstHandle,this.materialHandle]:[this.getHandle()];this.handleStart(),s.forEach(function(t){C.isNullOrUndefined(t)||("Horizontal"===e.orientation?e.enableRtl?t.style.right=i+"px":t.style.left=i+"px":t.style.bottom=i+"px")}),this.changeEvent("change",t)},r.prototype.getHandle=function(){return 1===this.activeHandle?this.firstHandle:this.secondHandle},r.prototype.setRangeValue=function(){this.updateRangeValue(),this.activeHandle=1,this.setHandlePosition(null),this.activeHandle=2,this.setHandlePosition(null),this.activeHandle=1},r.prototype.changeEvent=function(t,e){var i,s="change"===t?this.previousVal:this.previousChanged;"Range"!==this.type?(this.setProperties({value:this.handleVal1},!0),s===this.value||this.isMaterialTooltip&&this.initialTooltip||(this.trigger(t,this.changeEventArgs(t,e)),this.initialTooltip=!0,this.setPreviousVal(t,this.value)),this.setAriaAttrValue(this.firstHandle)):(i=this.value=[this.handleVal1,this.handleVal2],this.setProperties({value:i},!0),(s.length===this.value.length&&this.value[0]!==s[0]||this.value[1]!==s[1])&&(this.initialTooltip=!1,this.trigger(t,this.changeEventArgs(t,e)),this.initialTooltip=!0,this.setPreviousVal(t,this.value)),this.setAriaAttrValue(this.getHandle())),this.hiddenInput.value=this.value.toString()},r.prototype.changeEventArgs=function(t,e){t=this.tooltip.isVisible&&this.tooltipObj&&this.initialTooltip?(this.tooltipValue(),{value:this.value,previousValue:"change"===t?this.previousVal:this.previousChanged,action:t,text:"function"==typeof this.tooltipObj.content?this.tooltipObj.content():this.tooltipObj.content,isInteracted:!C.isNullOrUndefined(e)}):{value:this.value,previousValue:"change"===t?this.previousVal:this.previousChanged,action:t,text:C.isNullOrUndefined(this.ticksFormatInfo.format)?this.value.toString():"Range"!==this.type?this.formatString(this.value,this.ticksFormatInfo).formatString:this.formatString(this.value[0],this.ticksFormatInfo).formatString+" - "+this.formatString(this.value[1],this.ticksFormatInfo).formatString,isInteracted:!C.isNullOrUndefined(e)};return t},r.prototype.setPreviousVal=function(t,e){"change"===t?this.previousVal=e:this.previousChanged=e},r.prototype.updateRangeValue=function(){var t=this.value.toString().split(",").map(Number);this.enableRtl&&"Vertical"!==this.orientation||this.rtl?this.value=[t[1],t[0]]:this.value=[t[0],t[1]],this.enableRtl&&"Vertical"!==this.orientation?(this.handleVal1=this.checkHandleValue(this.value[1]),this.handleVal2=this.checkHandleValue(this.value[0])):(this.handleVal1=this.checkHandleValue(this.value[0]),this.handleVal2=this.checkHandleValue(this.value[1])),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handlePos2=this.checkHandlePosition(this.handleVal2),this.min<this.max&&this.handlePos1>this.handlePos2&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.min>this.max&&this.handlePos1<this.handlePos2&&(this.handlePos2=this.handlePos1,this.handleVal2=this.handleVal1),this.preHandlePos1=this.handlePos1,this.preHandlePos2=this.handlePos2,this.limits.enabled&&(this.activeHandle=1,t=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd),this.handleVal1=t[0],this.handlePos1=t[1],this.preHandlePos1=this.handlePos1,this.activeHandle=2,t=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=t[0],this.handlePos2=t[1],this.preHandlePos2=this.handlePos2)},r.prototype.checkHandlePosition=function(t){return t=100*(t-parseFloat(C.formatUnit(this.min)))/(parseFloat(C.formatUnit(this.max))-parseFloat(C.formatUnit(this.min))),t="Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(t/100):this.element.getBoundingClientRect().height*(t/100),t=parseFloat(C.formatUnit(this.max))===parseFloat(C.formatUnit(this.min))?"Horizontal"===this.orientation?this.element.getBoundingClientRect().width:this.element.getBoundingClientRect().height:t},r.prototype.checkHandleValue=function(t){var e;return this.min===this.max?parseFloat(C.formatUnit(this.max)):(t<(e=this.tempStartEnd()).start?t=e.start:t>e.end&&(t=e.end),t)},r.prototype.reposition=function(){var t=this;C.isNullOrUndefined(this.firstHandle)||(this.firstHandle.style.transition="none"),"Default"===this.type||C.isNullOrUndefined(this.rangeBar)||(this.rangeBar.style.transition="none"),"Range"!==this.type||C.isNullOrUndefined(this.secondHandle)||(this.secondHandle.style.transition="none"),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handleVal2&&(this.handlePos2=this.checkHandlePosition(this.handleVal2)),"Horizontal"===this.orientation?(this.enableRtl?this.firstHandle.style.right=this.handlePos1+"px":this.firstHandle.style.left=this.handlePos1+"px",this.isMaterialTooltip&&!C.isNullOrUndefined(this.materialHandle)&&(this.enableRtl?this.materialHandle.style.right=this.handlePos1+"px":this.materialHandle.style.left=this.handlePos1+"px"),"MinRange"!==this.type||C.isNullOrUndefined(this.rangeBar)?"Range"!==this.type||C.isNullOrUndefined(this.secondHandle)||C.isNullOrUndefined(this.rangeBar)||(this.enableRtl?(this.secondHandle.style.right=this.handlePos2+"px",this.rangeBar.style.right=this.handlePos1+"px"):(this.secondHandle.style.left=this.handlePos2+"px",this.rangeBar.style.left=this.handlePos1+"px"),C.setStyleAttribute(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"})):(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",C.setStyleAttribute(this.rangeBar,{width:C.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"}))):(this.firstHandle.style.bottom=this.handlePos1+"px",this.isMaterialTooltip&&(this.materialHandle.style.bottom=this.handlePos1+"px"),"MinRange"===this.type?(this.rangeBar.style.bottom=this.min>this.max?this.handlePos1+"px":"0px",C.setStyleAttribute(this.rangeBar,{height:C.isNullOrUndefined(this.handlePos1)?0:this.min>this.max?this.element.clientHeight-this.handlePos1+"px":this.handlePos1+"px"})):"Range"===this.type&&(this.secondHandle.style.bottom=this.handlePos2+"px",this.rangeBar.style.bottom=this.min>this.max?this.handlePos2+"px":this.handlePos1+"px",C.setStyleAttribute(this.rangeBar,{height:this.min>this.max?this.handlePos1-this.handlePos2+"px":this.handlePos2-this.handlePos1+"px"}))),this.limits.enabled&&this.setLimitBar(),"None"!==this.ticks.placement&&this.ul&&(this.removeElement(this.ul),this.ul=void 0,this.renderScale()),this.handleStart(),this.tooltip.isVisible||setTimeout(function(){C.isNullOrUndefined(t.firstHandle)||(t.firstHandle.style.transition=t.scaleTransform),"Range"!==t.type||C.isNullOrUndefined(t.secondHandle)||(t.secondHandle.style.transition=t.scaleTransform)}),this.refreshTooltip(this.tooltipTarget),this.setBarColor()},r.prototype.changeHandleValue=function(t){var e=null;1===this.activeHandle?this.limits.enabled&&this.limits.startHandleFixed||(this.handleVal1=this.checkHandleValue(t),this.handlePos1=this.checkHandlePosition(this.handleVal1),"Range"===this.type&&(this.handlePos1>this.handlePos2&&this.min<this.max||this.handlePos1<this.handlePos2&&this.min>this.max)&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.handlePos1!==this.preHandlePos1&&(e=this.preHandlePos1=this.handlePos1)):this.limits.enabled&&this.limits.endHandleFixed||(this.handleVal2=this.checkHandleValue(t),this.handlePos2=this.checkHandlePosition(this.handleVal2),"Range"===this.type&&(this.handlePos2<this.handlePos1&&this.min<this.max||this.handlePos2>this.handlePos1&&this.min>this.max)&&(this.handlePos2=this.handlePos1,this.handleVal2=this.handleVal1),this.handlePos2!==this.preHandlePos2&&(e=this.preHandlePos2=this.handlePos2)),this.modifyZindex(),null!==e&&("Default"!==this.type&&this.setRangeBar(),this.setHandlePosition(null))},r.prototype.tempStartEnd=function(){return this.min>this.max?{start:this.max,end:this.min}:{start:this.min,end:this.max}},r.prototype.xyToPosition=function(t){var e,i;if(this.min===this.max)return 100;"Horizontal"===this.orientation?(e=t.x-this.element.getBoundingClientRect().left,i=this.element.offsetWidth/100,this.val=e/i):(e=t.y-this.element.getBoundingClientRect().top,i=this.element.offsetHeight/100,this.val=100-e/i);t=this.stepValueCalculation(this.val);return t<0?t=0:100<t&&(t=100),this.enableRtl&&"Vertical"!==this.orientation&&(t=100-t),"Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(t/100):this.element.getBoundingClientRect().height*(t/100)},r.prototype.stepValueCalculation=function(t){0===this.step&&(this.step=1);var e=parseFloat(C.formatUnit(this.step))/((parseFloat(C.formatUnit(this.max))-parseFloat(C.formatUnit(this.min)))/100),i=t%Math.abs(e);return 0!=i&&(i<e/2?t-=i:t+=Math.abs(e)-i),t},r.prototype.add=function(t,e,i){var s=Math.pow(10,3),i=i?(Math.round(t*s)+Math.round(e*s))/s:(Math.round(t*s)-Math.round(e*s))/s;return i},r.prototype.positionToValue=function(t){var e=parseFloat(C.formatUnit(this.max))-parseFloat(C.formatUnit(this.min)),t="Horizontal"===this.orientation?t/this.element.getBoundingClientRect().width*e:t/this.element.getBoundingClientRect().height*e;return this.add(t,parseFloat(this.min.toString()),!0)},r.prototype.sliderBarClick=function(t){t.preventDefault(),"mousedown"===t.type||"mouseup"===t.type||"click"===t.type?i={x:t.clientX,y:t.clientY}:"touchend"!==t.type&&"touchstart"!==t.type||(i={x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY});var e,i=this.xyToPosition(i),s=this.positionToValue(i),n=(("Range"===this.type&&(this.min<this.max&&this.handlePos2-i<i-this.handlePos1||this.min>this.max&&this.handlePos1-i>i-this.handlePos2)?(this.activeHandle=2,this.limits.enabled&&this.limits.endHandleFixed||(this.limits.enabled&&(s=(n=this.getLimitValueAndPosition(s,this.limits.maxStart,this.limits.maxEnd))[0],i=n[1]),this.secondHandle.classList.add(Li),this.handlePos2=this.preHandlePos2=i,this.handleVal2=s),this.modifyZindex(),this.secondHandle):(this.activeHandle=1,this.limits.enabled&&this.limits.startHandleFixed||(this.limits.enabled&&(s=(n=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd))[0],i=n[1]),this.firstHandle.classList.add(Li),this.handlePos1=this.preHandlePos1=i,this.handleVal1=s),this.modifyZindex(),this.firstHandle)).focus(),this.isMaterialTooltip&&this.tooltipElement.classList.add(ui),this.element.querySelector("."+a)),i=(n&&this.getHandle()!==n&&n.classList.remove(a),1===this.activeHandle?this.firstHandle:this.secondHandle);"click"!==t.type&&"mousedown"!==t.type||t.target!==i||(n=t.clientX,e=t.clientY,document.elementFromPoint(n,e)),this.checkRepeatedValue(s)&&(n=(this.isMaterial||this.isMaterial3)&&this.tooltip.isVisible?this.transitionOnMaterialTooltip:this.transition,this.getHandle().style.transition=n.handle,"Default"!==this.type&&(this.rangeBar.style.transition=n.rangeBar),this.setHandlePosition(t),this.isMaterialTooltip&&(this.initialTooltip=!1),t.target!==i&&this.changeEvent("changed",t),"Default"!==this.type)&&this.setRangeBar()},r.prototype.handleValueAdjust=function(t,e,i){1===i?(this.handleVal1=e,this.handleVal2=this.handleVal1+this.minDiff):2===i&&(this.handleVal2=e,this.handleVal1=this.handleVal2-this.minDiff),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handlePos2=this.checkHandlePosition(this.handleVal2)},r.prototype.dragRangeBarMove=function(t){var e,i,s;"touchmove"!==t.type&&t.preventDefault(),this.rangeBarDragged=!0,this.rangeBar.style.transition="none",this.firstHandle.style.transition="none",this.secondHandle.style.transition="none",e=("mousemove"===t.type?(i=(e=[t.clientX,t.clientY])[0],e):(i=(e=[t.changedTouches[0].clientX,t.changedTouches[0].clientY])[0],e))[1],this.limits.enabled&&this.limits.startHandleFixed||this.limits.enabled&&this.limits.endHandleFixed||(s=this.enableRtl?{x:i+this.secondPartRemain,y:e+this.secondPartRemain}:{x:i-this.firstPartRemain,y:e+this.secondPartRemain},this.min>this.max?(this.handlePos2=this.xyToPosition(s),this.handleVal2=this.positionToValue(this.handlePos2)):(this.handlePos1=this.xyToPosition(s),this.handleVal1=this.positionToValue(this.handlePos1)),s=this.enableRtl?{x:i-this.firstPartRemain,y:e-this.firstPartRemain}:{x:i+this.secondPartRemain,y:e-this.firstPartRemain},this.min>this.max?(this.handlePos1=this.xyToPosition(s),this.handleVal1=this.positionToValue(this.handlePos1)):(this.handlePos2=this.xyToPosition(s),this.handleVal2=this.positionToValue(this.handlePos2)),this.limits.enabled&&(i=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd),this.handleVal1=i[0],this.handlePos1=i[1],this.handleVal1===this.limits.minEnd&&this.handleValueAdjust(this.handleVal1,this.limits.minEnd,1),this.handleVal1===this.limits.minStart&&this.handleValueAdjust(this.handleVal1,this.limits.minStart,1),i=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=i[0],this.handlePos2=i[1],this.handleVal2===this.limits.maxStart&&this.handleValueAdjust(this.handleVal2,this.limits.maxStart,2),this.handleVal2===this.limits.maxEnd)&&this.handleValueAdjust(this.handleVal2,this.limits.maxEnd,2),this.handleVal2===(this.min>this.max?this.min:this.max)&&this.handleValueAdjust(this.handleVal2,this.min>this.max?this.min:this.max,2),this.handleVal1===(this.min>this.max?this.max:this.min)&&this.handleValueAdjust(this.handleVal1,this.min>this.max?this.max:this.min,1)),this.activeHandle=1,this.setHandlePosition(t),this.activeHandle=2,this.setHandlePosition(t),this.tooltipToggle(this.rangeBar),this.setRangeBar()},r.prototype.sliderBarUp=function(t){this.changeEvent("changed",t),this.handleFocusOut(),this.firstHandle.classList.remove(Li),"Range"===this.type&&(this.initialTooltip=!1,this.secondHandle.classList.remove(Li)),this.closeTooltip(),(this.isMaterial||this.isMaterial3)&&(this.getHandle().classList.remove("e-large-thumb-size"),this.isMaterialTooltip)&&this.tooltipElement.classList.remove(ui),C.EventHandler.remove(document,"mousemove touchmove",this.sliderBarMove),C.EventHandler.remove(document,"mouseup touchend",this.sliderBarUp)},r.prototype.sliderBarMove=function(t){"touchmove"!==t.type&&t.preventDefault(),s="mousemove"===t.type?{x:t.clientX,y:t.clientY}:{x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY};var e,i,s=this.xyToPosition(s),n=this.positionToValue(s);s=Math.round(s),"Range"!==this.type&&1===this.activeHandle&&(this.limits.enabled&&this.limits.startHandleFixed||(this.limits.enabled&&(s=(e=this.getLimitValueAndPosition(n,this.limits.minStart,this.limits.minEnd))[1],n=e[0]),this.handlePos1=s,this.handleVal1=n),this.firstHandle.classList.add(Li)),"Range"===this.type&&(1===this.activeHandle?(this.firstHandle.classList.add(Li),this.limits.enabled&&this.limits.startHandleFixed||((this.min<this.max&&s>this.handlePos2||this.min>this.max&&s<this.handlePos2)&&(s=this.handlePos2,n=this.handleVal2),s!==this.preHandlePos1&&(this.limits.enabled&&(n=(i=this.getLimitValueAndPosition(n,this.limits.minStart,this.limits.minEnd))[0],s=i[1]),this.handlePos1=this.preHandlePos1=s,this.handleVal1=n,this.activeHandle=1))):2===this.activeHandle&&(this.secondHandle.classList.add(Li),this.limits.enabled&&this.limits.endHandleFixed||((this.min<this.max&&s<this.handlePos1||this.min>this.max&&s>this.handlePos1)&&(s=this.handlePos1,n=this.handleVal1),s!==this.preHandlePos2&&(this.limits.enabled&&(n=(i=this.getLimitValueAndPosition(n,this.limits.maxStart,this.limits.maxEnd))[0],s=i[1]),this.handlePos2=this.preHandlePos2=s,this.handleVal2=n,this.activeHandle=2)))),this.checkRepeatedValue(n)&&(this.getHandle().style.transition=this.scaleTransform,"Default"!==this.type&&(this.rangeBar.style.transition="none"),this.setHandlePosition(t),!this.isMaterial&&!this.isMaterial3||this.tooltip.isVisible||this.getHandle().classList.contains(a)||this.materialChange(),this.tooltipToggle(this.getHandle()),"Default"!==this.type)&&this.setRangeBar()},r.prototype.dragRangeBarUp=function(t){this.rangeBarDragged?this.isDragComplete=!0:(this.focusSliderElement(),this.sliderBarClick(t)),this.changeEvent("changed",t),this.closeTooltip(),C.EventHandler.remove(document,"mousemove touchmove",this.dragRangeBarMove),C.EventHandler.remove(document,"mouseup touchend",this.dragRangeBarUp),this.rangeBarDragged=!1},r.prototype.checkRepeatedValue=function(t){if("Range"===this.type){if(t===(this.enableRtl&&"Vertical"!==this.orientation?1===this.activeHandle?this.previousVal[1]:this.previousVal[0]:1===this.activeHandle?this.previousVal[0]:this.previousVal[1]))return 0}else if(t===this.previousVal)return 0;return 1},r.prototype.refreshTooltip=function(t){this.tooltip.isVisible&&this.tooltipObj&&(this.tooltipValue(),t)&&(this.tooltipObj.refresh(t),this.tooltipTarget=t)},r.prototype.openTooltip=function(t){this.tooltip.isVisible&&this.tooltipObj&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.open(t),this.tooltipTarget=t)},r.prototype.closeTooltip=function(){this.tooltip.isVisible&&this.tooltipObj&&"Always"!==this.tooltip.showOn&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.close(),this.tooltipTarget=void 0)},r.prototype.keyDown=function(t){switch(t.keyCode){case 37:case 38:case 39:case 40:case 33:case 34:case 36:case 35:t.preventDefault(),this.buttonClick(t)}},r.prototype.wireButtonEvt=function(t){t?(C.EventHandler.remove(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut),C.EventHandler.remove(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut),C.EventHandler.remove(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse),C.EventHandler.remove(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),C.EventHandler.remove(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse),C.EventHandler.remove(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),C.EventHandler.remove(this.firstBtn,"focusout",this.sliderFocusOut),C.EventHandler.remove(this.secondBtn,"focusout",this.sliderFocusOut)):(C.EventHandler.add(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut,this),C.EventHandler.add(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut,this),C.EventHandler.add(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse,this),C.EventHandler.add(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),C.EventHandler.add(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse,this),C.EventHandler.add(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),C.EventHandler.add(this.firstBtn,"focusout",this.sliderFocusOut,this),C.EventHandler.add(this.secondBtn,"focusout",this.sliderFocusOut,this))},r.prototype.rangeBarMousedown=function(t){var e,i,s;t.preventDefault(),this.focusSliderElement(),"Range"===this.type&&this.drag&&t.target===this.rangeBar&&(s=i=void 0,"mousedown"===t.type?(i=(e=[t.clientX,t.clientY])[0],s=e[1]):"touchstart"===t.type&&(i=(e=[t.changedTouches[0].clientX,t.changedTouches[0].clientY])[0],s=e[1]),"Horizontal"===this.orientation?(this.firstPartRemain=i-this.rangeBar.getBoundingClientRect().left,this.secondPartRemain=this.rangeBar.getBoundingClientRect().right-i):(this.firstPartRemain=s-this.rangeBar.getBoundingClientRect().top,this.secondPartRemain=this.rangeBar.getBoundingClientRect().bottom-s),this.minDiff=this.handleVal2-this.handleVal1,this.tooltipToggle(this.rangeBar),(t=this.element.querySelector("."+a))&&t.classList.remove(a),C.EventHandler.add(document,"mousemove touchmove",this.dragRangeBarMove,this),C.EventHandler.add(document,"mouseup touchend",this.dragRangeBarUp,this))},r.prototype.elementClick=function(t){this.isDragComplete?this.isDragComplete=!1:(t.preventDefault(),this.focusSliderElement(),this.sliderBarClick(t),this.focusHandle())},r.prototype.wireEvents=function(){this.onresize=this.reposition.bind(this),window.addEventListener("resize",this.onresize),this.enabled&&!this.readonly&&(C.EventHandler.add(this.element,"click",this.elementClick,this),"Range"===this.type&&this.drag&&C.EventHandler.add(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown,this),C.EventHandler.add(this.sliderContainer,"keydown",this.keyDown,this),C.EventHandler.add(this.sliderContainer,"keyup",this.keyUp,this),C.EventHandler.add(this.element,"focusout",this.sliderFocusOut,this),C.EventHandler.add(this.sliderContainer,"mouseover mouseout touchstart touchend",this.hover,this),this.wireFirstHandleEvt(!1),"Range"===this.type&&this.wireSecondHandleEvt(!1),this.showButtons&&this.wireButtonEvt(!1),this.wireMaterialTooltipEvent(!1),this.isForm)&&C.EventHandler.add(this.formElement,"reset",this.formResetHandler,this)},r.prototype.unwireEvents=function(){C.EventHandler.remove(this.element,"click",this.elementClick),"Range"===this.type&&this.drag&&C.EventHandler.remove(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown),C.EventHandler.remove(this.sliderContainer,"keydown",this.keyDown),C.EventHandler.remove(this.sliderContainer,"keyup",this.keyUp),C.EventHandler.remove(this.element,"focusout",this.sliderFocusOut),C.EventHandler.remove(this.sliderContainer,"mouseover mouseout touchstart touchend",this.hover),this.wireFirstHandleEvt(!0),"Range"===this.type&&this.wireSecondHandleEvt(!0),this.showButtons&&this.wireButtonEvt(!0),this.wireMaterialTooltipEvent(!0),C.EventHandler.remove(this.element,"reset",this.formResetHandler)},r.prototype.formResetHandler=function(){this.setProperties({value:this.formResetValue},!0),this.setValue()},r.prototype.keyUp=function(t){var e;9===t.keyCode&&t.target.classList.contains(je)&&(this.focusSliderElement(),t.target.classList.contains(a)||(this.element.querySelector("."+a)&&this.element.querySelector("."+a).classList.remove(a),t.target.classList.add(a),(e=t.target.parentElement)===this.element&&(e.querySelector("."+di).classList.add(ki),"Range"!==this.type&&"MinRange"!==this.type||e.querySelector("."+_e).classList.add(Oi)),"Range"===this.type&&((e=t.target.previousSibling)&&e.classList.contains(je)?this.activeHandle=2:this.activeHandle=1),this.getHandle().focus(),this.tooltipToggle(this.getHandle()))),this.closeTooltip(),this.changeEvent("changed",t)},r.prototype.hover=function(t){C.isNullOrUndefined(t)||("mouseover"===t.type||"touchmove"===t.type||"mousemove"===t.type||"pointermove"===t.type||"touchstart"===t.type?this.sliderContainer.classList.add(ti):(this.sliderContainer.classList.remove(ti),t=t.currentTarget,this.tooltip.isVisible&&"Always"!==this.tooltip.showOn&&this.tooltipObj&&this.isMaterialTooltip&&!t.classList.contains(vi)&&!t.classList.contains(a)&&this.closeMaterialTooltip()))},r.prototype.sliderFocusOut=function(t){t.relatedTarget!==this.secondHandle&&t.relatedTarget!==this.firstHandle&&t.relatedTarget!==this.element&&t.relatedTarget!==this.firstBtn&&t.relatedTarget!==this.secondBtn&&(this.closeMaterialTooltip(),this.closeTooltip(),this.element.querySelector("."+a)&&this.element.querySelector("."+a).classList.remove(a),this.element.querySelector("."+ki)&&(this.element.querySelector("."+ki).classList.remove(ki),"Range"!==this.type&&"MinRange"!==this.type||!this.element.querySelector("."+Oi)||this.element.querySelector("."+Oi).classList.remove(Oi)),this.hiddenInput.focus(),this.hiddenInput.blur(),this.isElementFocused=!1)},r.prototype.removeElement=function(t){t.parentNode&&t.parentNode.removeChild(t)},r.prototype.changeSliderType=function(t,e){this.isMaterialTooltip&&this.materialHandle&&(this.sliderContainer.classList.remove(pi),this.removeElement(this.materialHandle),this.materialHandle=void 0),this.removeElement(this.firstHandle),this.firstHandle=void 0,"Default"!==t&&("Range"===t&&(this.removeElement(this.secondHandle),this.secondHandle=void 0),this.removeElement(this.rangeBar),this.rangeBar=void 0),this.tooltip.isVisible&&!C.isNullOrUndefined(this.tooltipObj)&&(this.tooltipObj.destroy(),this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0),this.limits.enabled&&("MinRange"===t||"Default"===t?C.isNullOrUndefined(this.limitBarFirst)||(this.removeElement(this.limitBarFirst),this.limitBarFirst=void 0):C.isNullOrUndefined(this.limitBarSecond)||(this.removeElement(this.limitBarSecond),this.limitBarSecond=void 0)),this.activeHandle=1,this.getThemeInitialization(),"Range"===this.type&&this.rangeValueUpdate(),this.createRangeBar(),this.limits.enabled&&this.createLimitBar(),this.setHandler(),this.setOrientClass(),this.wireFirstHandleEvt(!this.enabled),"Range"===this.type&&this.wireSecondHandleEvt(!this.enabled),this.setValue(),this.tooltip.isVisible&&(this.renderTooltip(),this.wireMaterialTooltipEvent(!1)),this.setBarColor(),"tooltip"!==e&&this.updateConfig(),this.readonly&&(this.sliderContainer.classList.remove(Ui),this.setReadOnly())},r.prototype.changeRtl=function(){var t;this.enableRtl||"Range"!==this.type||(this.value=[this.handleVal2,this.handleVal1]),this.updateConfig(),this.tooltip.isVisible&&this.tooltipObj.refresh(this.firstHandle),this.showButtons&&(t=this.enableRtl&&"Vertical"!==this.orientation,C.attributes(t?this.secondBtn:this.firstBtn,{"aria-label":"Decrease",title:"Decrease"}),C.attributes(t?this.firstBtn:this.secondBtn,{"aria-label":"Increase",title:"Increase"}))},r.prototype.changeOrientation=function(){this.changeSliderType(this.type,"null")},r.prototype.updateConfig=function(){this.setEnableRTL(),this.setValue(),this.tooltip.isVisible&&this.refreshTooltip(this.tooltipTarget),"None"!==this.ticks.placement&&this.ul&&(this.removeElement(this.ul),this.ul=void 0,this.renderScale()),this.limitsPropertyChange()},r.prototype.limitsPropertyChange=function(){this.limits.enabled?(C.isNullOrUndefined(this.limitBarFirst)&&"Range"!==this.type&&this.createLimitBar(),C.isNullOrUndefined(this.limitBarFirst)&&C.isNullOrUndefined(this.limitBarSecond)&&"Range"===this.type&&this.createLimitBar(),this.setLimitBar(),this.setValue()):(C.isNullOrUndefined(this.limitBarFirst)||C.detach(this.limitBarFirst),C.isNullOrUndefined(this.limitBarSecond)||C.detach(this.limitBarSecond))},r.prototype.getPersistData=function(){return this.addOnPersist(["value"])},r.prototype.destroy=function(){Me.prototype.destroy.call(this),this.unwireEvents(),window.removeEventListener("resize",this.onresize),C.removeClass([this.sliderContainer],[si]),this.firstHandle.removeAttribute("aria-orientation"),"Range"===this.type&&this.secondHandle.removeAttribute("aria-orientation"),this.sliderContainer.parentNode&&this.sliderContainer.parentNode.insertBefore(this.element,this.sliderContainer),C.detach(this.sliderContainer),this.tooltip.isVisible&&this.tooltipObj.destroy(),this.element.innerHTML="",this.hiddenInput=null,this.sliderContainer=null,this.sliderTrack=null,this.rangeBar=null,this.firstHandle=null,this.secondHandle=null,this.tickElementCollection=null,this.ul=null,this.firstBtn=null,this.secondBtn=null,this.materialHandle=null,this.tooltipObj=null,this.tooltipTarget=null,this.limitBarFirst=null,this.limitBarSecond=null,this.firstChild=null,this.lastChild=null,this.tooltipElement=null},r.prototype.onPropertyChanged=function(t,e){for(var i=this,s=0,n=Object.keys(t);s<n.length;s++){var a,r=n[s];switch(r){case"cssClass":this.setCSSClass(e.cssClass);break;case"value":t&&e&&(a=C.isNullOrUndefined(t.value)?"Range"===this.type?[this.min,this.max]:this.min:t.value,this.setProperties({value:a},!0),C.isNullOrUndefined(e.value)||e.value.toString()===a.toString()||(this.setValue(),this.refreshTooltip(this.tooltipTarget),"Range"===this.type&&(C.isNullOrUndefined(t.value)||e.value[1]===a[1]?this.activeHandle=1:this.activeHandle=2)));break;case"min":case"step":case"max":this.setMinMaxValue();break;case"tooltip":C.isNullOrUndefined(t.tooltip)||C.isNullOrUndefined(e.tooltip)||(this.initialTooltip=!0,this.setTooltip(r),this.showButtons)||this.wireEvents();break;case"type":C.isNullOrUndefined(e)||!Object.keys(e).length||C.isNullOrUndefined(e.type)||(this.changeSliderType(e.type,r),this.setZindex());break;case"enableRtl":e.enableRtl!==t.enableRtl&&"Vertical"!==this.orientation&&(this.rtl=e.enableRtl,this.changeRtl());break;case"limits":this.limitsPropertyChange();break;case"orientation":this.changeOrientation();break;case"ticks":C.isNullOrUndefined(this.sliderContainer.querySelector("."+Ze))||(C.detach(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(t){t.match(/e-scale-/)&&i.sliderContainer.classList.remove(t)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex());break;case"locale":this.showButtons&&this.buttonTitle();break;case"showButtons":t.showButtons?(this.setButtons(),this.reposition(),this.enabled&&!this.readonly&&this.wireButtonEvt(!1)):this.firstBtn&&this.secondBtn&&(this.sliderContainer.removeChild(this.firstBtn),this.sliderContainer.removeChild(this.secondBtn),this.sliderContainer.classList.remove(Pi),this.firstBtn=void 0,this.secondBtn=void 0,this.reposition());break;case"enabled":this.setEnabled();break;case"readonly":this.setReadOnly();break;case"customValues":this.setValue(),this.reposition();break;case"colorRange":this.reposition();break;case"width":this.setElementWidth(t.width),this.setMinMaxValue(),this.limits&&this.limitsPropertyChange()}}},r.prototype.setReadOnly=function(){this.readonly?(this.unwireEvents(),this.sliderContainer.classList.add(Ui)):(this.wireEvents(),this.sliderContainer.classList.remove(Ui))},r.prototype.setMinMaxValue=function(){var e=this;this.setValue(),this.refreshTooltip(this.tooltipTarget),C.isNullOrUndefined(this.sliderContainer.querySelector("."+Ze))||this.ul&&(C.detach(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(t){t.match(/e-scale-/)&&e.sliderContainer.classList.remove(t)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex())},r.prototype.setZindex=function(){this.zIndex=6,C.isNullOrUndefined(this.ticks)||"None"===this.ticks.placement||C.isNullOrUndefined(this.ul)||C.isNullOrUndefined(this.element)||(this.ul.style.zIndex=this.zIndex+-7+"",this.element.style.zIndex=this.zIndex+2+""),this.isMaterial||this.isMaterial3||C.isNullOrUndefined(this.ticks)||"Both"!==this.ticks.placement||(this.element.style.zIndex=this.zIndex+2+""),C.isNullOrUndefined(this.firstHandle)||(this.firstHandle.style.zIndex=this.zIndex+3+""),"Range"!==this.type||C.isNullOrUndefined(this.secondHandle)||(this.secondHandle.style.zIndex=this.zIndex+4+"")},r.prototype.setTooltip=function(t){this.changeSliderType(this.type,t)},r.prototype.setBarColor=function(){for(var t,e,i=this.sliderTrack.lastElementChild;i;)this.sliderTrack.removeChild(i),i=this.sliderTrack.lastElementChild;for(var s,n,a,r=0;r<this.colorRange.length;r++)C.isNullOrUndefined(this.colorRange[r].start)||C.isNullOrUndefined(this.colorRange[r].end)||this.colorRange[r].end>this.colorRange[r].start&&(this.colorRange[r].start<this.min&&(this.colorRange[r].start=this.min),this.colorRange[r].end>this.max&&(this.colorRange[r].end=this.max),s=this.checkHandlePosition(this.colorRange[r].start),n=this.checkHandlePosition(this.colorRange[r].end),(a=this.createElement("div")).style.backgroundColor=this.colorRange[r].color,a.style.border="1px solid "+this.colorRange[r].color,"Horizontal"===this.orientation?(e=ci,t=this.enableRtl?C.isNullOrUndefined(this.customValues)?this.checkHandlePosition(this.max)-this.checkHandlePosition(this.colorRange[r].end):this.checkHandlePosition(this.customValues.length-this.colorRange[r].end-1):this.checkHandlePosition(this.colorRange[r].start),a.style.width=n-s+"px",a.style.left=t+"px"):(e=mi,t=this.checkHandlePosition(this.colorRange[r].start),a.style.height=n-s+"px",a.style.bottom=t+"px"),a.classList.add(e),this.sliderTrack.appendChild(a))},r.prototype.getModuleName=function(){return"slider"},s([C.Property(null)],r.prototype,"value",void 0),s([C.Property(null)],r.prototype,"customValues",void 0),s([C.Property(1)],r.prototype,"step",void 0),s([C.Property(null)],r.prototype,"width",void 0),s([C.Property(0)],r.prototype,"min",void 0),s([C.Property(100)],r.prototype,"max",void 0),s([C.Property(!1)],r.prototype,"readonly",void 0),s([C.Property("Default")],r.prototype,"type",void 0),s([C.Collection([{}],Ne)],r.prototype,"colorRange",void 0),s([C.Complex({},Le)],r.prototype,"ticks",void 0),s([C.Complex({},Ue)],r.prototype,"limits",void 0),s([C.Property(!0)],r.prototype,"enabled",void 0),s([C.Complex({},Ve)],r.prototype,"tooltip",void 0),s([C.Property(!1)],r.prototype,"showButtons",void 0),s([C.Property(!0)],r.prototype,"enableAnimation",void 0),s([C.Property("Horizontal")],r.prototype,"orientation",void 0),s([C.Property("")],r.prototype,"cssClass",void 0),s([C.Property(!0)],r.prototype,"enableHtmlSanitizer",void 0),s([C.Event()],r.prototype,"created",void 0),s([C.Event()],r.prototype,"change",void 0),s([C.Event()],r.prototype,"changed",void 0),s([C.Event()],r.prototype,"renderingTicks",void 0),s([C.Event()],r.prototype,"renderedTicks",void 0),s([C.Event()],r.prototype,"tooltipChange",void 0),s([C.NotifyPropertyChanges],r));function r(t,e){t=Me.call(this,t,e)||this;return t.horDir="left",t.verDir="bottom",t.transition={handle:"left .4s cubic-bezier(.25, .8, .25, 1), right .4s cubic-bezier(.25, .8, .25, 1), top .4s cubic-bezier(.25, .8, .25, 1) , bottom .4s cubic-bezier(.25, .8, .25, 1)",rangeBar:"all .4s cubic-bezier(.25, .8, .25, 1)"},t.transitionOnMaterialTooltip={handle:"left 1ms ease-out, right 1ms ease-out, bottom 1ms ease-out, top 1ms ease-out",rangeBar:"left 1ms ease-out, right 1ms ease-out, bottom 1ms ease-out, width 1ms ease-out, height 1ms ease-out"},t.scaleTransform="transform .4s cubic-bezier(.25, .8, .25, 1)",t.customAriaText=null,t.drag=!0,t.isDragComplete=!1,t.initialTooltip=!0,t}Wi=function(t,e){return(Wi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Wi,qi,ji,t=function(t,e){function i(){this.constructor=t}Wi(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},s=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},_i={EMAIL:new RegExp("^[A-Za-z0-9._%+-]{1,}@[A-Za-z0-9._%+-]{1,}([.]{1}[a-zA-Z0-9]{2,}|[.]{1}[a-zA-Z0-9]{2,4}[.]{1}[a-zA-Z0-9]{2,4})$"),URL:/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/m,DATE_ISO:new RegExp("^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$"),DIGITS:new RegExp("^[0-9]*$"),PHONE:new RegExp("^[+]?[0-9]{9,13}$"),CREDITCARD:new RegExp("^\\d{13,16}$")},Xi=((Xi=o.ErrorOption||(o.ErrorOption={}))[Xi.Message=0]="Message",Xi[Xi.Label=1]="Label",qi=C.Base,t(l,qi),(ji=l).prototype.addRules=function(t,e){t&&(this.rules.hasOwnProperty(t)?C.extend(this.rules[""+t],e,{}):this.rules[""+t]=e)},l.prototype.removeRules=function(t,e){if(t||e){if(this.rules[""+t]&&!e)delete this.rules[""+t];else if(!C.isNullOrUndefined(this.rules[""+t]&&e))for(var i=0;i<e.length;i++)delete this.rules[""+t][e[parseInt(i.toString(),10)]]}else this.rules={}},l.prototype.validate=function(e){var t=Object.keys(this.rules);if(e&&t.length)return this.validateRules(e),-1!==t.indexOf(e)&&0===this.errorRules.filter(function(t){return t.name===e}).length;this.errorRules=[];for(var i=0,s=t;i<s.length;i++){var n=s[i];this.validateRules(n)}return 0===this.errorRules.length},l.prototype.reset=function(){this.element.reset(),this.clearForm()},l.prototype.getInputElement=function(t){return this.inputElement=C.select('[name="'+t+'"]',this.element),this.inputElement},l.prototype.destroy=function(){this.reset(),this.unwireEvents(),this.rules={};for(var t=0,e=C.selectAll("."+this.errorClass+", ."+this.validClass,this.element);t<e.length;t++){var i=e[t];C.detach(i)}qi.prototype.destroy.call(this),this.infoElement=null,C.onIntlChange.off("notifyExternalChange",this.afterLocalization)},l.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)"locale"===s[i]&&this.localeFunc()},l.prototype.localeFunc=function(){for(var t=0,e=Object.keys(this.defaultMessages);t<e.length;t++){var i=e[t],s=(this.l10n.setLocale(this.locale),this.l10n.getConstant(i));this.localyMessage[""+i]=s}},l.prototype.getModuleName=function(){return"formvalidator"},l.prototype.afterLocalization=function(t){this.locale=t.locale,this.localeFunc()},l.prototype.refresh=function(){this.unwireEvents(),this.inputElements=C.selectAll(this.selectQuery,this.element),this.wireEvents()},l.prototype.clearForm=function(){this.errorRules=[],this.validated=[];for(var t=0,e=C.selectAll(this.selectQuery,this.element);t<e.length;t++){var i=e[t],s=(i.removeAttribute("aria-invalid"),i.parentElement),n=s.parentElement;(s.classList.contains("e-control-wrapper")||s.classList.contains("e-wrapper")||i.classList.contains("e-input")&&s.classList.contains("e-input-group")?s:null!=n&&(n.classList.contains("e-control-wrapper")||n.classList.contains("e-wrapper"))?n:i).classList.remove(this.errorClass),0<i.name.length&&(this.getInputElement(i.name),this.getErrorElement(i.name),this.hideMessage(i.name)),(s.classList.contains("e-control-wrapper")||s.classList.contains("e-wrapper")||i.classList.contains("e-input")&&s.classList.contains("e-input-group")?s:null!=n&&(n.classList.contains("e-control-wrapper")||n.classList.contains("e-wrapper"))?n:i).classList.remove(this.validClass)}},l.prototype.createHTML5Rules=function(){for(var t=["required","validateHidden","regex","rangeLength","maxLength","minLength","dateIso","digits","pattern","data-val-required","type","data-validation","min","max","range","equalTo","data-val-minlength-min","data-val-equalto-other","data-val-maxlength-max","data-val-range-min","data-val-regex-pattern","data-val-length-max","data-val-creditcard","data-val-phone"],e=["hidden","email","url","date","number","tel"],i=0,s=this.inputElements;i<s.length;i++){for(var n=s[i],a={},r=0,l=t;r<l.length;r++){var o=l[r];if(null!==n.getAttribute(o))switch(o){case"required":this.defRule(n,a,o,n.required);break;case"data-validation":o=n.getAttribute(o),this.defRule(n,a,o,!0);break;case"type":-1!==e.indexOf(n.type)&&this.defRule(n,a,n.type,!0);break;case"rangeLength":case"range":this.defRule(n,a,o,JSON.parse(n.getAttribute(o)));break;case"equalTo":var h=n.getAttribute(o);this.defRule(n,a,o,h);break;default:"true"===n.getAttribute("data-val")?this.annotationRule(n,a,o,n.getAttribute(o)):this.defRule(n,a,o,n.getAttribute(o))}}0!==Object.keys(a).length&&this.addRules(n.name,a)}},l.prototype.annotationRule=function(t,e,i,s){var n=i.split("-"),a=["required","creditcard","phone","maxlength","minlength","range","regex","equalto"],r=n[n.length-1],n=n[n.length-2];if(-1!==a.indexOf(r))switch(r){case"required":this.defRule(t,e,"required",s);break;case"creditcard":this.defRule(t,e,"creditcard",s);break;case"phone":this.defRule(t,e,"tel",s)}else if(-1!==a.indexOf(n))switch(n){case"maxlength":this.defRule(t,e,"maxLength",s);break;case"minlength":this.defRule(t,e,"minLength",s);break;case"range":var l=t.getAttribute("data-val-range-min"),o=t.getAttribute("data-val-range-max");this.defRule(t,e,"range",[l,o]);break;case"equalto":l=t.getAttribute(i).split(".");this.defRule(t,e,"equalTo",l[l.length-1]);break;case"regex":this.defRule(t,e,"regex",s)}},l.prototype.defRule=function(t,e,i,s){var n,a=t.getAttribute("data-"+i+"-message"),r=t.getAttribute("data-val-"+i);this.rules[t.name]&&"validateHidden"!==i&&"hidden"!==i&&(this.getInputElement(t.name),n=this.getErrorMessage(this.rules[t.name][""+i],i)),a?s=[s,a]:r?s=[s,r]:n&&(s=[s,n]),e[""+i]=s},l.prototype.wireEvents=function(){for(var t=0,e=this.inputElements;t<e.length;t++){var i=e[t];ji.isCheckable(i)?C.EventHandler.add(i,"click",this.clickHandler,this):"SELECT"===i.tagName?C.EventHandler.add(i,"change",this.changeHandler,this):(C.EventHandler.add(i,"focusout",this.focusOutHandler,this),C.EventHandler.add(i,"keyup",this.keyUpHandler,this))}C.EventHandler.add(this.element,"submit",this.submitHandler,this),C.EventHandler.add(this.element,"reset",this.resetHandler,this)},l.prototype.unwireEvents=function(){for(var t=0,e=this.inputElements;t<e.length;t++){var i=e[t];C.EventHandler.clearEvents(i)}C.EventHandler.remove(this.element,"submit",this.submitHandler),C.EventHandler.remove(this.element,"reset",this.resetHandler)},l.prototype.focusOutHandler=function(t){this.trigger("focusout",t);t=t.target;this.rules[t.name]&&(this.rules[t.name][this.required]||0<t.value.length?this.validate(t.name):-1===this.validated.indexOf(t.name)&&this.validated.push(t.name))},l.prototype.keyUpHandler=function(t){this.trigger("keyup",t);var e=t.target;(9!==t.which||this.rules[e.name]&&(!this.rules[e.name]||this.rules[e.name][this.required]))&&-1!==this.validated.indexOf(e.name)&&this.rules[e.name]&&-1===[16,17,18,20,35,36,37,38,39,40,45,144,225].indexOf(t.which)&&this.validate(e.name)},l.prototype.clickHandler=function(t){this.trigger("click",t);t=t.target;"submit"!==t.type?this.validate(t.name):null!==t.getAttribute("formnovalidate")&&(this.allowSubmit=!0)},l.prototype.changeHandler=function(t){this.trigger("change",t);t=t.target;this.validate(t.name)},l.prototype.submitHandler=function(t){this.trigger("submit",t),this.allowSubmit||this.validate()?this.allowSubmit=!1:t.preventDefault()},l.prototype.resetHandler=function(){this.clearForm()},l.prototype.validateRules=function(t){if(this.rules[""+t]){var e=Object.keys(this.rules[""+t]),i=!1,s=!1,n=e.indexOf("validateHidden"),a=e.indexOf("hidden");if(this.getInputElement(t),-1!==n&&(s=!0),!(i=-1!==a?!0:i)||s){-1!==n&&e.splice(n,1),-1!==a&&e.splice(a-1,1),this.getErrorElement(t);for(var r=0,l=e;r<l.length;r++){var o=l[r],h=this.getErrorMessage(this.rules[""+t][""+o],o),u={name:t,message:h},h={inputName:t,element:this.inputElement,message:h};if(!this.isValid(t,o)&&!this.inputElement.classList.contains(this.ignore)){this.removeErrorRules(t),this.errorRules.push(u),this.inputElement.setAttribute("aria-invalid","true"),this.inputElement.setAttribute("aria-describedby",this.inputElement.id+"-info");var p=this.inputElement.parentElement,d=p.parentElement;(p.classList.contains("e-control-wrapper")||p.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&p.classList.contains("e-input-group")?(p.classList.add(this.errorClass),p):null!=d&&(d.classList.contains("e-control-wrapper")||d.classList.contains("e-wrapper"))?(d.classList.add(this.errorClass),d):(this.inputElement.classList.add(this.errorClass),this.inputElement)).classList.remove(this.validClass),this.infoElement?this.showMessage(u):this.createErrorElement(t,u.message,this.inputElement),h.errorElement=this.infoElement,h.status="failure",(p.classList.contains("e-control-wrapper")||p.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&p.classList.contains("e-input-group")?(p.classList.add(this.errorClass),p):null!=d&&(d.classList.contains("e-control-wrapper")||d.classList.contains("e-wrapper"))?(d.classList.add(this.errorClass),d):(this.inputElement.classList.add(this.errorClass),this.inputElement)).classList.remove(this.validClass),this.optionalValidationStatus(t,h),this.trigger("validationComplete",h),"required"===o&&this.inputElement.setAttribute("aria-required","true");break}this.hideMessage(t),h.status="success",this.trigger("validationComplete",h)}}}},l.prototype.optionalValidationStatus=function(t,e){this.rules[""+t][this.required]||this.inputElement.value.length||C.isNullOrUndefined(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),e.status="",this.hideMessage(t))},l.prototype.isValid=function(t,e){var i=this.rules[""+t][""+e],i=i instanceof Array&&"string"==typeof i[1]?i[0]:i,s=this.rules[""+t][""+e],n="min"!==e&&"max"!==e||!this.rules[""+t].date||"string"!=typeof this.rules[""+t].date?null:this.rules[""+t].date,i={value:this.inputElement.value,param:i,element:this.inputElement,formElement:this.element,format:n};return this.trigger("validationBegin",i),!i.param&&"required"===e||(s&&"function"==typeof s[0]?s[0].call(this,{element:this.inputElement,value:this.inputElement.value}):ji.isCheckable(this.inputElement)?"required"!==e||0<C.selectAll('input[name="'+t+'"]:checked',this.element).length:ji.checkValidator[""+e](i))},l.prototype.getErrorMessage=function(t,e){var i=(a=this.inputElement.getAttribute("data-"+e+"-message")?this.inputElement.getAttribute("data-"+e+"-message"):t instanceof Array&&"string"==typeof t[1]?t[1]:(0!==Object.keys(this.localyMessage).length?this.localyMessage:this.defaultMessages)[""+e]).match(/{(\d)}/g);if(!C.isNullOrUndefined(i))for(var s=0;s<i.length;s++)var n=t instanceof Array?t[parseInt(s.toString(),10)]:t,a=a.replace(i[parseInt(s.toString(),10)],n);return a},l.prototype.createErrorElement=function(t,e,i){var s,e=C.createElement(this.errorElement,{className:this.errorClass,innerHTML:e,attrs:{for:t}});this.errorOption===o.ErrorOption.Message&&(e.classList.remove(this.errorClass),e.classList.add("e-message"),e=C.createElement(this.errorContainer,{className:this.errorClass,innerHTML:e.outerHTML})),e.id=this.inputElement.name+"-info",this.element.querySelector('[data-valmsg-for="'+i.id+'"]')?this.element.querySelector('[data-valmsg-for="'+i.id+'"]').appendChild(e):!0===i.hasAttribute("data-msg-containerid")?(i=i.getAttribute("data-msg-containerid"),C.select("#"+i,this.element).appendChild(e)):null!=this.customPlacement?this.customPlacement.call(this,this.inputElement,e):(s=(i=this.inputElement.parentElement).parentElement,i.classList.contains("e-control-wrapper")||i.classList.contains("e-wrapper")?s.insertBefore(e,i.nextSibling):s.classList.contains("e-control-wrapper")||s.classList.contains("e-wrapper")?s.parentElement.insertBefore(e,s.nextSibling):i.insertBefore(e,this.inputElement.nextSibling)),e.style.display="block",this.getErrorElement(t),this.validated.push(t),this.checkRequired(t)},l.prototype.getErrorElement=function(t){return this.infoElement=C.select(this.errorElement+"."+this.errorClass,this.inputElement.parentElement),this.infoElement||(this.infoElement=C.select(this.errorElement+"."+this.errorClass+'[for="'+t+'"]',this.element)),this.infoElement},l.prototype.removeErrorRules=function(t){for(var e=0;e<this.errorRules.length;e++)this.errorRules[parseInt(e.toString(),10)].name===t&&this.errorRules.splice(e,1)},l.prototype.showMessage=function(t){this.infoElement.style.display="block",this.infoElement.innerHTML=t.message,this.checkRequired(t.name)},l.prototype.hideMessage=function(t){var e;this.infoElement&&(this.infoElement.style.display="none",this.removeErrorRules(t),e=(t=this.inputElement.parentElement).parentElement,(t.classList.contains("e-control-wrapper")||t.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&t.classList.contains("e-input-group")?(t.classList.add(this.validClass),t):null!=e&&(e.classList.contains("e-control-wrapper")||e.classList.contains("e-wrapper"))?(e.classList.add(this.validClass),e):(this.inputElement.classList.add(this.validClass),this.inputElement)).classList.remove(this.errorClass),this.inputElement.setAttribute("aria-invalid","false"))},l.prototype.checkRequired=function(t){this.rules[""+t][this.required]||this.inputElement.value.length||C.isNullOrUndefined(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),this.hideMessage(t))},l.isCheckable=function(t){t=t.getAttribute("type");return t&&("checkbox"===t||"radio"===t||"submit"===t)},l.checkValidator={required:function(t){return isNaN(Date.parse(t.value))?0<t.value.toString().length:!isNaN(new Date(t.value).getTime())},email:function(t){return _i.EMAIL.test(t.value)},url:function(t){return _i.URL.test(t.value)},dateIso:function(t){return _i.DATE_ISO.test(t.value)},tel:function(t){return _i.PHONE.test(t.value)},creditcard:function(t){return _i.CREDITCARD.test(t.value)},number:function(t){return!isNaN(Number(t.value))&&-1===t.value.indexOf(" ")},digits:function(t){return _i.DIGITS.test(t.value)},maxLength:function(t){return t.value.length<=Number(t.param)},minLength:function(t){return t.value.length>=Number(t.param)},rangeLength:function(t){var e=t.param;return t.value.length>=e[0]&&t.value.length<=e[1]},range:function(t){var e=t.param;return!isNaN(Number(t.value))&&Number(t.value)>=e[0]&&Number(t.value)<=e[1]},date:function(t){var e,i;return C.isNullOrUndefined(t.param)||"string"!=typeof t.param||""===t.param?!isNaN(new Date(t.value).getTime()):(i=new C.Internationalization,e={format:t.param.toString(),type:"dateTime",skeleton:"yMd"},i=i.parseDate(t.value,e),!C.isNullOrUndefined(i)&&i instanceof Date&&!isNaN(+i))},max:function(t){var e,i,s;return isNaN(Number(t.value))?t.format&&""!==t.format?(s=new C.Internationalization,e={format:t.format.toString(),type:"dateTime",skeleton:"yMd"},i=s.parseDate(t.value,e),s="string"==typeof t.param?s.parseDate(JSON.parse(JSON.stringify(t.param)),e):t.param,new Date(i).getTime()<=new Date(s).getTime()):new Date(t.value).getTime()<=new Date(JSON.parse(JSON.stringify(t.param))).getTime():+t.value<=+t.param},min:function(t){var e,i,s;return isNaN(Number(t.value))?-1!==t.value.indexOf(",")?(s=t.value.replace(/,/g,""),parseFloat(s)>=Number(t.param)):t.format&&""!==t.format?(s=new C.Internationalization,e={format:t.format.toString(),type:"dateTime",skeleton:"yMd"},i=s.parseDate(t.value,e),s="string"==typeof t.param?s.parseDate(JSON.parse(JSON.stringify(t.param)),e):t.param,new Date(i).getTime()>=new Date(s).getTime()):new Date(t.value).getTime()>=new Date(JSON.parse(JSON.stringify(t.param))).getTime():+t.value>=+t.param},regex:function(t){return new RegExp(t.param).test(t.value)},equalTo:function(t){var e=t.formElement.querySelector("#"+t.param);return t.param=e.value,t.param===t.value}},s([C.Property("")],l.prototype,"locale",void 0),s([C.Property("e-hidden")],l.prototype,"ignore",void 0),s([C.Property()],l.prototype,"rules",void 0),s([C.Property("e-error")],l.prototype,"errorClass",void 0),s([C.Property("e-valid")],l.prototype,"validClass",void 0),s([C.Property("label")],l.prototype,"errorElement",void 0),s([C.Property("div")],l.prototype,"errorContainer",void 0),s([C.Property(o.ErrorOption.Label)],l.prototype,"errorOption",void 0),s([C.Event()],l.prototype,"focusout",void 0),s([C.Event()],l.prototype,"keyup",void 0),s([C.Event()],l.prototype,"click",void 0),s([C.Event()],l.prototype,"change",void 0),s([C.Event()],l.prototype,"submit",void 0),s([C.Event()],l.prototype,"validationBegin",void 0),s([C.Event()],l.prototype,"validationComplete",void 0),s([C.Event()],l.prototype,"customPlacement",void 0),ji=s([C.NotifyPropertyChanges],l));function l(t,e){e=qi.call(this,e,t)||this;if(e.validated=[],e.errorRules=[],e.allowSubmit=!1,e.required="required",e.infoElement=null,e.inputElement=null,e.selectQuery="input:not([type=reset]):not([type=button]), select, textarea",e.localyMessage={},e.defaultMessages={required:"This field is required.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateIso:"Please enter a valid date ( ISO ).",creditcard:"Please enter valid card number",number:"Please enter a valid number.",digits:"Please enter only digits.",maxLength:"Please enter no more than {0} characters.",minLength:"Please enter at least {0} characters.",rangeLength:"Please enter a value between {0} and {1} characters long.",range:"Please enter a value between {0} and {1}.",max:"Please enter a value less than or equal to {0}.",min:"Please enter a value greater than or equal to {0}.",regex:"Please enter a correct value.",tel:"Please enter a valid phone number.",pattern:"Please enter a correct pattern value.",equalTo:"Please enter the valid match text"},void 0===e.rules&&(e.rules={}),e.l10n=new C.L10n("formValidator",e.defaultMessages,e.locale),e.locale&&e.localeFunc(),C.onIntlChange.on("notifyExternalChange",e.afterLocalization,e),t="string"==typeof t?C.select(t,document):t,null!=e.element)return e.element.setAttribute("novalidate",""),e.inputElements=C.selectAll(e.selectQuery,e.element),e.createHTML5Rules(),e.wireEvents(),e}Ki=function(t,e){return(Ki=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Ki,Yi,t=function(t,e){function i(){this.constructor=t}Ki(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},s=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Zi="e-file-select",Gi="e-file-drop",Ji="e-upload-files",$i="e-upload-file-list",c="e-file-status",Qi="e-file-name",ts="e-file-type",es="e-file-size",m="e-file-remove-btn",d="e-file-delete-btn",is="e-spinner-pane",v="e-file-abort-btn",ss="e-file-reload-btn",ns="e-upload-drag-hover",as="e-upload-progress-wrap",rs="e-upload-progress-bar",ls="e-progress-bar-text",f="e-upload-progress",g="e-upload-success",y="e-upload-fails",os="e-file-container",hs="e-validation-fails",us="e-disabled",ps="e-rtl-container",ds="e-clear-icon-focus",E="e-file-pause-btn",cs="e-file-play-btn",ms="e-restrict-retry",vs=["title","style","class"],fs="e-form-upload",gs="e-file-invalid",ys=(Yi=C.ChildProperty,t(bs,Yi),s([C.Property("")],bs.prototype,"name",void 0),s([C.Property(null)],bs.prototype,"size",void 0),s([C.Property("")],bs.prototype,"type",void 0),bs);function bs(){return null!==Yi&&Yi.apply(this,arguments)||this}Cs=C.ChildProperty,t(xs,Cs),s([C.Property("Browse...")],xs.prototype,"browse",void 0),s([C.Property("Upload")],xs.prototype,"upload",void 0),s([C.Property("Clear")],xs.prototype,"clear",void 0);var Cs,Es=xs;function xs(){return null!==Cs&&Cs.apply(this,arguments)||this}Ss=C.ChildProperty,t(Ps,Ss),s([C.Property("")],Ps.prototype,"saveUrl",void 0),s([C.Property("")],Ps.prototype,"removeUrl",void 0),s([C.Property(0)],Ps.prototype,"chunkSize",void 0),s([C.Property(3)],Ps.prototype,"retryCount",void 0),s([C.Property(500)],Ps.prototype,"retryAfterDelay",void 0);var Ss,Ts=Ps;function Ps(){return null!==Ss&&Ss.apply(this,arguments)||this}ks=C.Component,t(x,ks),x.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"allowedExtensions":this.setExtensions(this.allowedExtensions),this.clearAll();break;case"enabled":this.setControlStatus();break;case"multiple":this.setMultipleSelection();break;case"enableRtl":this.setRTL(),this.reRenderFileList();break;case"buttons":this.buttons.browse=C.isNullOrUndefined(this.buttons.browse)?"":this.buttons.browse,this.buttons.clear=C.isNullOrUndefined(this.buttons.clear)?"":this.buttons.clear,this.buttons.upload=C.isNullOrUndefined(this.buttons.upload)?"":this.buttons.upload,this.renderButtonTemplates();break;case"dropArea":this.unBindDropEvents(),this.updateDropArea();break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkHTMLAttributes(!0);break;case"files":this.renderPreLoadFiles();break;case"directoryUpload":this.updateDirectoryAttributes();break;case"template":this.isReact?this.reRenderFileList():this.clearAll();break;case"minFileSize":case"maxFileSize":case"autoUpload":case"sequentialUpload":this.clearAll();break;case"locale":this.l10n.setLocale(this.locale),this.setLocalizedTexts(),this.preLocaleObj=C.getValue("currentLocale",this.l10n);break;case"cssClass":this.setCSSClass(e.cssClass)}},x.prototype.setLocalizedTexts=function(){C.isNullOrUndefined(this.template)&&("string"==typeof this.buttons.browse&&(this.browseButton.innerText="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.innerText),this.uploadWrapper)&&!C.isNullOrUndefined(this.uploadWrapper.querySelector("."+Gi))&&(this.uploadWrapper.querySelector("."+Gi).innerHTML=this.localizedTexts("dropFilesHint")),this.updateFileList())},x.prototype.getKeyValue=function(t){for(var e,i=0,s=Object.keys(this.preLocaleObj);i<s.length;i++){var n=s[i];this.preLocaleObj[""+n]===t&&(e=n)}return e},x.prototype.updateFileList=function(){if(0<this.fileList.length&&!C.isNullOrUndefined(this.uploadWrapper.querySelector("."+Ji)))for(var t=0;t<this.fileList.length;t++)this.fileList[t].querySelector(".e-file-status").innerHTML=this.localizedTexts(this.getKeyValue(this.filesData[t].status)),this.filesData[t].status=this.localizedTexts(this.getKeyValue(this.filesData[t].status)),this.fileList[t].classList.contains(g)&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("delete")),this.fileList[t].querySelector(".e-file-play-btn")&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("resume")),this.fileList[t].querySelector(".e-file-remove-btn")&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("remove")),this.fileList[t].querySelector(".e-file-reload-btn")&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("retry")),this.autoUpload||(this.uploadButton.innerText="Upload"===this.buttons.upload?this.localizedTexts("Upload"):this.buttons.upload,this.uploadButton.setAttribute("title",this.localizedTexts("Upload")),this.clearButton.innerText="Clear"===this.buttons.clear?this.localizedTexts("Clear"):this.buttons.clear,this.clearButton.setAttribute("title",this.localizedTexts("Clear")))},x.prototype.reRenderFileList=function(){this.listParent&&(C.detach(this.listParent),this.listParent=null,this.fileList=[],this.internalCreateFileList(this.filesData),this.actionButtons)&&(this.removeActionButtons(),this.renderActionButtons(),this.checkActionButtonStatus())},x.prototype.preRender=function(){this.localeText={Browse:"Browse...",Clear:"Clear",Upload:"Upload",invalidFileName:"File Name is not allowed",dropFilesHint:"Or drop files here",invalidMaxFileSize:"File size is too large",invalidMinFileSize:"File size is too small",invalidFileType:"File type is not allowed",uploadFailedMessage:"File failed to upload",uploadSuccessMessage:"File uploaded successfully",removedSuccessMessage:"File removed successfully",removedFailedMessage:"Unable to remove file",inProgress:"Uploading",readyToUploadMessage:"Ready to upload",abort:"Abort",remove:"Remove",cancel:"Cancel",delete:"Delete file",pauseUpload:"File upload paused",pause:"Pause",resume:"Resume",retry:"Retry",fileUploadCancel:"File upload canceled",invalidFileSelection:"Invalid files selected",totalFiles:"Total files",size:"Size"},this.l10n=new C.L10n("uploader",this.localeText,this.locale),this.preLocaleObj=C.getValue("currentLocale",this.l10n),this.formRendered(),this.updateHTMLAttrToElement(),this.checkHTMLAttributes(!1);var t=C.getValue("ej2_instances",this.element);if("EJS-UPLOADER"===this.element.tagName){for(var e=this.createElement("input",{attrs:{type:"file"}}),i=0;i<this.element.attributes.length;i++)"id"!==this.element.attributes[i].nodeName?e.setAttribute(this.element.attributes[i].nodeName,this.element.attributes[i].nodeValue):"id"===this.element.attributes[i].nodeName&&e.setAttribute(this.element.attributes[i].nodeName,C.getUniqueID("uploader")),e.innerHTML=this.element.innerHTML;e.hasAttribute("name")||e.setAttribute("name","UploadFiles"),this.element.appendChild(e),this.element=e,C.setValue("ej2_instances",t,this.element)}t[0].isPureReactComponent&&(C.isNullOrUndefined(t[0].props.name)?!C.isNullOrUndefined(t[0].props.id)&&C.isNullOrUndefined(t[0].props.name)?this.element.setAttribute("name",t[0].props.id):this.element.setAttribute("name","UploadFiles"):this.element.setAttribute("name",t[0].props.name)),C.isNullOrUndefined(this.element.getAttribute("name"))&&this.element.setAttribute("name",this.element.getAttribute("id")),this.element.hasAttribute("type")||this.element.setAttribute("type","file"),this.updateDirectoryAttributes(),this.keyConfigs={enter:"enter"},this.element.hasAttribute("tabindex")&&(this.tabIndex=this.element.getAttribute("tabindex")),this.browserName=C.Browser.info.name,this.uploaderName=this.element.getAttribute("name")},x.prototype.formRendered=function(){var t=C.closest(this.element,"form");if(!C.isNullOrUndefined(t))for(;t&&t!==document.documentElement;t=t.parentElement)"FORM"===t.tagName&&(this.isForm=!0,(this.formElement=t).setAttribute("enctype","multipart/form-data"),t.setAttribute("encoding","multipart/form-data"))},x.prototype.getPersistData=function(){return this.addOnPersist(["filesData"])},x.prototype.getModuleName=function(){return"uploader"},x.prototype.updateDirectoryAttributes=function(){this.directoryUpload?(this.element.setAttribute("directory","true"),this.element.setAttribute("webkitdirectory","true")):(this.element.removeAttribute("directory"),this.element.removeAttribute("webkitdirectory"))},x.prototype.render=function(){this.renderBrowseButton(),this.initializeUpload(),this.updateHTMLAttrToWrapper(),this.wireEvents(),this.setMultipleSelection(),this.setExtensions(this.allowedExtensions),this.setRTL(),this.renderPreLoadFiles(),this.setControlStatus(),this.setCSSClass()},x.prototype.renderBrowseButton=function(){this.browseButton=this.createElement("button",{className:"e-css e-btn",attrs:{type:"button"}}),this.browseButton.setAttribute("tabindex",this.tabIndex),"string"==typeof this.buttons.browse?(this.browseButton.textContent="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.innerText)):this.browseButton.appendChild(this.buttons.browse),this.element.setAttribute("aria-label","Uploader")},x.prototype.renderActionButtons=function(){this.element.setAttribute("tabindex","-1"),this.actionButtons=this.createElement("div",{className:"e-upload-actions"}),this.uploadButton=this.createElement("button",{className:"e-file-upload-btn e-css e-btn e-flat e-primary",attrs:{type:"button",tabindex:this.btnTabIndex,"aria-label":this.localizedTexts("Upload")}}),this.clearButton=this.createElement("button",{className:"e-file-clear-btn e-css e-btn e-flat",attrs:{type:"button",tabindex:this.btnTabIndex,"aria-label":this.localizedTexts("Clear")}}),this.actionButtons.appendChild(this.clearButton),this.actionButtons.appendChild(this.uploadButton),this.renderButtonTemplates(),this.uploadWrapper.appendChild(this.actionButtons),this.browseButton.blur(),this.isPreloadFiles||this.uploadButton.focus(),this.wireActionButtonEvents()},x.prototype.serverActionButtonsEventBind=function(t){t&&!this.isForm&&(this.browseButton.blur(),this.actionButtons=t,this.uploadButton=this.actionButtons.querySelector(".e-file-upload-btn"),this.clearButton=this.actionButtons.querySelector(".e-file-clear-btn"),this.uploadButton.focus(),this.unwireActionButtonEvents(),this.wireActionButtonEvents(),this.checkActionButtonStatus())},x.prototype.wireActionButtonEvents=function(){C.EventHandler.add(this.uploadButton,"click",this.uploadButtonClick,this),C.EventHandler.add(this.clearButton,"click",this.clearButtonClick,this)},x.prototype.unwireActionButtonEvents=function(){C.EventHandler.remove(this.uploadButton,"click",this.uploadButtonClick),C.EventHandler.remove(this.clearButton,"click",this.clearButtonClick)},x.prototype.removeActionButtons=function(){this.actionButtons&&(this.unwireActionButtonEvents(),C.detach(this.actionButtons),this.actionButtons=null)},x.prototype.renderButtonTemplates=function(){var t;"string"==typeof this.buttons.browse?(this.browseButton.textContent="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.textContent)):(this.browseButton.innerHTML="",this.browseButton.appendChild(this.buttons.browse)),this.uploadButton&&(t=C.isNullOrUndefined(this.buttons.upload)?"Upload":this.buttons.upload,this.buttons.upload=t,"string"==typeof this.buttons.upload?(this.uploadButton.textContent="Upload"===this.buttons.upload?this.localizedTexts("Upload"):this.buttons.upload,this.uploadButton.setAttribute("title",this.uploadButton.textContent)):(this.uploadButton.innerHTML="",this.uploadButton.appendChild(this.buttons.upload))),this.clearButton&&(t=C.isNullOrUndefined(this.buttons.clear)?"Clear":this.buttons.clear,this.buttons.clear=t,"string"==typeof this.buttons.clear?(this.clearButton.textContent="Clear"===this.buttons.clear?this.localizedTexts("Clear"):this.buttons.clear,this.clearButton.setAttribute("title",this.clearButton.textContent)):(this.clearButton.innerHTML="",this.clearButton.appendChild(this.buttons.clear)))},x.prototype.initializeUpload=function(){this.element.setAttribute("tabindex","-1");var t=this.createElement("span",{className:Zi});this.element.parentElement.insertBefore(t,this.element),this.dropAreaWrapper=this.createElement("div",{className:"e-file-select-wrap"}),this.element.parentElement.insertBefore(this.dropAreaWrapper,this.element),t.appendChild(this.element),this.dropAreaWrapper.appendChild(this.browseButton),this.dropAreaWrapper.appendChild(t),this.uploadWrapper=this.createElement("div",{className:"e-upload e-control-wrapper"}),this.dropAreaWrapper.parentElement.insertBefore(this.uploadWrapper,this.dropAreaWrapper),this.uploadWrapper.appendChild(this.dropAreaWrapper),this.setDropArea()},x.prototype.renderPreLoadFiles=function(){if(this.files.length)if(this.enablePersistence&&this.filesData.length)this.internalCreateFileList(this.filesData);else if(!C.isNullOrUndefined(this.files[0].size)){this.isPreloadFiles=!0;var t=[].slice.call(this.files),e=[];this.multiple||(this.clearData(),t=[t[0]]);for(var i=0,s=t;i<s.length;i++){var n=s[i],n={name:n.name+"."+n.type.split(".")[n.type.split(".").length-1],rawFile:"",size:n.size,status:this.localizedTexts("uploadSuccessMessage"),type:n.type,validationMessages:{minSize:"",maxSize:""},statusCode:"2"};e.push(n),this.filesData.push(n)}this.internalCreateFileList(e),this.autoUpload||!this.listParent||this.actionButtons||this.isForm&&!this.allowUpload()||!this.showFileList||this.renderActionButtons(),this.checkActionButtonStatus(),this.sequentialUpload&&(this.count=this.filesData.length-1),this.isPreloadFiles=!1}},x.prototype.checkActionButtonStatus=function(){var t;this.actionButtons&&(0<(t=this.uploadWrapper.querySelectorAll("."+hs).length+this.uploadWrapper.querySelectorAll(".e-upload-fails:not(.e-upload-progress)").length+this.uploadWrapper.querySelectorAll("span."+g).length+this.uploadWrapper.querySelectorAll("span."+f).length)&&t===this.uploadWrapper.querySelectorAll("li").length?this.uploadButton.setAttribute("disabled","disabled"):this.uploadButton.removeAttribute("disabled"))},x.prototype.setDropArea=function(){var t=this.dropAreaWrapper.querySelector(".e-file-drop");if(this.dropArea){this.dropZoneElement="string"!=typeof this.dropArea?this.dropArea:C.select(this.dropArea,document);for(var e=this.element,i=!1;e.parentNode;)(e=e.parentNode)===this.dropZoneElement&&(i=!0,t?t.innerHTML=this.localizedTexts("dropFilesHint"):this.createDropTextHint());!i&&t&&C.remove(t)}else C.isNullOrUndefined(this.uploaderOptions)||void 0!==this.uploaderOptions.dropArea||(this.createDropTextHint(),this.dropZoneElement=this.uploadWrapper,this.setProperties({dropArea:this.uploadWrapper},!0));this.bindDropEvents()},x.prototype.updateDropArea=function(){var t;this.dropArea?this.setDropArea():(this.dropZoneElement=null,(t=this.dropAreaWrapper.querySelector(".e-file-drop"))&&C.remove(t))},x.prototype.createDropTextHint=function(){var t=this.createElement("span",{className:Gi});t.innerHTML=this.localizedTexts("dropFilesHint"),this.dropAreaWrapper.appendChild(t)},x.prototype.updateHTMLAttrToElement=function(){if(!C.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i=e[t];vs.indexOf(i)<0&&this.element.setAttribute(i,this.htmlAttributes[""+i])}},x.prototype.updateHTMLAttrToWrapper=function(){if(!C.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i,s=e[t];-1<vs.indexOf(s)&&("class"===s?""!==(i=this.htmlAttributes[""+s].replace(/\s+/g," ").trim())&&C.addClass([this.uploadWrapper],i.split(" ")):"style"===s?(i=this.uploadWrapper.getAttribute(s),i=C.isNullOrUndefined(i)?this.htmlAttributes[""+s]:i+this.htmlAttributes[""+s],this.uploadWrapper.setAttribute(s,i)):this.uploadWrapper.setAttribute(s,this.htmlAttributes[""+s]))}},x.prototype.setMultipleSelection=function(){var t;this.multiple&&!this.element.hasAttribute("multiple")?((t=document.createAttribute("multiple")).value="multiple",this.element.setAttributeNode(t)):this.multiple||this.element.removeAttribute("multiple")},x.prototype.checkAutoUpload=function(t){this.autoUpload?(this.sequentialUpload?this.sequenceUpload(t):this.upload(t),this.removeActionButtons()):this.actionButtons||this.renderActionButtons(),this.checkActionButtonStatus()},x.prototype.sequenceUpload=function(t){var e;this.filesData.length-t.length!=0&&"1"===this.filesData[this.filesData.length-t.length-1].statusCode||((this.multiple||this.count<0)&&++this.count,e=!this.showFileList,"object"==typeof this.filesData[this.count]?(this.isFirstFileOnSelection=!1,this.upload(this.filesData[this.count],e),"0"===this.filesData[this.count].statusCode&&this.sequenceUpload(t)):--this.count)},x.prototype.setCSSClass=function(t){var e=t,t=(C.isNullOrUndefined(t)||(e=t.replace(/\s+/g," ").trim()),C.isNullOrUndefined(t)||""===e||C.removeClass([this.uploadWrapper],e.split(" ")),this.cssClass);C.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=this.cssClass.replace(/\s+/g," ").trim()),C.isNullOrUndefined(this.cssClass)||""===t||C.addClass([this.uploadWrapper],t.split(-1<t.indexOf(",")?",":" "))},x.prototype.wireEvents=function(){C.EventHandler.add(this.browseButton,"click",this.browseButtonClick,this),C.EventHandler.add(this.element,"change",this.onSelectFiles,this),C.EventHandler.add(document,"click",this.removeFocus,this),this.keyboardModule=new C.KeyboardEvents(this.uploadWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.isForm&&C.EventHandler.add(this.formElement,"reset",this.resetForm,this)},x.prototype.unWireEvents=function(){C.EventHandler.remove(this.browseButton,"click",this.browseButtonClick),C.EventHandler.remove(this.element,"change",this.onSelectFiles),C.EventHandler.remove(document,"click",this.removeFocus),this.isForm&&C.EventHandler.remove(this.formElement,"reset",this.resetForm),this.keyboardModule&&this.keyboardModule.destroy()},x.prototype.resetForm=function(){this.clearAll()},x.prototype.keyActionHandler=function(t){var e,i,s=t.target;"enter"===t.action&&(t.target===this.clearButton?this.clearButtonClick():t.target===this.uploadButton?this.uploadButtonClick():t.target===this.browseButton?this.browseButtonClick():s.classList.contains(E)?((e=this.getCurrentMetaData(null,t)).file.statusCode="4",e.file.status=this.localizedTexts("pauseUpload"),this.abortUpload(e,!1)):s.classList.contains(cs)?this.resumeUpload(this.getCurrentMetaData(null,t),t):s.classList.contains(ss)?(e=this.getCurrentMetaData(null,t),C.isNullOrUndefined(e)?(i=t.target.parentElement,i=this.filesData[this.fileList.indexOf(i)],this.retry(i)):(e.file.statusCode="1",e.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(e.file))):(this.removeFiles(t),s.classList.contains(v)||this.browseButton.focus()),t.preventDefault(),t.stopPropagation())},x.prototype.getCurrentMetaData=function(t,e){var i,s;s=C.isNullOrUndefined(t)?(e=e.target.parentElement,this.filesData[this.fileList.indexOf(e)]):t;for(var n=0;n<this.uploadMetaData.length;n++)this.uploadMetaData[n].file.name===s.name&&(i=this.uploadMetaData[n]);return i},x.prototype.removeFocus=function(){this.uploadWrapper&&this.listParent&&this.listParent.querySelector("."+ds)&&(document.activeElement.blur(),this.listParent.querySelector("."+ds).classList.remove(ds))},x.prototype.browseButtonClick=function(){this.element.click()},x.prototype.uploadButtonClick=function(){this.sequentialUpload?this.sequenceUpload(this.filesData):this.upload(this.filesData)},x.prototype.clearButtonClick=function(){this.clearAll(),this.sequentialUpload&&(this.count=-1),this.actionCompleteCount=0},x.prototype.bindDropEvents=function(){this.dropZoneElement&&(C.EventHandler.add(this.dropZoneElement,"drop",this.dropElement,this),C.EventHandler.add(this.dropZoneElement,"dragover",this.dragHover,this),C.EventHandler.add(this.dropZoneElement,"dragleave",this.onDragLeave,this),C.EventHandler.add(this.dropZoneElement,"paste",this.onPasteFile,this),C.EventHandler.add(this.dropZoneElement,"dragenter",this.onDragEnter,this))},x.prototype.unBindDropEvents=function(){this.dropZoneElement&&(C.EventHandler.remove(this.dropZoneElement,"drop",this.dropElement),C.EventHandler.remove(this.dropZoneElement,"dragover",this.dragHover),C.EventHandler.remove(this.dropZoneElement,"dragleave",this.onDragLeave),C.EventHandler.remove(this.dropZoneElement,"dragenter",this.onDragEnter))},x.prototype.onDragEnter=function(t){this.enabled&&(this.dropZoneElement.classList.add(ns),this.dragCounter=this.dragCounter+1,t.preventDefault(),t.stopPropagation())},x.prototype.onDragLeave=function(){this.enabled&&(this.dragCounter=this.dragCounter-1,this.dragCounter||this.dropZoneElement.classList.remove(ns))},x.prototype.dragHover=function(t){this.enabled&&("Default"!==this.dropEffect&&(t.dataTransfer.dropEffect=this.dropEffect.toLowerCase()),t.preventDefault(),t.stopPropagation())},x.prototype.dropElement=function(t){this.dragCounter=0,this.dropZoneElement.classList.remove(ns),this.onSelectFiles(t),t.preventDefault(),t.stopPropagation()},x.prototype.onPasteFile=function(t){var e=t.clipboardData.items;if("paste"===t.type&&"msie"!==this.browserName&&"edge"!==this.browserName&&"safari"!==this.browserName&&(this.element.files=t.clipboardData.files),1===e.length||this.multiple)for(var i=0;i<e.length;i++){var s=[].slice.call(e)[i];"file"!==s.kind&&!s.type.match("^image/")||this.renderSelectedFiles(t,[s.getAsFile()],!1,!0)}},x.prototype.getSelectedFiles=function(t){for(var e=[],i=this.fileList[t],s=this.getFilesData(),n=+i.getAttribute("data-files-count"),a=0,r=0;r<t;r++)a+=+this.fileList[r].getAttribute("data-files-count");for(var l=a;l<a+n;l++)e.push(s[l]);return e},x.prototype.removeFiles=function(t){var e,i,s;this.enabled&&(i=t.target.parentElement,i=this.fileList.indexOf(i),e=this.fileList[i],i=(s=this.isFormUpload())?this.getSelectedFiles(i):this.getFilesInArray(this.filesData[i]),C.isNullOrUndefined(i)||(t.target.classList.contains(v)&&!s?(i[0].statusCode="5",C.isNullOrUndefined(e)||(s=e.querySelector("."+v),h.createSpinner({target:s,width:"20px"}),h.showSpinner(s)),this.sequentialUpload&&this.uploadSequential(),e.classList.contains(ms)||this.checkActionComplete(!0)):C.closest(t.target,"."+is)||this.remove(i,!1,!1,!0,t),this.isForm&&e&&e.classList.contains(gs)&&(this.element.value=""),this.checkActionButtonStatus()))},x.prototype.removeFilesData=function(t,e){var i;e?this.showFileList||(i=this.filesData.indexOf(t),this.filesData.splice(i,1)):(e=this.getLiElement(t),C.isNullOrUndefined(e)||(this.element.value="",C.detach(e),i=this.fileList.indexOf(e),this.fileList.splice(i,1),this.filesData.splice(i,1),0!==this.fileList.length||C.isNullOrUndefined(this.listParent)||(C.detach(this.listParent),this.listParent=null,this.removeActionButtons()),this.sequentialUpload&&i<=this.count&&--this.count))},x.prototype.removeUploadedFile=function(i,t,s,e){var n=this,a=i,r=new C.Ajax(this.asyncSettings.removeUrl,"POST",!0,null),l=(r.emitError=!1,new FormData);r.beforeSend=function(e){t.currentRequest=r.httpRequest,s?n.removingEventCallback(t,l,a,i):n.trigger("removing",t,function(t){t.cancel?e.cancel=!0:n.removingEventCallback(t,l,a,i)})},r.onLoad=function(t){return n.removeCompleted(t,a,e),{}},r.onError=function(t){return n.removeFailed(t,a,e),{}},r.send(l)},x.prototype.removingEventCallback=function(t,e,i,s){var n=this.element.getAttribute("name"),s=this.getLiElement(s);C.isNullOrUndefined(s)||C.isNullOrUndefined(s.querySelector("."+d))&&C.isNullOrUndefined(s.querySelector("."+m))||(s=s.querySelector("."+d)?s.querySelector("."+d):s.querySelector("."+m),h.createSpinner({target:s,width:"20px"}),h.showSpinner(s)),t.postRawFile&&!C.isNullOrUndefined(i.rawFile)&&""!==i.rawFile?e.append(n,i.rawFile,i.name):e.append(n,i.name),this.updateFormData(e,t.customFormData)},x.prototype.updateFormData=function(i,s){if(0<s.length&&s[0])for(var t=0;t<s.length;t++)!function(t){var e=s[t],t=Object.keys(e).map(function(t){return e[""+t]});i.append(Object.keys(e)[0],t)}(t)},x.prototype.updateCustomheader=function(i,s){if(0<s.length&&s[0])for(var t=0;t<s.length;t++)!function(t){var e=s[t],t=Object.keys(e).map(function(t){return e[""+t]});i.setRequestHeader(Object.keys(e)[0],t)}(t)},x.prototype.removeCompleted=function(t,e,i){var s=t&&t.currentTarget?this.getResponse(t):null,n=t.target;4===n.readyState&&200<=n.status&&n.status<=299?(n={e:t,response:s,operation:"remove",file:this.updateStatus(e,this.localizedTexts("removedSuccessMessage"),"2")},this.trigger("success",n),this.removeFilesData(e,i),s=this.uploadedFilesData.indexOf(e),this.uploadedFilesData.splice(s,1),this.trigger("change",{files:this.uploadedFilesData})):this.removeFailed(t,e,i)},x.prototype.removeFailed=function(t,e,i){var t={e:t,response:t&&t.currentTarget?this.getResponse(t):null,operation:"remove",file:this.updateStatus(e,this.localizedTexts("removedFailedMessage"),"0")},i=(i||(i=this.filesData.indexOf(e),(i=this.fileList[i])&&(i.classList.remove(g),i.classList.add(y),i=i.querySelector("."+c))&&(i.classList.remove(g),i.classList.add(y)),this.checkActionButtonStatus()),this.trigger("failure",t),this.getLiElement(e));C.isNullOrUndefined(i)||C.isNullOrUndefined(i.querySelector("."+d))||(t=i.querySelector("."+d),h.hideSpinner(t),C.detach(i.querySelector(".e-spinner-pane")))},x.prototype.getFilesFromFolder=function(e){this.filesEntries=[];var n=this.multiple?e.dataTransfer.items:[e.dataTransfer.items[0]];if(this.checkDirectoryUpload(n))for(var a=this,t=0;t<n.length;t++)!function(t){var i,s=n[t].webkitGetAsEntry();s.isFile?(i=[],s.file(function(t){var e=s.fullPath;i.push({path:e,file:t})}),a.renderSelectedFiles(e,i,!0)):s.isDirectory&&a.traverseFileTree(s,e)}(t)},x.prototype.checkDirectoryUpload=function(t){for(var e=0;t&&e<t.length;e++)if(t[e].webkitGetAsEntry().isDirectory)return!0;return!1},x.prototype.traverseFileTree=function(t,e){t.isFile?this.filesEntries.push(t):t.isDirectory&&(t=t.createReader(),this.readFileFromDirectory(t,e))},x.prototype.readFileFromDirectory=function(i,s){var n=this;i.readEntries(function(t){for(var e=0;e<t.length;e++)n.traverseFileTree(t[e],s);n.pushFilesEntries(s),t.length&&n.readFileFromDirectory(i)})},x.prototype.pushFilesEntries=function(s){for(var n=this,a=[],t=this,e=0;e<this.filesEntries.length;e++)!function(i){t.filesEntries[i].file(function(t){var e;n.filesEntries.length&&(e=n.filesEntries[i].fullPath,a.push({path:e,file:t}),i===n.filesEntries.length-1)&&(n.filesEntries=[],n.renderSelectedFiles(s,a,!0))})}(e)},x.prototype.onSelectFiles=function(t){var e,i;this.enabled&&("drop"===t.type?this.directoryUpload?this.getFilesFromFolder(t):(i=this.sortFilesList=t.dataTransfer.files,"msie"!==this.browserName&&"edge"!==this.browserName&&"safari"!==this.browserName&&(this.element.files=i),0<i.length&&(e=this.multiple?this.sortFileList(i):[i[0]],this.renderSelectedFiles(t,e))):(e=[].slice.call(t.target.files),this.renderSelectedFiles(t,e)),this.isAngular||this.isReact)&&t.stopPropagation()},x.prototype.getBase64=function(s){return new Promise(function(t,e){var i=new FileReader;i.readAsDataURL(s),i.onload=function(){return t(i.result)},i.onerror=function(t){return e(t)}})},x.prototype.renderSelectedFiles=function(t,e,i,s){var n=this,a={event:t,cancel:!(this.base64String=[]),filesData:[],isModified:!1,modifiedFilesData:[],progressInterval:"",isCanceled:!1,currentRequest:null,customFormData:null};if(e.length<1)a.isCanceled=!0,this.trigger("selected",a);else{this.flag=!0;var r=[];this.multiple||(this.clearData(!0),e=[e[this.actionCompleteCount=0]]);for(var l=0;l<e.length;l++){var o=i?e[l].file:e[l];this.updateInitialFileDetails(t,e,o,l,r,i,s)}if(a.filesData=r,-1<this.allowedExtensions.indexOf("*")&&(this.allTypes=!0),this.enableHtmlSanitizer)for(l=0;l<r.length;l++){for(var h=C.SanitizeHtmlHelper.beforeSanitize(),h=C.SanitizeHtmlHelper.serializeValue(h,r[parseInt(l.toString(),10)].name),u=r[parseInt(l.toString(),10)].name,p=!1,d=0;d<u.length;d++)if(127<u.charCodeAt(d)){p=!0;break}var c=/<([a-z][a-z0-9]*)\b[^>]*>(.*?)<\/\1>/i.test(u);h===r[parseInt(l.toString(),10)].name||p&&!c||(h=e[parseInt(l.toString(),10)].name.replace(/[\u00A0-\u9999<>\\&]/g,function(t){return"&#"+t.charCodeAt(0)+";"}),r[parseInt(l.toString(),10)].name=h,r[parseInt(l.toString(),10)].status=this.localizedTexts("invalidFileName"),r[parseInt(l.toString(),10)].statusCode="0")}this.allTypes||(r=this.checkExtension(r)),this.trigger("selected",a,function(t){n._internalRenderSelect(t,r)})}},x.prototype.updateInitialFileDetails=function(t,e,i,s,n,a,r){a={name:a?e[s].path.substring(1,e[s].path.length):r?C.getUniqueID(i.name.substring(0,i.name.lastIndexOf(".")))+"."+this.getFileType(i.name):this.directoryUpload?e[s].webkitRelativePath:i.name,rawFile:i,size:i.size,status:this.localizedTexts("readyToUploadMessage"),type:this.getFileType(i.name),validationMessages:this.validatedFileSize(i.size),statusCode:"1",id:C.getUniqueID(i.name.substring(0,i.name.lastIndexOf(".")))+"."+this.getFileType(i.name)};r&&(a.fileSource="paste"),a.status=""!==a.validationMessages.minSize?this.localizedTexts("invalidMinFileSize"):""!==a.validationMessages.maxSize?this.localizedTexts("invalidMaxFileSize"):a.status,""===a.validationMessages.minSize&&""===a.validationMessages.maxSize||(a.statusCode="0",this.checkActionComplete(!0)),n.push(a)},x.prototype._internalRenderSelect=function(t,e){if(!t.cancel){if(this.selectedFiles=this.selectedFiles.concat(e),this.btnTabIndex=this.disableKeyboardNavigation?"-1":"0",this.showFileList){if(t.isModified&&0<t.modifiedFilesData.length){for(var i=0;i<t.modifiedFilesData.length;i++)for(var s=0;s<e.length;s++)t.modifiedFilesData[i].id===e[s].id&&(t.modifiedFilesData[i].rawFile=e[s].rawFile);var n=this.allTypes?t.modifiedFilesData:this.checkExtension(t.modifiedFilesData);this.updateSortedFileList(n),this.filesData=this.filesData.concat(n),this.isForm&&!this.allowUpload()||this.checkAutoUpload(n)}else{if(this.internalCreateFileList(e),this.autoUpload&&this.sequenceUpload&&this.sequentialUpload&&0<this.filesData.length&&"2"!==this.filesData[this.filesData.length-1].statusCode&&"0"!==this.filesData[this.filesData.length-1].statusCode)return void(this.filesData=this.filesData.concat(e));this.filesData=this.filesData.concat(e),this.isForm&&!this.allowUpload()||this.checkAutoUpload(e)}C.isNullOrUndefined(t.progressInterval)||""===t.progressInterval||(this.progressInterval=t.progressInterval)}else this.filesData=this.filesData.concat(e),this.autoUpload&&this.upload(this.filesData,!0);this.raiseActionComplete(),this.isFirstFileOnSelection=!0}},x.prototype.allowUpload=function(){var t=!1;return t=this.isForm&&!C.isNullOrUndefined(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl?!0:t},x.prototype.isFormUpload=function(){var t=!1;return t=!this.isForm||!C.isNullOrUndefined(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl||!C.isNullOrUndefined(this.asyncSettings.removeUrl)&&""!==this.asyncSettings.removeUrl?t:!0},x.prototype.clearData=function(t){C.isNullOrUndefined(this.listParent)||(C.detach(this.listParent),this.listParent=null),"msie"===this.browserName||t||(this.element.value=""),this.fileList=[],this.filesData=[],this.removeActionButtons()},x.prototype.updateSortedFileList=function(t){var e=this.createElement("div",{id:"clonewrapper"}),i=-1;if(this.listParent){for(var s=0;s<this.listParent.querySelectorAll("li").length;s++){var n=this.listParent.querySelectorAll("li")[s];e.appendChild(n.cloneNode(!0))}this.removeActionButtons();var a=[].slice.call(e.childNodes);this.createParentUL();for(var r=0;r<t.length;r++){for(var l=0;l<this.filesData.length;l++)this.filesData[l].name===t[r].name&&(this.listParent.appendChild(a[l]),C.EventHandler.add(a[l].querySelector(".e-icons"),"click",this.removeFiles,this),this.fileList.push(a[l]),i=r);i!==r&&this.internalCreateFileList([t[r]])}}else this.internalCreateFileList(t)},x.prototype.isBlank=function(t){return!t||/^\s*$/.test(t)},x.prototype.checkExtension=function(t){var e=t;if(!this.isBlank(this.allowedExtensions)){for(var i=[],s=0,n=this.allowedExtensions.split(",");s<n.length;s++){var a=n[s];i.push(a.trim().toLocaleLowerCase())}for(var r=0;r<t.length;r++){var l=-1!==t[r].type.indexOf(".")?t[r].type.replace(".",""):t[r].type;-1===i.indexOf(("."+l).toLocaleLowerCase())&&(t[r].status=this.localizedTexts("invalidFileType"),t[r].statusCode="0")}}return e},x.prototype.validatedFileSize=function(t){var e="",i="";return t<this.minFileSize?e=this.localizedTexts("invalidMinFileSize"):i=t>this.maxFileSize?this.localizedTexts("invalidMaxFileSize"):e="",{minSize:e,maxSize:i}},x.prototype.isPreLoadFile=function(t){for(var e=!1,i=0;i<this.files.length;i++)this.files[i].name===t.name.slice(0,t.name.lastIndexOf("."))&&this.files[i].type===t.type&&(e=!0);return e},x.prototype.createCustomfileList=function(t){this.createParentUL();for(var e=0,i=t;e<i.length;e++){var s=i[e],n=this.createElement("li",{className:$i,attrs:{"data-file-name":s.name}}),a=(this.uploadTemplateFn=this.templateComplier(this.template),this.uploadTemplateFn(s,this,"template",this.element.id+"Template",this.isStringTemplate,null,n)),a=(a&&(a=[].slice.call(a),C.append(a,n)),t.indexOf(s)),r={element:n,fileInfo:s,index:a,isPreload:this.isPreLoadFile(s)},a={element:n,fileInfo:s,index:a,isPreload:this.isPreLoadFile(s)};this.trigger("rendering",r),this.trigger("fileListRendering",a),this.listParent.appendChild(n),this.fileList.push(n)}this.renderReactTemplates()},x.prototype.createParentUL=function(){C.isNullOrUndefined(this.listParent)&&(this.listParent=this.createElement("ul",{className:Ji}),this.uploadWrapper.appendChild(this.listParent))},x.prototype.formFileList=function(t,e){for(var i,s=this.createElement("li",{className:$i}),n=(s.setAttribute("data-files-count",t.length+""),this.createElement("span",{className:os})),a=0,r=t;a<r.length;a++){var l=r[a],o=this.createElement("span",{className:Qi}),h=(o.innerHTML=this.getFileNameOnly(l.name),this.createElement("span",{className:ts})),u=this.getFileType(l.name);h.innerHTML="."+u,u||h.classList.add("e-hidden"),this.enableRtl?((u=this.createElement("span",{className:ps})).appendChild(h),u.appendChild(o),n.appendChild(u)):(n.appendChild(o),n.appendChild(h)),this.truncateName(o),i=this.formValidateFileInfo(l,s)}s.appendChild(n),this.setListToFileInfo(t,s);var p=this.listParent.querySelectorAll("li").length,d=this.createElement("span"),d=(s.classList.contains(gs)?(d.classList.add(c),d.classList.add(gs),d.innerText=1<t.length?this.localizedTexts("invalidFileSelection"):i):(d.classList.add(1<t.length?"e-file-information":es),d.innerText=1<t.length?this.localizedTexts("totalFiles")+": "+t.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(t)):this.bytesToSize(t[0].size),this.createFormInput(t)),n.appendChild(d),C.isNullOrUndefined(s.querySelector(".e-icons"))&&(d=this.createElement("span",{className:"e-icons",attrs:{tabindex:this.btnTabIndex}}),"msie"===this.browserName&&d.classList.add("e-msie"),d.setAttribute("title",this.localizedTexts("remove")),s.appendChild(n),s.appendChild(d),C.EventHandler.add(d,"click",this.removeFiles,this),d.classList.add(m)),{element:s,fileInfo:this.mergeFileInfo(t,s),index:p,isPreload:this.isPreLoadFile(this.mergeFileInfo(t,s))}),p={element:s,fileInfo:this.mergeFileInfo(t,s),index:p,isPreload:this.isPreLoadFile(this.mergeFileInfo(t,s))};this.trigger("rendering",d),this.trigger("fileListRendering",p),this.listParent.appendChild(s),this.fileList.push(s)},x.prototype.formValidateFileInfo=function(t,e){var i=t.status,s=this.validatedFileSize(t.size),s=(""===s.minSize&&""===s.maxSize||(this.addInvalidClass(e),i=""!==s.minSize?this.localizedTexts("invalidMinFileSize"):""!==s.maxSize?this.localizedTexts("invalidMaxFileSize"):i),this.checkExtension(this.getFilesInArray(t))[0].status);return s===this.localizedTexts("invalidFileType")&&(this.addInvalidClass(e),i=s),i},x.prototype.addInvalidClass=function(t){t.classList.add(gs)},x.prototype.createFormInput=function(t){if("safari"!==this.browserName){var e=this.element.cloneNode(!0);e.classList.add("e-hidden-file-input");for(var i=0,s=t;i<s.length;i++)s[i].input=e;e.setAttribute("id",C.getUniqueID("hiddenUploader")),e.setAttribute("name",this.uploaderName),this.uploadWrapper.querySelector("."+Zi).appendChild(e),"msie"!==this.browserName&&"edge"!==this.browserName&&(this.element.value="")}},x.prototype.getFileSize=function(t){for(var e=0,i=0,s=t;i<s.length;i++)e+=s[i].size;return e},x.prototype.mergeFileInfo=function(t,e){for(var i={name:"",rawFile:"",size:0,status:"",type:"",validationMessages:{minSize:"",maxSize:""},statusCode:"1",list:e},s=[],n="",a=0,r=t;a<r.length;a++){var l=r[a];s.push(l.name),n=l.type}return i.name=s.join(", "),i.size=this.getFileSize(t),i.type=n,i.status=this.statusForFormUpload(t,e),i},x.prototype.statusForFormUpload=function(t,e){for(var i=!0,s=0,n=t;s<n.length;s++){var a=n[s],r=a.status,l=this.validatedFileSize(a.size),l=(""===l.minSize&&""===l.maxSize||(i=!1,r=""!==l.minSize?this.localizedTexts("invalidMinFileSize"):""!==l.maxSize?this.localizedTexts("invalidMaxFileSize"):r),this.checkExtension(this.getFilesInArray(a))[0].status);l===this.localizedTexts("invalidFileType")&&(i=!1,r=l)}return r=i?this.localizedTexts("totalFiles")+": "+t.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(t)):(e.classList.add(gs),1<t.length?this.localizedTexts("invalidFileSelection"):r)},x.prototype.formCustomFileList=function(t,e){this.createParentUL();var i=this.createElement("li",{className:$i}),s=(i.setAttribute("data-files-count",t.length+""),this.setListToFileInfo(t,i),this.mergeFileInfo(t,i)),n=(i.setAttribute("data-file-name",s.name),this.uploadTemplateFn=this.templateComplier(this.template),this.uploadTemplateFn(s,this,"template",this.element.id+"Template",this.isStringTemplate,null,i)),n=(n&&(n=[].slice.call(n),C.append(n,i)),this.listParent.querySelectorAll("li").length),t=(i.classList.contains(gs)||this.createFormInput(t),{element:i,fileInfo:s,index:n,isPreload:this.isPreLoadFile(s)}),n={element:i,fileInfo:s,index:n,isPreload:this.isPreLoadFile(s)};this.trigger("rendering",t),this.trigger("fileListRendering",n),this.listParent.appendChild(i),this.fileList.push(i),this.renderReactTemplates()},x.prototype.createFileList=function(t){this.filesData=this.filesData&&0<this.filesData.length?this.filesData.concat(t):t,this.internalCreateFileList(t)},x.prototype.internalCreateFileList=function(t){if(this.createParentUL(),""===this.template||C.isNullOrUndefined(this.template))if(this.isFormUpload())this.uploadWrapper.classList.add(fs),this.formFileList(t,this.element.files);else for(var e=0,i=t;e<i.length;e++){var s=i[e],n=this.createElement("li",{className:$i,attrs:{"data-file-name":s.name,"data-files-count":"1"}}),a=this.createElement("span",{className:os}),r=this.createElement("span",{className:Qi,attrs:{title:s.name}}),l=(r.innerHTML=this.getFileNameOnly(s.name),this.createElement("span",{className:ts})),o=this.getFileType(s.name),o=(l.innerHTML="."+o,o||l.classList.add("e-hidden"),this.enableRtl?((o=this.createElement("span",{className:ps})).appendChild(l),o.appendChild(r),a.appendChild(o)):(a.appendChild(r),a.appendChild(l)),this.createElement("span",{className:es})),l=(o.innerHTML=this.bytesToSize(s.size),a.appendChild(o),this.createElement("span",{className:c})),o=(a.appendChild(l),l.innerHTML=s.status,n.appendChild(a),this.createElement("span",{className:" e-icons",attrs:{tabindex:this.btnTabIndex}})),a=("msie"===this.browserName&&o.classList.add("e-msie"),o.setAttribute("title",this.localizedTexts("remove")),n.appendChild(o),C.EventHandler.add(o,"click",this.removeFiles,this),"2"===s.statusCode?(l.classList.add(g),o.classList.add(d),o.setAttribute("title",this.localizedTexts("delete")),o.setAttribute("aria-label",this.localizedTexts("delete"))):"1"!==s.statusCode&&(l.classList.remove(g),l.classList.add(hs)),this.autoUpload&&"1"===s.statusCode&&""!==this.asyncSettings.saveUrl&&(l.innerHTML=""),o.classList.contains(d)||(o.classList.add(m),o.setAttribute("aria-label",this.localizedTexts("remove"))),t.indexOf(s)),l={element:n,fileInfo:s,index:a,isPreload:this.isPreLoadFile(s)},o={element:n,fileInfo:s,index:a,isPreload:this.isPreLoadFile(s)},a=(this.trigger("rendering",l),this.trigger("fileListRendering",o),this.listParent.appendChild(n),this.fileList.push(n),this.truncateName(r),this.flag);this.isPreLoadFile(s)&&(this.flag=!1,this.checkActionComplete(!0),this.flag=a)}else this.isFormUpload()?(this.uploadWrapper.classList.add(fs),this.formCustomFileList(t,this.element.files)):this.createCustomfileList(t)},x.prototype.getSlicedName=function(t){var e=t.textContent;t.dataset.tail=e.slice(e.length-10)},x.prototype.setListToFileInfo=function(t,e){for(var i=0,s=t;i<s.length;i++)s[i].list=e},x.prototype.truncateName=function(t){("edge"!==this.browserName&&t.offsetWidth<t.scrollWidth||t.offsetWidth+1<t.scrollWidth)&&this.getSlicedName(t)},x.prototype.getFileType=function(t){var e,i=t.lastIndexOf(".");return(e=0<=i?t.substring(i+1):e)||""},x.prototype.getFileNameOnly=function(t){var e=this.getFileType(t);return t.split("."+e)[0]},x.prototype.setInitialAttributes=function(){var t;this.initialAttr.accept&&this.element.setAttribute("accept",this.initialAttr.accept),this.initialAttr.disabled&&this.element.setAttribute("disabled","disabled"),this.initialAttr.multiple&&(t=document.createAttribute("multiple"),this.element.setAttributeNode(t))},x.prototype.filterfileList=function(t){for(var e,i=[],s=0;s<t.length;s++)e=this.getLiElement(t[s]),(C.isNullOrUndefined(e)||e.classList.contains(g))&&(this.showFileList||"File uploaded successfully"===t[s].status)||i.push(t[s]);return i},x.prototype.updateStatus=function(t,e,i,s){return void 0===s&&(s=!0),""===e||C.isNullOrUndefined(e)||""===i||C.isNullOrUndefined(i)||(t.status=e,t.statusCode=i),s&&(i=this.getLiElement(t),C.isNullOrUndefined(i)||C.isNullOrUndefined(i.querySelector("."+c))||""===e||C.isNullOrUndefined(e)||(i.querySelector("."+c).textContent=e)),t},x.prototype.getLiElement=function(t){for(var e,i=0;i<this.filesData.length;i++)C.isNullOrUndefined(t)||(C.isNullOrUndefined(this.filesData[i].id)||C.isNullOrUndefined(t.id)?this.filesData[i].name!==t.name:this.filesData[i].name!==t.name||this.filesData[i].id!==t.id)||(e=i);return this.fileList[e]},x.prototype.createProgressBar=function(t){var e=this.createElement("span",{className:as}),i=this.createElement("progressbar",{className:rs,attrs:{value:"0",max:"100"}}),s=this.createElement("span",{className:"e-progress-inner-wrap"}),n=(i.setAttribute("style","width: 0%"),this.createElement("span",{className:ls}));n.textContent="0%",s.appendChild(i),e.appendChild(s),e.appendChild(n),t.querySelector("."+os).appendChild(e)},x.prototype.updateProgressbar=function(t,e){var i;isNaN(Math.round(t.loaded/t.total*100))||C.isNullOrUndefined(e.querySelector("."+rs))||!C.isNullOrUndefined(this.progressInterval)&&""!==this.progressInterval&&0!=(i=Math.round(t.loaded/t.total*100)%parseInt(this.progressInterval,10))&&100!=i||this.changeProgressValue(e,Math.round(t.loaded/t.total*100).toString()+"%")},x.prototype.changeProgressValue=function(t,e){t.querySelector("."+rs).setAttribute("style","width:"+e),t.querySelector("."+ls).textContent=e},x.prototype.uploadInProgress=function(t,e,i,s){var n=this.getLiElement(e);C.isNullOrUndefined(n)&&!i||(C.isNullOrUndefined(n)?this.cancelUploadingFile(e,t,s):("5"===e.statusCode&&this.cancelUploadingFile(e,t,s,n),0<n.querySelectorAll("."+as).length||!n.querySelector("."+c)||(n.querySelector("."+c).classList.add(f),this.createProgressBar(n),this.updateProgressBarClasses(n,f),n.querySelector("."+c).classList.remove(y)),this.updateProgressbar(t,n),i=n.querySelector("."+m),C.isNullOrUndefined(i)||(i.classList.add(v,f),i.setAttribute("title",this.localizedTexts("abort")),i.classList.remove(m))),s={e:t,operation:"upload",file:this.updateStatus(e,this.localizedTexts("inProgress"),"3")},this.trigger("progress",s))},x.prototype.cancelUploadingFile=function(n,t,a,r){var l=this;"5"===n.statusCode&&this.trigger("canceling",{event:t,fileData:n,cancel:!1,customFormData:[],currentRequest:null},function(e){var t,i,s;e.cancel?(n.statusCode="3",C.isNullOrUndefined(r)||(t=r.querySelector("."+v),C.isNullOrUndefined(t))||(h.hideSpinner(t),C.detach(r.querySelector(".e-spinner-pane")))):(a.emitError=!1,a.httpRequest.abort(),t=new FormData,"5"===n.statusCode&&(i=l.element.getAttribute("name"),t.append(i,n.name),t.append("cancel-uploading",n.name),l.updateFormData(t,e.customFormData),(s=new C.Ajax(l.asyncSettings.removeUrl,"POST",!0,null)).emitError=!1,s.beforeSend=function(t){e.currentRequest&&l.updateCustomheader(s.httpRequest,e.currentRequest)},s.onLoad=function(t){return l.removecanceledFile(t,n),{}},s.send(t)))})},x.prototype.removecanceledFile=function(t,e){var i,s=this.getLiElement(e);C.isNullOrUndefined(s)||s.querySelector("."+ss)||C.isNullOrUndefined(s.querySelector("."+v))||(this.updateStatus(e,this.localizedTexts("fileUploadCancel"),"5"),this.renderFailureState(t,e,s),i=s.querySelector("."+m),C.isNullOrUndefined(s)||(h.hideSpinner(i),C.isNullOrUndefined(s.querySelector(".e-spinner-pane")))||C.detach(s.querySelector(".e-spinner-pane")),i=t&&t.currentTarget?this.getResponse(t):null,this.trigger("success",{event:t,response:i,operation:"cancel",file:e}))},x.prototype.renderFailureState=function(t,e,i){var s=this,n=(this.updateProgressBarClasses(i,y),this.removeProgressbar(i,"failure"),C.isNullOrUndefined(i.querySelector(".e-file-status"))||i.querySelector(".e-file-status").classList.add(y),i.querySelector("."+v));C.isNullOrUndefined(n)||(n.classList.remove(v,f),n.classList.add(m),n.setAttribute("title",this.localizedTexts("remove")),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}}),n.parentElement.insertBefore(this.pauseButton,n),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),this.pauseButton.setAttribute("aria-label",this.localizedTexts("retry")),i.querySelector("."+ss).addEventListener("click",function(t){s.reloadcanceledFile(t,e,i,!1)},!1))},x.prototype.reloadcanceledFile=function(t,e,i,s){e.statusCode="1",e.status=this.localizedTexts("readyToUploadMessage"),s||(C.isNullOrUndefined(i.querySelector("."+c))||i.querySelector("."+c).classList.remove(y),C.isNullOrUndefined(i.querySelector("."+ss))||C.detach(i.querySelector("."+ss)),this.pauseButton=null),C.isNullOrUndefined(i)||i.classList.add(ms),this.upload([e])},x.prototype.uploadComplete=function(t,e,i){var s=t.target;4===s.readyState&&200<=s.status&&s.status<=299?(s=this.getLiElement(e),C.isNullOrUndefined(s)&&(!i||C.isNullOrUndefined(i))&&this.showFileList||(C.isNullOrUndefined(s)||(this.updateProgressBarClasses(s,g),this.removeProgressbar(s,"success"),i=s.querySelector("."+v),C.isNullOrUndefined(i))||(i.classList.add(d),i.setAttribute("title",this.localizedTexts("delete")),i.setAttribute("aria-label",this.localizedTexts("delete")),i.classList.remove(v),i.classList.remove(f)),this.raiseSuccessEvent(t,e))):this.uploadFailed(t,e)},x.prototype.getResponse=function(t){t=t.currentTarget;return{readyState:t.readyState,statusCode:t.status,statusText:t.statusText,headers:t.getAllResponseHeaders(),withCredentials:t.withCredentials}},x.prototype.raiseSuccessEvent=function(t,e){var i=this,s=t&&t.currentTarget?this.getResponse(t):null,n=this.localizedTexts("uploadSuccessMessage"),t={e:t,response:s,operation:"upload",file:this.updateStatus(e,n,"2",!1),statusText:n},s=this.getLiElement(e);C.isNullOrUndefined(s)||(n=s.querySelector("."+is),C.isNullOrUndefined(n))||(h.hideSpinner(s),C.detach(n)),this.trigger("success",t,function(t){i.updateStatus(e,t.statusText,"2"),i.multiple?i.uploadedFilesData.push(e):i.uploadedFilesData=[e],i.trigger("change",{file:i.uploadedFilesData}),i.checkActionButtonStatus(),0<i.fileList.length?i.getLiElement(e).classList.contains(ms)?i.getLiElement(e).classList.remove(ms):(i.uploadSequential(),i.checkActionComplete(!0)):i.showFileList||i.checkActionComplete(!0)})},x.prototype.uploadFailed=function(t,e){var i=this,s=this.getLiElement(e),n=t&&t.currentTarget?this.getResponse(t):null,a=this.localizedTexts("uploadFailedMessage"),n={e:t,response:n,operation:"upload",file:this.updateStatus(e,a,"0",!1),statusText:a};C.isNullOrUndefined(s)||this.renderFailureState(t,e,s),this.trigger("failure",n,function(t){i.updateStatus(e,t.statusText,"0"),i.checkActionButtonStatus(),i.uploadSequential(),i.checkActionComplete(!0)})},x.prototype.uploadSequential=function(){this.sequentialUpload&&(this.autoUpload?this.checkAutoUpload(this.filesData):this.uploadButtonClick())},x.prototype.checkActionComplete=function(t){t?++this.actionCompleteCount:--this.actionCompleteCount,this.raiseActionComplete()},x.prototype.raiseActionComplete=function(){var t;this.filesData.length===this.actionCompleteCount&&this.flag&&(this.flag=!1,(t={fileData:[]}).fileData=this.getSelectedFileStatus(this.selectedFiles),this.trigger("actionComplete",t))},x.prototype.getSelectedFileStatus=function(t){for(var e=[],i=0,s=0;s<t.length;s++)for(var n=t[s],a=0;a<this.filesData.length;a++)if(this.filesData[a].name===n.name&&this.filesData[a].status===n.status){e[i]=this.filesData[a],++i;break}return e},x.prototype.updateProgressBarClasses=function(t,e){t=t.querySelector("."+rs);C.isNullOrUndefined(t)||t.classList.add(e)},x.prototype.removeProgressbar=function(t,e){var i=this;C.isNullOrUndefined(t.querySelector("."+as))||(this.progressAnimation=new C.Animation({duration:1250}),this.progressAnimation.animate(t.querySelector("."+as),{name:"FadeOut"}),this.progressAnimation.animate(t.querySelector("."+ls),{name:"FadeOut"}),setTimeout(function(){i.animateProgressBar(t,e)},750))},x.prototype.animateProgressBar=function(t,e){"success"===e?(t.classList.add(g),C.isNullOrUndefined(t.querySelector("."+c))||(t.querySelector("."+c).classList.remove(f),this.progressAnimation.animate(t.querySelector("."+c),{name:"FadeIn"}),t.querySelector("."+c).classList.add(g))):C.isNullOrUndefined(t.querySelector("."+c))||(t.querySelector("."+c).classList.remove(f),this.progressAnimation.animate(t.querySelector("."+c),{name:"FadeIn"}),t.querySelector("."+c).classList.add(y)),t.querySelector("."+as)&&C.detach(t.querySelector("."+as))},x.prototype.setExtensions=function(t){""===t||C.isNullOrUndefined(t)?this.element.removeAttribute("accept"):this.element.setAttribute("accept",t)},x.prototype.templateComplier=function(e){if(e)try{return"function"!=typeof e&&C.selectAll(e,document).length?C.compile(C.select(e,document).innerHTML.trim()):C.compile(e)}catch(t){return C.compile(e)}},x.prototype.setRTL=function(){this.enableRtl?C.addClass([this.uploadWrapper],"e-rtl"):C.removeClass([this.uploadWrapper],"e-rtl")},x.prototype.localizedTexts=function(t){return this.l10n.setLocale(this.locale),this.l10n.getConstant(t)},x.prototype.setControlStatus=function(){this.enabled?(this.uploadWrapper.classList.contains(us)&&this.uploadWrapper.classList.remove(us),!C.isNullOrUndefined(this.browseButton)&&this.element.hasAttribute("disabled")&&(this.element.removeAttribute("disabled"),this.browseButton.removeAttribute("disabled")),!C.isNullOrUndefined(this.clearButton)&&this.clearButton.hasAttribute("disabled")&&this.clearButton.removeAttribute("disabled"),!C.isNullOrUndefined(this.uploadButton)&&this.uploadButton.hasAttribute("disabled")&&this.uploadButton.hasAttribute("disabled")):(this.uploadWrapper.classList.add(us),this.element.setAttribute("disabled","disabled"),this.browseButton.setAttribute("disabled","disabled"),C.isNullOrUndefined(this.clearButton)||this.clearButton.setAttribute("disabled","disabled"),C.isNullOrUndefined(this.uploadButton)||this.uploadButton.setAttribute("disabled","disabled"))},x.prototype.checkHTMLAttributes=function(t){for(var e=0,i=t?C.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["accept","multiple","disabled"];e<i.length;e++){var s,n=i[e];if(!C.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"accept":(C.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.allowedExtensions||t)&&(this.setProperties({allowedExtensions:this.element.getAttribute("accept")},!t),this.initialAttr.accept=this.allowedExtensions);break;case"multiple":(C.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.multiple||t)&&(s="multiple"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n),this.setProperties({multiple:s},!t),this.initialAttr.multiple=!0);break;case"disabled":(C.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n),this.setProperties({enabled:s},!t),this.initialAttr.disabled=!0)}}},x.prototype.chunkUpload=function(t,e,i){var s=Math.min(this.asyncSettings.chunkSize,t.size),n=t.rawFile.slice(0,s);this.sendRequest(t,{chunkIndex:0,blob:n,file:t,start:0,end:s,retryCount:0,request:null},e,i)},x.prototype.sendRequest=function(i,s,e,t){var n=this,a=new FormData,r=i.rawFile.slice(s.start,s.end),r=(a.append(this.uploaderName,r,i.name),a.append("chunk-index",s.chunkIndex.toString()),a.append("chunkIndex",s.chunkIndex.toString()),Math.max(Math.ceil(i.size/this.asyncSettings.chunkSize),1)),l=(a.append("total-chunk",r.toString()),a.append("totalChunk",r.toString()),new C.Ajax({url:this.asyncSettings.saveUrl,type:"POST",async:!0,contentType:null})),o=(l.emitError=!1,l.onLoad=function(t){return n.chunkUploadComplete(t,s,e),{}},l.onUploadProgress=function(t){return n.chunkUploadInProgress(t,s,e),{}},{fileData:i,customFormData:[],cancel:!1,chunkSize:0===this.asyncSettings.chunkSize?null:this.asyncSettings.chunkSize});l.beforeSend=function(e){o.currentRequest=l.httpRequest,o.currentChunkIndex=s.chunkIndex,0===o.currentChunkIndex?n.trigger("uploading",o,function(t){n.uploadingEventCallback(a,t,e,i)}):n.trigger("chunkUploading",o,function(t){n.uploadingEventCallback(a,t,e,i)})},l.onError=function(t){return n.chunkUploadFailed(t,s,e),{}},l.send(a),s.request=l},x.prototype.uploadingEventCallback=function(t,e,i,s){e.cancel?this.eventCancelByArgs(i,e,s):this.updateFormData(t,e.customFormData)},x.prototype.eventCancelByArgs=function(t,e,i){var s,n=this;t.cancel=!0,"5"!==e.fileData.statusCode&&(e.fileData.statusCode="5",e.fileData.status=this.localizedTexts("fileUploadCancel"),s=this.getLiElement(e.fileData))&&(C.isNullOrUndefined(s.querySelector("."+c))||(s.querySelector("."+c).innerHTML=this.localizedTexts("fileUploadCancel"),s.querySelector("."+c).classList.add(y)),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}}),(t=s.querySelector("."+m))&&t.parentElement.insertBefore(this.pauseButton,t),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),this.pauseButton.addEventListener("click",function(t){n.reloadcanceledFile(t,i,s)},!1),this.checkActionButtonStatus())},x.prototype.checkChunkUpload=function(){return!(this.asyncSettings.chunkSize<=0||C.isNullOrUndefined(this.asyncSettings.chunkSize))},x.prototype.chunkUploadComplete=function(t,s,n){var a,e,i,r=this,l=t.target;4===l.readyState&&200<=l.status&&l.status<300?(i=t&&t.currentTarget?this.getResponse(t):null,e=Math.max(Math.ceil(s.file.size/this.asyncSettings.chunkSize),1),i={event:t,file:s.file,chunkIndex:s.chunkIndex,totalChunk:e,chunkSize:this.asyncSettings.chunkSize,response:i},this.trigger("chunkSuccess",i),!C.isNullOrUndefined(n)&&n||(a=this.getLiElement(s.file)),this.updateMetaData(s),s.end===s.file.size&&(s.file.statusCode="3"),"5"===s.file.statusCode?(i={event:t,fileData:s.file,cancel:!1,customFormData:[]},this.trigger("canceling",i,function(t){var e,i;t.cancel?(s.file.statusCode="3",e=a.querySelector("."+v),C.isNullOrUndefined(a)||C.isNullOrUndefined(e)||(h.hideSpinner(e),C.detach(a.querySelector(".e-spinner-pane"))),r.sendNextRequest(s)):(s.request.emitError=!1,l.abort(),e=new FormData,i=r.element.getAttribute("name"),e.append(i,s.file.name),e.append("cancel-uploading",s.file.name),e.append("cancelUploading",s.file.name),r.updateFormData(e,t.customFormData),(i=new C.Ajax(r.asyncSettings.removeUrl,"POST",!0,null)).emitError=!1,i.onLoad=function(t){return r.removeChunkFile(t,s,n),{}},i.send(e))})):e-1===s.chunkIndex&&e>s.chunkIndex?(0<=(i=this.pausedData.indexOf(s))&&this.pausedData.splice(i,1),C.isNullOrUndefined(this.template)&&(C.isNullOrUndefined(n)||!n)&&a&&(a&&!C.isNullOrUndefined(a.querySelector("."+E))&&C.detach(a.querySelector("."+E)),this.removeChunkProgressBar(s)),this.raiseSuccessEvent(t,s.file)):"4"!==s.file.statusCode&&this.sendNextRequest(s)):this.chunkUploadFailed(t,s)},x.prototype.sendNextRequest=function(t){t.start=t.end,t.end+=this.asyncSettings.chunkSize,t.end=Math.min(t.end,t.file.size),t.chunkIndex+=1,this.sendRequest(t.file,t)},x.prototype.removeChunkFile=function(t,e,i){var s,n;C.isNullOrUndefined(this.template)&&C.isNullOrUndefined(i)&&!i&&(n=s=(i=this.getLiElement(e.file)).querySelector("."+v),this.updateStatus(e.file,this.localizedTexts("fileUploadCancel"),"5"),this.updateProgressBarClasses(i,y),this.removeProgressbar(i,"failure"),s&&(s.classList.remove(v),s.classList.add(m),s.setAttribute("title",this.localizedTexts("remove"))),(e=i.querySelector("."+E))&&(e.classList.add(ss),e.classList.remove(E),e.setAttribute("title",this.localizedTexts("retry"))),C.isNullOrUndefined(i)||C.isNullOrUndefined(s)||C.isNullOrUndefined(i.querySelector(".e-spinner-pane"))||(h.hideSpinner(n),C.detach(i.querySelector(".e-spinner-pane"))))},x.prototype.pauseUpload=function(t,e,i){t.file.statusCode="4",t.file.status=this.localizedTexts("pause"),this.updateMetaData(t);e={event:e||null,file:t.file,chunkIndex:t.chunkIndex,chunkCount:Math.round(t.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize};this.abortUpload(t,i,e),this.sequentialUpload&&this.uploadSequential()},x.prototype.abortUpload=function(t,e,i){"4"!==t.file.statusCode&&(t.request.emitError=!1,t.request.httpRequest.abort());var s=this.getLiElement(t.file);!C.isNullOrUndefined(this.template)||!C.isNullOrUndefined(e)&&e||((e=s.querySelector("."+E)).classList.remove(E),e.classList.add(cs),e.setAttribute("title",this.localizedTexts("resume")),e.nextElementSibling.classList.add(m),e.nextElementSibling.classList.remove(v),e.nextElementSibling.setAttribute("title",this.localizedTexts("remove")));for(var n=0;n<this.pausedData.length;n++)this.pausedData[n].file.name===t.file.name&&this.pausedData.splice(n,1);this.pausedData.push(t),this.trigger("pausing",i)},x.prototype.resumeUpload=function(t,e,i){var s,n=this.getLiElement(t.file),n=(C.isNullOrUndefined(n)||(s=n.querySelector("."+cs)),C.isNullOrUndefined(s)||!C.isNullOrUndefined(i)&&i||(s.classList.remove(cs),s.classList.add(E),s.setAttribute("title",this.localizedTexts("pause")),s.nextElementSibling.classList.remove(m),s.nextElementSibling.classList.add(v),s.nextElementSibling.setAttribute("title",this.localizedTexts("abort"))),t.file.status=this.localizedTexts("inProgress"),t.file.statusCode="3",this.updateMetaData(t),{event:e||null,file:t.file,chunkIndex:t.chunkIndex,chunkCount:Math.round(t.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize});this.trigger("resuming",n);for(var a=0;a<this.pausedData.length;a++)this.pausedData[a].end===this.pausedData[a].file.size?this.chunkUploadComplete(e,t,i):this.pausedData[a].file.name===t.file.name&&(this.pausedData[a].start=this.pausedData[a].end,this.pausedData[a].end=this.pausedData[a].end+this.asyncSettings.chunkSize,this.pausedData[a].end=Math.min(this.pausedData[a].end,this.pausedData[a].file.size),this.pausedData[a].chunkIndex=this.pausedData[a].chunkIndex+1,this.sendRequest(this.pausedData[a].file,this.pausedData[a],i))},x.prototype.updateMetaData=function(t){-1===this.uploadMetaData.indexOf(t)||this.uploadMetaData.splice(this.uploadMetaData.indexOf(t),1),this.uploadMetaData.push(t)},x.prototype.removeChunkProgressBar=function(t){var t=this.getLiElement(t.file);C.isNullOrUndefined(t)||(this.updateProgressBarClasses(t,g),this.removeProgressbar(t,"success"),t=t.querySelector("."+v),C.isNullOrUndefined(t))||(t.classList.add(d),t.setAttribute("title",this.localizedTexts("delete")),t.classList.remove(v,f))},x.prototype.chunkUploadFailed=function(i,s,n){var a,r=this,t=Math.max(Math.ceil(s.file.size/this.asyncSettings.chunkSize),1),l=(!C.isNullOrUndefined(this.template)||!C.isNullOrUndefined(n)&&n||(a=this.getLiElement(s.file)),i&&i.currentTarget?this.getResponse(i):null),t={event:i,file:s.file,chunkIndex:s.chunkIndex,totalChunk:t,chunkSize:this.asyncSettings.chunkSize,cancel:!1,response:l};this.trigger("chunkFailure",t,function(t){var e;t.cancel||(s.retryCount<r.asyncSettings.retryCount?setTimeout(function(){r.retryRequest(a,s,n)},r.asyncSettings.retryAfterDelay):(C.isNullOrUndefined(a)||(t=a.querySelector("."+E)?a.querySelector("."+E):a.querySelector("."+cs),C.isNullOrUndefined(t)||(t.classList.add(ss),t.classList.remove(E,cs)),r.updateProgressBarClasses(a,y),r.removeProgressbar(a,"failure"),a.querySelector(".e-icons").classList.remove(f),(t=a.querySelector("."+v)?a.querySelector("."+v):a.querySelector("."+m)).classList.remove(v),C.isNullOrUndefined(a.querySelector("."+E))||C.detach(a.querySelector("."+E)),0<s.start?(t.classList.add(d),t.setAttribute("title",r.localizedTexts("delete"))):(t.classList.add(m),t.setAttribute("title",r.localizedTexts("remove")))),s.retryCount=0,e=s.file,t=r.localizedTexts("uploadFailedMessage"),t={e:i,response:l,operation:"upload",file:r.updateStatus(e,t,"0",!1),statusText:t},r.trigger("failure",t,function(t){r.updateStatus(e,t.statusText,"0"),r.uploadSequential(),r.checkActionComplete(!0)})))})},x.prototype.retryRequest=function(t,e,i){C.isNullOrUndefined(this.template)&&(C.isNullOrUndefined(i)||!i)&&t&&this.updateProgressBarClasses(t,y),e.retryCount+=1,this.sendRequest(e.file,e)},x.prototype.checkPausePlayAction=function(t){var e=t.target,i=t.target.parentElement,i=this.fileList.indexOf(i),i=this.filesData[i],i=this.getCurrentMetaData(i);e.classList.contains(E)?this.pauseUpload(i,t):e.classList.contains(cs)?this.resumeUpload(i,t):e.classList.contains(ss)&&(i.file.status===this.localizedTexts("fileUploadCancel")?this.retryUpload(i,!1):this.retryUpload(i,!0))},x.prototype.retryUpload=function(t,e){e?(t.end=t.end+this.asyncSettings.chunkSize,t.start=t.start+this.asyncSettings.chunkSize,this.sendRequest(t.file,t)):(t.file.statusCode="1",t.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(t.file)),this.getLiElement(t.file).classList.add(ms)},x.prototype.chunkUploadInProgress=function(t,e,i){var s,n,a=this;"4"===e.file.statusCode||("4"!==e.file.statusCode&&"5"!==e.file.statusCode&&(e.file.statusCode="3",e.file.status=this.localizedTexts("inProgress")),this.updateMetaData(e),s=this.getLiElement(e.file),C.isNullOrUndefined(s))||(n=s.querySelector("."+ss),C.isNullOrUndefined(n)||(n.classList.add(E),n.setAttribute("title",this.localizedTexts("pause")),n.classList.remove(ss)),C.isNullOrUndefined(s)||(0<s.querySelectorAll("."+as).length||(n=s.querySelector("."+c),C.isNullOrUndefined(this.template)&&(n.classList.add(f),n.classList.remove(y),this.createProgressBar(s),this.updateProgressBarClasses(s,f)),n=s.querySelector("."+m)?s.querySelector("."+m):s.querySelector("."+d),C.isNullOrUndefined(n))||(n.classList.add(v),n.setAttribute("title",this.localizedTexts("abort")),n.classList.remove(m)),!isNaN(Math.round(t.loaded/t.total*100))&&C.isNullOrUndefined(this.template)&&"4"!==e.file.statusCode&&(n=void 0,t=Math.ceil(e.file.size/this.asyncSettings.chunkSize)-1,this.asyncSettings.chunkSize)&&t&&(n=Math.round(e.chunkIndex/t*100),this.changeProgressValue(s,n.toString()+"%")),0===e.chunkIndex&&this.checkActionButtonStatus()),C.isNullOrUndefined(s.querySelector("."+E))&&C.isNullOrUndefined(this.template)&&C.isNullOrUndefined(s.querySelector("."+d))&&(this.pauseButton=this.createElement("span",{className:"e-icons e-file-pause-btn",attrs:{tabindex:this.btnTabIndex}}),"msie"===this.browserName&&this.pauseButton.classList.add("e-msie"),(t=s.querySelector("."+v)).parentElement.insertBefore(this.pauseButton,t),this.pauseButton.setAttribute("title",this.localizedTexts("pause")),this.pauseButton.addEventListener("click",function(t){a.checkPausePlayAction(t)},!1)))},x.prototype.bytesToSize=function(t){var e=-1;if(!t)return"0.0 KB";for(;e++,99<(t/=1024););return 2<=e&&(t*=1024,e=1),Math.max(t,0).toFixed(1)+" "+["KB","MB"][e]},x.prototype.sortFileList=function(t){for(var e=t=t||this.sortFilesList,i=[],s=0;s<e.length;s++)i.push(e[s].name);for(var n=[],a=0,r=i.sort();a<r.length;a++)for(var l=r[a],s=0;s<e.length;s++)l===e[s].name&&n.push(e[s]);return n},x.prototype.destroy=function(){this.element.value=null,this.clearTemplate(),this.clearAll(),this.unWireEvents(),this.unBindDropEvents(),this.multiple&&this.element.removeAttribute("multiple"),this.enabled||this.element.removeAttribute("disabled"),this.element.removeAttribute("accept"),this.setInitialAttributes();for(var t=0,e=["aria-label","directory","webkitdirectory","tabindex"];t<e.length;t++)this.element.removeAttribute(e[t]);C.isNullOrUndefined(this.uploadWrapper)||(this.uploadWrapper.parentElement.appendChild(this.element),C.detach(this.uploadWrapper)),this.uploadWrapper=null,this.uploadWrapper=null,this.browseButton=null,this.dropAreaWrapper=null,this.dropZoneElement=null,this.dropArea=null,this.keyboardModule=null,this.clearButton=null,this.uploadButton=null,ks.prototype.destroy.call(this)},x.prototype.upload=function(t,e){var i,s=this;t=t||this.filesData,this.sequentialUpload&&(this.isFirstFileOnSelection||e)?this.sequenceUpload(t):(i=this.getFilesInArray(t),this.trigger("beforeUpload",{customFormData:[],currentRequest:null,cancel:!1},function(t){t.cancel||(s.customFormDatas=t.customFormData&&0<t.customFormData.length?t.customFormData:s.customFormDatas,s.uploadFiles(i,e))}))},x.prototype.getFilesInArray=function(t){var e=[];return t instanceof Array?e=t:e.push(t),e},x.prototype.serverReadFileBase64=function(a,r,l){var o=this;return new Promise(function(i,s){var n,t=o.fileStreams[a].rawFile;try{var e=new FileReader;e.onload=(n=e,function(){try{var t=n.result,e=t?t.split(";base64,")[1]:null;i(e)}catch(t){s(t)}}),e.readAsDataURL(t.slice(r,r+l))}catch(t){s(t)}})},x.prototype.uploadFileCount=function(t){var e=this.filesData;return e&&0!==e.length?e.length:-1},x.prototype.getFileRead=function(t,e){var i=this.filesData;return i&&0!==i.length?(i=i[t],t=this.newFileRef++,this.fileStreams[t]=i,t):-1},x.prototype.uploadFiles=function(t,e){var i,s=[];if(""!==this.asyncSettings.saveUrl&&!C.isNullOrUndefined(this.asyncSettings.saveUrl)){s=!e||C.isNullOrUndefined(e)?this.multiple?this.filterfileList(t):((i=[]).push(t[0]),this.filterfileList(i)):t;for(var n=0;n<s.length;n++)this.uploadFilesRequest(s,n,e)}},x.prototype.uploadFilesRequest=function(i,s,e){var t,n=this,a=this.checkChunkUpload(),r=new C.Ajax(this.asyncSettings.saveUrl,"POST",!0,null),l=(r.emitError=!1,{fileData:i[s],customFormData:[],cancel:!1}),o=new FormData;r.beforeSend=function(e){l.currentRequest=r.httpRequest,n.trigger("uploading",l,function(t){t.cancel&&n.eventCancelByArgs(e,t,i[s]),n.customFormDatas&&0<n.customFormDatas.length&&n.updateFormData(o,n.customFormDatas),n.updateFormData(o,t.customFormData)})},"1"===i[s].statusCode&&(t=this.element.getAttribute("name"),o.append(t,i[s].rawFile,i[s].name),a&&i[s].size>this.asyncSettings.chunkSize?this.chunkUpload(i[s],e,s):(r.onLoad=function(t){return l.cancel||n.uploadComplete(t,i[s],e),{}},r.onUploadProgress=function(t){return l.cancel||n.uploadInProgress(t,i[s],e,r),{}},r.onError=function(t){return n.uploadFailed(t,i[s]),{}},r.send(o)))},x.prototype.spliceFiles=function(t){for(var e=this.fileList[t],i=this.getFilesData(),e=+e.getAttribute("data-files-count"),s=0,n=0;n<t;n++)s+=+this.fileList[n].getAttribute("data-files-count");for(var a=s+e-1;s<=a;a--)i.splice(a,1)},x.prototype.remove=function(r,a,l,t,o){var h=this,u=(C.isNullOrUndefined(t)&&(t=!0),{event:o,cancel:!1,filesData:[],customFormData:[],postRawFile:t,currentRequest:null});this.trigger("beforeRemove",{cancel:!1,customFormData:[],currentRequest:null},function(t){if(!t.cancel)if(h.isFormUpload())u.filesData=r,h.trigger("removing",u,function(t){if(!t.cancel)for(var e=!1,i=void 0,s=0,n=h.getFilesInArray(r);s<n.length;s++){var a=n[s];-1<(i=e?i:h.fileList.indexOf(a.list))&&((a=C.isNullOrUndefined(a.input)?null:a.input)&&C.detach(a),h.spliceFiles(i),C.detach(h.fileList[i]),h.fileList.splice(i,1),e=!0,i=-1)}});else if(h.isForm&&(C.isNullOrUndefined(h.asyncSettings.removeUrl)||""===h.asyncSettings.removeUrl))u.filesData=h.getFilesData(),h.trigger("removing",u,function(t){t.cancel||h.clearAll()});else for(var t=[],e=((r=C.isNullOrUndefined(r)?h.filesData:r)instanceof Array?t=r:t.push(r),u.filesData=t,h.asyncSettings.removeUrl),i=""!==e&&!C.isNullOrUndefined(e),s=0,n=t;s<n.length;s++)!function(e){var t=h.uploadedFilesData.indexOf(e);("2"===e.statusCode||"4"===e.statusCode||"0"===e.statusCode&&-1!==t)&&i?h.removeUploadedFile(e,u,l,a):l?h.removeFilesData(e,a):h.trigger("removing",u,function(t){t.cancel||h.removeFilesData(e,a)}),o&&!o.target.classList.contains(m)&&h.checkActionComplete(!1)}(n[s])})},x.prototype.clearAll=function(){var t,e=this;C.isNullOrUndefined(this.listParent)?("msie"!==this.browserName&&(this.element.value=""),this.filesData=[]):(t={cancel:!1,filesData:this.filesData},this.trigger("clearing",t,function(t){t.cancel||(e.clearData(),e.actionCompleteCount=0,e.count=-1)}))},x.prototype.getFilesData=function(t){return C.isNullOrUndefined(t)?this.filesData:this.getSelectedFiles(t)},x.prototype.pause=function(t,e){t=t||this.filesData;t=this.getFilesInArray(t);this.pauseUploading(t,e)},x.prototype.pauseUploading=function(t,e){for(var i=this.getFiles(t),s=0;s<i.length;s++)"3"===i[s].statusCode&&this.pauseUpload(this.getCurrentMetaData(i[s],null),null,e)},x.prototype.getFiles=function(t){var e=[];return C.isNullOrUndefined(t)||t instanceof Array?e=t:e.push(t),e},x.prototype.resume=function(t,e){t=t||this.filesData;t=this.getFilesInArray(t);this.resumeFiles(t,e)},x.prototype.resumeFiles=function(t,e){for(var i=this.getFiles(t),s=0;s<i.length;s++)"4"===i[s].statusCode&&this.resumeUpload(this.getCurrentMetaData(i[s],null),null,e)},x.prototype.retry=function(t,e,i){t=t||this.filesData;t=this.getFilesInArray(t);this.sequentialUpload&&this.isFirstFileOnSelection&&(this.isFirstFileOnSelection=!1),this.retryFailedFiles(t,e,i)},x.prototype.retryFailedFiles=function(t,e,i){for(var s,n=this.getFiles(t),a=0;a<n.length;a++)"5"!==n[a].statusCode&&"0"!==n[a].statusCode||(0<this.asyncSettings.chunkSize&&this.getCurrentMetaData(n[a],null)?this.retryUpload(this.getCurrentMetaData(n[a],null),e):(s=void 0,i||(s=this.fileList[this.filesData.indexOf(n[a])]),this.reloadcanceledFile(null,n[a],s,i)))},x.prototype.cancel=function(t){t=t||this.filesData;t=this.getFilesInArray(t);this.cancelUpload(t)},x.prototype.cancelUpload=function(t){var e=this.getFiles(t);if(0<this.asyncSettings.chunkSize)for(var i,s=0;s<e.length;s++)"3"===e[s].statusCode&&((i=this.getCurrentMetaData(e[s],null)).file.statusCode="5",i.file.status=this.localizedTexts("fileUploadCancel"),this.updateMetaData(i),this.showHideUploadSpinner(e[s]));else for(s=0;s<e.length;s++)"3"===e[s].statusCode&&(e[s].statusCode="5",e[s].status=this.localizedTexts("fileUploadCancel"),this.showHideUploadSpinner(e[s]))},x.prototype.showHideUploadSpinner=function(t){var t=this.getLiElement(t);!C.isNullOrUndefined(t)&&C.isNullOrUndefined(this.template)&&(t=t.querySelector("."+v),h.createSpinner({target:t,width:"20px"}),h.showSpinner(t))},s([C.Complex({saveUrl:"",removeUrl:""},Ts)],x.prototype,"asyncSettings",void 0),s([C.Property(!1)],x.prototype,"sequentialUpload",void 0),s([C.Property({})],x.prototype,"htmlAttributes",void 0),s([C.Property("")],x.prototype,"cssClass",void 0),s([C.Property(!0)],x.prototype,"enabled",void 0),s([C.Property(null)],x.prototype,"template",void 0),s([C.Property(!0)],x.prototype,"multiple",void 0),s([C.Property(!0)],x.prototype,"autoUpload",void 0),s([C.Property(!0)],x.prototype,"enableHtmlSanitizer",void 0),s([C.Complex({},Es)],x.prototype,"buttons",void 0),s([C.Property("")],x.prototype,"allowedExtensions",void 0),s([C.Property(0)],x.prototype,"minFileSize",void 0),s([C.Property(3e7)],x.prototype,"maxFileSize",void 0),s([C.Property(null)],x.prototype,"dropArea",void 0),s([C.Collection([{}],ys)],x.prototype,"files",void 0),s([C.Property(!0)],x.prototype,"showFileList",void 0),s([C.Property(!1)],x.prototype,"directoryUpload",void 0),s([C.Property("Default")],x.prototype,"dropEffect",void 0),s([C.Event()],x.prototype,"created",void 0),s([C.Event()],x.prototype,"actionComplete",void 0),s([C.Event()],x.prototype,"rendering",void 0),s([C.Event()],x.prototype,"beforeUpload",void 0),s([C.Event()],x.prototype,"fileListRendering",void 0),s([C.Event()],x.prototype,"selected",void 0),s([C.Event()],x.prototype,"uploading",void 0),s([C.Event()],x.prototype,"success",void 0),s([C.Event()],x.prototype,"failure",void 0),s([C.Event()],x.prototype,"removing",void 0),s([C.Event()],x.prototype,"beforeRemove",void 0),s([C.Event()],x.prototype,"clearing",void 0),s([C.Event()],x.prototype,"progress",void 0),s([C.Event()],x.prototype,"change",void 0),s([C.Event()],x.prototype,"chunkSuccess",void 0),s([C.Event()],x.prototype,"chunkFailure",void 0),s([C.Event()],x.prototype,"chunkUploading",void 0),s([C.Event()],x.prototype,"canceling",void 0),s([C.Event()],x.prototype,"pausing",void 0),s([C.Event()],x.prototype,"resuming",void 0);var ks,t=s([C.NotifyPropertyChanges],x);function x(t,e){e=ks.call(this,t,e)||this;return e.initialAttr={accept:null,multiple:!1,disabled:!1},e.uploadedFilesData=[],e.base64String=[],e.isForm=!1,e.allTypes=!1,e.pausedData=[],e.uploadMetaData=[],e.tabIndex="0",e.btnTabIndex="0",e.disableKeyboardNavigation=!1,e.count=-1,e.actionCompleteCount=0,e.flag=!0,e.selectedFiles=[],e.uploaderName="UploadFiles",e.fileStreams=[],e.newFileRef=0,e.isFirstFileOnSelection=!1,e.dragCounter=0,e.fileList=[],e.filesData=[],e.uploaderOptions=t,e}Os=function(t,e){return(Os=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Os,Ls,s=function(t,e){function i(){this.constructor=t}Os(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},S=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},ws="e-apply",As="e-cancel",Ns="e-current",Hs="e-ctrl-btn",Bs="e-switch-ctrl-btn",Us="e-disabled",Rs="e-value-switch-btn",Is="e-handler",Vs="e-hide-hex-value",Fs="e-hide-opacity",Ms="e-hide-switchable-value",Ds="e-hide-value",zs="e-hide-valueswitcher",Ws="e-hsv-color",qs="e-hsv-container",js="e-selected-value",_s="e-mode-switch-btn",Xs="e-nocolor-item",Ks="e-opacity-value",Ys="e-palette",Zs="e-color-palette",Gs="e-color-picker",Js="e-preview-container",$s="e-previous",Qs="e-show-value",tn="e-selected",en="e-split-preview",sn="e-tile",nn=["#000000","#f44336","#e91e63","#9c27b0","#673ab7","#2196f3","#03a9f4","#00bcd4","#009688","#ffeb3b","#ffffff","#ffebee","#fce4ec","#f3e5f5","#ede7f6","#e3f2fd","#e1f5fe","#e0f7fa","#e0f2f1","#fffde7","#f2f2f2","#ffcdd2","#f8bbd0","#e1bee7","#d1c4e9","#bbdefb","#b3e5fc","#b2ebf2","#b2dfdb","#fff9c4","#e6e6e6","#ef9a9a","#f48fb1","#ce93d8","#b39ddb","#90caf9","#81d4fa","#80deea","#80cbc4","#fff59d","#cccccc","#e57373","#f06292","#ba68c8","#9575cd","#64b5f6","#4fc3f7","#4dd0e1","#4db6ac","#fff176","#b3b3b3","#ef5350","#ec407a","#ab47bc","#7e57c2","#42a5f5","#29b6f6","#26c6da","#26a69a","#ffee58","#999999","#e53935","#d81b60","#8e24aa","#5e35b1","#1e88e5","#039be5","#00acc1","#00897b","#fdd835","#808080","#d32f2f","#c2185b","#7b1fa2","#512da8","#1976d2","#0288d1","#0097a7","#00796b","#fbc02d","#666666","#c62828","#ad1457","#6a1b9a","#4527a0","#1565c0","#0277bd","#00838f","#00695c","#f9a825","#4d4d4d","#b71c1c","#880e4f","#4a148c","#311b92","#0d47a1","#01579b","#006064","#004d40","#f57f17"],s=(Ls=C.Component,s(T,Ls),T.prototype.preRender=function(){var t=this.element;this.formElement=C.closest(this.element,"form"),this.formElement&&C.EventHandler.add(this.formElement,"reset",this.formResetHandler,this);this.l10n=new C.L10n("colorpicker",{Apply:"Apply",Cancel:"Cancel",ModeSwitcher:"Switch Mode",RecentColors:"Recent colors"},this.locale),t.getAttribute("ejs-for")&&!t.getAttribute("name")&&t.setAttribute("name",t.id)},T.prototype.render=function(){this.initWrapper(),this.inline?this.createWidget():this.createSplitBtn(),this.enableOpacity||C.addClass([this.container.parentElement],Fs),this.renderComplete()},T.prototype.initWrapper=function(){var t=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"}),e=(this.element.parentNode.insertBefore(t,this.element),t.appendChild(this.element),C.attributes(this.element,{tabindex:"-1",spellcheck:"false","aria-label":"colorpicker"}),this.container=this.createElement("div",{className:"e-container"}),this.getWrapper().appendChild(this.container),this.value?this.roundValue(this.value).toLowerCase():"#008000ff"),i=(e=this.noColor&&"Palette"===this.mode&&""===this.value?"":e).slice(0,7);C.isNullOrUndefined(this.initialInputValue)&&(this.initialInputValue=i),this.element.value=i,this.enableOpacity?this.setProperties({value:e},!0):this.setProperties({value:i},!0),this.enableRtl&&t.classList.add("e-rtl"),this.cssClass&&C.addClass([t],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.tileRipple=C.rippleEffect(this.container,{selector:"."+sn}),this.ctrlBtnRipple=C.rippleEffect(this.container,{selector:".e-btn"})},T.prototype.getWrapper=function(){return this.element.parentElement},T.prototype.createWidget=function(){"Palette"===this.mode?(this.createPalette(),this.inline||this.firstPaletteFocus()):(this.createPicker(),this.inline||this.getDragHandler().focus()),this.isRgb=!0,this.createInput(),this.createCtrlBtn(),this.disabled||this.wireEvents(),this.inline&&this.disabled&&this.toggleDisabled(!0),C.Browser.isDevice&&this.refreshPopupPos()},T.prototype.createSplitBtn=function(){var e=this,t=this.createElement("button",{className:"e-split-colorpicker"}),i=(this.getWrapper().appendChild(t),this.splitBtn=new I.SplitButton({iconCss:"e-selected-color",target:this.container,disabled:this.disabled,enableRtl:this.enableRtl,createPopupOnClick:this.createPopupOnClick,open:this.onOpen.bind(this),click:function(){var t=new MouseEvent("click",{bubbles:!0,cancelable:!1});e.trigger("change",{currentValue:{hex:e.value.slice(0,7),rgba:e.convertToRgbString(e.hexToRgb(e.value))},previousValue:{hex:null,rgba:null},value:e.value,event:t})}}),this.splitBtn.createElement=this.createElement,this.splitBtn.appendTo(t),this.splitBtn.element.setAttribute("aria-label","colorpicker"),this.createElement("span",{className:en})),t=(C.select(".e-selected-color",t).appendChild(i),i.style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.getPopupEle());C.addClass([t],"e-colorpicker-popup"),this.cssClass&&C.addClass([t],this.cssClass.replace(/\s+/g," ").trim().split(" ")),C.Browser.isDevice&&!this.createPopupOnClick&&((i=this.getPopupInst()).relateTo=document.body,i.position={X:"center",Y:"center"},i.targetType="container",i.collision={X:"fit",Y:"fit"},i.offsetY=4,t.style.zIndex=h.getZindexPartial(this.splitBtn.element).toString()),this.bindCallBackEvent()},T.prototype.onOpen=function(){var t;this.trigger("open",{element:this.container}),C.Browser.isDevice||(t=this.getPopupInst(),0<h.isCollide(t.element).length&&(t.collision={X:"flip",Y:"fit"},t.position={X:"right",Y:"bottom"},t.targetType="container"))},T.prototype.getPopupInst=function(){return C.getInstance(this.getPopupEle(),h.Popup)},T.prototype.bindCallBackEvent=function(){var a=this;this.splitBtn.beforeOpen=function(s){var n=new I.Deferred;return a.trigger("beforeOpen",s,function(t){var e,i;t.cancel||((e=a.getPopupEle()).style.top=C.formatUnit(0+pageYOffset),e.style.left=C.formatUnit(0+pageXOffset),e.style.display="block",a.createWidget(),e.style.display="",C.Browser.isDevice&&(a.createPopupOnClick&&((i=a.getPopupInst()).relateTo=document.body,i.position={X:"center",Y:"center"},i.targetType="container",i.collision={X:"fit",Y:"fit"},i.offsetY=4,e.style.zIndex=h.getZindexPartial(a.splitBtn.element).toString()),a.modal=a.createElement("div"),a.modal.className="e-"+a.getModuleName()+" e-modal",a.modal.style.display="none",document.body.insertBefore(a.modal,e),document.body.className+=" e-colorpicker-overflow",a.modal.style.display="block",a.modal.style.zIndex=(Number(e.style.zIndex)-1).toString())),s.cancel=t.cancel,n.resolve(t)}),n},this.splitBtn.beforeClose=function(e){var t,i=new I.Deferred;return C.isNullOrUndefined(e.event)?i.resolve(e):(t={element:a.container,event:e.event,cancel:!1},a.trigger("beforeClose",t,function(t){C.Browser.isDevice&&e.event.target===a.modal&&(t.cancel=!0),t.cancel||a.onPopupClose(),e.cancel=t.cancel,i.resolve(t)})),i}},T.prototype.onPopupClose=function(){this.unWireEvents(),this.destroyOtherComp(),this.container.style.width="",C.select("."+en,this.splitBtn.element).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.container.innerHTML="",C.removeClass([this.container],[Gs,Zs]),C.Browser.isDevice&&this.modal&&(C.removeClass([document.body],"e-colorpicker-overflow"),this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},T.prototype.createPalette=function(){if(C.classList(this.container,[Zs],[Gs]),this.presetColors){var t=this.createElement("div",{className:"e-custom-palette"}),e=(this.appendElement(t),Object.keys(this.presetColors));if(1===e.length)this.appendPalette(this.presetColors[e[0]],e[0],t);else for(var i=0,s=e.length;i<s;i++)this.appendPalette(this.presetColors[e[i]],e[i],t);10<C.selectAll(".e-row",t).length&&C.addClass([t],"e-palette-group")}else this.appendPalette(nn,"default");"Palette"===this.mode&&!this.modeSwitcher&&this.noColor&&this.setNoColor(),this.showRecentColors&&this.recentColors&&0<this.recentColors.length&&this.renderRecentColor();var n=parseInt(getComputedStyle(this.container).borderBottomWidth,10);this.container.style.width=C.formatUnit(this.container.children[0].offsetWidth+n+n),this.rgb=this.hexToRgb(this.roundValue(this.value)),this.hsv=this.rgbToHsv.apply(this,this.rgb)},T.prototype.renderRecentColor=function(){var i=this,t=this.container.querySelector(".e-clr-pal-rec-wpr"),t=(t&&C.detach(t),this.createElement("div",{className:"e-clr-pal-rec-wpr"})),e=this.container.querySelector(".e-switch-ctrl-btn"),e=(e?this.container.insertBefore(t,e):this.container.appendChild(t),this.createElement("label",{className:"e-recent-clr-span"}));if(e.textContent=this.l10n.getConstant("RecentColors"),t.appendChild(e),0<this.recentColors.length){for(this.recentColors=this.recentColors.filter(function(t,e){return i.recentColors.indexOf(t)===e});10<this.recentColors.length;)this.recentColors.pop();this.appendPalette(this.recentColors,"recent-color",t)}},T.prototype.firstPaletteFocus=function(){C.select("."+tn,this.container.children[0])||C.selectAll("."+Ys,this.container)[0].focus()},T.prototype.appendPalette=function(t,e,i){var s,n,a,r=this.createElement("div",{className:Ys,attrs:{tabindex:"0",role:"grid"}});"recent-color"===e&&r.classList.add("e-recent-palette"),i?i.appendChild(r):this.appendElement(r);for(var l=0,o=t.length;l<o;l++)0!==l&&l%this.columns!=0||(s=this.createElement("div",{className:"e-row",attrs:{role:"row"}}),r.appendChild(s)),a=this.roundValue(t[l]).toLowerCase(),n=this.createElement("span",{className:sn,attrs:{role:"gridcell","aria-label":a,"aria-selected":"false"}}),this.trigger("beforeTileRender",{element:n,presetName:e,value:t[l]}),s.appendChild(n),this.value===a&&"recent-color"!==e&&(this.addTileSelection(n),r.focus()),n.style.backgroundColor=this.convertToRgbString(this.hexToRgb(a))},T.prototype.setNoColor=function(){var e=this.container.querySelector(".e-row").children[0];e.classList.add(Xs),this.value||(e.classList.add(tn),C.closest(e,"."+Ys).focus()),["aria-selected","aria-label"].forEach(function(t){e.removeAttribute(t)}),e.style.backgroundColor=""},T.prototype.appendElement=function(t,e){e=this.container.children[e=void 0===e?0:e];e?this.container.insertBefore(t,e):this.container.appendChild(t)},T.prototype.addTileSelection=function(t){t&&(t.classList.add(tn),t.setAttribute("aria-selected","true"))},T.prototype.createPicker=function(){C.classList(this.container,[Gs],[Zs]);var t=this.createElement("div",{className:qs}),e=(this.appendElement(t),t.appendChild(this.createElement("div",{className:Ws})),this.createElement("span",{className:Is,attrs:{tabindex:"0"}}));t.appendChild(e),null!==this.value&&""!==this.value||(this.value="#008000ff"),this.rgb=this.hexToRgb(this.value),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHsvContainerBg(),this.setHandlerPosition(),this.createSlider(),this.createDragTooltip()},T.prototype.setHsvContainerBg=function(t){void 0===t&&(t=this.hsv[0]),this.getHsvContainer().style.backgroundColor=this.convertToRgbString(this.hsvToRgb(t,100,100,1))},T.prototype.getHsvContainer=function(){return C.select("."+qs,this.container)},T.prototype.setHandlerPosition=function(){var t=this.getDragHandler(),e=C.select("."+Ws,this.container);this.enableRtl?t.style.left=C.formatUnit((e.offsetWidth-t.offsetWidth/2.5)*Math.abs(100-this.hsv[1])/100):t.style.left=C.formatUnit((e.offsetWidth-t.offsetWidth/2.5)*this.hsv[1]/100),t.style.top=C.formatUnit((e.offsetHeight-t.offsetHeight/2.5)*(100-this.hsv[2])/100)},T.prototype.createSlider=function(){var t=this.createElement("div",{className:"e-slider-preview"}),e=(this.appendElement(t,1),this.createPreview(t),this.createElement("div",{className:"e-colorpicker-slider"})),t=(t.insertBefore(e,t.children[0]),this.createElement("div",{className:"e-hue-slider"}));e.appendChild(t),this.hueSlider=new zi({value:this.hsv[0],min:0,max:359,enableRtl:this.enableRtl,enabled:!this.disabled,change:this.hueChange.bind(this)}),this.hueSlider.createElement=this.createElement,this.hueSlider.appendTo(t),this.enableOpacity&&(t=this.createElement("div",{className:"e-opacity-slider"}),e.appendChild(t),this.createOpacitySlider(t))},T.prototype.createOpacitySlider=function(t){this.opacitySlider=new zi({value:100*this.rgb[3],min:0,max:100,enableRtl:this.enableRtl,enabled:!this.disabled,change:this.opacityChange.bind(this)}),this.opacitySlider.createElement=this.createElement,this.opacitySlider.appendTo(t);var e=this.createElement("div",{className:"e-opacity-empty-track"});t.appendChild(e),this.updateOpacitySliderBg()},T.prototype.updateOpacitySliderBg=function(){var t=this.enableRtl?"to left":"to right",e=C.select(".e-opacity-empty-track",this.opacitySlider.element);e&&(e.style.background="linear-gradient("+t+", rgba("+this.rgb.slice(0,3)+", 0) 0%, "+this.convertToRgbString(this.rgb.slice(0,3))+" 100%)")},T.prototype.hueChange=function(t){this.hsv[0]=t.value,this.setHsvContainerBg(),this.convertToOtherFormat()},T.prototype.opacityChange=function(t){var t=t.value,e=this.rgbToHex(this.rgb),i=(this.hsv[3]=t/100,this.rgb[3]=t/100,this.rgbToHex(this.rgb)),t=(this.updateOpacityInput(t),this.convertToRgbString(this.rgb));this.updatePreview(t),this.triggerEvent(i,e,t)},T.prototype.updateOpacityInput=function(t){var e;this.enableOpacity&&!this.getWrapper().classList.contains(Ds)&&((e=C.getInstance(C.select("."+Ks,this.container),Ht)).value=t,e.dataBind())},T.prototype.createPreview=function(t){var e=this.createElement("div",{className:Js}),t=(t.appendChild(e),this.createElement("span",{className:"e-preview "+Ns})),i=(e.appendChild(t),this.convertToRgbString(this.rgb));t.style.backgroundColor=i,t=this.createElement("span",{className:"e-preview "+$s}),e.appendChild(t),t.style.backgroundColor=i},T.prototype.isPicker=function(){return!this.container.classList.contains(Zs)},T.prototype.getPopupEle=function(){return this.container.parentElement},T.prototype.createNumericInput=function(t,e,i,s){var n=this,e=new Ht({value:e,placeholder:i,min:0,max:s,format:"###.##",showSpinButton:!1,floatLabelType:"Always",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker(),change:function(t){t.event&&n.inputHandler(t.event)}});e.createElement=this.createElement,e.appendTo(t)},T.prototype.createInput=function(){var t=this.isPicker(),e=this.getWrapper();if(t&&!e.classList.contains(Ds)||!t&&e.classList.contains(Qs)){var i=this.createElement("div",{className:js}),s=(t?this.appendElement(i,2):this.appendElement(i,1),this.createElement("div",{className:"e-input-container"}));if(i.appendChild(s),e.classList.contains(zs)||this.appendValueSwitchBtn(i),e.classList.contains(Vs)||(t=this.createElement("input",{className:"e-hex",attrs:{maxlength:"7",spellcheck:"false","aria-label":"HEX"}}),s.appendChild(t),o.Input.createInput({element:t,floatLabelType:"Always",properties:{placeholder:"HEX",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker()}},this.createElement),o.Input.setValue(this.value.slice(0,7),t),t.addEventListener("input",this.inputHandler.bind(this))),!e.classList.contains(Ms)){for(var n=void 0,a=void 0,a=this.isRgb?(n="RGB",this.rgb):(n="HSV",this.hsv),r=["rh","gs","bv"],l=0;l<3;l++)this.createNumericInput(s.appendChild(this.createElement("input",{className:"e-"+r[l]+"-value"})),a[l],n[l],255);this.enableOpacity&&this.appendOpacityValue(s)}}},T.prototype.appendOpacityValue=function(t){this.createNumericInput(t.appendChild(this.createElement("input",{className:Ks})),100*this.rgb[3],"A",100)},T.prototype.appendValueSwitchBtn=function(t){var e=this.createElement("button",{className:"e-icons e-css e-btn e-flat e-icon-btn "+Rs,attrs:{title:"Toggle format"}});t.appendChild(e),this.isPicker()&&!this.getWrapper().classList.contains(Ms)&&e.addEventListener("click",this.formatSwitchHandler.bind(this))},T.prototype.createCtrlBtn=function(){var t,e;(this.modeSwitcher||this.showButtons)&&(this.l10n.setLocale(this.locale),e=this.createElement("div",{className:Bs}),this.container.appendChild(e),this.showButtons&&(t=this.createElement("div",{className:Hs}),e.appendChild(t),e=this.l10n.getConstant("Apply"),t.appendChild(this.createElement("button",{innerHTML:e,className:"e-btn e-css e-flat e-primary e-small "+ws,attrs:{title:e}})),e=this.l10n.getConstant("Cancel"),t.appendChild(this.createElement("button",{innerHTML:e,className:"e-btn e-css e-flat e-small "+As,attrs:{title:e}}))),this.modeSwitcher)&&this.appendModeSwitchBtn()},T.prototype.appendModeSwitchBtn=function(){var t=this.createElement("button",{className:"e-icons e-btn e-flat e-icon-btn "+_s,attrs:{title:this.l10n.getConstant("ModeSwitcher")}});C.select("."+Bs,this.container).insertBefore(t,C.select("."+Hs,this.container))},T.prototype.createDragTooltip=function(){var e=this,t=new h.Tooltip({opensOn:"Custom",showTipPointer:!1,cssClass:"e-color-picker-tooltip",htmlAttributes:{title:"tooltip"},beforeOpen:function(t){e.tooltipEle=t.element},animation:{open:{effect:"None"},close:{effect:"None"}}});t.createElement=this.createElement,t.appendTo(this.container),t.open(this.container),this.tooltipEle.style.zIndex=h.getZindexPartial(this.tooltipEle).toString(),this.tooltipEle.setAttribute("aria-label","colorpicker-tooltip"),C.select(".e-tip-content",this.tooltipEle).appendChild(this.createElement("div",{className:"e-tip-transparent"}))},T.prototype.getTooltipInst=function(){return C.getInstance(this.container,h.Tooltip)},T.prototype.setTooltipOffset=function(t){this.getTooltipInst().offsetY=t},T.prototype.toggleDisabled=function(e){e?this.getWrapper().classList.add(Us):this.getWrapper().classList.remove(Us),this.showButtons&&[].slice.call(C.selectAll(".e-btn",this.container)).forEach(function(t){e?C.attributes(t,{disabled:""}):t.removeAttribute("disabled")})},T.prototype.convertToRgbString=function(t){return t.length?4===t.length?"rgba("+t.join()+")":"rgb("+t.join()+")":""},T.prototype.convertToHsvString=function(t){return 4===t.length?"hsva("+t.join()+")":"hsv("+t.join()+")"},T.prototype.updateHsv=function(){this.hsv[1]=100<this.hsv[1]?100:this.hsv[1],this.hsv[2]=100<this.hsv[2]?100:this.hsv[2],this.setHandlerPosition()},T.prototype.convertToOtherFormat=function(t,e){void 0===t&&(t=!1);var i=this.rgbToHex(this.rgb),s=(this.rgb=this.hsvToRgb.apply(this,this.hsv),this.rgbToHex(this.rgb)),n=this.convertToRgbString(this.rgb);this.updatePreview(n),this.updateInput(s),this.triggerEvent(s,i,n,t,e)},T.prototype.updateInput=function(t){var e=this.getWrapper();e.classList.contains(Ds)||(e.classList.contains(Vs)||o.Input.setValue(t.substr(0,7),C.select(".e-hex",this.container)),e.classList.contains(Ms))||(this.isRgb?this.updateValue(this.rgb,!1):this.updateValue(this.hsv,!1))},T.prototype.updatePreview=function(t){this.enableOpacity&&this.updateOpacitySliderBg(),C.select(".e-tip-transparent",this.tooltipEle).style.backgroundColor=t,C.select("."+Js+" ."+Ns,this.container).style.backgroundColor=t,C.select("."+Js+" ."+$s,this.container).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value))},T.prototype.getDragHandler=function(){return C.select("."+Is,this.container)},T.prototype.removeTileSelection=function(){[].slice.call(C.selectAll("."+tn,this.container)).forEach(function(t){t.classList.remove(tn),t.setAttribute("aria-selected","false")})},T.prototype.convertRgbToNumberArray=function(t){return t.slice(t.indexOf("(")+1,t.indexOf(")")).split(",").map(function(t,e){return 3!==e?parseInt(t,10):parseFloat(t)})},T.prototype.getValue=function(t,e){var i,s;return t=t||this.value,e=e?e.toLowerCase():"hex","r"===t[0]?(i=this.convertRgbToNumberArray(t),"hex"===e||"hexa"===e?(s=this.rgbToHex(i),"hex"===e?s.slice(0,7):s):"hsv"===e?this.convertToHsvString(this.rgbToHsv.apply(this,i.slice(0,3))):"hsva"===e?this.convertToHsvString(this.rgbToHsv.apply(this,i)):"null"):"h"===t[0]?(i=this.hsvToRgb.apply(this,this.convertRgbToNumberArray(t)),"rgba"===e?this.convertToRgbString(i):"hex"===e||"hexa"===e?(s=this.rgbToHex(i),"hex"===e?s.slice(0,7):s):"rgb"===e?this.convertToRgbString(i.slice(0,3)):"null"):(t=this.roundValue(t),s=this.hexToRgb(t),"rgb"!==e&&"hsv"!==e||(s=s.slice(0,3)),"rgba"===e||"rgb"===e?this.convertToRgbString(s):"hsva"===e||"hsv"===e?this.convertToHsvString(this.rgbToHsv.apply(this,s)):"hex"===e?t.slice(0,7):"a"===e?s[3].toString():"null")},T.prototype.toggle=function(){this.container.parentElement.classList.contains("e-popup-close")?this.splitBtn.toggle():this.closePopup(null)},T.prototype.getModuleName=function(){return"colorpicker"},T.prototype.getPersistData=function(){return this.addOnPersist(["value"])},T.prototype.wireEvents=function(){var t;this.isPicker()?(t=this.getDragHandler(),C.EventHandler.add(t,"keydown",this.pickerKeyDown,this),(t=C.select("."+Hs,this.container))&&C.EventHandler.add(t,"keydown",this.ctrlBtnKeyDown,this),C.EventHandler.add(this.getHsvContainer(),"mousedown touchstart",this.handlerDown,this),(this.modeSwitcher||this.showButtons)&&this.addCtrlSwitchEvent(),C.EventHandler.add(C.select("."+$s,this.container),"click",this.previewHandler,this)):(C.EventHandler.add(this.container,"click",this.paletteClickHandler,this),C.EventHandler.add(this.container,"keydown",this.paletteKeyDown,this))},T.prototype.formResetHandler=function(){this.value=this.initialInputValue,C.attributes(this.element,{value:this.initialInputValue})},T.prototype.addCtrlSwitchEvent=function(){var t=C.select("."+Bs,this.container);t&&C.EventHandler.add(t,"click",this.btnClickHandler,this)},T.prototype.ctrlBtnKeyDown=function(t){13===t.keyCode&&(C.select("."+ws,this.container)&&(t=this.rgbToHex(this.rgb),this.triggerChangeEvent(t)),this.splitBtn.element.focus())},T.prototype.pickerKeyDown=function(t){switch(t.keyCode){case 39:this.handlerDragPosition(1,this.enableRtl?-1:1,t);break;case 37:this.handlerDragPosition(1,this.enableRtl?1:-1,t);break;case 38:this.handlerDragPosition(2,1,t);break;case 40:this.handlerDragPosition(2,-1,t);break;case 13:t.preventDefault();var e=this.rgbToHex(this.rgb);this.enterKeyHandler(e)}},T.prototype.enterKeyHandler=function(t){this.triggerChangeEvent(t),this.inline||this.splitBtn.element.focus()},T.prototype.closePopup=function(t){var e=this,t={element:this.container,event:t,cancel:!1};this.trigger("beforeClose",t,function(t){t.cancel||(e.splitBtn.toggle(),e.onPopupClose())})},T.prototype.triggerChangeEvent=function(t,e){var i=t.slice(0,7);this.trigger("change",{currentValue:{hex:i,rgba:this.convertToRgbString(this.rgb)},event:e,previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:this.enableOpacity?t:i}),this.showRecentColors&&(this.recentColors.unshift(i),this.inline)&&this.renderRecentColor(),this.enableOpacity?this.setProperties({value:t},!0):this.setProperties({value:i},!0),this.element.value=i||"#000000"},T.prototype.handlerDragPosition=function(t,e,i){i.preventDefault(),this.hsv[t]+=e*(i.ctrlKey?1:3),this.hsv[t]<0&&(this.hsv[t]=0),this.updateHsv(),this.convertToOtherFormat(!0,i)},T.prototype.handlerDown=function(t){t.preventDefault(),"mousedown"===t.type?(this.clientX=Math.abs(t.pageX-pageXOffset),this.clientY=Math.abs(t.pageY-pageYOffset),this.setTooltipOffset(8)):(this.clientX=Math.abs(t.changedTouches[0].pageX-pageXOffset),this.clientY=Math.abs(t.changedTouches[0].pageY-pageYOffset),this.setTooltipOffset(-8)),this.setHsv(this.clientX,this.clientY),this.getDragHandler().style.transition="left .4s cubic-bezier(.25, .8, .25, 1), top .4s cubic-bezier(.25, .8, .25, 1)",this.updateHsv(),this.convertToOtherFormat(!1,t),this.getDragHandler().focus(),C.EventHandler.add(document,"mousemove touchmove",this.handlerMove,this),C.EventHandler.add(document,"mouseup touchend",this.handlerEnd,this)},T.prototype.handlerMove=function(t){"touchmove"!==t.type&&t.preventDefault(),i="mousemove"===t.type?(e=Math.abs(t.pageX-pageXOffset),Math.abs(t.pageY-pageYOffset)):(e=Math.abs(t.changedTouches[0].pageX-pageXOffset),Math.abs(t.changedTouches[0].pageY-pageYOffset)),this.setHsv(e,i);var e,i,s=this.getDragHandler();this.updateHsv(),this.convertToOtherFormat(!1,t),this.getTooltipInst().refresh(s),this.tooltipEle.style.transform||(8<Math.abs(this.clientX-e)||8<Math.abs(this.clientY-i))&&(C.select("."+Ws,this.container).style.cursor="pointer",s.style.transition="none",this.inline||(this.tooltipEle.style.zIndex=(parseInt(this.getPopupEle().style.zIndex,10)+1).toString()),this.tooltipEle.style.transform="rotate(45deg)",s.classList.add("e-hide-handler"))},T.prototype.setHsv=function(t,e){var i=C.select("."+Ws,this.container),s=i.getBoundingClientRect();t=this.enableRtl?t>s.right?0:Math.abs(t-s.right):t>s.left?Math.abs(t-s.left):0,e=e>s.top?Math.abs(e-s.top):0,this.hsv[2]=Math.round(10*Number(100*(i.offsetHeight-Math.max(0,Math.min(i.offsetHeight,e-i.offsetTop)))/i.offsetHeight))/10,this.hsv[1]=Math.round(10*Number(100*Math.max(0,Math.min(i.offsetWidth,t-i.offsetLeft))/i.offsetWidth))/10},T.prototype.handlerEnd=function(t){"touchend"!==t.type&&t.preventDefault(),C.EventHandler.remove(document,"mousemove touchmove",this.handlerMove),C.EventHandler.remove(document,"mouseup touchend",this.handlerEnd);var e=this.getDragHandler();C.select("."+Ws,this.container).style.cursor="",this.tooltipEle.style.transform&&(this.tooltipEle.style.transform="",e.classList.remove("e-hide-handler")),this.inline||this.showButtons||this.closePopup(t)},T.prototype.btnClickHandler=function(t){var e=t.target;C.closest(e,"."+_s)?(t.stopPropagation(),this.switchToPalette()):(e.classList.contains(ws)||e.classList.contains(As))&&this.ctrlBtnClick(e,t)},T.prototype.switchToPalette=function(){this.trigger("beforeModeSwitch",{element:this.container,mode:"Palette"}),this.unWireEvents(),this.destroyOtherComp(),C.detach(C.select(".e-slider-preview",this.container)),this.getWrapper().classList.contains(Ds)||C.remove(C.select("."+js,this.container)),C.detach(this.getHsvContainer()),this.createPalette(),this.firstPaletteFocus(),this.createInput(),this.refreshPopupPos(),this.element.parentElement&&this.element.parentElement.parentElement&&this.element.parentElement.parentElement.classList.contains("e-ie-ddb-popup")&&this.refreshImageEditorPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Palette"})},T.prototype.refreshImageEditorPopupPos=function(){var t,e;C.Browser.isDevice&&((t=this.getPopupEle()).style.left=C.formatUnit(0+pageXOffset),t.style.top=C.formatUnit(0+pageYOffset),e=document.querySelector("#"+this.element.parentElement.parentElement.id.split("-popup")[0]))&&t.parentElement.ej2_instances[0].refreshPosition(e)},T.prototype.refreshPopupPos=function(){var t;this.inline||((t=this.getPopupEle()).style.left=C.formatUnit(0+pageXOffset),t.style.top=C.formatUnit(0+pageYOffset),this.getPopupInst().refreshPosition(this.splitBtn.element.parentElement))},T.prototype.formatSwitchHandler=function(){this.isRgb?(this.updateValue(this.hsv,!0,3,[360,100,100]),this.isRgb=!1):(this.updateValue(this.rgb,!0,2),this.isRgb=!0)},T.prototype.updateValue=function(t,e,i,s){for(var n,a=["e-rh-value","e-gs-value","e-bv-value"],r=0,l=a.length;r<l;r++)(n=C.getInstance(C.select("."+a[r],this.container),Ht)).value=Math.round(t[r]),e&&(n.placeholder=a[r].substr(i,1).toUpperCase(),n.max=s?s[r]:255),n.dataBind()},T.prototype.previewHandler=function(t){var e=t.target,i=this.rgbToHex(this.rgb),e=(this.rgb=this.convertRgbToNumberArray(e.style.backgroundColor),this.rgb[3]||(this.rgb[3]=1),this.rgbToHex(this.rgb)),s=this.rgbToHsv.apply(this,this.rgb);s[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:s[0]},!0),this.hueSlider.refresh()),this.setHsvContainerBg(s[0]),this.enableOpacity&&s[3]!==this.hsv[3]&&(this.opacitySlider.setProperties({value:100*s[3]},!0),this.opacitySlider.refresh(),this.updateOpacitySliderBg()),this.hsv=s,this.setHandlerPosition(),this.updateInput(e),C.select("."+Js+" ."+Ns,this.container).style.backgroundColor=this.convertToRgbString(this.rgb),this.triggerEvent(e,i,this.convertToRgbString(this.rgb),!1,t)},T.prototype.paletteClickHandler=function(t){t.preventDefault();var e,i,s=t.target;s.classList.contains(sn)?(this.removeTileSelection(),this.addTileSelection(s),s.classList.contains(Xs)?this.noColorTile():(e=s.getAttribute("aria-label"),i=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(this.roundValue(e)),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(Qs)&&this.updateInput(e),this.triggerEvent(e,i,this.convertToRgbString(this.rgb),!1,t)),this.inline||this.showButtons||this.closePopup(t)):C.closest(s,"."+_s)?this.switchToPicker():s.classList.contains(ws)||s.classList.contains(As)?this.ctrlBtnClick(s,t):this.getWrapper().classList.contains(Qs)&&C.closest(s,"."+Rs)&&this.formatSwitchHandler()},T.prototype.noColorTile=function(t){void 0===t&&(t=!1);var e=this.rgbToHex(this.rgb);this.rgb=[],this.hsv=[],this.triggerEvent("",e,"",t)},T.prototype.switchToPicker=function(){var t=this.getWrapper(),t=(this.trigger("beforeModeSwitch",{element:this.container,mode:"Picker"}),this.unWireEvents(),[].slice.call(C.selectAll("."+Ys,this.container)).forEach(function(t){C.detach(t)}),this.container.querySelector(".e-clr-pal-rec-wpr")&&C.detach(this.container.querySelector(".e-clr-pal-rec-wpr")),t.classList.contains(Qs)&&C.detach(C.select("."+js,this.container)),this.container.style.width="",C.select(".e-custom-palette",this.container));this.presetColors&&C.remove(t),this.createPicker(),this.getDragHandler().focus(),this.createInput(),this.refreshPopupPos(),this.element.parentElement&&this.element.parentElement.parentElement&&this.element.parentElement.parentElement.classList.contains("e-ie-ddb-popup")&&this.refreshImageEditorPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Picker"})},T.prototype.ctrlBtnClick=function(t,e){var i;t.classList.contains(ws)&&(i=this.rgbToHex(this.rgb),this.triggerChangeEvent(i,e)),this.inline?t.classList.contains(As)&&(i={element:this.container,event:e,cancel:!1},this.trigger("beforeClose",i)):(this.closePopup(e),this.splitBtn.element.focus())},T.prototype.paletteKeyDown=function(t){var e=t.target;if(e.classList.contains(Ys)){var i,s,n=[].slice.call(C.selectAll("."+sn,e)),a=n.filter(function(t){return t.classList.contains("e-selected")}).pop();switch(!t.altKey&&t.keyCode){case 39:t.preventDefault(),i=a?n[this.tilePosition(n,a,this.enableRtl?-1:1)]:n[this.enableRtl?n.length-1:0],this.keySelectionChanges(i);break;case 37:t.preventDefault(),i=a?n[this.tilePosition(n,a,this.enableRtl?1:-1)]:n[this.enableRtl?0:n.length-1],this.keySelectionChanges(i);break;case 38:t.preventDefault(),i=n[s=a?this.tilePosition(n,a,-this.columns):0]||n[s-this.columns],this.keySelectionChanges(i);break;case 40:t.preventDefault(),i=n[s=a?this.tilePosition(n,a,this.columns):n.length-1]||n[s=(s%=n.length)+n[n.length-1].parentElement.childElementCount],this.keySelectionChanges(i);break;case 13:t.preventDefault(),a&&(s=a.getAttribute("aria-label"),this.enterKeyHandler(s||""))}}},T.prototype.keySelectionChanges=function(t){var e;this.removeTileSelection(),this.addTileSelection(t),t.classList.contains(Xs)?this.noColorTile(!0):(t=t.getAttribute("aria-label"),e=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(t),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(Qs)&&this.updateInput(t),this.triggerEvent(t,e,this.convertToRgbString(this.rgb),!0))},T.prototype.tilePosition=function(t,e,i){var s=(t=Array.prototype.slice.call(t)).length,n=this.columns-t[s-1].parentElement.childElementCount,t=t.indexOf(e);return(t+=i)<0?t+=s+n:t%=s+n,t},T.prototype.inputHandler=function(t){var e,i,s=t.target;if(s.value.length)switch(C.select(".e-float-text",s.parentElement).textContent){case"HEX":var n="";if(9!==(n="#"===s.value[0]&&5!==s.value.length||"#"!==s.value[0]&&4!==s.value.length?this.roundValue(s.value):n).length)return;i=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(n+n.substr(-2)),this.inputValueChange(this.rgbToHsv.apply(this,this.rgb),i,s.value,t);break;case"R":this.rgb[0]!==Number(s.value)&&(i=this.rgbToHex(this.rgb),this.rgb[0]=Number(s.value),e=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(e,i,null,t));break;case"G":this.rgb[1]!==Number(s.value)&&(i=this.rgbToHex(this.rgb),this.rgb[1]=Number(s.value),e=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(e,i,null,t));break;case"B":this.rgb[2]!==Number(s.value)&&(i=this.rgbToHex(this.rgb),this.rgb[2]=Number(s.value),e=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(e,i,null,t));break;case"H":this.hueSlider.value=Number(s.value);break;case"S":this.hsv[1]!==Number(s.value)&&(this.hsv[1]=Number(s.value),this.updateHsv(),this.convertToOtherFormat(!1,t));break;case"V":this.hsv[2]!==Number(s.value)&&(this.hsv[2]=Number(s.value),this.updateHsv(),this.convertToOtherFormat(!1,t));break;case"A":this.opacitySlider.value=Number(s.value)}},T.prototype.inputValueChange=function(t,e,i,s){t[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:t[0]},!0),this.hueSlider.refresh(),this.setHsvContainerBg(t[0])),this.hsv=t;t=this.rgbToHex(this.rgb),this.setHandlerPosition(),this.updateInput(i||t),i=this.convertToRgbString(this.rgb);this.updatePreview(i),this.triggerEvent(t,e,i,!1,s)},T.prototype.triggerEvent=function(t,e,i,s,n){void 0===s&&(s=!1);var a=t.slice(0,7);C.isNullOrUndefined(n)&&(n=new MouseEvent("click",{bubbles:!0,cancelable:!1})),this.showButtons||s?this.trigger("select",{currentValue:{hex:a,rgba:i},event:n,previousValue:{hex:e.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(e))}}):(this.trigger("change",{currentValue:{hex:a,rgba:i},event:n,previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:t}),this.showRecentColors&&(this.recentColors.unshift(a),this.inline)&&this.renderRecentColor(),this.enableOpacity?this.setProperties({value:t},!0):this.setProperties({value:a},!0),this.element.value=a||"#000000")},T.prototype.destroy=function(){var e=this,t=this.getWrapper();Ls.prototype.destroy.call(this),["tabindex","spellcheck"].forEach(function(t){e.element.removeAttribute(t)}),this.inline?(this.unWireEvents(),this.destroyOtherComp()):(this.isPopupOpen()&&(this.unWireEvents(),this.destroyOtherComp()),this.splitBtn.destroy(),this.splitBtn=null),this.tileRipple(),this.tileRipple=null,this.ctrlBtnRipple(),this.ctrlBtnRipple=null,this.element.nextElementSibling&&C.detach(this.element.nextElementSibling),t&&(t.parentElement.insertBefore(this.element,t),C.detach(t)),this.container=null,this.formElement&&C.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},T.prototype.destroyOtherComp=function(){if(this.isPicker()){for(var t=C.closest(this.hueSlider.element,".e-color-picker").querySelectorAll(".e-numerictextbox"),e=0;e<t.length;e++)C.getInstance(t[e],Ht).destroy();this.hueSlider.destroy(),this.enableOpacity&&(this.opacitySlider.destroy(),this.opacitySlider=null),this.hueSlider=null;var i=this.getTooltipInst();i.close(),i.destroy(),this.tooltipEle=null}},T.prototype.isPopupOpen=function(){return this.getPopupEle().classList.contains("e-popup-open")},T.prototype.unWireEvents=function(){var t;this.isPicker()?(t=this.getDragHandler(),C.EventHandler.remove(t,"keydown",this.pickerKeyDown),(t=C.select("."+Hs,this.container))&&C.EventHandler.remove(t,"keydown",this.ctrlBtnKeyDown),C.EventHandler.remove(this.getHsvContainer(),"mousedown touchstart",this.handlerDown),(this.modeSwitcher||this.showButtons)&&C.EventHandler.remove(C.select("."+Bs,this.container),"click",this.btnClickHandler),C.EventHandler.remove(C.select("."+$s,this.container),"click",this.previewHandler)):(C.EventHandler.remove(this.container,"click",this.paletteClickHandler),C.EventHandler.remove(this.container,"keydown",this.paletteKeyDown))},T.prototype.roundValue=function(t){if(!t)return"";var e=(t="#"!==t[0]?"#"+t:t).length;if(4===e&&(t+="f",e=5),5===e){for(var i="",s=1,n=t.length;s<n;s++)i+=t.charAt(s)+t.charAt(s);t="#"+i,e=9}return 7===e&&(t+="ff"),t},T.prototype.hexToRgb=function(t){if(!t)return[];9!==(t=t.trim()).length&&(t=this.roundValue(t));var e=Number((parseInt(t.slice(-2),16)/255).toFixed(2)),t=(t=t.slice(1,7),parseInt(t,16)),i=[];return i.push(t>>16&255),i.push(t>>8&255),i.push(255&t),i.push(e),i},T.prototype.rgbToHsv=function(t,e,i,s){if(this.rgb&&!this.rgb.length)return[];t/=255,e/=255,i/=255;var n,a=Math.max(t,e,i),r=Math.min(t,e,i),l=a,o=a-r,h=0===a?0:o/a;if(a===r)n=0;else{switch(a){case t:n=(e-i)/o+(e<i?6:0);break;case e:n=(i-t)/o+2;break;case i:n=(t-e)/o+4}n/=6}r=[Math.round(360*n),Math.round(1e3*h)/10,Math.round(1e3*l)/10];return C.isNullOrUndefined(s)||r.push(s),r},T.prototype.hsvToRgb=function(t,e,i,s){var n,a,r;if(i/=100,0===(e/=100))return n=a=r=i,[Math.round(255*n),Math.round(255*a),Math.round(255*r),s];t/=60;var l=Math.floor(t),t=t-l,o=i*(1-e),h=i*(1-e*t),u=i*(1-e*(1-t));switch(l){case 0:n=i,a=u,r=o;break;case 1:n=h,a=i,r=o;break;case 2:n=o,a=i,r=u;break;case 3:n=o,a=h,r=i;break;case 4:n=u,a=o,r=i;break;default:n=i,a=o,r=h}e=[Math.round(255*n),Math.round(255*a),Math.round(255*r)];return C.isNullOrUndefined(s)||e.push(s),e},T.prototype.rgbToHex=function(t){return t.length?"#"+this.hex(t[0])+this.hex(t[1])+this.hex(t[2])+(C.isNullOrUndefined(t[3])?"":0!==t[3]?(Math.round(255*t[3])+65536).toString(16).substr(-2):"00"):""},T.prototype.hex=function(t){return("0"+t.toString(16)).slice(-2)},T.prototype.changeModeSwitcherProp=function(t){var e=C.select("."+Bs,this.container);t?e?this.appendModeSwitchBtn():(this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):e&&(this.showButtons?C.detach(C.select("."+_s,e)):C.remove(e))},T.prototype.changeShowBtnProps=function(t){var e=C.select("."+Bs,this.container);t?(e&&C.remove(e),this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):this.modeSwitcher?C.detach(C.select("."+Hs,e)):C.remove(e)},T.prototype.changeValueProp=function(t){this.isPicker()?(this.rgb=this.hexToRgb(t),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHandlerPosition(),C.detach(C.closest(this.hueSlider.element,".e-slider-preview")),this.createSlider(),this.setHsvContainerBg(),this.updateInput(t),4===this.rgb.length&&this.updateOpacityInput(100*this.rgb[3])):(this.removeTileSelection(),(t=this.container.querySelector('span[aria-label="'+this.roundValue(t)+'"]'))&&this.addTileSelection(t))},T.prototype.setInputEleProps=function(){C.remove(C.select("."+js,this.container)),this.createInput()},T.prototype.changeDisabledProp=function(t){this.isPicker()&&(this.hueSlider.enabled=!t,this.opacitySlider.enabled=!t,this.setInputEleProps()),t?(this.toggleDisabled(!0),this.unWireEvents()):(this.toggleDisabled(!1),this.wireEvents())},T.prototype.changeCssClassProps=function(t,e){var i=this.getWrapper(),s=this.getPopupEle();e&&C.removeClass([i,s],e.split(" ")),t&&C.addClass([i,s],t.replace(/\s+/g," ").trim().split(" "))},T.prototype.changeRtlProps=function(t){t?C.addClass([this.getWrapper()],"e-rtl"):C.removeClass([this.getWrapper()],"e-rtl")},T.prototype.changePaletteProps=function(){C.detach(this.container.children[0]),this.container.style.width="",this.createPalette()},T.prototype.changeOpacityProps=function(t){var e=this.getWrapper();t?(C.removeClass([this.container.parentElement],Fs),this.createOpacitySlider(C.select(".e-colorpicker-slider",this.container).appendChild(this.createElement("div",{className:"e-opacity-slider"}))),e.classList.contains(Ds)||e.classList.contains(Ms)||this.appendOpacityValue(C.select(".e-input-container",this.container))):(C.addClass([this.container.parentElement],Fs),this.opacitySlider.destroy(),C.remove(this.opacitySlider.element),this.opacitySlider=null,e.classList.contains(Ds)||e.classList.contains(Ms)||C.remove(C.select("."+Ks,this.container).parentElement))},T.prototype.onPropertyChanged=function(s,n){var t,e,a=this;if(C.isNullOrUndefined(s.value)||(9===(t=this.roundValue(s.value)).length?(this.element.value=this.roundValue(t).slice(0,7),(e=this.splitBtn&&C.select("."+en,this.splitBtn.element))&&(e.style.backgroundColor=this.convertToRgbString(this.hexToRgb(s.value)))):this.noColor&&"Palette"===this.mode&&""===this.value?(e=this.splitBtn&&C.select("."+en,this.splitBtn.element)).style.backgroundColor="":this.value=n.value),!this.inline&&C.isNullOrUndefined(s.inline))if(this.splitBtn.setProperties(I.getModel(s,["disabled","enableRtl"])),!this.isPopupOpen())return this.changeCssClassProps(s.cssClass,n.cssClass),void this.changeRtlProps(s.enableRtl);for(var r=this,i=0,l=Object.keys(s);i<l.length;i++)!function(t){switch(t){case"inline":s.inline?(r.getWrapper().appendChild(r.container),r.splitBtn.destroy(),C.detach(r.element.nextElementSibling),r.container.children.length||r.createWidget()):(r.destroyOtherComp(),r.unWireEvents(),r.container.innerHTML="",r.createSplitBtn());break;case"cssClass":r.changeCssClassProps(s.cssClass,n.cssClass);var e=(e=s.cssClass.split(" ").concat(n.cssClass.split(" "))).reduce(function(t,e){return t.indexOf(e)<0&&t.push(e),t},[]),i=0;e.forEach(function(t){0!==i||t!==Ds&&t!==zs&&t!==Qs&&t!==Vs&&t!==Ms||(C.select("."+js,a.container)&&C.remove(C.select("."+js,a.container)),a.createInput(),i++)});break;case"enableRtl":r.isPicker()&&(r.hueSlider.enableRtl=s.enableRtl,r.enableOpacity&&(r.opacitySlider.enableRtl=s.enableRtl),r.setInputEleProps()),r.changeRtlProps(s.enableRtl);break;case"disabled":r.changeDisabledProp(s.disabled);break;case"value":r.value!==n.value&&r.changeValueProp(s.value);break;case"showButtons":r.changeShowBtnProps(s.showButtons);break;case"mode":"Picker"===s.mode?r.switchToPicker():r.switchToPalette();break;case"modeSwitcher":r.changeModeSwitcherProp(s.modeSwitcher);break;case"columns":case"presetColors":r.isPicker()||r.changePaletteProps();break;case"noColor":s.noColor?"Palette"!==r.mode||r.modeSwitcher||r.setNoColor():r.changePaletteProps();break;case"enableOpacity":r.changeOpacityProps(s.enableOpacity);break;case"showRecentColors":s.showRecentColors||(e=r.container.querySelector(".e-clr-pal-rec-wpr"))&&C.detach(e),r.recentColors=[]}}(l[i])},T.prototype.focusIn=function(){this.element.parentElement.focus()},S([C.Property("#008000ff")],T.prototype,"value",void 0),S([C.Property("")],T.prototype,"cssClass",void 0),S([C.Property(!1)],T.prototype,"disabled",void 0),S([C.Property("Picker")],T.prototype,"mode",void 0),S([C.Property(!0)],T.prototype,"modeSwitcher",void 0),S([C.Property(null)],T.prototype,"presetColors",void 0),S([C.Property(!0)],T.prototype,"showButtons",void 0),S([C.Property(10)],T.prototype,"columns",void 0),S([C.Property(!1)],T.prototype,"inline",void 0),S([C.Property(!1)],T.prototype,"noColor",void 0),S([C.Property(!1)],T.prototype,"enablePersistence",void 0),S([C.Property(!0)],T.prototype,"enableOpacity",void 0),S([C.Property(!1)],T.prototype,"createPopupOnClick",void 0),S([C.Property(!1)],T.prototype,"showRecentColors",void 0),S([C.Event()],T.prototype,"select",void 0),S([C.Event()],T.prototype,"change",void 0),S([C.Event()],T.prototype,"beforeTileRender",void 0),S([C.Event()],T.prototype,"beforeOpen",void 0),S([C.Event()],T.prototype,"open",void 0),S([C.Event()],T.prototype,"beforeClose",void 0),S([C.Event()],T.prototype,"beforeModeSwitch",void 0),S([C.Event()],T.prototype,"onModeSwitch",void 0),S([C.Event()],T.prototype,"created",void 0),S([C.NotifyPropertyChanges],T));function T(t,e){t=Ls.call(this,t,e)||this;return t.recentColors=[],t}an=function(t,e){return(an=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var an,rn,S=function(t,e){function i(){this.constructor=t}an(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},P=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},S=(rn=C.Component,S(k,rn),k.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"floatLabelType":o.Input.removeFloating(this.textboxWrapper),o.Input.addFloating(this.respectiveElement,this.floatLabelType,this.placeholder);break;case"enabled":o.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container),this.bindClearEvent();break;case"width":o.Input.setWidth(t.width,this.textboxWrapper.container);break;case"value":var n=this.isProtectedOnChange;this.isProtectedOnChange=!0,o.Input.isBlank(this.value)||(this.value=this.value.toString()),this.isProtectedOnChange=n,o.Input.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.inputPreviousValue=this.respectiveElement.value,(this.isAngular||this.isVue)&&!0===this.preventChange?(this.previousValue=this.isAngular?this.value:this.previousValue,this.preventChange=!1):(C.isNullOrUndefined(this.isAngular)||!this.isAngular||this.isAngular&&!this.preventChange||this.isAngular&&C.isNullOrUndefined(this.preventChange))&&this.raiseChangeEvent();break;case"htmlAttributes":this.updateHTMLAttributesToElement(),this.updateHTMLAttributesToWrapper(),this.checkAttributes(!0),this.multiline&&!C.isNullOrUndefined(this.textarea)?o.Input.validateInputType(this.textboxWrapper.container,this.textarea):o.Input.validateInputType(this.textboxWrapper.container,this.element);break;case"readonly":o.Input.setReadonly(this.readonly,this.respectiveElement);break;case"type":"TEXTAREA"!==this.respectiveElement.tagName&&(this.respectiveElement.setAttribute("type",this.type),o.Input.validateInputType(this.textboxWrapper.container,this.element),this.raiseChangeEvent());break;case"showClearButton":o.Input.setClearButton(this.showClearButton,this.respectiveElement,this.textboxWrapper),this.bindClearEvent();break;case"enableRtl":o.Input.setEnableRtl(this.enableRtl,[this.textboxWrapper.container]);break;case"placeholder":o.Input.setPlaceholder(this.placeholder,this.respectiveElement),o.Input.calculateWidth(this.respectiveElement,this.textboxWrapper.container);break;case"autocomplete":"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:this.removeAttributes(["autocomplete"]);break;case"cssClass":o.Input.updateCssClass(t.cssClass,e.cssClass,this.textboxWrapper.container);break;case"locale":this.globalize=new C.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),o.Input.setPlaceholder(this.placeholder,this.respectiveElement)}},k.prototype.getModuleName=function(){return"textbox"},k.prototype.preRender=function(){if(this.cloneElement=this.element.cloneNode(!0),this.formElement=C.closest(this.element,"form"),C.isNullOrUndefined(this.formElement)||(this.isForm=!0),"EJS-TEXTBOX"===this.element.tagName){for(var t=C.getValue("ej2_instances",this.element),e=this.multiline?this.createElement("textarea"):this.createElement("input"),i=0;i<this.element.attributes.length;i++)"id"!==(n=this.element.attributes[i].nodeName)&&"class"!==n?(e.setAttribute(n,this.element.attributes[i].nodeValue),e.innerHTML=this.element.innerHTML,"name"===n&&this.element.removeAttribute("name")):"class"===n&&e.setAttribute(n,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "));this.element.appendChild(e),this.element=e,C.setValue("ej2_instances",t,this.element)}this.updateHTMLAttributesToElement(),this.checkAttributes(!1),!C.isNullOrUndefined(this.textboxOptions)&&void 0!==this.textboxOptions.value||""===this.element.value||this.setProperties({value:this.element.value},!0),"TEXTAREA"!==this.element.tagName&&this.element.setAttribute("type",this.type),("text"===this.type||"INPUT"===this.element.tagName&&this.multiline&&this.isReact)&&this.element.setAttribute("role","textbox"),this.globalize=new C.Internationalization(this.locale);t={placeholder:this.placeholder};if(this.l10n=new C.L10n("textbox",t,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",C.getUniqueID("textbox")),this.element.hasAttribute("name")||this.element.setAttribute("name",this.element.getAttribute("id")),"INPUT"===this.element.tagName&&this.multiline){this.isHiddenInput=!0,this.textarea=this.createElement("textarea"),this.element.parentNode.insertBefore(this.textarea,this.element),this.element.setAttribute("type","hidden"),this.textarea.setAttribute("name",this.element.getAttribute("name")),this.element.removeAttribute("name"),this.textarea.setAttribute("role",this.element.getAttribute("role")),this.element.removeAttribute("role"),this.textarea.setAttribute("id",C.getUniqueID("textarea"));for(var s=["placeholder","disabled","value","readonly","type","autocomplete"],i=0;i<this.element.attributes.length;i++){var n=this.element.attributes[i].nodeName;this.element.hasAttribute(n)&&F.indexOf(n)<0&&"id"!==n&&"type"!==n&&"e-mappinguid"!==n&&(this.textarea.setAttribute(n,this.element.attributes[i].nodeValue),s.indexOf(n)<0)&&(this.element.removeAttribute(n),i--)}}},k.prototype.checkAttributes=function(t){for(var e=0,i=t?C.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly","type","autocomplete"];e<i.length;e++){var s,n,a=i[e];if(!C.isNullOrUndefined(this.element.getAttribute(a)))switch(a){case"disabled":(C.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(a)&&""!==this.element.getAttribute(a)&&"true"!==this.element.getAttribute(a),this.setProperties({enabled:s},!t));break;case"readonly":(C.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.readonly||t)&&(s="readonly"===this.element.getAttribute(a)||""===this.element.getAttribute(a)||"true"===this.element.getAttribute(a),this.setProperties({readonly:s},!t));break;case"placeholder":(C.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"autocomplete":(C.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||t)&&(n="off"===this.element.autocomplete?"off":"on",this.setProperties({autocomplete:n},!t));break;case"value":(C.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.value||t)&&""!==this.element.value&&this.setProperties({value:this.element.value},!t);break;case"type":(C.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.type||t)&&this.setProperties({type:this.element.type},!t)}}},k.prototype.render=function(){var t=this.cssClass;C.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=o.Input.getInputValidClassList(this.cssClass)),this.respectiveElement=this.isHiddenInput?this.textarea:this.element,this.textboxWrapper=o.Input.createInput({element:this.respectiveElement,floatLabelType:this.floatLabelType,properties:{enabled:this.enabled,enableRtl:this.enableRtl,cssClass:t,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}}),this.updateHTMLAttributesToWrapper(),this.isHiddenInput&&this.respectiveElement.parentNode.insertBefore(this.element,this.respectiveElement),this.wireEvents(),C.isNullOrUndefined(this.value)||(o.Input.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value)),C.isNullOrUndefined(this.value)||(this.initialValue=this.value,this.setInitialValue()),"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:C.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||this.removeAttributes(["autocomplete"]),this.previousValue=this.value,this.inputPreviousValue=this.value,this.respectiveElement.defaultValue=this.respectiveElement.value,o.Input.setWidth(this.width,this.textboxWrapper.container),!C.isNullOrUndefined(C.closest(this.element,"fieldset"))&&C.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","textbox"),this.renderComplete()},k.prototype.updateHTMLAttributesToWrapper=function(){o.Input.updateHTMLAttributesToWrapper(this.htmlAttributes,this.textboxWrapper.container)},k.prototype.updateHTMLAttributesToElement=function(){o.Input.updateHTMLAttributesToElement(this.htmlAttributes,this.respectiveElement||(this.multiline&&!C.isNullOrUndefined(this.textarea)?this.textarea:this.element))},k.prototype.setInitialValue=function(){this.isAngular||this.respectiveElement.setAttribute("value",this.initialValue)},k.prototype.wireEvents=function(){C.EventHandler.add(this.respectiveElement,"focus",this.focusHandler,this),C.EventHandler.add(this.respectiveElement,"blur",this.focusOutHandler,this),C.EventHandler.add(this.respectiveElement,"keydown",this.keydownHandler,this),C.EventHandler.add(this.respectiveElement,"input",this.inputHandler,this),C.EventHandler.add(this.respectiveElement,"change",this.changeHandler,this),this.isForm&&C.EventHandler.add(this.formElement,"reset",this.resetForm,this),this.bindClearEvent(),!C.isNullOrUndefined(this.textboxWrapper.container.querySelector(".e-float-text"))&&"Auto"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-autofill")&&this.textboxWrapper.container.classList.contains("e-outline")&&C.EventHandler.add(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler,this)},k.prototype.animationHandler=function(){this.textboxWrapper.container.classList.add("e-valid-input");var t=this.textboxWrapper.container.querySelector(".e-float-text");C.isNullOrUndefined(t)||(t.classList.add("e-label-top"),t.classList.contains("e-label-bottom")&&t.classList.remove("e-label-bottom"))},k.prototype.resetValue=function(t){var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,null!=(this.value=t)||!this.textboxWrapper.container.classList.contains("e-valid-input")||"Always"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.remove("e-valid-input"),this.isProtectedOnChange=e},k.prototype.resetForm=function(){var t;this.isAngular?this.resetValue(""):this.resetValue(this.initialValue),C.isNullOrUndefined(this.textboxWrapper)||(t=this.textboxWrapper.container.querySelector(".e-float-text"),C.isNullOrUndefined(t))||"Always"===this.floatLabelType||(C.isNullOrUndefined(this.initialValue)||""===this.initialValue?(t.classList.add("e-label-bottom"),t.classList.remove("e-label-top")):""!==this.initialValue&&(t.classList.add("e-label-top"),t.classList.remove("e-label-bottom")))},k.prototype.focusHandler=function(t){t={container:this.textboxWrapper.container,event:t,value:this.value};this.trigger("focus",t)},k.prototype.focusOutHandler=function(t){null===this.previousValue&&null===this.value&&""===this.respectiveElement.value||this.previousValue===this.value||this.raiseChangeEvent(t,!0);t={container:this.textboxWrapper.container,event:t,value:this.value};this.trigger("blur",t)},k.prototype.keydownHandler=function(t){13!==t.keyCode&&9!==t.keyCode||!(null!==this.previousValue&&""!==this.previousValue||null!==this.value&&""!==this.value||""!==this.respectiveElement.value)||this.setProperties({value:this.respectiveElement.value},!0)},k.prototype.inputHandler=function(t){var e={event:t,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};this.inputPreviousValue=this.respectiveElement.value,this.isAngular&&(this.localChange({value:this.respectiveElement.value}),this.preventChange=!0),this.isVue&&(this.preventChange=!0),this.trigger("input",e),t.stopPropagation()},k.prototype.changeHandler=function(t){this.setProperties({value:this.respectiveElement.value},!0),this.previousValue!==this.value&&this.raiseChangeEvent(t,!0),t.stopPropagation()},k.prototype.raiseChangeEvent=function(t,e){t={event:t,value:this.value,previousValue:this.previousValue,container:this.textboxWrapper.container,isInteraction:e||!1,isInteracted:e||!1};this.preventChange=!1,this.trigger("change",t),this.previousValue=this.value,"INPUT"===this.element.tagName&&this.multiline&&"mozilla"===C.Browser.info.name&&(this.element.value=this.respectiveElement.value)},k.prototype.bindClearEvent=function(){this.showClearButton&&(this.enabled?C.EventHandler.add(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler,this):C.EventHandler.remove(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler))},k.prototype.resetInputHandler=function(t){var e;t.preventDefault(),this.textboxWrapper.clearButton.classList.contains("e-clear-icon-hide")&&!this.textboxWrapper.container.classList.contains("e-static-clear")||(o.Input.setValue("",this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.setProperties({value:this.respectiveElement.value},!0),e={event:t,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container},this.trigger("input",e),this.inputPreviousValue=this.respectiveElement.value,this.raiseChangeEvent(t,!0),C.closest(this.element,"form")&&(e=this.element,(t=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(t)))},k.prototype.unWireEvents=function(){C.EventHandler.remove(this.respectiveElement,"focus",this.focusHandler),C.EventHandler.remove(this.respectiveElement,"blur",this.focusOutHandler),C.EventHandler.remove(this.respectiveElement,"keydown",this.keydownHandler),C.EventHandler.remove(this.respectiveElement,"input",this.inputHandler),C.EventHandler.remove(this.respectiveElement,"change",this.changeHandler),this.isForm&&C.EventHandler.remove(this.formElement,"reset",this.resetForm),!C.isNullOrUndefined(this.textboxWrapper.container.querySelector(".e-float-text"))&&"Auto"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-outline")&&this.textboxWrapper.container.classList.contains("e-autofill")&&C.EventHandler.remove(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler)},k.prototype.destroy=function(){this.unWireEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),"INPUT"===this.element.tagName&&this.multiline&&(C.detach(this.textboxWrapper.container.getElementsByTagName("textarea")[0]),this.respectiveElement=this.element,this.element.removeAttribute("type")),this.respectiveElement.value=this.respectiveElement.defaultValue,this.respectiveElement.classList.remove("e-input"),this.removeAttributes(["aria-disabled","aria-readonly","aria-labelledby"]),C.isNullOrUndefined(this.textboxWrapper)||(this.textboxWrapper.container.insertAdjacentElement("afterend",this.respectiveElement),C.detach(this.textboxWrapper.container)),this.textboxWrapper=null,o.Input.destroy({element:this.respectiveElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),rn.prototype.destroy.call(this)},k.prototype.addIcon=function(t,e){o.Input.addIcon(t,e,this.textboxWrapper.container,this.respectiveElement,this.createElement)},k.prototype.getPersistData=function(){return this.addOnPersist(["value"])},k.prototype.addAttributes=function(t){for(var e=0,i=Object.keys(t);e<i.length;e++){var s=i[e];"disabled"===s?(this.setProperties({enabled:!1},!0),o.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===s?(this.setProperties({readonly:!0},!0),o.Input.setReadonly(this.readonly,this.respectiveElement)):"class"===s?this.respectiveElement.classList.add(t[""+s]):"placeholder"===s?(this.setProperties({placeholder:t[""+s]},!0),o.Input.setPlaceholder(this.placeholder,this.respectiveElement)):("rows"===s&&this.respectiveElement.tagName,this.respectiveElement.setAttribute(s,t[""+s]))}},k.prototype.removeAttributes=function(t){for(var e=0,i=t;e<i.length;e++){var s=i[e];"disabled"===s?(this.setProperties({enabled:!0},!0),o.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===s?(this.setProperties({readonly:!1},!0),o.Input.setReadonly(this.readonly,this.respectiveElement)):"placeholder"===s?(this.setProperties({placeholder:null},!0),o.Input.setPlaceholder(this.placeholder,this.respectiveElement)):this.respectiveElement.removeAttribute(s)}},k.prototype.focusIn=function(){document.activeElement!==this.respectiveElement&&this.enabled&&(this.respectiveElement.focus(),this.textboxWrapper.container.classList.contains("e-input-group")||this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.contains("e-filled"))&&C.addClass([this.textboxWrapper.container],[M])},k.prototype.focusOut=function(){document.activeElement===this.respectiveElement&&this.enabled&&(this.respectiveElement.blur(),this.textboxWrapper.container.classList.contains("e-input-group")||this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.contains("e-filled"))&&C.removeClass([this.textboxWrapper.container],[M])},P([C.Property("text")],k.prototype,"type",void 0),P([C.Property(!1)],k.prototype,"readonly",void 0),P([C.Property(null)],k.prototype,"value",void 0),P([C.Property("Never")],k.prototype,"floatLabelType",void 0),P([C.Property("")],k.prototype,"cssClass",void 0),P([C.Property(null)],k.prototype,"placeholder",void 0),P([C.Property("on")],k.prototype,"autocomplete",void 0),P([C.Property({})],k.prototype,"htmlAttributes",void 0),P([C.Property(!1)],k.prototype,"multiline",void 0),P([C.Property(!0)],k.prototype,"enabled",void 0),P([C.Property(!1)],k.prototype,"showClearButton",void 0),P([C.Property(!1)],k.prototype,"enablePersistence",void 0),P([C.Property(null)],k.prototype,"width",void 0),P([C.Event()],k.prototype,"created",void 0),P([C.Event()],k.prototype,"destroyed",void 0),P([C.Event()],k.prototype,"change",void 0),P([C.Event()],k.prototype,"blur",void 0),P([C.Event()],k.prototype,"focus",void 0),P([C.Event()],k.prototype,"input",void 0),P([C.NotifyPropertyChanges],k));function k(t,e){e=rn.call(this,t,e)||this;return e.previousValue=null,e.isHiddenInput=!1,e.isForm=!1,e.inputPreviousValue=null,e.textboxOptions=t,e}ln=function(t,e){return(ln=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var ln,on,P=function(t,e){function i(){this.constructor=t}ln(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},O=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},hn="e-auto-width",un="e-resize-x",pn="e-resize-y",dn="e-resize-xy",cn="e-resize-none",P=(on=C.Component,P(L,on),L.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"floatLabelType":o.Input.removeFloating(this.textareaWrapper),o.Input.addFloating(this.element,this.floatLabelType,this.placeholder),"Never"===this.floatLabelType&&this.element.removeAttribute("aria-labelledby");break;case"enabled":o.Input.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container),this.bindClearEvent(),this.enabled||"None"===this.resizeMode?this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)):(this.element.classList.remove(this.getCurrentResizeClass(this.resizeMode)),this.element.classList.add(cn));break;case"width":"None"!==this.resizeMode&&"Vertical"!==this.resizeMode?(this.setElementWidth(t.width),this.textareaWrapper.container.classList.add(hn)):(this.textareaWrapper.container.classList.contains(hn)&&this.textareaWrapper.container.classList.remove(hn),o.Input.setWidth(t.width,this.textareaWrapper.container));break;case"value":var n=this.isProtectedOnChange;this.isProtectedOnChange=!0,o.Input.isBlank(this.value)||(this.value=this.value.toString()),this.isProtectedOnChange=n,o.Input.setValue(this.value,this.element,this.floatLabelType,this.showClearButton),this.inputPreviousValue=this.element.value,(this.isAngular||this.isVue)&&!0===this.preventChange?(this.previousValue=this.isAngular?this.value:this.previousValue,this.preventChange=!1):(C.isNullOrUndefined(this.isAngular)||!this.isAngular||this.isAngular&&!this.preventChange||this.isAngular&&C.isNullOrUndefined(this.preventChange))&&this.raiseChangeEvent();break;case"htmlAttributes":this.updateHTMLAttributesToElement(),this.updateHTMLAttributesToWrapper(),this.checkAttributes(!0),o.Input.validateInputType(this.textareaWrapper.container,this.element);break;case"readonly":o.Input.setReadonly(this.readonly,this.element),this.readonly?this.element.setAttribute("aria-readonly","true"):this.element.removeAttribute("aria-readonly");break;case"showClearButton":o.Input.setClearButton(this.showClearButton,this.element,this.textareaWrapper),this.bindClearEvent();break;case"enableRtl":o.Input.setEnableRtl(this.enableRtl,[this.textareaWrapper.container]);break;case"placeholder":o.Input.setPlaceholder(this.placeholder,this.element),o.Input.calculateWidth(this.element,this.textareaWrapper.container);break;case"cssClass":o.Input.updateCssClass(t.cssClass,e.cssClass,this.textareaWrapper.container);break;case"locale":this.globalize=new C.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),o.Input.setPlaceholder(this.placeholder,this.element);break;case"rows":this.rows&&this.element.setAttribute("rows",this.rows.toString());break;case"cols":this.cols&&(this.element.setAttribute("cols",this.cols.toString()),null==this.width)&&this.textareaWrapper.container.classList.add(hn);break;case"maxLength":this.maxLength&&this.element.setAttribute("maxlength",this.maxLength.toString());break;case"resizeMode":this.enabled&&(this.element.classList.contains(this.getCurrentResizeClass(e.resizeMode))&&this.element.classList.remove(this.getCurrentResizeClass(e.resizeMode)),this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)),!this.element.style.width||"None"!==this.resizeMode&&"Vertical"!==this.resizeMode?(n=this.element.offsetWidth,this.element.style.width=n+"px",this.textareaWrapper.container.style.width&&(this.textareaWrapper.container.style.width="")):o.Input.setWidth(this.element.style.width,this.textareaWrapper.container),this.setWrapperWidth())}},L.prototype.preRender=function(){if(this.formElement=C.closest(this.element,"form"),C.isNullOrUndefined(this.formElement)||(this.isForm=!0),"EJS-TEXTAREA"===this.element.tagName||"EJS-SMARTTEXTAREA"===this.element.tagName){for(var t=C.getValue("ej2_instances",this.element),e=this.createElement("textarea"),i=0;i<this.element.attributes.length;i++){var s=this.element.attributes[i].nodeName;"id"!==s&&"class"!==s?(e.setAttribute(s,this.element.attributes[i].nodeValue),e.innerHTML=this.element.innerHTML,"name"===s&&this.element.removeAttribute("name")):"class"===s&&e.setAttribute(s,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "))}this.element.appendChild(e),this.element=e,C.setValue("ej2_instances",t,this.element)}this.updateHTMLAttributesToElement(),this.checkAttributes(!1),!C.isNullOrUndefined(this.textareaOptions)&&void 0!==this.textareaOptions.value||""===this.element.value||this.setProperties({value:this.element.value},!0),this.globalize=new C.Internationalization(this.locale);t={placeholder:this.placeholder};this.l10n=new C.L10n("textarea",t,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",C.getUniqueID("textbox")),this.element.hasAttribute("name")||this.element.setAttribute("name",this.element.getAttribute("id")),this.rows&&this.element.setAttribute("rows",this.rows.toString()),this.cols&&this.element.setAttribute("cols",this.cols.toString()),this.maxLength&&this.element.setAttribute("maxlength",this.maxLength.toString()),!this.element.style.resize&&this.enabled&&this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)),this.enabled&&this.element.setAttribute("aria-multiline","true")},L.prototype.render=function(){var t=this.cssClass;C.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=o.Input.getInputValidClassList(this.cssClass)),this.textareaWrapper=o.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{enabled:this.enabled,enableRtl:this.enableRtl,cssClass:t,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}}),this.updateHTMLAttributesToWrapper(),this.wireEvents(),C.isNullOrUndefined(this.value)||o.Input.setValue(this.value,this.element,this.floatLabelType,this.showClearButton),C.isNullOrUndefined(this.value)||(this.initialValue=this.value,this.isAngular)||this.element.setAttribute("value",this.initialValue),this.previousValue=this.value,this.inputPreviousValue=this.value,this.element.defaultValue=this.element.value,o.Input.setWidth(this.width,this.textareaWrapper.container),this.setWrapperWidth(),this.renderComplete()},L.prototype.getModuleName=function(){return"textarea"},L.prototype.getPersistData=function(){return this.addOnPersist(["value"])},L.prototype.checkAttributes=function(t){for(var e=0,i=t?C.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"];e<i.length;e++){var s,n=i[e];if(!C.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"disabled":(C.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n),this.setProperties({enabled:s},!t));break;case"readonly":(C.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.readonly||t)&&(s="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n),this.setProperties({readonly:s},!t));break;case"placeholder":(C.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"value":(C.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.value||t)&&""!==this.element.value&&this.setProperties({value:this.element.value},!t)}}},L.prototype.wireEvents=function(){C.EventHandler.add(this.element,"focus",this.focusHandler,this),C.EventHandler.add(this.element,"blur",this.focusOutHandler,this),C.EventHandler.add(this.element,"keydown",this.keydownHandler,this),C.EventHandler.add(this.element,"input",this.inputHandler,this),C.EventHandler.add(this.element,"change",this.changeHandler,this),this.isForm&&C.EventHandler.add(this.formElement,"reset",this.resetForm,this),this.bindClearEvent()},L.prototype.unWireEvents=function(){C.EventHandler.remove(this.element,"focus",this.focusHandler),C.EventHandler.remove(this.element,"blur",this.focusOutHandler),C.EventHandler.remove(this.element,"keydown",this.keydownHandler),C.EventHandler.remove(this.element,"input",this.inputHandler),C.EventHandler.remove(this.element,"change",this.changeHandler),this.isForm&&C.EventHandler.remove(this.formElement,"reset",this.resetForm)},L.prototype.destroy=function(){this.unWireEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.element.value=this.element.defaultValue,this.element.classList.remove("e-input",un,pn,dn,cn),this.removeAttributes(["aria-disabled","aria-readonly","aria-labelledby","aria-multiline"]),C.isNullOrUndefined(this.textareaWrapper)||(this.textareaWrapper.container.insertAdjacentElement("afterend",this.element),C.detach(this.textareaWrapper.container)),this.textareaWrapper=null,o.Input.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),this.formElement=null,on.prototype.destroy.call(this)},L.prototype.focusHandler=function(t){t={container:this.textareaWrapper.container,event:t,value:this.value};this.trigger("focus",t)},L.prototype.focusOutHandler=function(t){null===this.previousValue&&null===this.value||this.previousValue===this.value||this.raiseChangeEvent(t,!0);t={container:this.textareaWrapper.container,event:t,value:this.value};this.trigger("blur",t)},L.prototype.keydownHandler=function(t){13!==t.keyCode&&9!==t.keyCode||!(null!==this.previousValue&&""!==this.previousValue||null!==this.value&&""!==this.value||""!==this.element.value)||this.setProperties({value:this.element.value},!0)},L.prototype.inputHandler=function(t){var e={event:t,value:this.element.value,previousValue:this.inputPreviousValue,container:this.textareaWrapper.container};this.inputPreviousValue=this.element.value,this.isAngular&&(this.localChange({value:this.element.value}),this.preventChange=!0),this.isVue&&(this.preventChange=!0),this.trigger("input",e),t.stopPropagation()},L.prototype.changeHandler=function(t){this.setProperties({value:this.element.value},!0),this.previousValue!==this.value&&this.raiseChangeEvent(t,!0),t.stopPropagation()},L.prototype.raiseChangeEvent=function(t,e){t={event:t,value:this.value,previousValue:this.previousValue,container:this.textareaWrapper.container,isInteraction:e||!1,isInteracted:e||!1};this.preventChange=!1,this.trigger("change",t),this.previousValue=this.value},L.prototype.updateHTMLAttributesToWrapper=function(){o.Input.updateHTMLAttributesToWrapper(this.htmlAttributes,this.textareaWrapper.container)},L.prototype.updateHTMLAttributesToElement=function(){o.Input.updateHTMLAttributesToElement(this.htmlAttributes,this.element)},L.prototype.bindClearEvent=function(){this.showClearButton&&(this.enabled?C.EventHandler.add(this.textareaWrapper.clearButton,"mousedown touchstart",this.resetInputHandler,this):C.EventHandler.remove(this.textareaWrapper.clearButton,"mousedown touchstart",this.resetInputHandler))},L.prototype.resetInputHandler=function(t){t.preventDefault(),this.textareaWrapper.clearButton.classList.contains("e-clear-icon-hide")&&!this.textareaWrapper.container.classList.contains("e-static-clear")||(o.Input.setValue("",this.element,this.floatLabelType,this.showClearButton),this.setProperties({value:this.element.value},!0));var e={event:t,value:this.element.value,previousValue:this.inputPreviousValue,container:this.textareaWrapper.container};this.trigger("input",e),this.inputPreviousValue=this.element.value,this.raiseChangeEvent(t,!0),C.closest(this.element,"form")&&(e=this.element,(t=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(t))},L.prototype.addAttributes=function(t){for(var e=0,i=Object.keys(t);e<i.length;e++){var s=i[e];"disabled"===s?(this.setProperties({enabled:!1},!0),o.Input.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container)):"readonly"===s?(this.setProperties({readonly:!0},!0),o.Input.setReadonly(this.readonly,this.element)):"class"===s?this.element.classList.add(t[""+s]):"placeholder"===s?(this.setProperties({placeholder:t[""+s]},!0),o.Input.setPlaceholder(this.placeholder,this.element)):this.element.setAttribute(s,t[""+s])}},L.prototype.removeAttributes=function(t){for(var e=0,i=t;e<i.length;e++){var s=i[e];"disabled"===s?(this.setProperties({enabled:!0},!0),o.Input.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container)):"readonly"===s?(this.setProperties({readonly:!1},!0),o.Input.setReadonly(this.readonly,this.element)):"placeholder"===s?(this.setProperties({placeholder:null},!0),o.Input.setPlaceholder(this.placeholder,this.element)):this.element.removeAttribute(s)}},L.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),this.textareaWrapper.container.classList.contains("e-input-group")||this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.contains("e-filled"))&&C.addClass([this.textareaWrapper.container],[M])},L.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),this.textareaWrapper.container.classList.contains("e-input-group")||this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.contains("e-filled"))&&C.removeClass([this.textareaWrapper.container],[M])},L.prototype.setWrapperWidth=function(){this.enabled&&("None"!==this.resizeMode&&"Vertical"!==this.resizeMode||this.cols||this.element.getAttribute("cols"))?("None"!==this.resizeMode&&"Vertical"!==this.resizeMode&&this.textareaWrapper.container.style.width&&(this.setElementWidth(this.textareaWrapper.container.style.width),this.textareaWrapper.container.style.width="",this.textareaWrapper.container.classList.add(hn)),this.textareaWrapper.container.classList.add(hn)):this.textareaWrapper.container.classList.contains(hn)&&this.textareaWrapper.container.classList.remove(hn)},L.prototype.resetForm=function(){var t;this.isAngular?this.resetValue(""):this.resetValue(this.initialValue),C.isNullOrUndefined(this.textareaWrapper)||(t=this.textareaWrapper.container.querySelector(".e-float-text"),C.isNullOrUndefined(t))||"Always"===this.floatLabelType||(C.isNullOrUndefined(this.initialValue)||""===this.initialValue?(t.classList.add("e-label-bottom"),t.classList.remove("e-label-top")):""!==this.initialValue&&(t.classList.add("e-label-top"),t.classList.remove("e-label-bottom")))},L.prototype.resetValue=function(t){var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,null!=(this.value=t)||!this.textareaWrapper.container.classList.contains("e-valid-input")||"Always"===this.floatLabelType&&this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.remove("e-valid-input"),this.isProtectedOnChange=e},L.prototype.setElementWidth=function(t){"number"==typeof t?this.element.style.width=C.formatUnit(t):"string"==typeof t&&(this.element.style.width=t.match(/px|%|em/)?t:C.formatUnit(t))},O([C.Property(!(L.prototype.getCurrentResizeClass=function(t){return"None"===t?cn:"Both"===t?dn:"Horizontal"===t?un:pn}))],L.prototype,"readonly",void 0),O([C.Property(null)],L.prototype,"value",void 0),O([C.Property("Never")],L.prototype,"floatLabelType",void 0),O([C.Property("")],L.prototype,"cssClass",void 0),O([C.Property(null)],L.prototype,"placeholder",void 0),O([C.Property({})],L.prototype,"htmlAttributes",void 0),O([C.Property(!0)],L.prototype,"enabled",void 0),O([C.Property(!1)],L.prototype,"showClearButton",void 0),O([C.Property(!1)],L.prototype,"enablePersistence",void 0),O([C.Property(null)],L.prototype,"width",void 0),O([C.Property("Both")],L.prototype,"resizeMode",void 0),O([C.Property(null)],L.prototype,"maxLength",void 0),O([C.Property(null)],L.prototype,"cols",void 0),O([C.Property(null)],L.prototype,"rows",void 0),O([C.Event()],L.prototype,"created",void 0),O([C.Event()],L.prototype,"destroyed",void 0),O([C.Event()],L.prototype,"change",void 0),O([C.Event()],L.prototype,"blur",void 0),O([C.Event()],L.prototype,"focus",void 0),O([C.Event()],L.prototype,"input",void 0),O([C.NotifyPropertyChanges],L));function L(t,e){e=on.call(this,t,e)||this;return e.previousValue=null,e.isForm=!1,e.inputPreviousValue=null,e.textareaOptions=t,e}vn.createStyledDiv=function(e,t){var i=document.createElement("div"),s={position:"absolute",left:-9999,top:0,zIndex:-2e3},n=(this.properties.forEach(function(t){s[""+t]=getComputedStyle(e)[t]}),Object.keys(s).forEach(function(t){i.style[""+t]=s[""+t]}),e.offsetWidth-e.clientWidth);return i.style.width=e.clientWidth+n+"px",i.innerHTML=t,e&&e.parentNode&&e.parentNode.insertBefore(i,e.nextSibling),i},vn.createCaretMarker=function(t,e){t=this.createStyledDiv(t,e),e=t.ownerDocument.getElementById("caret-position-marker"),e={left:e.offsetLeft,top:e.offsetTop,height:e.offsetHeight};return t&&t.parentNode&&t.parentNode.removeChild(t),e},vn.escapeHtml=function(t){return t.replace(/<|>|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"<br/>")},vn.getCaretPosition=function(t){var e=t.selectionStart||0,i=t.value.slice(0,e),s=t.value.slice(e),i='<span style="position: relative; display: inline;">'+this.escapeHtml(i)+"</span>",s=(i=(i+='<span id="caret-position-marker" style="position: relative; display: inline;">|</span>')+('<span style="position: relative; display: inline;">'+this.escapeHtml(s)+"</span>"),this.createCaretMarker(t,i));return s.pos=e,s},vn.adjustScrollToCaretPosition=function(t){var e=this.getCaretPosition(t),i=parseFloat(window.getComputedStyle(t).lineHeight);e.top>t.clientHeight+t.scrollTop-i&&(t.scrollTop=e.top-t.clientHeight+i)},vn.getTextAreaPosition=function(t){var e=window.getComputedStyle(t),i=this.getCaretPosition(t);return{top:i.top+parseFloat(e.borderTopWidth)+t.offsetTop-t.scrollTop,left:i.left+parseFloat(e.borderLeftWidth)+t.offsetLeft-t.scrollLeft-.25,height:i.height,elemStyle:e}},vn.insertCharacter=function(t,e){var i=t.selectionStart,s=t.selectionEnd;t.value=t.value.substring(0,i)+e+t.value.substring(s),i+=e.length,t.setSelectionRange(i,i)},vn.properties=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","boxSizing","fontFamily","fontSize","fontWeight","height","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","outlineWidth","overflow","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","textAlign","textOverflow","textTransform","whiteSpace","wordBreak","wordWrap","width"];var mn=vn;function vn(){}fn=function(t,e){return(fn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var fn,gn,O=function(t,e){function i(){this.constructor=t}fn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},yn=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},bn=function(a,r,l,o){return new(l=l||Promise)(function(t,e){function i(t){try{n(o.next(t))}catch(t){e(t)}}function s(t){try{n(o.throw(t))}catch(t){e(t)}}function n(e){e.done?t(e.value):new l(function(t){t(e.value)}).then(i,s)}n((o=o.apply(a,r||[])).next())})},Cn=function(s,n){var a,r,l,o={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(i){return function(t){var e=[i,t];if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,r&&(l=2&e[0]?r.return:e[0]?r.throw||((l=r.return)&&l.call(r),0):r.next)&&!(l=l.call(r,e[1])).done)return l;switch(r=0,(e=l?[2&e[0],l.value]:e)[0]){case 0:case 1:l=e;break;case 4:return o.label++,{value:e[1],done:!1};case 5:o.label++,r=e[1],e=[0];continue;case 7:e=o.ops.pop(),o.trys.pop();continue;default:if(!(l=0<(l=o.trys).length&&l[l.length-1])&&(6===e[0]||2===e[0])){o=0;continue}if(3===e[0]&&(!l||e[1]>l[0]&&e[1]<l[3]))o.label=e[1];else if(6===e[0]&&o.label<l[1])o.label=l[1],l=e;else{if(!(l&&o.label<l[2])){l[2]&&o.ops.pop(),o.trys.pop();continue}o.label=l[2],o.ops.push(e)}}e=n.call(s,o)}catch(t){e=[6,t],r=0}finally{a=l=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}},En=((En=o.ChatMessageRole||(o.ChatMessageRole={})).System="system",En.User="user",En.Assistant="assistant",O(w,gn=P),w.prototype.render=function(){var t,e;gn.prototype.render.call(this),this.element instanceof HTMLTextAreaElement&&(this.textArea=this.element,(t=C.createElement("smart-textarea")).classList.add("e-smart-textarea"),this.textArea.after(t),"None"!==this.showSuggestionOnPopup&&(e="Enable"===this.showSuggestionOnPopup?"false":"true",this.textArea.setAttribute("data-inline-suggestions",e)),this.suggestionDisplay=new(this.shouldShowInlineSuggestions(this.textArea)?xn:Tn)(t,this.textArea))},w.prototype.wireEvents=function(){var t=this;gn.prototype.wireEvents.call(this),C.EventHandler.add(this.element,"keyup",this.handleKeyUp,this),C.EventHandler.add(this.element,"keydown",this.handleKeyDown,this),C.EventHandler.add(this.element,"mousedown",this.removeExistingOrPendingSuggestion,this),C.EventHandler.add(this.element,"focusout",this.removeExistingOrPendingSuggestion,this),this.element.addEventListener("scroll",function(){return t.suggestionDisplay.reject()},{passive:!0})},w.prototype.unWireEvents=function(){var t=this;gn.prototype.unWireEvents.call(this),C.EventHandler.remove(this.element,"keyup",this.handleKeyUp),C.EventHandler.remove(this.element,"keydown",this.handleKeyDown),C.EventHandler.remove(this.element,"mousedown",this.removeExistingOrPendingSuggestion),C.EventHandler.remove(this.element,"focusout",this.removeExistingOrPendingSuggestion),this.element.removeEventListener("scroll",function(){return t.suggestionDisplay.reject()})},w.prototype.keydownHandler=function(){},w.prototype.shouldShowInlineSuggestions=function(t){t=t.getAttribute("data-inline-suggestions");return t?"true"===t.toLowerCase():!("ontouchstart"in window)},w.prototype.handleKeyDown=function(t){switch(t.key){case"Tab":this.suggestionDisplay.isShowing()&&(this.suggestionDisplay.accept(),t.preventDefault());break;case"Alt":case"Control":case"Shift":case"Command":break;default:this.suggestionDisplay.isShowing()&&this.suggestionDisplay.currentSuggestion.startsWith(t.key)?(mn.insertCharacter(this.textArea,t.key),t.preventDefault(),this.suggestionDisplay.show(this.suggestionDisplay.currentSuggestion.substring(t.key.length)),mn.adjustScrollToCaretPosition(this.textArea)):this.removeExistingOrPendingSuggestion()}},w.prototype.handleKeyUp=function(){var t=this;this.suggestionDisplay.isShowing()||(clearTimeout(this.typingDebounceTimeout),this.typingDebounceTimeout=setTimeout(function(){return t.handleTypingPaused()},350))},w.prototype.handleTypingPaused=function(){return bn(this,void 0,void 0,function(){return Cn(this,function(t){switch(t.label){case 0:return document.activeElement!==this.textArea?[2]:this.textArea.selectionStart!==this.textArea.selectionEnd||this.textArea.selectionStart!==this.textArea.value.length&&"\n"!==this.textArea.value[this.textArea.selectionStart]?[3,2]:[4,this.requestSuggestionAsync()];case 1:t.sent(),t.label=2;case 2:return[2]}})})},w.prototype.removeExistingOrPendingSuggestion=function(){clearTimeout(this.typingDebounceTimeout),this.pendingSuggestionAbort&&(this.pendingSuggestionAbort.abort(),this.pendingSuggestionAbort=null),this.suggestionDisplay.reject()},w.prototype.createSuggestionPrompt=function(t,e){var i="Predict what text the user in the given ROLE would insert at the cursor position indicated by ^^^.\nOnly give predictions for which you have an EXTREMELY high confidence that the user would insert that EXACT text.\nDo not make up new information. If you are not sure, just reply with NO_PREDICTION.\n\nRULES:\n1. Reply with OK:, then in square brackets the predicted text, then END_INSERTION, and no other output.\n2. When a specific value or quantity cannot be inferred and would need to be provided, use the word NEED_INFO.\n3. If there is not enough information to predict any words that the user would type next, just reply with the word NO_PREDICTION.\n4. NEVER invent new information. If you can not be sure what the user is about to type, ALWAYS stop the prediction with END_INSERTION.",s=this.UserPhrases;if(s&&0<s.length){i+="\nAlways try to use variations on the following phrases as part of the predictions:\n";for(var n=0,a=s;n<a.length;n++)i+="- "+a[n]+"\n"}return{messages:[{role:o.ChatMessageRole.System,content:i},{role:o.ChatMessageRole.User,content:"ROLE: Family member sending a text\nUSER_TEXT: Hey, it is a nice day - the weather is ^^^"},{role:o.ChatMessageRole.Assistant,content:"OK:[great!]END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: Customer service assistant\nUSER_TEXT: You can find more information on^^^\n\nAlternatively, phone us."},{role:o.ChatMessageRole.Assistant,content:"OK:[ our website at NEED_INFO]END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: Casual\nUSER_TEXT: Oh I see!\n\nWell sure thing, we can"},{role:o.ChatMessageRole.Assistant,content:"OK:[ help you out with that!]END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: Storyteller\nUSER_TEXT: Sir Digby Chicken Caesar, also know^^^"},{role:o.ChatMessageRole.Assistant,content:"OK:[n as NEED_INFO]END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: Customer support agent\nUSER_TEXT: Goodbye for now.^^^"},{role:o.ChatMessageRole.Assistant,content:"NO_PREDICTION END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: Pirate\nUSER_TEXT: Have you found^^^"},{role:o.ChatMessageRole.Assistant,content:"OK:[ the treasure, me hearties?]END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: "+this.userRole+"\nUSER_TEXT: "+t+"^^^"+e}],temperature:0,maxTokens:400,stopSequences:["END_INSERTION","NEED_INFO"],frequencyPenalty:0,presencePenalty:0}},w.prototype.requestSuggestionAsync=function(){return bn(this,void 0,void 0,function(){var e,i,s,n;return Cn(this,function(t){switch(t.label){case 0:return this.pendingSuggestionAbort?(this.pendingSuggestionAbort.abort(),[2]):(this.pendingSuggestionAbort=new AbortController,e={textAreaValue:this.textArea.value,cursorPosition:this.textArea.selectionStart},i={textBefore:e.textAreaValue.substring(0,e.cursorPosition),textAfter:e.textAreaValue.substring(e.cursorPosition)},n=this.createSuggestionPrompt(i.textBefore,i.textAfter),"function"!=typeof this.aiSuggestionHandler?[3,2]:[4,this.aiSuggestionHandler(n)]);case 1:n=t.sent(),s=this.validateSuggestion(n,i.textBefore),t.label=2;case 2:return s&&e.textAreaValue===this.textArea.value&&e.cursorPosition===this.textArea.selectionStart&&(s.endsWith(" ")||(s+=" "),this.suggestionDisplay.show(s)),[2]}})})},w.prototype.validateSuggestion=function(t,e){var i;return"string"!=typeof t||t.length<=5||0!==t.indexOf("OK:[")?"":(i=(t=0<(i=this.indexOfAny(t,[".","?","!"]))&&t.length>i+1&&" "===t[i+1]?t.substring(0,i+1):t).substring(4).replace(/[\]\s]+$/,""),0<e.length&&" "===e[e.length-1]?i.replace(/^\s+/,""):i)},w.prototype.indexOfAny=function(t,e){for(var i=0;i<t.length;i++)if(-1!==e.indexOf(t[""+i]))return i;return-1},w.prototype.getModuleName=function(){return"smarttextarea"},w.prototype.destroy=function(){gn.prototype.destroy.call(this),this.textArea=null,this.suggestionDisplay=null,this.typingDebounceTimeout=null},yn([C.Property("")],w.prototype,"userRole",void 0),yn([C.Property([])],w.prototype,"UserPhrases",void 0),yn([C.Property()],w.prototype,"aiSuggestionHandler",void 0),yn([C.Property("None")],w.prototype,"showSuggestionOnPopup",void 0),w);function w(t,e){return gn.call(this,t,e)||this}Object.defineProperty(Sn.prototype,"value",{get:function(){var t=this.originalValueProperty.get.call(this.textArea);return this.isShowing()?t.substring(0,this.suggestionStartPos)+t.substring(this.suggestionEndPos):t},set:function(t){this.originalValueProperty.set.call(this.textArea,t)},enumerable:!0,configurable:!0}),Sn.prototype.getOriginalValueProperty=function(t,e){for(;t;){var i=Object.getOwnPropertyDescriptor(t,e);if(i)return i;t=Object.getPrototypeOf(t)}throw new Error("Property "+e+" not found on object or its prototype chain")},Object.defineProperty(Sn.prototype,"valueIncludingSuggestion",{get:function(){return this.originalValueProperty.get.call(this.textArea)},set:function(t){this.originalValueProperty.set.call(this.textArea,t)},enumerable:!0,configurable:!0}),Sn.prototype.isShowing=function(){return null!==this.suggestionStartPos},Sn.prototype.show=function(t){this.latestSuggestionText=t,this.suggestionStartPos=this.textArea.selectionStart,this.suggestionEndPos=this.suggestionStartPos+t.length,this.textArea.setAttribute("data-suggestion-visible",""),this.valueIncludingSuggestion=this.valueIncludingSuggestion.substring(0,this.suggestionStartPos)+t+this.valueIncludingSuggestion.substring(this.suggestionStartPos),this.textArea.setSelectionRange(this.suggestionStartPos,this.suggestionEndPos),this.virtualCaret||(this.virtualCaret=new kn(this.owner,this.textArea)),this.virtualCaret.show()},Object.defineProperty(Sn.prototype,"currentSuggestion",{get:function(){return this.latestSuggestionText},enumerable:!0,configurable:!0}),Sn.prototype.accept=function(){this.textArea.setSelectionRange(this.suggestionEndPos,this.suggestionEndPos),this.suggestionStartPos=null,this.suggestionEndPos=null,this.virtualCaret&&this.virtualCaret.hide(),this.textArea.removeAttribute("data-suggestion-visible"),mn.adjustScrollToCaretPosition(this.textArea)},Sn.prototype.reject=function(){var t,e;this.isShowing()&&(t=this.textArea.selectionStart,e=this.textArea.selectionEnd,this.valueIncludingSuggestion=this.valueIncludingSuggestion.substring(0,this.suggestionStartPos)+this.valueIncludingSuggestion.substring(this.suggestionEndPos),this.suggestionStartPos===t&&this.suggestionEndPos===e&&this.textArea.setSelectionRange(t,t),this.suggestionStartPos=null,this.suggestionEndPos=null,this.textArea.removeAttribute("data-suggestion-visible"),this.virtualCaret)&&this.virtualCaret.hide()};var xn=Sn;function Sn(t,e){this.owner=t,this.textArea=e,this.latestSuggestionText="",this.suggestionStartPos=null,this.suggestionEndPos=null,this.virtualCaret=null,this.originalValueProperty=this.getOriginalValueProperty(e,"value")}Object.defineProperty(Pn.prototype,"currentSuggestion",{get:function(){return this.latestSuggestionText},enumerable:!0,configurable:!0}),Pn.prototype.show=function(t){this.latestSuggestionText=t,this.suggestionPrefixElement.textContent=" "!==t[0]?this.getPrefixText(this.textArea,20):"",this.suggestionTextElement.textContent=t;var t=mn.getTextAreaPosition(this.textArea),e=this.suggestionElement.style,t=(e.minWidth=null,this.suggestionElement.classList.add("smart-textarea-suggestion-overlay-visible"),e.zIndex=this.textArea.style.zIndex+1,e.top=t.top+"px",t.left-this.suggestionPrefixElement.offsetWidth),t=((!e.left||10<Math.abs(parseFloat(e.left)-t))&&(e.left=t+"px"),this.showing=!0,window.getComputedStyle(this.suggestionElement)),i=parseFloat(t.lineHeight),s=parseFloat(t.paddingTop),t=parseFloat(t.paddingBottom),s=Math.round((this.suggestionElement.offsetHeight-s-t)/i),i=(2<s&&(t=this.suggestionElement.offsetWidth,e.minWidth="calc(min(70vw, "+s*t/2+"px))"),this.suggestionElement.getBoundingClientRect());i.right>document.body.clientWidth-20&&(e.left="calc("+(parseFloat(e.left)-(i.right-document.body.clientWidth))+"px - 2rem)")},Pn.prototype.accept=function(){this.showing&&(mn.insertCharacter(this.textArea,this.currentSuggestion),mn.adjustScrollToCaretPosition(this.textArea),this.hide())},Pn.prototype.reject=function(){this.hide()},Pn.prototype.hide=function(){this.showing&&(this.showing=!1,this.suggestionElement.classList.remove("smart-textarea-suggestion-overlay-visible"))},Pn.prototype.isShowing=function(){return this.showing},Pn.prototype.handleSuggestionClicked=function(t){t.preventDefault(),t.stopImmediatePropagation(),this.accept()},Pn.prototype.getPrefixText=function(t,e){for(var i=t.value,s=t.selectionStart,n=s-1;s-e<n;n--)if(n<0||/\s/.test(i[""+n]))return i.substring(n+1,s);return""};var Tn=Pn;function Pn(t,e){var i=this,e=(this.latestSuggestionText="",this.showing=!1,this.textArea=e,this.suggestionElement=document.createElement("div"),this.suggestionElement.classList.add("smart-textarea-suggestion-overlay"),this.suggestionElement.addEventListener("mousedown",function(t){return i.handleSuggestionClicked(t)}),this.suggestionElement.addEventListener("touchend",function(t){return i.handleSuggestionClicked(t)}),this.suggestionPrefixElement=document.createElement("span"),this.suggestionTextElement=document.createElement("span"),this.suggestionElement.appendChild(this.suggestionPrefixElement),this.suggestionElement.appendChild(this.suggestionTextElement),this.suggestionPrefixElement.style.opacity="0.3",window.getComputedStyle(this.textArea));this.suggestionElement.style.font=e.font,this.suggestionElement.style.marginTop=1.4*parseFloat(e.fontSize)+"px",t.appendChild(this.suggestionElement)}On.prototype.show=function(){var t=mn.getTextAreaPosition(this.textArea),e=this.caretDiv.style;e.display="block",e.top=t.top+"px",e.left=t.left+"px",e.height=t.height+"px",e.zIndex=this.textArea.style.zIndex,e.backgroundColor=t.elemStyle.caretColor},On.prototype.hide=function(){this.caretDiv.style.display="none"};var kn=On;function On(t,e){this.textArea=e,this.caretDiv=document.createElement("div"),this.caretDiv.classList.add("smart-textarea-caret"),t.appendChild(this.caretDiv)}Ln=function(t,e){return(Ln=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Ln,wn,O=function(t,e){function i(){this.constructor=t}Ln(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},yn=(wn=C.Component,O(A,wn),A.prototype.initialize=function(t,e){this.clearArray=[],this.element=t,this.canvasContext=this.element.getContext("2d"),this.canvasContext.canvas.tabIndex=-1,e&&(this.dotnetRef=e,this.isBlazor=!0,this.signatureValue)&&this.loadPersistedSignature(),this.setHTMLProperties(),C.isNullOrUndefined(this.signatureValue)&&this.updateSnapCollection(!0),this.wireEvents(),this.isBlazor||this.trigger("created",null)},A.prototype.wireEvents=function(){!C.isNullOrUndefined(this.pointColl)||this.isReadOnly||this.disabled?this.pointColl&&(C.EventHandler.add(this.canvasContext.canvas,"mousemove touchmove",this.mouseMoveHandler,this),C.EventHandler.add(this.canvasContext.canvas,"mouseup touchend",this.mouseUpHandler,this),C.EventHandler.add(document,"mouseup",this.mouseUpHandler,this)):(C.EventHandler.add(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler,this),C.EventHandler.add(this.canvasContext.canvas,"keydown",this.keyboardHandler,this),window.addEventListener("resize",this.resizeHandler.bind(this)))},A.prototype.unwireEvents=function(t){"mouseup"===t||"touchend"===t?(C.EventHandler.remove(this.canvasContext.canvas,"mousemove touchmove",this.mouseMoveHandler),C.EventHandler.remove(this.canvasContext.canvas,"mouseup touchend",this.mouseUpHandler),C.EventHandler.remove(document,"mouseup",this.mouseUpHandler)):(C.EventHandler.remove(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler),C.EventHandler.remove(this.canvasContext.canvas,"keydown",this.keyboardHandler),window.removeEventListener("resize",this.resizeHandler))},A.prototype.setHTMLProperties=function(){150===this.element.height&&300===this.element.width&&0!==this.element.offsetHeight&&0!==this.element.offsetWidth?(this.element.height=this.element.offsetHeight,this.element.width=this.element.offsetWidth,this.isResponsive=!0):this.element.height===this.element.offsetHeight-1&&this.element.width===this.element.offsetWidth-1||0===this.element.offsetHeight||0===this.element.offsetWidth||(this.element.height=this.element.offsetHeight,this.element.width=this.element.offsetWidth),this.canvasContext.fillStyle=this.strokeColor,this.tempCanvas=this.createElement("canvas",{className:"e-"+this.getModuleName()+"-temp"}),this.tempContext=this.tempCanvas.getContext("2d"),this.tempCanvas.width=this.element.width,this.tempCanvas.height=this.element.height,this.backgroundImage?(this.canvasContext.canvas.style.backgroundImage="url("+this.backgroundImage+")",this.canvasContext.canvas.style.backgroundRepeat="no-repeat",this.saveWithBackground&&this.setBackgroundImage(this.backgroundImage,"temp")):this.backgroundColor&&(this.canvasContext.canvas.style.backgroundColor=this.backgroundColor)},A.prototype.mouseDownHandler=function(t){1!==t.buttons&&2!==t.buttons&&"touchstart"!==t.type||("touchstart"===t.type&&(t.preventDefault(),t.stopPropagation()),this.beginStroke(t),this.wireEvents())},A.prototype.mouseMoveHandler=function(t){1!==t.buttons&&2!==t.buttons&&"touchmove"!==t.type||("touchmove"===t.type&&(t.preventDefault(),t.stopPropagation()),this.interval?this.updateStrokeWithThrottle(t):this.updateStroke(t))},A.prototype.mouseUpHandler=function(t){"touchstart"===t.type&&(t.preventDefault(),t.stopPropagation()),this.endDraw(),this.updateSnapCollection(),this.unwireEvents(t.type),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","mouseUp"):this.trigger("change",{actionName:"strokeUpdate"}),this.signatureValue=this.snapColl[this.incStep];for(var e=0;e<this.signPointsColl.length;e++)this.signRatioPointsColl.push({x:this.signPointsColl[e].x/this.canvasContext.canvas.width,y:this.signPointsColl[e].y/this.canvasContext.canvas.height});this.signPointsColl=[]},A.prototype.keyboardHandler=function(t){var e=this,i={fileName:"Signature",type:"Png",cancel:!1};switch(t.key){case"Delete":this.clear();break;case t.ctrlKey&&"s":this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","beforeSave"):this.trigger("beforeSave",i,function(t){i.cancel||e.save(t.type,t.fileName)}),t.preventDefault(),t.stopImmediatePropagation();break;case t.ctrlKey&&"z":this.undo();break;case t.ctrlKey&&"y":this.redo()}},A.prototype.resizeHandler=function(){var t=this;if(this.isResponsive&&this.canRedraw){this.canvasContext.canvas.width=this.element.offsetWidth,this.canvasContext.canvas.height=this.element.offsetHeight,this.canvasContext.scale(1,1);for(var e=(this.minStrokeWidth+this.maxStrokeWidth)/2,i=0;i<this.signRatioPointsColl.length;i++)this.arcDraw(this.signRatioPointsColl[i].x*this.canvasContext.canvas.width,this.signRatioPointsColl[i].y*this.canvasContext.canvas.height,e);this.signPointsColl=[],this.canvasContext.closePath(),this.canvasContext.fill()}else{var s=new Image;s.src=this.snapColl[this.incStep],s.onload=function(){t.canvasContext.clearRect(0,0,t.element.width,t.element.height),t.canvasContext.drawImage(s,0,0,t.element.width,t.element.height)}}},A.prototype.beginStroke=function(t){this.internalRefresh(),this.updateStroke(t)},A.prototype.updateStroke=function(t){t=this.createPoint(t);this.addPoint(t)},A.prototype.updateStrokeWithThrottle=function(t){var e=Date.now(),i=this.interval-(e-this.previous);this.storedArgs=t,i<=0||i>this.interval?(this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.previous=e,this.updateStroke(this.storedArgs),this.timeout||(this.storedArgs=null)):this.timeout||(this.timeout=window.setTimeout(this.delay.bind(this),i))},A.prototype.delay=function(){this.previous=Date.now(),this.timeout=null,this.updateStroke(this.storedArgs),this.timeout||(this.storedArgs=null)},A.prototype.createPoint=function(t){var e=this.canvasContext.canvas.getBoundingClientRect();return"mousedown"===t.type||"mousemove"===t.type?this.point(t.clientX-e.left,t.clientY-e.top,(new Date).getTime()):this.point(t.touches[0].clientX-e.left,t.touches[0].clientY-e.top,(new Date).getTime())},A.prototype.point=function(t,e,i){return this.pointX=t,this.pointY=e,this.time=i||(new Date).getTime(),{x:this.pointX,y:this.pointY,time:this.time}},A.prototype.addPoint=function(t){var e=this.pointColl,i=0<e.length&&e[e.length-1],s=!!i&&this.distanceTo(i)<=this.minDistance;i&&s||(e.push(t),2<e.length&&(3===e.length&&e.unshift(e[0]),i=this.calculateCurveControlPoints(e[0],e[1],e[2]).controlPoint2,s=this.calculateCurveControlPoints(e[1],e[2],e[3]).controlPoint1,this.startPoint=e[1],this.controlPoint1=i,this.controlPoint2=s,this.endPoint=e[2],this.startDraw(),e.shift()))},A.prototype.startDraw=function(){var t=this.pointVelocityCalc(this.startPoint),e=(t=this.velocity*t+(1-this.velocity)*this.lastVelocity,Math.max(this.maxStrokeWidth/(1+t),this.minStrokeWidth));this.curveDraw(this.lastWidth,e),this.lastVelocity=t,this.lastWidth=e},A.prototype.endDraw=function(){var t,e;C.isNullOrUndefined(this.pointColl)||(t=2<this.pointColl.length,e=this.pointColl[0],!t&&e&&this.strokeDraw(e))},A.prototype.curveDraw=function(t,e){var i,s,n,a,r,l,o,h,u=this.canvasContext,p=e-t,e=this.bezierLengthCalc(),d=2*Math.ceil(e);for(u.beginPath(),i=0;i<d;i++)o=(h=(l=(r=1-(s=i/d))*r)*r)*this.startPoint.x,o=(o=(o+=3*l*s*this.controlPoint1.x)+3*r*(n=s*s)*this.controlPoint2.x)+(a=n*s)*this.endPoint.x,h=h*this.startPoint.y,h=(h=(h+=3*l*s*this.controlPoint1.y)+3*r*n*this.controlPoint2.y)+a*this.endPoint.y,l=Math.min(t+a*p,this.maxStrokeWidth),this.arcDraw(o,h,l);u.closePath(),u.fill(),this.isSignatureEmpty=!1},A.prototype.strokeDraw=function(t){var e=this.canvasContext,i=(this.minStrokeWidth+this.maxStrokeWidth)/2;e.beginPath(),this.arcDraw(t.x,t.y,i),e.closePath(),e.fill(),this.isSignatureEmpty=!1},A.prototype.arcDraw=function(t,e,i){this.signPointsColl.push({x:t,y:e});var s=this.canvasContext;s.moveTo(t,e),s.arc(t,e,i,0,2*Math.PI,!1)},A.prototype.calculateCurveControlPoints=function(t,e,i){var s=t.x-e.x,n=t.y-e.y,a=e.x-i.x,r=e.y-i.y,l=(t.x+e.x)/2,t=(t.y+e.y)/2,o=(e.x+i.x)/2,i=(e.y+i.y)/2,s=Math.sqrt(s*s+n*n),n=Math.sqrt(a*a+r*r),a=n/(s+n),r=o+(l-o)*a,s=i+(t-i)*a,n=e.x-r,a=e.y-s;return{controlPoint1:this.point(l+n,t+a,0),controlPoint2:this.point(o+n,i+a,0)}},A.prototype.bezierLengthCalc=function(){for(var t,e,i,s,n,a,r=0,l=0;l<=10;l++)t=this.bezierPointCalc(e=l/10,this.startPoint.x,this.controlPoint1.x,this.controlPoint2.x,this.endPoint.x),e=this.bezierPointCalc(e,this.startPoint.y,this.controlPoint1.y,this.controlPoint2.y,this.endPoint.y),0<l&&(n=t-i,a=e-s,r+=Math.sqrt(n*n+a*a)),i=t,s=e;return r},A.prototype.bezierPointCalc=function(t,e,i,s,n){return e*(1-t)*(1-t)*(1-t)+3*i*(1-t)*(1-t)*t+3*s*(1-t)*t*t+n*t*t*t},A.prototype.pointVelocityCalc=function(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0},A.prototype.distanceTo=function(t){return Math.sqrt(Math.pow(this.pointX-t.x,2)+Math.pow(this.pointY-t.y,2))},A.prototype.isRead=function(t){t?C.EventHandler.remove(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler):this.disabled||C.EventHandler.add(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler,this)},A.prototype.enableOrDisable=function(t){(this.disabled=t)?(this.canvasContext.canvas.style.filter="opacity(0.5)",this.isRead(!0)):(this.canvasContext.canvas.style.filter="",this.isRead(!1))},A.prototype.updateSnapCollection=function(t){var e,i;C.isNullOrUndefined(this.incStep)?(this.incStep=-1,this.incStep++,this.snapColl=[],this.clearArray=[]):this.incStep++,this.incStep<this.snapColl.length&&(this.snapColl.length=this.incStep),0<this.incStep?(i=(e=this.createElement("canvas",{className:"e-"+this.getModuleName()+"-wrapper"})).getContext("2d"),e.width=this.canvasContext.canvas.width,e.height=this.canvasContext.canvas.height,i.drawImage(this.canvasContext.canvas,0,0,e.width,e.height),this.snapColl.push(e.toDataURL())):this.snapColl.push(this.canvasContext.canvas.toDataURL()),t&&this.clearArray.push(this.incStep)},A.prototype.setBackgroundImage=function(t,e){var i=this,s=new Image;s.crossOrigin="anonymous",s.src=t,"temp"===e?s.onload=function(){i.tempContext.globalCompositeOperation="source-over",i.tempContext.drawImage(s,0,0,i.element.width,i.element.height)}:(s.onload=function(){i.canvasContext.globalCompositeOperation="source-over",i.canvasContext.drawImage(s,0,0,i.element.width,i.element.height),i.updateSnapCollection(),i.saveBackground(!0)},this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height))},A.prototype.setBackgroundColor=function(t){var e,i,s=this.canvasContext;for(s.strokeStyle=t,e=1;e<=s.canvas.width;e++)for(i=1;i<=s.canvas.height;i++)s.strokeRect(0,0,e,i);this.updateSnapCollection()},A.prototype.loadPersistedSignature=function(){var t,e;C.isNullOrUndefined(this.signatureValue)||(t=this,(e=new Image).src=this.signatureValue,e.onload=function(){t.canvasContext.clearRect(0,0,t.element.width,t.element.height),t.canvasContext.drawImage(e,0,0),t.updateSnapCollection()},this.isSignatureEmpty=!1)},A.prototype.getBlob=function(t){for(var t=t.split(","),e=t[0].match(/:(.*?);/)[1],i=atob(t[1]),s=i.length,n=new Uint8Array(s);s--;)n[s]=i.charCodeAt(s);return new Blob([n],{type:e})},A.prototype.download=function(t,e){var t=URL.createObjectURL(t),i=document.createElement("a");i.href=t,i.target="_parent",i.download=e,(document.body||document.documentElement).appendChild(i),i.click(),i.parentNode.removeChild(i)},A.prototype.internalRefresh=function(){this.pointColl=[],this.lastVelocity=0,this.lastWidth=(this.minStrokeWidth+this.maxStrokeWidth)/2},A.prototype.refresh=function(){this.isResponsive=!1,this.setHTMLProperties(),this.resizeHandler(),this.internalRefresh()},A.prototype.clear=function(){this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.tempContext.clearRect(0,0,this.tempContext.canvas.width,this.tempContext.canvas.height),this.saveWithBackground&&this.backgroundImage&&this.setBackgroundImage(this.backgroundImage,"temp"),this.internalRefresh(),this.signRatioPointsColl=[],this.updateSnapCollection(!0),this.isSignatureEmpty=this.canRedraw=!0,this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Clear"):this.trigger("change",{actionName:"clear"})},A.prototype.undo=function(){var t,e=this;0<this.incStep&&(this.incStep--,(t=new Image).src=this.snapColl[this.incStep],t.onload=function(){e.canvasContext.clearRect(0,0,e.element.width,e.element.height),e.canvasContext.drawImage(t,0,0,e.element.width,e.element.height)}),this.isClear(),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Undo"):this.trigger("change",{actionName:"undo"})},A.prototype.redo=function(){var t,e=this;this.incStep<this.snapColl.length-1&&(this.incStep++,(t=new Image).src=this.snapColl[this.incStep],t.onload=function(){e.canvasContext.clearRect(0,0,e.element.width,e.element.height),e.canvasContext.drawImage(t,0,0,e.element.width,e.element.height)}),this.isClear(),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Redo"):this.trigger("change",{actionName:"redo"})},A.prototype.isClear=function(){if(this.clearArray){for(var t=!1,e=0;e<this.clearArray.length;e++)this.clearArray[e]===this.incStep&&(t=this.isSignatureEmpty=!0);t||(this.isSignatureEmpty=!1)}},A.prototype.isEmpty=function(){return this.isSignatureEmpty},A.prototype.canUndo=function(){return 0<this.incStep},A.prototype.canRedo=function(){return this.incStep<this.snapColl.length-1},A.prototype.draw=function(t,e,i,s,n){this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.canvasContext.font=(i=i||30)+"px "+(e=e||"Arial");var e=this.element.width/2,a=this.element.height/2;C.isNullOrUndefined(s)&&C.isNullOrUndefined(n)?(this.canvasContext.textAlign="center",this.canvasContext.textBaseline="middle"):(e=C.isNullOrUndefined(s)?e:s,a=C.isNullOrUndefined(n)?a+i/2:n+i/2),this.canvasContext.fillText(t,e,a),this.updateSnapCollection(),this.isSignatureEmpty=!1,this.trigger("change",{actionName:"draw-text"})},A.prototype.load=function(i,s,n){n=n||this.element.height,s=s||this.element.width,this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height);var a=this,t=new Image;"data"!==(t.src=i).slice(0,4)&&(t.crossOrigin="anonymous"),t.onload=function(){Promise.all([createImageBitmap(t,0,0,s,n)]).then(function(t){var e=document.createElement("canvas");e.width=s,e.height=n,e.getContext("2d").drawImage(t[0],0,0),"data"!==i.slice(0,4)&&(a.canvasContext.globalCompositeOperation="source-over"),a.canvasContext.drawImage(e,0,0,s,n,0,0,a.element.width,a.element.height),a.updateSnapCollection()})},this.isSignatureEmpty=this.canRedraw=!1},A.prototype.saveBackground=function(t){var e,i,s=t&&this.backgroundImage?this.snapColl[this.incStep-1]:this.snapColl[this.incStep];t||(this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.backgroundImage?this.setBackgroundImage(this.backgroundImage):this.backgroundColor&&(this.setBackgroundColor(this.backgroundColor),t=!0)),t&&(e=this,(i=new Image).crossOrigin="anonymous",i.src=s,i.onload=function(){e.backgroundLoaded=!0,e.canvasContext.globalCompositeOperation="source-over",e.canvasContext.drawImage(i,0,0,e.element.width,e.element.height),e.save(e.fileType,e.fileName)})},A.prototype.save=function(t,e){var i;this.saveWithBackground&&null==this.backgroundLoaded&&(this.backgroundImage||this.backgroundColor)?(this.backgroundLoaded=!1,this.fileType=t,this.fileName=e,this.saveBackground(!1)):"Svg"===t?this.toSVG(e=e||"Signature",this.canvasContext.canvas.toDataURL("image/png")):"Jpeg"===t?(e=e||"Signature",!this.saveWithBackground||this.saveWithBackground&&!this.backgroundImage&&!this.backgroundColor?this.toJPEG(e):(i=this.canvasContext.canvas.toDataURL("image/jpeg"),this.download(this.getBlob(i),e+".jpeg"))):(e=e||"Signature",i=this.canvasContext.canvas.toDataURL("image/png"),this.download(this.getBlob(i),e+".png")),this.saveWithBackground&&this.backgroundLoaded&&this.resetSnap()},A.prototype.resetSnap=function(){this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height);var t=this,e=new Image;e.src=this.snapColl[this.incStep-1],e.onload=function(){t.canvasContext.drawImage(e,0,0,t.element.width,t.element.height),t.updateSnapCollection()},this.backgroundLoaded=null,this.snapColl.pop(),this.incStep--,this.snapColl.pop(),this.incStep--},A.prototype.toJPEG=function(e){var i=this,t=this.snapColl[this.incStep],s=(this.setBackgroundColor("#ffffff"),this),n=new Image;n.crossOrigin="anonymous",n.src=t,n.onload=function(){s.canvasContext.globalCompositeOperation="source-over",s.canvasContext.drawImage(n,0,0,s.element.width,s.element.height);var t=s.canvasContext.canvas.toDataURL("image/jpeg");s.download(s.getBlob(t),e+".jpeg"),s.canvasContext.clearRect(0,0,s.canvasContext.canvas.width,s.canvasContext.canvas.height),i.resizeHandler()},this.snapColl.pop(),this.incStep--},A.prototype.toSVG=function(t,e){var i=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=(i.setAttribute("width",this.canvasContext.canvas.width.toString()),i.setAttribute("height",this.canvasContext.canvas.height.toString()),document.createElementNS("http://www.w3.org/2000/svg","image")),e=(s.setAttributeNS(null,"height",this.canvasContext.canvas.height.toString()),s.setAttributeNS(null,"width",this.canvasContext.canvas.width.toString()),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e),i.appendChild(s),'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+this.canvasContext.canvas.width+'" height="'+this.canvasContext.canvas.height+'">'),s=i.innerHTML,i="data:image/svg+xml;base64,"+btoa(e+s+"</svg>");return null==t?i:(this.download(this.getBlob(i),t+".svg"),null)},A.prototype.saveAsBlob=function(){return this.getBlob(this.canvasContext.canvas.toDataURL("image/png"))},A.prototype.getSignature=function(t){return this.saveWithBackground&&this.backgroundColor&&!this.backgroundImage?(this.tempContext.fillStyle=this.backgroundColor,this.tempContext.fillRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height)):this.backgroundColor||this.backgroundImage||"Jpeg"!==t||(this.tempContext.fillStyle="#fff",this.tempContext.fillRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height)),this.tempContext.drawImage(this.element,0,0),"Jpeg"===t?this.tempCanvas.toDataURL("image/jpeg"):"Svg"===t?this.toSVG(null,this.tempCanvas.toDataURL("image/png")):this.tempCanvas.toDataURL("image/png")},A.prototype.getModuleName=function(){return"signature"},A.prototype.getPersistData=function(){return this.signatureValue=this.snapColl[this.incStep],this.addOnPersist(["signatureValue"])},A.prototype.destroy=function(){"image-editor"!==this.getModuleName()&&(this.unwireEvents(null),C.removeClass([this.element],"e-"+this.getModuleName()),this.element.removeAttribute("tabindex"),this.pointColl=null),wn.prototype.destroy.call(this)},A.prototype.propertyChanged=function(t,e){var i=this.canvasContext;switch(t){case"backgroundColor":i.canvas.style.backgroundColor=e,this.backgroundColor=e;break;case"backgroundImage":i.canvas.style.backgroundImage="url("+e+")",this.backgroundImage=e,this.saveWithBackground&&this.setBackgroundImage(this.backgroundImage,"temp");break;case"strokeColor":i.fillStyle=e,this.strokeColor=e;break;case"saveWithBackground":this.saveWithBackground=e;break;case"maxStrokeWidth":this.maxStrokeWidth=e;break;case"minStrokeWidth":this.minStrokeWidth=e;break;case"velocity":this.velocity=e;break;case"isReadOnly":this.isRead(e);break;case"disabled":this.enableOrDisable(e)}},A);function A(){var t=null!==wn&&wn.apply(this,arguments)||this;return t.minDistance=5,t.previous=0,t.interval=30,t.timeout=null,t.isSignatureEmpty=!0,t.backgroundLoaded=null,t.isBlazor=!1,t.isResponsive=!1,t.signPointsColl=[],t.signRatioPointsColl=[],t.canRedraw=!0,t}An=function(t,e){return(An=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var An,N,O=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},O=(function(t,e){function i(){this.constructor=t}An(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(H,N=yn),H.prototype.preRender=function(){},H.prototype.render=function(){this.initialize()},H.prototype.initialize=function(){this.element.setAttribute("role","img"),this.element.setAttribute("aria-label","signature"),C.addClass([this.element],"e-"+this.getModuleName()),N.prototype.initialize.call(this,this.element),this.enablePersistence&&this.loadPersistedSignature()},H.prototype.getModuleName=function(){return N.prototype.getModuleName.call(this)},H.prototype.getPersistData=function(){return N.prototype.getPersistData.call(this)},H.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i];switch(n){case"backgroundColor":N.prototype.propertyChanged.call(this,n,t.backgroundColor);break;case"backgroundImage":N.prototype.propertyChanged.call(this,n,t.backgroundImage);break;case"strokeColor":t.strokeColor!==e.strokeColor&&N.prototype.propertyChanged.call(this,n,t.strokeColor);break;case"maxStrokeWidth":t.maxStrokeWidth!==e.maxStrokeWidth&&N.prototype.propertyChanged.call(this,n,t.maxStrokeWidth);break;case"minStrokeWidth":t.minStrokeWidth!==e.minStrokeWidth&&N.prototype.propertyChanged.call(this,n,t.minStrokeWidth);break;case"velocity":t.velocity!==e.velocity&&N.prototype.propertyChanged.call(this,n,t.velocity);break;case"saveWithBackground":N.prototype.propertyChanged.call(this,n,t.saveWithBackground);break;case"isReadOnly":N.prototype.propertyChanged.call(this,n,t.isReadOnly);break;case"disabled":N.prototype.propertyChanged.call(this,n,t.disabled)}}},O([C.Property("")],H.prototype,"backgroundColor",void 0),O([C.Property("")],H.prototype,"backgroundImage",void 0),O([C.Property(!1)],H.prototype,"disabled",void 0),O([C.Property(!1)],H.prototype,"isReadOnly",void 0),O([C.Property(!0)],H.prototype,"saveWithBackground",void 0),O([C.Property("#000000")],H.prototype,"strokeColor",void 0),O([C.Property(.5)],H.prototype,"minStrokeWidth",void 0),O([C.Property(2)],H.prototype,"maxStrokeWidth",void 0),O([C.Property(.7)],H.prototype,"velocity",void 0),O([C.Property("en-US")],H.prototype,"locale",void 0),O([C.Property(!1)],H.prototype,"enableRtl",void 0),O([C.Property(!1)],H.prototype,"enablePersistence",void 0),O([C.Event()],H.prototype,"beforeSave",void 0),O([C.Event()],H.prototype,"change",void 0),O([C.Event()],H.prototype,"created",void 0),O([C.NotifyPropertyChanges],H));function H(t,e){return N.call(this,t,e)||this}Nn=function(t,e){return(Nn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Nn,Hn,Bn=function(t,e){function i(){this.constructor=t}Nn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},B=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Un="e-rating-icon e-icons e-star-filled",Rn="e-rating-item-list",In="e-rating-item-container",Vn="e-rating-selected",Fn="e-rating-intermediate",Mn="e-rating-hidden",Dn="e-disabled",zn="e-rating-readonly",Wn="e-rating-animation",qn="e-rating-full",jn="e-rating-empty",_n="e-selected-value",Xn=((Xn=o.LabelPosition||(o.LabelPosition={})).Top="Top",Xn.Bottom="Bottom",Xn.Left="Left",Xn.Right="Right",(Xn=o.PrecisionType||(o.PrecisionType={})).Full="Full",Xn.Half="Half",Xn.Quarter="Quarter",Xn.Exact="Exact",Hn=C.Component,Bn(U,Hn),U.prototype.preRender=function(){this.element.id||(this.element.id=C.getUniqueID("e-"+this.getModuleName())),this.keyConfigs={downarrow:"downarrow",leftarrow:"leftarrow",rightarrow:"rightarrow",uparrow:"uparrow",space:"space"},this.tooltipOpen=!1,this.isTouchSelected=!1},U.prototype.render=function(){this.initialize(),this.updateMinValue(),this.updateTemplateFunction(),this.triggerChange(null,this.value,!1),this.renderItems(),this.displayLabel()},U.prototype.initialize=function(){this.wrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-container "}),this.element.parentNode.insertBefore(this.wrapper,this.element),this.wrapper.appendChild(this.element),null==this.element.getAttribute("name")&&this.element.setAttribute("name",this.element.id),C.attributes(this.element,{"aria-label":"rating"}),this.renderItemList(),this.updateReset(),this.readOnly&&this.wrapper.classList.add(zn),this.visible||this.wrapper.classList.add(Mn),this.enableRtl&&this.wrapper.classList.add("e-rtl"),this.enableAnimation&&this.wrapper.classList.add(Wn),this.cssClass&&C.addClass([this.wrapper],this.cssClass.split(" ")),this.updateTooltip(),this.wireKeyboardEvent(),this.updateDisabled()},U.prototype.updateDisabled=function(){this.wrapper.classList[this.disabled?"add":"remove"](Dn),C.attributes(this.ratingItemList,{tabindex:this.disabled?"-1":"0"}),this.updateResetButton()},U.prototype.updateResetButton=function(){var t;this.allowReset&&(t=this.value<=this.min||this.disabled,this.resetElement.classList[t?"add":"remove"](Dn),C.attributes(this.resetElement,{tabindex:t?"-1":"0","aria-hidden":t.toString()}))},U.prototype.renderItemList=function(){var e=this;this.ratingItemList=this.createElement("div",{className:Rn,id:this.element.id+"_item-list"}),C.attributes(this.ratingItemList,{"aria-label":"rating",role:"slider"}),this.wrapper.appendChild(this.ratingItemList),C.EventHandler.add(this.ratingItemList,"touchmove",function(t){return e.touchMoveHandler(t)},this),C.EventHandler.add(this.ratingItemList,C.Browser.touchEndEvent,this.touchEndHandler,this)},U.prototype.touchMoveHandler=function(t){this.isTouchSelected||(this.wrapper.classList.add("e-rating-touch"),this.isTouchSelected=!0),this.wrapper.classList.add("e-touch-select");var e,i=this.ratingItemList.getBoundingClientRect(),i=(t.touches[0].clientX-i.x)/i.width*this.itemsCount,s=(i=(i=this.enableRtl?this.itemsCount-i:i)<this.min?this.min:i>this.itemsCount?this.itemsCount:i,0===(i=this.validateValue(i))?null:this.itemElements[parseInt((Math.ceil(i)-1).toString(),10)]);i===this.currentValue?this.showTooltip&&s&&this.openRatingTooltip(s,!1):(e=this.currentValue,this.triggerChange(t,i),this.updateCurrentValue(i),this.showTooltip&&(s?(Math.ceil(i)!==Math.ceil(e)&&this.closeRatingTooltip(),this.openRatingTooltip(s,!0)):this.closeRatingTooltip()))},U.prototype.touchEndHandler=function(){this.closeRatingTooltip(),this.wrapper.classList.remove("e-touch-select")},U.prototype.updateTemplateFunction=function(){this.emptyTemplateFunction=this.emptyTemplate?this.getTemplateString(this.emptyTemplate):null,this.fullTemplateFunction=this.fullTemplate?this.getTemplateString(this.fullTemplate):null},U.prototype.renderItems=function(){for(var e=this,t=0;t<this.itemsCount;t++){var i=this.createElement("span",{className:In}),s=this.createElement("span",{className:"e-rating-item"}),n=this.getRatingValue(this.value,t),n=(this.renderItemContent(s,n,t,!1),i.appendChild(s),this.wireItemsEvents(i,t+1),this.itemElements.push(i),{element:i,value:t+1});this.trigger("beforeItemRender",n,function(t){e.ratingItemList.appendChild(t.element)})}C.attributes(this.ratingItemList,{"aria-valuemax":this.itemsCount.toString()}),this.updateItemValue(!1)},U.prototype.renderItemContent=function(t,e,i,s){s&&this.removeItemContent(t),this.fullTemplate&&1===e?(t.classList.add(qn),C.append(this.fullTemplateFunction({index:i,ratingValue:e},this,"ratingFullTemplate",this.element.id+"fullTemplate",this.isStringTemplate),t)):this.emptyTemplate?(t.classList.add(jn),C.append(this.emptyTemplateFunction({index:i,ratingValue:e},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate",this.isStringTemplate),t)):C.addClass([t],Un.split(" "))},U.prototype.removeItemContent=function(t){t.classList.remove(qn,jn),C.removeClass([t],Un.split(" ")),t.firstChild&&(t.innerHTML="")},U.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipObj=new h.Tooltip({target:".e-rating-item-container",windowCollision:!0,opensOn:"Custom",cssClass:this.cssClass?"e-rating-tooltip "+this.cssClass:"e-rating-tooltip"}),this.tooltipObj.appendTo(this.ratingItemList)):C.isNullOrUndefined(this.tooltipObj)||(this.tooltipObj.destroy(),this.tooltipObj=null)},U.prototype.updateMinValue=function(){this.setProperties({min:this.validateValue(this.min)},!0),0<this.min&&this.value<this.min&&this.triggerChange(null,this.min,!1),C.attributes(this.ratingItemList,{"aria-valuemin":this.min.toString()})},U.prototype.validateValue=function(t){return t=t>this.itemsCount?this.itemsCount:t<0?0:this.precision===o.PrecisionType.Full||this.enableSingleSelection?Math.round(t):this.precision===o.PrecisionType.Half?Math.round(2*t)/2:this.precision===o.PrecisionType.Quarter?Math.round(4*t)/4:Math.round(10*t)/10},U.prototype.getRatingValue=function(t,e){return this.enableSingleSelection?e<t&&t<=e+1?1:0:e+1<=t?1:t<e?0:t-e},U.prototype.updateItemValue=function(t){(t=void 0===t?!0:t)&&this.isReact&&this.clearTemplate(["ratingEmptyTemplate","ratingFullTemplate"]);for(var e=0;e<this.itemsCount;e++){var i=this.itemElements[parseInt(e.toString(),10)],s=(i.classList.remove(Vn,Fn,_n),this.getRatingValue(this.currentValue,e));1===s?i.classList.add(Vn):0<s?i.classList.add(Fn):this.precision===o.PrecisionType.Full&&e+1<=this.value&&!this.enableSingleSelection&&i.classList.add(_n),t&&this.updateItemContent(s,e),i.style.setProperty("--rating-value",100*s+"%"),i.classList[0===this.value&&0===e||this.value===e+1||0<s&&s<1?"add":"remove"]("e-rating-focus")}t&&this.renderReactTemplates(),this.updateResetButton(),C.attributes(this.ratingItemList,{"aria-valuenow":this.currentValue.toString()}),C.attributes(this.element,{value:this.value.toString()})},U.prototype.updateItemContent=function(t,e){var i;(this.fullTemplate||this.emptyTemplate)&&(i=this.itemElements[parseInt(e.toString(),10)].querySelector(".e-rating-item"),this.fullTemplate&&1===t?!this.isReact&&i.classList.contains(qn)||(this.removeItemContent(i),i.classList.add(qn),C.append(this.fullTemplateFunction({ratingValue:t,index:e},this,"ratingFullTemplate",this.element.id+"fullTemplate"+e,this.isStringTemplate),i)):this.emptyTemplate?!this.isReact&&i.classList.contains(jn)||(this.removeItemContent(i),i.classList.add(jn),C.append(this.emptyTemplateFunction({ratingValue:t,index:e},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate"+e,this.isStringTemplate),i)):(this.removeItemContent(i),C.addClass([i],Un.split(" "))))},U.prototype.updateTooltipContent=function(t){var e,i,s=this;this.showTooltip&&(this.isReact&&this.clearTemplate(["ratingTooltipTemplate"]),this.tooltipTemplate?(e=this.createElement("span",{className:"e-rating-tooltip-content"}),i=this.getTemplateString(this.tooltipTemplate),C.append(i({value:this.currentValue},this,"ratingTooltipTemplate",this.element.id+"tooltipTemplate",this.isStringTemplate),e),this.tooltipObj.setProperties({content:e},t),this.isAngular&&setTimeout(function(){var t=s.ratingItemList.querySelectorAll("."+In+"."+Vn);s.tooltipObj.refresh(t[t.length-1])})):(e=this.currentValue.toString(),this.tooltipObj.setProperties({content:C.initializeCSPTemplate(function(){return e})},t)),this.renderReactTemplates())},U.prototype.getTemplateString=function(e){var t,i="";try{i="function"!=typeof e&&(t=C.select(e))?"SCRIPT"===t.tagName?t.innerHTML:t.outerHTML:e}catch(t){i=e}return C.compile(i)},U.prototype.displayLabel=function(){this.showLabel?(this.spanLabel=this.createElement("span",{className:"e-rating-label"}),this.updateLabel(),this.updateLabelPosition()):this.wrapper.contains(this.spanLabel)&&(C.remove(this.spanLabel),this.spanLabel=null)},U.prototype.updateLabel=function(){var t;this.showLabel&&(this.labelTemplate?(this.isReact&&this.clearTemplate(["ratingLabelTemplate"]),this.spanLabel.firstChild&&(this.spanLabel.innerHTML=""),t=this.getTemplateString(this.labelTemplate),C.append(t({value:this.currentValue},this,"ratingLabelTemplate",this.element.id+"labelTemplate",this.isStringTemplate),this.spanLabel),this.renderReactTemplates()):this.spanLabel.textContent=this.currentValue+" / "+this.itemsCount)},U.prototype.updateReset=function(){this.allowReset?(this.resetElement=this.createElement("span",{className:"e-icons e-reset",attrs:{"aria-label":"resetbutton",role:"button"}}),this.updateResetButton(),C.EventHandler.add(this.resetElement,"click",this.resetClicked,this),this.wrapper.insertBefore(this.resetElement,this.ratingItemList)):this.wrapper.contains(this.resetElement)&&(C.remove(this.resetElement),this.resetElement=null)},U.prototype.updateLabelPosition=function(){this.clearLabelPosition(),this.spanLabel.classList.add("e-label-"+this.labelPosition.toLowerCase()),"Left"===this.labelPosition||"Top"===this.labelPosition?this.wrapper.firstChild.after(this.spanLabel):this.wrapper.appendChild(this.spanLabel)},U.prototype.clearLabelPosition=function(){var t=this.spanLabel.classList.value.match(/(e-label-[top|bottom|right|left]+)/g);t&&C.removeClass([this.spanLabel],t)},U.prototype.wireItemsEvents=function(t,e){var i=this;C.EventHandler.add(t,"click",function(t){return i.clickHandler(t)},this),C.EventHandler.add(t,"mousemove",function(t){return i.mouseMoveHandler(e,t)},this),C.EventHandler.add(t,"mouseleave",this.mouseLeaveHandler,this)},U.prototype.clickHandler=function(t){this.currentValue=0<this.min&&this.currentValue<this.min?this.min:this.currentValue,this.triggerChange(t,this.currentValue),this.updateItemValue(),this.updateLabel(),this.updateResetButton()},U.prototype.updateValueChange=function(t,e,i){this.triggerChange(t,e,i=void 0===i?!0:i),this.updateItemValue(),this.updateLabel()},U.prototype.triggerChange=function(t,e,i){void 0===i&&(i=!0),e=this.validateValue(e),this.currentValue=e,this.currentValue!==this.value&&(t={event:t,isInteracted:i,value:e,previousValue:this.value},this.setProperties({value:e},!0),this.trigger("valueChanged",t))},U.prototype.mouseMoveHandler=function(t,e){this.isTouchSelected&&(this.wrapper.classList.remove("e-rating-touch"),this.isTouchSelected=!1);var i=this.calculateCurrentValue(t,e),i=this.validateValue(i),t=this.itemElements[parseInt((t-1).toString(),10)];i===this.currentValue?this.openRatingTooltip(t,!1):(this.updateCurrentValue(i),this.openRatingTooltip(t,!0),this.trigger("onItemHover",{element:t,event:e,value:i}))},U.prototype.openRatingTooltip=function(t,e){this.showTooltip&&(this.tooltipOpen?e&&(this.updateTooltipContent(!0),this.tooltipObj.refresh(t)):(this.updateTooltipContent(!1),this.tooltipObj.open(t),this.tooltipOpen=!0))},U.prototype.closeRatingTooltip=function(){this.tooltipOpen&&(this.tooltipObj.close(),this.tooltipOpen=!1)},U.prototype.updateCurrentValue=function(t){this.currentValue=t,this.updateItemValue(),this.updateLabel()},U.prototype.mouseLeaveHandler=function(){this.closeRatingTooltip(),this.updateCurrentValue(this.value)},U.prototype.calculateCurrentValue=function(t,e){var i=t;return this.enableSingleSelection||this.precision===o.PrecisionType.Full||(i=e.offsetX/this.itemElements[t-1].clientWidth,i=this.enableRtl?1-i:i,this.precision===o.PrecisionType.Quarter?i=i<=.25?.25:i<=.5?.5:i<.75?.75:1:this.precision===o.PrecisionType.Half&&(i=i<=.5?.5:1),i=i+t-1),i},U.prototype.reset=function(){this.resetClicked(null,!1)},U.prototype.resetClicked=function(t,e){this.updateValueChange(t,this.min,e=void 0===e?!0:e),this.updateResetButton()},U.prototype.wireKeyboardEvent=function(){this.keyboardModuleRating=new C.KeyboardEvents(this.wrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},U.prototype.keyActionHandler=function(t){if(t.preventDefault(),!this.disabled&&!this.readOnly){if(t.target.classList.contains(Rn))switch(t.action){case"uparrow":this.handleNavigation(t,!0);break;case"downarrow":this.handleNavigation(t,!1);break;case"leftarrow":this.handleNavigation(t,this.enableRtl);break;case"rightarrow":this.handleNavigation(t,!this.enableRtl)}this.allowReset&&t.target.classList.contains("e-reset")&&"space"===t.action&&this.resetClicked(t)}},U.prototype.handleNavigation=function(t,e){var i;(!e&&this.value>this.min||e&&this.value<this.itemsCount)&&(i=this.precision===o.PrecisionType.Full||this.enableSingleSelection?1:this.precision===o.PrecisionType.Half?.5:this.precision===o.PrecisionType.Quarter?.25:Math.round(1)/10,i=e?this.value+i:this.value-i,this.updateValueChange(t,i),this.updateResetButton())},U.prototype.updateContent=function(){this.isReact&&this.clearTemplate(["ratingEmptyTemplate","ratingFullTemplate"]);for(var t=0;t<this.itemsCount;t++){var e=this.itemElements[parseInt(t.toString(),10)].firstElementChild;this.renderItemContent(e,this.getRatingValue(this.value,t),t,!0)}},U.prototype.getModuleName=function(){return"rating"},U.prototype.getPersistData=function(){return this.addOnPersist([])},U.prototype.removeItemElements=function(){for(var t=0;t<this.itemElements.length;t++)C.remove(this.itemElements[parseInt(t.toString(),10)]);this.itemElements=[]},U.prototype.destroy=function(){var e=this;Hn.prototype.destroy.call(this),this.removeItemElements(),this.clearTemplate(),this.spanLabel&&(C.remove(this.spanLabel),this.spanLabel=null),this.resetElement&&(C.remove(this.resetElement),this.resetElement=null),this.showTooltip&&(this.tooltipObj.destroy(),this.tooltipObj=null),C.remove(this.ratingItemList),this.ratingItemList=null,this.wrapper.parentNode.insertBefore(this.element,this.wrapper),C.remove(this.wrapper),this.wrapper=null,this.keyboardModuleRating.destroy(),this.keyboardModuleRating=null,["value","aria-label","name"].forEach(function(t){e.element.removeAttribute(t)})},B([C.Property(!(U.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"value":this.updateValueChange(null,this.value>this.min?this.value:this.min,!1);break;case"min":this.updateMinValue(),this.updateItemValue(),this.updateLabel();break;case"showLabel":this.displayLabel();break;case"visible":this.wrapper.classList[this.visible?"remove":"add"](Mn);break;case"disabled":this.updateDisabled();break;case"readOnly":this.wrapper.classList[this.readOnly?"add":"remove"](zn);break;case"allowReset":this.updateReset();break;case"enableRtl":this.wrapper.classList[this.enableRtl?"add":"remove"]("e-rtl");break;case"cssClass":e.cssClass&&C.removeClass([this.wrapper],e.cssClass.split(" ")),t.cssClass&&C.addClass([this.wrapper],t.cssClass.split(" ")),this.tooltipObj&&this.tooltipObj.setProperties({cssClass:this.cssClass?"e-rating-tooltip "+this.cssClass:"e-rating-tooltip"});break;case"labelPosition":this.updateLabelPosition();break;case"showTooltip":this.updateTooltip();break;case"precision":this.updateMinValue(),this.triggerChange(null,this.value,!1),this.updateItemValue(),this.updateLabel();break;case"enableSingleSelection":this.updateValueChange(null,this.currentValue,!1);break;case"enableAnimation":this.wrapper.classList[this.enableAnimation?"add":"remove"](Wn);break;case"emptyTemplate":case"fullTemplate":this.updateTemplateFunction(),this.updateContent();break;case"labelTemplate":this.updateLabel();break;case"itemsCount":this.removeItemElements(),this.renderItems(),this.updateLabel()}}))],U.prototype,"allowReset",void 0),B([C.Property("")],U.prototype,"cssClass",void 0),B([C.Property(!1)],U.prototype,"disabled",void 0),B([C.Property("")],U.prototype,"emptyTemplate",void 0),B([C.Property(!0)],U.prototype,"enableAnimation",void 0),B([C.Property(!1)],U.prototype,"enableSingleSelection",void 0),B([C.Property("")],U.prototype,"fullTemplate",void 0),B([C.Property(5)],U.prototype,"itemsCount",void 0),B([C.Property(o.LabelPosition.Right)],U.prototype,"labelPosition",void 0),B([C.Property("")],U.prototype,"labelTemplate",void 0),B([C.Property(0)],U.prototype,"min",void 0),B([C.Property(o.PrecisionType.Full)],U.prototype,"precision",void 0),B([C.Property(!1)],U.prototype,"readOnly",void 0),B([C.Property(!1)],U.prototype,"showLabel",void 0),B([C.Property(!0)],U.prototype,"showTooltip",void 0),B([C.Property("")],U.prototype,"tooltipTemplate",void 0),B([C.Property(0)],U.prototype,"value",void 0),B([C.Property(!0)],U.prototype,"visible",void 0),B([C.Event()],U.prototype,"beforeItemRender",void 0),B([C.Event()],U.prototype,"created",void 0),B([C.Event()],U.prototype,"onItemHover",void 0),B([C.Event()],U.prototype,"valueChanged",void 0),B([C.NotifyPropertyChanges],U));function U(t,e){t=Hn.call(this,t,e)||this;return t.itemElements=[],t}Kn=function(t,e){return(Kn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Kn,Yn,Bn=function(t,e){function i(){this.constructor=t}Kn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},B=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Zn=((Zn=o.OtpInputType||(o.OtpInputType={})).Number="number",Zn.Text="text",Zn.Password="password",(Zn=o.OtpInputStyle||(o.OtpInputStyle={})).Outlined="outlined",Zn.Underlined="underlined",Zn.Filled="filled",(Zn=o.TextTransform||(o.TextTransform={})).None="none",Zn.Uppercase="uppercase",Zn.Lowercase="lowercase",Yn=C.Component,Bn(R,Yn),R.prototype.preRender=function(){this.element.id||(this.element.id=C.getUniqueID("e-"+this.getModuleName()))},R.prototype.render=function(){this.initialize()},R.prototype.initialize=function(){C.attributes(this.element,{role:"group"}),this.renderInputs(),this.renderSeparator(1,this.inputs.length),this.addPlaceHolder(),this.updateCssClass(this.cssClass),this.updateVariantClass(),this.updateAriaLabel(this.ariaLabels),this.setElementAttributes(this.htmlAttributes,this.element),this.enableRtl&&this.element.classList.add("e-rtl"),this.previousValue=this.value.toString(),this.autoFocus&&this.focusIn()},R.prototype.renderInputs=function(){this.hiddenInputEle=this.createElement("input",{id:"otpInput_hidden",attrs:{name:this.element.id,type:"hidden",value:"number"===this.type?this.value.toString().replace(/\D/g,""):this.value.toString(),autoComplete:"off"}}),this.element.appendChild(this.hiddenInputEle);for(var t=0;t<this.length;t++)this.createOtpInput(t)},R.prototype.createOtpInput=function(t){var e=this.getDefaultValue(),i="",s=(e&&("number"===this.type?(s=e[parseInt(t.toString(),10)],isNaN(Number(s))||(i=s)):i=e[parseInt(t.toString(),10)]||""),this.createElement("input",{id:this.element.id+"-"+(t+1),className:"e-otp-input-field e-input",attrs:{maxlength:"1",type:this.type,inputmode:"inputmode"in this.htmlAttributes?this.htmlAttributes.inputmode:"number"===this.type?"numeric":"text"}}));this.disabled&&s.setAttribute("disabled","disabled"),this.element.appendChild(s),this.inputs.push(s),i&&(s.value=i),this.wireEvents(s,t)},R.prototype.renderSeparator=function(t,e){if(0<this.separator.length)for(var i=t;i<e;i++){var s=this.createElement("span",{className:"e-otp-separator"});s.textContent=this.separator,this.separatorElements.push(s),this.element.insertBefore(s,this.inputs[parseInt(i.toString(),10)])}},R.prototype.updateSeparatorValue=function(){if(""===this.separator){for(var t=0;t<this.separatorElements.length;t++)C.remove(this.separatorElements[parseInt(t.toString(),10)]);this.separatorElements=[]}else for(t=0;t<this.separatorElements.length;t++)this.separatorElements[parseInt(t.toString(),10)].textContent=this.separator},R.prototype.addPlaceHolder=function(){for(var t=0;t<this.inputs.length;t++)this.setElementAttributes({placeholder:1===this.placeholder.length||0===this.placeholder.length?this.placeholder:this.placeholder.charAt(t)},this.inputs[parseInt(t.toString(),10)])},R.prototype.updateInputType=function(e){var i=this;this.inputs.forEach(function(t){t.type=e,t.setAttribute("inputmode","inputmode"in i.htmlAttributes?i.htmlAttributes.inputmode:"number"===e?"numeric":"text")})},R.prototype.getDefaultValue=function(){var t="number"==typeof this.value?this.value.toString():this.value,t=(t=this.textTransform?this.getTransformedText(t):t).replace(/\s/g,"");if(0<t.length)return t.split("")},R.prototype.getTransformedText=function(t){return this.textTransform.toLowerCase()===o.TextTransform.Lowercase?t.toLowerCase():this.textTransform.toLowerCase()===o.TextTransform.Uppercase?t.toUpperCase():t},R.prototype.handleInputChange=function(t,e){var i=this.inputs[parseInt(t.toString(),10)],i=(i&&t<this.length-1&&0<i.value.length&&(i=this.inputs[parseInt(t.toString(),10)+1],this.shouldFireFocus=this.shouldFireBlur=!1,i.focus(),i)&&0<i.value.length&&i.select(),e.target);1<i.value.length&&(i.value=i.value.slice(0,1)),this.textTransform&&(i.value=this.getTransformedText(i.value)),this.triggerInputEvent(t,e),this.triggerValuechanged(e,!0)},R.prototype.handleKeyAction=function(t,e){1<e.key.length&&!(0===t&&"Backspace"===e.key||t===this.length-1&&"Delete"===e.key)&&(this.shouldFireFocus=this.shouldFireBlur=!1);var i,s=this.inputs[parseInt(t.toString(),10)],n=this.inputs[parseInt(t.toString(),10)-1],a=this.inputs[parseInt(t.toString(),10)+1];"Delete"===e.key?(i="",0<s.value.length?(i=s.value,s.value=""):t!==this.inputs.length-1&&(i=a.value,a.value="",a.focus()),0<i.length&&this.triggerInputEvent(t,e)):"Backspace"===e.key?0!==t&&0===s.value.length&&(i=n.value,n.value="",n.focus(),0<i.length)&&this.triggerInputEvent(t,e):"ArrowLeft"===e.key||"ArrowRight"===e.key?("ArrowLeft"===e.key?0<t&&(n.focus(),n.select()):t<this.inputs.length-1&&(a.focus(),a.select()),e.preventDefault()):"ArrowUp"===e.key||"ArrowDown"===e.key?e.preventDefault():"Tab"===e.key||e.shiftKey||e.ctrlKey||"number"===this.type&&/\D/.test(e.key.toLocaleLowerCase())&&e.preventDefault()},R.prototype.handleSelection=function(t){t=this.inputs[parseInt(t.toString(),10)];t.value&&t.select()},R.prototype.handleFocus=function(t,e){C.addClass([this.inputs[parseInt(t.toString(),10)]],"e-otp-input-focus"),this.shouldFireFocus&&(e={element:this.element,event:e,index:t,isInteracted:!this.isFocusInCalled,value:this.value},this.trigger("focus",e)),this.shouldFireFocus=!0},R.prototype.handleBlur=function(t,e){C.removeClass([this.inputs[parseInt(t.toString(),10)]],"e-otp-input-focus"),this.shouldFireBlur&&(e={element:this.element,event:e,value:this.value,index:t,isInteracted:!this.isFocusOutCalled},this.trigger("blur",e)),this.shouldFireBlur=!0},R.prototype.handlePaste=function(t,e){var i=e.clipboardData;if(i){for(var s=i.getData("text").split(""),n=0,a=t;a<this.inputs.length;a++)0<s.length&&s[parseInt(n.toString(),10)]&&(this.inputs[parseInt(a.toString(),10)].value=s[parseInt(n.toString(),10)],n++,this.updateValueProperty());this.focusIn(),this.triggerValuechanged(e,!0)}},R.prototype.triggerInputEvent=function(t,e){var i=this.value.toString(),e=(this.updateValueProperty(),{element:this.element,event:e,previousValue:i,value:this.value.toString(),index:t});this.trigger("input",e)},R.prototype.triggerValuechanged=function(t,e){this.length===this.value.toString().length&&this.previousValue!==this.value&&(t={element:this.element,event:t,isInteracted:e||!1,previousValue:this.previousValue,value:this.value},this.trigger("valueChanged",t),this.previousValue=this.value.toString())},R.prototype.wireEvents=function(t,e){C.EventHandler.add(t,"focus",this.handleFocus.bind(this,e),this),C.EventHandler.add(t,"blur",this.handleBlur.bind(this,e),this),C.EventHandler.add(t,"input",this.handleInputChange.bind(this,e),this),C.EventHandler.add(t,"keydown",this.handleKeyAction.bind(this,e),this),C.EventHandler.add(t,"click",this.handleSelection.bind(this,e),this),C.EventHandler.add(t,"paste",this.handlePaste.bind(this,e),this),C.EventHandler.add(t,"wheel",this.handleWheelEvent,this)},R.prototype.unWireEvents=function(){for(var t=0;t<this.inputs.length;t++){var e=this.inputs[parseInt(t.toString(),10)];C.EventHandler.remove(e,"focus",this.handleFocus.bind(this,t)),C.EventHandler.remove(e,"blur",this.handleBlur.bind(this,t)),C.EventHandler.remove(e,"input",this.handleInputChange.bind(this,t)),C.EventHandler.remove(e,"keydown",this.handleKeyAction.bind(this,t)),C.EventHandler.remove(e,"click",this.handleSelection.bind(this,t)),C.EventHandler.remove(e,"paste",this.handlePaste.bind(this,t)),C.EventHandler.remove(e,"wheel",this.handleWheelEvent)}},R.prototype.updateValueProperty=function(){var e="",t=(this.inputs.forEach(function(t){e+=t.value}),this.isProtectedOnChange);this.isProtectedOnChange=!0,this.value="number"==typeof this.value?parseInt(e,10):e,this.isProtectedOnChange=t,this.hiddenInputEle.value=this.value.toString()},R.prototype.updateInputValue=function(t){var e=this.value.toString();this.textTransform&&(e=this.getTransformedText(e));for(var i=0;i<this.inputs.length;i++)t.toString().charAt(i)!==e.charAt(i)&&(this.inputs[parseInt(i.toString(),10)].value=e.charAt(i),this.hiddenInputEle.value=e);this.focusIn()},R.prototype.updateCssClass=function(t,e){var i;(e=void 0===e?"":e)&&(i=e.trim().split(" "),(e=this.element.classList).remove.apply(e,i)),t&&(i=t.trim().split(" "),(e=this.element.classList).add.apply(e,i))},R.prototype.updateVariantClass=function(){var t=this.stylingMode.toLocaleLowerCase();"underlined"!==(t="outlined"===t?"outline":t)&&"filled"!==t&&"outline"!==t||(C.removeClass([this.element],["e-underlined","e-filled","e-outline"]),C.addClass([this.element],"e-"+t))},R.prototype.updateAriaLabel=function(s){this.inputs.forEach(function(t,e){var i="Enter Otp Character "+(e+1),e=s&&0<s.length&&s[parseInt(e.toString(),10)]||i;t.setAttribute("aria-label",e)})},R.prototype.updateDisabledState=function(){var e=this;this.inputs.forEach(function(t){e.disabled?t.setAttribute("disabled","disabled"):t.removeAttribute("disabled")})},R.prototype.setElementAttributes=function(t,e){if(!C.isNullOrUndefined(t))for(var i in t){var s;"class"===i?(s=t.class.replace(/\s+/g," ").trim())&&C.addClass([e],s.split(" ")):"inputmode"===i?this.setInputMode(t[""+i]):("name"===i&&this.element.id===e.id?this.hiddenInputEle:e).setAttribute(i,t[""+i])}},R.prototype.setInputMode=function(t){for(var e=0;e<this.inputs.length;e++)this.inputs[parseInt(e.toString(),10)].setAttribute("inputmode",t)},R.prototype.handleLengthChange=function(t,e){if(0<t-e){for(var i=e;i<t;i++)this.createOtpInput(i);this.renderSeparator(e,t),this.addPlaceHolder(),this.updateAriaLabel(this.ariaLabels)}else if(0<=t&&0<this.inputs.length){for(i=t;i<this.inputs.length;i++)C.remove(this.inputs[parseInt(i.toString(),10)]);if(this.inputs.splice(t),0<this.separatorElements.length){for(e=0===t?0:t-1,i=e;i<this.separatorElements.length;i++)C.remove(this.separatorElements[parseInt(i.toString(),10)]);this.separatorElements.splice(e)}}},R.prototype.getModuleName=function(){return"otpinput"},R.prototype.getPersistData=function(){return this.addOnPersist([])},R.prototype.destroy=function(){Yn.prototype.destroy.call(this),this.unWireEvents();for(var t=0;t<this.inputs.length;t++)C.remove(this.inputs[parseInt(t.toString(),10)]);for(t=0;t<this.separatorElements.length;t++)C.remove(this.separatorElements[parseInt(t.toString(),10)]);C.remove(this.hiddenInputEle),C.removeClass([this.element],["e-underlined","e-filled","e-outline","e-rtl"]),this.cssClass&&C.removeClass([this.element],this.cssClass.trim().split(" ")),this.element.removeAttribute("role"),this.inputs=[],this.separatorElements=[],this.hiddenInputEle=null},R.prototype.focusIn=function(){this.isFocusInCalled=!0;for(var t=this.inputs.length-1,e=0;e<this.inputs.length;e++)if(!(0<this.inputs[parseInt(e.toString(),10)].value.length)){t=e;break}this.inputs[parseInt(t.toString(),10)].focus(),this.isFocusInCalled=!1},R.prototype.focusOut=function(){this.isFocusOutCalled=!0,this.inputs.forEach(function(t){t.blur()}),this.isFocusOutCalled=!1},R.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"textTransform":this.updateInputValue(this.value);break;case"value":this.updateInputValue(e.value),this.triggerValuechanged();break;case"placeholder":this.addPlaceHolder();break;case"disabled":this.updateDisabledState();break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"separator":""===e.separator?this.renderSeparator(1,this.inputs.length):this.updateSeparatorValue();break;case"htmlAttributes":this.setElementAttributes(t.htmlAttributes,this.element);break;case"type":this.updateInputType(t.type);break;case"stylingMode":this.updateVariantClass();break;case"ariaLabels":this.updateAriaLabel(t.ariaLabels);break;case"length":this.handleLengthChange(t.length,e.length);break;case"enableRtl":this.element.classList[this.enableRtl?"add":"remove"]("e-rtl");break;case"autoFocus":this.autoFocus&&this.focusIn()}},B([C.Property(4)],R.prototype,"length",void 0),B([C.Property("")],R.prototype,"value",void 0),B([C.Property(o.OtpInputType.Number)],R.prototype,"type",void 0),B([C.Property("")],R.prototype,"separator",void 0),B([C.Property("")],R.prototype,"placeholder",void 0),B([C.Property(o.OtpInputStyle.Outlined)],R.prototype,"stylingMode",void 0),B([C.Property(!1)],R.prototype,"disabled",void 0),B([C.Property("")],R.prototype,"cssClass",void 0),B([C.Property(!1)],R.prototype,"autoFocus",void 0),B([C.Property(o.TextTransform.None)],R.prototype,"textTransform",void 0),B([C.Property({})],R.prototype,"htmlAttributes",void 0),B([C.Property([])],R.prototype,"ariaLabels",void 0),B([C.Event()],R.prototype,"created",void 0),B([C.Event()],R.prototype,"valueChanged",void 0),B([C.Event()],R.prototype,"focus",void 0),B([C.Event()],R.prototype,"blur",void 0),B([C.Event()],R.prototype,"input",void 0),B([C.NotifyPropertyChanges],R));function R(t,e){t=Yn.call(this,t,e)||this;return t.inputs=[],t.previousValue="",t.separatorElements=[],t.shouldFireFocus=!0,t.shouldFireBlur=!0,t.isFocusInCalled=!1,t.isFocusOutCalled=!1,t.handleWheelEvent=function(t){t.preventDefault()},t}o.AsyncSettings=Ts,o.ButtonsProps=Es,o.ColorPicker=s,o.ColorRangeData=Ne,o.FilesProp=ys,o.FormValidator=Xi,o.LimitData=Ue,o.MaskUndo=Ee,o.MaskedTextBox=xt,o.NumericTextBox=Ht,o.OtpInput=Zn,o.Rating=Xn,o.Signature=O,o.SignatureBase=yn,o.Slider=zi,o.SmartTextArea=En,o.TEXTBOX_FOCUS=M,o.TextArea=P,o.TextBox=S,o.TicksData=Le,o.TooltipData=Ve,o.Uploader=t,o.applyMask=zt,o.bindClearEvent=jt,o.containerAttributes=F,o.createMask=Dt,o.escapeRegExp=Qt,o.getMaskedVal=function(t){return Kt.call(Ce(t),t.element)},o.getVal=function(t){return p.call(Ce(t),t.element)},o.maskInput=function(t){var e=be(t),i=(zt.call(e),p.call(this,this.element));this.prevValue=i,this.value=i,t.mask&&(qt.call(e),Wt.call(e))},o.maskInputBlurHandler=te,o.maskInputDropHandler=se,o.maskInputFocusHandler=Jt,o.maskInputMouseDownHandler=Zt,o.maskInputMouseUpHandler=Gt,o.mobileRemoveFunction=re,o.regex=_i,o.regularExpressions=Mt,o.setElementValue=b,o.setMaskValue=ye,o.strippedValue=p,o.triggerFocus=$t,o.unstrippedValue=Kt,o.unwireEvents=qt,o.wireEvents=Wt,Object.defineProperty(o,"__esModule",{value:!0})});
10
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-splitbuttons")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-splitbuttons"],e):e((t=t||self).ej={},t.ej2Base,t.ej2Popups,t.ej2Splitbuttons)}(this,function(o,C,h,I){"use strict";var n,V,u={RTL:"e-rtl",DISABLE:"e-disabled",INPUT:"e-input",TEXTAREA:"e-multi-line-input",INPUTGROUP:"e-input-group",FLOATINPUT:"e-float-input",FLOATLINE:"e-float-line",FLOATTEXT:"e-float-text",FLOATTEXTCONTENT:"e-float-text-content",CLEARICON:"e-clear-icon",CLEARICONHIDE:"e-clear-icon-hide",LABELTOP:"e-label-top",LABELBOTTOM:"e-label-bottom",NOFLOATLABEL:"e-no-float-label",INPUTCUSTOMTAG:"e-input-custom-tag",FLOATCUSTOMTAG:"e-float-custom-tag"},F=["title","style","class"],M="e-input-focus";function D(i){z(i.floatLabelType,i.element);function t(){var t,e;((e=J((t=i).element)).classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.add("e-input-focus"),"Never"!==t.floatLabelType&&setTimeout(function(){n.calculateWidth(t.element,e)},80)}function e(){var t,e;((e=J((t=i).element)).classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.remove("e-input-focus"),"Never"!==t.floatLabelType&&setTimeout(function(){n.calculateWidth(t.element,e)},80)}function s(){z(i.floatLabelType,i.element)}i.element.addEventListener("focus",t),i.element.addEventListener("blur",e),i.element.addEventListener("input",s),i.element.__eventHandlers.inputFocusHandler={focusHandler:t},i.element.__eventHandlers.inputBlurHandler={blurHandler:e},i.element.__eventHandlers.inputHandler={inputHandler:s}}function z(t,e){var i=e.value,e=e.parentElement,s=e&&e.parentElement;""===i||C.isNullOrUndefined(i)?"Always"!==t&&(e&&e.classList.contains("e-input-group")?e.classList.remove("e-valid-input"):s&&s.classList.contains("e-input-group")&&s.classList.remove("e-valid-input")):e&&e.classList.contains("e-input-group")?e.classList.add("e-valid-input"):s&&s.classList.contains("e-input-group")&&s.classList.add("e-valid-input")}function W(){var t=J(this).getElementsByClassName("e-float-text")[0];C.isNullOrUndefined(t)||(C.addClass([t],u.LABELTOP),t.classList.contains(u.LABELBOTTOM)&&C.removeClass([t],u.LABELBOTTOM))}function q(){var t=J(this);(t.getElementsByTagName("textarea")[0]?""===t.getElementsByTagName("textarea")[0].value:""===t.getElementsByTagName("input")[0].value)&&(t=t.getElementsByClassName("e-float-text")[0],C.isNullOrUndefined(t)||(t.classList.contains(u.LABELTOP)&&C.removeClass([t],u.LABELTOP),C.addClass([t],u.LABELBOTTOM)))}function j(t){t.addEventListener("focus",W),t.addEventListener("blur",q)}function _(t){C.isNullOrUndefined(t)||(t.removeEventListener("focus",W),t.removeEventListener("blur",q))}function X(t,e,i){var s,i=C.isNullOrUndefined(i)?C.createElement:i,n=("Auto"===t.floatLabelType&&j(t.element),C.isNullOrUndefined(e.container)?(e.container=tt(t,u.FLOATINPUT,u.FLOATCUSTOMTAG,"div",i),e.container.classList.add(u.INPUTGROUP),t.element.parentNode&&t.element.parentNode.insertBefore(e.container,t.element)):(C.isNullOrUndefined(t.customTag)||e.container.classList.add(u.FLOATCUSTOMTAG),e.container.classList.add(u.FLOATINPUT)),i("span",{className:u.FLOATLINE})),i=i("label",{className:u.FLOATTEXT});C.isNullOrUndefined(t.element.id)||""===t.element.id||(i.id="label_"+t.element.id.replace(/ /g,"_"),C.attributes(t.element,{"aria-labelledby":i.id})),C.isNullOrUndefined(t.element.placeholder)||""===t.element.placeholder||(i.innerText=et(t.element.placeholder),t.element.removeAttribute("placeholder")),C.isNullOrUndefined(t.properties)||C.isNullOrUndefined(t.properties.placeholder)||""===t.properties.placeholder||(i.innerText=et(t.properties.placeholder)),i.innerText||e.container.classList.add(u.NOFLOATLABEL),(e.container.classList.contains("e-float-icon-left")?((s=e.container.querySelector(".e-input-in-wrap")).appendChild(t.element),s.appendChild(n),s):(e.container.appendChild(t.element),e.container.appendChild(n),e.container)).appendChild(i),G(t.element.value,i),"Always"===t.floatLabelType&&(i.classList.contains(u.LABELBOTTOM)&&C.removeClass([i],u.LABELBOTTOM),C.addClass([i],u.LABELTOP)),"Auto"===t.floatLabelType?(s=function(){Q(t.element,t.floatLabelType)},t.element.addEventListener("input",n=function(){Q(t.element,t.floatLabelType)}),t.element.addEventListener("blur",s),t.element.__eventHandlers.floatInputHandler={inputFloatHandler:n},t.element.__eventHandlers.floatBlurHandler={blurFloatHandler:s}):K(t),C.isNullOrUndefined(t.element.getAttribute("id"))||i.setAttribute("for",t.element.getAttribute("id"))}function K(t){var e,i;C.isNullOrUndefined(t.element)||C.isNullOrUndefined(t.element.__eventHandlers)||C.isNullOrUndefined(t.element.__eventHandlers.floatInputHandler)||C.isNullOrUndefined(t.element.__eventHandlers.floatBlurHandler)||(e=t.element.__eventHandlers.floatInputHandler.inputFloatHandler,i=t.element.__eventHandlers.floatBlurHandler.blurFloatHandler,t.element.removeEventListener("input",e),t.element.removeEventListener("blur",i),delete t.element.__eventHandlers.floatInputHandler,delete t.element.__eventHandlers.floatBlurHandler)}function Y(t,e){"Always"===t&&e.classList.contains("e-outline")&&e.classList.add("e-valid-input")}function Z(t,e,i){C.isNullOrUndefined(e)||(t&&!i?C.removeClass([e],u.CLEARICONHIDE):C.addClass([e],u.CLEARICONHIDE))}function G(t,e,i){void 0===i&&(i=null),t?(C.addClass([e],u.LABELTOP),e.classList.contains(u.LABELBOTTOM)&&C.removeClass([e],u.LABELBOTTOM)):null!=i&&i===document.activeElement||(e.classList.contains(u.LABELTOP)&&C.removeClass([e],u.LABELTOP),C.addClass([e],u.LABELBOTTOM))}function J(t){t=C.isNullOrUndefined(t.parentNode)?t:t.parentNode;return t=t&&t.classList.contains("e-input-in-wrap")?t.parentNode:t}function $(s,n,t){function e(){Z(s.value,n)}function i(){Z(s.value,n,s.readOnly)}function a(){var t,e;t=s,e=n,setTimeout(function(){C.isNullOrUndefined(e)||(C.addClass([e],u.CLEARICONHIDE),e=!C.isNullOrUndefined(t)&&t.classList.contains("e-combobox")?null:e)},200)}var l;void 0!==V&&!V||(n.addEventListener("click",l=function(t){var e,i;t=t,i=n,(e=s).classList.contains(u.DISABLE)||e.readOnly||(t.preventDefault(),e!==document.activeElement&&e.focus(),e.value="",C.addClass([i],u.CLEARICONHIDE))}),s.__eventHandlers.clearClickHandler={clickHandlerEvent:l});s.addEventListener("input",e),s.addEventListener("focus",i),s.addEventListener("blur",a),s.__eventHandlers.clearInputHandler={inputHandlerEvent:e},s.__eventHandlers.clearFocusHandler={focusHandlerEvent:i},s.__eventHandlers.clearBlurHandler={blurHandlerEvent:a}}function Q(t,e){J(t).classList.contains(u.FLOATINPUT)&&"Auto"===e&&(e=J(t).getElementsByClassName("e-float-text")[0],G(t.value,e,t))}function tt(t,e,i,s,n){var a,n=C.isNullOrUndefined(n)?C.createElement:n;return C.isNullOrUndefined(t.customTag)?a=n(s,{className:e}):(a=n(t.customTag,{className:e})).classList.add(i),a.classList.add("e-control-wrapper"),a}function et(t){var e,i="";return C.isNullOrUndefined(t)||""===t||((e=document.createElement("span")).innerHTML='<input placeholder="'+t+'"/>',i=e.children[0].placeholder),i}function it(t,e,i){C.isNullOrUndefined(i)||""===i||C.removeClass(e,i.split(" ")),C.isNullOrUndefined(t)||""===t||C.addClass(e,t.split(" "))}function st(t,e,i){("multiselect"===i||function(t){if(!t)return;var e=t;for(;e&&e!==document.body;){if("none"===window.getComputedStyle(e).display)return;e=e.parentElement}return 1}(t))&&(i="multiselect"===i?t:t.clientWidth-parseInt(getComputedStyle(t,null).getPropertyValue("padding-left"),10),!C.isNullOrUndefined(e))&&!C.isNullOrUndefined(e.getElementsByClassName("e-float-text-content")[0])&&(e.getElementsByClassName("e-float-text-content")[0].classList.contains("e-float-text-overflow")&&e.getElementsByClassName("e-float-text-content")[0].classList.remove("e-float-text-overflow"),i<e.getElementsByClassName("e-float-text-content")[0].clientWidth||i===e.getElementsByClassName("e-float-text-content")[0].clientWidth)&&e.getElementsByClassName("e-float-text-content")[0].classList.add("e-float-text-overflow")}function nt(t,e){t=et(t);var i,s=J(e);s.classList.contains(u.FLOATINPUT)?C.isNullOrUndefined(t)||""===t?(s.classList.add(u.NOFLOATLABEL),(i=s.getElementsByClassName("e-float-text-content")[0])?i.children[0].textContent="":s.getElementsByClassName(u.FLOATTEXT)[0].textContent=""):((i=s.getElementsByClassName("e-float-text-content")[0])&&i.children[0]?i.children[0].textContent=t:s.getElementsByClassName(u.FLOATTEXT)[0].textContent=t,s.classList.remove(u.NOFLOATLABEL),e.removeAttribute("placeholder")):C.isNullOrUndefined(t)||""===t?e.removeAttribute("placeholder"):C.attributes(e,{placeholder:t})}function at(t,e,i){t?C.attributes(e,{readonly:""}):e.removeAttribute("readonly"),C.isNullOrUndefined(i)||Q(e,i)}function lt(t,e){t?C.addClass(e,u.RTL):C.removeClass(e,u.RTL)}function rt(t,e,i,s){var n={disabled:"","aria-disabled":"true"},a=!C.isNullOrUndefined(s);t?(e.classList.remove(u.DISABLE),ht(n,e),a&&C.removeClass([s],u.DISABLE)):(e.classList.add(u.DISABLE),ut(n,e),a&&C.addClass([s],u.DISABLE)),C.isNullOrUndefined(i)||Q(e,i)}function ot(t,e,i,s,n){var a,n=C.isNullOrUndefined(n)?C.createElement:n;t?i.clearButton=(t=e,e=i,s=s,n=n,n=(C.isNullOrUndefined(n)?C.createElement:n)("span",{className:u.CLEARICON}),a=e.container,C.isNullOrUndefined(s)?(e.container.classList.contains(u.FLOATINPUT)?e.container.querySelector("."+u.FLOATTEXT):t).insertAdjacentElement("afterend",n):a.appendChild(n),C.addClass([n],u.CLEARICONHIDE),$(t,n),n.setAttribute("aria-label","close"),n):(C.remove(i.clearButton),i.clearButton=null)}function ht(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],a=J(e);"disabled"===n&&e.classList.remove(u.DISABLE),"disabled"===n&&a.classList.contains(u.INPUTGROUP)&&a.classList.remove(u.DISABLE),"placeholder"===n&&a.classList.contains(u.FLOATINPUT)?a.getElementsByClassName(u.FLOATTEXT)[0].textContent="":e.removeAttribute(n)}}function ut(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],a=J(e);"disabled"===n&&e.classList.add(u.DISABLE),"disabled"===n&&a.classList.contains(u.INPUTGROUP)&&a.classList.add(u.DISABLE),"placeholder"===n&&a.classList.contains(u.FLOATINPUT)?a.getElementsByClassName(u.FLOATTEXT)[0].textContent=t[""+n]:e.setAttribute(n,t[""+n])}}function pt(t,e){t.classList.contains("e-outline")&&t.getElementsByClassName("e-float-text")[0]&&((e=e("span",{className:u.FLOATTEXTCONTENT})).innerHTML=t.getElementsByClassName("e-float-text")[0].innerHTML,t.getElementsByClassName("e-float-text")[0].innerHTML="",t.getElementsByClassName("e-float-text")[0].appendChild(e))}function dt(t,e,i){var s=[],n=(s.push(i),C.isNullOrUndefined(i)?e.querySelectorAll(".e-input-group-icon"):s);if(t&&0<n.length)for(var a=0;a<n.length;a++)n[parseInt(a.toString(),10)].addEventListener("mousedown",ct,!1),n[parseInt(a.toString(),10)].addEventListener("mouseup",mt,!1);else if(0<n.length)for(a=0;a<n.length;a++)n[parseInt(a.toString(),10)].removeEventListener("mousedown",ct,this),n[parseInt(a.toString(),10)].removeEventListener("mouseup",mt,this)}function ct(){for(var t,e,i=this.parentElement;!i.classList.contains("e-input-group");)i=i.parentElement;e=this,(t=i).classList.contains("e-disabled")||t.querySelector("input").readOnly||e.classList.add("e-input-btn-ripple")}function mt(){var t=this;setTimeout(function(){t.classList.remove("e-input-btn-ripple")},500)}function vt(t,e){e=e("span",{className:t});return e.classList.add("e-input-group-icon"),e}function ft(t,e,i,s){var s=C.isNullOrUndefined(s)?C.createElement:s,t=vt(t,s),n=(e.classList.add("e-float-icon-left"),e.querySelector(".e-input-in-wrap"));if(C.isNullOrUndefined(n)){n=s("span",{className:"e-input-in-wrap"}),i.parentNode.insertBefore(n,i);var a=e.querySelectorAll(i.tagName+" ~ *");n.appendChild(i);for(var l=0;l<a.length;l++){var r=a[parseInt(l.toString(),10)],o=n.parentElement;r.classList.contains("e-float-line")&&(o&&o.classList.contains("e-filled")||!o)||n.appendChild(r)}}return n.parentNode.insertBefore(t,n),dt(!0,e,t),t}function gt(t,e,i){t=vt(t,C.isNullOrUndefined(i)?C.createElement:i);return(e.classList.contains("e-float-icon-left")?e.querySelector(".e-input-in-wrap"):e).appendChild(t),dt(!0,e,t),t}function yt(t,e){"hidden"===e.type?t.classList.add("e-hidden"):t.classList.contains("e-hidden")&&t.classList.remove("e-hidden")}function bt(t){var e=t;return e=C.isNullOrUndefined(t)||""===t?e:t.replace(/\s+/g," ").trim()}n=o.Input||(o.Input={}),V=!0,n.createInput=function(t,e){t.element.__eventHandlers={};var i=C.isNullOrUndefined(e)?C.createElement:e,s={container:null,buttons:[],clearButton:null};if(t.floatLabelType,V=t.bindClearAction,C.isNullOrUndefined(t.floatLabelType)||"Never"===t.floatLabelType?(s.container=tt(t,u.INPUTGROUP,u.INPUTCUSTOMTAG,"span",i),t.element.parentNode.insertBefore(s.container,t.element),C.addClass([t.element],u.INPUT),s.container.appendChild(t.element)):X(t,s,i),D(t),C.isNullOrUndefined(t.properties)||C.isNullOrUndefined(t.properties.showClearButton)||!t.properties.showClearButton||(ot(t.properties.showClearButton,t.element,s,!0,i),s.clearButton.setAttribute("role","button"),s.container.classList.contains(u.FLOATINPUT)&&C.addClass([s.container],u.INPUTGROUP)),!C.isNullOrUndefined(t.buttons))for(var n=0;n<t.buttons.length;n++)s.buttons.push(gt(t.buttons[n],s.container,i));return C.isNullOrUndefined(t.element)||"TEXTAREA"!==t.element.tagName||C.addClass([s.container],u.TEXTAREA),yt(s.container,t.element),pt((s=function(t,e){if(!C.isNullOrUndefined(t.properties))for(var i=0,s=Object.keys(t.properties);i<s.length;i++)switch(s[i]){case"cssClass":it(t.properties.cssClass,[e.container]),Y(t.floatLabelType,e.container);break;case"enabled":rt(t.properties.enabled,t.element,t.floatLabelType,e.container);break;case"enableRtl":lt(t.properties.enableRtl,[e.container]);break;case"placeholder":nt(t.properties.placeholder,t.element);break;case"readonly":at(t.properties.readonly,t.element)}return e}(t,s)).container,i),s},n.bindInitialEvent=D,n.wireFloatingEvents=j,n.wireClearBtnEvents=$,n.destroy=function(t,e){var i,s,n,a,l;void 0===e&&(e=null),i=t,C.isNullOrUndefined(i.element)||C.isNullOrUndefined(i.element.__eventHandlers)||C.isNullOrUndefined(i.element.__eventHandlers.inputFocusHandler)||C.isNullOrUndefined(i.element.__eventHandlers.inputBlurHandler)||C.isNullOrUndefined(i.element.__eventHandlers.inputHandler)||(s=i.element.__eventHandlers.inputFocusHandler.focusHandler,n=i.element.__eventHandlers.inputBlurHandler.blurHandler,l=i.element.__eventHandlers.inputHandler.inputHandler,i.element.removeEventListener("focus",s),i.element.removeEventListener("blur",n),i.element.removeEventListener("input",l),delete i.element.__eventHandlers.inputFocusHandler,delete i.element.__eventHandlers.inputBlurHandler,delete i.element.__eventHandlers.inputHandler),"Auto"===t.floatLabelType&&K(t),t.properties.showClearButton&&(s=t.element,n=e,C.isNullOrUndefined(s)||C.isNullOrUndefined(s.__eventHandlers)||(C.isNullOrUndefined(s.__eventHandlers.clearClickHandler)||(a=s.__eventHandlers.clearClickHandler.clickHandlerEvent,void 0!==V&&!V||C.isNullOrUndefined(n)||n.removeEventListener("click",a),delete s.__eventHandlers.clearClickHandler),C.isNullOrUndefined(s.__eventHandlers.clearInputHandler))||C.isNullOrUndefined(s.__eventHandlers.clearFocusHandler)||C.isNullOrUndefined(s.__eventHandlers.clearBlurHandler)||(n=s.__eventHandlers.clearInputHandler.inputHandlerEvent,a=s.__eventHandlers.clearFocusHandler.focusHandlerEvent,l=s.__eventHandlers.clearBlurHandler.blurHandlerEvent,s.removeEventListener("input",n),s.removeEventListener("focus",a),s.removeEventListener("blur",l),delete s.__eventHandlers.clearInputHandler,delete s.__eventHandlers.clearFocusHandler,delete s.__eventHandlers.clearBlurHandler)),C.isNullOrUndefined(t.buttons)||dt(!1,null,t.buttons),_(t.element),C.isNullOrUndefined(t.element)||(delete t.element.__eventHandlers,t.element.classList.contains(u.INPUT)&&t.element.classList.remove(u.INPUT))},n.setValue=function(t,e,i,s){e.value=t,"Never"!==i&&st(e,e.parentElement),C.isNullOrUndefined(i)||"Auto"!==i||Q(e,i),!C.isNullOrUndefined(s)&&s&&(t=J(e),C.isNullOrUndefined(t)||(s=t.getElementsByClassName(u.CLEARICON)[0],C.isNullOrUndefined(s))||(e.value&&!C.isNullOrUndefined(t)&&t.classList.contains("e-input-focus")?C.removeClass([s],u.CLEARICONHIDE):C.addClass([s],u.CLEARICONHIDE))),z(i,e)},n.setCssClass=it,n.calculateWidth=st,n.setWidth=function(t,e){"number"==typeof t?e.style.width=C.formatUnit(t):"string"==typeof t&&(e.style.width=t.match(/px|%|em/)?t:C.formatUnit(t)),st(e.firstChild,e)},n.setPlaceholder=nt,n.setReadonly=at,n.setEnableRtl=lt,n.setEnabled=rt,n.setClearButton=ot,n.removeAttributes=ht,n.addAttributes=ut,n.removeFloating=function(t){var e,i,s,t=t.container;!C.isNullOrUndefined(t)&&t.classList.contains(u.FLOATINPUT)&&(e=t.querySelector("textarea")?t.querySelector("textarea"):t.querySelector("input"),i=t.querySelector("."+u.FLOATTEXT).textContent,s=null!==t.querySelector(".e-clear-icon"),C.detach(t.querySelector("."+u.FLOATLINE)),C.detach(t.querySelector("."+u.FLOATTEXT)),C.classList(t,[u.INPUTGROUP],[u.FLOATINPUT]),_(e),C.attributes(e,{placeholder:i}),e.classList.add(u.INPUT),s||"INPUT"!==e.tagName||e.removeAttribute("required"))},n.addFloating=function(t,e,i,s){var n,a,s=C.isNullOrUndefined(s)?C.createElement:s,l=C.closest(t,"."+u.INPUTGROUP),r=l.tagName,r={element:t,floatLabelType:e,customTag:"DIV"!==r&&"SPAN"!==r?r:null,properties:{placeholder:i}};"Never"!==e?(i=l.querySelector(".e-clear-icon"),n={container:l},t.classList.remove(u.INPUT),X(r,n,s),pt(n.container,s),st(r.element,n.container),s=l.classList.contains("e-float-icon-left"),C.isNullOrUndefined(i)&&(i=(s?l.querySelector(".e-input-in-wrap"):l).querySelector(".e-input-group-icon")),C.isNullOrUndefined(i)?s&&(i=l.querySelector(".e-input-group-icon")):(n=l.querySelector("."+u.FLOATLINE),a=l.querySelector("."+u.FLOATTEXT),(s=s?l.querySelector(".e-input-in-wrap"):l).insertBefore(t,i),s.insertBefore(n,i),s.insertBefore(a,i))):K(r),Y(e,t.parentElement)},n.createSpanElement=pt,n.setRipple=function(t,e){for(var i=0;i<e.length;i++)dt(t,e[parseInt(i.toString(),10)].container)},n.addIcon=function(t,e,i,s,n){if(e="string"==typeof e?e.split(","):e,"append"===t.toLowerCase())for(var a=0,l=e;a<l.length;a++)gt(l[a],i,n);else for(var r=0,o=e;r<o.length;r++)ft(o[r],i,s,n);i.getElementsByClassName("e-input-group-icon")[0]&&i.getElementsByClassName("e-float-text-overflow")[0]&&i.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon")},n.prependSpan=ft,n.appendSpan=gt,n.validateInputType=yt,n.updateHTMLAttributesToElement=function(t,e){if(!C.isNullOrUndefined(t))for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i];F.indexOf(n)<0&&e.setAttribute(n,t[""+n])}},n.updateCssClass=function(t,e,i){it(bt(t),[i],bt(e))},n.getInputValidClassList=bt,n.updateHTMLAttributesToWrapper=function(t,e){if(!C.isNullOrUndefined(t))for(var i=0,s=Object.keys(t);i<s.length;i++){var n,a=s[i];-1<F.indexOf(a)&&("class"===a?""!==(n=this.getInputValidClassList(t[""+a]))&&C.addClass([e],n.split(" ")):"style"===a?(n=e.getAttribute(a),n=C.isNullOrUndefined(n)?t[""+a]:n+t[""+a],e.setAttribute(a,n)):e.setAttribute(a,t[""+a]))}},n.isBlank=function(t){return!t||/^\s*$/.test(t)};Ct=function(t,e){return(Ct=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Ct,Et,xt=function(t,e){function i(){this.constructor=t}Ct(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},t=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},St="e-input-group-icon",Tt="e-spin-up",Pt="e-error",kt="increment",Ot="decrement",Lt=new RegExp("^(-)?(\\d*)$"),wt="e-input-focus",At=["title","style","class"],Nt=0,Ht=(Et=C.Component,xt(e,Et),e.prototype.preRender=function(){this.isPrevFocused=!1,this.decimalSeparator=".",this.intRegExp=new RegExp("/^(-)?(d*)$/"),this.isCalled=!1;var t=C.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),C.removeClass([this.cloneElement],["e-control","e-numerictextbox","e-lib"]),this.angularTagName=null,this.formEle=C.closest(this.element,"form"),"EJS-NUMERICTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;for(var e=this.createElement("input"),i=0;i<this.element.attributes.length;i++){var s=this.element.attributes[i].nodeName;"id"!==s&&"class"!==s?(e.setAttribute(this.element.attributes[i].nodeName,this.element.attributes[i].nodeValue),e.innerHTML=this.element.innerHTML):"class"===s&&e.setAttribute(s,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "))}this.element.hasAttribute("name")&&this.element.removeAttribute("name"),this.element.classList.remove("e-control","e-numerictextbox"),this.element.appendChild(e),this.element=e,C.setValue("ej2_instances",t,this.element)}C.attributes(this.element,{role:"spinbutton",tabindex:"0",autocomplete:"off"});t={incrementTitle:"Increment value",decrementTitle:"Decrement value",placeholder:this.placeholder};this.l10n=new C.L10n("numerictextbox",t,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",C.getUniqueID("numerictextbox")),this.isValidState=!0,this.inputStyle=null,this.inputName=null,this.cultureInfo={},this.initCultureInfo(),this.initCultureFunc(),this.prevValue=this.value,this.updateHTMLAttrToElement(),this.checkAttributes(!1),this.formEle&&(this.inputEleValue=this.value),this.validateMinMax(),this.validateStep(),null===this.placeholder&&this.updatePlaceholder()},e.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&(this.createWrapper(),this.showSpinButton&&this.spinBtnCreation(),this.setElementWidth(this.width),this.container.classList.contains("e-input-group")||this.container.classList.add("e-input-group"),this.changeValue(null===this.value||isNaN(this.value)?null:this.strictMode?this.trimValue(this.value):this.value),this.wireEvents(),null===this.value||isNaN(this.value)||this.decimals&&this.setProperties({value:this.roundNumber(this.value,this.decimals)},!0),(this.element.getAttribute("value")||this.value)&&(this.element.setAttribute("value",this.element.value),this.hiddenInput.setAttribute("value",this.hiddenInput.value)),this.elementPrevValue=this.element.value,this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","numerictextbox"),!C.isNullOrUndefined(C.closest(this.element,"fieldset"))&&C.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete())},e.prototype.checkAttributes=function(t){for(var e=0,i=t?C.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","step","disabled","readonly","style","name","placeholder"];e<i.length;e++){var s,n,a,l=i[e];if(!C.isNullOrUndefined(this.element.getAttribute(l)))switch(l){case"disabled":(C.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(l)&&""!==this.element.getAttribute(l)&&"true"!==this.element.getAttribute(l),this.setProperties({enabled:s},!t));break;case"readonly":(C.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.readonly||t)&&(s="readonly"===this.element.getAttribute(l)||""===this.element.getAttribute(l)||"true"===this.element.getAttribute(l),this.setProperties({readonly:s},!t));break;case"placeholder":(C.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"value":(C.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.value||t)&&(n=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(l)),this.setProperties(C.setValue(l,n,{}),!t));break;case"min":!C.isNullOrUndefined(this.numericOptions)&&void 0!==this.numericOptions.min&&!t||null===(n=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(l)))||isNaN(n)||this.setProperties(C.setValue(l,n,{}),!t);break;case"max":!C.isNullOrUndefined(this.numericOptions)&&void 0!==this.numericOptions.max&&!t||null===(a=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(l)))||isNaN(a)||this.setProperties(C.setValue(l,a,{}),!t);break;case"step":!C.isNullOrUndefined(this.numericOptions)&&void 0!==this.numericOptions.step&&!t||null===(a=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(l)))||isNaN(a)||this.setProperties(C.setValue(l,a,{}),!t);break;case"style":this.inputStyle=this.element.getAttribute(l);break;case"name":this.inputName=this.element.getAttribute(l);break;default:var r=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(l));(null===r||isNaN(r))&&"value"!==l||this.setProperties(C.setValue(l,r,{}),!0)}}},e.prototype.updatePlaceholder=function(){this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0)},e.prototype.initCultureFunc=function(){this.instance=new C.Internationalization(this.locale)},e.prototype.initCultureInfo=function(){this.cultureInfo.format=this.format,null!==C.getValue("currency",this)&&(C.setValue("currency",this.currency,this.cultureInfo),this.setProperties({currencyCode:this.currency},!0))},e.prototype.createWrapper=function(){var t=this.cssClass,t=(C.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=this.getNumericValidClassList(this.cssClass)),o.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:t,enableRtl:this.enableRtl,showClearButton:this.showClearButton,enabled:this.enabled}},this.createElement));this.inputWrapper=t,this.container=t.container,this.container.setAttribute("class","e-control-wrapper e-numeric "+this.container.getAttribute("class")),this.updateHTMLAttrToWrapper(),this.readonly&&C.attributes(this.element,{"aria-readonly":"true"}),this.hiddenInput=this.createElement("input",{attrs:{type:"text",validateHidden:"true","aria-label":"hidden",class:"e-numeric-hidden"}}),this.inputName=null!==this.inputName?this.inputName:this.element.id,this.element.removeAttribute("name"),this.isAngular&&"EJS-NUMERICTEXTBOX"===this.angularTagName&&0<this.cloneElement.id.length?C.attributes(this.hiddenInput,{name:this.cloneElement.id}):C.attributes(this.hiddenInput,{name:this.inputName}),this.container.insertBefore(this.hiddenInput,this.container.childNodes[1]),this.updateDataAttribute(!1),null!==this.inputStyle&&C.attributes(this.container,{style:this.inputStyle})},e.prototype.updateDataAttribute=function(t){var e={};if(t)e=this.htmlAttributes;else for(var i=0;i<this.element.attributes.length;i++)e[this.element.attributes[i].name]=this.element.getAttribute(this.element.attributes[i].name);for(var s=0,n=Object.keys(e);s<n.length;s++){var a=n[s];0===a.indexOf("data")&&this.hiddenInput.setAttribute(a,e[""+a])}},e.prototype.updateHTMLAttrToElement=function(){if(!C.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i=e[t];At.indexOf(i)<0&&this.element.setAttribute(i,this.htmlAttributes[""+i])}},e.prototype.updateCssClass=function(t,e){o.Input.setCssClass(this.getNumericValidClassList(t),[this.container],this.getNumericValidClassList(e))},e.prototype.getNumericValidClassList=function(t){var e=t;return e=C.isNullOrUndefined(t)||""===t?e:t.replace(/\s+/g," ").trim()},e.prototype.updateHTMLAttrToWrapper=function(){if(!C.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i,s=e[t];-1<At.indexOf(s)&&("class"===s?""!==(i=this.getNumericValidClassList(this.htmlAttributes[""+s]))&&C.addClass([this.container],i.split(" ")):"style"===s?(i=this.container.getAttribute(s),i=C.isNullOrUndefined(i)?this.htmlAttributes[""+s]:i+this.htmlAttributes[""+s],this.container.setAttribute(s,i)):this.container.setAttribute(s,this.htmlAttributes[""+s]))}},e.prototype.setElementWidth=function(t){C.isNullOrUndefined(t)||("number"==typeof t?this.container.style.width=C.formatUnit(t):"string"==typeof t&&(this.container.style.width=t.match(/px|%|em/)?t:C.formatUnit(t)))},e.prototype.spinBtnCreation=function(){this.spinDown=o.Input.appendSpan(St+" e-spin-down",this.container,this.createElement),C.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle")}),this.spinUp=o.Input.appendSpan(St+" "+Tt,this.container,this.createElement),C.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle")}),this.wireSpinBtnEvents()},e.prototype.validateMinMax=function(){"number"==typeof this.min&&!isNaN(this.min)||this.setProperties({min:-Number.MAX_VALUE},!0),"number"==typeof this.max&&!isNaN(this.max)||this.setProperties({max:Number.MAX_VALUE},!0),null!==this.decimals&&(this.min!==-Number.MAX_VALUE&&this.setProperties({min:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.min))},!0),this.max!==Number.MAX_VALUE)&&this.setProperties({max:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.max))},!0),this.setProperties({min:this.min>this.max?this.max:this.min},!0),this.min!==-Number.MAX_VALUE&&C.attributes(this.element,{"aria-valuemin":this.min.toString()}),this.max!==Number.MAX_VALUE&&C.attributes(this.element,{"aria-valuemax":this.max.toString()})},e.prototype.formattedValue=function(t,e){return this.instance.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(e)},e.prototype.validateStep=function(){null!==this.decimals&&this.setProperties({step:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.step))},!0)},e.prototype.action=function(t,e){this.isInteract=!0;var i=this.isFocused?this.instance.getNumberParser({format:"n"})(this.element.value):this.value;this.changeValue(this.performAction(i,this.step,t)),this.raiseChangeEvent(e)},e.prototype.checkErrorClass=function(){this.isValidState?C.removeClass([this.container],Pt):C.addClass([this.container],Pt),C.attributes(this.element,{"aria-invalid":this.isValidState?"false":"true"})},e.prototype.bindClearEvent=function(){this.showClearButton&&C.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},e.prototype.resetHandler=function(t){t.preventDefault(),this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&!this.inputWrapper.container.classList.contains("e-static-clear")||this.clear(t),this.isInteract=!0,this.raiseChangeEvent(t)},e.prototype.clear=function(t){var e,i;this.setProperties({value:null},!0),this.setElementValue(""),this.hiddenInput.value="",C.closest(this.element,"form")&&(e=this.element.nextElementSibling,(i=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(i))},e.prototype.resetFormHandler=function(){"EJS-NUMERICTEXTBOX"===this.element.tagName?this.updateValue(null):this.updateValue(this.inputEleValue)},e.prototype.setSpinButton=function(){C.isNullOrUndefined(this.spinDown)||C.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),C.isNullOrUndefined(this.spinUp)||C.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")})},e.prototype.wireEvents=function(){C.EventHandler.add(this.element,"focus",this.focusHandler,this),C.EventHandler.add(this.element,"blur",this.focusOutHandler,this),C.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),C.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),C.EventHandler.add(this.element,"input",this.inputHandler,this),C.EventHandler.add(this.element,"keypress",this.keyPressHandler,this),C.EventHandler.add(this.element,"change",this.changeHandler,this),C.EventHandler.add(this.element,"paste",this.pasteHandler,this),this.enabled&&(this.bindClearEvent(),this.formEle)&&C.EventHandler.add(this.formEle,"reset",this.resetFormHandler,this)},e.prototype.wireSpinBtnEvents=function(){C.EventHandler.add(this.spinUp,C.Browser.touchStartEvent,this.mouseDownOnSpinner,this),C.EventHandler.add(this.spinDown,C.Browser.touchStartEvent,this.mouseDownOnSpinner,this),C.EventHandler.add(this.spinUp,C.Browser.touchEndEvent,this.mouseUpOnSpinner,this),C.EventHandler.add(this.spinDown,C.Browser.touchEndEvent,this.mouseUpOnSpinner,this),C.EventHandler.add(this.spinUp,C.Browser.touchMoveEvent,this.touchMoveOnSpinner,this),C.EventHandler.add(this.spinDown,C.Browser.touchMoveEvent,this.touchMoveOnSpinner,this)},e.prototype.unwireEvents=function(){C.EventHandler.remove(this.element,"focus",this.focusHandler),C.EventHandler.remove(this.element,"blur",this.focusOutHandler),C.EventHandler.remove(this.element,"keyup",this.keyUpHandler),C.EventHandler.remove(this.element,"input",this.inputHandler),C.EventHandler.remove(this.element,"keydown",this.keyDownHandler),C.EventHandler.remove(this.element,"keypress",this.keyPressHandler),C.EventHandler.remove(this.element,"change",this.changeHandler),C.EventHandler.remove(this.element,"paste",this.pasteHandler),this.formEle&&C.EventHandler.remove(this.formEle,"reset",this.resetFormHandler)},e.prototype.unwireSpinBtnEvents=function(){C.EventHandler.remove(this.spinUp,C.Browser.touchStartEvent,this.mouseDownOnSpinner),C.EventHandler.remove(this.spinDown,C.Browser.touchStartEvent,this.mouseDownOnSpinner),C.EventHandler.remove(this.spinUp,C.Browser.touchEndEvent,this.mouseUpOnSpinner),C.EventHandler.remove(this.spinDown,C.Browser.touchEndEvent,this.mouseUpOnSpinner),C.EventHandler.remove(this.spinUp,C.Browser.touchMoveEvent,this.touchMoveOnSpinner),C.EventHandler.remove(this.spinDown,C.Browser.touchMoveEvent,this.touchMoveOnSpinner)},e.prototype.changeHandler=function(t){t.stopPropagation(),this.element.value.length||this.setProperties({value:null},!0);var e=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(e,t)},e.prototype.raiseChangeEvent=function(t){var e;this.inputValue=C.isNullOrUndefined(this.inputValue)||isNaN(this.inputValue)?null:this.inputValue,this.prevValue===this.value&&this.prevValue===this.inputValue||(e={},this.changeEventArgs={value:this.value,previousValue:this.prevValue,isInteracted:this.isInteract,isInteraction:this.isInteract,event:t},t&&(this.changeEventArgs.event=t),void 0===this.changeEventArgs.event&&(this.changeEventArgs.isInteracted=!1,this.changeEventArgs.isInteraction=!1),C.merge(e,this.changeEventArgs),this.prevValue=this.value,this.isInteract=!1,this.elementPrevValue=this.element.value,this.preventChange=!1,this.trigger("change",e))},e.prototype.pasteHandler=function(){var t,e=this;this.enabled&&!this.readonly&&(t=this.element.value,setTimeout(function(){e.numericRegex().test(e.element.value)||e.setElementValue(t)}))},e.prototype.preventHandler=function(){var a=this,l=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);setTimeout(function(){var t,e,i,s,n;0<a.element.selectionStart&&(t=a.element.selectionStart,e=a.element.selectionStart-1,i=a.element.value.split(""),s=C.getNumericObject(a.locale),n=(s=C.getValue("decimal",s)).charCodeAt(0)," "===a.element.value[e]&&0<a.element.selectionStart&&!l?(C.isNullOrUndefined(a.prevVal)?a.element.value=a.element.value.trim():0!=e?a.element.value=a.prevVal:0==e&&(a.element.value=a.element.value.trim()),a.element.setSelectionRange(e,e)):isNaN(parseFloat(a.element.value[a.element.selectionStart-1]))&&45!==a.element.value[a.element.selectionStart-1].charCodeAt(0)?(i.indexOf(a.element.value[a.element.selectionStart-1])!==i.lastIndexOf(a.element.value[a.element.selectionStart-1])&&a.element.value[a.element.selectionStart-1].charCodeAt(0)===n||a.element.value[a.element.selectionStart-1].charCodeAt(0)!==n)&&(a.element.value=a.element.value.substring(0,e)+a.element.value.substring(t,a.element.value.length),a.element.setSelectionRange(e,e),isNaN(parseFloat(a.element.value[a.element.selectionStart-1])))&&0<a.element.selectionStart&&a.element.value.length&&a.preventHandler():isNaN(parseFloat(a.element.value[a.element.selectionStart-2]))&&1<a.element.selectionStart&&45!==a.element.value[a.element.selectionStart-2].charCodeAt(0)&&(i.indexOf(a.element.value[a.element.selectionStart-2])!==i.lastIndexOf(a.element.value[a.element.selectionStart-2])&&a.element.value[a.element.selectionStart-2].charCodeAt(0)===n||a.element.value[a.element.selectionStart-2].charCodeAt(0)!==n)&&(a.element.setSelectionRange(e,e),a.nextEle=a.element.value[a.element.selectionStart],a.cursorPosChanged=!0,a.preventHandler()),!0===a.cursorPosChanged&&a.element.value[a.element.selectionStart]===a.nextEle&&isNaN(parseFloat(a.element.value[a.element.selectionStart-1]))&&(a.element.setSelectionRange(a.element.selectionStart+1,a.element.selectionStart+1),a.cursorPosChanged=!1,a.nextEle=null),""===a.element.value.trim()&&a.element.setSelectionRange(0,0),0<a.element.selectionStart&&(45===a.element.value[a.element.selectionStart-1].charCodeAt(0)&&1<a.element.selectionStart&&(C.isNullOrUndefined(a.prevVal)||(a.element.value=a.prevVal),a.element.setSelectionRange(a.element.selectionStart,a.element.selectionStart)),a.element.value[a.element.selectionStart-1]===s)&&0===a.decimals&&a.validateDecimalOnType&&(a.element.value=a.element.value.substring(0,e)+a.element.value.substring(t,a.element.value.length)),a.prevVal=a.element.value)})},e.prototype.keyUpHandler=function(){var t,e;this.enabled&&!this.readonly&&(!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)||!C.Browser.isDevice||this.preventHandler(),t=null===(t=this.instance.getNumberParser({format:"n"})(this.element.value))||isNaN(t)?null:t,this.hiddenInput.value=t||0===t?t.toString():null,C.closest(this.element,"form"))&&(t=this.element.nextElementSibling,(e=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),t.dispatchEvent(e))},e.prototype.inputHandler=function(t){var e,i;this.enabled&&!this.readonly&&(e=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),(-1<navigator.userAgent.toLowerCase().indexOf("firefox")||e)&&C.Browser.isDevice&&this.preventHandler(),this.isAngular&&this.element.value!==C.getValue("decimal",C.getNumericObject(this.locale))&&this.element.value!==C.getValue("minusSign",C.getNumericObject(this.locale))&&(e=this.instance.getNumberParser({format:"n"})(this.element.value),e=isNaN(e)?null:e,this.localChange({value:e}),this.preventChange=!0),this.isVue)&&(e=this.instance.getNumberParser({format:"n"})(this.element.value),i=this.instance.getNumberParser({format:"n"})(this.elementPrevValue),t={event:t,value:null===(e=!new RegExp("[^0-9]+$").test(this.element.value)&&(-1===this.elementPrevValue.indexOf(".")&&-1===this.elementPrevValue.indexOf("-")||"0"!==this.element.value[this.element.value.length-1])?e:this.value)||isNaN(e)?null:e,previousValue:null===i||isNaN(i)?null:i},this.preventChange=!0,this.elementPrevValue=this.element.value,this.trigger("input",t))},e.prototype.keyDownHandler=function(t){if(!this.readonly)switch(t.keyCode){case 38:t.preventDefault(),this.action(kt,t);break;case 40:t.preventDefault(),this.action(Ot,t)}},e.prototype.performAction=function(t,e,i){null!==t&&!isNaN(t)||(t=0);i=this.correctRounding(t,e,i===kt?t+e:t-e);return this.strictMode?this.trimValue(i):i},e.prototype.correctRounding=function(t,e,i){var s=new RegExp("[,.](.*)"),n=s.test(t.toString()),a=s.test(e.toString());return n||a?(n=n?s.exec(t.toString())[0].length:0,t=a?s.exec(e.toString())[0].length:0,a=Math.max(n,t),this.roundValue(i,a)):i},e.prototype.roundValue=function(t,e){e=e||0;e=Math.pow(10,e);return t*=e,Math.round(t)/e},e.prototype.updateValue=function(t,e){e&&(this.isInteract=!0),null===t||isNaN(t)||this.decimals&&(t=this.roundNumber(t,this.decimals)),this.inputValue=t,this.changeValue(null===t||isNaN(t)?null:this.strictMode?this.trimValue(t):t),this.isDynamicChange||this.raiseChangeEvent(e)},e.prototype.updateCurrency=function(t,e){C.setValue(t,e,this.cultureInfo),this.updateValue(this.value)},e.prototype.changeValue=function(t){var e;t||0===t?(e=this.getNumberOfDecimals(t),this.setProperties({value:this.roundNumber(t,e)},!0)):this.setProperties({value:t=null},!0),this.modifyText(),this.strictMode||this.validateState()},e.prototype.modifyText=function(){var t,e;this.value||0===this.value?(t=this.formatNumber(),e=this.isFocused?t:this.instance.getNumberFormat(this.cultureInfo)(this.value),this.setElementValue(e),C.attributes(this.element,{"aria-valuenow":t}),C.isNullOrUndefined(this.hiddenInput)||(this.hiddenInput.value=this.value.toString(),null!==this.value&&this.serverDecimalSeparator&&(this.hiddenInput.value=this.hiddenInput.value.replace(".",this.serverDecimalSeparator)))):(this.setElementValue(""),this.element.removeAttribute("aria-valuenow"),this.hiddenInput.value=null)},e.prototype.setElementValue=function(t,e){o.Input.setValue(t,e||this.element,this.floatLabelType,this.showClearButton)},e.prototype.validateState=function(){this.isValidState=!0,!this.value&&0!==this.value||(this.isValidState=!(this.value>this.max||this.value<this.min)),this.checkErrorClass()},e.prototype.getNumberOfDecimals=function(t){var e=new RegExp("[eE][-+]?([0-9]+)"),i=t.toString(),t=(e.test(i)&&(e=e.exec(i),C.isNullOrUndefined(e)||(i=t.toFixed(Math.min(parseInt(e[1],10),20)))),i.split(".")[1]),e=t&&t.length?t.length:0;return e=null!==this.decimals?e<this.decimals?e:this.decimals:e},e.prototype.formatNumber=function(){var t=this.getNumberOfDecimals(this.value);return this.instance.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(this.value)},e.prototype.trimValue=function(t){return t>this.max?this.max:t<this.min?this.min:t},e.prototype.roundNumber=function(t,e){var e=e||0,i=t.toString().split("e"),i=(t=Math.round(Number(i[0]+"e"+(i[1]?Number(i[1])+e:e)))).toString().split("e");return t=Number(i[0]+"e"+(i[1]?Number(i[1])-e:-e)),Number(t.toFixed(e))},e.prototype.cancelEvent=function(t){return t.preventDefault(),!1},e.prototype.keyPressHandler=function(t){if(!this.enabled||this.readonly)return!0;if(!C.Browser.isDevice&&"11.0"===C.Browser.info.version&&13===t.keyCode)return e=this.instance.getNumberParser({format:"n"})(this.element.value),this.updateValue(e,t),!0;if(0===t.which||t.metaKey||t.ctrlKey||8===t.keyCode||13===t.keyCode)return!0;var e=String.fromCharCode(t.which),i=C.getValue("decimal",C.getNumericObject(this.locale)),s="NumpadDecimal"===t.code&&e!==i;s&&(e=i);i=(i=this.element.value).substring(0,this.element.selectionStart)+e+i.substring(this.element.selectionEnd);return this.numericRegex().test(i)?(s&&(e=this.element.selectionStart+1,this.element.value=i,this.element.setSelectionRange(e,e),t.preventDefault(),t.stopPropagation()),!0):(t.preventDefault(),t.stopPropagation(),!1)},e.prototype.numericRegex=function(){var t=C.getNumericObject(this.locale),t=C.getValue("decimal",t),e="*";return"."===t&&(t="\\"+t),0===this.decimals&&this.validateDecimalOnType?Lt:(this.decimals&&this.validateDecimalOnType&&(e="{0,"+this.decimals+"}"),new RegExp("^\\s*(-)?(((\\d+("+t+"\\d"+e+")?)|("+t+"\\d"+e+")))?$"))},e.prototype.mouseWheel=function(t){var e;t.preventDefault(),t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),0<e?this.action(kt,t):e<0&&this.action(Ot,t),this.cancelEvent(t)},e.prototype.focusHandler=function(t){var e,i=this;clearTimeout(Nt),this.focusEventArgs={event:t,value:this.value,container:this.container},this.trigger("focus",this.focusEventArgs),!this.enabled||this.readonly||(this.isFocused=!0,this.prevValue=this.value,!this.value&&0!==this.value||(e=this.formatNumber(),this.setElementValue(e),this.isPrevFocused)||(C.Browser.isDevice||"11.0"!==C.Browser.info.version?(t=C.Browser.isDevice&&C.Browser.isIos?600:0,Nt=setTimeout(function(){i.element.setSelectionRange(0,e.length)},t)):this.element.setSelectionRange(0,e.length)),C.Browser.isDevice)||C.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this)},e.prototype.focusOutHandler=function(t){var e,i,s,n=this;this.blurEventArgs={event:t,value:this.value,container:this.container},this.trigger("blur",this.blurEventArgs),this.enabled&&!this.readonly&&(this.isPrevFocused?(t.preventDefault(),C.Browser.isDevice&&(e=this.element.value,this.element.focus(),this.isPrevFocused=!1,i=this.element,setTimeout(function(){n.setElementValue(e,i)},200))):(this.isFocused=!1,this.element.value.length||this.setProperties({value:null},!0),t=this.instance.getNumberParser({format:"n"})(this.element.value),this.updateValue(t),C.Browser.isDevice||C.EventHandler.remove(this.element,"mousewheel DOMMouseScroll",this.mouseWheel)),C.closest(this.element,"form"))&&(t=this.element.nextElementSibling,(s=document.createEvent("FocusEvent")).initEvent("focusout",!1,!0),t.dispatchEvent(s))},e.prototype.mouseDownOnSpinner=function(t){var e,i,s=this;this.isFocused&&(this.isPrevFocused=!0,t.preventDefault()),this.getElementData(t)&&(this.getElementData(t),e=t.currentTarget,i=e.classList.contains(Tt)?kt:Ot,C.EventHandler.add(e,"mouseleave",this.mouseUpClick,this),this.timeOut=setInterval(function(){s.isCalled=!0,s.action(i,t)},150),C.EventHandler.add(document,"mouseup",this.mouseUpClick,this))},e.prototype.touchMoveOnSpinner=function(t){var e;("touchmove"===t.type?(e=t.touches).length&&document.elementFromPoint(e[0].pageX,e[0].pageY):document.elementFromPoint(t.clientX,t.clientY)).classList.contains(St)||clearInterval(this.timeOut)},e.prototype.mouseUpOnSpinner=function(t){var e,i;this.prevValue=this.value,this.isPrevFocused&&(this.element.focus(),C.Browser.isDevice||(this.isPrevFocused=!1)),C.Browser.isDevice||t.preventDefault(),this.getElementData(t)&&(i=(e=t.currentTarget).classList.contains(Tt)?kt:Ot,C.EventHandler.remove(e,"mouseleave",this.mouseUpClick),this.isCalled||this.action(i,t),this.isCalled=!1,C.EventHandler.remove(document,"mouseup",this.mouseUpClick),C.closest(this.element,"form"))&&(e=this.element.nextElementSibling,(i=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(i))},e.prototype.getElementData=function(t){return!(t.which&&3===t.which||t.button&&2===t.button||!this.enabled||this.readonly||(clearInterval(this.timeOut),0))},e.prototype.floatLabelTypeUpdate=function(){o.Input.removeFloating(this.inputWrapper);var t=this.hiddenInput;this.hiddenInput.remove(),o.Input.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement),this.container.insertBefore(t,this.container.childNodes[1])},e.prototype.mouseUpClick=function(t){t.stopPropagation(),clearInterval(this.timeOut),this.isCalled=!1,this.spinUp&&C.EventHandler.remove(this.spinUp,"mouseleave",this.mouseUpClick),this.spinDown&&C.EventHandler.remove(this.spinDown,"mouseleave",this.mouseUpClick)},e.prototype.increment=function(t){void 0===t&&(t=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,t,kt)),this.raiseChangeEvent()},e.prototype.decrement=function(t){void 0===t&&(t=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,t,Ot)),this.raiseChangeEvent()},e.prototype.destroy=function(){this.unwireEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),C.detach(this.hiddenInput),this.showSpinButton&&(this.unwireSpinBtnEvents(),C.detach(this.spinUp),C.detach(this.spinDown));for(var t=["aria-labelledby","role","autocomplete","aria-readonly","aria-disabled","autocapitalize","spellcheck","aria-autocomplete","tabindex","aria-valuemin","aria-valuemax","aria-valuenow","aria-invalid"],e=0;e<t.length;e++)this.element.removeAttribute(t[e]);this.element.classList.remove("e-input"),this.container.insertAdjacentElement("afterend",this.element),C.detach(this.container),this.spinUp=null,this.spinDown=null,this.container=null,this.hiddenInput=null,this.changeEventArgs=null,this.blurEventArgs=null,this.focusEventArgs=null,this.inputWrapper=null,o.Input.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),Et.prototype.destroy.call(this)},e.prototype.getText=function(){return this.element.value},e.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),C.addClass([this.container],[wt]))},e.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),C.removeClass([this.container],[wt]))},e.prototype.getPersistData=function(){return this.addOnPersist(["value"])},e.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i];switch(n){case"width":this.setElementWidth(t.width),o.Input.calculateWidth(this.element,this.container);break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"enabled":o.Input.setEnabled(t.enabled,this.element),this.bindClearEvent();break;case"enableRtl":o.Input.setEnableRtl(t.enableRtl,[this.container]);break;case"readonly":o.Input.setReadonly(t.readonly,this.element),this.readonly?C.attributes(this.element,{"aria-readonly":"true"}):this.element.removeAttribute("aria-readonly");break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.updateDataAttribute(!0),this.checkAttributes(!0),o.Input.validateInputType(this.container,this.element);break;case"placeholder":o.Input.setPlaceholder(t.placeholder,this.element),o.Input.calculateWidth(this.element,this.container);break;case"step":this.step=t.step,this.validateStep();break;case"showSpinButton":this.updateSpinButton(t);break;case"showClearButton":this.updateClearButton(t);break;case"floatLabelType":this.floatLabelType=t.floatLabelType,this.floatLabelTypeUpdate();break;case"value":this.isDynamicChange=(this.isAngular||this.isVue)&&this.preventChange,this.updateValue(t.value),this.isDynamicChange&&(this.preventChange=!1,this.isDynamicChange=!1);break;case"min":case"max":C.setValue(n,C.getValue(n,t),this),this.validateMinMax(),this.updateValue(this.value);break;case"strictMode":this.strictMode=t.strictMode,this.updateValue(this.value),this.validateState();break;case"locale":this.initCultureFunc(),this.l10n.setLocale(this.locale),this.setSpinButton(),this.updatePlaceholder(),o.Input.setPlaceholder(this.placeholder,this.element),this.updateValue(this.value);break;case"currency":var a=C.getValue(n,t);this.setProperties({currencyCode:a},!0),this.updateCurrency(n,a);break;case"currencyCode":a=C.getValue(n,t);this.setProperties({currency:a},!0),this.updateCurrency("currency",a);break;case"format":C.setValue(n,C.getValue(n,t),this),this.initCultureInfo(),this.updateValue(this.value);break;case"decimals":this.decimals=t.decimals,this.updateValue(this.value)}}},e.prototype.updateClearButton=function(t){o.Input.setClearButton(t.showClearButton,this.element,this.inputWrapper,void 0,this.createElement),this.bindClearEvent()},e.prototype.updateSpinButton=function(t){t.showSpinButton?this.spinBtnCreation():(C.detach(this.spinUp),C.detach(this.spinDown))},e.prototype.getModuleName=function(){return"numerictextbox"},t([C.Property("")],e.prototype,"cssClass",void 0),t([C.Property(null)],e.prototype,"value",void 0),t([C.Property(-Number.MAX_VALUE)],e.prototype,"min",void 0),t([C.Property(Number.MAX_VALUE)],e.prototype,"max",void 0),t([C.Property(1)],e.prototype,"step",void 0),t([C.Property(null)],e.prototype,"width",void 0),t([C.Property(null)],e.prototype,"placeholder",void 0),t([C.Property({})],e.prototype,"htmlAttributes",void 0),t([C.Property(!0)],e.prototype,"showSpinButton",void 0),t([C.Property(!1)],e.prototype,"readonly",void 0),t([C.Property(!0)],e.prototype,"enabled",void 0),t([C.Property(!1)],e.prototype,"showClearButton",void 0),t([C.Property(!1)],e.prototype,"enablePersistence",void 0),t([C.Property("n2")],e.prototype,"format",void 0),t([C.Property(null)],e.prototype,"decimals",void 0),t([C.Property(null)],e.prototype,"currency",void 0),t([C.Property(null)],e.prototype,"currencyCode",void 0),t([C.Property(!0)],e.prototype,"strictMode",void 0),t([C.Property(!1)],e.prototype,"validateDecimalOnType",void 0),t([C.Property("Never")],e.prototype,"floatLabelType",void 0),t([C.Event()],e.prototype,"created",void 0),t([C.Event()],e.prototype,"destroyed",void 0),t([C.Event()],e.prototype,"change",void 0),t([C.Event()],e.prototype,"focus",void 0),t([C.Event()],e.prototype,"blur",void 0),t([C.NotifyPropertyChanges],e));function e(t,e){e=Et.call(this,t,e)||this;return e.preventChange=!1,e.isDynamicChange=!1,e.numericOptions=t,e}var Bt="e-error",Ut="e-input-group",Rt="e-float-input",It="e-utility-mask",Vt="e-label-top",Ft="e-label-bottom",Mt={0:"[0-9]",9:"[0-9 ]","#":"[0-9 +-]",L:"[A-Za-z]","?":"[A-Za-z ]","&":"[^ ]+",C:"[^]+",A:"[A-Za-z0-9]",a:"[A-Za-z0-9 ]"};function Dt(){if(C.attributes(this.element,{role:"textbox",autocomplete:"off",autocapitalize:"off",spellcheck:"false","aria-live":"assertive"}),this.mask){for(var t=this.mask.split("]"),e=0;e<t.length;e++)if("\\"===t[e][t[e].length-1]){t[e]=t[e]+"]";for(var i=t[e].split("["),s=0;s<i.length;s++)"\\"===i[s][i[s].length-1]&&(i[s]=i[s]+"["),Yt.call(this,i[s])}else if(1<(i=t[e].split("[")).length)for(var n=!1,s=0;s<i.length;s++)"\\"===i[s]?(this.customRegExpCollec.push("["),this.hiddenMask+=i[s]+"["):""===i[s]?n=!0:""!==i[s]&&n||s===i.length-1?(this.customRegExpCollec.push("["+i[s]+"]"),this.hiddenMask+=this.promptChar,n=!1):Yt.call(this,i[s]);else Yt.call(this,i[0]);if(this.escapeMaskValue=this.hiddenMask,this.promptMask=this.hiddenMask.replace(/[09?LCAa#&]/g,this.promptChar),!C.isNullOrUndefined(this.customCharacters))for(e=0;e<this.promptMask.length;e++)C.isNullOrUndefined(this.customCharacters[this.promptMask[e]])||(this.promptMask=this.promptMask.replace(new RegExp(this.promptMask[e],"g"),this.promptChar));if(this.hiddenMask.match(new RegExp(/\\/)))for(e=0;e<this.hiddenMask.length;e++){var a,s=1<=e?e:0;s-=a=this.hiddenMask.length-this.promptMask.length,0<e&&"\\"!==this.hiddenMask[e-1]&&(">"===this.hiddenMask[e]||"<"===this.hiddenMask[e]||"|"===this.hiddenMask[e])&&(this.promptMask=this.promptMask.substring(0,s)+this.promptMask.substring(e+1-a,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,s)+this.escapeMaskValue.substring(e+1-a,this.escapeMaskValue.length)),"\\"===this.hiddenMask[e]&&(this.promptMask=this.promptMask.substring(0,s)+this.hiddenMask[e+1]+this.promptMask.substring(e+2-a,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,s)+this.escapeMaskValue[e+1]+this.escapeMaskValue.substring(e+2-a,this.escapeMaskValue.length))}else this.promptMask=this.promptMask.replace(/[>|<]/g,""),this.escapeMaskValue=this.hiddenMask.replace(/[>|<]/g,"");C.attributes(this.element,{"aria-invalid":"false"})}}function zt(){b.call(this,this.promptMask),ye.call(this,this.value)}function Wt(){C.EventHandler.add(this.element,"keydown",ae,this),C.EventHandler.add(this.element,"keypress",he,this),C.EventHandler.add(this.element,"keyup",pe,this),C.EventHandler.add(this.element,"input",ne,this),C.EventHandler.add(this.element,"focus",Jt,this),C.EventHandler.add(this.element,"blur",te,this),C.EventHandler.add(this.element,"paste",ee,this),C.EventHandler.add(this.element,"cut",ie,this),C.EventHandler.add(this.element,"drop",se,this),C.EventHandler.add(this.element,"mousedown",Zt,this),C.EventHandler.add(this.element,"mouseup",Gt,this),this.enabled&&(jt.call(this),this.formElement)&&C.EventHandler.add(this.formElement,"reset",Xt,this)}function qt(){C.EventHandler.remove(this.element,"keydown",ae),C.EventHandler.remove(this.element,"keypress",he),C.EventHandler.remove(this.element,"keyup",pe),C.EventHandler.remove(this.element,"input",ne),C.EventHandler.remove(this.element,"focus",Jt),C.EventHandler.remove(this.element,"blur",te),C.EventHandler.remove(this.element,"paste",ee),C.EventHandler.remove(this.element,"cut",ie),C.EventHandler.remove(this.element,"drop",se),C.EventHandler.remove(this.element,"mousedown",Zt),C.EventHandler.remove(this.element,"mouseup",Gt),this.formElement&&C.EventHandler.remove(this.formElement,"reset",Xt)}function jt(){this.showClearButton&&C.EventHandler.add(this.inputObj.clearButton,"mousedown touchstart",_t,this)}function _t(t){t.preventDefault(),this.inputObj.clearButton.classList.contains("e-clear-icon-hide")&&!this.inputObj.container.classList.contains("e-static-clear")||(function(t){var e=this.element.value;b.call(this,this.promptMask),this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),ue.call(this,t,e),this.element.setSelectionRange(0,0)}.call(this,t),this.value="")}function Xt(){"EJS-MASKEDTEXTBOX"===this.element.tagName?b.call(this,this.promptMask):this.value=this.initInputValue}function Kt(t){return t.value}function p(t,e){var i="",s=0,n=!1,a=!C.isNullOrUndefined(e)||C.isNullOrUndefined(t)||C.isNullOrUndefined(this)?e:t.value;if(a!==this.promptMask)for(var l=0;l<this.customRegExpCollec.length;l++)n=n&&!1,">"!==this.customRegExpCollec[s]&&"<"!==this.customRegExpCollec[s]&&"|"!==this.customRegExpCollec[s]&&"\\"!==this.customRegExpCollec[s]||(--l,n=!0),n||a[l]!==this.promptChar&&!C.isNullOrUndefined(this.customRegExpCollec[s])&&(this._callPasteHandler||!C.isNullOrUndefined(this.regExpCollec[this.customRegExpCollec[s]])&&!this.maskedRegExp.includes(this.customRegExpCollec[s])||2<this.customRegExpCollec[s].length&&"["===this.customRegExpCollec[s][0]&&"]"===this.customRegExpCollec[s][this.customRegExpCollec[s].length-1]||!C.isNullOrUndefined(this.customCharacters)&&!C.isNullOrUndefined(this.customCharacters[this.customRegExpCollec[s]]))&&""!==a&&(i+=a[l]),++s;return i=null===this.mask||""===this.mask&&void 0!==this.value?a:i}function Yt(t){for(var e=0;e<t.length;e++)this.hiddenMask+=t[e],"\\"!==t[e]?this.customRegExpCollec.push(t[e]):"\\"!==t[e]||C.isNullOrUndefined(this.regExpCollec[t[e+1]])||this.maskedRegExp.push(t[e+1])}function Zt(){this.isClicked=!0}function Gt(){this.isClicked=!1}function Jt(t){var i=this,s=this.element,e=0,n=p.call(this,s),a=!1,l=!1,r={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:C.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd};if(this.isClicked||$t.call(this,r,s),this.mask&&(null!==n&&""!==n||"Always"===this.floatLabelType||null===this.placeholder||""===this.placeholder||(s.value=this.promptMask),setTimeout(function(){if(s.selectionStart===i.promptMask.length||s.value[s.selectionStart]===i.promptChar)a=!0;else for(var t=s.selectionStart;t<i.promptMask.length;t++){if(s.value[t]===i.promptChar){a=!0;break}if(s.value[t]!==i.promptMask[t]){a=!1;break}}}),setTimeout(function(){var t=s.selectionStart-1;if(t==i.promptMask.length-1||s.value[t]===i.promptChar)l=!0;else for(var e=t;0<=e;e--){if(s.value[e]===i.promptChar){l=!0;break}if(s.value[e]!==i.promptMask[e]){l=!1;break}}}),this.isClicked||"Always"!==this.floatLabelType&&(null===n||""===n)&&null!==this.placeholder&&""!==this.placeholder)){for(e=0;e<this.promptMask.length;e++)if(s.value[e]===this.promptChar){setTimeout(function(){(a||l)&&(s.selectionEnd=e,s.selectionStart=e),r={selectionStart:s.selectionStart,event:t,value:i.value,maskedValue:s.value,container:C.isNullOrUndefined(i.inputObj)?i.inputObj:i.inputObj.container,selectionEnd:s.selectionEnd},$t.call(i,r,s)},110);break}C.isNullOrUndefined(s.value.match(Qt(this.promptChar)))&&(r={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:C.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd},$t.call(this,r,s)),this.isClicked=!1}}function $t(t,e){this.trigger("focus",t,function(t){e.selectionStart=t.selectionStart,e.selectionEnd=t.selectionEnd})}function Qt(t){return C.isNullOrUndefined(t)?t:t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function te(t){this.blurEventArgs={event:t,value:this.value,maskedValue:this.element.value,container:C.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container},this.trigger("blur",this.blurEventArgs),this.mask&&(this.isFocus=!1,this.placeholder)&&this.element.value===this.promptMask&&"Always"!==this.floatLabelType&&(b.call(this,""),t=this.element.parentNode.querySelector(".e-float-text"),"Auto"===this.floatLabelType)&&!C.isNullOrUndefined(t)&&t.classList.contains(Vt)&&C.removeClass([t],Vt)}function ee(s){var n,a,l,r=this;this.mask&&!this.readonly&&(n=this.element.selectionStart,a=this.element.selectionEnd,l=this.element.value,b.call(this,""),this._callPasteHandler=!0,setTimeout(function(){var t=r.element.value.replace(/ /g,""),e=(0<r.redoCollec.length&&r.redoCollec[0].value===r.element.value&&(t=p.call(r,r.element)),b.call(r,l),r.element.selectionStart=n,r.element.selectionEnd=a,0);for(r.maskKeyPress=!0;ce.call(r,t[e],!1,null),++e<t.length;);if(r.maskKeyPress=!1,r._callPasteHandler=!1,r.element.value===l){var i=0;for(r.maskKeyPress=!0;ce.call(r,t[i],!1,null),++i<t.length;);r.maskKeyPress=!1}else ue.call(r,s,l)},1))}function ie(t){var e,i,s,n,a=this;this.mask&&!this.readonly&&(e=this.element.value,i=this.element.selectionStart,s=this.element.selectionEnd,this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),n=this.element.value.substring(0,i)+this.promptMask.substring(i,s)+this.element.value.substring(s),setTimeout(function(){b.call(a,n),a.element.selectionStart=a.element.selectionEnd=i,a.element.value!==e&&ue.call(a,t,null)},0))}function se(t){t.preventDefault()}function ne(t){if(!0!==C.Browser.isIE||""!==this.element.value||"Never"!==this.floatLabelType)if(C.extend(t,{ctrlKey:!1,keyCode:229}),this.mask){if(""===this.element.value&&this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),1===this.element.value.length&&(this.element.value=this.element.value+this.promptMask,this.element.setSelectionRange(1,1)),this._callPasteHandler||oe.call(this,t),this.element.value.length>this.promptMask.length){for(var e=this.element.selectionStart,i=this.element.value.length-this.promptMask.length,s=this.element.value.substring(e-i,e),n=(this.maskKeyPress=!1,0);ce.call(this,s[n],t.ctrlKey,t),++n<s.length;);this.element.value!==this.preEleVal&&ue.call(this,t,null)}i=p.call(this,this.element);this.prevValue=i,""===(this.value=i)&&(b.call(this,this.promptMask),this.element.setSelectionRange(0,0))}}function ae(t){var e,i;this.mask&&!this.readonly&&(229!==t.keyCode&&(!t.ctrlKey||89!==t.keyCode&&90!==t.keyCode||t.preventDefault(),oe.call(this,t)),e=this.element.value,!t.ctrlKey||89!==t.keyCode&&90!==t.keyCode||(i=void 0,90===t.keyCode&&0<this.undoCollec.length&&e!==this.undoCollec[this.undoCollec.length-1].value?(i=this.undoCollec[this.undoCollec.length-1],this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),b.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.undoCollec.splice(this.undoCollec.length-1,1)):89===t.keyCode&&0<this.redoCollec.length&&e!==this.redoCollec[0].value&&(i=this.redoCollec[0],this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),b.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.redoCollec.splice(0,1))))}function le(){var t,e=this.element.selectionStart,i=this.element.selectionEnd;0<this.redoCollec.length?(t=this.redoCollec[0],b.call(this,t.value),t.startIndex-e==1?(this.element.selectionStart=t.startIndex,this.element.selectionEnd=t.endIndex):(this.element.selectionStart=e+1,this.element.selectionEnd=i+1)):(b.call(this,this.promptMask),this.element.selectionStart=this.element.selectionEnd=e)}function re(t,e,i){return"input"===i.type&&(t=!1,e=this.element.value,b.call(this,this.promptMask),ye.call(this,e)),t}function oe(t){var e,i=!1,s=!1,n=(this.element.value.length<this.promptMask.length&&(e=this.element.value,i=re.call(this,i=!0,e,t),le.call(this)),this.element.value.length>=this.promptMask.length&&"input"===t.type&&(i=re.call(this,i,e,t)),this.element.selectionStart),a=this.element.selectionEnd,l=this.element.selectionStart,r=this.element.selectionEnd,o=this.hiddenMask.replace(/[>|\\<]/g,""),h=o[l-1],u=this.element.selectionEnd;if(i||8===t.keyCode||46===t.keyCode){this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:r});var p=!1,d=this.element.value;if(0<l||(8===t.keyCode||46===t.keyCode)&&l<this.element.value.length&&this.element.selectionEnd-l!==this.element.value.length){var c=l;l!==r?(l=r,46===t.keyCode&&(p=!0)):46===t.keyCode?++c:--c;for(var m=l;8===t.keyCode||i||p?c<m:m<c;8===t.keyCode||i||p?m--:m++)for(var v=l;8===t.keyCode||i||p?0<v:v<this.element.value.length;8===t.keyCode||i||p?v--:v++){var f,g,y=void 0;(8===t.keyCode||p)&&(n!==a&&n!==l||n===a)||i?(h=o[v-1],y=l-1):(h=o[v],y=l,++l),this.element.value[y];if(C.isNullOrUndefined(this.regExpCollec[""+h])&&!C.isNullOrUndefined(this.customCharacters)&&C.isNullOrUndefined(this.customCharacters[""+h])&&this.hiddenMask[y]!==this.promptChar&&"["!==this.customRegExpCollec[y][0]&&"]"!==this.customRegExpCollec[y][this.customRegExpCollec[y].length-1]||this.promptMask[y]!==this.promptChar&&C.isNullOrUndefined(this.customCharacters)?(this.element.selectionStart=this.element.selectionEnd=y,t.preventDefault(),46!==t.keyCode||p||++this.element.selectionStart):(f=this.element.value,g=this.promptChar,g=f.substring(0,y)+g+f.substring(l,f.length),b.call(this,g),t.preventDefault(),46!==t.keyCode||p||y++,this.element.selectionStart=this.element.selectionEnd=y,s=!0),l=this.element.selectionStart,!s&&8===t.keyCode||p||!s&&46!==t.keyCode?y=l-1:(y=l,s=!1),f=this.element.value[y],n!==a&&this.element.selectionStart===n||this.promptMask[y]===this.promptChar||f!==this.promptMask[y]&&this.promptMask[y]!==this.promptChar&&!C.isNullOrUndefined(this.customCharacters))break}}46===t.keyCode&&p&&s&&(this.element.selectionStart=this.element.selectionEnd=u),0===this.element.selectionStart&&this.element.selectionEnd===this.element.value.length&&(b.call(this,this.promptMask),t.preventDefault(),this.element.selectionStart=this.element.selectionEnd=l),this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),this.element.value!==d&&ue.call(this,t,e)}}function he(t){var e,i;this.mask&&!this.readonly&&(e=this.element.value,(!t.ctrlKey&&!t.metaKey||(t.ctrlKey||t.metaKey)&&"KeyA"!==t.code&&"KeyY"!==t.code&&"KeyZ"!==t.code&&"KeyX"!==t.code&&"KeyC"!==t.code&&"KeyV"!==t.code)&&(this.maskKeyPress=!0,(i="Spacebar"===(i=t.key)?String.fromCharCode(t.keyCode):i)?1===i.length&&(ce.call(this,i,t.ctrlKey,t),t.preventDefault()):(this.isIosInvalid=!0,ce.call(this,String.fromCharCode(t.keyCode),t.ctrlKey,t),t.preventDefault(),this.isIosInvalid=!1),32===t.keyCode)&&" "===i&&" "===this.promptChar&&(this.element.selectionStart=this.element.selectionEnd=this.element.selectionStart-i.length),this.element.value!==e)&&ue.call(this,t,e)}function ue(t,e){var i,s=this.isProtectedOnChange;C.isNullOrUndefined(this.changeEventArgs)||this.isInitial||(this.changeEventArgs={value:this.element.value,maskedValue:this.element.value,isInteraction:!(i={}),isInteracted:!1},this.mask&&(this.changeEventArgs.value=p.call(this,this.element)),C.isNullOrUndefined(t)||(this.changeEventArgs.isInteracted=!0,this.changeEventArgs.isInteraction=!0,this.changeEventArgs.event=t),this.isProtectedOnChange=!0,this.value=this.changeEventArgs.value,this.isProtectedOnChange=s,C.merge(i,this.changeEventArgs),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",i)),this.preEleVal=this.element.value,this.prevValue=p.call(this,this.element)}function pe(t){var e,i,s,n,a,l,r,o;this.mask&&!this.readonly?(s=void 0,this.maskKeyPress||229!==t.keyCode?ge.call(this):(a=void 0,1===this.element.value.length&&(this.element.value=this.element.value+this.promptMask,this.element.setSelectionRange(1,1)),this.element.value.length>this.promptMask.length&&(i=this.element.selectionStart,e=this.element.value.length-this.promptMask.length,i=this.element.value.substring(i-e,i),0<this.undoCollec.length?(s=this.undoCollec[this.undoCollec.length-1],n=this.element.selectionStart,a=s.value,r=s.value.substring(n-e,n),s=this.redoCollec[0],i=i.trim(),(l=C.Browser.isAndroid&&""===i)||r===i||s.value.substring(n-e,n)===i?l&&ve.call(this,t,n-1,this.element.selectionEnd-1,i,t.ctrlKey,!1):ce.call(this,i,t.ctrlKey,t)):(a=this.promptMask,ce.call(this,i,t.ctrlKey,t)),this.maskKeyPress=!1,ue.call(this,t,a))),r=p.call(this,this.element),(0!==this.element.selectionStart||this.promptMask!==this.element.value||""!==r||""===r&&this.value!==r)&&(this.prevValue=r,this.value=r)):ue.call(this,t),0===this.element.selectionStart&&0===this.element.selectionEnd&&(o=this.element,setTimeout(function(){o.setSelectionRange(0,0)},0))}function de(t){this.maskKeyPress||!function(t){var e;1<t.length&&this.promptMask.length+t.length<this.element.value.length&&(e=this.redoCollec[0].value.substring(0,this.redoCollec[0].startIndex)+t+this.redoCollec[0].value.substring(this.redoCollec[0].startIndex,this.redoCollec[0].value.length),b.call(this,e),this.element.selectionStart=this.element.selectionEnd=this.redoCollec[0].startIndex+t.length),this.element.selectionStart=this.element.selectionStart-t.length,this.element.selectionEnd=this.element.selectionEnd-t.length}.call(this,t)}function ce(t,e,i){if(de.call(this,t),!C.isNullOrUndefined(this)&&!C.isNullOrUndefined(t))for(var s,n=p=this.element.selectionStart,a=!1,l=this.element.value,r=!1,o=!1,h=0;h<t.length;h++){var u=t[h],p=this.element.selectionStart;if(this.maskKeyPress||n!==p||(p+=h),!this.maskKeyPress||p<this.promptMask.length){for(var d,c,m=p;m<this.promptMask.length;m++){var v=this.escapeMaskValue[p];"\\"===this.hiddenMask[p]&&this.hiddenMask[p+1]===t&&(o=!0),(C.isNullOrUndefined(this.regExpCollec[""+v])&&(C.isNullOrUndefined(this.customCharacters)||!C.isNullOrUndefined(this.customCharacters)&&C.isNullOrUndefined(this.customCharacters[""+v]))&&this.hiddenMask[p]!==this.promptChar&&"["!==this.customRegExpCollec[p][0]&&"]"!==this.customRegExpCollec[p][this.customRegExpCollec[p].length-1]||this.promptMask[p]!==this.promptChar&&C.isNullOrUndefined(this.customCharacters)||this.promptChar===v&&this.escapeMaskValue===this.mask)&&(this.element.selectionStart=this.element.selectionEnd=p+1,p=this.element.selectionStart,v=this.hiddenMask[p])}if(C.isNullOrUndefined(this.customCharacters)||C.isNullOrUndefined(this.customCharacters[""+v]))(!C.isNullOrUndefined(this.regExpCollec[""+v])&&u.match(new RegExp(this.regExpCollec[""+v]))&&this.promptMask[p]===this.promptChar||this.promptMask[p]===this.promptChar&&"["===this.customRegExpCollec[p][0]&&"]"===this.customRegExpCollec[p][this.customRegExpCollec[p].length-1]&&u.match(new RegExp(this.customRegExpCollec[p])))&&(a=!0);else for(var f=this.customCharacters[""+v].split(","),m=0;m<f.length;m++)if(u.match(new RegExp("["+f[m]+"]"))){a=!0;break}(!this.maskKeyPress||p<this.hiddenMask.length)&&a?(0===h&&(this.maskKeyPress?this.undoCollec.push({value:l,startIndex:p,endIndex:p}):(d=this.element.selectionStart,c=this.element.selectionEnd,0<this.redoCollec.length?(s=this.redoCollec[0].value,b.call(this,s),this.undoCollec.push(this.redoCollec[0])):(this.undoCollec.push({value:this.promptMask,startIndex:p,endIndex:p}),s=this.promptMask,b.call(this,s)),this.element.selectionStart=d,this.element.selectionEnd=c)),p=this.element.selectionStart,me.call(this,i,p,u,s,o),r=!0,h===t.length-1&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),a=!1):(p=this.element.selectionStart,ve.call(this,i,p,n,t,e,r)),h!==t.length-1||a||(!C.Browser.isAndroid||C.Browser.isAndroid&&p<this.promptMask.length)&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd})}else 1!==t.length||e||C.isNullOrUndefined(i)||fe.call(this)}}function me(t,e,i,s,n){this.hiddenMask.length>this.promptMask.length&&(i=function(t,e){var i,s,n=e,a=0;for(s=0;s<this.hiddenMask.length;s++)if("\\"===this.hiddenMask[s]&&(i=n.substring(0,s)+"\\"+n.substring(s,n.length)),">"!==this.hiddenMask[s]&&"<"!==this.hiddenMask[s]&&"|"!==this.hiddenMask[s]||(this.hiddenMask[s]!==n[s]&&(i=n.substring(0,s)+this.hiddenMask[s]+n.substring(s,n.length)),++a),i){if(i[s]===this.promptChar&&s>this.element.selectionStart||this.element.value.indexOf(this.promptChar)<0&&this.element.selectionStart+a===s){a=0;break}n=i}for(;0<=s&&i;){if(0===s||"\\"!==i[s-1]){if(">"===i[s]){t=t.toUpperCase();break}if("<"===i[s]){t=t.toLowerCase();break}if("|"===i[s])break}--s}return t}.call(this,i,this.element.value)),n||(i=(n=this.element.value).substring(0,e)+i+n.substring(e+1,n.length),b.call(this,i),this.element.selectionStart=this.element.selectionEnd=e+1)}function ve(t,e,i,s,n,a){var l;this.maskKeyPress||(l=this.element.value,e>=this.promptMask.length?b.call(this,l.substring(0,e)):(i===e?b.call(this,l.substring(0,e)+l.substring(e+1,l.length)):this.promptMask.length===this.element.value.length?b.call(this,l.substring(0,e)+l.substring(e,l.length)):b.call(this,l.substring(0,i)+l.substring(i+1,l.length)),this.element.selectionStart=this.element.selectionEnd=a||this.element.value[i]!==this.promptChar?e:i),fe.call(this)),1!==s.length||n||C.isNullOrUndefined(t)||fe.call(this)}function fe(){var t=this,e=this.element.parentNode,i=200;e.classList.contains(Ut)||e.classList.contains(Rt)?C.addClass([e],Bt):C.addClass([this.element],Bt),!0===this.isIosInvalid&&(i=400),C.attributes(this.element,{"aria-invalid":"true"}),setTimeout(function(){t.maskKeyPress||ge.call(t)},i)}function ge(){var t=this.element.parentNode;C.isNullOrUndefined(t)||C.removeClass([t],Bt),C.removeClass([this.element],Bt),C.attributes(this.element,{"aria-invalid":"false"})}function ye(t){if(this.mask&&void 0!==t&&(void 0===this.prevValue||this.prevValue!==t)){if(this.maskKeyPress=!0,b.call(this,this.promptMask),""===t||null===t&&"Never"===this.floatLabelType&&this.placeholder||(this.element.selectionStart=0,this.element.selectionEnd=0),null!==t)for(var e=0;e<t.length;e++)ce.call(this,t[e],!1,null);var i=p.call(this,this.element),i=(this.prevValue=i,this.value=i,ue.call(this,null,null),this.maskKeyPress=!1,this.element.parentNode.querySelector(".e-float-text"));this.element.value===this.promptMask&&"Auto"===this.floatLabelType&&this.placeholder&&!C.isNullOrUndefined(i)&&i.classList.contains(Vt)&&!this.isFocus&&(C.removeClass([i],Vt),C.addClass([i],Ft),b.call(this,""))}(null===this.mask||""===this.mask&&void 0!==this.value)&&b.call(this,this.value)}function b(t,e){!this.isFocus&&"Auto"===this.floatLabelType&&this.placeholder&&C.isNullOrUndefined(this.value)&&(t="");var i=p.call(this,e||this.element,t);null===i||""===i?(o.Input.setValue(t,e||this.element,this.floatLabelType,!1),this.showClearButton&&this.inputObj.clearButton.classList.add("e-clear-icon-hide")):o.Input.setValue(t,e||this.element,this.floatLabelType,this.showClearButton)}function be(t){C.addClass([t.element],It);t={element:t.element,mask:t.mask,promptMask:"",hiddenMask:"",escapeMaskValue:"",promptChar:t.promptChar?1<t.promptChar.length?t.promptChar=t.promptChar[0]:t.promptChar:"_",value:t.value||null,regExpCollec:Mt,customRegExpCollec:[],customCharacters:t.customCharacters,undoCollec:[],redoCollec:[],maskKeyPress:!1,prevValue:""};return Dt.call(t),t}function Ce(t){var e;return e=!C.isNullOrUndefined(t)&&t.element.classList.contains(It)?be(t):e}function Ee(){}xe=function(t,e){return(xe=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var xe,Se,xt=function(t,e){function i(){this.constructor=t}xe(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},t=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},Te="e-input-focus",Pe=["title","style","class"],xt=(Se=C.Component,xt(i,Se),i.prototype.getModuleName=function(){return"maskedtextbox"},i.prototype.preRender=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.regExpCollec=Mt,this.customRegExpCollec=[],this.maskedRegExp=[],this.undoCollec=[],this.redoCollec=[],this.changeEventArgs={},this.focusEventArgs={},this.blurEventArgs={},this.maskKeyPress=!1,this.isFocus=!1,this.isInitial=!1,this.isIosInvalid=!1;var t=C.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),C.removeClass([this.cloneElement],["e-control","e-maskedtextbox","e-lib"]),this.angularTagName=null,this.formElement=C.closest(this.element,"form"),"EJS-MASKEDTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;for(var e=this.createElement("input"),i=0;i<this.element.attributes.length;i++)e.setAttribute(this.element.attributes[i].nodeName,this.element.attributes[i].nodeValue),e.innerHTML=this.element.innerHTML;this.element.hasAttribute("id")&&this.element.removeAttribute("id"),this.element.hasAttribute("name")&&this.element.removeAttribute("name"),this.element.classList.remove("e-control","e-maskedtextbox"),this.element.classList.add("e-mask-container"),this.element.appendChild(e),this.element=e,C.setValue("ej2_instances",t,this.element)}this.updateHTMLAttrToElement(),this.checkHtmlAttributes(!1),this.formElement&&(this.initInputValue=this.value)},i.prototype.getPersistData=function(){return this.addOnPersist(["value"])},i.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&("Never"===this.floatLabelType&&C.addClass([this.element],"e-input"),this.createWrapper(),this.updateHTMLAttrToWrapper(),""===this.element.name&&this.element.setAttribute("name",this.element.id),this.isInitial=!0,this.resetMaskedTextBox(),this.isInitial=!1,this.setMaskPlaceholder(!0,!1),this.setWidth(this.width),this.preEleVal=this.element.value,C.Browser.isDevice||"11.0"!==C.Browser.info.version&&"edge"!==C.Browser.info.name||this.element.blur(),C.Browser.isDevice&&C.Browser.isIos&&this.element.blur(),(this.element.getAttribute("value")||this.value)&&this.element.setAttribute("value",this.element.value),!C.isNullOrUndefined(C.closest(this.element,"fieldset"))&&C.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","maskedtextbox"),this.renderComplete())},i.prototype.updateHTMLAttrToElement=function(){if(!C.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i=e[t];Pe.indexOf(i)<0&&this.element.setAttribute(i,this.htmlAttributes[""+i])}},i.prototype.updateCssClass=function(t,e){o.Input.setCssClass(this.getValidClassList(t),[this.inputObj.container],this.getValidClassList(e))},i.prototype.getValidClassList=function(t){var e=t;return e=C.isNullOrUndefined(t)||""===t?e:t.replace(/\s+/g," ").trim()},i.prototype.updateHTMLAttrToWrapper=function(){if(!C.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i,s=e[t];-1<Pe.indexOf(s)&&("class"===s?""!==(i=this.htmlAttributes[""+s].replace(/\s+/g," ").trim())&&C.addClass([this.inputObj.container],i.split(" ")):"style"===s?(i=this.inputObj.container.getAttribute(s),i=C.isNullOrUndefined(i)?this.htmlAttributes[""+s]:i+this.htmlAttributes[""+s],this.inputObj.container.setAttribute(s,i)):this.inputObj.container.setAttribute(s,this.htmlAttributes[""+s]))}},i.prototype.resetMaskedTextBox=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.customRegExpCollec=[],this.undoCollec=[],this.redoCollec=[],this.promptChar&&1<this.promptChar.length&&(this.promptChar=this.promptChar[0]),Dt.call(this),zt.call(this),(null===this.mask||""===this.mask&&void 0!==this.value)&&b.call(this,this.value);var t=p.call(this,this.element);this.prevValue=t,this.value=t,this.isInitial||qt.call(this),Wt.call(this)},i.prototype.setMaskPlaceholder=function(t,e){(e||this.placeholder)&&(o.Input.setPlaceholder(this.placeholder,this.element),this.element.value===this.promptMask&&t&&"Always"!==this.floatLabelType||this.element.value===this.promptMask&&"Never"===this.floatLabelType)&&b.call(this,"")},i.prototype.setWidth=function(t){C.isNullOrUndefined(t)||("number"==typeof t?(this.inputObj.container.style.width=C.formatUnit(t),this.element.style.width=C.formatUnit(t)):"string"==typeof t&&(t=t.match(/px|%|em/)?t:C.formatUnit(t),this.inputObj.container.style.width=t,this.element.style.width=t))},i.prototype.checkHtmlAttributes=function(t){for(var e=0,i=t?C.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"];e<i.length;e++){var s,n=i[e];if(!C.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"placeholder":(C.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"disabled":(C.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n),this.setProperties({enabled:s},!t));break;case"value":(C.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.value||t)&&this.setProperties({value:this.element.value},!t);break;case"readonly":(C.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.readonly||t)&&(s="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n),this.setProperties({readonly:s},!t))}}},i.prototype.createWrapper=function(){var t=this.cssClass;C.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=this.getValidClassList(this.cssClass)),this.inputObj=o.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{enableRtl:this.enableRtl,cssClass:t,enabled:this.enabled,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}},this.createElement),this.inputObj.container.setAttribute("class","e-control-wrapper e-mask "+this.inputObj.container.getAttribute("class"))},i.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"value":ye.call(this,this.value),this.placeholder&&!this.isFocus&&this.setMaskPlaceholder(!1,!1),""===this.value&&null!=e.value&&(this.element.selectionStart=0,this.element.selectionEnd=0);break;case"placeholder":this.setMaskPlaceholder(!0,!0);break;case"width":this.setWidth(t.width),o.Input.calculateWidth(this.element,this.inputObj.container);break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"enabled":o.Input.setEnabled(t.enabled,this.element,this.floatLabelType,this.inputObj.container);break;case"readonly":o.Input.setReadonly(t.readonly,this.element);break;case"enableRtl":o.Input.setEnableRtl(t.enableRtl,[this.inputObj.container]);break;case"customCharacters":this.customCharacters=t.customCharacters,this.resetMaskedTextBox();break;case"showClearButton":o.Input.setClearButton(t.showClearButton,this.element,this.inputObj,void 0,this.createElement),jt.call(this);break;case"floatLabelType":this.floatLabelType=t.floatLabelType,o.Input.removeFloating(this.inputObj),o.Input.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement);break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkHtmlAttributes(!0);break;case"mask":var n=this.value;this.mask=t.mask,this.maskedRegExp=[],this.updateValue(n);break;case"promptChar":1<t.promptChar.length&&(t.promptChar=t.promptChar[0]),t.promptChar?this.promptChar=t.promptChar:this.promptChar="_";n=this.element.value.replace(new RegExp("["+e.promptChar+"]","g"),this.promptChar);this.promptMask===this.element.value&&(n=this.promptMask.replace(new RegExp("["+e.promptChar+"]","g"),this.promptChar)),this.promptMask=this.promptMask.replace(new RegExp("["+e.promptChar+"]","g"),this.promptChar),this.undoCollec=this.redoCollec=[],b.call(this,n)}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},i.prototype.updateValue=function(t){this.resetMaskedTextBox(),ye.call(this,t)},i.prototype.getMaskedValue=function(){return Kt.call(this,this.element)},i.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.isFocus=!0,this.element.focus(),C.addClass([this.inputObj.container],[Te]))},i.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.isFocus=!1,this.element.blur(),C.removeClass([this.inputObj.container],[Te]))},i.prototype.destroy=function(){qt.call(this),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]);for(var t=["aria-labelledby","role","autocomplete","aria-readonly","aria-disabled","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-invalid"],e=0;e<t.length;e++)this.element.removeAttribute(t[e]);this.element.classList.remove("e-input"),this.inputObj&&(this.inputObj.container.insertAdjacentElement("afterend",this.element),C.detach(this.inputObj.container)),this.blurEventArgs=null,o.Input.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),this.changeEventArgs=null,this.inputObj=null,Se.prototype.destroy.call(this)},t([C.Property(null)],i.prototype,"cssClass",void 0),t([C.Property(null)],i.prototype,"width",void 0),t([C.Property(null)],i.prototype,"placeholder",void 0),t([C.Property("Never")],i.prototype,"floatLabelType",void 0),t([C.Property({})],i.prototype,"htmlAttributes",void 0),t([C.Property(!0)],i.prototype,"enabled",void 0),t([C.Property(!1)],i.prototype,"readonly",void 0),t([C.Property(!1)],i.prototype,"showClearButton",void 0),t([C.Property(!1)],i.prototype,"enablePersistence",void 0),t([C.Property(null)],i.prototype,"mask",void 0),t([C.Property("_")],i.prototype,"promptChar",void 0),t([C.Property(null)],i.prototype,"value",void 0),t([C.Property(null)],i.prototype,"customCharacters",void 0),t([C.Event()],i.prototype,"created",void 0),t([C.Event()],i.prototype,"destroyed",void 0),t([C.Event()],i.prototype,"change",void 0),t([C.Event()],i.prototype,"focus",void 0),t([C.Event()],i.prototype,"blur",void 0),t([C.NotifyPropertyChanges],i));function i(t,e){e=Se.call(this,t,e)||this;return e.initInputValue="",e.preventChange=!1,e.isClicked=!1,e.maskOptions=t,e}ke=function(t,e){return(ke=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var ke,Oe,t=function(t,e){function i(){this.constructor=t}ke(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},s=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},Le=(Oe=C.ChildProperty,t(we,Oe),s([C.Property("None")],we.prototype,"placement",void 0),s([C.Property(10)],we.prototype,"largeStep",void 0),s([C.Property(1)],we.prototype,"smallStep",void 0),s([C.Property(!1)],we.prototype,"showSmallTicks",void 0),s([C.Property(null)],we.prototype,"format",void 0),we);function we(){return null!==Oe&&Oe.apply(this,arguments)||this}Ae=C.ChildProperty,t(He,Ae),s([C.Property(null)],He.prototype,"color",void 0),s([C.Property(null)],He.prototype,"start",void 0),s([C.Property(null)],He.prototype,"end",void 0);var Ae,Ne=He;function He(){return null!==Ae&&Ae.apply(this,arguments)||this}Be=C.ChildProperty,t(Re,Be),s([C.Property(!1)],Re.prototype,"enabled",void 0),s([C.Property(null)],Re.prototype,"minStart",void 0),s([C.Property(null)],Re.prototype,"minEnd",void 0),s([C.Property(null)],Re.prototype,"maxStart",void 0),s([C.Property(null)],Re.prototype,"maxEnd",void 0),s([C.Property(!1)],Re.prototype,"startHandleFixed",void 0),s([C.Property(!1)],Re.prototype,"endHandleFixed",void 0);var Be,Ue=Re;function Re(){return null!==Be&&Be.apply(this,arguments)||this}Ie=C.ChildProperty,t(Fe,Ie),s([C.Property("")],Fe.prototype,"cssClass",void 0),s([C.Property("Before")],Fe.prototype,"placement",void 0),s([C.Property("Focus")],Fe.prototype,"showOn",void 0),s([C.Property(!1)],Fe.prototype,"isVisible",void 0),s([C.Property(null)],Fe.prototype,"format",void 0);var Ie,Ve=Fe;function Fe(){return null!==Ie&&Ie.apply(this,arguments)||this}var Me,De="e-slider",ze="e-rtl",We="e-slider-input",qe="e-control-wrapper",je="e-handle",_e="e-range",Xe="e-slider-button",Ke="e-first-button",Ye="e-second-button",Ze="e-scale",Ge="e-tick",Je="e-large",$e="e-tick-value",Qe="e-slider-tooltip",ti="e-slider-hover",ei="e-handle-first",ii="e-handle-second",si="e-disabled",ni="e-slider-container",ai="e-slider-horizontal-before",li="e-slider-horizontal-after",ri="e-slider-vertical-before",oi="e-slider-vertical-after",hi="e-material-tooltip-open",ui="e-tooltip-active",pi="e-material-slider",di="e-slider-track",ci="e-slider-horizantal-color",mi="e-slider-vertical-color",vi="e-handle-focused",fi="e-vertical",gi="e-horizontal",yi="e-handle-start",bi="e-material-tooltip-start",a="e-tab-handle",Ci="e-button-icon",Ei="e-small-size",xi="e-tick-pos",Si="e-first-tick",Ti="e-last-tick",Pi="e-slider-btn",ki="e-tab-track",Oi="e-tab-range",Li="e-handle-active",wi="e-material-handle",Ai="e-material-range",Ni="e-material-default",Hi="e-material-tooltip-show",Bi="e-material-tooltip-hide",Ui="e-read-only",Ri="e-limits",Ii="e-limit-bar",Vi="e-limit-first",Fi="e-limit-second",Mi="e-drag-horizontal",Di="e-drag-vertical",zi=(Me=C.Component,t(l,Me),l.prototype.preRender=function(){this.l10n=new C.L10n("slider",{incrementTitle:"Increase",decrementTitle:"Decrease"},this.locale),this.isElementFocused=!1,this.tickElementCollection=[],this.tooltipFormatInfo={},this.ticksFormatInfo={},this.initCultureInfo(),this.initCultureFunc(),this.formChecker()},l.prototype.formChecker=function(){var t=C.closest(this.element,"form");t?(this.isForm=!0,C.isNullOrUndefined(this.formResetValue)||this.setProperties({value:this.formResetValue},!0),this.formResetValue=this.value,"Range"!==this.type||!C.isNullOrUndefined(this.formResetValue)&&"object"==typeof this.formResetValue?C.isNullOrUndefined(this.formResetValue)&&(this.formResetValue=parseFloat(C.formatUnit(this.min))):this.formResetValue=[parseFloat(C.formatUnit(this.min)),parseFloat(C.formatUnit(this.max))],this.formElement=t):this.isForm=!1},l.prototype.initCultureFunc=function(){this.internationalization=new C.Internationalization(this.locale)},l.prototype.initCultureInfo=function(){this.tooltipFormatInfo.format=C.isNullOrUndefined(this.tooltip.format)?null:this.tooltip.format,this.ticksFormatInfo.format=C.isNullOrUndefined(this.ticks.format)?null:this.ticks.format},l.prototype.formatString=function(t,e){var i,s=null,n=null;return!t&&0!==t||(s=this.formatNumber(t),i=this.numberOfDecimals(t),n=this.internationalization.getNumberFormat(e)(this.makeRoundNumber(t,i))),{elementVal:s,formatString:n}},l.prototype.formatNumber=function(t){var e=this.numberOfDecimals(t);return this.internationalization.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(t)},l.prototype.numberOfDecimals=function(t){t=t.toString().split(".")[1];return t&&t.length?t.length:0},l.prototype.makeRoundNumber=function(t,e){return Number(t.toFixed(e||0))},l.prototype.fractionalToInteger=function(t){t=0===this.numberOfDecimals(t)?Number(t).toFixed(this.noOfDecimals):t;for(var e=1,i=0;i<this.noOfDecimals;i++)e*=10;return t=Number((t*e).toFixed(0))},l.prototype.render=function(){var t=this;this.initialize(),this.initRender(),this.wireEvents(),this.setZindex(),this.renderComplete(),"EJS-SLIDER"===this.element.tagName&&"none"===this.getTheme(this.sliderContainer)&&setTimeout(function(){t.refresh()},0)},l.prototype.initialize=function(){C.addClass([this.element],De),this.setCSSClass()},l.prototype.setElementWidth=function(t){C.isNullOrUndefined(t)||C.isNullOrUndefined(this.sliderContainer)||("number"==typeof t?this.sliderContainer.style.width=C.formatUnit(t):"string"==typeof t&&(this.sliderContainer.style.width=t.match(/px|%|em/)?t:C.formatUnit(t)))},l.prototype.setCSSClass=function(t){t&&C.removeClass([this.element],t.split(" ")),this.cssClass&&C.addClass([this.element],this.cssClass.split(" "))},l.prototype.setEnabled=function(){this.enabled?(C.removeClass([this.sliderContainer],[si]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.remove(si),this.wireEvents()):(C.addClass([this.sliderContainer],[si]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.add(si),this.unwireEvents())},l.prototype.getTheme=function(t){return window.getComputedStyle(t,":after").getPropertyValue("content").replace(/['"]+/g,"")},l.prototype.initRender=function(){this.sliderContainer=this.createElement("div",{className:ni+" "+qe}),this.element.parentNode.insertBefore(this.sliderContainer,this.element),this.sliderContainer.appendChild(this.element),this.sliderTrack=this.createElement("div",{className:di}),this.element.appendChild(this.sliderTrack),this.setElementWidth(this.width),this.element.tabIndex=-1,this.getThemeInitialization(),this.setHandler(),this.createRangeBar(),this.limits.enabled&&this.createLimitBar(),this.setOrientClass(),this.hiddenInput=this.createElement("input",{attrs:{type:"hidden",value:C.isNullOrUndefined(this.value)?C.isNullOrUndefined(this.min)?"0":this.min.toString():this.value.toString(),name:this.element.getAttribute("name")||this.element.getAttribute("id")||"_"+(1e3*Math.random()).toFixed(0)+"slider",class:We}}),this.hiddenInput.tabIndex=-1,this.sliderContainer.appendChild(this.hiddenInput),this.showButtons&&this.setButtons(),this.setEnableRTL(),"Range"===this.type?this.rangeValueUpdate():this.value=C.isNullOrUndefined(this.value)?C.isNullOrUndefined(this.min)?0:parseFloat(C.formatUnit(this.min.toString())):this.value,this.previousVal="Range"!==this.type?this.checkHandleValue(parseFloat(C.formatUnit(this.value.toString()))):[this.checkHandleValue(parseFloat(C.formatUnit(this.value[0].toString()))),this.checkHandleValue(parseFloat(C.formatUnit(this.value[1].toString())))],this.previousChanged=this.previousVal,C.isNullOrUndefined(this.element.hasAttribute("name"))||this.element.removeAttribute("name"),this.setValue(),this.limits.enabled&&this.setLimitBar(),"None"!==this.ticks.placement&&this.renderScale(),this.tooltip.isVisible&&this.renderTooltip(),this.enabled?C.removeClass([this.sliderContainer],[si]):C.addClass([this.sliderContainer],[si]),this.readonly?C.addClass([this.sliderContainer],[Ui]):C.removeClass([this.sliderContainer],[Ui])},l.prototype.getThemeInitialization=function(){this.isMaterial="material"===this.getTheme(this.sliderContainer)||"material-dark"===this.getTheme(this.sliderContainer),this.isMaterial3="Material3"===this.getTheme(this.sliderContainer)||"Material3-dark"===this.getTheme(this.sliderContainer),this.isBootstrap="bootstrap"===this.getTheme(this.sliderContainer)||"bootstrap-dark"===this.getTheme(this.sliderContainer),this.isBootstrap4="bootstrap4"===this.getTheme(this.sliderContainer),this.isTailwind="tailwind"===this.getTheme(this.sliderContainer)||"tailwind-dark"===this.getTheme(this.sliderContainer),this.isTailwind3="tailwind3"===this.getTheme(this.sliderContainer)||"tailwind3-dark"===this.getTheme(this.sliderContainer),this.isBootstrap5="bootstrap5"===this.getTheme(this.sliderContainer),this.isFluent="FluentUI"===this.getTheme(this.sliderContainer),this.isFluent2="fluent2"===this.getTheme(this.sliderContainer),this.isBootstrap5Dot3="bootstrap5.3"===this.getTheme(this.sliderContainer),this.isMaterialTooltip=(this.isMaterial||this.isMaterial3)&&"Range"!==this.type&&this.tooltip.isVisible},l.prototype.createRangeBar=function(){"Default"!==this.type&&(this.rangeBar=this.createElement("div",{attrs:{class:_e}}),this.element.appendChild(this.rangeBar),this.drag)&&"Range"===this.type&&("Horizontal"===this.orientation?this.rangeBar.classList.add(Mi):this.rangeBar.classList.add(Di))},l.prototype.createLimitBar=function(){var t="Range"!==this.type?Ii:Vi;t+=" "+Ri,this.limitBarFirst=this.createElement("div",{attrs:{class:t}}),this.element.appendChild(this.limitBarFirst),"Range"===this.type&&(this.limitBarSecond=this.createElement("div",{attrs:{class:Fi+" "+Ri}}),this.element.appendChild(this.limitBarSecond))},l.prototype.setOrientClass=function(){"Vertical"!==this.orientation?(this.sliderContainer.classList.remove(fi),this.sliderContainer.classList.add(gi),this.firstHandle.setAttribute("aria-orientation","horizontal"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","horizontal")):(this.sliderContainer.classList.remove(gi),this.sliderContainer.classList.add(fi),this.firstHandle.setAttribute("aria-orientation","vertical"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","vertical"))},l.prototype.setAriaAttributes=function(t){var i=this,e=this.min,s=this.max;!C.isNullOrUndefined(this.customValues)&&0<this.customValues.length&&(e=this.customValues[0],s=this.customValues[this.customValues.length-1]),"Range"!==this.type?C.attributes(t,{"aria-valuemin":C.isNullOrUndefined(e)?"0":e.toString(),"aria-valuemax":C.isNullOrUndefined(s)?"100":s.toString()}):(!C.isNullOrUndefined(this.customValues)&&0<this.customValues.length?[[e.toString(),this.customValues[this.value[1]].toString()],[this.customValues[this.value[0]].toString(),s.toString()]]:[[e.toString(),this.value[1].toString()],[this.value[0].toString(),s.toString()]]).forEach(function(t,e){e=0===e?i.firstHandle:i.secondHandle;e&&C.attributes(e,{"aria-valuemin":t[0],"aria-valuemax":t[1]})})},l.prototype.createSecondHandle=function(){this.secondHandle=this.createElement("div",{attrs:{class:je,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.secondHandle.classList.add(ii),this.element.appendChild(this.secondHandle)},l.prototype.createFirstHandle=function(){this.firstHandle=this.createElement("div",{attrs:{class:je,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.firstHandle.classList.add(ei),this.element.appendChild(this.firstHandle),this.isMaterialTooltip&&(this.materialHandle=this.createElement("div",{attrs:{class:je+" "+wi}}),this.element.appendChild(this.materialHandle))},l.prototype.wireFirstHandleEvt=function(t){t?(C.EventHandler.remove(this.firstHandle,"mousedown touchstart",this.handleFocus),C.EventHandler.remove(this.firstHandle,"transitionend",this.transitionEnd),C.EventHandler.remove(this.firstHandle,"mouseenter touchenter",this.handleOver),C.EventHandler.remove(this.firstHandle,"mouseleave touchend",this.handleLeave)):(C.EventHandler.add(this.firstHandle,"mousedown touchstart",this.handleFocus,this),C.EventHandler.add(this.firstHandle,"transitionend",this.transitionEnd,this),C.EventHandler.add(this.firstHandle,"mouseenter touchenter",this.handleOver,this),C.EventHandler.add(this.firstHandle,"mouseleave touchend",this.handleLeave,this))},l.prototype.wireSecondHandleEvt=function(t){t?(C.EventHandler.remove(this.secondHandle,"mousedown touchstart",this.handleFocus),C.EventHandler.remove(this.secondHandle,"transitionend",this.transitionEnd),C.EventHandler.remove(this.secondHandle,"mouseenter touchenter",this.handleOver),C.EventHandler.remove(this.secondHandle,"mouseleave touchend",this.handleLeave)):(C.EventHandler.add(this.secondHandle,"mousedown touchstart",this.handleFocus,this),C.EventHandler.add(this.secondHandle,"transitionend",this.transitionEnd,this),C.EventHandler.add(this.secondHandle,"mouseenter touchenter",this.handleOver,this),C.EventHandler.add(this.secondHandle,"mouseleave touchend",this.handleLeave,this))},l.prototype.handleStart=function(){"Range"!==this.type&&(this.firstHandle.classList[0===this.handlePos1?"add":"remove"](yi),this.isMaterialTooltip)&&(this.materialHandle.classList[0===this.handlePos1?"add":"remove"](yi),this.tooltipElement)&&this.tooltipElement.classList[0===this.handlePos1?"add":"remove"](bi)},l.prototype.transitionEnd=function(t){"transform"!==t.propertyName&&(this.handleStart(),this.enableAnimation||(this.getHandle().style.transition="none"),"Default"!==this.type&&(this.rangeBar.style.transition="none"),(this.isMaterial||this.isMaterial3)&&this.tooltip.isVisible&&"Default"===this.type&&(this.tooltipElement.style.transition=this.transition.handle),this.tooltipToggle(this.getHandle()),this.closeTooltip())},l.prototype.handleFocusOut=function(){this.firstHandle.classList.contains(vi)&&this.firstHandle.classList.remove(vi),"Range"===this.type&&this.secondHandle.classList.contains(vi)&&this.secondHandle.classList.remove(vi)},l.prototype.handleFocus=function(t){this.focusSliderElement(),this.sliderBarClick(t),(t.currentTarget===this.firstHandle?(this.firstHandle.classList.add(vi),this.firstHandle):(this.secondHandle.classList.add(vi),this.secondHandle)).classList.add(a),C.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),C.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},l.prototype.handleOver=function(t){this.tooltip.isVisible&&"Hover"===this.tooltip.showOn&&this.tooltipToggle(t.currentTarget),"Default"===this.type&&this.tooltipToggle(this.getHandle())},l.prototype.handleLeave=function(t){!this.tooltip.isVisible||"Hover"!==this.tooltip.showOn||t.currentTarget.classList.contains(vi)||t.currentTarget.classList.contains(a)||this.closeTooltip()},l.prototype.setHandler=function(){this.createFirstHandle(),"Range"===this.type&&this.createSecondHandle()},l.prototype.setEnableRTL=function(){this.enableRtl&&"Vertical"!==this.orientation?C.addClass([this.sliderContainer],ze):C.removeClass([this.sliderContainer],ze);var t="Vertical"!==this.orientation?this.horDir:this.verDir;this.enableRtl?this.horDir="right":this.horDir="left",this.verDir="bottom",t!==("Vertical"!==this.orientation?this.horDir:this.verDir)&&"Horizontal"===this.orientation&&(C.setStyleAttribute(this.firstHandle,{right:"",left:"auto"}),"Range"===this.type)&&C.setStyleAttribute(this.secondHandle,{top:"",left:"auto"}),this.setBarColor()},l.prototype.tooltipValue=function(){var e,i=this,t={value:this.value,text:""};this.initialTooltip&&(this.initialTooltip=!1,this.setTooltipContent(),t.text=e="function"==typeof this.tooltipObj.content?this.tooltipObj.content():this.tooltipObj.content,this.trigger("tooltipChange",t,function(t){i.addTooltipClass(t.text),e!==t.text&&(i.customAriaText=t.text,i.enableHtmlSanitizer?t.text=C.SanitizeHtmlHelper.sanitize(t.text.toString()):t.text=t.text.toString(),i.tooltipObj.content=C.initializeCSPTemplate(function(){return t.text}),i.setAriaAttrValue(i.firstHandle),"Range"===i.type)&&i.setAriaAttrValue(i.secondHandle)}),this.isMaterialTooltip)&&this.setPreviousVal("change",this.value)},l.prototype.setTooltipContent=function(){var t=this.formatContent(this.tooltipFormatInfo,!1);this.tooltipObj.content=C.initializeCSPTemplate(function(){return t})},l.prototype.formatContent=function(t,e){var i="",s=this.handleVal1,n=this.handleVal2;return!C.isNullOrUndefined(this.customValues)&&0<this.customValues.length&&(s=this.customValues[this.handleVal1],n=this.customValues[this.handleVal2]),e?"Range"===this.type?i=this.enableRtl&&"Vertical"!==this.orientation?C.isNullOrUndefined(this.tooltip)||C.isNullOrUndefined(this.tooltip.format)?n.toString()+" - "+s.toString():this.formatString(n,t).elementVal+" - "+this.formatString(s,t).elementVal:C.isNullOrUndefined(this.tooltip)||C.isNullOrUndefined(this.tooltip.format)?s.toString()+" - "+n.toString():this.formatString(s,t).elementVal+" - "+this.formatString(n,t).elementVal:C.isNullOrUndefined(s)||(i=C.isNullOrUndefined(this.tooltip)||C.isNullOrUndefined(this.tooltip.format)?s.toString():this.formatString(s,t).elementVal):"Range"===this.type?i=this.enableRtl&&"Vertical"!==this.orientation?C.isNullOrUndefined(t.format)?n.toString()+" - "+s.toString():this.formatString(n,t).formatString+" - "+this.formatString(s,t).formatString:C.isNullOrUndefined(t.format)?s.toString()+" - "+n.toString():this.formatString(s,t).formatString+" - "+this.formatString(n,t).formatString:C.isNullOrUndefined(s)||(i=C.isNullOrUndefined(t.format)?s.toString():this.formatString(s,t).formatString),i},l.prototype.addTooltipClass=function(t){var e;this.isMaterialTooltip&&(t=t.toString().length,this.tooltipElement?(e=4<t?{oldCss:Ni,newCss:Ai}:{oldCss:Ai,newCss:Ni},this.tooltipElement.classList.remove(e.oldCss),this.tooltipElement.classList.contains(e.newCss)||(this.tooltipElement.classList.add(e.newCss),this.tooltipElement.style.transform=4<t?"scale(1)":this.getTooltipTransformProperties(this.previousTooltipClass).rotate)):(e=4<t?Ai:Ni,this.tooltipObj.cssClass=Qe+" "+e))},l.prototype.tooltipPlacement=function(){return"Horizontal"===this.orientation?"Before"===this.tooltip.placement?"TopCenter":"BottomCenter":"Before"===this.tooltip.placement?"LeftCenter":"RightCenter"},l.prototype.tooltipBeforeOpen=function(t){this.tooltipElement=t.element,this.tooltip.cssClass&&C.addClass([this.tooltipElement],this.tooltip.cssClass.split(" ").filter(function(t){return t})),t.target.removeAttribute("aria-describedby"),this.isMaterialTooltip&&(this.tooltipElement.firstElementChild.classList.add(Bi),this.handleStart(),this.setTooltipTransform())},l.prototype.tooltipCollision=function(t){if(this.isBootstrap||this.isBootstrap4||(this.isMaterial||this.isMaterial3)&&!this.isMaterialTooltip){var e=this.isBootstrap4?3:6;switch(t){case"TopCenter":this.tooltipObj.setProperties({offsetY:-e},!1);break;case"BottomCenter":this.tooltipObj.setProperties({offsetY:e},!1);break;case"LeftCenter":this.tooltipObj.setProperties({offsetX:-e},!1);break;case"RightCenter":this.tooltipObj.setProperties({offsetX:e},!1)}}},l.prototype.materialTooltipEventCallBack=function(t){this.sliderBarClick(t),C.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),C.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},l.prototype.wireMaterialTooltipEvent=function(t){this.isMaterialTooltip&&(t?C.EventHandler.remove(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack):C.EventHandler.add(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack,this))},l.prototype.tooltipPositionCalculation=function(t){var e;switch(t){case"TopCenter":e=ai;break;case"BottomCenter":e=li;break;case"LeftCenter":e=ri;break;case"RightCenter":e=oi}return e},l.prototype.getTooltipTransformProperties=function(t){var e;return this.tooltipElement&&(e="Horizontal"===this.orientation?this.tooltipElement.clientHeight+14-this.tooltipElement.clientHeight/2:this.tooltipElement.clientWidth+14-this.tooltipElement.clientWidth/2,e="Horizontal"===this.orientation?t===ai?{rotate:"rotate(45deg)",translate:"translateY("+e+"px)"}:{rotate:"rotate(225deg)",translate:"translateY("+-e+"px)"}:t===ri?{rotate:"rotate(-45deg)",translate:"translateX("+e+"px)"}:{rotate:"rotate(-225deg)",translate:"translateX("+-e+"px)"}),e},l.prototype.openMaterialTooltip=function(){var t,e=this;this.isMaterialTooltip&&(this.refreshTooltip(this.firstHandle),(t=this.tooltipElement.firstElementChild).classList.remove(Bi),t.classList.add(Hi),this.firstHandle.style.cursor="default",this.tooltipElement.style.transition=this.scaleTransform,this.tooltipElement.classList.add(hi),this.materialHandle.style.transform="scale(0)",4<t.innerText.length?this.tooltipElement.style.transform="scale(1)":this.tooltipElement.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate,"Default"===this.type?setTimeout(function(){e.tooltipElement&&(e.tooltipElement.style.transition=e.transition.handle)},2500):setTimeout(function(){e.tooltipElement&&(e.tooltipElement.style.transition="none")},2500))},l.prototype.closeMaterialTooltip=function(){var t,e=this;this.isMaterialTooltip&&(t=this.tooltipElement.firstElementChild,this.tooltipElement.style.transition=this.scaleTransform,t.classList.remove(Hi),t.classList.add(Bi),this.firstHandle.style.cursor="-webkit-grab",this.firstHandle.style.cursor="grab",this.materialHandle&&(this.materialHandle.style.transform="scale(1)"),this.tooltipElement.classList.remove(hi),this.setTooltipTransform(),this.tooltipTarget=void 0,setTimeout(function(){e.tooltipElement&&(e.tooltipElement.style.transition="none")},2500))},l.prototype.checkTooltipPosition=function(t){var e=this.tooltipPositionCalculation(t.collidedPosition);void 0!==this.tooltipCollidedPosition&&this.tooltipCollidedPosition===t.collidedPosition&&t.element.classList.contains(e)||(this.isMaterialTooltip&&(void 0!==e&&(t.element.classList.remove(this.previousTooltipClass),t.element.classList.add(e),this.previousTooltipClass=e),t.element.style.transform)&&t.element.classList.contains(hi)&&t.element.firstElementChild.innerText.length<=4&&(t.element.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate),this.tooltipCollidedPosition=t.collidedPosition),this.isMaterialTooltip&&this.tooltipElement&&-1!==this.tooltipElement.style.transform.indexOf("translate")&&this.setTooltipTransform()},l.prototype.setTooltipTransform=function(){var t=this.getTooltipTransformProperties(this.previousTooltipClass);C.isNullOrUndefined(this.tooltipElement)||(4<this.tooltipElement.firstElementChild.innerText.length?this.tooltipElement.style.transform=t.translate+" scale(0.01)":this.tooltipElement.style.transform=t.translate+" "+t.rotate+" scale(0.01)")},l.prototype.renderTooltip=function(){this.tooltipObj=new h.Tooltip({showTipPointer:this.isBootstrap||this.isMaterial||this.isMaterial3||this.isBootstrap4||this.isTailwind||this.isTailwind3||this.isBootstrap5||this.isFluent||this.isFluent2||this.isBootstrap5Dot3,cssClass:Qe,height:this.isMaterial||this.isMaterial3?30:"auto",animation:{open:{effect:"None"},close:{effect:"FadeOut",duration:500}},opensOn:"Custom",beforeOpen:this.tooltipBeforeOpen.bind(this),beforeCollision:this.checkTooltipPosition.bind(this),beforeClose:this.tooltipBeforeClose.bind(this),enableHtmlSanitizer:this.enableHtmlSanitizer}),this.tooltipObj.appendTo(this.firstHandle),this.initializeTooltipProps()},l.prototype.initializeTooltipProps=function(){var t="Auto"===this.tooltip.showOn?"Hover":this.tooltip.showOn;this.setProperties({tooltip:{showOn:t}},!0),this.tooltipObj.position=this.tooltipPlacement(),this.tooltipCollision(this.tooltipObj.position),[this.firstHandle,this.rangeBar,this.secondHandle].forEach(function(t){C.isNullOrUndefined(t)||(t.style.transition="none")}),this.isMaterialTooltip&&(this.sliderContainer.classList.add(pi),this.tooltipValue(),this.tooltipObj.animation.close.effect="None",this.tooltipObj.open(this.firstHandle))},l.prototype.tooltipBeforeClose=function(){this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0},l.prototype.setButtons=function(){this.firstBtn=this.createElement("div",{className:Xe+" "+Ke}),this.firstBtn.appendChild(this.createElement("span",{className:Ci})),(this.isTailwind||this.isTailwind3)&&this.firstBtn.querySelector("span").classList.add("e-icons"),this.firstBtn.tabIndex=-1,this.secondBtn=this.createElement("div",{className:Xe+" "+Ye}),this.secondBtn.appendChild(this.createElement("span",{className:Ci})),(this.isTailwind||this.isTailwind3)&&this.secondBtn.querySelector("span").classList.add("e-icons"),this.secondBtn.tabIndex=-1,this.sliderContainer.classList.add(Pi),this.sliderContainer.appendChild(this.firstBtn),this.sliderContainer.appendChild(this.secondBtn),this.sliderContainer.appendChild(this.element),this.buttonTitle()},l.prototype.buttonTitle=function(){var t=this.enableRtl&&"Vertical"!==this.orientation,e=(this.l10n.setLocale(this.locale),this.l10n.getConstant("decrementTitle")),i=this.l10n.getConstant("incrementTitle");C.attributes(t?this.secondBtn:this.firstBtn,{"aria-label":e,title:e}),C.attributes(t?this.firstBtn:this.secondBtn,{"aria-label":i,title:i})},l.prototype.buttonFocusOut=function(){(this.isMaterial||this.isMaterial3)&&this.getHandle().classList.remove("e-large-thumb-size")},l.prototype.repeatButton=function(t){var e,i=this.handleValueUpdate(),s=this.enableRtl&&"Vertical"!==this.orientation;t.target.parentElement.classList.contains(Ke)||t.target.classList.contains(Ke)?e=s?this.add(i,parseFloat(this.step.toString()),!0):this.add(i,parseFloat(this.step.toString()),!1):(t.target.parentElement.classList.contains(Ye)||t.target.classList.contains(Ye))&&(e=s?this.add(i,parseFloat(this.step.toString()),!1):this.add(i,parseFloat(this.step.toString()),!0)),(e=this.limits.enabled?this.getLimitCorrectedValues(e):e)>=this.min&&e<=this.max&&(this.changeHandleValue(e),this.tooltipToggle(this.getHandle()))},l.prototype.repeatHandlerMouse=function(t){t.preventDefault(),"mousedown"!==t.type&&"touchstart"!==t.type||(this.buttonClick(t),this.repeatInterval=setInterval(this.repeatButton.bind(this),180,t))},l.prototype.materialChange=function(){this.getHandle().classList.contains("e-large-thumb-size")||this.getHandle().classList.add("e-large-thumb-size")},l.prototype.focusHandle=function(){this.getHandle().classList.contains(a)||this.getHandle().classList.add(a)},l.prototype.repeatHandlerUp=function(t){this.changeEvent("changed",t),this.closeTooltip(),clearInterval(this.repeatInterval),this.getHandle().focus()},l.prototype.customTickCounter=function(t){var e=4;return e=!C.isNullOrUndefined(this.customValues)&&0<this.customValues.length&&(4<t&&(e=3),7<t&&(e=2),14<t&&(e=1),28<t)?0:e},l.prototype.renderScale=function(){var t="Vertical"===this.orientation?"v":"h",e=(this.noOfDecimals=this.numberOfDecimals(this.step),this.ul=this.createElement("ul",{className:Ze+" e-"+t+"-scale "+Ge+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation","aria-hidden":"true"}}),this.ul.style.zIndex="-1",C.Browser.isAndroid&&"h"==t&&this.ul.classList.add(xi),this.ticks.smallStep),i=(this.ticks.showSmallTicks?e<=0&&(e=parseFloat(C.formatUnit(this.step))):e=0<this.ticks.largeStep?this.ticks.largeStep:parseFloat(C.formatUnit(this.max))-parseFloat(C.formatUnit(this.min)),this.fractionalToInteger(this.min)),s=this.fractionalToInteger(this.max),n=this.fractionalToInteger(e),a=!C.isNullOrUndefined(this.customValues)&&0<this.customValues.length&&this.customValues.length-1,l=this.customTickCounter(a),r=!C.isNullOrUndefined(this.customValues)&&0<this.customValues.length?a*l+a:Math.abs((s-i)/n),o=(this.element.appendChild(this.ul),parseFloat(this.min.toString())),h=("v"==t&&(o=parseFloat(this.max.toString())),0),u=100/r;u===1/0&&(u=5);for(var p=0,d=!C.isNullOrUndefined(this.customValues)&&0<this.customValues.length?this.customValues.length-1:0,c=0;p<=r;p++){var m,v,f=this.createElement("li",{attrs:{class:Ge,role:"presentation","aria-hidden":"true"}}),g=(!C.isNullOrUndefined(this.customValues)&&0<this.customValues.length?(v=p%(l+1)==0)&&("h"==t?(o=this.customValues[c],c++):(o=this.customValues[d],d--),f.setAttribute("title",o.toString())):(f.setAttribute("title",o.toString()),v=0===this.numberOfDecimals(this.max)&&0===this.numberOfDecimals(this.min)&&0===this.numberOfDecimals(this.step)?"h"==t?(o-parseFloat(this.min.toString()))%this.ticks.largeStep==0:Math.abs(o-parseFloat(this.max.toString()))%this.ticks.largeStep==0:(m=this.fractionalToInteger(this.ticks.largeStep),b=this.fractionalToInteger(o),"h"==t?(b-i)%m==0:Math.abs(b-parseFloat(s.toString()))%m==0)),v&&f.classList.add(Je),"h"==t?f.style.width=u+"%":f.style.height=u+"%",v?"Both"===this.ticks.placement?2:1:0);if(v)for(var y=0;y<g;y++)this.createTick(f,o);else C.isNullOrUndefined(this.customValues)&&this.formatTicksValue(f,o);this.ul.appendChild(f),this.tickElementCollection.push(f);var b=void 0;C.isNullOrUndefined(this.customValues)&&(b=this.numberOfDecimals(e)>this.numberOfDecimals(o)?this.numberOfDecimals(e):this.numberOfDecimals(o),o="h"==t||this.min>this.max?this.makeRoundNumber(o+e,b):this.makeRoundNumber(o-e,b),h=this.makeRoundNumber(h+e,b))}this.ticksAlignment(t,u)},l.prototype.ticksAlignment=function(t,e,i){void 0===i&&(i=!0),this.firstChild=this.ul.firstElementChild,this.lastChild=this.ul.lastElementChild,this.firstChild.classList.add(Si),this.lastChild.classList.add(Ti),this.sliderContainer.classList.add(Ze+"-"+this.ticks.placement.toLowerCase()),"h"===t?(this.firstChild.style.width=e/2+"%",this.lastChild.style.width=e/2+"%"):(this.firstChild.style.height=e/2+"%",this.lastChild.style.height=e/2+"%");t={ticksWrapper:this.ul,tickElements:this.tickElementCollection};i&&this.trigger("renderedTicks",t),this.scaleAlignment()},l.prototype.createTick=function(t,e){var i=this.createElement("span",{className:$e+" "+Ge+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation","aria-hidden":"true"}});t.appendChild(i),C.isNullOrUndefined(this.customValues)?this.formatTicksValue(t,e,i):this.enableHtmlSanitizer?i.innerHTML=C.SanitizeHtmlHelper.sanitize(e.toString()):i.innerHTML=e.toString()},l.prototype.formatTicksValue=function(e,t,i){var s=this,n=this.formatNumber(t),n=C.isNullOrUndefined(this.ticks)||C.isNullOrUndefined(this.ticks.format)?n:this.formatString(t,this.ticksFormatInfo).formatString;this.trigger("renderingTicks",{value:t,text:n,tickElement:e},function(t){e.setAttribute("title",t.text.toString()),i&&(s.enableHtmlSanitizer?i.innerHTML=C.SanitizeHtmlHelper.sanitize(t.text.toString()):i.innerHTML=t.text.toString())})},l.prototype.scaleAlignment=function(){this.tickValuePosition(),"Vertical"===this.orientation?this.element.getBoundingClientRect().width<=15?this.sliderContainer.classList.add(Ei):this.sliderContainer.classList.remove(Ei):this.element.getBoundingClientRect().height<=15?this.sliderContainer.classList.add(Ei):this.sliderContainer.classList.remove(Ei)},l.prototype.tickValuePosition=function(){this.firstChild=this.element.querySelector("ul").children[0];for(var t,e,i=this.firstChild.getBoundingClientRect(),s=this.ticks.smallStep,s=Math.abs(parseFloat(C.formatUnit(this.max))-parseFloat(C.formatUnit(this.min)))/s,n=(0<this.firstChild.children.length&&(t=this.firstChild.children[0].getBoundingClientRect()),[this.sliderContainer.querySelectorAll("."+Ge+"."+Je+" ."+$e)]),a="Both"===this.ticks.placement?[].slice.call(n[0],2):[].slice.call(n[0],1),l="Vertical"===this.orientation?2*i.height:2*i.width,r=0;r<this.firstChild.children.length;r++)"Vertical"===this.orientation?this.firstChild.children[r].style.top=-t.height/2+"px":this.enableRtl?this.firstChild.children[r].style.left=(l-this.firstChild.children[r].getBoundingClientRect().width)/2+"px":this.firstChild.children[r].style.left=-t.width/2+"px";for(r=0;r<a.length;r++)e=a[r].getBoundingClientRect(),"Vertical"===this.orientation?C.setStyleAttribute(a[r],{top:(l-e.height)/2+"px"}):C.setStyleAttribute(a[r],{left:(l-e.width)/2+"px"});this.enableRtl&&this.lastChild.children.length&&0!=s&&(this.lastChild.children[0].style.left=-this.lastChild.getBoundingClientRect().width/2+"px","Both"===this.ticks.placement)&&(this.lastChild.children[1].style.left=-this.lastChild.getBoundingClientRect().width/2+"px"),0==s&&("Horizontal"===this.orientation&&(this.enableRtl?(this.firstChild.classList.remove(Ti),this.firstChild.style.right=this.firstHandle.style.right,this.firstChild.children[0].style.left=this.firstChild.getBoundingClientRect().width/2+2+"px","Both"===this.ticks.placement&&(this.firstChild.children[1].style.left=this.firstChild.getBoundingClientRect().width/2+2+"px")):(this.firstChild.classList.remove(Ti),this.firstChild.style.left=this.firstHandle.style.left)),"Vertical"===this.orientation)&&this.firstChild.classList.remove(Ti)},l.prototype.setAriaAttrValue=function(t){var e=!C.isNullOrUndefined(this.ticks)&&!C.isNullOrUndefined(this.ticks.format),i=e?this.formatContent(this.tooltipFormatInfo,!1):this.formatContent(this.ticksFormatInfo,!1),e=e?this.formatContent(this.ticksFormatInfo,!0):this.formatContent(this.tooltipFormatInfo,!0),s=2===(i=this.customAriaText||i).split(" - ").length?i.split(" - "):[i,i];this.setAriaAttributes(t),"Range"!==this.type?C.attributes(t,{"aria-valuenow":e,"aria-valuetext":i}):this.enableRtl?t===this.firstHandle?C.attributes(t,{"aria-valuenow":e.split(" - ")[1],"aria-valuetext":s[1]}):C.attributes(t,{"aria-valuenow":e.split(" - ")[0],"aria-valuetext":s[0]}):t===this.firstHandle?C.attributes(t,{"aria-valuenow":e.split(" - ")[0],"aria-valuetext":s[0]}):C.attributes(t,{"aria-valuenow":e.split(" - ")[1],"aria-valuetext":s[1]})},l.prototype.handleValueUpdate=function(){var t="Range"!==this.type||1===this.activeHandle?this.handleVal1:this.handleVal2;return t},l.prototype.getLimitCorrectedValues=function(t){return t=("MinRange"===this.type||"Default"===this.type||1===this.activeHandle?this.getLimitValueAndPosition(t,this.limits.minStart,this.limits.minEnd):this.getLimitValueAndPosition(t,this.limits.maxStart,this.limits.maxEnd))[0]},l.prototype.focusSliderElement=function(){this.isElementFocused||(this.element.focus(),this.isElementFocused=!0)},l.prototype.buttonClick=function(t){this.focusSliderElement();var e,i=this.enableRtl&&"Vertical"!==this.orientation,s=this.handleValueUpdate();40===t.keyCode||37===t.keyCode||t.currentTarget.classList.contains(Ke)?e=i?this.add(s,parseFloat(this.step.toString()),!0):this.add(s,parseFloat(this.step.toString()),!1):38===t.keyCode||39===t.keyCode||t.currentTarget.classList.contains(Ye)?e=i?this.add(s,parseFloat(this.step.toString()),!1):this.add(s,parseFloat(this.step.toString()),!0):33===t.keyCode||t.currentTarget.classList.contains(Ke)?e=i?this.add(s,parseFloat(this.ticks.largeStep.toString()),!1):this.add(s,parseFloat(this.ticks.largeStep.toString()),!0):34===t.keyCode||t.currentTarget.classList.contains(Ye)?e=i?this.add(s,parseFloat(this.ticks.largeStep.toString()),!0):this.add(s,parseFloat(this.ticks.largeStep.toString()),!1):36===t.keyCode?e=parseFloat((this.min<this.max?this.min:this.max).toString()):35===t.keyCode&&(e=parseFloat((this.min<this.max?this.max:this.min).toString())),this.limits.enabled&&(e=this.getLimitCorrectedValues(e)),this.changeHandleValue(e),!this.isMaterial&&!this.isMaterial3||this.tooltip.isVisible||this.getHandle().classList.contains(a)||this.materialChange(),this.tooltipToggle(this.getHandle()),this.getHandle().focus(),this.focusHandle(),t.currentTarget.classList.contains(Ke)&&C.EventHandler.add(this.firstBtn,"mouseup touchend",this.buttonUp,this),t.currentTarget.classList.contains(Ye)&&C.EventHandler.add(this.secondBtn,"mouseup touchend",this.buttonUp,this)},l.prototype.tooltipToggle=function(t){this.isMaterialTooltip?this.tooltipElement.classList.contains(hi)?this.refreshTooltip(this.firstHandle):this.openMaterialTooltip():this.tooltipElement?this.refreshTooltip(t):this.openTooltip(t)},l.prototype.buttonUp=function(t){t.currentTarget.classList.contains(Ke)&&C.EventHandler.remove(this.firstBtn,"mouseup touchend",this.buttonUp),t.currentTarget.classList.contains(Ye)&&C.EventHandler.remove(this.secondBtn,"mouseup touchend",this.buttonUp)},l.prototype.setRangeBar=function(){"Horizontal"!==this.orientation||C.isNullOrUndefined(this.rangeBar)?C.isNullOrUndefined(this.rangeBar)||("MinRange"===this.type?(this.rangeBar.style.bottom=this.min>this.max?this.handlePos1+"px":"0px",C.setStyleAttribute(this.rangeBar,{height:C.isNullOrUndefined(this.handlePos1)?0:this.min>this.max?this.element.clientHeight-this.handlePos1+"px":this.handlePos1+"px"})):(this.rangeBar.style.bottom=this.min>this.max?this.handlePos2+"px":this.handlePos1+"px",C.setStyleAttribute(this.rangeBar,{height:this.min>this.max?this.handlePos1-this.handlePos2+"px":this.handlePos2-this.handlePos1+"px"}))):"MinRange"===this.type?(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",C.setStyleAttribute(this.rangeBar,{width:C.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):(this.enableRtl?this.rangeBar.style.right=this.handlePos1+"px":this.rangeBar.style.left=this.handlePos1+"px",C.setStyleAttribute(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"}))},l.prototype.checkValidValueAndPos=function(t){return t=this.checkHandleValue(t),t=this.checkHandlePosition(t)},l.prototype.setLimitBarPositions=function(t,e,i,s){"Horizontal"===this.orientation?(this.enableRtl?this.limitBarFirst.style.right=t+"px":this.limitBarFirst.style.left=t+"px",this.limitBarFirst.style.width=e-t+"px"):(this.limitBarFirst.style.bottom=(this.min<this.max?t:e)+"px",this.limitBarFirst.style.height=(this.min<this.max?e-t:t-e)+"px"),"Range"===this.type&&("Horizontal"===this.orientation?(this.enableRtl?this.limitBarSecond.style.right=i+"px":this.limitBarSecond.style.left=i+"px",this.limitBarSecond.style.width=s-i+"px"):(this.limitBarSecond.style.bottom=(this.min<this.max?i:s)+"px",this.limitBarSecond.style.height=(this.min<this.max?s-i:i-s)+"px"))},l.prototype.setLimitBar=function(){var t,e,i,s;"Default"===this.type||"MinRange"===this.type?(t=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0],t=this.checkValidValueAndPos(t),e=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0],e=this.checkValidValueAndPos(e),this.setLimitBarPositions(t,e)):"Range"===this.type&&(t=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0],t=this.checkValidValueAndPos(t),e=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0],e=this.checkValidValueAndPos(e),i=this.getLimitValueAndPosition(this.limits.maxStart,this.limits.maxStart,this.limits.maxEnd,!0)[0],i=this.checkValidValueAndPos(i),s=this.getLimitValueAndPosition(this.limits.maxEnd,this.limits.maxStart,this.limits.maxEnd,!0)[0],s=this.checkValidValueAndPos(s),this.setLimitBarPositions(t,e,i,s))},l.prototype.getLimitValueAndPosition=function(t,e,i,s){return C.isNullOrUndefined(e)&&(e=this.min<this.max?this.min:this.max,C.isNullOrUndefined(t))&&s&&(t=e),C.isNullOrUndefined(i)&&(i=this.min<this.max?this.max:this.min,C.isNullOrUndefined(t))&&s&&(t=i),[t=i<(t=t<e?e:t)?i:t,this.checkHandlePosition(t)]},l.prototype.setValue=function(){var t;!C.isNullOrUndefined(this.customValues)&&0<this.customValues.length&&(this.min=0,this.max=this.customValues.length-1,this.setBarColor()),this.setAriaAttributes(this.firstHandle),this.handleVal1=C.isNullOrUndefined(this.value)?this.checkHandleValue(parseFloat(this.min.toString())):this.checkHandleValue(parseFloat(this.value.toString())),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.preHandlePos1=this.handlePos1,C.isNullOrUndefined(this.activeHandle)&&(this.activeHandle="Range"===this.type?2:1),"Default"===this.type||"MinRange"===this.type?(this.limits.enabled&&(t=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd),this.handleVal1=t[0],this.handlePos1=t[1],this.preHandlePos1=this.handlePos1),this.setHandlePosition(null),this.handleStart(),this.value=this.handleVal1,this.setAriaAttrValue(this.firstHandle),this.changeEvent("changed",null)):this.validateRangeValue(),"Default"!==this.type&&this.setRangeBar(),this.limits.enabled&&this.setLimitBar()},l.prototype.rangeValueUpdate=function(){null!==this.value&&"object"==typeof this.value||(this.value=[parseFloat(C.formatUnit(this.min)),parseFloat(C.formatUnit(this.max))])},l.prototype.validateRangeValue=function(){this.rangeValueUpdate(),this.setRangeValue()},l.prototype.modifyZindex=function(){"Range"!==this.type||C.isNullOrUndefined(this.firstHandle)||C.isNullOrUndefined(this.secondHandle)?this.isMaterialTooltip&&this.tooltipElement&&(this.tooltipElement.style.zIndex=h.getZindexPartial(this.element)+""):1===this.activeHandle?(this.firstHandle.style.zIndex=this.zIndex+4+"",this.secondHandle.style.zIndex=this.zIndex+3+""):(this.firstHandle.style.zIndex=this.zIndex+3+"",this.secondHandle.style.zIndex=this.zIndex+4+"")},l.prototype.setHandlePosition=function(t){var e=this,i=1===this.activeHandle?this.handlePos1:this.handlePos2,s=this.isMaterialTooltip?[this.firstHandle,this.materialHandle]:[this.getHandle()];this.handleStart(),s.forEach(function(t){C.isNullOrUndefined(t)||("Horizontal"===e.orientation?e.enableRtl?t.style.right=i+"px":t.style.left=i+"px":t.style.bottom=i+"px")}),this.changeEvent("change",t)},l.prototype.getHandle=function(){return 1===this.activeHandle?this.firstHandle:this.secondHandle},l.prototype.setRangeValue=function(){this.updateRangeValue(),this.activeHandle=1,this.setHandlePosition(null),this.activeHandle=2,this.setHandlePosition(null),this.activeHandle=1},l.prototype.changeEvent=function(t,e){var i,s="change"===t?this.previousVal:this.previousChanged;"Range"!==this.type?(this.setProperties({value:this.handleVal1},!0),s===this.value||this.isMaterialTooltip&&this.initialTooltip||(this.trigger(t,this.changeEventArgs(t,e)),this.initialTooltip=!0,this.setPreviousVal(t,this.value)),this.setAriaAttrValue(this.firstHandle)):(i=this.value=[this.handleVal1,this.handleVal2],this.setProperties({value:i},!0),(s.length===this.value.length&&this.value[0]!==s[0]||this.value[1]!==s[1])&&(this.initialTooltip=!1,this.trigger(t,this.changeEventArgs(t,e)),this.initialTooltip=!0,this.setPreviousVal(t,this.value)),this.setAriaAttrValue(this.getHandle())),this.hiddenInput.value=this.value.toString()},l.prototype.changeEventArgs=function(t,e){t=this.tooltip.isVisible&&this.tooltipObj&&this.initialTooltip?(this.tooltipValue(),{value:this.value,previousValue:"change"===t?this.previousVal:this.previousChanged,action:t,text:"function"==typeof this.tooltipObj.content?this.tooltipObj.content():this.tooltipObj.content,isInteracted:!C.isNullOrUndefined(e)}):{value:this.value,previousValue:"change"===t?this.previousVal:this.previousChanged,action:t,text:C.isNullOrUndefined(this.ticksFormatInfo.format)?this.value.toString():"Range"!==this.type?this.formatString(this.value,this.ticksFormatInfo).formatString:this.formatString(this.value[0],this.ticksFormatInfo).formatString+" - "+this.formatString(this.value[1],this.ticksFormatInfo).formatString,isInteracted:!C.isNullOrUndefined(e)};return t},l.prototype.setPreviousVal=function(t,e){"change"===t?this.previousVal=e:this.previousChanged=e},l.prototype.updateRangeValue=function(){var t=this.value.toString().split(",").map(Number);this.enableRtl&&"Vertical"!==this.orientation||this.rtl?this.value=[t[1],t[0]]:this.value=[t[0],t[1]],this.enableRtl&&"Vertical"!==this.orientation?(this.handleVal1=this.checkHandleValue(this.value[1]),this.handleVal2=this.checkHandleValue(this.value[0])):(this.handleVal1=this.checkHandleValue(this.value[0]),this.handleVal2=this.checkHandleValue(this.value[1])),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handlePos2=this.checkHandlePosition(this.handleVal2),this.min<this.max&&this.handlePos1>this.handlePos2&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.min>this.max&&this.handlePos1<this.handlePos2&&(this.handlePos2=this.handlePos1,this.handleVal2=this.handleVal1),this.preHandlePos1=this.handlePos1,this.preHandlePos2=this.handlePos2,this.limits.enabled&&(this.activeHandle=1,t=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd),this.handleVal1=t[0],this.handlePos1=t[1],this.preHandlePos1=this.handlePos1,this.activeHandle=2,t=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=t[0],this.handlePos2=t[1],this.preHandlePos2=this.handlePos2)},l.prototype.checkHandlePosition=function(t){return t=100*(t-parseFloat(C.formatUnit(this.min)))/(parseFloat(C.formatUnit(this.max))-parseFloat(C.formatUnit(this.min))),t="Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(t/100):this.element.getBoundingClientRect().height*(t/100),t=parseFloat(C.formatUnit(this.max))===parseFloat(C.formatUnit(this.min))?"Horizontal"===this.orientation?this.element.getBoundingClientRect().width:this.element.getBoundingClientRect().height:t},l.prototype.checkHandleValue=function(t){var e;return this.min===this.max?parseFloat(C.formatUnit(this.max)):(t<(e=this.tempStartEnd()).start?t=e.start:t>e.end&&(t=e.end),t)},l.prototype.reposition=function(){var t=this;C.isNullOrUndefined(this.firstHandle)||(this.firstHandle.style.transition="none"),"Default"===this.type||C.isNullOrUndefined(this.rangeBar)||(this.rangeBar.style.transition="none"),"Range"!==this.type||C.isNullOrUndefined(this.secondHandle)||(this.secondHandle.style.transition="none"),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handleVal2&&(this.handlePos2=this.checkHandlePosition(this.handleVal2)),"Horizontal"===this.orientation?(this.enableRtl?this.firstHandle.style.right=this.handlePos1+"px":this.firstHandle.style.left=this.handlePos1+"px",this.isMaterialTooltip&&!C.isNullOrUndefined(this.materialHandle)&&(this.enableRtl?this.materialHandle.style.right=this.handlePos1+"px":this.materialHandle.style.left=this.handlePos1+"px"),"MinRange"!==this.type||C.isNullOrUndefined(this.rangeBar)?"Range"!==this.type||C.isNullOrUndefined(this.secondHandle)||C.isNullOrUndefined(this.rangeBar)||(this.enableRtl?(this.secondHandle.style.right=this.handlePos2+"px",this.rangeBar.style.right=this.handlePos1+"px"):(this.secondHandle.style.left=this.handlePos2+"px",this.rangeBar.style.left=this.handlePos1+"px"),C.setStyleAttribute(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"})):(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",C.setStyleAttribute(this.rangeBar,{width:C.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"}))):(this.firstHandle.style.bottom=this.handlePos1+"px",this.isMaterialTooltip&&(this.materialHandle.style.bottom=this.handlePos1+"px"),"MinRange"===this.type?(this.rangeBar.style.bottom=this.min>this.max?this.handlePos1+"px":"0px",C.setStyleAttribute(this.rangeBar,{height:C.isNullOrUndefined(this.handlePos1)?0:this.min>this.max?this.element.clientHeight-this.handlePos1+"px":this.handlePos1+"px"})):"Range"===this.type&&(this.secondHandle.style.bottom=this.handlePos2+"px",this.rangeBar.style.bottom=this.min>this.max?this.handlePos2+"px":this.handlePos1+"px",C.setStyleAttribute(this.rangeBar,{height:this.min>this.max?this.handlePos1-this.handlePos2+"px":this.handlePos2-this.handlePos1+"px"}))),this.limits.enabled&&this.setLimitBar(),"None"!==this.ticks.placement&&this.ul&&(this.removeElement(this.ul),this.ul=void 0,this.renderScale()),this.handleStart(),this.tooltip.isVisible||setTimeout(function(){C.isNullOrUndefined(t.firstHandle)||(t.firstHandle.style.transition=t.scaleTransform),"Range"!==t.type||C.isNullOrUndefined(t.secondHandle)||(t.secondHandle.style.transition=t.scaleTransform)}),this.refreshTooltip(this.tooltipTarget),this.setBarColor()},l.prototype.changeHandleValue=function(t){var e=null;1===this.activeHandle?this.limits.enabled&&this.limits.startHandleFixed||(this.handleVal1=this.checkHandleValue(t),this.handlePos1=this.checkHandlePosition(this.handleVal1),"Range"===this.type&&(this.handlePos1>this.handlePos2&&this.min<this.max||this.handlePos1<this.handlePos2&&this.min>this.max)&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.handlePos1!==this.preHandlePos1&&(e=this.preHandlePos1=this.handlePos1)):this.limits.enabled&&this.limits.endHandleFixed||(this.handleVal2=this.checkHandleValue(t),this.handlePos2=this.checkHandlePosition(this.handleVal2),"Range"===this.type&&(this.handlePos2<this.handlePos1&&this.min<this.max||this.handlePos2>this.handlePos1&&this.min>this.max)&&(this.handlePos2=this.handlePos1,this.handleVal2=this.handleVal1),this.handlePos2!==this.preHandlePos2&&(e=this.preHandlePos2=this.handlePos2)),this.modifyZindex(),null!==e&&("Default"!==this.type&&this.setRangeBar(),this.setHandlePosition(null))},l.prototype.tempStartEnd=function(){return this.min>this.max?{start:this.max,end:this.min}:{start:this.min,end:this.max}},l.prototype.xyToPosition=function(t){var e,i;if(this.min===this.max)return 100;"Horizontal"===this.orientation?(e=t.x-this.element.getBoundingClientRect().left,i=this.element.offsetWidth/100,this.val=e/i):(e=t.y-this.element.getBoundingClientRect().top,i=this.element.offsetHeight/100,this.val=100-e/i);t=this.stepValueCalculation(this.val);return t<0?t=0:100<t&&(t=100),this.enableRtl&&"Vertical"!==this.orientation&&(t=100-t),"Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(t/100):this.element.getBoundingClientRect().height*(t/100)},l.prototype.stepValueCalculation=function(t){0===this.step&&(this.step=1);var e=parseFloat(C.formatUnit(this.step))/((parseFloat(C.formatUnit(this.max))-parseFloat(C.formatUnit(this.min)))/100),i=t%Math.abs(e);return 0!=i&&(i<e/2?t-=i:t+=Math.abs(e)-i),t},l.prototype.add=function(t,e,i){var s=Math.pow(10,3),i=i?(Math.round(t*s)+Math.round(e*s))/s:(Math.round(t*s)-Math.round(e*s))/s;return i},l.prototype.positionToValue=function(t){var e=parseFloat(C.formatUnit(this.max))-parseFloat(C.formatUnit(this.min)),t="Horizontal"===this.orientation?t/this.element.getBoundingClientRect().width*e:t/this.element.getBoundingClientRect().height*e;return this.add(t,parseFloat(this.min.toString()),!0)},l.prototype.sliderBarClick=function(t){t.preventDefault(),"mousedown"===t.type||"mouseup"===t.type||"click"===t.type?i={x:t.clientX,y:t.clientY}:"touchend"!==t.type&&"touchstart"!==t.type||(i={x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY});var e,i=this.xyToPosition(i),s=this.positionToValue(i),n=(("Range"===this.type&&(this.min<this.max&&this.handlePos2-i<i-this.handlePos1||this.min>this.max&&this.handlePos1-i>i-this.handlePos2)?(this.activeHandle=2,this.limits.enabled&&this.limits.endHandleFixed||(this.limits.enabled&&(s=(n=this.getLimitValueAndPosition(s,this.limits.maxStart,this.limits.maxEnd))[0],i=n[1]),this.secondHandle.classList.add(Li),this.handlePos2=this.preHandlePos2=i,this.handleVal2=s),this.modifyZindex(),this.secondHandle):(this.activeHandle=1,this.limits.enabled&&this.limits.startHandleFixed||(this.limits.enabled&&(s=(n=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd))[0],i=n[1]),this.firstHandle.classList.add(Li),this.handlePos1=this.preHandlePos1=i,this.handleVal1=s),this.modifyZindex(),this.firstHandle)).focus(),this.isMaterialTooltip&&this.tooltipElement.classList.add(ui),this.element.querySelector("."+a)),i=(n&&this.getHandle()!==n&&n.classList.remove(a),1===this.activeHandle?this.firstHandle:this.secondHandle);"click"!==t.type&&"mousedown"!==t.type||t.target!==i||(n=t.clientX,e=t.clientY,document.elementFromPoint(n,e)),this.checkRepeatedValue(s)&&(n=(this.isMaterial||this.isMaterial3)&&this.tooltip.isVisible?this.transitionOnMaterialTooltip:this.transition,this.getHandle().style.transition=n.handle,"Default"!==this.type&&(this.rangeBar.style.transition=n.rangeBar),this.setHandlePosition(t),this.isMaterialTooltip&&(this.initialTooltip=!1),t.target!==i&&this.changeEvent("changed",t),"Default"!==this.type)&&this.setRangeBar()},l.prototype.handleValueAdjust=function(t,e,i){1===i?(this.handleVal1=e,this.handleVal2=this.handleVal1+this.minDiff):2===i&&(this.handleVal2=e,this.handleVal1=this.handleVal2-this.minDiff),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handlePos2=this.checkHandlePosition(this.handleVal2)},l.prototype.dragRangeBarMove=function(t){var e,i,s;"touchmove"!==t.type&&t.preventDefault(),this.rangeBarDragged=!0,this.rangeBar.style.transition="none",this.firstHandle.style.transition="none",this.secondHandle.style.transition="none",e=("mousemove"===t.type?(i=(e=[t.clientX,t.clientY])[0],e):(i=(e=[t.changedTouches[0].clientX,t.changedTouches[0].clientY])[0],e))[1],this.limits.enabled&&this.limits.startHandleFixed||this.limits.enabled&&this.limits.endHandleFixed||(s=this.enableRtl?{x:i+this.secondPartRemain,y:e+this.secondPartRemain}:{x:i-this.firstPartRemain,y:e+this.secondPartRemain},this.min>this.max?(this.handlePos2=this.xyToPosition(s),this.handleVal2=this.positionToValue(this.handlePos2)):(this.handlePos1=this.xyToPosition(s),this.handleVal1=this.positionToValue(this.handlePos1)),s=this.enableRtl?{x:i-this.firstPartRemain,y:e-this.firstPartRemain}:{x:i+this.secondPartRemain,y:e-this.firstPartRemain},this.min>this.max?(this.handlePos1=this.xyToPosition(s),this.handleVal1=this.positionToValue(this.handlePos1)):(this.handlePos2=this.xyToPosition(s),this.handleVal2=this.positionToValue(this.handlePos2)),this.limits.enabled&&(i=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd),this.handleVal1=i[0],this.handlePos1=i[1],this.handleVal1===this.limits.minEnd&&this.handleValueAdjust(this.handleVal1,this.limits.minEnd,1),this.handleVal1===this.limits.minStart&&this.handleValueAdjust(this.handleVal1,this.limits.minStart,1),i=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=i[0],this.handlePos2=i[1],this.handleVal2===this.limits.maxStart&&this.handleValueAdjust(this.handleVal2,this.limits.maxStart,2),this.handleVal2===this.limits.maxEnd)&&this.handleValueAdjust(this.handleVal2,this.limits.maxEnd,2),this.handleVal2===(this.min>this.max?this.min:this.max)&&this.handleValueAdjust(this.handleVal2,this.min>this.max?this.min:this.max,2),this.handleVal1===(this.min>this.max?this.max:this.min)&&this.handleValueAdjust(this.handleVal1,this.min>this.max?this.max:this.min,1)),this.activeHandle=1,this.setHandlePosition(t),this.activeHandle=2,this.setHandlePosition(t),this.tooltipToggle(this.rangeBar),this.setRangeBar()},l.prototype.sliderBarUp=function(t){this.changeEvent("changed",t),this.handleFocusOut(),this.firstHandle.classList.remove(Li),"Range"===this.type&&(this.initialTooltip=!1,this.secondHandle.classList.remove(Li)),this.closeTooltip(),(this.isMaterial||this.isMaterial3)&&(this.getHandle().classList.remove("e-large-thumb-size"),this.isMaterialTooltip)&&this.tooltipElement.classList.remove(ui),C.EventHandler.remove(document,"mousemove touchmove",this.sliderBarMove),C.EventHandler.remove(document,"mouseup touchend",this.sliderBarUp)},l.prototype.sliderBarMove=function(t){"touchmove"!==t.type&&t.preventDefault(),s="mousemove"===t.type?{x:t.clientX,y:t.clientY}:{x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY};var e,i,s=this.xyToPosition(s),n=this.positionToValue(s);s=Math.round(s),"Range"!==this.type&&1===this.activeHandle&&(this.limits.enabled&&this.limits.startHandleFixed||(this.limits.enabled&&(s=(e=this.getLimitValueAndPosition(n,this.limits.minStart,this.limits.minEnd))[1],n=e[0]),this.handlePos1=s,this.handleVal1=n),this.firstHandle.classList.add(Li)),"Range"===this.type&&(1===this.activeHandle?(this.firstHandle.classList.add(Li),this.limits.enabled&&this.limits.startHandleFixed||((this.min<this.max&&s>this.handlePos2||this.min>this.max&&s<this.handlePos2)&&(s=this.handlePos2,n=this.handleVal2),s!==this.preHandlePos1&&(this.limits.enabled&&(n=(i=this.getLimitValueAndPosition(n,this.limits.minStart,this.limits.minEnd))[0],s=i[1]),this.handlePos1=this.preHandlePos1=s,this.handleVal1=n,this.activeHandle=1))):2===this.activeHandle&&(this.secondHandle.classList.add(Li),this.limits.enabled&&this.limits.endHandleFixed||((this.min<this.max&&s<this.handlePos1||this.min>this.max&&s>this.handlePos1)&&(s=this.handlePos1,n=this.handleVal1),s!==this.preHandlePos2&&(this.limits.enabled&&(n=(i=this.getLimitValueAndPosition(n,this.limits.maxStart,this.limits.maxEnd))[0],s=i[1]),this.handlePos2=this.preHandlePos2=s,this.handleVal2=n,this.activeHandle=2)))),this.checkRepeatedValue(n)&&(this.getHandle().style.transition=this.scaleTransform,"Default"!==this.type&&(this.rangeBar.style.transition="none"),this.setHandlePosition(t),!this.isMaterial&&!this.isMaterial3||this.tooltip.isVisible||this.getHandle().classList.contains(a)||this.materialChange(),this.tooltipToggle(this.getHandle()),"Default"!==this.type)&&this.setRangeBar()},l.prototype.dragRangeBarUp=function(t){this.rangeBarDragged?this.isDragComplete=!0:(this.focusSliderElement(),this.sliderBarClick(t)),this.changeEvent("changed",t),this.closeTooltip(),C.EventHandler.remove(document,"mousemove touchmove",this.dragRangeBarMove),C.EventHandler.remove(document,"mouseup touchend",this.dragRangeBarUp),this.rangeBarDragged=!1},l.prototype.checkRepeatedValue=function(t){if("Range"===this.type){if(t===(this.enableRtl&&"Vertical"!==this.orientation?1===this.activeHandle?this.previousVal[1]:this.previousVal[0]:1===this.activeHandle?this.previousVal[0]:this.previousVal[1]))return 0}else if(t===this.previousVal)return 0;return 1},l.prototype.refreshTooltip=function(t){this.tooltip.isVisible&&this.tooltipObj&&(this.tooltipValue(),t)&&(this.tooltipObj.refresh(t),this.tooltipTarget=t)},l.prototype.openTooltip=function(t){this.tooltip.isVisible&&this.tooltipObj&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.open(t),this.tooltipTarget=t)},l.prototype.closeTooltip=function(){this.tooltip.isVisible&&this.tooltipObj&&"Always"!==this.tooltip.showOn&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.close(),this.tooltipTarget=void 0)},l.prototype.keyDown=function(t){switch(t.keyCode){case 37:case 38:case 39:case 40:case 33:case 34:case 36:case 35:t.preventDefault(),this.buttonClick(t)}},l.prototype.wireButtonEvt=function(t){t?(C.EventHandler.remove(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut),C.EventHandler.remove(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut),C.EventHandler.remove(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse),C.EventHandler.remove(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),C.EventHandler.remove(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse),C.EventHandler.remove(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),C.EventHandler.remove(this.firstBtn,"focusout",this.sliderFocusOut),C.EventHandler.remove(this.secondBtn,"focusout",this.sliderFocusOut)):(C.EventHandler.add(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut,this),C.EventHandler.add(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut,this),C.EventHandler.add(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse,this),C.EventHandler.add(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),C.EventHandler.add(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse,this),C.EventHandler.add(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),C.EventHandler.add(this.firstBtn,"focusout",this.sliderFocusOut,this),C.EventHandler.add(this.secondBtn,"focusout",this.sliderFocusOut,this))},l.prototype.rangeBarMousedown=function(t){var e,i,s;t.preventDefault(),this.focusSliderElement(),"Range"===this.type&&this.drag&&t.target===this.rangeBar&&(s=i=void 0,"mousedown"===t.type?(i=(e=[t.clientX,t.clientY])[0],s=e[1]):"touchstart"===t.type&&(i=(e=[t.changedTouches[0].clientX,t.changedTouches[0].clientY])[0],s=e[1]),"Horizontal"===this.orientation?(this.firstPartRemain=i-this.rangeBar.getBoundingClientRect().left,this.secondPartRemain=this.rangeBar.getBoundingClientRect().right-i):(this.firstPartRemain=s-this.rangeBar.getBoundingClientRect().top,this.secondPartRemain=this.rangeBar.getBoundingClientRect().bottom-s),this.minDiff=this.handleVal2-this.handleVal1,this.tooltipToggle(this.rangeBar),(t=this.element.querySelector("."+a))&&t.classList.remove(a),C.EventHandler.add(document,"mousemove touchmove",this.dragRangeBarMove,this),C.EventHandler.add(document,"mouseup touchend",this.dragRangeBarUp,this))},l.prototype.elementClick=function(t){this.isDragComplete?this.isDragComplete=!1:(t.preventDefault(),this.focusSliderElement(),this.sliderBarClick(t),this.focusHandle())},l.prototype.wireEvents=function(){this.onresize=this.reposition.bind(this),window.addEventListener("resize",this.onresize),this.enabled&&!this.readonly&&(C.EventHandler.add(this.element,"click",this.elementClick,this),"Range"===this.type&&this.drag&&C.EventHandler.add(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown,this),C.EventHandler.add(this.sliderContainer,"keydown",this.keyDown,this),C.EventHandler.add(this.sliderContainer,"keyup",this.keyUp,this),C.EventHandler.add(this.element,"focusout",this.sliderFocusOut,this),C.EventHandler.add(this.sliderContainer,"mouseover mouseout touchstart touchend",this.hover,this),this.wireFirstHandleEvt(!1),"Range"===this.type&&this.wireSecondHandleEvt(!1),this.showButtons&&this.wireButtonEvt(!1),this.wireMaterialTooltipEvent(!1),this.isForm)&&C.EventHandler.add(this.formElement,"reset",this.formResetHandler,this)},l.prototype.unwireEvents=function(){C.EventHandler.remove(this.element,"click",this.elementClick),"Range"===this.type&&this.drag&&C.EventHandler.remove(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown),C.EventHandler.remove(this.sliderContainer,"keydown",this.keyDown),C.EventHandler.remove(this.sliderContainer,"keyup",this.keyUp),C.EventHandler.remove(this.element,"focusout",this.sliderFocusOut),C.EventHandler.remove(this.sliderContainer,"mouseover mouseout touchstart touchend",this.hover),this.wireFirstHandleEvt(!0),"Range"===this.type&&this.wireSecondHandleEvt(!0),this.showButtons&&this.wireButtonEvt(!0),this.wireMaterialTooltipEvent(!0),C.EventHandler.remove(this.element,"reset",this.formResetHandler)},l.prototype.formResetHandler=function(){this.setProperties({value:this.formResetValue},!0),this.setValue()},l.prototype.keyUp=function(t){var e;9===t.keyCode&&t.target.classList.contains(je)&&(this.focusSliderElement(),t.target.classList.contains(a)||(this.element.querySelector("."+a)&&this.element.querySelector("."+a).classList.remove(a),t.target.classList.add(a),(e=t.target.parentElement)===this.element&&(e.querySelector("."+di).classList.add(ki),"Range"!==this.type&&"MinRange"!==this.type||e.querySelector("."+_e).classList.add(Oi)),"Range"===this.type&&((e=t.target.previousSibling)&&e.classList.contains(je)?this.activeHandle=2:this.activeHandle=1),this.getHandle().focus(),this.tooltipToggle(this.getHandle()))),this.closeTooltip(),this.changeEvent("changed",t)},l.prototype.hover=function(t){C.isNullOrUndefined(t)||("mouseover"===t.type||"touchmove"===t.type||"mousemove"===t.type||"pointermove"===t.type||"touchstart"===t.type?this.sliderContainer.classList.add(ti):(this.sliderContainer.classList.remove(ti),t=t.currentTarget,this.tooltip.isVisible&&"Always"!==this.tooltip.showOn&&this.tooltipObj&&this.isMaterialTooltip&&!t.classList.contains(vi)&&!t.classList.contains(a)&&this.closeMaterialTooltip()))},l.prototype.sliderFocusOut=function(t){t.relatedTarget!==this.secondHandle&&t.relatedTarget!==this.firstHandle&&t.relatedTarget!==this.element&&t.relatedTarget!==this.firstBtn&&t.relatedTarget!==this.secondBtn&&(this.closeMaterialTooltip(),this.closeTooltip(),this.element.querySelector("."+a)&&this.element.querySelector("."+a).classList.remove(a),this.element.querySelector("."+ki)&&(this.element.querySelector("."+ki).classList.remove(ki),"Range"!==this.type&&"MinRange"!==this.type||!this.element.querySelector("."+Oi)||this.element.querySelector("."+Oi).classList.remove(Oi)),this.hiddenInput.focus(),this.hiddenInput.blur(),this.isElementFocused=!1)},l.prototype.removeElement=function(t){t.parentNode&&t.parentNode.removeChild(t)},l.prototype.changeSliderType=function(t,e){this.isMaterialTooltip&&this.materialHandle&&(this.sliderContainer.classList.remove(pi),this.removeElement(this.materialHandle),this.materialHandle=void 0),this.removeElement(this.firstHandle),this.firstHandle=void 0,"Default"!==t&&("Range"===t&&(this.removeElement(this.secondHandle),this.secondHandle=void 0),this.removeElement(this.rangeBar),this.rangeBar=void 0),this.tooltip.isVisible&&!C.isNullOrUndefined(this.tooltipObj)&&(this.tooltipObj.destroy(),this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0),this.limits.enabled&&("MinRange"===t||"Default"===t?C.isNullOrUndefined(this.limitBarFirst)||(this.removeElement(this.limitBarFirst),this.limitBarFirst=void 0):C.isNullOrUndefined(this.limitBarSecond)||(this.removeElement(this.limitBarSecond),this.limitBarSecond=void 0)),this.activeHandle=1,this.getThemeInitialization(),"Range"===this.type&&this.rangeValueUpdate(),this.createRangeBar(),this.limits.enabled&&this.createLimitBar(),this.setHandler(),this.setOrientClass(),this.wireFirstHandleEvt(!this.enabled),"Range"===this.type&&this.wireSecondHandleEvt(!this.enabled),this.setValue(),this.tooltip.isVisible&&(this.renderTooltip(),this.wireMaterialTooltipEvent(!1)),this.setBarColor(),"tooltip"!==e&&this.updateConfig(),this.readonly&&(this.sliderContainer.classList.remove(Ui),this.setReadOnly())},l.prototype.changeRtl=function(){var t;this.enableRtl||"Range"!==this.type||(this.value=[this.handleVal2,this.handleVal1]),this.updateConfig(),this.tooltip.isVisible&&this.tooltipObj.refresh(this.firstHandle),this.showButtons&&(t=this.enableRtl&&"Vertical"!==this.orientation,C.attributes(t?this.secondBtn:this.firstBtn,{"aria-label":"Decrease",title:"Decrease"}),C.attributes(t?this.firstBtn:this.secondBtn,{"aria-label":"Increase",title:"Increase"}))},l.prototype.changeOrientation=function(){this.changeSliderType(this.type,"null")},l.prototype.updateConfig=function(){this.setEnableRTL(),this.setValue(),this.tooltip.isVisible&&this.refreshTooltip(this.tooltipTarget),"None"!==this.ticks.placement&&this.ul&&(this.removeElement(this.ul),this.ul=void 0,this.renderScale()),this.limitsPropertyChange()},l.prototype.limitsPropertyChange=function(){this.limits.enabled?(C.isNullOrUndefined(this.limitBarFirst)&&"Range"!==this.type&&this.createLimitBar(),C.isNullOrUndefined(this.limitBarFirst)&&C.isNullOrUndefined(this.limitBarSecond)&&"Range"===this.type&&this.createLimitBar(),this.setLimitBar(),this.setValue()):(C.isNullOrUndefined(this.limitBarFirst)||C.detach(this.limitBarFirst),C.isNullOrUndefined(this.limitBarSecond)||C.detach(this.limitBarSecond))},l.prototype.getPersistData=function(){return this.addOnPersist(["value"])},l.prototype.destroy=function(){Me.prototype.destroy.call(this),this.unwireEvents(),window.removeEventListener("resize",this.onresize),C.removeClass([this.sliderContainer],[si]),this.firstHandle.removeAttribute("aria-orientation"),"Range"===this.type&&this.secondHandle.removeAttribute("aria-orientation"),this.sliderContainer.parentNode&&this.sliderContainer.parentNode.insertBefore(this.element,this.sliderContainer),C.detach(this.sliderContainer),this.tooltip.isVisible&&this.tooltipObj.destroy(),this.element.innerHTML="",this.hiddenInput=null,this.sliderContainer=null,this.sliderTrack=null,this.rangeBar=null,this.firstHandle=null,this.secondHandle=null,this.tickElementCollection=null,this.ul=null,this.firstBtn=null,this.secondBtn=null,this.materialHandle=null,this.tooltipObj=null,this.tooltipTarget=null,this.limitBarFirst=null,this.limitBarSecond=null,this.firstChild=null,this.lastChild=null,this.tooltipElement=null},l.prototype.onPropertyChanged=function(t,e){for(var i=this,s=0,n=Object.keys(t);s<n.length;s++){var a,l=n[s];switch(l){case"cssClass":this.setCSSClass(e.cssClass);break;case"value":t&&e&&(a=C.isNullOrUndefined(t.value)?"Range"===this.type?[this.min,this.max]:this.min:t.value,this.setProperties({value:a},!0),C.isNullOrUndefined(e.value)||e.value.toString()===a.toString()||(this.setValue(),this.refreshTooltip(this.tooltipTarget),"Range"===this.type&&(C.isNullOrUndefined(t.value)||e.value[1]===a[1]?this.activeHandle=1:this.activeHandle=2)));break;case"min":case"step":case"max":this.setMinMaxValue();break;case"tooltip":C.isNullOrUndefined(t.tooltip)||C.isNullOrUndefined(e.tooltip)||(this.initialTooltip=!0,this.setTooltip(l),this.showButtons)||this.wireEvents();break;case"type":C.isNullOrUndefined(e)||!Object.keys(e).length||C.isNullOrUndefined(e.type)||(this.changeSliderType(e.type,l),this.setZindex());break;case"enableRtl":e.enableRtl!==t.enableRtl&&"Vertical"!==this.orientation&&(this.rtl=e.enableRtl,this.changeRtl());break;case"limits":this.limitsPropertyChange();break;case"orientation":this.changeOrientation();break;case"ticks":C.isNullOrUndefined(this.sliderContainer.querySelector("."+Ze))||(C.detach(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(t){t.match(/e-scale-/)&&i.sliderContainer.classList.remove(t)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex());break;case"locale":this.showButtons&&this.buttonTitle();break;case"showButtons":t.showButtons?(this.setButtons(),this.reposition(),this.enabled&&!this.readonly&&this.wireButtonEvt(!1)):this.firstBtn&&this.secondBtn&&(this.sliderContainer.removeChild(this.firstBtn),this.sliderContainer.removeChild(this.secondBtn),this.sliderContainer.classList.remove(Pi),this.firstBtn=void 0,this.secondBtn=void 0,this.reposition());break;case"enabled":this.setEnabled();break;case"readonly":this.setReadOnly();break;case"customValues":this.setValue(),this.reposition();break;case"colorRange":this.reposition();break;case"width":this.setElementWidth(t.width),this.setMinMaxValue(),this.limits&&this.limitsPropertyChange()}}},l.prototype.setReadOnly=function(){this.readonly?(this.unwireEvents(),this.sliderContainer.classList.add(Ui)):(this.wireEvents(),this.sliderContainer.classList.remove(Ui))},l.prototype.setMinMaxValue=function(){var e=this;this.setValue(),this.refreshTooltip(this.tooltipTarget),C.isNullOrUndefined(this.sliderContainer.querySelector("."+Ze))||this.ul&&(C.detach(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(t){t.match(/e-scale-/)&&e.sliderContainer.classList.remove(t)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex())},l.prototype.setZindex=function(){this.zIndex=6,C.isNullOrUndefined(this.ticks)||"None"===this.ticks.placement||C.isNullOrUndefined(this.ul)||C.isNullOrUndefined(this.element)||(this.ul.style.zIndex=this.zIndex+-7+"",this.element.style.zIndex=this.zIndex+2+""),this.isMaterial||this.isMaterial3||C.isNullOrUndefined(this.ticks)||"Both"!==this.ticks.placement||(this.element.style.zIndex=this.zIndex+2+""),C.isNullOrUndefined(this.firstHandle)||(this.firstHandle.style.zIndex=this.zIndex+3+""),"Range"!==this.type||C.isNullOrUndefined(this.secondHandle)||(this.secondHandle.style.zIndex=this.zIndex+4+"")},l.prototype.setTooltip=function(t){this.changeSliderType(this.type,t)},l.prototype.setBarColor=function(){for(var t,e,i=this.sliderTrack.lastElementChild;i;)this.sliderTrack.removeChild(i),i=this.sliderTrack.lastElementChild;for(var s,n,a,l=0;l<this.colorRange.length;l++)C.isNullOrUndefined(this.colorRange[l].start)||C.isNullOrUndefined(this.colorRange[l].end)||this.colorRange[l].end>this.colorRange[l].start&&(this.colorRange[l].start<this.min&&(this.colorRange[l].start=this.min),this.colorRange[l].end>this.max&&(this.colorRange[l].end=this.max),s=this.checkHandlePosition(this.colorRange[l].start),n=this.checkHandlePosition(this.colorRange[l].end),(a=this.createElement("div")).style.backgroundColor=this.colorRange[l].color,a.style.border="1px solid "+this.colorRange[l].color,"Horizontal"===this.orientation?(e=ci,t=this.enableRtl?C.isNullOrUndefined(this.customValues)?this.checkHandlePosition(this.max)-this.checkHandlePosition(this.colorRange[l].end):this.checkHandlePosition(this.customValues.length-this.colorRange[l].end-1):this.checkHandlePosition(this.colorRange[l].start),a.style.width=n-s+"px",a.style.left=t+"px"):(e=mi,t=this.checkHandlePosition(this.colorRange[l].start),a.style.height=n-s+"px",a.style.bottom=t+"px"),a.classList.add(e),this.sliderTrack.appendChild(a))},l.prototype.getModuleName=function(){return"slider"},s([C.Property(null)],l.prototype,"value",void 0),s([C.Property(null)],l.prototype,"customValues",void 0),s([C.Property(1)],l.prototype,"step",void 0),s([C.Property(null)],l.prototype,"width",void 0),s([C.Property(0)],l.prototype,"min",void 0),s([C.Property(100)],l.prototype,"max",void 0),s([C.Property(!1)],l.prototype,"readonly",void 0),s([C.Property("Default")],l.prototype,"type",void 0),s([C.Collection([{}],Ne)],l.prototype,"colorRange",void 0),s([C.Complex({},Le)],l.prototype,"ticks",void 0),s([C.Complex({},Ue)],l.prototype,"limits",void 0),s([C.Property(!0)],l.prototype,"enabled",void 0),s([C.Complex({},Ve)],l.prototype,"tooltip",void 0),s([C.Property(!1)],l.prototype,"showButtons",void 0),s([C.Property(!0)],l.prototype,"enableAnimation",void 0),s([C.Property("Horizontal")],l.prototype,"orientation",void 0),s([C.Property("")],l.prototype,"cssClass",void 0),s([C.Property(!0)],l.prototype,"enableHtmlSanitizer",void 0),s([C.Event()],l.prototype,"created",void 0),s([C.Event()],l.prototype,"change",void 0),s([C.Event()],l.prototype,"changed",void 0),s([C.Event()],l.prototype,"renderingTicks",void 0),s([C.Event()],l.prototype,"renderedTicks",void 0),s([C.Event()],l.prototype,"tooltipChange",void 0),s([C.NotifyPropertyChanges],l));function l(t,e){t=Me.call(this,t,e)||this;return t.horDir="left",t.verDir="bottom",t.transition={handle:"left .4s cubic-bezier(.25, .8, .25, 1), right .4s cubic-bezier(.25, .8, .25, 1), top .4s cubic-bezier(.25, .8, .25, 1) , bottom .4s cubic-bezier(.25, .8, .25, 1)",rangeBar:"all .4s cubic-bezier(.25, .8, .25, 1)"},t.transitionOnMaterialTooltip={handle:"left 1ms ease-out, right 1ms ease-out, bottom 1ms ease-out, top 1ms ease-out",rangeBar:"left 1ms ease-out, right 1ms ease-out, bottom 1ms ease-out, width 1ms ease-out, height 1ms ease-out"},t.scaleTransform="transform .4s cubic-bezier(.25, .8, .25, 1)",t.customAriaText=null,t.drag=!0,t.isDragComplete=!1,t.initialTooltip=!0,t}Wi=function(t,e){return(Wi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Wi,qi,ji,t=function(t,e){function i(){this.constructor=t}Wi(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},s=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},_i={EMAIL:new RegExp("^[A-Za-z0-9._%+-]{1,}@[A-Za-z0-9._%+-]{1,}([.]{1}[a-zA-Z0-9]{2,}|[.]{1}[a-zA-Z0-9]{2,4}[.]{1}[a-zA-Z0-9]{2,4})$"),URL:/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/m,DATE_ISO:new RegExp("^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$"),DIGITS:new RegExp("^[0-9]*$"),PHONE:new RegExp("^[+]?[0-9]{9,13}$"),CREDITCARD:new RegExp("^\\d{13,16}$")},Xi=((Xi=o.ErrorOption||(o.ErrorOption={}))[Xi.Message=0]="Message",Xi[Xi.Label=1]="Label",qi=C.Base,t(r,qi),(ji=r).prototype.addRules=function(t,e){t&&(this.rules.hasOwnProperty(t)?C.extend(this.rules[""+t],e,{}):this.rules[""+t]=e)},r.prototype.removeRules=function(t,e){if(t||e){if(this.rules[""+t]&&!e)delete this.rules[""+t];else if(!C.isNullOrUndefined(this.rules[""+t]&&e))for(var i=0;i<e.length;i++)delete this.rules[""+t][e[parseInt(i.toString(),10)]]}else this.rules={}},r.prototype.validate=function(e){var t=Object.keys(this.rules);if(e&&t.length)return this.validateRules(e),-1!==t.indexOf(e)&&0===this.errorRules.filter(function(t){return t.name===e}).length;this.errorRules=[];for(var i=0,s=t;i<s.length;i++){var n=s[i];this.validateRules(n)}return 0===this.errorRules.length},r.prototype.reset=function(){this.element.reset(),this.clearForm()},r.prototype.getInputElement=function(t){return this.inputElement=C.select('[name="'+t+'"]',this.element),this.inputElement},r.prototype.destroy=function(){this.reset(),this.unwireEvents(),this.rules={};for(var t=0,e=C.selectAll("."+this.errorClass+", ."+this.validClass,this.element);t<e.length;t++){var i=e[t];C.detach(i)}qi.prototype.destroy.call(this),this.infoElement=null,C.onIntlChange.off("notifyExternalChange",this.afterLocalization)},r.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)"locale"===s[i]&&this.localeFunc()},r.prototype.localeFunc=function(){for(var t=0,e=Object.keys(this.defaultMessages);t<e.length;t++){var i=e[t],s=(this.l10n.setLocale(this.locale),this.l10n.getConstant(i));this.localyMessage[""+i]=s}},r.prototype.getModuleName=function(){return"formvalidator"},r.prototype.afterLocalization=function(t){this.locale=t.locale,this.localeFunc()},r.prototype.refresh=function(){this.unwireEvents(),this.inputElements=C.selectAll(this.selectQuery,this.element),this.wireEvents()},r.prototype.clearForm=function(){this.errorRules=[],this.validated=[];for(var t=0,e=C.selectAll(this.selectQuery,this.element);t<e.length;t++){var i=e[t],s=(i.removeAttribute("aria-invalid"),i.parentElement),n=s.parentElement;(s.classList.contains("e-control-wrapper")||s.classList.contains("e-wrapper")||i.classList.contains("e-input")&&s.classList.contains("e-input-group")?s:null!=n&&(n.classList.contains("e-control-wrapper")||n.classList.contains("e-wrapper"))?n:i).classList.remove(this.errorClass),0<i.name.length&&(this.getInputElement(i.name),this.getErrorElement(i.name),this.hideMessage(i.name)),(s.classList.contains("e-control-wrapper")||s.classList.contains("e-wrapper")||i.classList.contains("e-input")&&s.classList.contains("e-input-group")?s:null!=n&&(n.classList.contains("e-control-wrapper")||n.classList.contains("e-wrapper"))?n:i).classList.remove(this.validClass)}},r.prototype.createHTML5Rules=function(){for(var t=["required","validateHidden","regex","rangeLength","maxLength","minLength","dateIso","digits","pattern","data-val-required","type","data-validation","min","max","range","equalTo","data-val-minlength-min","data-val-equalto-other","data-val-maxlength-max","data-val-range-min","data-val-regex-pattern","data-val-length-max","data-val-creditcard","data-val-phone"],e=["hidden","email","url","date","number","tel"],i=0,s=this.inputElements;i<s.length;i++){for(var n=s[i],a={},l=0,r=t;l<r.length;l++){var o=r[l];if(null!==n.getAttribute(o))switch(o){case"required":this.defRule(n,a,o,n.required);break;case"data-validation":o=n.getAttribute(o),this.defRule(n,a,o,!0);break;case"type":-1!==e.indexOf(n.type)&&this.defRule(n,a,n.type,!0);break;case"rangeLength":case"range":this.defRule(n,a,o,JSON.parse(n.getAttribute(o)));break;case"equalTo":var h=n.getAttribute(o);this.defRule(n,a,o,h);break;default:"true"===n.getAttribute("data-val")?this.annotationRule(n,a,o,n.getAttribute(o)):this.defRule(n,a,o,n.getAttribute(o))}}0!==Object.keys(a).length&&this.addRules(n.name,a)}},r.prototype.annotationRule=function(t,e,i,s){var n=i.split("-"),a=["required","creditcard","phone","maxlength","minlength","range","regex","equalto"],l=n[n.length-1],n=n[n.length-2];if(-1!==a.indexOf(l))switch(l){case"required":this.defRule(t,e,"required",s);break;case"creditcard":this.defRule(t,e,"creditcard",s);break;case"phone":this.defRule(t,e,"tel",s)}else if(-1!==a.indexOf(n))switch(n){case"maxlength":this.defRule(t,e,"maxLength",s);break;case"minlength":this.defRule(t,e,"minLength",s);break;case"range":var r=t.getAttribute("data-val-range-min"),o=t.getAttribute("data-val-range-max");this.defRule(t,e,"range",[r,o]);break;case"equalto":r=t.getAttribute(i).split(".");this.defRule(t,e,"equalTo",r[r.length-1]);break;case"regex":this.defRule(t,e,"regex",s)}},r.prototype.defRule=function(t,e,i,s){var n,a=t.getAttribute("data-"+i+"-message"),l=t.getAttribute("data-val-"+i);this.rules[t.name]&&"validateHidden"!==i&&"hidden"!==i&&(this.getInputElement(t.name),n=this.getErrorMessage(this.rules[t.name][""+i],i)),a?s=[s,a]:l?s=[s,l]:n&&(s=[s,n]),e[""+i]=s},r.prototype.wireEvents=function(){for(var t=0,e=this.inputElements;t<e.length;t++){var i=e[t];ji.isCheckable(i)?C.EventHandler.add(i,"click",this.clickHandler,this):"SELECT"===i.tagName?C.EventHandler.add(i,"change",this.changeHandler,this):(C.EventHandler.add(i,"focusout",this.focusOutHandler,this),C.EventHandler.add(i,"keyup",this.keyUpHandler,this))}C.EventHandler.add(this.element,"submit",this.submitHandler,this),C.EventHandler.add(this.element,"reset",this.resetHandler,this)},r.prototype.unwireEvents=function(){for(var t=0,e=this.inputElements;t<e.length;t++){var i=e[t];C.EventHandler.clearEvents(i)}C.EventHandler.remove(this.element,"submit",this.submitHandler),C.EventHandler.remove(this.element,"reset",this.resetHandler)},r.prototype.focusOutHandler=function(t){this.trigger("focusout",t);t=t.target;this.rules[t.name]&&(this.rules[t.name][this.required]||0<t.value.length?this.validate(t.name):-1===this.validated.indexOf(t.name)&&this.validated.push(t.name))},r.prototype.keyUpHandler=function(t){this.trigger("keyup",t);var e=t.target;(9!==t.which||this.rules[e.name]&&(!this.rules[e.name]||this.rules[e.name][this.required]))&&-1!==this.validated.indexOf(e.name)&&this.rules[e.name]&&-1===[16,17,18,20,35,36,37,38,39,40,45,144,225].indexOf(t.which)&&this.validate(e.name)},r.prototype.clickHandler=function(t){this.trigger("click",t);t=t.target;"submit"!==t.type?this.validate(t.name):null!==t.getAttribute("formnovalidate")&&(this.allowSubmit=!0)},r.prototype.changeHandler=function(t){this.trigger("change",t);t=t.target;this.validate(t.name)},r.prototype.submitHandler=function(t){this.trigger("submit",t),this.allowSubmit||this.validate()?this.allowSubmit=!1:t.preventDefault()},r.prototype.resetHandler=function(){this.clearForm()},r.prototype.validateRules=function(t){if(this.rules[""+t]){var e=Object.keys(this.rules[""+t]),i=!1,s=!1,n=e.indexOf("validateHidden"),a=e.indexOf("hidden");if(this.getInputElement(t),-1!==n&&(s=!0),!(i=-1!==a?!0:i)||s){-1!==n&&e.splice(n,1),-1!==a&&e.splice(a-1,1),this.getErrorElement(t);for(var l=0,r=e;l<r.length;l++){var o=r[l],h=this.getErrorMessage(this.rules[""+t][""+o],o),u={name:t,message:h},h={inputName:t,element:this.inputElement,message:h};if(!this.isValid(t,o)&&!this.inputElement.classList.contains(this.ignore)){this.removeErrorRules(t),this.errorRules.push(u),this.inputElement.setAttribute("aria-invalid","true"),this.inputElement.setAttribute("aria-describedby",this.inputElement.id+"-info");var p=this.inputElement.parentElement,d=p.parentElement;(p.classList.contains("e-control-wrapper")||p.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&p.classList.contains("e-input-group")?(p.classList.add(this.errorClass),p):null!=d&&(d.classList.contains("e-control-wrapper")||d.classList.contains("e-wrapper"))?(d.classList.add(this.errorClass),d):(this.inputElement.classList.add(this.errorClass),this.inputElement)).classList.remove(this.validClass),this.infoElement?this.showMessage(u):this.createErrorElement(t,u.message,this.inputElement),h.errorElement=this.infoElement,h.status="failure",(p.classList.contains("e-control-wrapper")||p.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&p.classList.contains("e-input-group")?(p.classList.add(this.errorClass),p):null!=d&&(d.classList.contains("e-control-wrapper")||d.classList.contains("e-wrapper"))?(d.classList.add(this.errorClass),d):(this.inputElement.classList.add(this.errorClass),this.inputElement)).classList.remove(this.validClass),this.optionalValidationStatus(t,h),this.trigger("validationComplete",h),"required"===o&&this.inputElement.setAttribute("aria-required","true");break}this.hideMessage(t),h.status="success",this.trigger("validationComplete",h)}}}},r.prototype.optionalValidationStatus=function(t,e){this.rules[""+t][this.required]||this.inputElement.value.length||C.isNullOrUndefined(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),e.status="",this.hideMessage(t))},r.prototype.isValid=function(t,e){var i=this.rules[""+t][""+e],i=i instanceof Array&&"string"==typeof i[1]?i[0]:i,s=this.rules[""+t][""+e],n="min"!==e&&"max"!==e||!this.rules[""+t].date||"string"!=typeof this.rules[""+t].date?null:this.rules[""+t].date,i={value:this.inputElement.value,param:i,element:this.inputElement,formElement:this.element,format:n};return this.trigger("validationBegin",i),!i.param&&"required"===e||(s&&"function"==typeof s[0]?s[0].call(this,{element:this.inputElement,value:this.inputElement.value}):ji.isCheckable(this.inputElement)?"required"!==e||0<C.selectAll('input[name="'+t+'"]:checked',this.element).length:ji.checkValidator[""+e](i))},r.prototype.getErrorMessage=function(t,e){var i=(a=this.inputElement.getAttribute("data-"+e+"-message")?this.inputElement.getAttribute("data-"+e+"-message"):t instanceof Array&&"string"==typeof t[1]?t[1]:(0!==Object.keys(this.localyMessage).length?this.localyMessage:this.defaultMessages)[""+e]).match(/{(\d)}/g);if(!C.isNullOrUndefined(i))for(var s=0;s<i.length;s++)var n=t instanceof Array?t[parseInt(s.toString(),10)]:t,a=a.replace(i[parseInt(s.toString(),10)],n);return a},r.prototype.createErrorElement=function(t,e,i){var s,e=C.createElement(this.errorElement,{className:this.errorClass,innerHTML:e,attrs:{for:t}});this.errorOption===o.ErrorOption.Message&&(e.classList.remove(this.errorClass),e.classList.add("e-message"),e=C.createElement(this.errorContainer,{className:this.errorClass,innerHTML:e.outerHTML})),e.id=this.inputElement.name+"-info",this.element.querySelector('[data-valmsg-for="'+i.id+'"]')?this.element.querySelector('[data-valmsg-for="'+i.id+'"]').appendChild(e):!0===i.hasAttribute("data-msg-containerid")?(i=i.getAttribute("data-msg-containerid"),C.select("#"+i,this.element).appendChild(e)):null!=this.customPlacement?this.customPlacement.call(this,this.inputElement,e):(s=(i=this.inputElement.parentElement).parentElement,i.classList.contains("e-control-wrapper")||i.classList.contains("e-wrapper")?s.insertBefore(e,i.nextSibling):s.classList.contains("e-control-wrapper")||s.classList.contains("e-wrapper")?s.parentElement.insertBefore(e,s.nextSibling):i.insertBefore(e,this.inputElement.nextSibling)),e.style.display="block",this.getErrorElement(t),this.validated.push(t),this.checkRequired(t)},r.prototype.getErrorElement=function(t){return this.infoElement=C.select(this.errorElement+"."+this.errorClass,this.inputElement.parentElement),this.infoElement||(this.infoElement=C.select(this.errorElement+"."+this.errorClass+'[for="'+t+'"]',this.element)),this.infoElement},r.prototype.removeErrorRules=function(t){for(var e=0;e<this.errorRules.length;e++)this.errorRules[parseInt(e.toString(),10)].name===t&&this.errorRules.splice(e,1)},r.prototype.showMessage=function(t){this.infoElement.style.display="block",this.infoElement.innerHTML=t.message,this.checkRequired(t.name)},r.prototype.hideMessage=function(t){var e;this.infoElement&&(this.infoElement.style.display="none",this.removeErrorRules(t),e=(t=this.inputElement.parentElement).parentElement,(t.classList.contains("e-control-wrapper")||t.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&t.classList.contains("e-input-group")?(t.classList.add(this.validClass),t):null!=e&&(e.classList.contains("e-control-wrapper")||e.classList.contains("e-wrapper"))?(e.classList.add(this.validClass),e):(this.inputElement.classList.add(this.validClass),this.inputElement)).classList.remove(this.errorClass),this.inputElement.setAttribute("aria-invalid","false"))},r.prototype.checkRequired=function(t){this.rules[""+t][this.required]||this.inputElement.value.length||C.isNullOrUndefined(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),this.hideMessage(t))},r.isCheckable=function(t){t=t.getAttribute("type");return t&&("checkbox"===t||"radio"===t||"submit"===t)},r.checkValidator={required:function(t){return isNaN(Date.parse(t.value))?0<t.value.toString().length:!isNaN(new Date(t.value).getTime())},email:function(t){return _i.EMAIL.test(t.value)},url:function(t){return _i.URL.test(t.value)},dateIso:function(t){return _i.DATE_ISO.test(t.value)},tel:function(t){return _i.PHONE.test(t.value)},creditcard:function(t){return _i.CREDITCARD.test(t.value)},number:function(t){return!isNaN(Number(t.value))&&-1===t.value.indexOf(" ")},digits:function(t){return _i.DIGITS.test(t.value)},maxLength:function(t){return t.value.length<=Number(t.param)},minLength:function(t){return t.value.length>=Number(t.param)},rangeLength:function(t){var e=t.param;return t.value.length>=e[0]&&t.value.length<=e[1]},range:function(t){var e=t.param;return!isNaN(Number(t.value))&&Number(t.value)>=e[0]&&Number(t.value)<=e[1]},date:function(t){var e,i;return C.isNullOrUndefined(t.param)||"string"!=typeof t.param||""===t.param?!isNaN(new Date(t.value).getTime()):(i=new C.Internationalization,e={format:t.param.toString(),type:"dateTime",skeleton:"yMd"},i=i.parseDate(t.value,e),!C.isNullOrUndefined(i)&&i instanceof Date&&!isNaN(+i))},max:function(t){var e,i,s;return isNaN(Number(t.value))?t.format&&""!==t.format?(s=new C.Internationalization,e={format:t.format.toString(),type:"dateTime",skeleton:"yMd"},i=s.parseDate(t.value,e),s="string"==typeof t.param?s.parseDate(JSON.parse(JSON.stringify(t.param)),e):t.param,new Date(i).getTime()<=new Date(s).getTime()):new Date(t.value).getTime()<=new Date(JSON.parse(JSON.stringify(t.param))).getTime():+t.value<=+t.param},min:function(t){var e,i,s;return isNaN(Number(t.value))?-1!==t.value.indexOf(",")?(s=t.value.replace(/,/g,""),parseFloat(s)>=Number(t.param)):t.format&&""!==t.format?(s=new C.Internationalization,e={format:t.format.toString(),type:"dateTime",skeleton:"yMd"},i=s.parseDate(t.value,e),s="string"==typeof t.param?s.parseDate(JSON.parse(JSON.stringify(t.param)),e):t.param,new Date(i).getTime()>=new Date(s).getTime()):new Date(t.value).getTime()>=new Date(JSON.parse(JSON.stringify(t.param))).getTime():+t.value>=+t.param},regex:function(t){return new RegExp(t.param).test(t.value)},equalTo:function(t){var e=t.formElement.querySelector("#"+t.param);return t.param=e.value,t.param===t.value}},s([C.Property("")],r.prototype,"locale",void 0),s([C.Property("e-hidden")],r.prototype,"ignore",void 0),s([C.Property()],r.prototype,"rules",void 0),s([C.Property("e-error")],r.prototype,"errorClass",void 0),s([C.Property("e-valid")],r.prototype,"validClass",void 0),s([C.Property("label")],r.prototype,"errorElement",void 0),s([C.Property("div")],r.prototype,"errorContainer",void 0),s([C.Property(o.ErrorOption.Label)],r.prototype,"errorOption",void 0),s([C.Event()],r.prototype,"focusout",void 0),s([C.Event()],r.prototype,"keyup",void 0),s([C.Event()],r.prototype,"click",void 0),s([C.Event()],r.prototype,"change",void 0),s([C.Event()],r.prototype,"submit",void 0),s([C.Event()],r.prototype,"validationBegin",void 0),s([C.Event()],r.prototype,"validationComplete",void 0),s([C.Event()],r.prototype,"customPlacement",void 0),ji=s([C.NotifyPropertyChanges],r));function r(t,e){e=qi.call(this,e,t)||this;if(e.validated=[],e.errorRules=[],e.allowSubmit=!1,e.required="required",e.infoElement=null,e.inputElement=null,e.selectQuery="input:not([type=reset]):not([type=button]), select, textarea",e.localyMessage={},e.defaultMessages={required:"This field is required.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateIso:"Please enter a valid date ( ISO ).",creditcard:"Please enter valid card number",number:"Please enter a valid number.",digits:"Please enter only digits.",maxLength:"Please enter no more than {0} characters.",minLength:"Please enter at least {0} characters.",rangeLength:"Please enter a value between {0} and {1} characters long.",range:"Please enter a value between {0} and {1}.",max:"Please enter a value less than or equal to {0}.",min:"Please enter a value greater than or equal to {0}.",regex:"Please enter a correct value.",tel:"Please enter a valid phone number.",pattern:"Please enter a correct pattern value.",equalTo:"Please enter the valid match text"},void 0===e.rules&&(e.rules={}),e.l10n=new C.L10n("formValidator",e.defaultMessages,e.locale),e.locale&&e.localeFunc(),C.onIntlChange.on("notifyExternalChange",e.afterLocalization,e),t="string"==typeof t?C.select(t,document):t,null!=e.element)return e.element.setAttribute("novalidate",""),e.inputElements=C.selectAll(e.selectQuery,e.element),e.createHTML5Rules(),e.wireEvents(),e}Ki=function(t,e){return(Ki=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Ki,Yi,t=function(t,e){function i(){this.constructor=t}Ki(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},s=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},Zi="e-file-select",Gi="e-file-drop",Ji="e-upload-files",$i="e-upload-file-list",c="e-file-status",Qi="e-file-name",ts="e-file-type",es="e-file-size",m="e-file-remove-btn",d="e-file-delete-btn",is="e-spinner-pane",v="e-file-abort-btn",ss="e-file-reload-btn",ns="e-upload-drag-hover",as="e-upload-progress-wrap",ls="e-upload-progress-bar",rs="e-progress-bar-text",f="e-upload-progress",g="e-upload-success",y="e-upload-fails",os="e-file-container",hs="e-validation-fails",us="e-disabled",ps="e-rtl-container",ds="e-clear-icon-focus",E="e-file-pause-btn",cs="e-file-play-btn",ms="e-restrict-retry",vs=["title","style","class"],fs="e-form-upload",gs="e-file-invalid",ys=(Yi=C.ChildProperty,t(bs,Yi),s([C.Property("")],bs.prototype,"name",void 0),s([C.Property(null)],bs.prototype,"size",void 0),s([C.Property("")],bs.prototype,"type",void 0),bs);function bs(){return null!==Yi&&Yi.apply(this,arguments)||this}Cs=C.ChildProperty,t(xs,Cs),s([C.Property("Browse...")],xs.prototype,"browse",void 0),s([C.Property("Upload")],xs.prototype,"upload",void 0),s([C.Property("Clear")],xs.prototype,"clear",void 0);var Cs,Es=xs;function xs(){return null!==Cs&&Cs.apply(this,arguments)||this}Ss=C.ChildProperty,t(Ps,Ss),s([C.Property("")],Ps.prototype,"saveUrl",void 0),s([C.Property("")],Ps.prototype,"removeUrl",void 0),s([C.Property(0)],Ps.prototype,"chunkSize",void 0),s([C.Property(3)],Ps.prototype,"retryCount",void 0),s([C.Property(500)],Ps.prototype,"retryAfterDelay",void 0);var Ss,Ts=Ps;function Ps(){return null!==Ss&&Ss.apply(this,arguments)||this}ks=C.Component,t(x,ks),x.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"allowedExtensions":this.setExtensions(this.allowedExtensions),this.clearAll();break;case"enabled":this.setControlStatus();break;case"multiple":this.setMultipleSelection();break;case"enableRtl":this.setRTL(),this.reRenderFileList();break;case"buttons":this.buttons.browse=C.isNullOrUndefined(this.buttons.browse)?"":this.buttons.browse,this.buttons.clear=C.isNullOrUndefined(this.buttons.clear)?"":this.buttons.clear,this.buttons.upload=C.isNullOrUndefined(this.buttons.upload)?"":this.buttons.upload,this.renderButtonTemplates();break;case"dropArea":this.unBindDropEvents(),this.updateDropArea();break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkHTMLAttributes(!0);break;case"files":this.renderPreLoadFiles();break;case"directoryUpload":this.updateDirectoryAttributes();break;case"template":this.isReact?this.reRenderFileList():this.clearAll();break;case"minFileSize":case"maxFileSize":case"autoUpload":case"sequentialUpload":this.clearAll();break;case"locale":this.l10n.setLocale(this.locale),this.setLocalizedTexts(),this.preLocaleObj=C.getValue("currentLocale",this.l10n);break;case"cssClass":this.setCSSClass(e.cssClass)}},x.prototype.setLocalizedTexts=function(){C.isNullOrUndefined(this.template)&&("string"==typeof this.buttons.browse&&(this.browseButton.innerText="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.innerText),this.uploadWrapper)&&!C.isNullOrUndefined(this.uploadWrapper.querySelector("."+Gi))&&(this.uploadWrapper.querySelector("."+Gi).innerHTML=this.localizedTexts("dropFilesHint")),this.updateFileList())},x.prototype.getKeyValue=function(t){for(var e,i=0,s=Object.keys(this.preLocaleObj);i<s.length;i++){var n=s[i];this.preLocaleObj[""+n]===t&&(e=n)}return e},x.prototype.updateFileList=function(){if(0<this.fileList.length&&!C.isNullOrUndefined(this.uploadWrapper.querySelector("."+Ji)))for(var t=0;t<this.fileList.length;t++)this.fileList[t].querySelector(".e-file-status").innerHTML=this.localizedTexts(this.getKeyValue(this.filesData[t].status)),this.filesData[t].status=this.localizedTexts(this.getKeyValue(this.filesData[t].status)),this.fileList[t].classList.contains(g)&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("delete")),this.fileList[t].querySelector(".e-file-play-btn")&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("resume")),this.fileList[t].querySelector(".e-file-remove-btn")&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("remove")),this.fileList[t].querySelector(".e-file-reload-btn")&&this.fileList[t].querySelector(".e-icons").setAttribute("title",this.localizedTexts("retry")),this.autoUpload||(this.uploadButton.innerText="Upload"===this.buttons.upload?this.localizedTexts("Upload"):this.buttons.upload,this.uploadButton.setAttribute("title",this.localizedTexts("Upload")),this.clearButton.innerText="Clear"===this.buttons.clear?this.localizedTexts("Clear"):this.buttons.clear,this.clearButton.setAttribute("title",this.localizedTexts("Clear")))},x.prototype.reRenderFileList=function(){this.listParent&&(C.detach(this.listParent),this.listParent=null,this.fileList=[],this.internalCreateFileList(this.filesData),this.actionButtons)&&(this.removeActionButtons(),this.renderActionButtons(),this.checkActionButtonStatus())},x.prototype.preRender=function(){this.localeText={Browse:"Browse...",Clear:"Clear",Upload:"Upload",invalidFileName:"File Name is not allowed",dropFilesHint:"Or drop files here",invalidMaxFileSize:"File size is too large",invalidMinFileSize:"File size is too small",invalidFileType:"File type is not allowed",uploadFailedMessage:"File failed to upload",uploadSuccessMessage:"File uploaded successfully",removedSuccessMessage:"File removed successfully",removedFailedMessage:"Unable to remove file",inProgress:"Uploading",readyToUploadMessage:"Ready to upload",abort:"Abort",remove:"Remove",cancel:"Cancel",delete:"Delete file",pauseUpload:"File upload paused",pause:"Pause",resume:"Resume",retry:"Retry",fileUploadCancel:"File upload canceled",invalidFileSelection:"Invalid files selected",totalFiles:"Total files",size:"Size"},this.l10n=new C.L10n("uploader",this.localeText,this.locale),this.preLocaleObj=C.getValue("currentLocale",this.l10n),this.formRendered(),this.updateHTMLAttrToElement(),this.checkHTMLAttributes(!1);var t=C.getValue("ej2_instances",this.element);if("EJS-UPLOADER"===this.element.tagName){for(var e=this.createElement("input",{attrs:{type:"file"}}),i=0;i<this.element.attributes.length;i++)"id"!==this.element.attributes[i].nodeName?e.setAttribute(this.element.attributes[i].nodeName,this.element.attributes[i].nodeValue):"id"===this.element.attributes[i].nodeName&&e.setAttribute(this.element.attributes[i].nodeName,C.getUniqueID("uploader")),e.innerHTML=this.element.innerHTML;e.hasAttribute("name")||e.setAttribute("name","UploadFiles"),this.element.appendChild(e),this.element=e,C.setValue("ej2_instances",t,this.element)}t[0].isPureReactComponent&&(C.isNullOrUndefined(t[0].props.name)?!C.isNullOrUndefined(t[0].props.id)&&C.isNullOrUndefined(t[0].props.name)?this.element.setAttribute("name",t[0].props.id):this.element.setAttribute("name","UploadFiles"):this.element.setAttribute("name",t[0].props.name)),C.isNullOrUndefined(this.element.getAttribute("name"))&&this.element.setAttribute("name",this.element.getAttribute("id")),this.element.hasAttribute("type")||this.element.setAttribute("type","file"),this.updateDirectoryAttributes(),this.keyConfigs={enter:"enter"},this.element.hasAttribute("tabindex")&&(this.tabIndex=this.element.getAttribute("tabindex")),this.browserName=C.Browser.info.name,this.uploaderName=this.element.getAttribute("name")},x.prototype.formRendered=function(){var t=C.closest(this.element,"form");if(!C.isNullOrUndefined(t))for(;t&&t!==document.documentElement;t=t.parentElement)"FORM"===t.tagName&&(this.isForm=!0,(this.formElement=t).setAttribute("enctype","multipart/form-data"),t.setAttribute("encoding","multipart/form-data"))},x.prototype.getPersistData=function(){return this.addOnPersist(["filesData"])},x.prototype.getModuleName=function(){return"uploader"},x.prototype.updateDirectoryAttributes=function(){this.directoryUpload?(this.element.setAttribute("directory","true"),this.element.setAttribute("webkitdirectory","true")):(this.element.removeAttribute("directory"),this.element.removeAttribute("webkitdirectory"))},x.prototype.render=function(){this.renderBrowseButton(),this.initializeUpload(),this.updateHTMLAttrToWrapper(),this.wireEvents(),this.setMultipleSelection(),this.setExtensions(this.allowedExtensions),this.setRTL(),this.renderPreLoadFiles(),this.setControlStatus(),this.setCSSClass()},x.prototype.renderBrowseButton=function(){this.browseButton=this.createElement("button",{className:"e-css e-btn",attrs:{type:"button"}}),this.browseButton.setAttribute("tabindex",this.tabIndex),"string"==typeof this.buttons.browse?(this.browseButton.textContent="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.innerText)):this.browseButton.appendChild(this.buttons.browse),this.element.setAttribute("aria-label","Uploader")},x.prototype.renderActionButtons=function(){this.element.setAttribute("tabindex","-1"),this.actionButtons=this.createElement("div",{className:"e-upload-actions"}),this.uploadButton=this.createElement("button",{className:"e-file-upload-btn e-css e-btn e-flat e-primary",attrs:{type:"button",tabindex:this.btnTabIndex,"aria-label":this.localizedTexts("Upload")}}),this.clearButton=this.createElement("button",{className:"e-file-clear-btn e-css e-btn e-flat",attrs:{type:"button",tabindex:this.btnTabIndex,"aria-label":this.localizedTexts("Clear")}}),this.actionButtons.appendChild(this.clearButton),this.actionButtons.appendChild(this.uploadButton),this.renderButtonTemplates(),this.uploadWrapper.appendChild(this.actionButtons),this.browseButton.blur(),this.isPreloadFiles||this.uploadButton.focus(),this.wireActionButtonEvents()},x.prototype.serverActionButtonsEventBind=function(t){t&&!this.isForm&&(this.browseButton.blur(),this.actionButtons=t,this.uploadButton=this.actionButtons.querySelector(".e-file-upload-btn"),this.clearButton=this.actionButtons.querySelector(".e-file-clear-btn"),this.uploadButton.focus(),this.unwireActionButtonEvents(),this.wireActionButtonEvents(),this.checkActionButtonStatus())},x.prototype.wireActionButtonEvents=function(){C.EventHandler.add(this.uploadButton,"click",this.uploadButtonClick,this),C.EventHandler.add(this.clearButton,"click",this.clearButtonClick,this)},x.prototype.unwireActionButtonEvents=function(){C.EventHandler.remove(this.uploadButton,"click",this.uploadButtonClick),C.EventHandler.remove(this.clearButton,"click",this.clearButtonClick)},x.prototype.removeActionButtons=function(){this.actionButtons&&(this.unwireActionButtonEvents(),C.detach(this.actionButtons),this.actionButtons=null)},x.prototype.renderButtonTemplates=function(){var t;"string"==typeof this.buttons.browse?(this.browseButton.textContent="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.textContent)):(this.browseButton.innerHTML="",this.browseButton.appendChild(this.buttons.browse)),this.uploadButton&&(t=C.isNullOrUndefined(this.buttons.upload)?"Upload":this.buttons.upload,this.buttons.upload=t,"string"==typeof this.buttons.upload?(this.uploadButton.textContent="Upload"===this.buttons.upload?this.localizedTexts("Upload"):this.buttons.upload,this.uploadButton.setAttribute("title",this.uploadButton.textContent)):(this.uploadButton.innerHTML="",this.uploadButton.appendChild(this.buttons.upload))),this.clearButton&&(t=C.isNullOrUndefined(this.buttons.clear)?"Clear":this.buttons.clear,this.buttons.clear=t,"string"==typeof this.buttons.clear?(this.clearButton.textContent="Clear"===this.buttons.clear?this.localizedTexts("Clear"):this.buttons.clear,this.clearButton.setAttribute("title",this.clearButton.textContent)):(this.clearButton.innerHTML="",this.clearButton.appendChild(this.buttons.clear)))},x.prototype.initializeUpload=function(){this.element.setAttribute("tabindex","-1");var t=this.createElement("span",{className:Zi});this.element.parentElement.insertBefore(t,this.element),this.dropAreaWrapper=this.createElement("div",{className:"e-file-select-wrap"}),this.element.parentElement.insertBefore(this.dropAreaWrapper,this.element),t.appendChild(this.element),this.dropAreaWrapper.appendChild(this.browseButton),this.dropAreaWrapper.appendChild(t),this.uploadWrapper=this.createElement("div",{className:"e-upload e-control-wrapper"}),this.dropAreaWrapper.parentElement.insertBefore(this.uploadWrapper,this.dropAreaWrapper),this.uploadWrapper.appendChild(this.dropAreaWrapper),this.setDropArea()},x.prototype.renderPreLoadFiles=function(){if(this.files.length)if(this.enablePersistence&&this.filesData.length)this.internalCreateFileList(this.filesData);else if(!C.isNullOrUndefined(this.files[0].size)){this.isPreloadFiles=!0;var t=[].slice.call(this.files),e=[];this.multiple||(this.clearData(),t=[t[0]]);for(var i=0,s=t;i<s.length;i++){var n=s[i],n={name:n.name+"."+n.type.split(".")[n.type.split(".").length-1],rawFile:"",size:n.size,status:this.localizedTexts("uploadSuccessMessage"),type:n.type,validationMessages:{minSize:"",maxSize:""},statusCode:"2"};e.push(n),this.filesData.push(n)}this.internalCreateFileList(e),this.autoUpload||!this.listParent||this.actionButtons||this.isForm&&!this.allowUpload()||!this.showFileList||this.renderActionButtons(),this.checkActionButtonStatus(),this.sequentialUpload&&(this.count=this.filesData.length-1),this.isPreloadFiles=!1}},x.prototype.checkActionButtonStatus=function(){var t;this.actionButtons&&(0<(t=this.uploadWrapper.querySelectorAll("."+hs).length+this.uploadWrapper.querySelectorAll(".e-upload-fails:not(.e-upload-progress)").length+this.uploadWrapper.querySelectorAll("span."+g).length+this.uploadWrapper.querySelectorAll("span."+f).length)&&t===this.uploadWrapper.querySelectorAll("li").length?this.uploadButton.setAttribute("disabled","disabled"):this.uploadButton.removeAttribute("disabled"))},x.prototype.setDropArea=function(){var t=this.dropAreaWrapper.querySelector(".e-file-drop");if(this.dropArea){this.dropZoneElement="string"!=typeof this.dropArea?this.dropArea:C.select(this.dropArea,document);for(var e=this.element,i=!1;e.parentNode;)(e=e.parentNode)===this.dropZoneElement&&(i=!0,t?t.innerHTML=this.localizedTexts("dropFilesHint"):this.createDropTextHint());!i&&t&&C.remove(t)}else C.isNullOrUndefined(this.uploaderOptions)||void 0!==this.uploaderOptions.dropArea||(this.createDropTextHint(),this.dropZoneElement=this.uploadWrapper,this.setProperties({dropArea:this.uploadWrapper},!0));this.bindDropEvents()},x.prototype.updateDropArea=function(){var t;this.dropArea?this.setDropArea():(this.dropZoneElement=null,(t=this.dropAreaWrapper.querySelector(".e-file-drop"))&&C.remove(t))},x.prototype.createDropTextHint=function(){var t=this.createElement("span",{className:Gi});t.innerHTML=this.localizedTexts("dropFilesHint"),this.dropAreaWrapper.appendChild(t)},x.prototype.updateHTMLAttrToElement=function(){if(!C.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i=e[t];vs.indexOf(i)<0&&this.element.setAttribute(i,this.htmlAttributes[""+i])}},x.prototype.updateHTMLAttrToWrapper=function(){if(!C.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i,s=e[t];-1<vs.indexOf(s)&&("class"===s?""!==(i=this.htmlAttributes[""+s].replace(/\s+/g," ").trim())&&C.addClass([this.uploadWrapper],i.split(" ")):"style"===s?(i=this.uploadWrapper.getAttribute(s),i=C.isNullOrUndefined(i)?this.htmlAttributes[""+s]:i+this.htmlAttributes[""+s],this.uploadWrapper.setAttribute(s,i)):this.uploadWrapper.setAttribute(s,this.htmlAttributes[""+s]))}},x.prototype.setMultipleSelection=function(){var t;this.multiple&&!this.element.hasAttribute("multiple")?((t=document.createAttribute("multiple")).value="multiple",this.element.setAttributeNode(t)):this.multiple||this.element.removeAttribute("multiple")},x.prototype.checkAutoUpload=function(t){this.autoUpload?(this.sequentialUpload?this.sequenceUpload(t):this.upload(t),this.removeActionButtons()):this.actionButtons||this.renderActionButtons(),this.checkActionButtonStatus()},x.prototype.sequenceUpload=function(t){var e;this.filesData.length-t.length!=0&&"1"===this.filesData[this.filesData.length-t.length-1].statusCode||((this.multiple||this.count<0)&&++this.count,e=!this.showFileList,"object"==typeof this.filesData[this.count]?(this.isFirstFileOnSelection=!1,this.upload(this.filesData[this.count],e),"0"===this.filesData[this.count].statusCode&&this.sequenceUpload(t)):--this.count)},x.prototype.setCSSClass=function(t){var e=t,t=(C.isNullOrUndefined(t)||(e=t.replace(/\s+/g," ").trim()),C.isNullOrUndefined(t)||""===e||C.removeClass([this.uploadWrapper],e.split(" ")),this.cssClass);C.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=this.cssClass.replace(/\s+/g," ").trim()),C.isNullOrUndefined(this.cssClass)||""===t||C.addClass([this.uploadWrapper],t.split(-1<t.indexOf(",")?",":" "))},x.prototype.wireEvents=function(){C.EventHandler.add(this.browseButton,"click",this.browseButtonClick,this),C.EventHandler.add(this.element,"change",this.onSelectFiles,this),C.EventHandler.add(document,"click",this.removeFocus,this),this.keyboardModule=new C.KeyboardEvents(this.uploadWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.isForm&&C.EventHandler.add(this.formElement,"reset",this.resetForm,this)},x.prototype.unWireEvents=function(){C.EventHandler.remove(this.browseButton,"click",this.browseButtonClick),C.EventHandler.remove(this.element,"change",this.onSelectFiles),C.EventHandler.remove(document,"click",this.removeFocus),this.isForm&&C.EventHandler.remove(this.formElement,"reset",this.resetForm),this.keyboardModule&&this.keyboardModule.destroy()},x.prototype.resetForm=function(){this.clearAll()},x.prototype.keyActionHandler=function(t){var e,i,s=t.target;"enter"===t.action&&(t.target===this.clearButton?this.clearButtonClick():t.target===this.uploadButton?this.uploadButtonClick():t.target===this.browseButton?this.browseButtonClick():s.classList.contains(E)?((e=this.getCurrentMetaData(null,t)).file.statusCode="4",e.file.status=this.localizedTexts("pauseUpload"),this.abortUpload(e,!1)):s.classList.contains(cs)?this.resumeUpload(this.getCurrentMetaData(null,t),t):s.classList.contains(ss)?(e=this.getCurrentMetaData(null,t),C.isNullOrUndefined(e)?(i=t.target.parentElement,i=this.filesData[this.fileList.indexOf(i)],this.retry(i)):(e.file.statusCode="1",e.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(e.file))):(this.removeFiles(t),s.classList.contains(v)||this.browseButton.focus()),t.preventDefault(),t.stopPropagation())},x.prototype.getCurrentMetaData=function(t,e){var i,s;s=C.isNullOrUndefined(t)?(e=e.target.parentElement,this.filesData[this.fileList.indexOf(e)]):t;for(var n=0;n<this.uploadMetaData.length;n++)this.uploadMetaData[n].file.name===s.name&&(i=this.uploadMetaData[n]);return i},x.prototype.removeFocus=function(){this.uploadWrapper&&this.listParent&&this.listParent.querySelector("."+ds)&&(document.activeElement.blur(),this.listParent.querySelector("."+ds).classList.remove(ds))},x.prototype.browseButtonClick=function(){this.element.click()},x.prototype.uploadButtonClick=function(){this.sequentialUpload?this.sequenceUpload(this.filesData):this.upload(this.filesData)},x.prototype.clearButtonClick=function(){this.clearAll(),this.sequentialUpload&&(this.count=-1),this.actionCompleteCount=0},x.prototype.bindDropEvents=function(){this.dropZoneElement&&(C.EventHandler.add(this.dropZoneElement,"drop",this.dropElement,this),C.EventHandler.add(this.dropZoneElement,"dragover",this.dragHover,this),C.EventHandler.add(this.dropZoneElement,"dragleave",this.onDragLeave,this),C.EventHandler.add(this.dropZoneElement,"paste",this.onPasteFile,this),C.EventHandler.add(this.dropZoneElement,"dragenter",this.onDragEnter,this))},x.prototype.unBindDropEvents=function(){this.dropZoneElement&&(C.EventHandler.remove(this.dropZoneElement,"drop",this.dropElement),C.EventHandler.remove(this.dropZoneElement,"dragover",this.dragHover),C.EventHandler.remove(this.dropZoneElement,"dragleave",this.onDragLeave),C.EventHandler.remove(this.dropZoneElement,"dragenter",this.onDragEnter))},x.prototype.onDragEnter=function(t){this.enabled&&(this.dropZoneElement.classList.add(ns),this.dragCounter=this.dragCounter+1,t.preventDefault(),t.stopPropagation())},x.prototype.onDragLeave=function(){this.enabled&&(this.dragCounter=this.dragCounter-1,this.dragCounter||this.dropZoneElement.classList.remove(ns))},x.prototype.dragHover=function(t){this.enabled&&("Default"!==this.dropEffect&&(t.dataTransfer.dropEffect=this.dropEffect.toLowerCase()),t.preventDefault(),t.stopPropagation())},x.prototype.dropElement=function(t){this.dragCounter=0,this.dropZoneElement.classList.remove(ns),this.onSelectFiles(t),t.preventDefault(),t.stopPropagation()},x.prototype.onPasteFile=function(t){var e=t.clipboardData.items;if("paste"===t.type&&"msie"!==this.browserName&&"edge"!==this.browserName&&"safari"!==this.browserName&&(this.element.files=t.clipboardData.files),1===e.length||this.multiple)for(var i=0;i<e.length;i++){var s=[].slice.call(e)[i];"file"!==s.kind&&!s.type.match("^image/")||this.renderSelectedFiles(t,[s.getAsFile()],!1,!0)}},x.prototype.getSelectedFiles=function(t){for(var e=[],i=this.fileList[t],s=this.getFilesData(),n=+i.getAttribute("data-files-count"),a=0,l=0;l<t;l++)a+=+this.fileList[l].getAttribute("data-files-count");for(var r=a;r<a+n;r++)e.push(s[r]);return e},x.prototype.removeFiles=function(t){var e,i,s;this.enabled&&(i=t.target.parentElement,i=this.fileList.indexOf(i),e=this.fileList[i],i=(s=this.isFormUpload())?this.getSelectedFiles(i):this.getFilesInArray(this.filesData[i]),C.isNullOrUndefined(i)||(t.target.classList.contains(v)&&!s?(i[0].statusCode="5",C.isNullOrUndefined(e)||(s=e.querySelector("."+v),h.createSpinner({target:s,width:"20px"}),h.showSpinner(s)),this.sequentialUpload&&this.uploadSequential(),e.classList.contains(ms)||this.checkActionComplete(!0)):C.closest(t.target,"."+is)||this.remove(i,!1,!1,!0,t),this.isForm&&e&&e.classList.contains(gs)&&(this.element.value=""),this.checkActionButtonStatus()))},x.prototype.removeFilesData=function(t,e){var i;e?this.showFileList||(i=this.filesData.indexOf(t),this.filesData.splice(i,1)):(e=this.getLiElement(t),C.isNullOrUndefined(e)||(this.element.value="",C.detach(e),i=this.fileList.indexOf(e),this.fileList.splice(i,1),this.filesData.splice(i,1),0!==this.fileList.length||C.isNullOrUndefined(this.listParent)||(C.detach(this.listParent),this.listParent=null,this.removeActionButtons()),this.sequentialUpload&&i<=this.count&&--this.count))},x.prototype.removeUploadedFile=function(i,t,s,e){var n=this,a=i,l=new C.Ajax(this.asyncSettings.removeUrl,"POST",!0,null),r=(l.emitError=!1,new FormData);l.beforeSend=function(e){t.currentRequest=l.httpRequest,s?n.removingEventCallback(t,r,a,i):n.trigger("removing",t,function(t){t.cancel?e.cancel=!0:n.removingEventCallback(t,r,a,i)})},l.onLoad=function(t){return n.removeCompleted(t,a,e),{}},l.onError=function(t){return n.removeFailed(t,a,e),{}},l.send(r)},x.prototype.removingEventCallback=function(t,e,i,s){var n=this.element.getAttribute("name"),s=this.getLiElement(s);C.isNullOrUndefined(s)||C.isNullOrUndefined(s.querySelector("."+d))&&C.isNullOrUndefined(s.querySelector("."+m))||(s=s.querySelector("."+d)?s.querySelector("."+d):s.querySelector("."+m),h.createSpinner({target:s,width:"20px"}),h.showSpinner(s)),t.postRawFile&&!C.isNullOrUndefined(i.rawFile)&&""!==i.rawFile?e.append(n,i.rawFile,i.name):e.append(n,i.name),this.updateFormData(e,t.customFormData)},x.prototype.updateFormData=function(i,s){if(0<s.length&&s[0])for(var t=0;t<s.length;t++)!function(t){var e=s[t],t=Object.keys(e).map(function(t){return e[""+t]});i.append(Object.keys(e)[0],t)}(t)},x.prototype.updateCustomheader=function(i,s){if(0<s.length&&s[0])for(var t=0;t<s.length;t++)!function(t){var e=s[t],t=Object.keys(e).map(function(t){return e[""+t]});i.setRequestHeader(Object.keys(e)[0],t)}(t)},x.prototype.removeCompleted=function(t,e,i){var s=t&&t.currentTarget?this.getResponse(t):null,n=t.target;4===n.readyState&&200<=n.status&&n.status<=299?(n={e:t,response:s,operation:"remove",file:this.updateStatus(e,this.localizedTexts("removedSuccessMessage"),"2")},this.trigger("success",n),this.removeFilesData(e,i),s=this.uploadedFilesData.indexOf(e),this.uploadedFilesData.splice(s,1),this.trigger("change",{files:this.uploadedFilesData})):this.removeFailed(t,e,i)},x.prototype.removeFailed=function(t,e,i){var t={e:t,response:t&&t.currentTarget?this.getResponse(t):null,operation:"remove",file:this.updateStatus(e,this.localizedTexts("removedFailedMessage"),"0")},i=(i||(i=this.filesData.indexOf(e),(i=this.fileList[i])&&(i.classList.remove(g),i.classList.add(y),i=i.querySelector("."+c))&&(i.classList.remove(g),i.classList.add(y)),this.checkActionButtonStatus()),this.trigger("failure",t),this.getLiElement(e));C.isNullOrUndefined(i)||C.isNullOrUndefined(i.querySelector("."+d))||(t=i.querySelector("."+d),h.hideSpinner(t),C.detach(i.querySelector(".e-spinner-pane")))},x.prototype.getFilesFromFolder=function(e){this.filesEntries=[];var n=this.multiple?e.dataTransfer.items:[e.dataTransfer.items[0]];if(this.checkDirectoryUpload(n))for(var a=this,t=0;t<n.length;t++)!function(t){var i,s=n[t].webkitGetAsEntry();s.isFile?(i=[],s.file(function(t){var e=s.fullPath;i.push({path:e,file:t})}),a.renderSelectedFiles(e,i,!0)):s.isDirectory&&a.traverseFileTree(s,e)}(t)},x.prototype.checkDirectoryUpload=function(t){for(var e=0;t&&e<t.length;e++)if(t[e].webkitGetAsEntry().isDirectory)return!0;return!1},x.prototype.traverseFileTree=function(t,e){t.isFile?this.filesEntries.push(t):t.isDirectory&&(t=t.createReader(),this.readFileFromDirectory(t,e))},x.prototype.readFileFromDirectory=function(i,s){var n=this;i.readEntries(function(t){for(var e=0;e<t.length;e++)n.traverseFileTree(t[e],s);n.pushFilesEntries(s),t.length&&n.readFileFromDirectory(i)})},x.prototype.pushFilesEntries=function(s){for(var n=this,a=[],t=this,e=0;e<this.filesEntries.length;e++)!function(i){t.filesEntries[i].file(function(t){var e;n.filesEntries.length&&(e=n.filesEntries[i].fullPath,a.push({path:e,file:t}),i===n.filesEntries.length-1)&&(n.filesEntries=[],n.renderSelectedFiles(s,a,!0))})}(e)},x.prototype.onSelectFiles=function(t){var e,i;this.enabled&&("drop"===t.type?this.directoryUpload?this.getFilesFromFolder(t):(i=this.sortFilesList=t.dataTransfer.files,"msie"!==this.browserName&&"edge"!==this.browserName&&"safari"!==this.browserName&&(this.element.files=i),0<i.length&&(e=this.multiple?this.sortFileList(i):[i[0]],this.renderSelectedFiles(t,e))):(e=[].slice.call(t.target.files),this.renderSelectedFiles(t,e)),this.isAngular||this.isReact)&&t.stopPropagation()},x.prototype.getBase64=function(s){return new Promise(function(t,e){var i=new FileReader;i.readAsDataURL(s),i.onload=function(){return t(i.result)},i.onerror=function(t){return e(t)}})},x.prototype.renderSelectedFiles=function(t,e,i,s){var n=this,a={event:t,cancel:!(this.base64String=[]),filesData:[],isModified:!1,modifiedFilesData:[],progressInterval:"",isCanceled:!1,currentRequest:null,customFormData:null};if(e.length<1)a.isCanceled=!0,this.trigger("selected",a);else{this.flag=!0;var l=[];this.multiple||(this.clearData(!0),e=[e[this.actionCompleteCount=0]]);for(var r=0;r<e.length;r++){var o=i?e[r].file:e[r];this.updateInitialFileDetails(t,e,o,r,l,i,s)}if(a.filesData=l,-1<this.allowedExtensions.indexOf("*")&&(this.allTypes=!0),this.enableHtmlSanitizer)for(r=0;r<l.length;r++){for(var h=C.SanitizeHtmlHelper.beforeSanitize(),h=C.SanitizeHtmlHelper.serializeValue(h,l[parseInt(r.toString(),10)].name),u=l[parseInt(r.toString(),10)].name,p=!1,d=0;d<u.length;d++)if(127<u.charCodeAt(d)){p=!0;break}var c=/<([a-z][a-z0-9]*)\b[^>]*>(.*?)<\/\1>/i.test(u);h===l[parseInt(r.toString(),10)].name||p&&!c||(h=e[parseInt(r.toString(),10)].name.replace(/[\u00A0-\u9999<>\\&]/g,function(t){return"&#"+t.charCodeAt(0)+";"}),l[parseInt(r.toString(),10)].name=h,l[parseInt(r.toString(),10)].status=this.localizedTexts("invalidFileName"),l[parseInt(r.toString(),10)].statusCode="0")}this.allTypes||(l=this.checkExtension(l)),this.trigger("selected",a,function(t){n._internalRenderSelect(t,l)})}},x.prototype.updateInitialFileDetails=function(t,e,i,s,n,a,l){a={name:a?e[s].path.substring(1,e[s].path.length):l?C.getUniqueID(i.name.substring(0,i.name.lastIndexOf(".")))+"."+this.getFileType(i.name):this.directoryUpload?e[s].webkitRelativePath:i.name,rawFile:i,size:i.size,status:this.localizedTexts("readyToUploadMessage"),type:this.getFileType(i.name),validationMessages:this.validatedFileSize(i.size),statusCode:"1",id:C.getUniqueID(i.name.substring(0,i.name.lastIndexOf(".")))+"."+this.getFileType(i.name)};l&&(a.fileSource="paste"),a.status=""!==a.validationMessages.minSize?this.localizedTexts("invalidMinFileSize"):""!==a.validationMessages.maxSize?this.localizedTexts("invalidMaxFileSize"):a.status,""===a.validationMessages.minSize&&""===a.validationMessages.maxSize||(a.statusCode="0",this.checkActionComplete(!0)),n.push(a)},x.prototype._internalRenderSelect=function(t,e){if(!t.cancel){if(this.selectedFiles=this.selectedFiles.concat(e),this.btnTabIndex=this.disableKeyboardNavigation?"-1":"0",this.showFileList){if(t.isModified&&0<t.modifiedFilesData.length){for(var i=0;i<t.modifiedFilesData.length;i++)for(var s=0;s<e.length;s++)t.modifiedFilesData[i].id===e[s].id&&(t.modifiedFilesData[i].rawFile=e[s].rawFile);var n=this.allTypes?t.modifiedFilesData:this.checkExtension(t.modifiedFilesData);this.updateSortedFileList(n),this.filesData=this.filesData.concat(n),this.isForm&&!this.allowUpload()||this.checkAutoUpload(n)}else{if(this.internalCreateFileList(e),this.autoUpload&&this.sequenceUpload&&this.sequentialUpload&&0<this.filesData.length&&"2"!==this.filesData[this.filesData.length-1].statusCode&&"0"!==this.filesData[this.filesData.length-1].statusCode)return void(this.filesData=this.filesData.concat(e));this.filesData=this.filesData.concat(e),this.isForm&&!this.allowUpload()||this.checkAutoUpload(e)}C.isNullOrUndefined(t.progressInterval)||""===t.progressInterval||(this.progressInterval=t.progressInterval)}else this.filesData=this.filesData.concat(e),this.autoUpload&&this.upload(this.filesData,!0);this.raiseActionComplete(),this.isFirstFileOnSelection=!0}},x.prototype.allowUpload=function(){var t=!1;return t=this.isForm&&!C.isNullOrUndefined(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl?!0:t},x.prototype.isFormUpload=function(){var t=!1;return t=!this.isForm||!C.isNullOrUndefined(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl||!C.isNullOrUndefined(this.asyncSettings.removeUrl)&&""!==this.asyncSettings.removeUrl?t:!0},x.prototype.clearData=function(t){C.isNullOrUndefined(this.listParent)||(C.detach(this.listParent),this.listParent=null),"msie"===this.browserName||t||(this.element.value=""),this.fileList=[],this.filesData=[],this.removeActionButtons()},x.prototype.updateSortedFileList=function(t){var e=this.createElement("div",{id:"clonewrapper"}),i=-1;if(this.listParent){for(var s=0;s<this.listParent.querySelectorAll("li").length;s++){var n=this.listParent.querySelectorAll("li")[s];e.appendChild(n.cloneNode(!0))}this.removeActionButtons();var a=[].slice.call(e.childNodes);this.createParentUL();for(var l=0;l<t.length;l++){for(var r=0;r<this.filesData.length;r++)this.filesData[r].name===t[l].name&&(this.listParent.appendChild(a[r]),C.EventHandler.add(a[r].querySelector(".e-icons"),"click",this.removeFiles,this),this.fileList.push(a[r]),i=l);i!==l&&this.internalCreateFileList([t[l]])}}else this.internalCreateFileList(t)},x.prototype.isBlank=function(t){return!t||/^\s*$/.test(t)},x.prototype.checkExtension=function(t){var e=t;if(!this.isBlank(this.allowedExtensions)){for(var i=[],s=0,n=this.allowedExtensions.split(",");s<n.length;s++){var a=n[s];i.push(a.trim().toLocaleLowerCase())}for(var l=0;l<t.length;l++){var r=-1!==t[l].type.indexOf(".")?t[l].type.replace(".",""):t[l].type;-1===i.indexOf(("."+r).toLocaleLowerCase())&&(t[l].status=this.localizedTexts("invalidFileType"),t[l].statusCode="0")}}return e},x.prototype.validatedFileSize=function(t){var e="",i="";return t<this.minFileSize?e=this.localizedTexts("invalidMinFileSize"):i=t>this.maxFileSize?this.localizedTexts("invalidMaxFileSize"):e="",{minSize:e,maxSize:i}},x.prototype.isPreLoadFile=function(t){for(var e=!1,i=0;i<this.files.length;i++)this.files[i].name===t.name.slice(0,t.name.lastIndexOf("."))&&this.files[i].type===t.type&&(e=!0);return e},x.prototype.createCustomfileList=function(t){this.createParentUL();for(var e=0,i=t;e<i.length;e++){var s=i[e],n=this.createElement("li",{className:$i,attrs:{"data-file-name":s.name}}),a=(this.uploadTemplateFn=this.templateComplier(this.template),this.uploadTemplateFn(s,this,"template",this.element.id+"Template",this.isStringTemplate,null,n)),a=(a&&(a=[].slice.call(a),C.append(a,n)),t.indexOf(s)),l={element:n,fileInfo:s,index:a,isPreload:this.isPreLoadFile(s)},a={element:n,fileInfo:s,index:a,isPreload:this.isPreLoadFile(s)};this.trigger("rendering",l),this.trigger("fileListRendering",a),this.listParent.appendChild(n),this.fileList.push(n)}this.renderReactTemplates()},x.prototype.createParentUL=function(){C.isNullOrUndefined(this.listParent)&&(this.listParent=this.createElement("ul",{className:Ji}),this.uploadWrapper.appendChild(this.listParent))},x.prototype.formFileList=function(t,e){for(var i,s=this.createElement("li",{className:$i}),n=(s.setAttribute("data-files-count",t.length+""),this.createElement("span",{className:os})),a=0,l=t;a<l.length;a++){var r=l[a],o=this.createElement("span",{className:Qi}),h=(o.innerHTML=this.getFileNameOnly(r.name),this.createElement("span",{className:ts})),u=this.getFileType(r.name);h.innerHTML="."+u,u||h.classList.add("e-hidden"),this.enableRtl?((u=this.createElement("span",{className:ps})).appendChild(h),u.appendChild(o),n.appendChild(u)):(n.appendChild(o),n.appendChild(h)),this.truncateName(o),i=this.formValidateFileInfo(r,s)}s.appendChild(n),this.setListToFileInfo(t,s);var p=this.listParent.querySelectorAll("li").length,d=this.createElement("span"),d=(s.classList.contains(gs)?(d.classList.add(c),d.classList.add(gs),d.innerText=1<t.length?this.localizedTexts("invalidFileSelection"):i):(d.classList.add(1<t.length?"e-file-information":es),d.innerText=1<t.length?this.localizedTexts("totalFiles")+": "+t.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(t)):this.bytesToSize(t[0].size),this.createFormInput(t)),n.appendChild(d),C.isNullOrUndefined(s.querySelector(".e-icons"))&&(d=this.createElement("span",{className:"e-icons",attrs:{tabindex:this.btnTabIndex}}),"msie"===this.browserName&&d.classList.add("e-msie"),d.setAttribute("title",this.localizedTexts("remove")),s.appendChild(n),s.appendChild(d),C.EventHandler.add(d,"click",this.removeFiles,this),d.classList.add(m)),{element:s,fileInfo:this.mergeFileInfo(t,s),index:p,isPreload:this.isPreLoadFile(this.mergeFileInfo(t,s))}),p={element:s,fileInfo:this.mergeFileInfo(t,s),index:p,isPreload:this.isPreLoadFile(this.mergeFileInfo(t,s))};this.trigger("rendering",d),this.trigger("fileListRendering",p),this.listParent.appendChild(s),this.fileList.push(s)},x.prototype.formValidateFileInfo=function(t,e){var i=t.status,s=this.validatedFileSize(t.size),s=(""===s.minSize&&""===s.maxSize||(this.addInvalidClass(e),i=""!==s.minSize?this.localizedTexts("invalidMinFileSize"):""!==s.maxSize?this.localizedTexts("invalidMaxFileSize"):i),this.checkExtension(this.getFilesInArray(t))[0].status);return s===this.localizedTexts("invalidFileType")&&(this.addInvalidClass(e),i=s),i},x.prototype.addInvalidClass=function(t){t.classList.add(gs)},x.prototype.createFormInput=function(t){if("safari"!==this.browserName){var e=this.element.cloneNode(!0);e.classList.add("e-hidden-file-input");for(var i=0,s=t;i<s.length;i++)s[i].input=e;e.setAttribute("id",C.getUniqueID("hiddenUploader")),e.setAttribute("name",this.uploaderName),this.uploadWrapper.querySelector("."+Zi).appendChild(e),"msie"!==this.browserName&&"edge"!==this.browserName&&(this.element.value="")}},x.prototype.getFileSize=function(t){for(var e=0,i=0,s=t;i<s.length;i++)e+=s[i].size;return e},x.prototype.mergeFileInfo=function(t,e){for(var i={name:"",rawFile:"",size:0,status:"",type:"",validationMessages:{minSize:"",maxSize:""},statusCode:"1",list:e},s=[],n="",a=0,l=t;a<l.length;a++){var r=l[a];s.push(r.name),n=r.type}return i.name=s.join(", "),i.size=this.getFileSize(t),i.type=n,i.status=this.statusForFormUpload(t,e),i},x.prototype.statusForFormUpload=function(t,e){for(var i=!0,s=0,n=t;s<n.length;s++){var a=n[s],l=a.status,r=this.validatedFileSize(a.size),r=(""===r.minSize&&""===r.maxSize||(i=!1,l=""!==r.minSize?this.localizedTexts("invalidMinFileSize"):""!==r.maxSize?this.localizedTexts("invalidMaxFileSize"):l),this.checkExtension(this.getFilesInArray(a))[0].status);r===this.localizedTexts("invalidFileType")&&(i=!1,l=r)}return l=i?this.localizedTexts("totalFiles")+": "+t.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(t)):(e.classList.add(gs),1<t.length?this.localizedTexts("invalidFileSelection"):l)},x.prototype.formCustomFileList=function(t,e){this.createParentUL();var i=this.createElement("li",{className:$i}),s=(i.setAttribute("data-files-count",t.length+""),this.setListToFileInfo(t,i),this.mergeFileInfo(t,i)),n=(i.setAttribute("data-file-name",s.name),this.uploadTemplateFn=this.templateComplier(this.template),this.uploadTemplateFn(s,this,"template",this.element.id+"Template",this.isStringTemplate,null,i)),n=(n&&(n=[].slice.call(n),C.append(n,i)),this.listParent.querySelectorAll("li").length),t=(i.classList.contains(gs)||this.createFormInput(t),{element:i,fileInfo:s,index:n,isPreload:this.isPreLoadFile(s)}),n={element:i,fileInfo:s,index:n,isPreload:this.isPreLoadFile(s)};this.trigger("rendering",t),this.trigger("fileListRendering",n),this.listParent.appendChild(i),this.fileList.push(i),this.renderReactTemplates()},x.prototype.createFileList=function(t){this.filesData=this.filesData&&0<this.filesData.length?this.filesData.concat(t):t,this.internalCreateFileList(t)},x.prototype.internalCreateFileList=function(t){if(this.createParentUL(),""===this.template||C.isNullOrUndefined(this.template))if(this.isFormUpload())this.uploadWrapper.classList.add(fs),this.formFileList(t,this.element.files);else for(var e=0,i=t;e<i.length;e++){var s=i[e],n=this.createElement("li",{className:$i,attrs:{"data-file-name":s.name,"data-files-count":"1"}}),a=this.createElement("span",{className:os}),l=this.createElement("span",{className:Qi,attrs:{title:s.name}}),r=(l.innerHTML=this.getFileNameOnly(s.name),this.createElement("span",{className:ts})),o=this.getFileType(s.name),o=(r.innerHTML="."+o,o||r.classList.add("e-hidden"),this.enableRtl?((o=this.createElement("span",{className:ps})).appendChild(r),o.appendChild(l),a.appendChild(o)):(a.appendChild(l),a.appendChild(r)),this.createElement("span",{className:es})),r=(o.innerHTML=this.bytesToSize(s.size),a.appendChild(o),this.createElement("span",{className:c})),o=(a.appendChild(r),r.innerHTML=s.status,n.appendChild(a),this.createElement("span",{className:" e-icons",attrs:{tabindex:this.btnTabIndex}})),a=("msie"===this.browserName&&o.classList.add("e-msie"),o.setAttribute("title",this.localizedTexts("remove")),n.appendChild(o),C.EventHandler.add(o,"click",this.removeFiles,this),"2"===s.statusCode?(r.classList.add(g),o.classList.add(d),o.setAttribute("title",this.localizedTexts("delete")),o.setAttribute("aria-label",this.localizedTexts("delete"))):"1"!==s.statusCode&&(r.classList.remove(g),r.classList.add(hs)),this.autoUpload&&"1"===s.statusCode&&""!==this.asyncSettings.saveUrl&&(r.innerHTML=""),o.classList.contains(d)||(o.classList.add(m),o.setAttribute("aria-label",this.localizedTexts("remove"))),t.indexOf(s)),r={element:n,fileInfo:s,index:a,isPreload:this.isPreLoadFile(s)},o={element:n,fileInfo:s,index:a,isPreload:this.isPreLoadFile(s)},a=(this.trigger("rendering",r),this.trigger("fileListRendering",o),this.listParent.appendChild(n),this.fileList.push(n),this.truncateName(l),this.flag);this.isPreLoadFile(s)&&(this.flag=!1,this.checkActionComplete(!0),this.flag=a)}else this.isFormUpload()?(this.uploadWrapper.classList.add(fs),this.formCustomFileList(t,this.element.files)):this.createCustomfileList(t)},x.prototype.getSlicedName=function(t){var e=t.textContent;t.dataset.tail=e.slice(e.length-10)},x.prototype.setListToFileInfo=function(t,e){for(var i=0,s=t;i<s.length;i++)s[i].list=e},x.prototype.truncateName=function(t){("edge"!==this.browserName&&t.offsetWidth<t.scrollWidth||t.offsetWidth+1<t.scrollWidth)&&this.getSlicedName(t)},x.prototype.getFileType=function(t){var e,i=t.lastIndexOf(".");return(e=0<=i?t.substring(i+1):e)||""},x.prototype.getFileNameOnly=function(t){var e=this.getFileType(t);return t.split("."+e)[0]},x.prototype.setInitialAttributes=function(){var t;this.initialAttr.accept&&this.element.setAttribute("accept",this.initialAttr.accept),this.initialAttr.disabled&&this.element.setAttribute("disabled","disabled"),this.initialAttr.multiple&&(t=document.createAttribute("multiple"),this.element.setAttributeNode(t))},x.prototype.filterfileList=function(t){for(var e,i=[],s=0;s<t.length;s++)e=this.getLiElement(t[s]),(C.isNullOrUndefined(e)||e.classList.contains(g))&&(this.showFileList||"File uploaded successfully"===t[s].status)||i.push(t[s]);return i},x.prototype.updateStatus=function(t,e,i,s){return void 0===s&&(s=!0),""===e||C.isNullOrUndefined(e)||""===i||C.isNullOrUndefined(i)||(t.status=e,t.statusCode=i),s&&(i=this.getLiElement(t),C.isNullOrUndefined(i)||C.isNullOrUndefined(i.querySelector("."+c))||""===e||C.isNullOrUndefined(e)||(i.querySelector("."+c).textContent=e)),t},x.prototype.getLiElement=function(t){for(var e,i=0;i<this.filesData.length;i++)C.isNullOrUndefined(t)||(C.isNullOrUndefined(this.filesData[i].id)||C.isNullOrUndefined(t.id)?this.filesData[i].name!==t.name:this.filesData[i].name!==t.name||this.filesData[i].id!==t.id)||(e=i);return this.fileList[e]},x.prototype.createProgressBar=function(t){var e=this.createElement("span",{className:as}),i=this.createElement("progressbar",{className:ls,attrs:{value:"0",max:"100"}}),s=this.createElement("span",{className:"e-progress-inner-wrap"}),n=(i.setAttribute("style","width: 0%"),this.createElement("span",{className:rs}));n.textContent="0%",s.appendChild(i),e.appendChild(s),e.appendChild(n),t.querySelector("."+os).appendChild(e)},x.prototype.updateProgressbar=function(t,e){var i;isNaN(Math.round(t.loaded/t.total*100))||C.isNullOrUndefined(e.querySelector("."+ls))||!C.isNullOrUndefined(this.progressInterval)&&""!==this.progressInterval&&0!=(i=Math.round(t.loaded/t.total*100)%parseInt(this.progressInterval,10))&&100!=i||this.changeProgressValue(e,Math.round(t.loaded/t.total*100).toString()+"%")},x.prototype.changeProgressValue=function(t,e){t.querySelector("."+ls).setAttribute("style","width:"+e),t.querySelector("."+rs).textContent=e},x.prototype.uploadInProgress=function(t,e,i,s){var n=this.getLiElement(e);C.isNullOrUndefined(n)&&!i||(C.isNullOrUndefined(n)?this.cancelUploadingFile(e,t,s):("5"===e.statusCode&&this.cancelUploadingFile(e,t,s,n),0<n.querySelectorAll("."+as).length||!n.querySelector("."+c)||(n.querySelector("."+c).classList.add(f),this.createProgressBar(n),this.updateProgressBarClasses(n,f),n.querySelector("."+c).classList.remove(y)),this.updateProgressbar(t,n),i=n.querySelector("."+m),C.isNullOrUndefined(i)||(i.classList.add(v,f),i.setAttribute("title",this.localizedTexts("abort")),i.classList.remove(m))),s={e:t,operation:"upload",file:this.updateStatus(e,this.localizedTexts("inProgress"),"3")},this.trigger("progress",s))},x.prototype.cancelUploadingFile=function(n,t,a,l){var r=this;"5"===n.statusCode&&this.trigger("canceling",{event:t,fileData:n,cancel:!1,customFormData:[],currentRequest:null},function(e){var t,i,s;e.cancel?(n.statusCode="3",C.isNullOrUndefined(l)||(t=l.querySelector("."+v),C.isNullOrUndefined(t))||(h.hideSpinner(t),C.detach(l.querySelector(".e-spinner-pane")))):(a.emitError=!1,a.httpRequest.abort(),t=new FormData,"5"===n.statusCode&&(i=r.element.getAttribute("name"),t.append(i,n.name),t.append("cancel-uploading",n.name),r.updateFormData(t,e.customFormData),(s=new C.Ajax(r.asyncSettings.removeUrl,"POST",!0,null)).emitError=!1,s.beforeSend=function(t){e.currentRequest&&r.updateCustomheader(s.httpRequest,e.currentRequest)},s.onLoad=function(t){return r.removecanceledFile(t,n),{}},s.send(t)))})},x.prototype.removecanceledFile=function(t,e){var i,s=this.getLiElement(e);C.isNullOrUndefined(s)||s.querySelector("."+ss)||C.isNullOrUndefined(s.querySelector("."+v))||(this.updateStatus(e,this.localizedTexts("fileUploadCancel"),"5"),this.renderFailureState(t,e,s),i=s.querySelector("."+m),C.isNullOrUndefined(s)||(h.hideSpinner(i),C.isNullOrUndefined(s.querySelector(".e-spinner-pane")))||C.detach(s.querySelector(".e-spinner-pane")),i=t&&t.currentTarget?this.getResponse(t):null,this.trigger("success",{event:t,response:i,operation:"cancel",file:e}))},x.prototype.renderFailureState=function(t,e,i){var s=this,n=(this.updateProgressBarClasses(i,y),this.removeProgressbar(i,"failure"),C.isNullOrUndefined(i.querySelector(".e-file-status"))||i.querySelector(".e-file-status").classList.add(y),i.querySelector("."+v));C.isNullOrUndefined(n)||(n.classList.remove(v,f),n.classList.add(m),n.setAttribute("title",this.localizedTexts("remove")),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}}),n.parentElement.insertBefore(this.pauseButton,n),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),this.pauseButton.setAttribute("aria-label",this.localizedTexts("retry")),i.querySelector("."+ss).addEventListener("click",function(t){s.reloadcanceledFile(t,e,i,!1)},!1))},x.prototype.reloadcanceledFile=function(t,e,i,s){e.statusCode="1",e.status=this.localizedTexts("readyToUploadMessage"),s||(C.isNullOrUndefined(i.querySelector("."+c))||i.querySelector("."+c).classList.remove(y),C.isNullOrUndefined(i.querySelector("."+ss))||C.detach(i.querySelector("."+ss)),this.pauseButton=null),C.isNullOrUndefined(i)||i.classList.add(ms),this.upload([e])},x.prototype.uploadComplete=function(t,e,i){var s=t.target;4===s.readyState&&200<=s.status&&s.status<=299?(s=this.getLiElement(e),C.isNullOrUndefined(s)&&(!i||C.isNullOrUndefined(i))&&this.showFileList||(C.isNullOrUndefined(s)||(this.updateProgressBarClasses(s,g),this.removeProgressbar(s,"success"),i=s.querySelector("."+v),C.isNullOrUndefined(i))||(i.classList.add(d),i.setAttribute("title",this.localizedTexts("delete")),i.setAttribute("aria-label",this.localizedTexts("delete")),i.classList.remove(v),i.classList.remove(f)),this.raiseSuccessEvent(t,e))):this.uploadFailed(t,e)},x.prototype.getResponse=function(t){t=t.currentTarget;return{readyState:t.readyState,statusCode:t.status,statusText:t.statusText,headers:t.getAllResponseHeaders(),withCredentials:t.withCredentials}},x.prototype.raiseSuccessEvent=function(t,e){var i=this,s=t&&t.currentTarget?this.getResponse(t):null,n=this.localizedTexts("uploadSuccessMessage"),t={e:t,response:s,operation:"upload",file:this.updateStatus(e,n,"2",!1),statusText:n},s=this.getLiElement(e);C.isNullOrUndefined(s)||(n=s.querySelector("."+is),C.isNullOrUndefined(n))||(h.hideSpinner(s),C.detach(n)),this.trigger("success",t,function(t){i.updateStatus(e,t.statusText,"2"),i.multiple?i.uploadedFilesData.push(e):i.uploadedFilesData=[e],i.trigger("change",{file:i.uploadedFilesData}),i.checkActionButtonStatus(),0<i.fileList.length?i.getLiElement(e).classList.contains(ms)?i.getLiElement(e).classList.remove(ms):(i.uploadSequential(),i.checkActionComplete(!0)):i.showFileList||i.checkActionComplete(!0)})},x.prototype.uploadFailed=function(t,e){var i=this,s=this.getLiElement(e),n=t&&t.currentTarget?this.getResponse(t):null,a=this.localizedTexts("uploadFailedMessage"),n={e:t,response:n,operation:"upload",file:this.updateStatus(e,a,"0",!1),statusText:a};C.isNullOrUndefined(s)||this.renderFailureState(t,e,s),this.trigger("failure",n,function(t){i.updateStatus(e,t.statusText,"0"),i.checkActionButtonStatus(),i.uploadSequential(),i.checkActionComplete(!0)})},x.prototype.uploadSequential=function(){this.sequentialUpload&&(this.autoUpload?this.checkAutoUpload(this.filesData):this.uploadButtonClick())},x.prototype.checkActionComplete=function(t){t?++this.actionCompleteCount:--this.actionCompleteCount,this.raiseActionComplete()},x.prototype.raiseActionComplete=function(){var t;this.filesData.length===this.actionCompleteCount&&this.flag&&(this.flag=!1,(t={fileData:[]}).fileData=this.getSelectedFileStatus(this.selectedFiles),this.trigger("actionComplete",t))},x.prototype.getSelectedFileStatus=function(t){for(var e=[],i=0,s=0;s<t.length;s++)for(var n=t[s],a=0;a<this.filesData.length;a++)if(this.filesData[a].name===n.name&&this.filesData[a].status===n.status){e[i]=this.filesData[a],++i;break}return e},x.prototype.updateProgressBarClasses=function(t,e){t=t.querySelector("."+ls);C.isNullOrUndefined(t)||t.classList.add(e)},x.prototype.removeProgressbar=function(t,e){var i=this;C.isNullOrUndefined(t.querySelector("."+as))||(this.progressAnimation=new C.Animation({duration:1250}),this.progressAnimation.animate(t.querySelector("."+as),{name:"FadeOut"}),this.progressAnimation.animate(t.querySelector("."+rs),{name:"FadeOut"}),setTimeout(function(){i.animateProgressBar(t,e)},750))},x.prototype.animateProgressBar=function(t,e){"success"===e?(t.classList.add(g),C.isNullOrUndefined(t.querySelector("."+c))||(t.querySelector("."+c).classList.remove(f),this.progressAnimation.animate(t.querySelector("."+c),{name:"FadeIn"}),t.querySelector("."+c).classList.add(g))):C.isNullOrUndefined(t.querySelector("."+c))||(t.querySelector("."+c).classList.remove(f),this.progressAnimation.animate(t.querySelector("."+c),{name:"FadeIn"}),t.querySelector("."+c).classList.add(y)),t.querySelector("."+as)&&C.detach(t.querySelector("."+as))},x.prototype.setExtensions=function(t){""===t||C.isNullOrUndefined(t)?this.element.removeAttribute("accept"):this.element.setAttribute("accept",t)},x.prototype.templateComplier=function(e){if(e)try{return"function"!=typeof e&&C.selectAll(e,document).length?C.compile(C.select(e,document).innerHTML.trim()):C.compile(e)}catch(t){return C.compile(e)}},x.prototype.setRTL=function(){this.enableRtl?C.addClass([this.uploadWrapper],"e-rtl"):C.removeClass([this.uploadWrapper],"e-rtl")},x.prototype.localizedTexts=function(t){return this.l10n.setLocale(this.locale),this.l10n.getConstant(t)},x.prototype.setControlStatus=function(){this.enabled?(this.uploadWrapper.classList.contains(us)&&this.uploadWrapper.classList.remove(us),!C.isNullOrUndefined(this.browseButton)&&this.element.hasAttribute("disabled")&&(this.element.removeAttribute("disabled"),this.browseButton.removeAttribute("disabled")),!C.isNullOrUndefined(this.clearButton)&&this.clearButton.hasAttribute("disabled")&&this.clearButton.removeAttribute("disabled"),!C.isNullOrUndefined(this.uploadButton)&&this.uploadButton.hasAttribute("disabled")&&this.uploadButton.hasAttribute("disabled")):(this.uploadWrapper.classList.add(us),this.element.setAttribute("disabled","disabled"),this.browseButton.setAttribute("disabled","disabled"),C.isNullOrUndefined(this.clearButton)||this.clearButton.setAttribute("disabled","disabled"),C.isNullOrUndefined(this.uploadButton)||this.uploadButton.setAttribute("disabled","disabled"))},x.prototype.checkHTMLAttributes=function(t){for(var e=0,i=t?C.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["accept","multiple","disabled"];e<i.length;e++){var s,n=i[e];if(!C.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"accept":(C.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.allowedExtensions||t)&&(this.setProperties({allowedExtensions:this.element.getAttribute("accept")},!t),this.initialAttr.accept=this.allowedExtensions);break;case"multiple":(C.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.multiple||t)&&(s="multiple"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n),this.setProperties({multiple:s},!t),this.initialAttr.multiple=!0);break;case"disabled":(C.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n),this.setProperties({enabled:s},!t),this.initialAttr.disabled=!0)}}},x.prototype.chunkUpload=function(t,e,i){var s=Math.min(this.asyncSettings.chunkSize,t.size),n=t.rawFile.slice(0,s);this.sendRequest(t,{chunkIndex:0,blob:n,file:t,start:0,end:s,retryCount:0,request:null},e,i)},x.prototype.sendRequest=function(i,s,e,t){var n=this,a=new FormData,l=i.rawFile.slice(s.start,s.end),l=(a.append(this.uploaderName,l,i.name),a.append("chunk-index",s.chunkIndex.toString()),a.append("chunkIndex",s.chunkIndex.toString()),Math.max(Math.ceil(i.size/this.asyncSettings.chunkSize),1)),r=(a.append("total-chunk",l.toString()),a.append("totalChunk",l.toString()),new C.Ajax({url:this.asyncSettings.saveUrl,type:"POST",async:!0,contentType:null})),o=(r.emitError=!1,r.onLoad=function(t){return n.chunkUploadComplete(t,s,e),{}},r.onUploadProgress=function(t){return n.chunkUploadInProgress(t,s,e),{}},{fileData:i,customFormData:[],cancel:!1,chunkSize:0===this.asyncSettings.chunkSize?null:this.asyncSettings.chunkSize});r.beforeSend=function(e){o.currentRequest=r.httpRequest,o.currentChunkIndex=s.chunkIndex,0===o.currentChunkIndex?n.trigger("uploading",o,function(t){n.uploadingEventCallback(a,t,e,i)}):n.trigger("chunkUploading",o,function(t){n.uploadingEventCallback(a,t,e,i)})},r.onError=function(t){return n.chunkUploadFailed(t,s,e),{}},r.send(a),s.request=r},x.prototype.uploadingEventCallback=function(t,e,i,s){e.cancel?this.eventCancelByArgs(i,e,s):this.updateFormData(t,e.customFormData)},x.prototype.eventCancelByArgs=function(t,e,i){var s,n=this;t.cancel=!0,"5"!==e.fileData.statusCode&&(e.fileData.statusCode="5",e.fileData.status=this.localizedTexts("fileUploadCancel"),s=this.getLiElement(e.fileData))&&(C.isNullOrUndefined(s.querySelector("."+c))||(s.querySelector("."+c).innerHTML=this.localizedTexts("fileUploadCancel"),s.querySelector("."+c).classList.add(y)),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}}),(t=s.querySelector("."+m))&&t.parentElement.insertBefore(this.pauseButton,t),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),this.pauseButton.addEventListener("click",function(t){n.reloadcanceledFile(t,i,s)},!1),this.checkActionButtonStatus())},x.prototype.checkChunkUpload=function(){return!(this.asyncSettings.chunkSize<=0||C.isNullOrUndefined(this.asyncSettings.chunkSize))},x.prototype.chunkUploadComplete=function(t,s,n){var a,e,i,l=this,r=t.target;4===r.readyState&&200<=r.status&&r.status<300?(i=t&&t.currentTarget?this.getResponse(t):null,e=Math.max(Math.ceil(s.file.size/this.asyncSettings.chunkSize),1),i={event:t,file:s.file,chunkIndex:s.chunkIndex,totalChunk:e,chunkSize:this.asyncSettings.chunkSize,response:i},this.trigger("chunkSuccess",i),!C.isNullOrUndefined(n)&&n||(a=this.getLiElement(s.file)),this.updateMetaData(s),s.end===s.file.size&&(s.file.statusCode="3"),"5"===s.file.statusCode?(i={event:t,fileData:s.file,cancel:!1,customFormData:[]},this.trigger("canceling",i,function(t){var e,i;t.cancel?(s.file.statusCode="3",e=a.querySelector("."+v),C.isNullOrUndefined(a)||C.isNullOrUndefined(e)||(h.hideSpinner(e),C.detach(a.querySelector(".e-spinner-pane"))),l.sendNextRequest(s)):(s.request.emitError=!1,r.abort(),e=new FormData,i=l.element.getAttribute("name"),e.append(i,s.file.name),e.append("cancel-uploading",s.file.name),e.append("cancelUploading",s.file.name),l.updateFormData(e,t.customFormData),(i=new C.Ajax(l.asyncSettings.removeUrl,"POST",!0,null)).emitError=!1,i.onLoad=function(t){return l.removeChunkFile(t,s,n),{}},i.send(e))})):e-1===s.chunkIndex&&e>s.chunkIndex?(0<=(i=this.pausedData.indexOf(s))&&this.pausedData.splice(i,1),C.isNullOrUndefined(this.template)&&(C.isNullOrUndefined(n)||!n)&&a&&(a&&!C.isNullOrUndefined(a.querySelector("."+E))&&C.detach(a.querySelector("."+E)),this.removeChunkProgressBar(s)),this.raiseSuccessEvent(t,s.file)):"4"!==s.file.statusCode&&this.sendNextRequest(s)):this.chunkUploadFailed(t,s)},x.prototype.sendNextRequest=function(t){t.start=t.end,t.end+=this.asyncSettings.chunkSize,t.end=Math.min(t.end,t.file.size),t.chunkIndex+=1,this.sendRequest(t.file,t)},x.prototype.removeChunkFile=function(t,e,i){var s,n;C.isNullOrUndefined(this.template)&&C.isNullOrUndefined(i)&&!i&&(n=s=(i=this.getLiElement(e.file)).querySelector("."+v),this.updateStatus(e.file,this.localizedTexts("fileUploadCancel"),"5"),this.updateProgressBarClasses(i,y),this.removeProgressbar(i,"failure"),s&&(s.classList.remove(v),s.classList.add(m),s.setAttribute("title",this.localizedTexts("remove"))),(e=i.querySelector("."+E))&&(e.classList.add(ss),e.classList.remove(E),e.setAttribute("title",this.localizedTexts("retry"))),C.isNullOrUndefined(i)||C.isNullOrUndefined(s)||C.isNullOrUndefined(i.querySelector(".e-spinner-pane"))||(h.hideSpinner(n),C.detach(i.querySelector(".e-spinner-pane"))))},x.prototype.pauseUpload=function(t,e,i){t.file.statusCode="4",t.file.status=this.localizedTexts("pause"),this.updateMetaData(t);e={event:e||null,file:t.file,chunkIndex:t.chunkIndex,chunkCount:Math.round(t.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize};this.abortUpload(t,i,e),this.sequentialUpload&&this.uploadSequential()},x.prototype.abortUpload=function(t,e,i){"4"!==t.file.statusCode&&(t.request.emitError=!1,t.request.httpRequest.abort());var s=this.getLiElement(t.file);!C.isNullOrUndefined(this.template)||!C.isNullOrUndefined(e)&&e||((e=s.querySelector("."+E)).classList.remove(E),e.classList.add(cs),e.setAttribute("title",this.localizedTexts("resume")),e.nextElementSibling.classList.add(m),e.nextElementSibling.classList.remove(v),e.nextElementSibling.setAttribute("title",this.localizedTexts("remove")));for(var n=0;n<this.pausedData.length;n++)this.pausedData[n].file.name===t.file.name&&this.pausedData.splice(n,1);this.pausedData.push(t),this.trigger("pausing",i)},x.prototype.resumeUpload=function(t,e,i){var s,n=this.getLiElement(t.file),n=(C.isNullOrUndefined(n)||(s=n.querySelector("."+cs)),C.isNullOrUndefined(s)||!C.isNullOrUndefined(i)&&i||(s.classList.remove(cs),s.classList.add(E),s.setAttribute("title",this.localizedTexts("pause")),s.nextElementSibling.classList.remove(m),s.nextElementSibling.classList.add(v),s.nextElementSibling.setAttribute("title",this.localizedTexts("abort"))),t.file.status=this.localizedTexts("inProgress"),t.file.statusCode="3",this.updateMetaData(t),{event:e||null,file:t.file,chunkIndex:t.chunkIndex,chunkCount:Math.round(t.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize});this.trigger("resuming",n);for(var a=0;a<this.pausedData.length;a++)this.pausedData[a].end===this.pausedData[a].file.size?this.chunkUploadComplete(e,t,i):this.pausedData[a].file.name===t.file.name&&(this.pausedData[a].start=this.pausedData[a].end,this.pausedData[a].end=this.pausedData[a].end+this.asyncSettings.chunkSize,this.pausedData[a].end=Math.min(this.pausedData[a].end,this.pausedData[a].file.size),this.pausedData[a].chunkIndex=this.pausedData[a].chunkIndex+1,this.sendRequest(this.pausedData[a].file,this.pausedData[a],i))},x.prototype.updateMetaData=function(t){-1===this.uploadMetaData.indexOf(t)||this.uploadMetaData.splice(this.uploadMetaData.indexOf(t),1),this.uploadMetaData.push(t)},x.prototype.removeChunkProgressBar=function(t){var t=this.getLiElement(t.file);C.isNullOrUndefined(t)||(this.updateProgressBarClasses(t,g),this.removeProgressbar(t,"success"),t=t.querySelector("."+v),C.isNullOrUndefined(t))||(t.classList.add(d),t.setAttribute("title",this.localizedTexts("delete")),t.classList.remove(v,f))},x.prototype.chunkUploadFailed=function(i,s,n){var a,l=this,t=Math.max(Math.ceil(s.file.size/this.asyncSettings.chunkSize),1),r=(!C.isNullOrUndefined(this.template)||!C.isNullOrUndefined(n)&&n||(a=this.getLiElement(s.file)),i&&i.currentTarget?this.getResponse(i):null),t={event:i,file:s.file,chunkIndex:s.chunkIndex,totalChunk:t,chunkSize:this.asyncSettings.chunkSize,cancel:!1,response:r};this.trigger("chunkFailure",t,function(t){var e;t.cancel||(s.retryCount<l.asyncSettings.retryCount?setTimeout(function(){l.retryRequest(a,s,n)},l.asyncSettings.retryAfterDelay):(C.isNullOrUndefined(a)||(t=a.querySelector("."+E)?a.querySelector("."+E):a.querySelector("."+cs),C.isNullOrUndefined(t)||(t.classList.add(ss),t.classList.remove(E,cs)),l.updateProgressBarClasses(a,y),l.removeProgressbar(a,"failure"),a.querySelector(".e-icons").classList.remove(f),(t=a.querySelector("."+v)?a.querySelector("."+v):a.querySelector("."+m)).classList.remove(v),C.isNullOrUndefined(a.querySelector("."+E))||C.detach(a.querySelector("."+E)),0<s.start?(t.classList.add(d),t.setAttribute("title",l.localizedTexts("delete"))):(t.classList.add(m),t.setAttribute("title",l.localizedTexts("remove")))),s.retryCount=0,e=s.file,t=l.localizedTexts("uploadFailedMessage"),t={e:i,response:r,operation:"upload",file:l.updateStatus(e,t,"0",!1),statusText:t},l.trigger("failure",t,function(t){l.updateStatus(e,t.statusText,"0"),l.uploadSequential(),l.checkActionComplete(!0)})))})},x.prototype.retryRequest=function(t,e,i){C.isNullOrUndefined(this.template)&&(C.isNullOrUndefined(i)||!i)&&t&&this.updateProgressBarClasses(t,y),e.retryCount+=1,this.sendRequest(e.file,e)},x.prototype.checkPausePlayAction=function(t){var e=t.target,i=t.target.parentElement,i=this.fileList.indexOf(i),i=this.filesData[i],i=this.getCurrentMetaData(i);e.classList.contains(E)?this.pauseUpload(i,t):e.classList.contains(cs)?this.resumeUpload(i,t):e.classList.contains(ss)&&(i.file.status===this.localizedTexts("fileUploadCancel")?this.retryUpload(i,!1):this.retryUpload(i,!0))},x.prototype.retryUpload=function(t,e){e?(t.end=t.end+this.asyncSettings.chunkSize,t.start=t.start+this.asyncSettings.chunkSize,this.sendRequest(t.file,t)):(t.file.statusCode="1",t.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(t.file)),this.getLiElement(t.file).classList.add(ms)},x.prototype.chunkUploadInProgress=function(t,e,i){var s,n,a=this;"4"===e.file.statusCode||("4"!==e.file.statusCode&&"5"!==e.file.statusCode&&(e.file.statusCode="3",e.file.status=this.localizedTexts("inProgress")),this.updateMetaData(e),s=this.getLiElement(e.file),C.isNullOrUndefined(s))||(n=s.querySelector("."+ss),C.isNullOrUndefined(n)||(n.classList.add(E),n.setAttribute("title",this.localizedTexts("pause")),n.classList.remove(ss)),C.isNullOrUndefined(s)||(0<s.querySelectorAll("."+as).length||(n=s.querySelector("."+c),C.isNullOrUndefined(this.template)&&(n.classList.add(f),n.classList.remove(y),this.createProgressBar(s),this.updateProgressBarClasses(s,f)),n=s.querySelector("."+m)?s.querySelector("."+m):s.querySelector("."+d),C.isNullOrUndefined(n))||(n.classList.add(v),n.setAttribute("title",this.localizedTexts("abort")),n.classList.remove(m)),!isNaN(Math.round(t.loaded/t.total*100))&&C.isNullOrUndefined(this.template)&&"4"!==e.file.statusCode&&(n=void 0,t=Math.ceil(e.file.size/this.asyncSettings.chunkSize)-1,this.asyncSettings.chunkSize)&&t&&(n=Math.round(e.chunkIndex/t*100),this.changeProgressValue(s,n.toString()+"%")),0===e.chunkIndex&&this.checkActionButtonStatus()),C.isNullOrUndefined(s.querySelector("."+E))&&C.isNullOrUndefined(this.template)&&C.isNullOrUndefined(s.querySelector("."+d))&&(this.pauseButton=this.createElement("span",{className:"e-icons e-file-pause-btn",attrs:{tabindex:this.btnTabIndex}}),"msie"===this.browserName&&this.pauseButton.classList.add("e-msie"),(t=s.querySelector("."+v)).parentElement.insertBefore(this.pauseButton,t),this.pauseButton.setAttribute("title",this.localizedTexts("pause")),this.pauseButton.addEventListener("click",function(t){a.checkPausePlayAction(t)},!1)))},x.prototype.bytesToSize=function(t){var e=-1;if(!t)return"0.0 KB";for(;e++,99<(t/=1024););return 2<=e&&(t*=1024,e=1),Math.max(t,0).toFixed(1)+" "+["KB","MB"][e]},x.prototype.sortFileList=function(t){for(var e=t=t||this.sortFilesList,i=[],s=0;s<e.length;s++)i.push(e[s].name);for(var n=[],a=0,l=i.sort();a<l.length;a++)for(var r=l[a],s=0;s<e.length;s++)r===e[s].name&&n.push(e[s]);return n},x.prototype.destroy=function(){this.element.value=null,this.clearTemplate(),this.clearAll(),this.unWireEvents(),this.unBindDropEvents(),this.multiple&&this.element.removeAttribute("multiple"),this.enabled||this.element.removeAttribute("disabled"),this.element.removeAttribute("accept"),this.setInitialAttributes();for(var t=0,e=["aria-label","directory","webkitdirectory","tabindex"];t<e.length;t++)this.element.removeAttribute(e[t]);C.isNullOrUndefined(this.uploadWrapper)||(this.uploadWrapper.parentElement.appendChild(this.element),C.detach(this.uploadWrapper)),this.uploadWrapper=null,this.uploadWrapper=null,this.browseButton=null,this.dropAreaWrapper=null,this.dropZoneElement=null,this.dropArea=null,this.keyboardModule=null,this.clearButton=null,this.uploadButton=null,ks.prototype.destroy.call(this)},x.prototype.upload=function(t,e){var i,s=this;t=t||this.filesData,this.sequentialUpload&&(this.isFirstFileOnSelection||e)?this.sequenceUpload(t):(i=this.getFilesInArray(t),this.trigger("beforeUpload",{customFormData:[],currentRequest:null,cancel:!1},function(t){t.cancel||(s.customFormDatas=t.customFormData&&0<t.customFormData.length?t.customFormData:s.customFormDatas,s.uploadFiles(i,e))}))},x.prototype.getFilesInArray=function(t){var e=[];return t instanceof Array?e=t:e.push(t),e},x.prototype.serverReadFileBase64=function(a,l,r){var o=this;return new Promise(function(i,s){var n,t=o.fileStreams[a].rawFile;try{var e=new FileReader;e.onload=(n=e,function(){try{var t=n.result,e=t?t.split(";base64,")[1]:null;i(e)}catch(t){s(t)}}),e.readAsDataURL(t.slice(l,l+r))}catch(t){s(t)}})},x.prototype.uploadFileCount=function(t){var e=this.filesData;return e&&0!==e.length?e.length:-1},x.prototype.getFileRead=function(t,e){var i=this.filesData;return i&&0!==i.length?(i=i[t],t=this.newFileRef++,this.fileStreams[t]=i,t):-1},x.prototype.uploadFiles=function(t,e){var i,s=[];if(""!==this.asyncSettings.saveUrl&&!C.isNullOrUndefined(this.asyncSettings.saveUrl)){s=!e||C.isNullOrUndefined(e)?this.multiple?this.filterfileList(t):((i=[]).push(t[0]),this.filterfileList(i)):t;for(var n=0;n<s.length;n++)this.uploadFilesRequest(s,n,e)}},x.prototype.uploadFilesRequest=function(i,s,e){var t,n=this,a=this.checkChunkUpload(),l=new C.Ajax(this.asyncSettings.saveUrl,"POST",!0,null),r=(l.emitError=!1,{fileData:i[s],customFormData:[],cancel:!1}),o=new FormData;l.beforeSend=function(e){r.currentRequest=l.httpRequest,n.trigger("uploading",r,function(t){t.cancel&&n.eventCancelByArgs(e,t,i[s]),n.customFormDatas&&0<n.customFormDatas.length&&n.updateFormData(o,n.customFormDatas),n.updateFormData(o,t.customFormData)})},"1"===i[s].statusCode&&(t=this.element.getAttribute("name"),o.append(t,i[s].rawFile,i[s].name),a&&i[s].size>this.asyncSettings.chunkSize?this.chunkUpload(i[s],e,s):(l.onLoad=function(t){return r.cancel||n.uploadComplete(t,i[s],e),{}},l.onUploadProgress=function(t){return r.cancel||n.uploadInProgress(t,i[s],e,l),{}},l.onError=function(t){return n.uploadFailed(t,i[s]),{}},l.send(o)))},x.prototype.spliceFiles=function(t){for(var e=this.fileList[t],i=this.getFilesData(),e=+e.getAttribute("data-files-count"),s=0,n=0;n<t;n++)s+=+this.fileList[n].getAttribute("data-files-count");for(var a=s+e-1;s<=a;a--)i.splice(a,1)},x.prototype.remove=function(l,a,r,t,o){var h=this,u=(C.isNullOrUndefined(t)&&(t=!0),{event:o,cancel:!1,filesData:[],customFormData:[],postRawFile:t,currentRequest:null});this.trigger("beforeRemove",{cancel:!1,customFormData:[],currentRequest:null},function(t){if(!t.cancel)if(h.isFormUpload())u.filesData=l,h.trigger("removing",u,function(t){if(!t.cancel)for(var e=!1,i=void 0,s=0,n=h.getFilesInArray(l);s<n.length;s++){var a=n[s];-1<(i=e?i:h.fileList.indexOf(a.list))&&((a=C.isNullOrUndefined(a.input)?null:a.input)&&C.detach(a),h.spliceFiles(i),C.detach(h.fileList[i]),h.fileList.splice(i,1),e=!0,i=-1)}});else if(h.isForm&&(C.isNullOrUndefined(h.asyncSettings.removeUrl)||""===h.asyncSettings.removeUrl))u.filesData=h.getFilesData(),h.trigger("removing",u,function(t){t.cancel||h.clearAll()});else for(var t=[],e=((l=C.isNullOrUndefined(l)?h.filesData:l)instanceof Array?t=l:t.push(l),u.filesData=t,h.asyncSettings.removeUrl),i=""!==e&&!C.isNullOrUndefined(e),s=0,n=t;s<n.length;s++)!function(e){var t=h.uploadedFilesData.indexOf(e);("2"===e.statusCode||"4"===e.statusCode||"0"===e.statusCode&&-1!==t)&&i?h.removeUploadedFile(e,u,r,a):r?h.removeFilesData(e,a):h.trigger("removing",u,function(t){t.cancel||h.removeFilesData(e,a)}),o&&!o.target.classList.contains(m)&&h.checkActionComplete(!1)}(n[s])})},x.prototype.clearAll=function(){var t,e=this;C.isNullOrUndefined(this.listParent)?("msie"!==this.browserName&&(this.element.value=""),this.filesData=[]):(t={cancel:!1,filesData:this.filesData},this.trigger("clearing",t,function(t){t.cancel||(e.clearData(),e.actionCompleteCount=0,e.count=-1)}))},x.prototype.getFilesData=function(t){return C.isNullOrUndefined(t)?this.filesData:this.getSelectedFiles(t)},x.prototype.pause=function(t,e){t=t||this.filesData;t=this.getFilesInArray(t);this.pauseUploading(t,e)},x.prototype.pauseUploading=function(t,e){for(var i=this.getFiles(t),s=0;s<i.length;s++)"3"===i[s].statusCode&&this.pauseUpload(this.getCurrentMetaData(i[s],null),null,e)},x.prototype.getFiles=function(t){var e=[];return C.isNullOrUndefined(t)||t instanceof Array?e=t:e.push(t),e},x.prototype.resume=function(t,e){t=t||this.filesData;t=this.getFilesInArray(t);this.resumeFiles(t,e)},x.prototype.resumeFiles=function(t,e){for(var i=this.getFiles(t),s=0;s<i.length;s++)"4"===i[s].statusCode&&this.resumeUpload(this.getCurrentMetaData(i[s],null),null,e)},x.prototype.retry=function(t,e,i){t=t||this.filesData;t=this.getFilesInArray(t);this.sequentialUpload&&this.isFirstFileOnSelection&&(this.isFirstFileOnSelection=!1),this.retryFailedFiles(t,e,i)},x.prototype.retryFailedFiles=function(t,e,i){for(var s,n=this.getFiles(t),a=0;a<n.length;a++)"5"!==n[a].statusCode&&"0"!==n[a].statusCode||(0<this.asyncSettings.chunkSize&&this.getCurrentMetaData(n[a],null)?this.retryUpload(this.getCurrentMetaData(n[a],null),e):(s=void 0,i||(s=this.fileList[this.filesData.indexOf(n[a])]),this.reloadcanceledFile(null,n[a],s,i)))},x.prototype.cancel=function(t){t=t||this.filesData;t=this.getFilesInArray(t);this.cancelUpload(t)},x.prototype.cancelUpload=function(t){var e=this.getFiles(t);if(0<this.asyncSettings.chunkSize)for(var i,s=0;s<e.length;s++)"3"===e[s].statusCode&&((i=this.getCurrentMetaData(e[s],null)).file.statusCode="5",i.file.status=this.localizedTexts("fileUploadCancel"),this.updateMetaData(i),this.showHideUploadSpinner(e[s]));else for(s=0;s<e.length;s++)"3"===e[s].statusCode&&(e[s].statusCode="5",e[s].status=this.localizedTexts("fileUploadCancel"),this.showHideUploadSpinner(e[s]))},x.prototype.showHideUploadSpinner=function(t){var t=this.getLiElement(t);!C.isNullOrUndefined(t)&&C.isNullOrUndefined(this.template)&&(t=t.querySelector("."+v),h.createSpinner({target:t,width:"20px"}),h.showSpinner(t))},s([C.Complex({saveUrl:"",removeUrl:""},Ts)],x.prototype,"asyncSettings",void 0),s([C.Property(!1)],x.prototype,"sequentialUpload",void 0),s([C.Property({})],x.prototype,"htmlAttributes",void 0),s([C.Property("")],x.prototype,"cssClass",void 0),s([C.Property(!0)],x.prototype,"enabled",void 0),s([C.Property(null)],x.prototype,"template",void 0),s([C.Property(!0)],x.prototype,"multiple",void 0),s([C.Property(!0)],x.prototype,"autoUpload",void 0),s([C.Property(!0)],x.prototype,"enableHtmlSanitizer",void 0),s([C.Complex({},Es)],x.prototype,"buttons",void 0),s([C.Property("")],x.prototype,"allowedExtensions",void 0),s([C.Property(0)],x.prototype,"minFileSize",void 0),s([C.Property(3e7)],x.prototype,"maxFileSize",void 0),s([C.Property(null)],x.prototype,"dropArea",void 0),s([C.Collection([{}],ys)],x.prototype,"files",void 0),s([C.Property(!0)],x.prototype,"showFileList",void 0),s([C.Property(!1)],x.prototype,"directoryUpload",void 0),s([C.Property("Default")],x.prototype,"dropEffect",void 0),s([C.Event()],x.prototype,"created",void 0),s([C.Event()],x.prototype,"actionComplete",void 0),s([C.Event()],x.prototype,"rendering",void 0),s([C.Event()],x.prototype,"beforeUpload",void 0),s([C.Event()],x.prototype,"fileListRendering",void 0),s([C.Event()],x.prototype,"selected",void 0),s([C.Event()],x.prototype,"uploading",void 0),s([C.Event()],x.prototype,"success",void 0),s([C.Event()],x.prototype,"failure",void 0),s([C.Event()],x.prototype,"removing",void 0),s([C.Event()],x.prototype,"beforeRemove",void 0),s([C.Event()],x.prototype,"clearing",void 0),s([C.Event()],x.prototype,"progress",void 0),s([C.Event()],x.prototype,"change",void 0),s([C.Event()],x.prototype,"chunkSuccess",void 0),s([C.Event()],x.prototype,"chunkFailure",void 0),s([C.Event()],x.prototype,"chunkUploading",void 0),s([C.Event()],x.prototype,"canceling",void 0),s([C.Event()],x.prototype,"pausing",void 0),s([C.Event()],x.prototype,"resuming",void 0);var ks,t=s([C.NotifyPropertyChanges],x);function x(t,e){e=ks.call(this,t,e)||this;return e.initialAttr={accept:null,multiple:!1,disabled:!1},e.uploadedFilesData=[],e.base64String=[],e.isForm=!1,e.allTypes=!1,e.pausedData=[],e.uploadMetaData=[],e.tabIndex="0",e.btnTabIndex="0",e.disableKeyboardNavigation=!1,e.count=-1,e.actionCompleteCount=0,e.flag=!0,e.selectedFiles=[],e.uploaderName="UploadFiles",e.fileStreams=[],e.newFileRef=0,e.isFirstFileOnSelection=!1,e.dragCounter=0,e.fileList=[],e.filesData=[],e.uploaderOptions=t,e}Os=function(t,e){return(Os=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Os,Ls,s=function(t,e){function i(){this.constructor=t}Os(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},S=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},ws="e-apply",As="e-cancel",Ns="e-current",Hs="e-ctrl-btn",Bs="e-switch-ctrl-btn",Us="e-disabled",Rs="e-value-switch-btn",Is="e-handler",Vs="e-hide-hex-value",Fs="e-hide-opacity",Ms="e-hide-switchable-value",Ds="e-hide-value",zs="e-hide-valueswitcher",Ws="e-hsv-color",qs="e-hsv-container",js="e-selected-value",_s="e-mode-switch-btn",Xs="e-nocolor-item",Ks="e-opacity-value",Ys="e-palette",Zs="e-color-palette",Gs="e-color-picker",Js="e-preview-container",$s="e-previous",Qs="e-show-value",tn="e-selected",en="e-split-preview",sn="e-tile",nn=["#000000","#f44336","#e91e63","#9c27b0","#673ab7","#2196f3","#03a9f4","#00bcd4","#009688","#ffeb3b","#ffffff","#ffebee","#fce4ec","#f3e5f5","#ede7f6","#e3f2fd","#e1f5fe","#e0f7fa","#e0f2f1","#fffde7","#f2f2f2","#ffcdd2","#f8bbd0","#e1bee7","#d1c4e9","#bbdefb","#b3e5fc","#b2ebf2","#b2dfdb","#fff9c4","#e6e6e6","#ef9a9a","#f48fb1","#ce93d8","#b39ddb","#90caf9","#81d4fa","#80deea","#80cbc4","#fff59d","#cccccc","#e57373","#f06292","#ba68c8","#9575cd","#64b5f6","#4fc3f7","#4dd0e1","#4db6ac","#fff176","#b3b3b3","#ef5350","#ec407a","#ab47bc","#7e57c2","#42a5f5","#29b6f6","#26c6da","#26a69a","#ffee58","#999999","#e53935","#d81b60","#8e24aa","#5e35b1","#1e88e5","#039be5","#00acc1","#00897b","#fdd835","#808080","#d32f2f","#c2185b","#7b1fa2","#512da8","#1976d2","#0288d1","#0097a7","#00796b","#fbc02d","#666666","#c62828","#ad1457","#6a1b9a","#4527a0","#1565c0","#0277bd","#00838f","#00695c","#f9a825","#4d4d4d","#b71c1c","#880e4f","#4a148c","#311b92","#0d47a1","#01579b","#006064","#004d40","#f57f17"],s=(Ls=C.Component,s(T,Ls),T.prototype.preRender=function(){var t=this.element;this.formElement=C.closest(this.element,"form"),this.formElement&&C.EventHandler.add(this.formElement,"reset",this.formResetHandler,this);this.l10n=new C.L10n("colorpicker",{Apply:"Apply",Cancel:"Cancel",ModeSwitcher:"Switch Mode",RecentColors:"Recent colors"},this.locale),t.getAttribute("ejs-for")&&!t.getAttribute("name")&&t.setAttribute("name",t.id)},T.prototype.render=function(){this.initWrapper(),this.inline?this.createWidget():this.createSplitBtn(),this.enableOpacity||C.addClass([this.container.parentElement],Fs),this.renderComplete()},T.prototype.initWrapper=function(){var t=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"}),e=(this.element.parentNode.insertBefore(t,this.element),t.appendChild(this.element),C.attributes(this.element,{tabindex:"-1",spellcheck:"false","aria-label":"colorpicker"}),this.container=this.createElement("div",{className:"e-container"}),this.getWrapper().appendChild(this.container),this.value?this.roundValue(this.value).toLowerCase():"#008000ff"),i=(e=this.noColor&&"Palette"===this.mode&&""===this.value?"":e).slice(0,7);C.isNullOrUndefined(this.initialInputValue)&&(this.initialInputValue=i),this.element.value=i,this.enableOpacity?this.setProperties({value:e},!0):this.setProperties({value:i},!0),this.enableRtl&&t.classList.add("e-rtl"),this.cssClass&&C.addClass([t],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.tileRipple=C.rippleEffect(this.container,{selector:"."+sn}),this.ctrlBtnRipple=C.rippleEffect(this.container,{selector:".e-btn"})},T.prototype.getWrapper=function(){return this.element.parentElement},T.prototype.createWidget=function(){"Palette"===this.mode?(this.createPalette(),this.inline||this.firstPaletteFocus()):(this.createPicker(),this.inline||this.getDragHandler().focus()),this.isRgb=!0,this.createInput(),this.createCtrlBtn(),this.disabled||this.wireEvents(),this.inline&&this.disabled&&this.toggleDisabled(!0),C.Browser.isDevice&&this.refreshPopupPos()},T.prototype.createSplitBtn=function(){var e=this,t=this.createElement("button",{className:"e-split-colorpicker"}),i=(this.getWrapper().appendChild(t),this.splitBtn=new I.SplitButton({iconCss:"e-selected-color",target:this.container,disabled:this.disabled,enableRtl:this.enableRtl,createPopupOnClick:this.createPopupOnClick,open:this.onOpen.bind(this),click:function(){var t=new MouseEvent("click",{bubbles:!0,cancelable:!1});e.trigger("change",{currentValue:{hex:e.value.slice(0,7),rgba:e.convertToRgbString(e.hexToRgb(e.value))},previousValue:{hex:null,rgba:null},value:e.value,event:t})}}),this.splitBtn.createElement=this.createElement,this.splitBtn.appendTo(t),this.splitBtn.element.setAttribute("aria-label","colorpicker"),this.createElement("span",{className:en})),t=(C.select(".e-selected-color",t).appendChild(i),i.style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.getPopupEle());C.addClass([t],"e-colorpicker-popup"),this.cssClass&&C.addClass([t],this.cssClass.replace(/\s+/g," ").trim().split(" ")),C.Browser.isDevice&&!this.createPopupOnClick&&((i=this.getPopupInst()).relateTo=document.body,i.position={X:"center",Y:"center"},i.targetType="container",i.collision={X:"fit",Y:"fit"},i.offsetY=4,t.style.zIndex=h.getZindexPartial(this.splitBtn.element).toString()),this.bindCallBackEvent()},T.prototype.onOpen=function(){var t;this.trigger("open",{element:this.container}),C.Browser.isDevice||(t=this.getPopupInst(),0<h.isCollide(t.element).length&&(t.collision={X:"flip",Y:"fit"},t.position={X:"right",Y:"bottom"},t.targetType="container"))},T.prototype.getPopupInst=function(){return C.getInstance(this.getPopupEle(),h.Popup)},T.prototype.bindCallBackEvent=function(){var a=this;this.splitBtn.beforeOpen=function(s){var n=new I.Deferred;return a.trigger("beforeOpen",s,function(t){var e,i;t.cancel||((e=a.getPopupEle()).style.top=C.formatUnit(0+pageYOffset),e.style.left=C.formatUnit(0+pageXOffset),e.style.display="block",a.createWidget(),e.style.display="",C.Browser.isDevice&&(a.createPopupOnClick&&((i=a.getPopupInst()).relateTo=document.body,i.position={X:"center",Y:"center"},i.targetType="container",i.collision={X:"fit",Y:"fit"},i.offsetY=4,e.style.zIndex=h.getZindexPartial(a.splitBtn.element).toString()),a.modal=a.createElement("div"),a.modal.className="e-"+a.getModuleName()+" e-modal",a.modal.style.display="none",document.body.insertBefore(a.modal,e),document.body.className+=" e-colorpicker-overflow",a.modal.style.display="block",a.modal.style.zIndex=(Number(e.style.zIndex)-1).toString())),s.cancel=t.cancel,n.resolve(t)}),n},this.splitBtn.beforeClose=function(e){var t,i=new I.Deferred;return C.isNullOrUndefined(e.event)?i.resolve(e):(t={element:a.container,event:e.event,cancel:!1},a.trigger("beforeClose",t,function(t){C.Browser.isDevice&&e.event.target===a.modal&&(t.cancel=!0),t.cancel||a.onPopupClose(),e.cancel=t.cancel,i.resolve(t)})),i}},T.prototype.onPopupClose=function(){this.unWireEvents(),this.destroyOtherComp(),this.container.style.width="",C.select("."+en,this.splitBtn.element).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.container.innerHTML="",C.removeClass([this.container],[Gs,Zs]),C.Browser.isDevice&&this.modal&&(C.removeClass([document.body],"e-colorpicker-overflow"),this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},T.prototype.createPalette=function(){if(C.classList(this.container,[Zs],[Gs]),this.presetColors){var t=this.createElement("div",{className:"e-custom-palette"}),e=(this.appendElement(t),Object.keys(this.presetColors));if(1===e.length)this.appendPalette(this.presetColors[e[0]],e[0],t);else for(var i=0,s=e.length;i<s;i++)this.appendPalette(this.presetColors[e[i]],e[i],t);10<C.selectAll(".e-row",t).length&&C.addClass([t],"e-palette-group")}else this.appendPalette(nn,"default");"Palette"===this.mode&&!this.modeSwitcher&&this.noColor&&this.setNoColor(),this.showRecentColors&&this.recentColors&&0<this.recentColors.length&&this.renderRecentColor();var n=parseInt(getComputedStyle(this.container).borderBottomWidth,10);this.container.style.width=C.formatUnit(this.container.children[0].offsetWidth+n+n),this.rgb=this.hexToRgb(this.roundValue(this.value)),this.hsv=this.rgbToHsv.apply(this,this.rgb)},T.prototype.renderRecentColor=function(){var i=this,t=this.container.querySelector(".e-clr-pal-rec-wpr"),t=(t&&C.detach(t),this.createElement("div",{className:"e-clr-pal-rec-wpr"})),e=this.container.querySelector(".e-switch-ctrl-btn"),e=(e?this.container.insertBefore(t,e):this.container.appendChild(t),this.createElement("label",{className:"e-recent-clr-span"}));if(e.textContent=this.l10n.getConstant("RecentColors"),t.appendChild(e),0<this.recentColors.length){for(this.recentColors=this.recentColors.filter(function(t,e){return i.recentColors.indexOf(t)===e});10<this.recentColors.length;)this.recentColors.pop();this.appendPalette(this.recentColors,"recent-color",t)}},T.prototype.firstPaletteFocus=function(){C.select("."+tn,this.container.children[0])||C.selectAll("."+Ys,this.container)[0].focus()},T.prototype.appendPalette=function(t,e,i){var s,n,a,l=this.createElement("div",{className:Ys,attrs:{tabindex:"0",role:"grid"}});"recent-color"===e&&l.classList.add("e-recent-palette"),i?i.appendChild(l):this.appendElement(l);for(var r=0,o=t.length;r<o;r++)0!==r&&r%this.columns!=0||(s=this.createElement("div",{className:"e-row",attrs:{role:"row"}}),l.appendChild(s)),a=this.roundValue(t[r]).toLowerCase(),n=this.createElement("span",{className:sn,attrs:{role:"gridcell","aria-label":a,"aria-selected":"false"}}),this.trigger("beforeTileRender",{element:n,presetName:e,value:t[r]}),s.appendChild(n),this.value===a&&"recent-color"!==e&&(this.addTileSelection(n),l.focus()),n.style.backgroundColor=this.convertToRgbString(this.hexToRgb(a))},T.prototype.setNoColor=function(){var e=this.container.querySelector(".e-row").children[0];e.classList.add(Xs),this.value||(e.classList.add(tn),C.closest(e,"."+Ys).focus()),["aria-selected","aria-label"].forEach(function(t){e.removeAttribute(t)}),e.style.backgroundColor=""},T.prototype.appendElement=function(t,e){e=this.container.children[e=void 0===e?0:e];e?this.container.insertBefore(t,e):this.container.appendChild(t)},T.prototype.addTileSelection=function(t){t&&(t.classList.add(tn),t.setAttribute("aria-selected","true"))},T.prototype.createPicker=function(){C.classList(this.container,[Gs],[Zs]);var t=this.createElement("div",{className:qs}),e=(this.appendElement(t),t.appendChild(this.createElement("div",{className:Ws})),this.createElement("span",{className:Is,attrs:{tabindex:"0"}}));t.appendChild(e),null!==this.value&&""!==this.value||(this.value="#008000ff"),this.rgb=this.hexToRgb(this.value),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHsvContainerBg(),this.setHandlerPosition(),this.createSlider(),this.createDragTooltip()},T.prototype.setHsvContainerBg=function(t){void 0===t&&(t=this.hsv[0]),this.getHsvContainer().style.backgroundColor=this.convertToRgbString(this.hsvToRgb(t,100,100,1))},T.prototype.getHsvContainer=function(){return C.select("."+qs,this.container)},T.prototype.setHandlerPosition=function(){var t=this.getDragHandler(),e=C.select("."+Ws,this.container);this.enableRtl?t.style.left=C.formatUnit((e.offsetWidth-t.offsetWidth/2.5)*Math.abs(100-this.hsv[1])/100):t.style.left=C.formatUnit((e.offsetWidth-t.offsetWidth/2.5)*this.hsv[1]/100),t.style.top=C.formatUnit((e.offsetHeight-t.offsetHeight/2.5)*(100-this.hsv[2])/100)},T.prototype.createSlider=function(){var t=this.createElement("div",{className:"e-slider-preview"}),e=(this.appendElement(t,1),this.createPreview(t),this.createElement("div",{className:"e-colorpicker-slider"})),t=(t.insertBefore(e,t.children[0]),this.createElement("div",{className:"e-hue-slider"}));e.appendChild(t),this.hueSlider=new zi({value:this.hsv[0],min:0,max:359,enableRtl:this.enableRtl,enabled:!this.disabled,change:this.hueChange.bind(this)}),this.hueSlider.createElement=this.createElement,this.hueSlider.appendTo(t),this.enableOpacity&&(t=this.createElement("div",{className:"e-opacity-slider"}),e.appendChild(t),this.createOpacitySlider(t))},T.prototype.createOpacitySlider=function(t){this.opacitySlider=new zi({value:100*this.rgb[3],min:0,max:100,enableRtl:this.enableRtl,enabled:!this.disabled,change:this.opacityChange.bind(this)}),this.opacitySlider.createElement=this.createElement,this.opacitySlider.appendTo(t);var e=this.createElement("div",{className:"e-opacity-empty-track"});t.appendChild(e),this.updateOpacitySliderBg()},T.prototype.updateOpacitySliderBg=function(){var t=this.enableRtl?"to left":"to right",e=C.select(".e-opacity-empty-track",this.opacitySlider.element);e&&(e.style.background="linear-gradient("+t+", rgba("+this.rgb.slice(0,3)+", 0) 0%, "+this.convertToRgbString(this.rgb.slice(0,3))+" 100%)")},T.prototype.hueChange=function(t){this.hsv[0]=t.value,this.setHsvContainerBg(),this.convertToOtherFormat()},T.prototype.opacityChange=function(t){var t=t.value,e=this.rgbToHex(this.rgb),i=(this.hsv[3]=t/100,this.rgb[3]=t/100,this.rgbToHex(this.rgb)),t=(this.updateOpacityInput(t),this.convertToRgbString(this.rgb));this.updatePreview(t),this.triggerEvent(i,e,t)},T.prototype.updateOpacityInput=function(t){var e;this.enableOpacity&&!this.getWrapper().classList.contains(Ds)&&((e=C.getInstance(C.select("."+Ks,this.container),Ht)).value=t,e.dataBind())},T.prototype.createPreview=function(t){var e=this.createElement("div",{className:Js}),t=(t.appendChild(e),this.createElement("span",{className:"e-preview "+Ns})),i=(e.appendChild(t),this.convertToRgbString(this.rgb));t.style.backgroundColor=i,t=this.createElement("span",{className:"e-preview "+$s}),e.appendChild(t),t.style.backgroundColor=i},T.prototype.isPicker=function(){return!this.container.classList.contains(Zs)},T.prototype.getPopupEle=function(){return this.container.parentElement},T.prototype.createNumericInput=function(t,e,i,s){var n=this,e=new Ht({value:e,placeholder:i,min:0,max:s,format:"###.##",showSpinButton:!1,floatLabelType:"Always",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker(),change:function(t){t.event&&n.inputHandler(t.event)}});e.createElement=this.createElement,e.appendTo(t)},T.prototype.createInput=function(){var t=this.isPicker(),e=this.getWrapper();if(t&&!e.classList.contains(Ds)||!t&&e.classList.contains(Qs)){var i=this.createElement("div",{className:js}),s=(t?this.appendElement(i,2):this.appendElement(i,1),this.createElement("div",{className:"e-input-container"}));if(i.appendChild(s),e.classList.contains(zs)||this.appendValueSwitchBtn(i),e.classList.contains(Vs)||(t=this.createElement("input",{className:"e-hex",attrs:{maxlength:"7",spellcheck:"false","aria-label":"HEX"}}),s.appendChild(t),o.Input.createInput({element:t,floatLabelType:"Always",properties:{placeholder:"HEX",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker()}},this.createElement),o.Input.setValue(this.value.slice(0,7),t),t.addEventListener("input",this.inputHandler.bind(this))),!e.classList.contains(Ms)){for(var n=void 0,a=void 0,a=this.isRgb?(n="RGB",this.rgb):(n="HSV",this.hsv),l=["rh","gs","bv"],r=0;r<3;r++)this.createNumericInput(s.appendChild(this.createElement("input",{className:"e-"+l[r]+"-value"})),a[r],n[r],255);this.enableOpacity&&this.appendOpacityValue(s)}}},T.prototype.appendOpacityValue=function(t){this.createNumericInput(t.appendChild(this.createElement("input",{className:Ks})),100*this.rgb[3],"A",100)},T.prototype.appendValueSwitchBtn=function(t){var e=this.createElement("button",{className:"e-icons e-css e-btn e-flat e-icon-btn "+Rs,attrs:{title:"Toggle format"}});t.appendChild(e),this.isPicker()&&!this.getWrapper().classList.contains(Ms)&&e.addEventListener("click",this.formatSwitchHandler.bind(this))},T.prototype.createCtrlBtn=function(){var t,e;(this.modeSwitcher||this.showButtons)&&(this.l10n.setLocale(this.locale),e=this.createElement("div",{className:Bs}),this.container.appendChild(e),this.showButtons&&(t=this.createElement("div",{className:Hs}),e.appendChild(t),e=this.l10n.getConstant("Apply"),t.appendChild(this.createElement("button",{innerHTML:e,className:"e-btn e-css e-flat e-primary e-small "+ws,attrs:{title:e}})),e=this.l10n.getConstant("Cancel"),t.appendChild(this.createElement("button",{innerHTML:e,className:"e-btn e-css e-flat e-small "+As,attrs:{title:e}}))),this.modeSwitcher)&&this.appendModeSwitchBtn()},T.prototype.appendModeSwitchBtn=function(){var t=this.createElement("button",{className:"e-icons e-btn e-flat e-icon-btn "+_s,attrs:{title:this.l10n.getConstant("ModeSwitcher")}});C.select("."+Bs,this.container).insertBefore(t,C.select("."+Hs,this.container))},T.prototype.createDragTooltip=function(){var e=this,t=new h.Tooltip({opensOn:"Custom",showTipPointer:!1,cssClass:"e-color-picker-tooltip",htmlAttributes:{title:"tooltip"},beforeOpen:function(t){e.tooltipEle=t.element},animation:{open:{effect:"None"},close:{effect:"None"}}});t.createElement=this.createElement,t.appendTo(this.container),t.open(this.container),this.tooltipEle.style.zIndex=h.getZindexPartial(this.tooltipEle).toString(),this.tooltipEle.setAttribute("aria-label","colorpicker-tooltip"),C.select(".e-tip-content",this.tooltipEle).appendChild(this.createElement("div",{className:"e-tip-transparent"}))},T.prototype.getTooltipInst=function(){return C.getInstance(this.container,h.Tooltip)},T.prototype.setTooltipOffset=function(t){this.getTooltipInst().offsetY=t},T.prototype.toggleDisabled=function(e){e?this.getWrapper().classList.add(Us):this.getWrapper().classList.remove(Us),this.showButtons&&[].slice.call(C.selectAll(".e-btn",this.container)).forEach(function(t){e?C.attributes(t,{disabled:""}):t.removeAttribute("disabled")})},T.prototype.convertToRgbString=function(t){return t.length?4===t.length?"rgba("+t.join()+")":"rgb("+t.join()+")":""},T.prototype.convertToHsvString=function(t){return 4===t.length?"hsva("+t.join()+")":"hsv("+t.join()+")"},T.prototype.updateHsv=function(){this.hsv[1]=100<this.hsv[1]?100:this.hsv[1],this.hsv[2]=100<this.hsv[2]?100:this.hsv[2],this.setHandlerPosition()},T.prototype.convertToOtherFormat=function(t,e){void 0===t&&(t=!1);var i=this.rgbToHex(this.rgb),s=(this.rgb=this.hsvToRgb.apply(this,this.hsv),this.rgbToHex(this.rgb)),n=this.convertToRgbString(this.rgb);this.updatePreview(n),this.updateInput(s),this.triggerEvent(s,i,n,t,e)},T.prototype.updateInput=function(t){var e=this.getWrapper();e.classList.contains(Ds)||(e.classList.contains(Vs)||o.Input.setValue(t.substr(0,7),C.select(".e-hex",this.container)),e.classList.contains(Ms))||(this.isRgb?this.updateValue(this.rgb,!1):this.updateValue(this.hsv,!1))},T.prototype.updatePreview=function(t){this.enableOpacity&&this.updateOpacitySliderBg(),C.select(".e-tip-transparent",this.tooltipEle).style.backgroundColor=t,C.select("."+Js+" ."+Ns,this.container).style.backgroundColor=t,C.select("."+Js+" ."+$s,this.container).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value))},T.prototype.getDragHandler=function(){return C.select("."+Is,this.container)},T.prototype.removeTileSelection=function(){[].slice.call(C.selectAll("."+tn,this.container)).forEach(function(t){t.classList.remove(tn),t.setAttribute("aria-selected","false")})},T.prototype.convertRgbToNumberArray=function(t){return t.slice(t.indexOf("(")+1,t.indexOf(")")).split(",").map(function(t,e){return 3!==e?parseInt(t,10):parseFloat(t)})},T.prototype.getValue=function(t,e){var i,s;return t=t||this.value,e=e?e.toLowerCase():"hex","r"===t[0]?(i=this.convertRgbToNumberArray(t),"hex"===e||"hexa"===e?(s=this.rgbToHex(i),"hex"===e?s.slice(0,7):s):"hsv"===e?this.convertToHsvString(this.rgbToHsv.apply(this,i.slice(0,3))):"hsva"===e?this.convertToHsvString(this.rgbToHsv.apply(this,i)):"null"):"h"===t[0]?(i=this.hsvToRgb.apply(this,this.convertRgbToNumberArray(t)),"rgba"===e?this.convertToRgbString(i):"hex"===e||"hexa"===e?(s=this.rgbToHex(i),"hex"===e?s.slice(0,7):s):"rgb"===e?this.convertToRgbString(i.slice(0,3)):"null"):(t=this.roundValue(t),s=this.hexToRgb(t),"rgb"!==e&&"hsv"!==e||(s=s.slice(0,3)),"rgba"===e||"rgb"===e?this.convertToRgbString(s):"hsva"===e||"hsv"===e?this.convertToHsvString(this.rgbToHsv.apply(this,s)):"hex"===e?t.slice(0,7):"a"===e?s[3].toString():"null")},T.prototype.toggle=function(){this.container.parentElement.classList.contains("e-popup-close")?this.splitBtn.toggle():this.closePopup(null)},T.prototype.getModuleName=function(){return"colorpicker"},T.prototype.getPersistData=function(){return this.addOnPersist(["value"])},T.prototype.wireEvents=function(){var t;this.isPicker()?(t=this.getDragHandler(),C.EventHandler.add(t,"keydown",this.pickerKeyDown,this),(t=C.select("."+Hs,this.container))&&C.EventHandler.add(t,"keydown",this.ctrlBtnKeyDown,this),C.EventHandler.add(this.getHsvContainer(),"mousedown touchstart",this.handlerDown,this),(this.modeSwitcher||this.showButtons)&&this.addCtrlSwitchEvent(),C.EventHandler.add(C.select("."+$s,this.container),"click",this.previewHandler,this)):(C.EventHandler.add(this.container,"click",this.paletteClickHandler,this),C.EventHandler.add(this.container,"keydown",this.paletteKeyDown,this))},T.prototype.formResetHandler=function(){this.value=this.initialInputValue,C.attributes(this.element,{value:this.initialInputValue})},T.prototype.addCtrlSwitchEvent=function(){var t=C.select("."+Bs,this.container);t&&C.EventHandler.add(t,"click",this.btnClickHandler,this)},T.prototype.ctrlBtnKeyDown=function(t){13===t.keyCode&&(C.select("."+ws,this.container)&&(t=this.rgbToHex(this.rgb),this.triggerChangeEvent(t)),this.splitBtn.element.focus())},T.prototype.pickerKeyDown=function(t){switch(t.keyCode){case 39:this.handlerDragPosition(1,this.enableRtl?-1:1,t);break;case 37:this.handlerDragPosition(1,this.enableRtl?1:-1,t);break;case 38:this.handlerDragPosition(2,1,t);break;case 40:this.handlerDragPosition(2,-1,t);break;case 13:t.preventDefault();var e=this.rgbToHex(this.rgb);this.enterKeyHandler(e)}},T.prototype.enterKeyHandler=function(t){this.triggerChangeEvent(t),this.inline||this.splitBtn.element.focus()},T.prototype.closePopup=function(t){var e=this,t={element:this.container,event:t,cancel:!1};this.trigger("beforeClose",t,function(t){t.cancel||(e.splitBtn.toggle(),e.onPopupClose())})},T.prototype.triggerChangeEvent=function(t,e){var i=t.slice(0,7);this.trigger("change",{currentValue:{hex:i,rgba:this.convertToRgbString(this.rgb)},event:e,previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:this.enableOpacity?t:i}),this.showRecentColors&&(this.recentColors.unshift(i),this.inline)&&this.renderRecentColor(),this.enableOpacity?this.setProperties({value:t},!0):this.setProperties({value:i},!0),this.element.value=i||"#000000"},T.prototype.handlerDragPosition=function(t,e,i){i.preventDefault(),this.hsv[t]+=e*(i.ctrlKey?1:3),this.hsv[t]<0&&(this.hsv[t]=0),this.updateHsv(),this.convertToOtherFormat(!0,i)},T.prototype.handlerDown=function(t){t.preventDefault(),"mousedown"===t.type?(this.clientX=Math.abs(t.pageX-pageXOffset),this.clientY=Math.abs(t.pageY-pageYOffset),this.setTooltipOffset(8)):(this.clientX=Math.abs(t.changedTouches[0].pageX-pageXOffset),this.clientY=Math.abs(t.changedTouches[0].pageY-pageYOffset),this.setTooltipOffset(-8)),this.setHsv(this.clientX,this.clientY),this.getDragHandler().style.transition="left .4s cubic-bezier(.25, .8, .25, 1), top .4s cubic-bezier(.25, .8, .25, 1)",this.updateHsv(),this.convertToOtherFormat(!1,t),this.getDragHandler().focus(),C.EventHandler.add(document,"mousemove touchmove",this.handlerMove,this),C.EventHandler.add(document,"mouseup touchend",this.handlerEnd,this)},T.prototype.handlerMove=function(t){"touchmove"!==t.type&&t.preventDefault(),i="mousemove"===t.type?(e=Math.abs(t.pageX-pageXOffset),Math.abs(t.pageY-pageYOffset)):(e=Math.abs(t.changedTouches[0].pageX-pageXOffset),Math.abs(t.changedTouches[0].pageY-pageYOffset)),this.setHsv(e,i);var e,i,s=this.getDragHandler();this.updateHsv(),this.convertToOtherFormat(!1,t),this.getTooltipInst().refresh(s),this.tooltipEle.style.transform||(8<Math.abs(this.clientX-e)||8<Math.abs(this.clientY-i))&&(C.select("."+Ws,this.container).style.cursor="pointer",s.style.transition="none",this.inline||(this.tooltipEle.style.zIndex=(parseInt(this.getPopupEle().style.zIndex,10)+1).toString()),this.tooltipEle.style.transform="rotate(45deg)",s.classList.add("e-hide-handler"))},T.prototype.setHsv=function(t,e){var i=C.select("."+Ws,this.container),s=i.getBoundingClientRect();t=this.enableRtl?t>s.right?0:Math.abs(t-s.right):t>s.left?Math.abs(t-s.left):0,e=e>s.top?Math.abs(e-s.top):0,this.hsv[2]=Math.round(10*Number(100*(i.offsetHeight-Math.max(0,Math.min(i.offsetHeight,e-i.offsetTop)))/i.offsetHeight))/10,this.hsv[1]=Math.round(10*Number(100*Math.max(0,Math.min(i.offsetWidth,t-i.offsetLeft))/i.offsetWidth))/10},T.prototype.handlerEnd=function(t){"touchend"!==t.type&&t.preventDefault(),C.EventHandler.remove(document,"mousemove touchmove",this.handlerMove),C.EventHandler.remove(document,"mouseup touchend",this.handlerEnd);var e=this.getDragHandler();C.select("."+Ws,this.container).style.cursor="",this.tooltipEle.style.transform&&(this.tooltipEle.style.transform="",e.classList.remove("e-hide-handler")),this.inline||this.showButtons||this.closePopup(t)},T.prototype.btnClickHandler=function(t){var e=t.target;C.closest(e,"."+_s)?(t.stopPropagation(),this.switchToPalette()):(e.classList.contains(ws)||e.classList.contains(As))&&this.ctrlBtnClick(e,t)},T.prototype.switchToPalette=function(){this.trigger("beforeModeSwitch",{element:this.container,mode:"Palette"}),this.unWireEvents(),this.destroyOtherComp(),C.detach(C.select(".e-slider-preview",this.container)),this.getWrapper().classList.contains(Ds)||C.remove(C.select("."+js,this.container)),C.detach(this.getHsvContainer()),this.createPalette(),this.firstPaletteFocus(),this.createInput(),this.refreshPopupPos(),this.element.parentElement&&this.element.parentElement.parentElement&&this.element.parentElement.parentElement.classList.contains("e-ie-ddb-popup")&&this.refreshImageEditorPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Palette"})},T.prototype.refreshImageEditorPopupPos=function(){var t,e;C.Browser.isDevice&&((t=this.getPopupEle()).style.left=C.formatUnit(0+pageXOffset),t.style.top=C.formatUnit(0+pageYOffset),e=document.querySelector("#"+this.element.parentElement.parentElement.id.split("-popup")[0]))&&t.parentElement.ej2_instances[0].refreshPosition(e)},T.prototype.refreshPopupPos=function(){var t;this.inline||((t=this.getPopupEle()).style.left=C.formatUnit(0+pageXOffset),t.style.top=C.formatUnit(0+pageYOffset),this.getPopupInst().refreshPosition(this.splitBtn.element.parentElement))},T.prototype.formatSwitchHandler=function(){this.isRgb?(this.updateValue(this.hsv,!0,3,[360,100,100]),this.isRgb=!1):(this.updateValue(this.rgb,!0,2),this.isRgb=!0)},T.prototype.updateValue=function(t,e,i,s){for(var n,a=["e-rh-value","e-gs-value","e-bv-value"],l=0,r=a.length;l<r;l++)(n=C.getInstance(C.select("."+a[l],this.container),Ht)).value=Math.round(t[l]),e&&(n.placeholder=a[l].substr(i,1).toUpperCase(),n.max=s?s[l]:255),n.dataBind()},T.prototype.previewHandler=function(t){var e=t.target,i=this.rgbToHex(this.rgb),e=(this.rgb=this.convertRgbToNumberArray(e.style.backgroundColor),this.rgb[3]||(this.rgb[3]=1),this.rgbToHex(this.rgb)),s=this.rgbToHsv.apply(this,this.rgb);s[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:s[0]},!0),this.hueSlider.refresh()),this.setHsvContainerBg(s[0]),this.enableOpacity&&s[3]!==this.hsv[3]&&(this.opacitySlider.setProperties({value:100*s[3]},!0),this.opacitySlider.refresh(),this.updateOpacitySliderBg()),this.hsv=s,this.setHandlerPosition(),this.updateInput(e),C.select("."+Js+" ."+Ns,this.container).style.backgroundColor=this.convertToRgbString(this.rgb),this.triggerEvent(e,i,this.convertToRgbString(this.rgb),!1,t)},T.prototype.paletteClickHandler=function(t){t.preventDefault();var e,i,s=t.target;s.classList.contains(sn)?(this.removeTileSelection(),this.addTileSelection(s),s.classList.contains(Xs)?this.noColorTile():(e=s.getAttribute("aria-label"),i=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(this.roundValue(e)),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(Qs)&&this.updateInput(e),this.triggerEvent(e,i,this.convertToRgbString(this.rgb),!1,t)),this.inline||this.showButtons||this.closePopup(t)):C.closest(s,"."+_s)?this.switchToPicker():s.classList.contains(ws)||s.classList.contains(As)?this.ctrlBtnClick(s,t):this.getWrapper().classList.contains(Qs)&&C.closest(s,"."+Rs)&&this.formatSwitchHandler()},T.prototype.noColorTile=function(t){void 0===t&&(t=!1);var e=this.rgbToHex(this.rgb);this.rgb=[],this.hsv=[],this.triggerEvent("",e,"",t)},T.prototype.switchToPicker=function(){var t=this.getWrapper(),t=(this.trigger("beforeModeSwitch",{element:this.container,mode:"Picker"}),this.unWireEvents(),[].slice.call(C.selectAll("."+Ys,this.container)).forEach(function(t){C.detach(t)}),this.container.querySelector(".e-clr-pal-rec-wpr")&&C.detach(this.container.querySelector(".e-clr-pal-rec-wpr")),t.classList.contains(Qs)&&C.detach(C.select("."+js,this.container)),this.container.style.width="",C.select(".e-custom-palette",this.container));this.presetColors&&C.remove(t),this.createPicker(),this.getDragHandler().focus(),this.createInput(),this.refreshPopupPos(),this.element.parentElement&&this.element.parentElement.parentElement&&this.element.parentElement.parentElement.classList.contains("e-ie-ddb-popup")&&this.refreshImageEditorPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Picker"})},T.prototype.ctrlBtnClick=function(t,e){var i;t.classList.contains(ws)&&(i=this.rgbToHex(this.rgb),this.triggerChangeEvent(i,e)),this.inline?t.classList.contains(As)&&(i={element:this.container,event:e,cancel:!1},this.trigger("beforeClose",i)):(this.closePopup(e),this.splitBtn.element.focus())},T.prototype.paletteKeyDown=function(t){var e=t.target;if(e.classList.contains(Ys)){var i,s,n=[].slice.call(C.selectAll("."+sn,e)),a=n.filter(function(t){return t.classList.contains("e-selected")}).pop();switch(!t.altKey&&t.keyCode){case 39:t.preventDefault(),i=a?n[this.tilePosition(n,a,this.enableRtl?-1:1)]:n[this.enableRtl?n.length-1:0],this.keySelectionChanges(i);break;case 37:t.preventDefault(),i=a?n[this.tilePosition(n,a,this.enableRtl?1:-1)]:n[this.enableRtl?0:n.length-1],this.keySelectionChanges(i);break;case 38:t.preventDefault(),i=n[s=a?this.tilePosition(n,a,-this.columns):0]||n[s-this.columns],this.keySelectionChanges(i);break;case 40:t.preventDefault(),i=n[s=a?this.tilePosition(n,a,this.columns):n.length-1]||n[s=(s%=n.length)+n[n.length-1].parentElement.childElementCount],this.keySelectionChanges(i);break;case 13:t.preventDefault(),a&&(s=a.getAttribute("aria-label"),this.enterKeyHandler(s||""))}}},T.prototype.keySelectionChanges=function(t){var e;this.removeTileSelection(),this.addTileSelection(t),t.classList.contains(Xs)?this.noColorTile(!0):(t=t.getAttribute("aria-label"),e=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(t),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(Qs)&&this.updateInput(t),this.triggerEvent(t,e,this.convertToRgbString(this.rgb),!0))},T.prototype.tilePosition=function(t,e,i){var s=(t=Array.prototype.slice.call(t)).length,n=this.columns-t[s-1].parentElement.childElementCount,t=t.indexOf(e);return(t+=i)<0?t+=s+n:t%=s+n,t},T.prototype.inputHandler=function(t){var e,i,s=t.target;if(s.value.length)switch(C.select(".e-float-text",s.parentElement).textContent){case"HEX":var n="";if(9!==(n="#"===s.value[0]&&5!==s.value.length||"#"!==s.value[0]&&4!==s.value.length?this.roundValue(s.value):n).length)return;i=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(n+n.substr(-2)),this.inputValueChange(this.rgbToHsv.apply(this,this.rgb),i,s.value,t);break;case"R":this.rgb[0]!==Number(s.value)&&(i=this.rgbToHex(this.rgb),this.rgb[0]=Number(s.value),e=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(e,i,null,t));break;case"G":this.rgb[1]!==Number(s.value)&&(i=this.rgbToHex(this.rgb),this.rgb[1]=Number(s.value),e=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(e,i,null,t));break;case"B":this.rgb[2]!==Number(s.value)&&(i=this.rgbToHex(this.rgb),this.rgb[2]=Number(s.value),e=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(e,i,null,t));break;case"H":this.hueSlider.value=Number(s.value);break;case"S":this.hsv[1]!==Number(s.value)&&(this.hsv[1]=Number(s.value),this.updateHsv(),this.convertToOtherFormat(!1,t));break;case"V":this.hsv[2]!==Number(s.value)&&(this.hsv[2]=Number(s.value),this.updateHsv(),this.convertToOtherFormat(!1,t));break;case"A":this.opacitySlider.value=Number(s.value)}},T.prototype.inputValueChange=function(t,e,i,s){t[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:t[0]},!0),this.hueSlider.refresh(),this.setHsvContainerBg(t[0])),this.hsv=t;t=this.rgbToHex(this.rgb),this.setHandlerPosition(),this.updateInput(i||t),i=this.convertToRgbString(this.rgb);this.updatePreview(i),this.triggerEvent(t,e,i,!1,s)},T.prototype.triggerEvent=function(t,e,i,s,n){void 0===s&&(s=!1);var a=t.slice(0,7);C.isNullOrUndefined(n)&&(n=new MouseEvent("click",{bubbles:!0,cancelable:!1})),this.showButtons||s?this.trigger("select",{currentValue:{hex:a,rgba:i},event:n,previousValue:{hex:e.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(e))}}):(this.trigger("change",{currentValue:{hex:a,rgba:i},event:n,previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:t}),this.showRecentColors&&(this.recentColors.unshift(a),this.inline)&&this.renderRecentColor(),this.enableOpacity?this.setProperties({value:t},!0):this.setProperties({value:a},!0),this.element.value=a||"#000000")},T.prototype.destroy=function(){var e=this,t=this.getWrapper();Ls.prototype.destroy.call(this),["tabindex","spellcheck"].forEach(function(t){e.element.removeAttribute(t)}),this.inline?(this.unWireEvents(),this.destroyOtherComp()):(this.isPopupOpen()&&(this.unWireEvents(),this.destroyOtherComp()),this.splitBtn.destroy(),this.splitBtn=null),this.tileRipple(),this.tileRipple=null,this.ctrlBtnRipple(),this.ctrlBtnRipple=null,this.element.nextElementSibling&&C.detach(this.element.nextElementSibling),t&&(t.parentElement.insertBefore(this.element,t),C.detach(t)),this.container=null,this.formElement&&C.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},T.prototype.destroyOtherComp=function(){if(this.isPicker()){for(var t=C.closest(this.hueSlider.element,".e-color-picker").querySelectorAll(".e-numerictextbox"),e=0;e<t.length;e++)C.getInstance(t[e],Ht).destroy();this.hueSlider.destroy(),this.enableOpacity&&(this.opacitySlider.destroy(),this.opacitySlider=null),this.hueSlider=null;var i=this.getTooltipInst();i.close(),i.destroy(),this.tooltipEle=null}},T.prototype.isPopupOpen=function(){return this.getPopupEle().classList.contains("e-popup-open")},T.prototype.unWireEvents=function(){var t;this.isPicker()?(t=this.getDragHandler(),C.EventHandler.remove(t,"keydown",this.pickerKeyDown),(t=C.select("."+Hs,this.container))&&C.EventHandler.remove(t,"keydown",this.ctrlBtnKeyDown),C.EventHandler.remove(this.getHsvContainer(),"mousedown touchstart",this.handlerDown),(this.modeSwitcher||this.showButtons)&&C.EventHandler.remove(C.select("."+Bs,this.container),"click",this.btnClickHandler),C.EventHandler.remove(C.select("."+$s,this.container),"click",this.previewHandler)):(C.EventHandler.remove(this.container,"click",this.paletteClickHandler),C.EventHandler.remove(this.container,"keydown",this.paletteKeyDown))},T.prototype.roundValue=function(t){if(!t)return"";var e=(t="#"!==t[0]?"#"+t:t).length;if(4===e&&(t+="f",e=5),5===e){for(var i="",s=1,n=t.length;s<n;s++)i+=t.charAt(s)+t.charAt(s);t="#"+i,e=9}return 7===e&&(t+="ff"),t},T.prototype.hexToRgb=function(t){if(!t)return[];9!==(t=t.trim()).length&&(t=this.roundValue(t));var e=Number((parseInt(t.slice(-2),16)/255).toFixed(2)),t=(t=t.slice(1,7),parseInt(t,16)),i=[];return i.push(t>>16&255),i.push(t>>8&255),i.push(255&t),i.push(e),i},T.prototype.rgbToHsv=function(t,e,i,s){if(this.rgb&&!this.rgb.length)return[];t/=255,e/=255,i/=255;var n,a=Math.max(t,e,i),l=Math.min(t,e,i),r=a,o=a-l,h=0===a?0:o/a;if(a===l)n=0;else{switch(a){case t:n=(e-i)/o+(e<i?6:0);break;case e:n=(i-t)/o+2;break;case i:n=(t-e)/o+4}n/=6}l=[Math.round(360*n),Math.round(1e3*h)/10,Math.round(1e3*r)/10];return C.isNullOrUndefined(s)||l.push(s),l},T.prototype.hsvToRgb=function(t,e,i,s){var n,a,l;if(i/=100,0===(e/=100))return n=a=l=i,[Math.round(255*n),Math.round(255*a),Math.round(255*l),s];t/=60;var r=Math.floor(t),t=t-r,o=i*(1-e),h=i*(1-e*t),u=i*(1-e*(1-t));switch(r){case 0:n=i,a=u,l=o;break;case 1:n=h,a=i,l=o;break;case 2:n=o,a=i,l=u;break;case 3:n=o,a=h,l=i;break;case 4:n=u,a=o,l=i;break;default:n=i,a=o,l=h}e=[Math.round(255*n),Math.round(255*a),Math.round(255*l)];return C.isNullOrUndefined(s)||e.push(s),e},T.prototype.rgbToHex=function(t){return t.length?"#"+this.hex(t[0])+this.hex(t[1])+this.hex(t[2])+(C.isNullOrUndefined(t[3])?"":0!==t[3]?(Math.round(255*t[3])+65536).toString(16).substr(-2):"00"):""},T.prototype.hex=function(t){return("0"+t.toString(16)).slice(-2)},T.prototype.changeModeSwitcherProp=function(t){var e=C.select("."+Bs,this.container);t?e?this.appendModeSwitchBtn():(this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):e&&(this.showButtons?C.detach(C.select("."+_s,e)):C.remove(e))},T.prototype.changeShowBtnProps=function(t){var e=C.select("."+Bs,this.container);t?(e&&C.remove(e),this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):this.modeSwitcher?C.detach(C.select("."+Hs,e)):C.remove(e)},T.prototype.changeValueProp=function(t){this.isPicker()?(this.rgb=this.hexToRgb(t),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHandlerPosition(),C.detach(C.closest(this.hueSlider.element,".e-slider-preview")),this.createSlider(),this.setHsvContainerBg(),this.updateInput(t),4===this.rgb.length&&this.updateOpacityInput(100*this.rgb[3])):(this.removeTileSelection(),(t=this.container.querySelector('span[aria-label="'+this.roundValue(t)+'"]'))&&this.addTileSelection(t))},T.prototype.setInputEleProps=function(){C.remove(C.select("."+js,this.container)),this.createInput()},T.prototype.changeDisabledProp=function(t){this.isPicker()&&(this.hueSlider.enabled=!t,this.opacitySlider.enabled=!t,this.setInputEleProps()),t?(this.toggleDisabled(!0),this.unWireEvents()):(this.toggleDisabled(!1),this.wireEvents())},T.prototype.changeCssClassProps=function(t,e){var i=this.getWrapper(),s=this.getPopupEle();e&&C.removeClass([i,s],e.split(" ")),t&&C.addClass([i,s],t.replace(/\s+/g," ").trim().split(" "))},T.prototype.changeRtlProps=function(t){t?C.addClass([this.getWrapper()],"e-rtl"):C.removeClass([this.getWrapper()],"e-rtl")},T.prototype.changePaletteProps=function(){C.detach(this.container.children[0]),this.container.style.width="",this.createPalette()},T.prototype.changeOpacityProps=function(t){var e=this.getWrapper();t?(C.removeClass([this.container.parentElement],Fs),this.createOpacitySlider(C.select(".e-colorpicker-slider",this.container).appendChild(this.createElement("div",{className:"e-opacity-slider"}))),e.classList.contains(Ds)||e.classList.contains(Ms)||this.appendOpacityValue(C.select(".e-input-container",this.container))):(C.addClass([this.container.parentElement],Fs),this.opacitySlider.destroy(),C.remove(this.opacitySlider.element),this.opacitySlider=null,e.classList.contains(Ds)||e.classList.contains(Ms)||C.remove(C.select("."+Ks,this.container).parentElement))},T.prototype.onPropertyChanged=function(s,n){var t,e,a=this;if(C.isNullOrUndefined(s.value)||(9===(t=this.roundValue(s.value)).length?(this.element.value=this.roundValue(t).slice(0,7),(e=this.splitBtn&&C.select("."+en,this.splitBtn.element))&&(e.style.backgroundColor=this.convertToRgbString(this.hexToRgb(s.value)))):this.noColor&&"Palette"===this.mode&&""===this.value?(e=this.splitBtn&&C.select("."+en,this.splitBtn.element)).style.backgroundColor="":this.value=n.value),!this.inline&&C.isNullOrUndefined(s.inline))if(this.splitBtn.setProperties(I.getModel(s,["disabled","enableRtl"])),!this.isPopupOpen())return this.changeCssClassProps(s.cssClass,n.cssClass),void this.changeRtlProps(s.enableRtl);for(var l=this,i=0,r=Object.keys(s);i<r.length;i++)!function(t){switch(t){case"inline":s.inline?(l.getWrapper().appendChild(l.container),l.splitBtn.destroy(),C.detach(l.element.nextElementSibling),l.container.children.length||l.createWidget()):(l.destroyOtherComp(),l.unWireEvents(),l.container.innerHTML="",l.createSplitBtn());break;case"cssClass":l.changeCssClassProps(s.cssClass,n.cssClass);var e=(e=s.cssClass.split(" ").concat(n.cssClass.split(" "))).reduce(function(t,e){return t.indexOf(e)<0&&t.push(e),t},[]),i=0;e.forEach(function(t){0!==i||t!==Ds&&t!==zs&&t!==Qs&&t!==Vs&&t!==Ms||(C.select("."+js,a.container)&&C.remove(C.select("."+js,a.container)),a.createInput(),i++)});break;case"enableRtl":l.isPicker()&&(l.hueSlider.enableRtl=s.enableRtl,l.enableOpacity&&(l.opacitySlider.enableRtl=s.enableRtl),l.setInputEleProps()),l.changeRtlProps(s.enableRtl);break;case"disabled":l.changeDisabledProp(s.disabled);break;case"value":l.value!==n.value&&l.changeValueProp(s.value);break;case"showButtons":l.changeShowBtnProps(s.showButtons);break;case"mode":"Picker"===s.mode?l.switchToPicker():l.switchToPalette();break;case"modeSwitcher":l.changeModeSwitcherProp(s.modeSwitcher);break;case"columns":case"presetColors":l.isPicker()||l.changePaletteProps();break;case"noColor":s.noColor?"Palette"!==l.mode||l.modeSwitcher||l.setNoColor():l.changePaletteProps();break;case"enableOpacity":l.changeOpacityProps(s.enableOpacity);break;case"showRecentColors":s.showRecentColors||(e=l.container.querySelector(".e-clr-pal-rec-wpr"))&&C.detach(e),l.recentColors=[]}}(r[i])},T.prototype.focusIn=function(){this.element.parentElement.focus()},S([C.Property("#008000ff")],T.prototype,"value",void 0),S([C.Property("")],T.prototype,"cssClass",void 0),S([C.Property(!1)],T.prototype,"disabled",void 0),S([C.Property("Picker")],T.prototype,"mode",void 0),S([C.Property(!0)],T.prototype,"modeSwitcher",void 0),S([C.Property(null)],T.prototype,"presetColors",void 0),S([C.Property(!0)],T.prototype,"showButtons",void 0),S([C.Property(10)],T.prototype,"columns",void 0),S([C.Property(!1)],T.prototype,"inline",void 0),S([C.Property(!1)],T.prototype,"noColor",void 0),S([C.Property(!1)],T.prototype,"enablePersistence",void 0),S([C.Property(!0)],T.prototype,"enableOpacity",void 0),S([C.Property(!1)],T.prototype,"createPopupOnClick",void 0),S([C.Property(!1)],T.prototype,"showRecentColors",void 0),S([C.Event()],T.prototype,"select",void 0),S([C.Event()],T.prototype,"change",void 0),S([C.Event()],T.prototype,"beforeTileRender",void 0),S([C.Event()],T.prototype,"beforeOpen",void 0),S([C.Event()],T.prototype,"open",void 0),S([C.Event()],T.prototype,"beforeClose",void 0),S([C.Event()],T.prototype,"beforeModeSwitch",void 0),S([C.Event()],T.prototype,"onModeSwitch",void 0),S([C.Event()],T.prototype,"created",void 0),S([C.NotifyPropertyChanges],T));function T(t,e){t=Ls.call(this,t,e)||this;return t.recentColors=[],t}an=function(t,e){return(an=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var an,ln,S=function(t,e){function i(){this.constructor=t}an(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},P=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},S=(ln=C.Component,S(k,ln),k.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"floatLabelType":o.Input.removeFloating(this.textboxWrapper),o.Input.addFloating(this.respectiveElement,this.floatLabelType,this.placeholder);break;case"enabled":o.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container),this.bindClearEvent();break;case"width":o.Input.setWidth(t.width,this.textboxWrapper.container);break;case"value":var n=this.isProtectedOnChange;this.isProtectedOnChange=!0,o.Input.isBlank(this.value)||(this.value=this.value.toString()),this.isProtectedOnChange=n,o.Input.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.inputPreviousValue=this.respectiveElement.value,(this.isAngular||this.isVue)&&!0===this.preventChange?(this.previousValue=this.isAngular?this.value:this.previousValue,this.preventChange=!1):(C.isNullOrUndefined(this.isAngular)||!this.isAngular||this.isAngular&&!this.preventChange||this.isAngular&&C.isNullOrUndefined(this.preventChange))&&this.raiseChangeEvent();break;case"htmlAttributes":this.updateHTMLAttributesToElement(),this.updateHTMLAttributesToWrapper(),this.checkAttributes(!0),this.multiline&&!C.isNullOrUndefined(this.textarea)?o.Input.validateInputType(this.textboxWrapper.container,this.textarea):o.Input.validateInputType(this.textboxWrapper.container,this.element);break;case"readonly":o.Input.setReadonly(this.readonly,this.respectiveElement);break;case"type":"TEXTAREA"!==this.respectiveElement.tagName&&(this.respectiveElement.setAttribute("type",this.type),o.Input.validateInputType(this.textboxWrapper.container,this.element),this.raiseChangeEvent());break;case"showClearButton":o.Input.setClearButton(this.showClearButton,this.respectiveElement,this.textboxWrapper),this.bindClearEvent();break;case"enableRtl":o.Input.setEnableRtl(this.enableRtl,[this.textboxWrapper.container]);break;case"placeholder":o.Input.setPlaceholder(this.placeholder,this.respectiveElement),o.Input.calculateWidth(this.respectiveElement,this.textboxWrapper.container);break;case"autocomplete":"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:this.removeAttributes(["autocomplete"]);break;case"cssClass":o.Input.updateCssClass(t.cssClass,e.cssClass,this.textboxWrapper.container);break;case"locale":this.globalize=new C.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),o.Input.setPlaceholder(this.placeholder,this.respectiveElement)}},k.prototype.getModuleName=function(){return"textbox"},k.prototype.preRender=function(){if(this.cloneElement=this.element.cloneNode(!0),this.formElement=C.closest(this.element,"form"),C.isNullOrUndefined(this.formElement)||(this.isForm=!0),"EJS-TEXTBOX"===this.element.tagName){for(var t=C.getValue("ej2_instances",this.element),e=this.multiline?this.createElement("textarea"):this.createElement("input"),i=0;i<this.element.attributes.length;i++)"id"!==(n=this.element.attributes[i].nodeName)&&"class"!==n?(e.setAttribute(n,this.element.attributes[i].nodeValue),e.innerHTML=this.element.innerHTML,"name"===n&&this.element.removeAttribute("name")):"class"===n&&e.setAttribute(n,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "));this.element.appendChild(e),this.element=e,C.setValue("ej2_instances",t,this.element)}this.updateHTMLAttributesToElement(),this.checkAttributes(!1),!C.isNullOrUndefined(this.textboxOptions)&&void 0!==this.textboxOptions.value||""===this.element.value||this.setProperties({value:this.element.value},!0),"TEXTAREA"!==this.element.tagName&&this.element.setAttribute("type",this.type),("text"===this.type||"INPUT"===this.element.tagName&&this.multiline&&this.isReact)&&this.element.setAttribute("role","textbox"),this.globalize=new C.Internationalization(this.locale);t={placeholder:this.placeholder};if(this.l10n=new C.L10n("textbox",t,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",C.getUniqueID("textbox")),this.element.hasAttribute("name")||this.element.setAttribute("name",this.element.getAttribute("id")),"INPUT"===this.element.tagName&&this.multiline){this.isHiddenInput=!0,this.textarea=this.createElement("textarea"),this.element.parentNode.insertBefore(this.textarea,this.element),this.element.setAttribute("type","hidden"),this.textarea.setAttribute("name",this.element.getAttribute("name")),this.element.removeAttribute("name"),this.textarea.setAttribute("role",this.element.getAttribute("role")),this.element.removeAttribute("role"),this.textarea.setAttribute("id",C.getUniqueID("textarea"));for(var s=["placeholder","disabled","value","readonly","type","autocomplete"],i=0;i<this.element.attributes.length;i++){var n=this.element.attributes[i].nodeName;this.element.hasAttribute(n)&&F.indexOf(n)<0&&"id"!==n&&"type"!==n&&"e-mappinguid"!==n&&(this.textarea.setAttribute(n,this.element.attributes[i].nodeValue),s.indexOf(n)<0)&&(this.element.removeAttribute(n),i--)}}},k.prototype.checkAttributes=function(t){for(var e=0,i=t?C.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly","type","autocomplete"];e<i.length;e++){var s,n,a=i[e];if(!C.isNullOrUndefined(this.element.getAttribute(a)))switch(a){case"disabled":(C.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(a)&&""!==this.element.getAttribute(a)&&"true"!==this.element.getAttribute(a),this.setProperties({enabled:s},!t));break;case"readonly":(C.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.readonly||t)&&(s="readonly"===this.element.getAttribute(a)||""===this.element.getAttribute(a)||"true"===this.element.getAttribute(a),this.setProperties({readonly:s},!t));break;case"placeholder":(C.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"autocomplete":(C.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||t)&&(n="off"===this.element.autocomplete?"off":"on",this.setProperties({autocomplete:n},!t));break;case"value":(C.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.value||t)&&""!==this.element.value&&this.setProperties({value:this.element.value},!t);break;case"type":(C.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.type||t)&&this.setProperties({type:this.element.type},!t)}}},k.prototype.render=function(){var t=this.cssClass;C.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=o.Input.getInputValidClassList(this.cssClass)),this.respectiveElement=this.isHiddenInput?this.textarea:this.element,this.textboxWrapper=o.Input.createInput({element:this.respectiveElement,floatLabelType:this.floatLabelType,properties:{enabled:this.enabled,enableRtl:this.enableRtl,cssClass:t,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}}),this.updateHTMLAttributesToWrapper(),this.isHiddenInput&&this.respectiveElement.parentNode.insertBefore(this.element,this.respectiveElement),this.wireEvents(),C.isNullOrUndefined(this.value)||(o.Input.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value)),C.isNullOrUndefined(this.value)||(this.initialValue=this.value,this.setInitialValue()),"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:C.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||this.removeAttributes(["autocomplete"]),this.previousValue=this.value,this.inputPreviousValue=this.value,this.respectiveElement.defaultValue=this.respectiveElement.value,o.Input.setWidth(this.width,this.textboxWrapper.container),!C.isNullOrUndefined(C.closest(this.element,"fieldset"))&&C.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","textbox"),this.renderComplete()},k.prototype.updateHTMLAttributesToWrapper=function(){o.Input.updateHTMLAttributesToWrapper(this.htmlAttributes,this.textboxWrapper.container)},k.prototype.updateHTMLAttributesToElement=function(){o.Input.updateHTMLAttributesToElement(this.htmlAttributes,this.respectiveElement||(this.multiline&&!C.isNullOrUndefined(this.textarea)?this.textarea:this.element))},k.prototype.setInitialValue=function(){this.isAngular||this.respectiveElement.setAttribute("value",this.initialValue)},k.prototype.wireEvents=function(){C.EventHandler.add(this.respectiveElement,"focus",this.focusHandler,this),C.EventHandler.add(this.respectiveElement,"blur",this.focusOutHandler,this),C.EventHandler.add(this.respectiveElement,"keydown",this.keydownHandler,this),C.EventHandler.add(this.respectiveElement,"input",this.inputHandler,this),C.EventHandler.add(this.respectiveElement,"change",this.changeHandler,this),this.isForm&&C.EventHandler.add(this.formElement,"reset",this.resetForm,this),this.bindClearEvent(),!C.isNullOrUndefined(this.textboxWrapper.container.querySelector(".e-float-text"))&&"Auto"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-autofill")&&this.textboxWrapper.container.classList.contains("e-outline")&&C.EventHandler.add(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler,this)},k.prototype.animationHandler=function(){this.textboxWrapper.container.classList.add("e-valid-input");var t=this.textboxWrapper.container.querySelector(".e-float-text");C.isNullOrUndefined(t)||(t.classList.add("e-label-top"),t.classList.contains("e-label-bottom")&&t.classList.remove("e-label-bottom"))},k.prototype.resetValue=function(t){var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,null!=(this.value=t)||!this.textboxWrapper.container.classList.contains("e-valid-input")||"Always"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.remove("e-valid-input"),this.isProtectedOnChange=e},k.prototype.resetForm=function(){var t;this.isAngular?this.resetValue(""):this.resetValue(this.initialValue),C.isNullOrUndefined(this.textboxWrapper)||(t=this.textboxWrapper.container.querySelector(".e-float-text"),C.isNullOrUndefined(t))||"Always"===this.floatLabelType||(C.isNullOrUndefined(this.initialValue)||""===this.initialValue?(t.classList.add("e-label-bottom"),t.classList.remove("e-label-top")):""!==this.initialValue&&(t.classList.add("e-label-top"),t.classList.remove("e-label-bottom")))},k.prototype.focusHandler=function(t){t={container:this.textboxWrapper.container,event:t,value:this.value};this.trigger("focus",t)},k.prototype.focusOutHandler=function(t){null===this.previousValue&&null===this.value&&""===this.respectiveElement.value||this.previousValue===this.value||this.raiseChangeEvent(t,!0);t={container:this.textboxWrapper.container,event:t,value:this.value};this.trigger("blur",t)},k.prototype.keydownHandler=function(t){13!==t.keyCode&&9!==t.keyCode||!(null!==this.previousValue&&""!==this.previousValue||null!==this.value&&""!==this.value||""!==this.respectiveElement.value)||this.setProperties({value:this.respectiveElement.value},!0)},k.prototype.inputHandler=function(t){var e={event:t,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};this.inputPreviousValue=this.respectiveElement.value,this.isAngular&&(this.localChange({value:this.respectiveElement.value}),this.preventChange=!0),this.isVue&&(this.preventChange=!0),this.trigger("input",e),t.stopPropagation()},k.prototype.changeHandler=function(t){this.setProperties({value:this.respectiveElement.value},!0),this.previousValue!==this.value&&this.raiseChangeEvent(t,!0),t.stopPropagation()},k.prototype.raiseChangeEvent=function(t,e){t={event:t,value:this.value,previousValue:this.previousValue,container:this.textboxWrapper.container,isInteraction:e||!1,isInteracted:e||!1};this.preventChange=!1,this.trigger("change",t),this.previousValue=this.value,"INPUT"===this.element.tagName&&this.multiline&&"mozilla"===C.Browser.info.name&&(this.element.value=this.respectiveElement.value)},k.prototype.bindClearEvent=function(){this.showClearButton&&(this.enabled?C.EventHandler.add(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler,this):C.EventHandler.remove(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler))},k.prototype.resetInputHandler=function(t){var e;t.preventDefault(),this.textboxWrapper.clearButton.classList.contains("e-clear-icon-hide")&&!this.textboxWrapper.container.classList.contains("e-static-clear")||(o.Input.setValue("",this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.setProperties({value:this.respectiveElement.value},!0),e={event:t,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container},this.trigger("input",e),this.inputPreviousValue=this.respectiveElement.value,this.raiseChangeEvent(t,!0),C.closest(this.element,"form")&&(e=this.element,(t=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(t)))},k.prototype.unWireEvents=function(){C.EventHandler.remove(this.respectiveElement,"focus",this.focusHandler),C.EventHandler.remove(this.respectiveElement,"blur",this.focusOutHandler),C.EventHandler.remove(this.respectiveElement,"keydown",this.keydownHandler),C.EventHandler.remove(this.respectiveElement,"input",this.inputHandler),C.EventHandler.remove(this.respectiveElement,"change",this.changeHandler),this.isForm&&C.EventHandler.remove(this.formElement,"reset",this.resetForm),!C.isNullOrUndefined(this.textboxWrapper.container.querySelector(".e-float-text"))&&"Auto"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-outline")&&this.textboxWrapper.container.classList.contains("e-autofill")&&C.EventHandler.remove(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler)},k.prototype.destroy=function(){this.unWireEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),"INPUT"===this.element.tagName&&this.multiline&&(C.detach(this.textboxWrapper.container.getElementsByTagName("textarea")[0]),this.respectiveElement=this.element,this.element.removeAttribute("type")),this.respectiveElement.value=this.respectiveElement.defaultValue,this.respectiveElement.classList.remove("e-input"),this.removeAttributes(["aria-disabled","aria-readonly","aria-labelledby"]),C.isNullOrUndefined(this.textboxWrapper)||(this.textboxWrapper.container.insertAdjacentElement("afterend",this.respectiveElement),C.detach(this.textboxWrapper.container)),this.textboxWrapper=null,o.Input.destroy({element:this.respectiveElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),ln.prototype.destroy.call(this)},k.prototype.addIcon=function(t,e){o.Input.addIcon(t,e,this.textboxWrapper.container,this.respectiveElement,this.createElement)},k.prototype.getPersistData=function(){return this.addOnPersist(["value"])},k.prototype.addAttributes=function(t){for(var e=0,i=Object.keys(t);e<i.length;e++){var s=i[e];"disabled"===s?(this.setProperties({enabled:!1},!0),o.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===s?(this.setProperties({readonly:!0},!0),o.Input.setReadonly(this.readonly,this.respectiveElement)):"class"===s?this.respectiveElement.classList.add(t[""+s]):"placeholder"===s?(this.setProperties({placeholder:t[""+s]},!0),o.Input.setPlaceholder(this.placeholder,this.respectiveElement)):("rows"===s&&this.respectiveElement.tagName,this.respectiveElement.setAttribute(s,t[""+s]))}},k.prototype.removeAttributes=function(t){for(var e=0,i=t;e<i.length;e++){var s=i[e];"disabled"===s?(this.setProperties({enabled:!0},!0),o.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===s?(this.setProperties({readonly:!1},!0),o.Input.setReadonly(this.readonly,this.respectiveElement)):"placeholder"===s?(this.setProperties({placeholder:null},!0),o.Input.setPlaceholder(this.placeholder,this.respectiveElement)):this.respectiveElement.removeAttribute(s)}},k.prototype.focusIn=function(){document.activeElement!==this.respectiveElement&&this.enabled&&(this.respectiveElement.focus(),this.textboxWrapper.container.classList.contains("e-input-group")||this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.contains("e-filled"))&&C.addClass([this.textboxWrapper.container],[M])},k.prototype.focusOut=function(){document.activeElement===this.respectiveElement&&this.enabled&&(this.respectiveElement.blur(),this.textboxWrapper.container.classList.contains("e-input-group")||this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.contains("e-filled"))&&C.removeClass([this.textboxWrapper.container],[M])},P([C.Property("text")],k.prototype,"type",void 0),P([C.Property(!1)],k.prototype,"readonly",void 0),P([C.Property(null)],k.prototype,"value",void 0),P([C.Property("Never")],k.prototype,"floatLabelType",void 0),P([C.Property("")],k.prototype,"cssClass",void 0),P([C.Property(null)],k.prototype,"placeholder",void 0),P([C.Property("on")],k.prototype,"autocomplete",void 0),P([C.Property({})],k.prototype,"htmlAttributes",void 0),P([C.Property(!1)],k.prototype,"multiline",void 0),P([C.Property(!0)],k.prototype,"enabled",void 0),P([C.Property(!1)],k.prototype,"showClearButton",void 0),P([C.Property(!1)],k.prototype,"enablePersistence",void 0),P([C.Property(null)],k.prototype,"width",void 0),P([C.Event()],k.prototype,"created",void 0),P([C.Event()],k.prototype,"destroyed",void 0),P([C.Event()],k.prototype,"change",void 0),P([C.Event()],k.prototype,"blur",void 0),P([C.Event()],k.prototype,"focus",void 0),P([C.Event()],k.prototype,"input",void 0),P([C.NotifyPropertyChanges],k));function k(t,e){e=ln.call(this,t,e)||this;return e.previousValue=null,e.isHiddenInput=!1,e.isForm=!1,e.inputPreviousValue=null,e.textboxOptions=t,e}rn=function(t,e){return(rn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var rn,on,P=function(t,e){function i(){this.constructor=t}rn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},O=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},hn="e-auto-width",un="e-resize-x",pn="e-resize-y",dn="e-resize-xy",cn="e-resize-none",P=(on=C.Component,P(L,on),L.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"floatLabelType":o.Input.removeFloating(this.textareaWrapper),o.Input.addFloating(this.element,this.floatLabelType,this.placeholder),"Never"===this.floatLabelType&&this.element.removeAttribute("aria-labelledby");break;case"enabled":o.Input.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container),this.bindClearEvent(),this.enabled||"None"===this.resizeMode?this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)):(this.element.classList.remove(this.getCurrentResizeClass(this.resizeMode)),this.element.classList.add(cn));break;case"width":"None"!==this.resizeMode&&"Vertical"!==this.resizeMode?(this.setElementWidth(t.width),this.textareaWrapper.container.classList.add(hn)):(this.textareaWrapper.container.classList.contains(hn)&&this.textareaWrapper.container.classList.remove(hn),o.Input.setWidth(t.width,this.textareaWrapper.container));break;case"value":var n=this.isProtectedOnChange;this.isProtectedOnChange=!0,o.Input.isBlank(this.value)||(this.value=this.value.toString()),this.isProtectedOnChange=n,o.Input.setValue(this.value,this.element,this.floatLabelType,this.showClearButton),this.inputPreviousValue=this.element.value,(this.isAngular||this.isVue)&&!0===this.preventChange?(this.previousValue=this.isAngular?this.value:this.previousValue,this.preventChange=!1):(C.isNullOrUndefined(this.isAngular)||!this.isAngular||this.isAngular&&!this.preventChange||this.isAngular&&C.isNullOrUndefined(this.preventChange))&&this.raiseChangeEvent();break;case"htmlAttributes":this.updateHTMLAttributesToElement(),this.updateHTMLAttributesToWrapper(),this.checkAttributes(!0),o.Input.validateInputType(this.textareaWrapper.container,this.element);break;case"readonly":o.Input.setReadonly(this.readonly,this.element),this.readonly?this.element.setAttribute("aria-readonly","true"):this.element.removeAttribute("aria-readonly");break;case"showClearButton":o.Input.setClearButton(this.showClearButton,this.element,this.textareaWrapper),this.bindClearEvent();break;case"enableRtl":o.Input.setEnableRtl(this.enableRtl,[this.textareaWrapper.container]);break;case"placeholder":o.Input.setPlaceholder(this.placeholder,this.element),o.Input.calculateWidth(this.element,this.textareaWrapper.container);break;case"cssClass":o.Input.updateCssClass(t.cssClass,e.cssClass,this.textareaWrapper.container);break;case"locale":this.globalize=new C.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),o.Input.setPlaceholder(this.placeholder,this.element);break;case"rows":this.rows&&this.element.setAttribute("rows",this.rows.toString());break;case"cols":this.cols&&(this.element.setAttribute("cols",this.cols.toString()),null==this.width)&&this.textareaWrapper.container.classList.add(hn);break;case"maxLength":this.maxLength&&this.element.setAttribute("maxlength",this.maxLength.toString());break;case"resizeMode":this.enabled&&(this.element.classList.contains(this.getCurrentResizeClass(e.resizeMode))&&this.element.classList.remove(this.getCurrentResizeClass(e.resizeMode)),this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)),!this.element.style.width||"None"!==this.resizeMode&&"Vertical"!==this.resizeMode?(n=this.element.offsetWidth,this.element.style.width=n+"px",this.textareaWrapper.container.style.width&&(this.textareaWrapper.container.style.width="")):o.Input.setWidth(this.element.style.width,this.textareaWrapper.container),this.setWrapperWidth())}},L.prototype.preRender=function(){if(this.formElement=C.closest(this.element,"form"),C.isNullOrUndefined(this.formElement)||(this.isForm=!0),"EJS-TEXTAREA"===this.element.tagName||"EJS-SMARTTEXTAREA"===this.element.tagName){for(var t=C.getValue("ej2_instances",this.element),e=this.createElement("textarea"),i=0;i<this.element.attributes.length;i++){var s=this.element.attributes[i].nodeName;"id"!==s&&"class"!==s?(e.setAttribute(s,this.element.attributes[i].nodeValue),e.innerHTML=this.element.innerHTML,"name"===s&&this.element.removeAttribute("name")):"class"===s&&e.setAttribute(s,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "))}this.element.appendChild(e),this.element=e,C.setValue("ej2_instances",t,this.element)}this.updateHTMLAttributesToElement(),this.checkAttributes(!1),!C.isNullOrUndefined(this.textareaOptions)&&void 0!==this.textareaOptions.value||""===this.element.value||this.setProperties({value:this.element.value},!0),this.globalize=new C.Internationalization(this.locale);t={placeholder:this.placeholder};this.l10n=new C.L10n("textarea",t,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",C.getUniqueID("textbox")),this.element.hasAttribute("name")||this.element.setAttribute("name",this.element.getAttribute("id")),this.rows&&this.element.setAttribute("rows",this.rows.toString()),this.cols&&this.element.setAttribute("cols",this.cols.toString()),this.maxLength&&this.element.setAttribute("maxlength",this.maxLength.toString()),!this.element.style.resize&&this.enabled&&this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)),this.enabled&&this.element.setAttribute("aria-multiline","true")},L.prototype.render=function(){var t=this.cssClass;C.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=o.Input.getInputValidClassList(this.cssClass)),this.textareaWrapper=o.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{enabled:this.enabled,enableRtl:this.enableRtl,cssClass:t,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}}),this.updateHTMLAttributesToWrapper(),this.wireEvents(),C.isNullOrUndefined(this.value)||o.Input.setValue(this.value,this.element,this.floatLabelType,this.showClearButton),C.isNullOrUndefined(this.value)||(this.initialValue=this.value,this.isAngular)||this.element.setAttribute("value",this.initialValue),this.previousValue=this.value,this.inputPreviousValue=this.value,this.element.defaultValue=this.element.value,o.Input.setWidth(this.width,this.textareaWrapper.container),this.setWrapperWidth(),this.renderComplete()},L.prototype.getModuleName=function(){return"textarea"},L.prototype.getPersistData=function(){return this.addOnPersist(["value"])},L.prototype.checkAttributes=function(t){for(var e=0,i=t?C.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"];e<i.length;e++){var s,n=i[e];if(!C.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"disabled":(C.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n),this.setProperties({enabled:s},!t));break;case"readonly":(C.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.readonly||t)&&(s="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n),this.setProperties({readonly:s},!t));break;case"placeholder":(C.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"value":(C.isNullOrUndefined(this.textareaOptions)||void 0===this.textareaOptions.value||t)&&""!==this.element.value&&this.setProperties({value:this.element.value},!t)}}},L.prototype.wireEvents=function(){C.EventHandler.add(this.element,"focus",this.focusHandler,this),C.EventHandler.add(this.element,"blur",this.focusOutHandler,this),C.EventHandler.add(this.element,"keydown",this.keydownHandler,this),C.EventHandler.add(this.element,"input",this.inputHandler,this),C.EventHandler.add(this.element,"change",this.changeHandler,this),this.isForm&&C.EventHandler.add(this.formElement,"reset",this.resetForm,this),this.bindClearEvent()},L.prototype.unWireEvents=function(){C.EventHandler.remove(this.element,"focus",this.focusHandler),C.EventHandler.remove(this.element,"blur",this.focusOutHandler),C.EventHandler.remove(this.element,"keydown",this.keydownHandler),C.EventHandler.remove(this.element,"input",this.inputHandler),C.EventHandler.remove(this.element,"change",this.changeHandler),this.isForm&&C.EventHandler.remove(this.formElement,"reset",this.resetForm)},L.prototype.destroy=function(){this.unWireEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.element.value=this.element.defaultValue,this.element.classList.remove("e-input",un,pn,dn,cn),this.removeAttributes(["aria-disabled","aria-readonly","aria-labelledby","aria-multiline"]),C.isNullOrUndefined(this.textareaWrapper)||(this.textareaWrapper.container.insertAdjacentElement("afterend",this.element),C.detach(this.textareaWrapper.container)),this.textareaWrapper=null,o.Input.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),this.formElement=null,on.prototype.destroy.call(this)},L.prototype.focusHandler=function(t){t={container:this.textareaWrapper.container,event:t,value:this.value};this.trigger("focus",t)},L.prototype.focusOutHandler=function(t){null===this.previousValue&&null===this.value||this.previousValue===this.value||this.raiseChangeEvent(t,!0);t={container:this.textareaWrapper.container,event:t,value:this.value};this.trigger("blur",t)},L.prototype.keydownHandler=function(t){13!==t.keyCode&&9!==t.keyCode||!(null!==this.previousValue&&""!==this.previousValue||null!==this.value&&""!==this.value||""!==this.element.value)||this.setProperties({value:this.element.value},!0)},L.prototype.inputHandler=function(t){var e={event:t,value:this.element.value,previousValue:this.inputPreviousValue,container:this.textareaWrapper.container};this.inputPreviousValue=this.element.value,this.isAngular&&(this.localChange({value:this.element.value}),this.preventChange=!0),this.isVue&&(this.preventChange=!0),this.trigger("input",e),t.stopPropagation()},L.prototype.changeHandler=function(t){this.setProperties({value:this.element.value},!0),this.previousValue!==this.value&&this.raiseChangeEvent(t,!0),t.stopPropagation()},L.prototype.raiseChangeEvent=function(t,e){t={event:t,value:this.value,previousValue:this.previousValue,container:this.textareaWrapper.container,isInteraction:e||!1,isInteracted:e||!1};this.preventChange=!1,this.trigger("change",t),this.previousValue=this.value},L.prototype.updateHTMLAttributesToWrapper=function(){o.Input.updateHTMLAttributesToWrapper(this.htmlAttributes,this.textareaWrapper.container)},L.prototype.updateHTMLAttributesToElement=function(){o.Input.updateHTMLAttributesToElement(this.htmlAttributes,this.element)},L.prototype.bindClearEvent=function(){this.showClearButton&&(this.enabled?C.EventHandler.add(this.textareaWrapper.clearButton,"mousedown touchstart",this.resetInputHandler,this):C.EventHandler.remove(this.textareaWrapper.clearButton,"mousedown touchstart",this.resetInputHandler))},L.prototype.resetInputHandler=function(t){t.preventDefault(),this.textareaWrapper.clearButton.classList.contains("e-clear-icon-hide")&&!this.textareaWrapper.container.classList.contains("e-static-clear")||(o.Input.setValue("",this.element,this.floatLabelType,this.showClearButton),this.setProperties({value:this.element.value},!0));var e={event:t,value:this.element.value,previousValue:this.inputPreviousValue,container:this.textareaWrapper.container};this.trigger("input",e),this.inputPreviousValue=this.element.value,this.raiseChangeEvent(t,!0),C.closest(this.element,"form")&&(e=this.element,(t=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(t))},L.prototype.addAttributes=function(t){for(var e=0,i=Object.keys(t);e<i.length;e++){var s=i[e];"disabled"===s?(this.setProperties({enabled:!1},!0),o.Input.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container)):"readonly"===s?(this.setProperties({readonly:!0},!0),o.Input.setReadonly(this.readonly,this.element)):"class"===s?this.element.classList.add(t[""+s]):"placeholder"===s?(this.setProperties({placeholder:t[""+s]},!0),o.Input.setPlaceholder(this.placeholder,this.element)):this.element.setAttribute(s,t[""+s])}},L.prototype.removeAttributes=function(t){for(var e=0,i=t;e<i.length;e++){var s=i[e];"disabled"===s?(this.setProperties({enabled:!0},!0),o.Input.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container)):"readonly"===s?(this.setProperties({readonly:!1},!0),o.Input.setReadonly(this.readonly,this.element)):"placeholder"===s?(this.setProperties({placeholder:null},!0),o.Input.setPlaceholder(this.placeholder,this.element)):this.element.removeAttribute(s)}},L.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),this.textareaWrapper.container.classList.contains("e-input-group")||this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.contains("e-filled"))&&C.addClass([this.textareaWrapper.container],[M])},L.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),this.textareaWrapper.container.classList.contains("e-input-group")||this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.contains("e-filled"))&&C.removeClass([this.textareaWrapper.container],[M])},L.prototype.setWrapperWidth=function(){this.enabled&&("None"!==this.resizeMode&&"Vertical"!==this.resizeMode||this.cols||this.element.getAttribute("cols"))?("None"!==this.resizeMode&&"Vertical"!==this.resizeMode&&this.textareaWrapper.container.style.width&&(this.setElementWidth(this.textareaWrapper.container.style.width),this.textareaWrapper.container.style.width="",this.textareaWrapper.container.classList.add(hn)),this.textareaWrapper.container.classList.add(hn)):this.textareaWrapper.container.classList.contains(hn)&&this.textareaWrapper.container.classList.remove(hn)},L.prototype.resetForm=function(){var t;this.isAngular?this.resetValue(""):this.resetValue(this.initialValue),C.isNullOrUndefined(this.textareaWrapper)||(t=this.textareaWrapper.container.querySelector(".e-float-text"),C.isNullOrUndefined(t))||"Always"===this.floatLabelType||(C.isNullOrUndefined(this.initialValue)||""===this.initialValue?(t.classList.add("e-label-bottom"),t.classList.remove("e-label-top")):""!==this.initialValue&&(t.classList.add("e-label-top"),t.classList.remove("e-label-bottom")))},L.prototype.resetValue=function(t){var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,null!=(this.value=t)||!this.textareaWrapper.container.classList.contains("e-valid-input")||"Always"===this.floatLabelType&&this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.remove("e-valid-input"),this.isProtectedOnChange=e},L.prototype.setElementWidth=function(t){"number"==typeof t?this.element.style.width=C.formatUnit(t):"string"==typeof t&&(this.element.style.width=t.match(/px|%|em/)?t:C.formatUnit(t))},O([C.Property(!(L.prototype.getCurrentResizeClass=function(t){return"None"===t?cn:"Both"===t?dn:"Horizontal"===t?un:pn}))],L.prototype,"readonly",void 0),O([C.Property(null)],L.prototype,"value",void 0),O([C.Property("Never")],L.prototype,"floatLabelType",void 0),O([C.Property("")],L.prototype,"cssClass",void 0),O([C.Property(null)],L.prototype,"placeholder",void 0),O([C.Property({})],L.prototype,"htmlAttributes",void 0),O([C.Property(!0)],L.prototype,"enabled",void 0),O([C.Property(!1)],L.prototype,"showClearButton",void 0),O([C.Property(!1)],L.prototype,"enablePersistence",void 0),O([C.Property(null)],L.prototype,"width",void 0),O([C.Property("Both")],L.prototype,"resizeMode",void 0),O([C.Property(null)],L.prototype,"maxLength",void 0),O([C.Property(null)],L.prototype,"cols",void 0),O([C.Property(null)],L.prototype,"rows",void 0),O([C.Event()],L.prototype,"created",void 0),O([C.Event()],L.prototype,"destroyed",void 0),O([C.Event()],L.prototype,"change",void 0),O([C.Event()],L.prototype,"blur",void 0),O([C.Event()],L.prototype,"focus",void 0),O([C.Event()],L.prototype,"input",void 0),O([C.NotifyPropertyChanges],L));function L(t,e){e=on.call(this,t,e)||this;return e.previousValue=null,e.isForm=!1,e.inputPreviousValue=null,e.textareaOptions=t,e}vn.createStyledDiv=function(e,t){var i=document.createElement("div"),s={position:"absolute",left:-9999,top:0,zIndex:-2e3},n=(this.properties.forEach(function(t){s[""+t]=getComputedStyle(e)[t]}),Object.keys(s).forEach(function(t){i.style[""+t]=s[""+t]}),e.offsetWidth-e.clientWidth);return i.style.width=e.clientWidth+n+"px",i.innerHTML=t,e&&e.parentNode&&e.parentNode.insertBefore(i,e.nextSibling),i},vn.createCaretMarker=function(t,e){t=this.createStyledDiv(t,e),e=t.ownerDocument.getElementById("caret-position-marker"),e={left:e.offsetLeft,top:e.offsetTop,height:e.offsetHeight};return t&&t.parentNode&&t.parentNode.removeChild(t),e},vn.escapeHtml=function(t){return t.replace(/<|>|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"<br/>")},vn.getCaretPosition=function(t){var e=t.selectionStart||0,i=t.value.slice(0,e),s=t.value.slice(e),i='<span style="position: relative; display: inline;">'+this.escapeHtml(i)+"</span>",s=(i=(i+='<span id="caret-position-marker" style="position: relative; display: inline;">|</span>')+('<span style="position: relative; display: inline;">'+this.escapeHtml(s)+"</span>"),this.createCaretMarker(t,i));return s.pos=e,s},vn.adjustScrollToCaretPosition=function(t){var e=this.getCaretPosition(t),i=parseFloat(window.getComputedStyle(t).lineHeight);e.top>t.clientHeight+t.scrollTop-i&&(t.scrollTop=e.top-t.clientHeight+i)},vn.getTextAreaPosition=function(t){var e=window.getComputedStyle(t),i=this.getCaretPosition(t);return{top:i.top+parseFloat(e.borderTopWidth)+t.offsetTop-t.scrollTop,left:i.left+parseFloat(e.borderLeftWidth)+t.offsetLeft-t.scrollLeft-.25,height:i.height,elemStyle:e}},vn.insertCharacter=function(t,e){var i=t.selectionStart,s=t.selectionEnd;t.value=t.value.substring(0,i)+e+t.value.substring(s),i+=e.length,t.setSelectionRange(i,i)},vn.properties=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","boxSizing","fontFamily","fontSize","fontWeight","height","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","outlineWidth","overflow","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","textAlign","textOverflow","textTransform","whiteSpace","wordBreak","wordWrap","width"];var mn=vn;function vn(){}fn=function(t,e){return(fn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var fn,gn,O=function(t,e){function i(){this.constructor=t}fn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},yn=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},bn=function(a,l,r,o){return new(r=r||Promise)(function(t,e){function i(t){try{n(o.next(t))}catch(t){e(t)}}function s(t){try{n(o.throw(t))}catch(t){e(t)}}function n(e){e.done?t(e.value):new r(function(t){t(e.value)}).then(i,s)}n((o=o.apply(a,l||[])).next())})},Cn=function(s,n){var a,l,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(i){return function(t){var e=[i,t];if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,l&&(r=2&e[0]?l.return:e[0]?l.throw||((r=l.return)&&r.call(l),0):l.next)&&!(r=r.call(l,e[1])).done)return r;switch(l=0,(e=r?[2&e[0],r.value]:e)[0]){case 0:case 1:r=e;break;case 4:return o.label++,{value:e[1],done:!1};case 5:o.label++,l=e[1],e=[0];continue;case 7:e=o.ops.pop(),o.trys.pop();continue;default:if(!(r=0<(r=o.trys).length&&r[r.length-1])&&(6===e[0]||2===e[0])){o=0;continue}if(3===e[0]&&(!r||e[1]>r[0]&&e[1]<r[3]))o.label=e[1];else if(6===e[0]&&o.label<r[1])o.label=r[1],r=e;else{if(!(r&&o.label<r[2])){r[2]&&o.ops.pop(),o.trys.pop();continue}o.label=r[2],o.ops.push(e)}}e=n.call(s,o)}catch(t){e=[6,t],l=0}finally{a=r=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}},En=((En=o.ChatMessageRole||(o.ChatMessageRole={})).System="system",En.User="user",En.Assistant="assistant",O(w,gn=P),w.prototype.render=function(){var t,e;gn.prototype.render.call(this),this.element instanceof HTMLTextAreaElement&&(this.textArea=this.element,(t=C.createElement("smart-textarea")).classList.add("e-smart-textarea"),this.textArea.after(t),"None"!==this.showSuggestionOnPopup&&(e="Enable"===this.showSuggestionOnPopup?"false":"true",this.textArea.setAttribute("data-inline-suggestions",e)),this.suggestionDisplay=new(this.shouldShowInlineSuggestions(this.textArea)?xn:Tn)(t,this.textArea))},w.prototype.wireEvents=function(){var t=this;gn.prototype.wireEvents.call(this),C.EventHandler.add(this.element,"keyup",this.handleKeyUp,this),C.EventHandler.add(this.element,"keydown",this.handleKeyDown,this),C.EventHandler.add(this.element,"mousedown",this.removeExistingOrPendingSuggestion,this),C.EventHandler.add(this.element,"focusout",this.removeExistingOrPendingSuggestion,this),this.element.addEventListener("scroll",function(){return t.suggestionDisplay.reject()},{passive:!0})},w.prototype.unWireEvents=function(){var t=this;gn.prototype.unWireEvents.call(this),C.EventHandler.remove(this.element,"keyup",this.handleKeyUp),C.EventHandler.remove(this.element,"keydown",this.handleKeyDown),C.EventHandler.remove(this.element,"mousedown",this.removeExistingOrPendingSuggestion),C.EventHandler.remove(this.element,"focusout",this.removeExistingOrPendingSuggestion),this.element.removeEventListener("scroll",function(){return t.suggestionDisplay.reject()})},w.prototype.keydownHandler=function(){},w.prototype.shouldShowInlineSuggestions=function(t){t=t.getAttribute("data-inline-suggestions");return t?"true"===t.toLowerCase():!("ontouchstart"in window)},w.prototype.handleKeyDown=function(t){switch(t.key){case"Tab":this.suggestionDisplay.isShowing()&&(this.suggestionDisplay.accept(),t.preventDefault());break;case"Alt":case"Control":case"Shift":case"Command":break;default:this.suggestionDisplay.isShowing()&&this.suggestionDisplay.currentSuggestion.startsWith(t.key)?(mn.insertCharacter(this.textArea,t.key),t.preventDefault(),this.suggestionDisplay.show(this.suggestionDisplay.currentSuggestion.substring(t.key.length)),mn.adjustScrollToCaretPosition(this.textArea)):this.removeExistingOrPendingSuggestion()}},w.prototype.handleKeyUp=function(){var t=this;this.suggestionDisplay.isShowing()||(clearTimeout(this.typingDebounceTimeout),this.typingDebounceTimeout=setTimeout(function(){return t.handleTypingPaused()},350))},w.prototype.handleTypingPaused=function(){return bn(this,void 0,void 0,function(){return Cn(this,function(t){switch(t.label){case 0:return document.activeElement!==this.textArea?[2]:this.textArea.selectionStart!==this.textArea.selectionEnd||this.textArea.selectionStart!==this.textArea.value.length&&"\n"!==this.textArea.value[this.textArea.selectionStart]?[3,2]:[4,this.requestSuggestionAsync()];case 1:t.sent(),t.label=2;case 2:return[2]}})})},w.prototype.removeExistingOrPendingSuggestion=function(){clearTimeout(this.typingDebounceTimeout),this.pendingSuggestionAbort&&(this.pendingSuggestionAbort.abort(),this.pendingSuggestionAbort=null),this.suggestionDisplay.reject()},w.prototype.createSuggestionPrompt=function(t,e){var i="Predict what text the user in the given ROLE would insert at the cursor position indicated by ^^^.\nOnly give predictions for which you have an EXTREMELY high confidence that the user would insert that EXACT text.\nDo not make up new information. If you are not sure, just reply with NO_PREDICTION.\n\nRULES:\n1. Reply with OK:, then in square brackets the predicted text, then END_INSERTION, and no other output.\n2. When a specific value or quantity cannot be inferred and would need to be provided, use the word NEED_INFO.\n3. If there is not enough information to predict any words that the user would type next, just reply with the word NO_PREDICTION.\n4. NEVER invent new information. If you can not be sure what the user is about to type, ALWAYS stop the prediction with END_INSERTION.",s=this.UserPhrases;if(s&&0<s.length){i+="\nAlways try to use variations on the following phrases as part of the predictions:\n";for(var n=0,a=s;n<a.length;n++)i+="- "+a[n]+"\n"}return{messages:[{role:o.ChatMessageRole.System,content:i},{role:o.ChatMessageRole.User,content:"ROLE: Family member sending a text\nUSER_TEXT: Hey, it is a nice day - the weather is ^^^"},{role:o.ChatMessageRole.Assistant,content:"OK:[great!]END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: Customer service assistant\nUSER_TEXT: You can find more information on^^^\n\nAlternatively, phone us."},{role:o.ChatMessageRole.Assistant,content:"OK:[ our website at NEED_INFO]END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: Casual\nUSER_TEXT: Oh I see!\n\nWell sure thing, we can"},{role:o.ChatMessageRole.Assistant,content:"OK:[ help you out with that!]END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: Storyteller\nUSER_TEXT: Sir Digby Chicken Caesar, also know^^^"},{role:o.ChatMessageRole.Assistant,content:"OK:[n as NEED_INFO]END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: Customer support agent\nUSER_TEXT: Goodbye for now.^^^"},{role:o.ChatMessageRole.Assistant,content:"NO_PREDICTION END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: Pirate\nUSER_TEXT: Have you found^^^"},{role:o.ChatMessageRole.Assistant,content:"OK:[ the treasure, me hearties?]END_INSERTION"},{role:o.ChatMessageRole.User,content:"ROLE: "+this.userRole+"\nUSER_TEXT: "+t+"^^^"+e}],temperature:0,maxTokens:400,stopSequences:["END_INSERTION","NEED_INFO"],frequencyPenalty:0,presencePenalty:0}},w.prototype.requestSuggestionAsync=function(){return bn(this,void 0,void 0,function(){var e,i,s,n;return Cn(this,function(t){switch(t.label){case 0:return this.pendingSuggestionAbort?(this.pendingSuggestionAbort.abort(),[2]):(this.pendingSuggestionAbort=new AbortController,e={textAreaValue:this.textArea.value,cursorPosition:this.textArea.selectionStart},i={textBefore:e.textAreaValue.substring(0,e.cursorPosition),textAfter:e.textAreaValue.substring(e.cursorPosition)},n=this.createSuggestionPrompt(i.textBefore,i.textAfter),"function"!=typeof this.aiSuggestionHandler?[3,2]:[4,this.aiSuggestionHandler(n)]);case 1:n=t.sent(),s=this.validateSuggestion(n,i.textBefore),t.label=2;case 2:return s&&e.textAreaValue===this.textArea.value&&e.cursorPosition===this.textArea.selectionStart&&(s.endsWith(" ")||(s+=" "),this.suggestionDisplay.show(s)),[2]}})})},w.prototype.validateSuggestion=function(t,e){var i;return"string"!=typeof t||t.length<=5||0!==t.indexOf("OK:[")?"":(i=(t=0<(i=this.indexOfAny(t,[".","?","!"]))&&t.length>i+1&&" "===t[i+1]?t.substring(0,i+1):t).substring(4).replace(/[\]\s]+$/,""),0<e.length&&" "===e[e.length-1]?i.replace(/^\s+/,""):i)},w.prototype.indexOfAny=function(t,e){for(var i=0;i<t.length;i++)if(-1!==e.indexOf(t[""+i]))return i;return-1},w.prototype.getModuleName=function(){return"smarttextarea"},w.prototype.destroy=function(){gn.prototype.destroy.call(this),this.textArea=null,this.suggestionDisplay=null,this.typingDebounceTimeout=null},yn([C.Property("")],w.prototype,"userRole",void 0),yn([C.Property([])],w.prototype,"UserPhrases",void 0),yn([C.Property()],w.prototype,"aiSuggestionHandler",void 0),yn([C.Property("None")],w.prototype,"showSuggestionOnPopup",void 0),w);function w(t,e){return gn.call(this,t,e)||this}Object.defineProperty(Sn.prototype,"value",{get:function(){var t=this.originalValueProperty.get.call(this.textArea);return this.isShowing()?t.substring(0,this.suggestionStartPos)+t.substring(this.suggestionEndPos):t},set:function(t){this.originalValueProperty.set.call(this.textArea,t)},enumerable:!0,configurable:!0}),Sn.prototype.getOriginalValueProperty=function(t,e){for(;t;){var i=Object.getOwnPropertyDescriptor(t,e);if(i)return i;t=Object.getPrototypeOf(t)}throw new Error("Property "+e+" not found on object or its prototype chain")},Object.defineProperty(Sn.prototype,"valueIncludingSuggestion",{get:function(){return this.originalValueProperty.get.call(this.textArea)},set:function(t){this.originalValueProperty.set.call(this.textArea,t)},enumerable:!0,configurable:!0}),Sn.prototype.isShowing=function(){return null!==this.suggestionStartPos},Sn.prototype.show=function(t){this.latestSuggestionText=t,this.suggestionStartPos=this.textArea.selectionStart,this.suggestionEndPos=this.suggestionStartPos+t.length,this.textArea.setAttribute("data-suggestion-visible",""),this.valueIncludingSuggestion=this.valueIncludingSuggestion.substring(0,this.suggestionStartPos)+t+this.valueIncludingSuggestion.substring(this.suggestionStartPos),this.textArea.setSelectionRange(this.suggestionStartPos,this.suggestionEndPos),this.virtualCaret||(this.virtualCaret=new kn(this.owner,this.textArea)),this.virtualCaret.show()},Object.defineProperty(Sn.prototype,"currentSuggestion",{get:function(){return this.latestSuggestionText},enumerable:!0,configurable:!0}),Sn.prototype.accept=function(){this.textArea.setSelectionRange(this.suggestionEndPos,this.suggestionEndPos),this.suggestionStartPos=null,this.suggestionEndPos=null,this.virtualCaret&&this.virtualCaret.hide(),this.textArea.removeAttribute("data-suggestion-visible"),mn.adjustScrollToCaretPosition(this.textArea)},Sn.prototype.reject=function(){var t,e;this.isShowing()&&(t=this.textArea.selectionStart,e=this.textArea.selectionEnd,this.valueIncludingSuggestion=this.valueIncludingSuggestion.substring(0,this.suggestionStartPos)+this.valueIncludingSuggestion.substring(this.suggestionEndPos),this.suggestionStartPos===t&&this.suggestionEndPos===e&&this.textArea.setSelectionRange(t,t),this.suggestionStartPos=null,this.suggestionEndPos=null,this.textArea.removeAttribute("data-suggestion-visible"),this.virtualCaret)&&this.virtualCaret.hide()};var xn=Sn;function Sn(t,e){this.owner=t,this.textArea=e,this.latestSuggestionText="",this.suggestionStartPos=null,this.suggestionEndPos=null,this.virtualCaret=null,this.originalValueProperty=this.getOriginalValueProperty(e,"value")}Object.defineProperty(Pn.prototype,"currentSuggestion",{get:function(){return this.latestSuggestionText},enumerable:!0,configurable:!0}),Pn.prototype.show=function(t){this.latestSuggestionText=t,this.suggestionPrefixElement.textContent=" "!==t[0]?this.getPrefixText(this.textArea,20):"",this.suggestionTextElement.textContent=t;var t=mn.getTextAreaPosition(this.textArea),e=this.suggestionElement.style,t=(e.minWidth=null,this.suggestionElement.classList.add("smart-textarea-suggestion-overlay-visible"),e.zIndex=this.textArea.style.zIndex+1,e.top=t.top+"px",t.left-this.suggestionPrefixElement.offsetWidth),t=((!e.left||10<Math.abs(parseFloat(e.left)-t))&&(e.left=t+"px"),this.showing=!0,window.getComputedStyle(this.suggestionElement)),i=parseFloat(t.lineHeight),s=parseFloat(t.paddingTop),t=parseFloat(t.paddingBottom),s=Math.round((this.suggestionElement.offsetHeight-s-t)/i),i=(2<s&&(t=this.suggestionElement.offsetWidth,e.minWidth="calc(min(70vw, "+s*t/2+"px))"),this.suggestionElement.getBoundingClientRect());i.right>document.body.clientWidth-20&&(e.left="calc("+(parseFloat(e.left)-(i.right-document.body.clientWidth))+"px - 2rem)")},Pn.prototype.accept=function(){this.showing&&(mn.insertCharacter(this.textArea,this.currentSuggestion),mn.adjustScrollToCaretPosition(this.textArea),this.hide())},Pn.prototype.reject=function(){this.hide()},Pn.prototype.hide=function(){this.showing&&(this.showing=!1,this.suggestionElement.classList.remove("smart-textarea-suggestion-overlay-visible"))},Pn.prototype.isShowing=function(){return this.showing},Pn.prototype.handleSuggestionClicked=function(t){t.preventDefault(),t.stopImmediatePropagation(),this.accept()},Pn.prototype.getPrefixText=function(t,e){for(var i=t.value,s=t.selectionStart,n=s-1;s-e<n;n--)if(n<0||/\s/.test(i[""+n]))return i.substring(n+1,s);return""};var Tn=Pn;function Pn(t,e){var i=this,e=(this.latestSuggestionText="",this.showing=!1,this.textArea=e,this.suggestionElement=document.createElement("div"),this.suggestionElement.classList.add("smart-textarea-suggestion-overlay"),this.suggestionElement.addEventListener("mousedown",function(t){return i.handleSuggestionClicked(t)}),this.suggestionElement.addEventListener("touchend",function(t){return i.handleSuggestionClicked(t)}),this.suggestionPrefixElement=document.createElement("span"),this.suggestionTextElement=document.createElement("span"),this.suggestionElement.appendChild(this.suggestionPrefixElement),this.suggestionElement.appendChild(this.suggestionTextElement),this.suggestionPrefixElement.style.opacity="0.3",window.getComputedStyle(this.textArea));this.suggestionElement.style.font=e.font,this.suggestionElement.style.marginTop=1.4*parseFloat(e.fontSize)+"px",t.appendChild(this.suggestionElement)}On.prototype.show=function(){var t=mn.getTextAreaPosition(this.textArea),e=this.caretDiv.style;e.display="block",e.top=t.top+"px",e.left=t.left+"px",e.height=t.height+"px",e.zIndex=this.textArea.style.zIndex,e.backgroundColor=t.elemStyle.caretColor},On.prototype.hide=function(){this.caretDiv.style.display="none"};var kn=On;function On(t,e){this.textArea=e,this.caretDiv=document.createElement("div"),this.caretDiv.classList.add("smart-textarea-caret"),t.appendChild(this.caretDiv)}Ln=function(t,e){return(Ln=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Ln,wn,O=function(t,e){function i(){this.constructor=t}Ln(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},yn=(wn=C.Component,O(A,wn),A.prototype.initialize=function(t,e){this.clearArray=[],this.element=t,this.canvasContext=this.element.getContext("2d"),this.canvasContext.canvas.tabIndex=-1,e&&(this.dotnetRef=e,this.isBlazor=!0,this.signatureValue)&&this.loadPersistedSignature(),this.setHTMLProperties(),C.isNullOrUndefined(this.signatureValue)&&this.updateSnapCollection(!0),this.wireEvents(),this.isBlazor||this.trigger("created",null)},A.prototype.wireEvents=function(){!C.isNullOrUndefined(this.pointColl)||this.isReadOnly||this.disabled?this.pointColl&&(C.EventHandler.add(this.canvasContext.canvas,"mousemove touchmove",this.mouseMoveHandler,this),C.EventHandler.add(this.canvasContext.canvas,"mouseup touchend",this.mouseUpHandler,this),C.EventHandler.add(document,"mouseup",this.mouseUpHandler,this)):(C.EventHandler.add(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler,this),C.EventHandler.add(this.canvasContext.canvas,"keydown",this.keyboardHandler,this),window.addEventListener("resize",this.resizeHandler.bind(this)))},A.prototype.unwireEvents=function(t){"mouseup"===t||"touchend"===t?(this.canvasContext&&(C.EventHandler.remove(this.canvasContext.canvas,"mousemove touchmove",this.mouseMoveHandler),C.EventHandler.remove(this.canvasContext.canvas,"mouseup touchend",this.mouseUpHandler)),C.EventHandler.remove(document,"mouseup",this.mouseUpHandler)):(this.canvasContext&&(C.EventHandler.remove(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler),C.EventHandler.remove(this.canvasContext.canvas,"keydown",this.keyboardHandler)),window.removeEventListener("resize",this.resizeHandler))},A.prototype.setHTMLProperties=function(){150===this.element.height&&300===this.element.width&&0!==this.element.offsetHeight&&0!==this.element.offsetWidth?(this.element.height=this.element.offsetHeight,this.element.width=this.element.offsetWidth,this.isResponsive=!0):this.element.height===this.element.offsetHeight-1&&this.element.width===this.element.offsetWidth-1||0===this.element.offsetHeight||0===this.element.offsetWidth||(this.element.height=this.element.offsetHeight,this.element.width=this.element.offsetWidth),this.canvasContext.fillStyle=this.strokeColor,this.tempCanvas=this.createElement("canvas",{className:"e-"+this.getModuleName()+"-temp"}),this.tempContext=this.tempCanvas.getContext("2d"),this.tempCanvas.width=this.element.width,this.tempCanvas.height=this.element.height,this.backgroundImage?(this.canvasContext.canvas.style.backgroundImage="url("+this.backgroundImage+")",this.canvasContext.canvas.style.backgroundRepeat="no-repeat",this.saveWithBackground&&this.setBackgroundImage(this.backgroundImage,"temp")):this.backgroundColor&&(this.canvasContext.canvas.style.backgroundColor=this.backgroundColor)},A.prototype.mouseDownHandler=function(t){1!==t.buttons&&2!==t.buttons&&"touchstart"!==t.type||("touchstart"===t.type&&(t.preventDefault(),t.stopPropagation()),this.beginStroke(t),this.wireEvents())},A.prototype.mouseMoveHandler=function(t){1!==t.buttons&&2!==t.buttons&&"touchmove"!==t.type||("touchmove"===t.type&&(t.preventDefault(),t.stopPropagation()),this.interval?this.updateStrokeWithThrottle(t):this.updateStroke(t))},A.prototype.mouseUpHandler=function(t){"touchstart"===t.type&&(t.preventDefault(),t.stopPropagation()),this.endDraw(),this.updateSnapCollection(),this.unwireEvents(t.type),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","mouseUp"):this.trigger("change",{actionName:"strokeUpdate"}),this.signatureValue=this.snapColl[this.incStep];for(var e=0;e<this.signPointsColl.length;e++)this.signRatioPointsColl.push({x:this.signPointsColl[e].x/this.canvasContext.canvas.width,y:this.signPointsColl[e].y/this.canvasContext.canvas.height});this.signPointsColl=[]},A.prototype.keyboardHandler=function(t){var e=this,i={fileName:"Signature",type:"Png",cancel:!1};switch(t.key){case"Delete":this.clear();break;case t.ctrlKey&&"s":this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","beforeSave"):this.trigger("beforeSave",i,function(t){i.cancel||e.save(t.type,t.fileName)}),t.preventDefault(),t.stopImmediatePropagation();break;case t.ctrlKey&&"z":this.undo();break;case t.ctrlKey&&"y":this.redo()}},A.prototype.resizeHandler=function(){var t,e=this;if(this.isResponsive&&this.canRedraw&&this.canvasContext&&this.element){this.canvasContext.canvas.width=this.element.offsetWidth,this.canvasContext.canvas.height=this.element.offsetHeight,this.canvasContext.scale(1,1);for(var i=(this.minStrokeWidth+this.maxStrokeWidth)/2,s=0;s<this.signRatioPointsColl.length;s++)this.arcDraw(this.signRatioPointsColl[s].x*this.canvasContext.canvas.width,this.signRatioPointsColl[s].y*this.canvasContext.canvas.height,i);this.signPointsColl=[],this.canvasContext.closePath(),this.canvasContext.fill()}else this.canvasContext&&this.element&&((t=new Image).src=this.snapColl[this.incStep],t.onload=function(){e.canvasContext.clearRect(0,0,e.element.width,e.element.height),e.canvasContext.drawImage(t,0,0,e.element.width,e.element.height)})},A.prototype.beginStroke=function(t){this.internalRefresh(),this.updateStroke(t)},A.prototype.updateStroke=function(t){t=this.createPoint(t);this.addPoint(t)},A.prototype.updateStrokeWithThrottle=function(t){var e=Date.now(),i=this.interval-(e-this.previous);this.storedArgs=t,i<=0||i>this.interval?(this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.previous=e,this.updateStroke(this.storedArgs),this.timeout||(this.storedArgs=null)):this.timeout||(this.timeout=window.setTimeout(this.delay.bind(this),i))},A.prototype.delay=function(){this.previous=Date.now(),this.timeout=null,this.updateStroke(this.storedArgs),this.timeout||(this.storedArgs=null)},A.prototype.createPoint=function(t){var e=this.canvasContext.canvas.getBoundingClientRect();return"mousedown"===t.type||"mousemove"===t.type?this.point(t.clientX-e.left,t.clientY-e.top,(new Date).getTime()):this.point(t.touches[0].clientX-e.left,t.touches[0].clientY-e.top,(new Date).getTime())},A.prototype.point=function(t,e,i){return this.pointX=t,this.pointY=e,this.time=i||(new Date).getTime(),{x:this.pointX,y:this.pointY,time:this.time}},A.prototype.addPoint=function(t){var e=this.pointColl,i=0<e.length&&e[e.length-1],s=!!i&&this.distanceTo(i)<=this.minDistance;i&&s||(e.push(t),2<e.length&&(3===e.length&&e.unshift(e[0]),i=this.calculateCurveControlPoints(e[0],e[1],e[2]).controlPoint2,s=this.calculateCurveControlPoints(e[1],e[2],e[3]).controlPoint1,this.startPoint=e[1],this.controlPoint1=i,this.controlPoint2=s,this.endPoint=e[2],this.startDraw(),e.shift()))},A.prototype.startDraw=function(){var t=this.pointVelocityCalc(this.startPoint),e=(t=this.velocity*t+(1-this.velocity)*this.lastVelocity,Math.max(this.maxStrokeWidth/(1+t),this.minStrokeWidth));this.curveDraw(this.lastWidth,e),this.lastVelocity=t,this.lastWidth=e},A.prototype.endDraw=function(){var t,e;C.isNullOrUndefined(this.pointColl)||(t=2<this.pointColl.length,e=this.pointColl[0],!t&&e&&this.strokeDraw(e))},A.prototype.curveDraw=function(t,e){var i,s,n,a,l,r,o,h,u=this.canvasContext,p=e-t,e=this.bezierLengthCalc(),d=2*Math.ceil(e);for(u.beginPath(),i=0;i<d;i++)o=(h=(r=(l=1-(s=i/d))*l)*l)*this.startPoint.x,o=(o=(o+=3*r*s*this.controlPoint1.x)+3*l*(n=s*s)*this.controlPoint2.x)+(a=n*s)*this.endPoint.x,h=h*this.startPoint.y,h=(h=(h+=3*r*s*this.controlPoint1.y)+3*l*n*this.controlPoint2.y)+a*this.endPoint.y,r=Math.min(t+a*p,this.maxStrokeWidth),this.arcDraw(o,h,r);u.closePath(),u.fill(),this.isSignatureEmpty=!1},A.prototype.strokeDraw=function(t){var e=this.canvasContext,i=(this.minStrokeWidth+this.maxStrokeWidth)/2;e.beginPath(),this.arcDraw(t.x,t.y,i),e.closePath(),e.fill(),this.isSignatureEmpty=!1},A.prototype.arcDraw=function(t,e,i){this.signPointsColl.push({x:t,y:e});var s=this.canvasContext;s.moveTo(t,e),s.arc(t,e,i,0,2*Math.PI,!1)},A.prototype.calculateCurveControlPoints=function(t,e,i){var s=t.x-e.x,n=t.y-e.y,a=e.x-i.x,l=e.y-i.y,r=(t.x+e.x)/2,t=(t.y+e.y)/2,o=(e.x+i.x)/2,i=(e.y+i.y)/2,s=Math.sqrt(s*s+n*n),n=Math.sqrt(a*a+l*l),a=n/(s+n),l=o+(r-o)*a,s=i+(t-i)*a,n=e.x-l,a=e.y-s;return{controlPoint1:this.point(r+n,t+a,0),controlPoint2:this.point(o+n,i+a,0)}},A.prototype.bezierLengthCalc=function(){for(var t,e,i,s,n,a,l=0,r=0;r<=10;r++)t=this.bezierPointCalc(e=r/10,this.startPoint.x,this.controlPoint1.x,this.controlPoint2.x,this.endPoint.x),e=this.bezierPointCalc(e,this.startPoint.y,this.controlPoint1.y,this.controlPoint2.y,this.endPoint.y),0<r&&(n=t-i,a=e-s,l+=Math.sqrt(n*n+a*a)),i=t,s=e;return l},A.prototype.bezierPointCalc=function(t,e,i,s,n){return e*(1-t)*(1-t)*(1-t)+3*i*(1-t)*(1-t)*t+3*s*(1-t)*t*t+n*t*t*t},A.prototype.pointVelocityCalc=function(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0},A.prototype.distanceTo=function(t){return Math.sqrt(Math.pow(this.pointX-t.x,2)+Math.pow(this.pointY-t.y,2))},A.prototype.isRead=function(t){t?C.EventHandler.remove(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler):this.disabled||C.EventHandler.add(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler,this)},A.prototype.enableOrDisable=function(t){(this.disabled=t)?(this.canvasContext.canvas.style.filter="opacity(0.5)",this.isRead(!0)):(this.canvasContext.canvas.style.filter="",this.isRead(!1))},A.prototype.updateSnapCollection=function(t){var e,i;C.isNullOrUndefined(this.incStep)?(this.incStep=-1,this.incStep++,this.snapColl=[],this.clearArray=[]):this.incStep++,this.incStep<this.snapColl.length&&(this.snapColl.length=this.incStep),0<this.incStep?(i=(e=this.createElement("canvas",{className:"e-"+this.getModuleName()+"-wrapper"})).getContext("2d"),this.canvasContext&&(e.width=this.canvasContext.canvas.width,e.height=this.canvasContext.canvas.height,i.drawImage(this.canvasContext.canvas,0,0,e.width,e.height),this.snapColl.push(e.toDataURL()))):this.snapColl.push(this.canvasContext.canvas.toDataURL()),t&&this.clearArray.push(this.incStep)},A.prototype.setBackgroundImage=function(t,e){var i=this,s=new Image;s.crossOrigin="anonymous",s.src=t,"temp"===e?s.onload=function(){i.tempContext.globalCompositeOperation="source-over",i.tempContext.drawImage(s,0,0,i.element.width,i.element.height)}:(s.onload=function(){i.canvasContext.globalCompositeOperation="source-over",i.canvasContext.drawImage(s,0,0,i.element.width,i.element.height),i.updateSnapCollection(),i.saveBackground(!0)},this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height))},A.prototype.setBackgroundColor=function(t){var e,i,s=this.canvasContext;for(s.strokeStyle=t,e=1;e<=s.canvas.width;e++)for(i=1;i<=s.canvas.height;i++)s.strokeRect(0,0,e,i);this.updateSnapCollection()},A.prototype.loadPersistedSignature=function(){var t,e;C.isNullOrUndefined(this.signatureValue)||(t=this,(e=new Image).src=this.signatureValue,e.onload=function(){t.canvasContext.clearRect(0,0,t.element.width,t.element.height),t.canvasContext.drawImage(e,0,0),t.updateSnapCollection()},this.isSignatureEmpty=!1)},A.prototype.getBlob=function(t){for(var t=t.split(","),e=t[0].match(/:(.*?);/)[1],i=atob(t[1]),s=i.length,n=new Uint8Array(s);s--;)n[s]=i.charCodeAt(s);return new Blob([n],{type:e})},A.prototype.download=function(t,e){var t=URL.createObjectURL(t),i=document.createElement("a");i.href=t,i.target="_parent",i.download=e,(document.body||document.documentElement).appendChild(i),i.click(),i.parentNode.removeChild(i)},A.prototype.internalRefresh=function(){this.pointColl=[],this.lastVelocity=0,this.lastWidth=(this.minStrokeWidth+this.maxStrokeWidth)/2},A.prototype.refresh=function(){this.isResponsive=!1,this.setHTMLProperties(),this.resizeHandler(),this.internalRefresh()},A.prototype.clear=function(){this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.tempContext.clearRect(0,0,this.tempContext.canvas.width,this.tempContext.canvas.height),this.saveWithBackground&&this.backgroundImage&&this.setBackgroundImage(this.backgroundImage,"temp"),this.internalRefresh(),this.signRatioPointsColl=[],this.updateSnapCollection(!0),this.isSignatureEmpty=this.canRedraw=!0,this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Clear"):this.trigger("change",{actionName:"clear"})},A.prototype.undo=function(){var t,e=this;0<this.incStep&&(this.incStep--,(t=new Image).src=this.snapColl[this.incStep],t.onload=function(){e.canvasContext.clearRect(0,0,e.element.width,e.element.height),e.canvasContext.drawImage(t,0,0,e.element.width,e.element.height)}),this.isClear(),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Undo"):this.trigger("change",{actionName:"undo"})},A.prototype.redo=function(){var t,e=this;this.incStep<this.snapColl.length-1&&(this.incStep++,(t=new Image).src=this.snapColl[this.incStep],t.onload=function(){e.canvasContext.clearRect(0,0,e.element.width,e.element.height),e.canvasContext.drawImage(t,0,0,e.element.width,e.element.height)}),this.isClear(),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Redo"):this.trigger("change",{actionName:"redo"})},A.prototype.isClear=function(){if(this.clearArray){for(var t=!1,e=0;e<this.clearArray.length;e++)this.clearArray[e]===this.incStep&&(t=this.isSignatureEmpty=!0);t||(this.isSignatureEmpty=!1)}},A.prototype.isEmpty=function(){return this.isSignatureEmpty},A.prototype.canUndo=function(){return 0<this.incStep},A.prototype.canRedo=function(){return this.incStep<this.snapColl.length-1},A.prototype.draw=function(t,e,i,s,n){this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.canvasContext.font=(i=i||30)+"px "+(e=e||"Arial");var e=this.element.width/2,a=this.element.height/2;C.isNullOrUndefined(s)&&C.isNullOrUndefined(n)?(this.canvasContext.textAlign="center",this.canvasContext.textBaseline="middle"):(e=C.isNullOrUndefined(s)?e:s,a=C.isNullOrUndefined(n)?a+i/2:n+i/2),this.canvasContext.fillText(t,e,a),this.updateSnapCollection(),this.isSignatureEmpty=!1,this.trigger("change",{actionName:"draw-text"})},A.prototype.load=function(i,s,n){n=n||this.element.height,s=s||this.element.width,this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height);var a=this,t=new Image;"data"!==(t.src=i).slice(0,4)&&(t.crossOrigin="anonymous"),t.onload=function(){Promise.all([createImageBitmap(t,0,0,s,n)]).then(function(t){var e=document.createElement("canvas");e.width=s,e.height=n,e.getContext("2d").drawImage(t[0],0,0),"data"!==i.slice(0,4)&&(a.canvasContext.globalCompositeOperation="source-over"),a.canvasContext.drawImage(e,0,0,s,n,0,0,a.element.width,a.element.height),a.updateSnapCollection()})},this.isSignatureEmpty=this.canRedraw=!1},A.prototype.saveBackground=function(t){var e,i,s=t&&this.backgroundImage?this.snapColl[this.incStep-1]:this.snapColl[this.incStep];t||(this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.backgroundImage?this.setBackgroundImage(this.backgroundImage):this.backgroundColor&&(this.setBackgroundColor(this.backgroundColor),t=!0)),t&&(e=this,(i=new Image).crossOrigin="anonymous",i.src=s,i.onload=function(){e.backgroundLoaded=!0,e.canvasContext.globalCompositeOperation="source-over",e.canvasContext.drawImage(i,0,0,e.element.width,e.element.height),e.save(e.fileType,e.fileName)})},A.prototype.save=function(t,e){var i;this.saveWithBackground&&null==this.backgroundLoaded&&(this.backgroundImage||this.backgroundColor)?(this.backgroundLoaded=!1,this.fileType=t,this.fileName=e,this.saveBackground(!1)):"Svg"===t?this.toSVG(e=e||"Signature"):"Jpeg"===t?(e=e||"Signature",!this.saveWithBackground||this.saveWithBackground&&!this.backgroundImage&&!this.backgroundColor?this.toJPEG(e):(i=this.canvasContext.canvas.toDataURL("image/jpeg"),this.download(this.getBlob(i),e+".jpeg"))):(e=e||"Signature",i=this.canvasContext.canvas.toDataURL("image/png"),this.download(this.getBlob(i),e+".png")),this.saveWithBackground&&this.backgroundLoaded&&this.resetSnap()},A.prototype.resetSnap=function(){this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height);var t=this,e=new Image;e.src=this.snapColl[this.incStep-1],e.onload=function(){t.canvasContext.drawImage(e,0,0,t.element.width,t.element.height),t.updateSnapCollection()},this.backgroundLoaded=null,this.snapColl.pop(),this.incStep--,this.snapColl.pop(),this.incStep--},A.prototype.toJPEG=function(e){var i=this,t=this.snapColl[this.incStep],s=(this.setBackgroundColor("#ffffff"),this),n=new Image;n.crossOrigin="anonymous",n.src=t,n.onload=function(){s.canvasContext.globalCompositeOperation="source-over",s.canvasContext.drawImage(n,0,0,s.element.width,s.element.height);var t=s.canvasContext.canvas.toDataURL("image/jpeg");s.download(s.getBlob(t),e+".jpeg"),s.canvasContext.clearRect(0,0,s.canvasContext.canvas.width,s.canvasContext.canvas.height),i.resizeHandler()},this.snapColl.pop(),this.incStep--},A.prototype.toSVG=function(t,e){var i=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=(i.setAttribute("width",this.canvasContext.canvas.width.toString()),i.setAttribute("height",this.canvasContext.canvas.height.toString()),document.createElementNS("http://www.w3.org/2000/svg","image")),e=(s.setAttributeNS(null,"height",this.canvasContext.canvas.height.toString()),s.setAttributeNS(null,"width",this.canvasContext.canvas.width.toString()),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e),i.appendChild(s),'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+this.canvasContext.canvas.width+'" height="'+this.canvasContext.canvas.height+'">'),s=i.innerHTML,i="data:image/svg+xml;base64,"+btoa(e+s+"</svg>");return null==t?i:(this.download(this.getBlob(i),t+".svg"),null)},A.prototype.saveAsBlob=function(){return this.getBlob(this.canvasContext.canvas.toDataURL("image/png"))},A.prototype.getSignature=function(t){return this.saveWithBackground&&this.backgroundColor&&!this.backgroundImage?(this.tempContext.fillStyle=this.backgroundColor,this.tempContext.fillRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height)):this.backgroundColor||this.backgroundImage||"Jpeg"!==t||(this.tempContext.fillStyle="#fff",this.tempContext.fillRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height)),this.tempContext.drawImage(this.element,0,0),"Jpeg"===t?this.tempCanvas.toDataURL("image/jpeg"):"Svg"===t?this.toSVG(null,this.tempCanvas.toDataURL("image/png")):this.tempCanvas.toDataURL("image/png")},A.prototype.getModuleName=function(){return"signature"},A.prototype.getPersistData=function(){return this.signatureValue=this.snapColl[this.incStep],this.addOnPersist(["signatureValue"])},A.prototype.destroy=function(){"image-editor"!==this.getModuleName()&&(this.unwireEvents(null),C.removeClass([this.element],"e-"+this.getModuleName()),this.element.removeAttribute("tabindex"),this.pointColl=null,this.tempContext=null,this.tempCanvas=null,this.canvasContext=null),wn.prototype.destroy.call(this),this.element=null},A.prototype.propertyChanged=function(t,e){var i=this.canvasContext;switch(t){case"backgroundColor":i.canvas.style.backgroundColor=e,this.backgroundColor=e;break;case"backgroundImage":i.canvas.style.backgroundImage="url("+e+")",this.backgroundImage=e,this.saveWithBackground&&this.setBackgroundImage(this.backgroundImage,"temp");break;case"strokeColor":i.fillStyle=e,this.strokeColor=e;break;case"saveWithBackground":this.saveWithBackground=e;break;case"maxStrokeWidth":this.maxStrokeWidth=e;break;case"minStrokeWidth":this.minStrokeWidth=e;break;case"velocity":this.velocity=e;break;case"isReadOnly":this.isRead(e);break;case"disabled":this.enableOrDisable(e)}},A);function A(){var t=null!==wn&&wn.apply(this,arguments)||this;return t.minDistance=5,t.previous=0,t.interval=30,t.timeout=null,t.isSignatureEmpty=!0,t.backgroundLoaded=null,t.isBlazor=!1,t.isResponsive=!1,t.signPointsColl=[],t.signRatioPointsColl=[],t.canRedraw=!0,t}An=function(t,e){return(An=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var An,N,O=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},O=(function(t,e){function i(){this.constructor=t}An(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(H,N=yn),H.prototype.preRender=function(){},H.prototype.render=function(){this.initialize()},H.prototype.initialize=function(){this.element.setAttribute("role","img"),this.element.setAttribute("aria-label","signature"),C.addClass([this.element],"e-"+this.getModuleName()),N.prototype.initialize.call(this,this.element),this.enablePersistence&&this.loadPersistedSignature()},H.prototype.getModuleName=function(){return N.prototype.getModuleName.call(this)},H.prototype.getPersistData=function(){return N.prototype.getPersistData.call(this)},H.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i];switch(n){case"backgroundColor":N.prototype.propertyChanged.call(this,n,t.backgroundColor);break;case"backgroundImage":N.prototype.propertyChanged.call(this,n,t.backgroundImage);break;case"strokeColor":t.strokeColor!==e.strokeColor&&N.prototype.propertyChanged.call(this,n,t.strokeColor);break;case"maxStrokeWidth":t.maxStrokeWidth!==e.maxStrokeWidth&&N.prototype.propertyChanged.call(this,n,t.maxStrokeWidth);break;case"minStrokeWidth":t.minStrokeWidth!==e.minStrokeWidth&&N.prototype.propertyChanged.call(this,n,t.minStrokeWidth);break;case"velocity":t.velocity!==e.velocity&&N.prototype.propertyChanged.call(this,n,t.velocity);break;case"saveWithBackground":N.prototype.propertyChanged.call(this,n,t.saveWithBackground);break;case"isReadOnly":N.prototype.propertyChanged.call(this,n,t.isReadOnly);break;case"disabled":N.prototype.propertyChanged.call(this,n,t.disabled)}}},O([C.Property("")],H.prototype,"backgroundColor",void 0),O([C.Property("")],H.prototype,"backgroundImage",void 0),O([C.Property(!1)],H.prototype,"disabled",void 0),O([C.Property(!1)],H.prototype,"isReadOnly",void 0),O([C.Property(!0)],H.prototype,"saveWithBackground",void 0),O([C.Property("#000000")],H.prototype,"strokeColor",void 0),O([C.Property(.5)],H.prototype,"minStrokeWidth",void 0),O([C.Property(2)],H.prototype,"maxStrokeWidth",void 0),O([C.Property(.7)],H.prototype,"velocity",void 0),O([C.Property("en-US")],H.prototype,"locale",void 0),O([C.Property(!1)],H.prototype,"enableRtl",void 0),O([C.Property(!1)],H.prototype,"enablePersistence",void 0),O([C.Event()],H.prototype,"beforeSave",void 0),O([C.Event()],H.prototype,"change",void 0),O([C.Event()],H.prototype,"created",void 0),O([C.NotifyPropertyChanges],H));function H(t,e){return N.call(this,t,e)||this}Nn=function(t,e){return(Nn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Nn,Hn,Bn=function(t,e){function i(){this.constructor=t}Nn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},B=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},Un="e-rating-icon e-icons e-star-filled",Rn="e-rating-item-list",In="e-rating-item-container",Vn="e-rating-selected",Fn="e-rating-intermediate",Mn="e-rating-hidden",Dn="e-disabled",zn="e-rating-readonly",Wn="e-rating-animation",qn="e-rating-full",jn="e-rating-empty",_n="e-selected-value",Xn=((Xn=o.LabelPosition||(o.LabelPosition={})).Top="Top",Xn.Bottom="Bottom",Xn.Left="Left",Xn.Right="Right",(Xn=o.PrecisionType||(o.PrecisionType={})).Full="Full",Xn.Half="Half",Xn.Quarter="Quarter",Xn.Exact="Exact",Hn=C.Component,Bn(U,Hn),U.prototype.preRender=function(){this.element.id||(this.element.id=C.getUniqueID("e-"+this.getModuleName())),this.keyConfigs={downarrow:"downarrow",leftarrow:"leftarrow",rightarrow:"rightarrow",uparrow:"uparrow",space:"space"},this.tooltipOpen=!1,this.isTouchSelected=!1},U.prototype.render=function(){this.initialize(),this.updateMinValue(),this.updateTemplateFunction(),this.triggerChange(null,this.value,!1),this.renderItems(),this.displayLabel()},U.prototype.initialize=function(){this.wrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-container "}),this.element.parentNode.insertBefore(this.wrapper,this.element),this.wrapper.appendChild(this.element),null==this.element.getAttribute("name")&&this.element.setAttribute("name",this.element.id),C.attributes(this.element,{"aria-label":"rating"}),this.renderItemList(),this.updateReset(),this.readOnly&&this.wrapper.classList.add(zn),this.visible||this.wrapper.classList.add(Mn),this.enableRtl&&this.wrapper.classList.add("e-rtl"),this.enableAnimation&&this.wrapper.classList.add(Wn),this.cssClass&&C.addClass([this.wrapper],this.cssClass.split(" ")),this.updateTooltip(),this.wireKeyboardEvent(),this.updateDisabled()},U.prototype.updateDisabled=function(){this.wrapper.classList[this.disabled?"add":"remove"](Dn),C.attributes(this.ratingItemList,{tabindex:this.disabled?"-1":"0"}),this.updateResetButton()},U.prototype.updateResetButton=function(){var t;this.allowReset&&(t=this.value<=this.min||this.disabled,this.resetElement.classList[t?"add":"remove"](Dn),C.attributes(this.resetElement,{tabindex:t?"-1":"0","aria-hidden":t.toString()}))},U.prototype.renderItemList=function(){var e=this;this.ratingItemList=this.createElement("div",{className:Rn,id:this.element.id+"_item-list"}),C.attributes(this.ratingItemList,{"aria-label":"rating",role:"slider"}),this.wrapper.appendChild(this.ratingItemList),C.EventHandler.add(this.ratingItemList,"touchmove",function(t){return e.touchMoveHandler(t)},this),C.EventHandler.add(this.ratingItemList,C.Browser.touchEndEvent,this.touchEndHandler,this)},U.prototype.touchMoveHandler=function(t){this.isTouchSelected||(this.wrapper.classList.add("e-rating-touch"),this.isTouchSelected=!0),this.wrapper.classList.add("e-touch-select");var e,i=this.ratingItemList.getBoundingClientRect(),i=(t.touches[0].clientX-i.x)/i.width*this.itemsCount,s=(i=(i=this.enableRtl?this.itemsCount-i:i)<this.min?this.min:i>this.itemsCount?this.itemsCount:i,0===(i=this.validateValue(i))?null:this.itemElements[parseInt((Math.ceil(i)-1).toString(),10)]);i===this.currentValue?this.showTooltip&&s&&this.openRatingTooltip(s,!1):(e=this.currentValue,this.triggerChange(t,i),this.updateCurrentValue(i),this.showTooltip&&(s?(Math.ceil(i)!==Math.ceil(e)&&this.closeRatingTooltip(),this.openRatingTooltip(s,!0)):this.closeRatingTooltip()))},U.prototype.touchEndHandler=function(){this.closeRatingTooltip(),this.wrapper.classList.remove("e-touch-select")},U.prototype.updateTemplateFunction=function(){this.emptyTemplateFunction=this.emptyTemplate?this.getTemplateString(this.emptyTemplate):null,this.fullTemplateFunction=this.fullTemplate?this.getTemplateString(this.fullTemplate):null},U.prototype.renderItems=function(){for(var e=this,t=0;t<this.itemsCount;t++){var i=this.createElement("span",{className:In}),s=this.createElement("span",{className:"e-rating-item"}),n=this.getRatingValue(this.value,t),n=(this.renderItemContent(s,n,t,!1),i.appendChild(s),this.wireItemsEvents(i,t+1),this.itemElements.push(i),{element:i,value:t+1});this.trigger("beforeItemRender",n,function(t){e.ratingItemList.appendChild(t.element)})}C.attributes(this.ratingItemList,{"aria-valuemax":this.itemsCount.toString()}),this.updateItemValue(!1)},U.prototype.renderItemContent=function(t,e,i,s){s&&this.removeItemContent(t),this.fullTemplate&&1===e?(t.classList.add(qn),C.append(this.fullTemplateFunction({index:i,ratingValue:e},this,"ratingFullTemplate",this.element.id+"fullTemplate",this.isStringTemplate),t)):this.emptyTemplate?(t.classList.add(jn),C.append(this.emptyTemplateFunction({index:i,ratingValue:e},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate",this.isStringTemplate),t)):C.addClass([t],Un.split(" "))},U.prototype.removeItemContent=function(t){t.classList.remove(qn,jn),C.removeClass([t],Un.split(" ")),t.firstChild&&(t.innerHTML="")},U.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipObj=new h.Tooltip({target:".e-rating-item-container",windowCollision:!0,opensOn:"Custom",cssClass:this.cssClass?"e-rating-tooltip "+this.cssClass:"e-rating-tooltip"}),this.tooltipObj.appendTo(this.ratingItemList)):C.isNullOrUndefined(this.tooltipObj)||(this.tooltipObj.destroy(),this.tooltipObj=null)},U.prototype.updateMinValue=function(){this.setProperties({min:this.validateValue(this.min)},!0),0<this.min&&this.value<this.min&&this.triggerChange(null,this.min,!1),C.attributes(this.ratingItemList,{"aria-valuemin":this.min.toString()})},U.prototype.validateValue=function(t){return t=t>this.itemsCount?this.itemsCount:t<0?0:this.precision===o.PrecisionType.Full||this.enableSingleSelection?Math.round(t):this.precision===o.PrecisionType.Half?Math.round(2*t)/2:this.precision===o.PrecisionType.Quarter?Math.round(4*t)/4:Math.round(10*t)/10},U.prototype.getRatingValue=function(t,e){return this.enableSingleSelection?e<t&&t<=e+1?1:0:e+1<=t?1:t<e?0:t-e},U.prototype.updateItemValue=function(t){(t=void 0===t?!0:t)&&this.isReact&&this.clearTemplate(["ratingEmptyTemplate","ratingFullTemplate"]);for(var e=0;e<this.itemsCount;e++){var i=this.itemElements[parseInt(e.toString(),10)],s=(i.classList.remove(Vn,Fn,_n),this.getRatingValue(this.currentValue,e));1===s?i.classList.add(Vn):0<s?i.classList.add(Fn):this.precision===o.PrecisionType.Full&&e+1<=this.value&&!this.enableSingleSelection&&i.classList.add(_n),t&&this.updateItemContent(s,e),i.style.setProperty("--rating-value",100*s+"%"),i.classList[0===this.value&&0===e||this.value===e+1||0<s&&s<1?"add":"remove"]("e-rating-focus")}t&&this.renderReactTemplates(),this.updateResetButton(),C.attributes(this.ratingItemList,{"aria-valuenow":this.currentValue.toString()}),C.attributes(this.element,{value:this.value.toString()})},U.prototype.updateItemContent=function(t,e){var i;(this.fullTemplate||this.emptyTemplate)&&(i=this.itemElements[parseInt(e.toString(),10)].querySelector(".e-rating-item"),this.fullTemplate&&1===t?!this.isReact&&i.classList.contains(qn)||(this.removeItemContent(i),i.classList.add(qn),C.append(this.fullTemplateFunction({ratingValue:t,index:e},this,"ratingFullTemplate",this.element.id+"fullTemplate"+e,this.isStringTemplate),i)):this.emptyTemplate?!this.isReact&&i.classList.contains(jn)||(this.removeItemContent(i),i.classList.add(jn),C.append(this.emptyTemplateFunction({ratingValue:t,index:e},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate"+e,this.isStringTemplate),i)):(this.removeItemContent(i),C.addClass([i],Un.split(" "))))},U.prototype.updateTooltipContent=function(t){var e,i,s=this;this.showTooltip&&(this.isReact&&this.clearTemplate(["ratingTooltipTemplate"]),this.tooltipTemplate?(e=this.createElement("span",{className:"e-rating-tooltip-content"}),i=this.getTemplateString(this.tooltipTemplate),C.append(i({value:this.currentValue},this,"ratingTooltipTemplate",this.element.id+"tooltipTemplate",this.isStringTemplate),e),this.tooltipObj.setProperties({content:e},t),this.isAngular&&setTimeout(function(){var t=s.ratingItemList.querySelectorAll("."+In+"."+Vn);s.tooltipObj.refresh(t[t.length-1])})):(e=this.currentValue.toString(),this.tooltipObj.setProperties({content:C.initializeCSPTemplate(function(){return e})},t)),this.renderReactTemplates())},U.prototype.getTemplateString=function(e){var t,i="";try{i="function"!=typeof e&&(t=C.select(e))?"SCRIPT"===t.tagName?t.innerHTML:t.outerHTML:e}catch(t){i=e}return C.compile(i)},U.prototype.displayLabel=function(){this.showLabel?(this.spanLabel=this.createElement("span",{className:"e-rating-label"}),this.updateLabel(),this.updateLabelPosition()):this.wrapper.contains(this.spanLabel)&&(C.remove(this.spanLabel),this.spanLabel=null)},U.prototype.updateLabel=function(){var t;this.showLabel&&(this.labelTemplate?(this.isReact&&this.clearTemplate(["ratingLabelTemplate"]),this.spanLabel.firstChild&&(this.spanLabel.innerHTML=""),t=this.getTemplateString(this.labelTemplate),C.append(t({value:this.currentValue},this,"ratingLabelTemplate",this.element.id+"labelTemplate",this.isStringTemplate),this.spanLabel),this.renderReactTemplates()):this.spanLabel.textContent=this.currentValue+" / "+this.itemsCount)},U.prototype.updateReset=function(){this.allowReset?(this.resetElement=this.createElement("span",{className:"e-icons e-reset",attrs:{"aria-label":"resetbutton",role:"button"}}),this.updateResetButton(),C.EventHandler.add(this.resetElement,"click",this.resetClicked,this),this.wrapper.insertBefore(this.resetElement,this.ratingItemList)):this.wrapper.contains(this.resetElement)&&(C.remove(this.resetElement),this.resetElement=null)},U.prototype.updateLabelPosition=function(){this.clearLabelPosition(),this.spanLabel.classList.add("e-label-"+this.labelPosition.toLowerCase()),"Left"===this.labelPosition||"Top"===this.labelPosition?this.wrapper.firstChild.after(this.spanLabel):this.wrapper.appendChild(this.spanLabel)},U.prototype.clearLabelPosition=function(){var t=this.spanLabel.classList.value.match(/(e-label-[top|bottom|right|left]+)/g);t&&C.removeClass([this.spanLabel],t)},U.prototype.wireItemsEvents=function(t,e){var i=this;C.EventHandler.add(t,"click",function(t){return i.clickHandler(t)},this),C.EventHandler.add(t,"mousemove",function(t){return i.mouseMoveHandler(e,t)},this),C.EventHandler.add(t,"mouseleave",this.mouseLeaveHandler,this)},U.prototype.clickHandler=function(t){this.currentValue=0<this.min&&this.currentValue<this.min?this.min:this.currentValue,this.triggerChange(t,this.currentValue),this.updateItemValue(),this.updateLabel(),this.updateResetButton()},U.prototype.updateValueChange=function(t,e,i){this.triggerChange(t,e,i=void 0===i?!0:i),this.updateItemValue(),this.updateLabel()},U.prototype.triggerChange=function(t,e,i){void 0===i&&(i=!0),e=this.validateValue(e),this.currentValue=e,this.currentValue!==this.value&&(t={event:t,isInteracted:i,value:e,previousValue:this.value},this.setProperties({value:e},!0),this.trigger("valueChanged",t))},U.prototype.mouseMoveHandler=function(t,e){this.isTouchSelected&&(this.wrapper.classList.remove("e-rating-touch"),this.isTouchSelected=!1);var i=this.calculateCurrentValue(t,e),i=this.validateValue(i),t=this.itemElements[parseInt((t-1).toString(),10)];i===this.currentValue?this.openRatingTooltip(t,!1):(this.updateCurrentValue(i),this.openRatingTooltip(t,!0),this.trigger("onItemHover",{element:t,event:e,value:i}))},U.prototype.openRatingTooltip=function(t,e){this.showTooltip&&(this.tooltipOpen?e&&(this.updateTooltipContent(!0),this.tooltipObj.refresh(t)):(this.updateTooltipContent(!1),this.tooltipObj.open(t),this.tooltipOpen=!0))},U.prototype.closeRatingTooltip=function(){this.tooltipOpen&&(this.tooltipObj.close(),this.tooltipOpen=!1)},U.prototype.updateCurrentValue=function(t){this.currentValue=t,this.updateItemValue(),this.updateLabel()},U.prototype.mouseLeaveHandler=function(){this.closeRatingTooltip(),this.updateCurrentValue(this.value)},U.prototype.calculateCurrentValue=function(t,e){var i=t;return this.enableSingleSelection||this.precision===o.PrecisionType.Full||(i=e.offsetX/this.itemElements[t-1].clientWidth,i=this.enableRtl?1-i:i,this.precision===o.PrecisionType.Quarter?i=i<=.25?.25:i<=.5?.5:i<.75?.75:1:this.precision===o.PrecisionType.Half&&(i=i<=.5?.5:1),i=i+t-1),i},U.prototype.reset=function(){this.resetClicked(null,!1)},U.prototype.resetClicked=function(t,e){this.updateValueChange(t,this.min,e=void 0===e?!0:e),this.updateResetButton()},U.prototype.wireKeyboardEvent=function(){this.keyboardModuleRating=new C.KeyboardEvents(this.wrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},U.prototype.keyActionHandler=function(t){if(t.preventDefault(),!this.disabled&&!this.readOnly){if(t.target.classList.contains(Rn))switch(t.action){case"uparrow":this.handleNavigation(t,!0);break;case"downarrow":this.handleNavigation(t,!1);break;case"leftarrow":this.handleNavigation(t,this.enableRtl);break;case"rightarrow":this.handleNavigation(t,!this.enableRtl)}this.allowReset&&t.target.classList.contains("e-reset")&&"space"===t.action&&this.resetClicked(t)}},U.prototype.handleNavigation=function(t,e){var i;(!e&&this.value>this.min||e&&this.value<this.itemsCount)&&(i=this.precision===o.PrecisionType.Full||this.enableSingleSelection?1:this.precision===o.PrecisionType.Half?.5:this.precision===o.PrecisionType.Quarter?.25:Math.round(1)/10,i=e?this.value+i:this.value-i,this.updateValueChange(t,i),this.updateResetButton())},U.prototype.updateContent=function(){this.isReact&&this.clearTemplate(["ratingEmptyTemplate","ratingFullTemplate"]);for(var t=0;t<this.itemsCount;t++){var e=this.itemElements[parseInt(t.toString(),10)].firstElementChild;this.renderItemContent(e,this.getRatingValue(this.value,t),t,!0)}},U.prototype.getModuleName=function(){return"rating"},U.prototype.getPersistData=function(){return this.addOnPersist([])},U.prototype.removeItemElements=function(){for(var t=0;t<this.itemElements.length;t++)C.remove(this.itemElements[parseInt(t.toString(),10)]);this.itemElements=[]},U.prototype.destroy=function(){var e=this;Hn.prototype.destroy.call(this),this.removeItemElements(),this.clearTemplate(),this.spanLabel&&(C.remove(this.spanLabel),this.spanLabel=null),this.resetElement&&(C.remove(this.resetElement),this.resetElement=null),this.showTooltip&&(this.tooltipObj.destroy(),this.tooltipObj=null),C.remove(this.ratingItemList),this.ratingItemList=null,this.wrapper.parentNode.insertBefore(this.element,this.wrapper),C.remove(this.wrapper),this.wrapper=null,this.keyboardModuleRating.destroy(),this.keyboardModuleRating=null,["value","aria-label","name"].forEach(function(t){e.element.removeAttribute(t)})},B([C.Property(!(U.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"value":this.updateValueChange(null,this.value>this.min?this.value:this.min,!1);break;case"min":this.updateMinValue(),this.updateItemValue(),this.updateLabel();break;case"showLabel":this.displayLabel();break;case"visible":this.wrapper.classList[this.visible?"remove":"add"](Mn);break;case"disabled":this.updateDisabled();break;case"readOnly":this.wrapper.classList[this.readOnly?"add":"remove"](zn);break;case"allowReset":this.updateReset();break;case"enableRtl":this.wrapper.classList[this.enableRtl?"add":"remove"]("e-rtl");break;case"cssClass":e.cssClass&&C.removeClass([this.wrapper],e.cssClass.split(" ")),t.cssClass&&C.addClass([this.wrapper],t.cssClass.split(" ")),this.tooltipObj&&this.tooltipObj.setProperties({cssClass:this.cssClass?"e-rating-tooltip "+this.cssClass:"e-rating-tooltip"});break;case"labelPosition":this.updateLabelPosition();break;case"showTooltip":this.updateTooltip();break;case"precision":this.updateMinValue(),this.triggerChange(null,this.value,!1),this.updateItemValue(),this.updateLabel();break;case"enableSingleSelection":this.updateValueChange(null,this.currentValue,!1);break;case"enableAnimation":this.wrapper.classList[this.enableAnimation?"add":"remove"](Wn);break;case"emptyTemplate":case"fullTemplate":this.updateTemplateFunction(),this.updateContent();break;case"labelTemplate":this.updateLabel();break;case"itemsCount":this.removeItemElements(),this.renderItems(),this.updateLabel()}}))],U.prototype,"allowReset",void 0),B([C.Property("")],U.prototype,"cssClass",void 0),B([C.Property(!1)],U.prototype,"disabled",void 0),B([C.Property("")],U.prototype,"emptyTemplate",void 0),B([C.Property(!0)],U.prototype,"enableAnimation",void 0),B([C.Property(!1)],U.prototype,"enableSingleSelection",void 0),B([C.Property("")],U.prototype,"fullTemplate",void 0),B([C.Property(5)],U.prototype,"itemsCount",void 0),B([C.Property(o.LabelPosition.Right)],U.prototype,"labelPosition",void 0),B([C.Property("")],U.prototype,"labelTemplate",void 0),B([C.Property(0)],U.prototype,"min",void 0),B([C.Property(o.PrecisionType.Full)],U.prototype,"precision",void 0),B([C.Property(!1)],U.prototype,"readOnly",void 0),B([C.Property(!1)],U.prototype,"showLabel",void 0),B([C.Property(!0)],U.prototype,"showTooltip",void 0),B([C.Property("")],U.prototype,"tooltipTemplate",void 0),B([C.Property(0)],U.prototype,"value",void 0),B([C.Property(!0)],U.prototype,"visible",void 0),B([C.Event()],U.prototype,"beforeItemRender",void 0),B([C.Event()],U.prototype,"created",void 0),B([C.Event()],U.prototype,"onItemHover",void 0),B([C.Event()],U.prototype,"valueChanged",void 0),B([C.NotifyPropertyChanges],U));function U(t,e){t=Hn.call(this,t,e)||this;return t.itemElements=[],t}Kn=function(t,e){return(Kn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Kn,Yn,Bn=function(t,e){function i(){this.constructor=t}Kn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},B=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(a<3?n(l):3<a?n(e,i,l):n(e,i))||l);return 3<a&&l&&Object.defineProperty(e,i,l),l},Zn=((Zn=o.OtpInputType||(o.OtpInputType={})).Number="number",Zn.Text="text",Zn.Password="password",(Zn=o.OtpInputStyle||(o.OtpInputStyle={})).Outlined="outlined",Zn.Underlined="underlined",Zn.Filled="filled",(Zn=o.TextTransform||(o.TextTransform={})).None="none",Zn.Uppercase="uppercase",Zn.Lowercase="lowercase",Yn=C.Component,Bn(R,Yn),R.prototype.preRender=function(){this.element.id||(this.element.id=C.getUniqueID("e-"+this.getModuleName()))},R.prototype.render=function(){this.initialize()},R.prototype.initialize=function(){C.attributes(this.element,{role:"group"}),this.renderInputs(),this.renderSeparator(1,this.inputs.length),this.addPlaceHolder(),this.updateCssClass(this.cssClass),this.updateVariantClass(),this.updateAriaLabel(this.ariaLabels),this.setElementAttributes(this.htmlAttributes,this.element),this.enableRtl&&this.element.classList.add("e-rtl"),this.previousValue=this.value.toString(),this.autoFocus&&this.focusIn()},R.prototype.renderInputs=function(){this.hiddenInputEle=this.createElement("input",{id:"otpInput_hidden",attrs:{name:this.element.id,type:"hidden",value:"number"===this.type?this.value.toString().replace(/\D/g,""):this.value.toString(),autoComplete:"off"}}),this.element.appendChild(this.hiddenInputEle);for(var t=0;t<this.length;t++)this.createOtpInput(t)},R.prototype.createOtpInput=function(t){var e=this.getDefaultValue(),i="",e=(e&&(e=e[parseInt(t.toString(),10)],"number"===this.type?isNaN(Number(e))||(i=e):i=e||""),this.createElement("input",{id:this.element.id+"-"+(t+1),className:"e-otp-input-field e-input",attrs:{maxlength:"1",type:this.type,inputmode:this.htmlAttributes.inputmode||("number"===this.type?"numeric":"text")}}));this.disabled&&e.setAttribute("disabled","disabled"),this.element.appendChild(e),this.inputs.push(e),i&&(e.value=i),this.wireEvents(e,t)},R.prototype.renderSeparator=function(t,e){if(0<this.separator.length)for(var i=t;i<e;i++){var s=this.createElement("span",{className:"e-otp-separator"});s.textContent=this.separator,this.separatorElements.push(s),this.element.insertBefore(s,this.inputs[parseInt(i.toString(),10)])}},R.prototype.updateSeparatorValue=function(){var e=this;""===this.separator?(this.separatorElements.forEach(function(t){return C.remove(t)}),this.separatorElements=[]):this.separatorElements.forEach(function(t){t.textContent=e.separator})},R.prototype.addPlaceHolder=function(){for(var t=0;t<this.inputs.length;t++){var e=this.placeholder.length<=1?this.placeholder:this.placeholder.charAt(t);this.setElementAttributes({placeholder:e},this.inputs[parseInt(t.toString(),10)])}},R.prototype.updateInputType=function(e){var i=this.htmlAttributes.inputmode||("number"===e?"numeric":"text");this.inputs.forEach(function(t){t.type=e,t.setAttribute("inputmode",i)})},R.prototype.getDefaultValue=function(){var t="number"==typeof this.value?this.value.toString():this.value,t=(t=this.textTransform?this.getTransformedText(t):t).replace(/\s/g,"");return 0<t.length?t.split(""):void 0},R.prototype.getTransformedText=function(t){return this.textTransform.toLowerCase()===o.TextTransform.Lowercase?t.toLowerCase():this.textTransform.toLowerCase()===o.TextTransform.Uppercase?t.toUpperCase():t},R.prototype.handleInputChange=function(t,e){var i=this.inputs[parseInt(t.toString(),10)],i=(i&&t<this.length-1&&0<i.value.length&&(i=this.inputs[parseInt(t.toString(),10)+1],this.shouldFireFocus=this.shouldFireBlur=!1,i.focus(),i)&&0<i.value.length&&i.select(),e.target);1<i.value.length&&(i.value=i.value.slice(0,1)),this.textTransform&&(i.value=this.getTransformedText(i.value)),this.triggerInputEvent(t,e),this.triggerValuechanged(e,!0)},R.prototype.handleKeyAction=function(t,e){1<e.key.length&&!(0===t&&"Backspace"===e.key||t===this.length-1&&"Delete"===e.key)&&(this.shouldFireFocus=this.shouldFireBlur=!1);var i,s=this.inputs[parseInt(t.toString(),10)],n=this.inputs[parseInt(t.toString(),10)-1],a=this.inputs[parseInt(t.toString(),10)+1];"Delete"===e.key?(i="",0<s.value.length?(i=s.value,s.value=""):t!==this.inputs.length-1&&(i=a.value,a.value="",a.focus()),0<i.length&&this.triggerInputEvent(t,e)):"Backspace"===e.key?0!==t&&0===s.value.length&&(i=n.value,n.value="",n.focus(),0<i.length)&&this.triggerInputEvent(t,e):"ArrowLeft"===e.key||"ArrowRight"===e.key?("ArrowLeft"===e.key&&0<t?(n.focus(),n.select()):"ArrowRight"===e.key&&t<this.inputs.length-1&&(a.focus(),a.select()),e.preventDefault()):"ArrowUp"===e.key||"ArrowDown"===e.key?e.preventDefault():"Tab"===e.key||e.shiftKey||e.ctrlKey||"number"===this.type&&/\D/.test(e.key.toLocaleLowerCase())&&e.preventDefault()},R.prototype.handleSelection=function(t){t=this.inputs[parseInt(t.toString(),10)];t.value&&t.select()},R.prototype.handleFocus=function(t,e){C.addClass([this.inputs[parseInt(t.toString(),10)]],"e-otp-input-focus"),this.shouldFireFocus&&(e={element:this.element,event:e,index:t,isInteracted:!this.isFocusInCalled,value:this.value},this.trigger("focus",e)),this.shouldFireFocus=!0},R.prototype.handleBlur=function(t,e){C.removeClass([this.inputs[parseInt(t.toString(),10)]],"e-otp-input-focus"),this.shouldFireBlur&&(e={element:this.element,event:e,value:this.value,index:t,isInteracted:!this.isFocusOutCalled},this.trigger("blur",e)),this.shouldFireBlur=!0},R.prototype.handlePaste=function(t,e){var i=e.clipboardData;if(i){for(var s=i.getData("text").split(""),n=0,a=t;a<this.inputs.length;a++)0<s.length&&s[parseInt(n.toString(),10)]&&(this.inputs[parseInt(a.toString(),10)].value=s[parseInt(n.toString(),10)],n++,this.updateValueProperty());this.focusIn(),this.triggerValuechanged(e,!0)}},R.prototype.triggerInputEvent=function(t,e){var i=this.value.toString(),e=(this.updateValueProperty(),{element:this.element,event:e,previousValue:i,value:this.value.toString(),index:t});this.trigger("input",e)},R.prototype.triggerValuechanged=function(t,e){this.length===this.value.toString().length&&this.previousValue!==this.value&&(t={element:this.element,event:t,isInteracted:e||!1,previousValue:this.previousValue,value:this.value},this.trigger("valueChanged",t),this.previousValue=this.value.toString())},R.prototype.wireEvents=function(t,e){C.EventHandler.add(t,"focus",this.handleFocus.bind(this,e),this),C.EventHandler.add(t,"blur",this.handleBlur.bind(this,e),this),C.EventHandler.add(t,"input",this.handleInputChange.bind(this,e),this),C.EventHandler.add(t,"keydown",this.handleKeyAction.bind(this,e),this),C.EventHandler.add(t,"click",this.handleSelection.bind(this,e),this),C.EventHandler.add(t,"paste",this.handlePaste.bind(this,e),this),C.EventHandler.add(t,"wheel",this.handleWheelEvent,this)},R.prototype.unWireEvents=function(){for(var t=0;t<this.inputs.length;t++){var e=this.inputs[parseInt(t.toString(),10)];C.EventHandler.remove(e,"focus",this.handleFocus.bind(this,t)),C.EventHandler.remove(e,"blur",this.handleBlur.bind(this,t)),C.EventHandler.remove(e,"input",this.handleInputChange.bind(this,t)),C.EventHandler.remove(e,"keydown",this.handleKeyAction.bind(this,t)),C.EventHandler.remove(e,"click",this.handleSelection.bind(this,t)),C.EventHandler.remove(e,"paste",this.handlePaste.bind(this,t)),C.EventHandler.remove(e,"wheel",this.handleWheelEvent)}},R.prototype.updateValueProperty=function(){var e="",t=(this.inputs.forEach(function(t){e+=t.value}),this.isProtectedOnChange);this.isProtectedOnChange=!0,this.value="number"==typeof this.value?parseInt(e,10):e,this.isProtectedOnChange=t,this.hiddenInputEle.value=this.value.toString()},R.prototype.updateInputValue=function(t){for(var e=this.value.toString(),i=(this.textTransform&&(e=this.getTransformedText(e)),t.toString()),s=0;s<this.inputs.length;s++)i.charAt(s)!==e.charAt(s)&&(this.inputs[parseInt(s.toString(),10)].value=e.charAt(s),this.hiddenInputEle.value=e);this.focusIn()},R.prototype.updateCssClass=function(t,e){var i;(e=void 0===e?"":e)&&(i=e.trim().split(" "),(e=this.element.classList).remove.apply(e,i)),t&&(i=t.trim().split(" "),(e=this.element.classList).add.apply(e,i))},R.prototype.updateVariantClass=function(){var t="outlined"===this.stylingMode.toLocaleLowerCase()?"outline":this.stylingMode.toLocaleLowerCase(),e=["underlined","filled","outline"];-1!==e.indexOf(t)&&(C.removeClass([this.element],e.map(function(t){return"e-"+t})),C.addClass([this.element],"e-"+t))},R.prototype.updateAriaLabel=function(s){this.inputs.forEach(function(t,e){var i="Enter Otp Character "+(e+1),e=s&&0<s.length&&s[parseInt(e.toString(),10)]||i;t.setAttribute("aria-label",e)})},R.prototype.updateDisabledState=function(){var e=this;this.inputs.forEach(function(t){e.disabled?t.setAttribute("disabled","disabled"):t.removeAttribute("disabled")})},R.prototype.setElementAttributes=function(t,e){if(!C.isNullOrUndefined(t))for(var i in t){var s;"class"===i?(s=t.class.replace(/\s+/g," ").trim())&&C.addClass([e],s.split(" ")):"inputmode"===i?this.setInputMode(t[""+i]):("name"===i&&this.element.id===e.id?this.hiddenInputEle:e).setAttribute(i,t[""+i])}},R.prototype.setInputMode=function(t){for(var e=0;e<this.inputs.length;e++)this.inputs[parseInt(e.toString(),10)].setAttribute("inputmode",t)},R.prototype.handleLengthChange=function(t,e){if(0<t-e){for(var i=e;i<t;i++)this.createOtpInput(i);this.renderSeparator(e,t),this.addPlaceHolder(),this.updateAriaLabel(this.ariaLabels)}else if(0<=t&&0<this.inputs.length){for(i=t;i<this.inputs.length;i++)C.remove(this.inputs[parseInt(i.toString(),10)]);if(this.inputs.splice(t),0<this.separatorElements.length){for(e=0===t?0:t-1,i=e;i<this.separatorElements.length;i++)C.remove(this.separatorElements[parseInt(i.toString(),10)]);this.separatorElements.splice(e)}}},R.prototype.getModuleName=function(){return"otpinput"},R.prototype.getPersistData=function(){return this.addOnPersist([])},R.prototype.destroy=function(){Yn.prototype.destroy.call(this),this.unWireEvents(),this.inputs.forEach(function(t){C.remove(t)}),this.separatorElements.forEach(function(t){C.remove(t)}),C.remove(this.hiddenInputEle),C.removeClass([this.element],["e-underlined","e-filled","e-outline","e-rtl"]),this.cssClass&&C.removeClass([this.element],this.cssClass.trim().split(" ")),this.element.removeAttribute("role"),this.inputs=[],this.separatorElements=[],this.hiddenInputEle=null},R.prototype.focusIn=function(){this.isFocusInCalled=!0;for(var t=this.inputs.length-1,e=0;e<this.inputs.length;e++)if(!(0<this.inputs[parseInt(e.toString(),10)].value.length)){t=e;break}this.inputs[parseInt(t.toString(),10)].focus(),this.isFocusInCalled=!1},R.prototype.focusOut=function(){this.isFocusOutCalled=!0,this.inputs.forEach(function(t){t.blur()}),this.isFocusOutCalled=!1},R.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"textTransform":this.updateInputValue(this.value);break;case"value":this.updateInputValue(e.value),this.triggerValuechanged();break;case"placeholder":this.addPlaceHolder();break;case"disabled":this.updateDisabledState();break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"separator":""===e.separator?this.renderSeparator(1,this.inputs.length):this.updateSeparatorValue();break;case"htmlAttributes":this.setElementAttributes(t.htmlAttributes,this.element);break;case"type":this.updateInputType(t.type);break;case"stylingMode":this.updateVariantClass();break;case"ariaLabels":this.updateAriaLabel(t.ariaLabels);break;case"length":this.handleLengthChange(t.length,e.length);break;case"enableRtl":this.element.classList[this.enableRtl?"add":"remove"]("e-rtl");break;case"autoFocus":this.autoFocus&&this.focusIn()}},B([C.Property(4)],R.prototype,"length",void 0),B([C.Property("")],R.prototype,"value",void 0),B([C.Property(o.OtpInputType.Number)],R.prototype,"type",void 0),B([C.Property("")],R.prototype,"separator",void 0),B([C.Property("")],R.prototype,"placeholder",void 0),B([C.Property(o.OtpInputStyle.Outlined)],R.prototype,"stylingMode",void 0),B([C.Property(!1)],R.prototype,"disabled",void 0),B([C.Property("")],R.prototype,"cssClass",void 0),B([C.Property(!1)],R.prototype,"autoFocus",void 0),B([C.Property(o.TextTransform.None)],R.prototype,"textTransform",void 0),B([C.Property({})],R.prototype,"htmlAttributes",void 0),B([C.Property([])],R.prototype,"ariaLabels",void 0),B([C.Event()],R.prototype,"created",void 0),B([C.Event()],R.prototype,"valueChanged",void 0),B([C.Event()],R.prototype,"focus",void 0),B([C.Event()],R.prototype,"blur",void 0),B([C.Event()],R.prototype,"input",void 0),B([C.NotifyPropertyChanges],R));function R(t,e){t=Yn.call(this,t,e)||this;return t.inputs=[],t.previousValue="",t.separatorElements=[],t.shouldFireFocus=!0,t.shouldFireBlur=!0,t.isFocusInCalled=!1,t.isFocusOutCalled=!1,t.handleWheelEvent=function(t){t.preventDefault()},t}o.AsyncSettings=Ts,o.ButtonsProps=Es,o.ColorPicker=s,o.ColorRangeData=Ne,o.FilesProp=ys,o.FormValidator=Xi,o.LimitData=Ue,o.MaskUndo=Ee,o.MaskedTextBox=xt,o.NumericTextBox=Ht,o.OtpInput=Zn,o.Rating=Xn,o.Signature=O,o.SignatureBase=yn,o.Slider=zi,o.SmartTextArea=En,o.TEXTBOX_FOCUS=M,o.TextArea=P,o.TextBox=S,o.TicksData=Le,o.TooltipData=Ve,o.Uploader=t,o.applyMask=zt,o.bindClearEvent=jt,o.containerAttributes=F,o.createMask=Dt,o.escapeRegExp=Qt,o.getMaskedVal=function(t){return Kt.call(Ce(t),t.element)},o.getVal=function(t){return p.call(Ce(t),t.element)},o.maskInput=function(t){var e=be(t),i=(zt.call(e),p.call(this,this.element));this.prevValue=i,this.value=i,t.mask&&(qt.call(e),Wt.call(e))},o.maskInputBlurHandler=te,o.maskInputDropHandler=se,o.maskInputFocusHandler=Jt,o.maskInputMouseDownHandler=Zt,o.maskInputMouseUpHandler=Gt,o.mobileRemoveFunction=le,o.regex=_i,o.regularExpressions=Mt,o.setElementValue=b,o.setMaskValue=ye,o.strippedValue=p,o.triggerFocus=$t,o.unstrippedValue=Kt,o.unwireEvents=qt,o.wireEvents=Wt,Object.defineProperty(o,"__esModule",{value:!0})});
11
11
  //# sourceMappingURL=ej2-inputs.umd.min.js.map