@syncfusion/ej2-inputs 21.2.9 → 22.1.38
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.
- package/.eslintrc.json +1 -0
- package/CHANGELOG.md +30 -0
- package/dist/ej2-inputs.min.js +2 -2
- package/dist/ej2-inputs.umd.min.js +2 -2
- package/dist/ej2-inputs.umd.min.js.map +1 -1
- package/dist/es6/ej2-inputs.es2015.js +171 -134
- package/dist/es6/ej2-inputs.es2015.js.map +1 -1
- package/dist/es6/ej2-inputs.es5.js +173 -137
- package/dist/es6/ej2-inputs.es5.js.map +1 -1
- package/dist/global/ej2-inputs.min.js +2 -2
- package/dist/global/ej2-inputs.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +9 -9
- package/src/color-picker/color-picker.d.ts +1 -0
- package/src/color-picker/color-picker.js +3 -14
- package/src/form-validator/form-validator.js +21 -3
- package/src/input/input.js +17 -23
- package/src/numerictextbox/numerictextbox.js +6 -2
- package/src/rating/rating-model.d.ts +31 -27
- package/src/rating/rating.d.ts +8 -4
- package/src/rating/rating.js +26 -19
- package/src/slider/slider-model.d.ts +1 -1
- package/src/slider/slider.d.ts +31 -65
- package/src/slider/slider.js +86 -55
- package/src/textbox/textbox.js +3 -5
- package/src/uploader/uploader-model.d.ts +2 -1
- package/src/uploader/uploader.d.ts +4 -2
- package/src/uploader/uploader.js +14 -18
- package/styles/bootstrap-dark.css +23 -3
- package/styles/bootstrap.css +23 -3
- package/styles/bootstrap4.css +23 -4
- package/styles/bootstrap5-dark.css +23 -3
- package/styles/bootstrap5.css +23 -3
- package/styles/color-picker/_layout.scss +49 -5
- package/styles/color-picker/_material3-dark-definition.scss +1 -0
- package/styles/color-picker/_material3-definition.scss +141 -0
- package/styles/color-picker/_theme.scss +6 -1
- package/styles/color-picker/fluent-dark.css +1 -0
- package/styles/color-picker/fluent.css +1 -0
- package/styles/color-picker/icons/_material3-dark.scss +1 -0
- package/styles/color-picker/material3-dark.css +880 -0
- package/styles/color-picker/material3-dark.scss +12 -0
- package/styles/color-picker/material3.css +936 -0
- package/styles/color-picker/material3.scss +12 -0
- package/styles/fabric-dark.css +23 -3
- package/styles/fabric.css +23 -3
- package/styles/fluent-dark.css +24 -3
- package/styles/fluent.css +24 -3
- package/styles/highcontrast-light.css +23 -3
- package/styles/highcontrast.css +23 -3
- package/styles/input/_layout.scss +303 -109
- package/styles/input/_material3-dark-definition.scss +1 -0
- package/styles/input/_material3-definition.scss +548 -0
- package/styles/input/_theme.scss +3 -2
- package/styles/input/bootstrap-dark.css +15 -1
- package/styles/input/bootstrap.css +15 -1
- package/styles/input/bootstrap4.css +15 -1
- package/styles/input/bootstrap5-dark.css +15 -1
- package/styles/input/bootstrap5.css +15 -1
- package/styles/input/fabric-dark.css +15 -1
- package/styles/input/fabric.css +15 -1
- package/styles/input/fluent-dark.css +15 -1
- package/styles/input/fluent.css +15 -1
- package/styles/input/highcontrast-light.css +15 -1
- package/styles/input/highcontrast.css +15 -1
- package/styles/input/icons/_material3-dark.scss +1 -0
- package/styles/input/material-dark.css +121 -66
- package/styles/input/material.css +121 -66
- package/styles/input/material3-dark.css +12384 -0
- package/styles/input/material3-dark.scss +5 -0
- package/styles/input/material3.css +12440 -0
- package/styles/input/material3.scss +5 -0
- package/styles/input/tailwind-dark.css +15 -1
- package/styles/input/tailwind.css +15 -1
- package/styles/maskedtextbox/_material3-dark-definition.scss +1 -0
- package/styles/maskedtextbox/_material3-definition.scss +4 -0
- package/styles/maskedtextbox/material3-dark.css +104 -0
- package/styles/maskedtextbox/material3-dark.scss +5 -0
- package/styles/maskedtextbox/material3.css +160 -0
- package/styles/maskedtextbox/material3.scss +5 -0
- package/styles/material-dark.css +131 -68
- package/styles/material.css +131 -68
- package/styles/material3-dark.css +15146 -0
- package/styles/material3-dark.scss +11 -0
- package/styles/material3.css +15202 -0
- package/styles/material3.scss +11 -0
- package/styles/numerictextbox/_material3-dark-definition.scss +1 -0
- package/styles/numerictextbox/_material3-definition.scss +4 -0
- package/styles/numerictextbox/icons/_material3-dark.scss +1 -0
- package/styles/numerictextbox/material3-dark.css +118 -0
- package/styles/numerictextbox/material3-dark.scss +6 -0
- package/styles/numerictextbox/material3.css +174 -0
- package/styles/numerictextbox/material3.scss +6 -0
- package/styles/rating/_bootstrap-dark-definition.scss +4 -3
- package/styles/rating/_bootstrap-definition.scss +4 -3
- package/styles/rating/_bootstrap4-definition.scss +4 -3
- package/styles/rating/_bootstrap5-definition.scss +4 -0
- package/styles/rating/_fabric-dark-definition.scss +4 -3
- package/styles/rating/_fabric-definition.scss +4 -3
- package/styles/rating/_fluent-definition.scss +4 -0
- package/styles/rating/_fusionnew-definition.scss +4 -3
- package/styles/rating/_highcontrast-definition.scss +4 -3
- package/styles/rating/_highcontrast-light-definition.scss +4 -3
- package/styles/rating/_layout.scss +2 -0
- package/styles/rating/_material-dark-definition.scss +4 -3
- package/styles/rating/_material-definition.scss +4 -3
- package/styles/rating/_material3-dark-definition.scss +1 -0
- package/styles/rating/_material3-definition.scss +47 -0
- package/styles/rating/_tailwind-definition.scss +4 -0
- package/styles/rating/_theme.scss +36 -14
- package/styles/rating/bootstrap-dark.css +8 -2
- package/styles/rating/bootstrap.css +8 -2
- package/styles/rating/bootstrap4.css +8 -3
- package/styles/rating/bootstrap5-dark.css +8 -2
- package/styles/rating/bootstrap5.css +8 -2
- package/styles/rating/fabric-dark.css +8 -2
- package/styles/rating/fabric.css +8 -2
- package/styles/rating/fluent-dark.css +8 -2
- package/styles/rating/fluent.css +8 -2
- package/styles/rating/highcontrast-light.css +8 -2
- package/styles/rating/highcontrast.css +8 -2
- package/styles/rating/material-dark.css +8 -2
- package/styles/rating/material.css +8 -2
- package/styles/rating/material3-dark.css +340 -0
- package/styles/rating/material3-dark.scss +5 -0
- package/styles/rating/material3.css +396 -0
- package/styles/rating/material3.scss +5 -0
- package/styles/rating/tailwind-dark.css +8 -2
- package/styles/rating/tailwind.css +8 -2
- package/styles/signature/_material3-dark-definition.scss +1 -0
- package/styles/signature/_material3-definition.scss +3 -0
- package/styles/signature/material3-dark.css +65 -0
- package/styles/signature/material3-dark.scss +4 -0
- package/styles/signature/material3.css +121 -0
- package/styles/signature/material3.scss +4 -0
- package/styles/slider/_layout.scss +60 -15
- package/styles/slider/_material3-dark-definition.scss +1 -0
- package/styles/slider/_material3-definition.scss +97 -0
- package/styles/slider/_theme.scss +11 -2
- package/styles/slider/material-dark.css +2 -0
- package/styles/slider/material.css +2 -0
- package/styles/slider/material3-dark.css +765 -0
- package/styles/slider/material3-dark.scss +6 -0
- package/styles/slider/material3.css +821 -0
- package/styles/slider/material3.scss +6 -0
- package/styles/tailwind-dark.css +23 -3
- package/styles/tailwind.css +23 -3
- package/styles/textbox/_bootstrap-dark-definition.scss +3 -0
- package/styles/textbox/_bootstrap-definition.scss +3 -0
- package/styles/textbox/_bootstrap4-definition.scss +3 -0
- package/styles/textbox/_bootstrap5-definition.scss +3 -0
- package/styles/textbox/_fabric-dark-definition.scss +3 -0
- package/styles/textbox/_fabric-definition.scss +3 -0
- package/styles/textbox/_fluent-definition.scss +3 -0
- package/styles/textbox/_fusionnew-definition.scss +3 -0
- package/styles/textbox/_highcontrast-definition.scss +3 -0
- package/styles/textbox/_highcontrast-light-definition.scss +3 -0
- package/styles/textbox/_layout.scss +27 -0
- package/styles/textbox/_material-dark-definition.scss +3 -0
- package/styles/textbox/_material-definition.scss +3 -0
- package/styles/textbox/_material3-dark-definition.scss +1 -0
- package/styles/textbox/_material3-definition.scss +4 -0
- package/styles/textbox/_tailwind-definition.scss +3 -0
- package/styles/textbox/material3-dark.css +72 -0
- package/styles/textbox/material3-dark.scss +5 -0
- package/styles/textbox/material3.css +128 -0
- package/styles/textbox/material3.scss +5 -0
- package/styles/uploader/_material3-dark-definition.scss +1 -0
- package/styles/uploader/_material3-definition.scss +215 -0
- package/styles/uploader/icons/_material3-dark.scss +1 -0
- package/styles/uploader/material3-dark.css +861 -0
- package/styles/uploader/material3-dark.scss +7 -0
- package/styles/uploader/material3.css +917 -0
- package/styles/uploader/material3.scss +7 -0
package/dist/ej2-inputs.min.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-inputs.min.js
|
|
3
|
-
* version :
|
|
3
|
+
* version : 22.1.38
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. 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&&"object"==typeof module?module.exports=e(require("SyncfusionBase"),require("SyncfusionPopups"),require("SyncfusionSplitbuttons")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionPopups","SyncfusionSplitbuttons"],e):"object"==typeof exports?exports.SyncfusionInputs=e(require("SyncfusionBase"),require("SyncfusionPopups"),require("SyncfusionSplitbuttons")):t.SyncfusionInputs=e(t.SyncfusionBase,t.SyncfusionPopups,t.SyncfusionSplitbuttons)}(this,function(t,e,i){return function(t){function e(s){if(i[s])return i[s].exports;var n=i[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var i={};return e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,s){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:s})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=20)}([function(e,i){e.exports=t},function(t,e,i){"use strict";i.d(e,"a",function(){return s});var s,n=i(0),a=(i.n(n),{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"});!function(t){function e(t,e){var r=i.i(n.isNullOrUndefined)(e)?n.createElement:e,l={container:null,buttons:[],clearButton:null};if(K=t.floatLabelType,Y=t.bindClearAction,i.i(n.isNullOrUndefined)(t.floatLabelType)||"Never"===t.floatLabelType?(l.container=E(t,a.INPUTGROUP,a.INPUTCUSTOMTAG,"span",r),t.element.parentNode.insertBefore(l.container,t.element),i.i(n.addClass)([t.element],a.INPUT),l.container.appendChild(t.element)):u(t,l,r),s(t),i.i(n.isNullOrUndefined)(t.properties)||i.i(n.isNullOrUndefined)(t.properties.showClearButton)||!t.properties.showClearButton||"TEXTAREA"===t.element.tagName||(A(t.properties.showClearButton,t.element,l,!0,r),l.clearButton.setAttribute("role","button"),l.container.classList.contains(a.FLOATINPUT)&&i.i(n.addClass)([l.container],a.INPUTGROUP)),!i.i(n.isNullOrUndefined)(t.buttons)&&"TEXTAREA"!==t.element.tagName)for(var o=0;o<t.buttons.length;o++)l.buttons.push(_(t.buttons[o],l.container,r));return i.i(n.isNullOrUndefined)(t.element)||"TEXTAREA"!==t.element.tagName||i.i(n.addClass)([l.container],a.TEXTAREA),X(l.container,t.element),l=p(t,l),V(l.container,r),Z=l,l}function s(e){r(e.floatLabelType,e.element),e.element.addEventListener("focus",function(){var i=v(this);(i.classList.contains("e-input-group")||i.classList.contains("e-outline")||i.classList.contains("e-filled"))&&i.classList.add("e-input-focus"),setTimeout(function(){t.calculateWidth(e.element,i)},80)}),e.element.addEventListener("blur",function(){var i=v(this);(i.classList.contains("e-input-group")||i.classList.contains("e-outline")||i.classList.contains("e-filled"))&&i.classList.remove("e-input-focus"),setTimeout(function(){t.calculateWidth(e.element,i)},80)}),e.element.addEventListener("input",function(){r(K,e.element)})}function r(t,e){var s=e.value;""!==s&&!i.i(n.isNullOrUndefined)(s)&&e.parentElement?e.parentElement.classList.add("e-valid-input"):"Always"!==t&&e.parentElement&&e.parentElement.classList.remove("e-valid-input")}function l(){var t=v(this).getElementsByClassName("e-float-text")[0];i.i(n.isNullOrUndefined)(t)||(i.i(n.addClass)([t],a.LABELTOP),t.classList.contains(a.LABELBOTTOM)&&i.i(n.removeClass)([t],a.LABELBOTTOM))}function o(){var t=v(this);if(t.getElementsByTagName("textarea")[0]?""===t.getElementsByTagName("textarea")[0].value:""===t.getElementsByTagName("input")[0].value){var e=t.getElementsByClassName("e-float-text")[0];i.i(n.isNullOrUndefined)(e)||(e.classList.contains(a.LABELTOP)&&i.i(n.removeClass)([e],a.LABELTOP),i.i(n.addClass)([e],a.LABELBOTTOM))}}function h(t){t.addEventListener("focus",l),t.addEventListener("blur",o)}function d(t){t.removeEventListener("focus",l),t.removeEventListener("blur",o)}function u(t,e,s){var r=i.i(n.isNullOrUndefined)(s)?n.createElement:s;"Auto"===t.floatLabelType&&h(t.element),i.i(n.isNullOrUndefined)(e.container)?(e.container=E(t,a.FLOATINPUT,a.FLOATCUSTOMTAG,"div",r),t.element.parentNode&&t.element.parentNode.insertBefore(e.container,t.element)):(i.i(n.isNullOrUndefined)(t.customTag)||e.container.classList.add(a.FLOATCUSTOMTAG),e.container.classList.add(a.FLOATINPUT));var l=r("span",{className:a.FLOATLINE}),o=r("label",{className:a.FLOATTEXT});if(i.i(n.isNullOrUndefined)(t.element.id)||""===t.element.id||(o.id="label_"+t.element.id.replace(/ /g,"_"),i.i(n.attributes)(t.element,{"aria-labelledby":o.id})),i.i(n.isNullOrUndefined)(t.element.placeholder)||""===t.element.placeholder||(o.innerText=S(t.element.placeholder),t.element.removeAttribute("placeholder")),i.i(n.isNullOrUndefined)(t.properties)||i.i(n.isNullOrUndefined)(t.properties.placeholder)||""===t.properties.placeholder||(o.innerText=S(t.properties.placeholder)),o.innerText||e.container.classList.add(a.NOFLOATLABEL),e.container.classList.contains("e-float-icon-left")){var d=e.container.querySelector(".e-input-in-wrap");d.appendChild(t.element),d.appendChild(l),d.appendChild(o)}else e.container.appendChild(t.element),e.container.appendChild(l),e.container.appendChild(o);f(t.element.value,o),"Always"===t.floatLabelType&&(o.classList.contains(a.LABELBOTTOM)&&i.i(n.removeClass)([o],a.LABELBOTTOM),i.i(n.addClass)([o],a.LABELTOP)),"Auto"===t.floatLabelType&&(t.element.addEventListener("input",function(e){f(t.element.value,o,t.element)}),t.element.addEventListener("blur",function(e){f(t.element.value,o)})),i.i(n.isNullOrUndefined)(t.element.getAttribute("id"))||o.setAttribute("for",t.element.getAttribute("id"))}function c(t,e){"Always"===t&&e.classList.contains("e-outline")&&e.classList.add("e-valid-input")}function p(t,e){if(!i.i(n.isNullOrUndefined)(t.properties))for(var s=0,a=Object.keys(t.properties);s<a.length;s++){var r=a[s];switch(r){case"cssClass":T(t.properties.cssClass,[e.container]),c(t.floatLabelType,e.container);break;case"enabled":H(t.properties.enabled,t.element,t.floatLabelType,e.container);break;case"enableRtl":w(t.properties.enableRtl,[e.container]);break;case"placeholder":O(t.properties.placeholder,t.element);break;case"readonly":L(t.properties.readonly,t.element)}}return e}function m(t,e,s){i.i(n.isNullOrUndefined)(e)||(t&&!s?i.i(n.removeClass)([e],a.CLEARICONHIDE):i.i(n.addClass)([e],a.CLEARICONHIDE))}function f(t,e,s){if(void 0===s&&(s=null),t)i.i(n.addClass)([e],a.LABELTOP),e.classList.contains(a.LABELBOTTOM)&&i.i(n.removeClass)([e],a.LABELBOTTOM);else{(null==s||s!==document.activeElement)&&(e.classList.contains(a.LABELTOP)&&i.i(n.removeClass)([e],a.LABELTOP),i.i(n.addClass)([e],a.LABELBOTTOM))}}function v(t){var e=i.i(n.isNullOrUndefined)(t.parentNode)?t:t.parentNode;return e&&e.classList.contains("e-input-in-wrap")&&(e=e.parentNode),e}function g(t,e,s,r){var l=i.i(n.isNullOrUndefined)(r)?n.createElement:r,o=l("span",{className:a.CLEARICON}),h=e.container;if(i.i(n.isNullOrUndefined)(s)){(e.container.classList.contains(a.FLOATINPUT)?e.container.querySelector("."+a.FLOATTEXT):t).insertAdjacentElement("afterend",o)}else h.appendChild(o);return!i.i(n.isNullOrUndefined)(h)&&h.classList.contains(a.FLOATINPUT)&&i.i(n.addClass)([h],a.INPUTGROUP),i.i(n.addClass)([o],a.CLEARICONHIDE),y(t,o,h),o.setAttribute("aria-label","close"),o}function y(t,e,s){i.i(n.isNullOrUndefined)(e)||void 0!==Y&&!Y||e.addEventListener("click",function(s){t.classList.contains(a.DISABLE)||t.readOnly||(s.preventDefault(),t!==document.activeElement&&t.focus(),t.value="",i.i(n.addClass)([e],a.CLEARICONHIDE))}),t.addEventListener("input",function(i){m(t.value,e)}),t.addEventListener("focus",function(i){m(t.value,e,t.readOnly)}),t.addEventListener("blur",function(s){setTimeout(function(){i.i(n.isNullOrUndefined)(e)||(i.i(n.addClass)([e],a.CLEARICONHIDE),e=!i.i(n.isNullOrUndefined)(t)&&t.classList.contains("e-combobox")?null:e)},200)})}function b(){Z=null}function C(t,e){if(v(t).classList.contains(a.FLOATINPUT)&&"Auto"===e){var i=v(t).getElementsByClassName("e-float-text")[0];f(t.value,i,t)}}function E(t,e,s,a,r){var l,o=i.i(n.isNullOrUndefined)(r)?n.createElement:r;return i.i(n.isNullOrUndefined)(t.customTag)?l=o(a,{className:e}):(l=o(t.customTag,{className:e}),l.classList.add(s)),l.classList.add("e-control-wrapper"),l}function S(t){var e="";if(!i.i(n.isNullOrUndefined)(t)&&""!==t){var s=document.createElement("span");s.innerHTML='<input placeholder="'+t+'"/>';e=s.children[0].placeholder}return e}function x(t,e,s,l){if(e.value=t,k(e,e.parentElement),i.i(n.isNullOrUndefined)(s)||"Auto"!==s||C(e,s),!i.i(n.isNullOrUndefined)(l)&&l){var o=v(e);if(!i.i(n.isNullOrUndefined)(o)){var h=o.getElementsByClassName(a.CLEARICON)[0];i.i(n.isNullOrUndefined)(h)||(e.value&&!i.i(n.isNullOrUndefined)(o)&&o.classList.contains("e-input-focus")?i.i(n.removeClass)([h],a.CLEARICONHIDE):i.i(n.addClass)([h],a.CLEARICONHIDE))}}r(s,e)}function T(t,e,s){i.i(n.isNullOrUndefined)(s)||""===s||i.i(n.removeClass)(e,s.split(" ")),i.i(n.isNullOrUndefined)(t)||""===t||i.i(n.addClass)(e,t.split(" "))}function k(t,e,s){var a="multiselect"===s?t:t.clientWidth-parseInt(getComputedStyle(t,null).getPropertyValue("padding-left"),10);i.i(n.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"),(a<e.getElementsByClassName("e-float-text-content")[0].clientWidth||a===e.getElementsByClassName("e-float-text-content")[0].clientWidth)&&e.getElementsByClassName("e-float-text-content")[0].classList.add("e-float-text-overflow"))}function P(t,e){"number"==typeof t?e.style.width=i.i(n.formatUnit)(t):"string"==typeof t&&(e.style.width=t.match(/px|%|em/)?t:i.i(n.formatUnit)(t)),k(e.firstChild,e)}function O(t,e){t=S(t);var s=v(e);s.classList.contains(a.FLOATINPUT)?i.i(n.isNullOrUndefined)(t)||""===t?(s.classList.add(a.NOFLOATLABEL),s.getElementsByClassName("e-float-text-content")[0]?s.getElementsByClassName(a.FLOATTEXT)[0].children[0].textContent="":s.getElementsByClassName(a.FLOATTEXT)[0].textContent=""):(s.getElementsByClassName("e-float-text-content")[0]?s.getElementsByClassName(a.FLOATTEXT)[0].children[0].textContent=t:s.getElementsByClassName(a.FLOATTEXT)[0].textContent=t,s.classList.remove(a.NOFLOATLABEL),e.removeAttribute("placeholder")):i.i(n.isNullOrUndefined)(t)||""===t?e.removeAttribute("placeholder"):i.i(n.attributes)(e,{placeholder:t})}function L(t,e,s){t?i.i(n.attributes)(e,{readonly:""}):e.removeAttribute("readonly"),i.i(n.isNullOrUndefined)(s)||C(e,s)}function w(t,e){t?i.i(n.addClass)(e,a.RTL):i.i(n.removeClass)(e,a.RTL)}function H(t,e,s,r){var l={disabled:"disabled","aria-disabled":"true"},o=!i.i(n.isNullOrUndefined)(r);t?(e.classList.remove(a.DISABLE),N(l,e),o&&i.i(n.removeClass)([r],a.DISABLE)):(e.classList.add(a.DISABLE),B(l,e),o&&i.i(n.addClass)([r],a.DISABLE)),i.i(n.isNullOrUndefined)(s)||C(e,s)}function A(t,e,s,a,r){var l=i.i(n.isNullOrUndefined)(r)?n.createElement:r;t?s.clearButton=g(e,s,a,l):(i.i(n.remove)(s.clearButton),s.clearButton=null)}function N(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],r=v(e);"disabled"===n&&e.classList.remove(a.DISABLE),"disabled"===n&&r.classList.contains(a.INPUTGROUP)&&r.classList.remove(a.DISABLE),"placeholder"===n&&r.classList.contains(a.FLOATINPUT)?r.getElementsByClassName(a.FLOATTEXT)[0].textContent="":e.removeAttribute(n)}}function B(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],r=v(e);"disabled"===n&&e.classList.add(a.DISABLE),"disabled"===n&&r.classList.contains(a.INPUTGROUP)&&r.classList.add(a.DISABLE),"placeholder"===n&&r.classList.contains(a.FLOATINPUT)?r.getElementsByClassName(a.FLOATTEXT)[0].textContent=t[""+n]:e.setAttribute(n,t[""+n])}}function U(t){var e=t.container;if(!i.i(n.isNullOrUndefined)(e)&&e.classList.contains(a.FLOATINPUT)){var s=e.querySelector("textarea")?e.querySelector("textarea"):e.querySelector("input"),r=e.querySelector("."+a.FLOATTEXT).textContent,l=null!==e.querySelector(".e-clear-icon");i.i(n.detach)(e.querySelector("."+a.FLOATLINE)),i.i(n.detach)(e.querySelector("."+a.FLOATTEXT)),i.i(n.classList)(e,[a.INPUTGROUP],[a.FLOATINPUT]),d(s),i.i(n.attributes)(s,{placeholder:r}),s.classList.add(a.INPUT),l||"INPUT"!==s.tagName||s.removeAttribute("required")}}function R(t,e,s,r){var l=i.i(n.isNullOrUndefined)(r)?n.createElement:r,o=i.i(n.closest)(t,"."+a.INPUTGROUP);if(K=e,"Never"!==e){var h=o.tagName;h="DIV"!==h&&"SPAN"!==h?h:null;var d={element:t,floatLabelType:e,customTag:h,properties:{placeholder:s}},p=o.querySelector(".e-clear-icon"),m={container:o};t.classList.remove(a.INPUT),u(d,m,l),V(m.container,l),k(d.element,m.container);var f=o.classList.contains("e-float-icon-left");if(i.i(n.isNullOrUndefined)(p))if(f){var v=o.querySelector(".e-input-in-wrap");p=v.querySelector(".e-input-group-icon")}else p=o.querySelector(".e-input-group-icon");if(i.i(n.isNullOrUndefined)(p))f&&(p=o.querySelector(".e-input-group-icon")),i.i(n.isNullOrUndefined)(p)&&o.classList.remove(a.INPUTGROUP);else{var g=o.querySelector("."+a.FLOATLINE),y=o.querySelector("."+a.FLOATTEXT),b=f?o.querySelector(".e-input-in-wrap"):o;b.insertBefore(t,p),b.insertBefore(g,p),b.insertBefore(y,p)}}c(e,t.parentElement)}function V(t,e){if(t.classList.contains("e-outline")&&t.getElementsByClassName("e-float-text")[0]){var i=e("span",{className:a.FLOATTEXTCONTENT});i.innerHTML=t.getElementsByClassName("e-float-text")[0].innerHTML,t.getElementsByClassName("e-float-text")[0].innerHTML="",t.getElementsByClassName("e-float-text")[0].appendChild(i)}}function F(t,e){for(var i=0;i<e.length;i++)M(t,e[parseInt(i.toString())].container)}function M(t,e,s){var a=[];a.push(s);var r=i.i(n.isNullOrUndefined)(s)?e.querySelectorAll(".e-input-group-icon"):a;if(t&&r.length>0)for(var l=0;l<r.length;l++)r[parseInt(l.toString())].addEventListener("mousedown",D,!1),r[parseInt(l.toString())].addEventListener("mouseup",z,!1);else if(r.length>0)for(var l=0;l<r.length;l++)r[parseInt(l.toString())].removeEventListener("mousedown",D,this),r[parseInt(l.toString())].removeEventListener("mouseup",z,this)}function I(t,e){t.classList.contains("e-disabled")||t.querySelector("input").readOnly||e.classList.add("e-input-btn-ripple")}function D(){for(var t=this,e=this.parentElement;!e.classList.contains("e-input-group");)e=e.parentElement;I(e,t)}function z(){var t=this;setTimeout(function(){t.classList.remove("e-input-btn-ripple")},500)}function q(t,e){var i=e("span",{className:t});return i.classList.add("e-input-group-icon"),i}function W(t,e,i,s,n){var a="string"==typeof e?e.split(","):e;if("append"===t.toLowerCase())for(var r=0,l=a;r<l.length;r++){var o=l[r];_(o,i,n)}else for(var h=0,d=a;h<d.length;h++){var o=d[h];j(o,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")}function j(t,e,s,r){var l=i.i(n.isNullOrUndefined)(r)?n.createElement:r,o=q(t,l);e.classList.add("e-float-icon-left");var h=e.querySelector(".e-input-in-wrap");if(i.i(n.isNullOrUndefined)(h)){h=l("span",{className:"e-input-in-wrap"}),s.parentNode.insertBefore(h,s);var d=e.querySelectorAll(s.tagName+" ~ *");h.appendChild(s);for(var u=0;u<d.length;u++)h.appendChild(d[parseInt(u.toString())])}return h.parentNode.insertBefore(o,h),e.classList.contains(a.INPUTGROUP)||e.classList.add(a.INPUTGROUP),M(!0,e,o),o}function _(t,e,s){var r=i.i(n.isNullOrUndefined)(s)?n.createElement:s,l=q(t,r);return e.classList.contains(a.INPUTGROUP)||e.classList.add(a.INPUTGROUP),(e.classList.contains("e-float-icon-left")?e.querySelector(".e-input-in-wrap"):e).appendChild(l),M(!0,e,l),l}function X(t,e){"hidden"===e.type?t.classList.add("e-hidden"):t.classList.contains("e-hidden")&&t.classList.remove("e-hidden")}var K,Z={container:null,buttons:[],clearButton:null},Y=!0;t.createInput=e,t.bindInitialEvent=s,t.wireFloatingEvents=h,t.wireClearBtnEvents=y,t.destroy=b,t.setValue=x,t.setCssClass=T,t.calculateWidth=k,t.setWidth=P,t.setPlaceholder=O,t.setReadonly=L,t.setEnableRtl=w,t.setEnabled=H,t.setClearButton=A,t.removeAttributes=N,t.addAttributes=B,t.removeFloating=U,t.addFloating=R,t.createSpanElement=V,t.setRipple=F,t.addIcon=W,t.prependSpan=j,t.appendSpan=_,t.validateInputType=X}(s||(s={}))},function(t,i){t.exports=e},function(t,e,i){"use strict";var s=i(21);i.d(e,"a",function(){return s.a}),i.d(e,"b",function(){return s.b}),i.d(e,"c",function(){return s.c}),i.d(e,"d",function(){return s.d}),i.d(e,"e",function(){return s.e}),i.d(e,"f",function(){return s.f}),i.d(e,"g",function(){return s.g}),i.d(e,"h",function(){return s.h}),i.d(e,"i",function(){return s.i}),i.d(e,"j",function(){return s.j}),i.d(e,"k",function(){return s.k}),i.d(e,"l",function(){return s.l}),i.d(e,"m",function(){return s.m}),i.d(e,"n",function(){return s.n}),i.d(e,"o",function(){return s.o}),i.d(e,"p",function(){return s.p}),i.d(e,"q",function(){return s.q}),i.d(e,"r",function(){return s.r}),i.d(e,"s",function(){return s.s}),i.d(e,"t",function(){return s.t}),i.d(e,"u",function(){return s.u}),i.d(e,"v",function(){return s.v})},function(t,e,i){"use strict";var s=i(1);i.d(e,"a",function(){return s.a})},function(t,e,i){"use strict";var s=i(24);i.d(e,"a",function(){return s.a})},function(t,e,i){"use strict";i.d(e,"a",function(){return a});var s=i(0),n=(i.n(s),this&&this.__extends||function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}()),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.minDistance=5,e.previous=0,e.interval=30,e.timeout=null,e.isSignatureEmpty=!0,e.backgroundLoaded=null,e.clearArray=[],e.isBlazor=!1,e.isResponsive=!1,e.signPointsColl=[],e.signRatioPointsColl=[],e}return n(e,t),e.prototype.initialize=function(t,e){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(),i.i(s.isNullOrUndefined)(this.signatureValue)&&this.updateSnapCollection(!0),this.wireEvents(),this.isBlazor||this.trigger("created",null)},e.prototype.wireEvents=function(){!i.i(s.isNullOrUndefined)(this.pointColl)||this.isReadOnly||this.disabled?this.pointColl&&(s.EventHandler.add(this.canvasContext.canvas,"mousemove touchmove",this.mouseMoveHandler,this),s.EventHandler.add(this.canvasContext.canvas,"mouseup touchend",this.mouseUpHandler,this),s.EventHandler.add(document,"mouseup",this.mouseUpHandler,this)):(s.EventHandler.add(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler,this),s.EventHandler.add(this.canvasContext.canvas,"keydown",this.keyboardHandler,this),window.addEventListener("resize",this.resizeHandler.bind(this)))},e.prototype.unwireEvents=function(t){"mouseup"===t||"touchend"===t?(s.EventHandler.remove(this.canvasContext.canvas,"mousemove touchmove",this.mouseMoveHandler),s.EventHandler.remove(this.canvasContext.canvas,"mouseup touchend",this.mouseUpHandler),s.EventHandler.remove(document,"mouseup",this.mouseUpHandler)):(s.EventHandler.remove(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler),s.EventHandler.remove(this.canvasContext.canvas,"keydown",this.keyboardHandler),window.removeEventListener("resize",this.resizeHandler))},e.prototype.setHTMLProperties=function(){150===this.element.height&&300===this.element.width?(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||(this.element.height=this.element.offsetHeight,this.element.width=this.element.offsetWidth),this.canvasContext.scale(1,1),this.canvasContext.fillStyle=this.strokeColor,this.backgroundImage?(this.canvasContext.canvas.style.backgroundImage="url("+this.backgroundImage+")",this.canvasContext.canvas.style.backgroundRepeat="no-repeat"):this.backgroundColor&&(this.canvasContext.canvas.style.backgroundColor=this.backgroundColor)},e.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())},e.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))},e.prototype.mouseUpHandler=function(t){var e={actionName:"strokeUpdate"};"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",e),this.signatureValue=this.snapColl[this.incStep];for(var i=0;i<this.signPointsColl.length;i++)this.signRatioPointsColl.push({x:this.signPointsColl[i].x/this.canvasContext.canvas.width,y:this.signPointsColl[i].y/this.canvasContext.canvas.height});this.signPointsColl=[]},e.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()}},e.prototype.resizeHandler=function(){var t=this;if(this.isResponsive){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)}}},e.prototype.beginStroke=function(t){this.refresh(),this.updateStroke(t)},e.prototype.updateStroke=function(t){var e=this.createPoint(t);this.addPoint(e)},e.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))},e.prototype.delay=function(){this.previous=Date.now(),this.timeout=null,this.updateStroke(this.storedArgs),this.timeout||(this.storedArgs=null)},e.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())},e.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}},e.prototype.addPoint=function(t){var e,i,s=this.pointColl,n=s.length>0&&s[s.length-1],a=!!n&&this.distanceTo(n)<=this.minDistance;n&&n&&a||(s.push(t),s.length>2&&(3===s.length&&s.unshift(s[0]),e=this.calculateCurveControlPoints(s[0],s[1],s[2]).controlPoint2,i=this.calculateCurveControlPoints(s[1],s[2],s[3]).controlPoint1,this.startPoint=s[1],this.controlPoint1=e,this.controlPoint2=i,this.endPoint=s[2],this.startDraw(),s.shift()))},e.prototype.startDraw=function(){var t;t=this.pointVelocityCalc(this.startPoint),t=this.velocity*t+(1-this.velocity)*this.lastVelocity;var e=Math.max(this.maxStrokeWidth/(t+1),this.minStrokeWidth);this.curveDraw(this.lastWidth,e),this.lastVelocity=t,this.lastWidth=e},e.prototype.endDraw=function(){var t=this.pointColl.length>2,e=this.pointColl[0];!t&&e&&this.strokeDraw(e)},e.prototype.curveDraw=function(t,e){var i,s,n,a,r,l,o,h,d,u,c=this.canvasContext,p=e-t,m=this.bezierLengthCalc(),f=2*Math.ceil(m);for(c.beginPath(),s=0;s<f;s++)n=s/f,a=n*n,r=a*n,l=1-n,o=l*l,h=o*l,d=h*this.startPoint.x,d+=3*o*n*this.controlPoint1.x,d+=3*l*a*this.controlPoint2.x,d+=r*this.endPoint.x,u=h*this.startPoint.y,u+=3*o*n*this.controlPoint1.y,u+=3*l*a*this.controlPoint2.y,u+=r*this.endPoint.y,i=Math.min(t+r*p,this.maxStrokeWidth),this.arcDraw(d,u,i);c.closePath(),c.fill(),this.isSignatureEmpty=!1},e.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},e.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)},e.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={x:(t.x+e.x)/2,y:(t.y+e.y)/2},o={x:(e.x+i.x)/2,y:(e.y+i.y)/2},h=Math.sqrt(s*s+n*n),d=Math.sqrt(a*a+r*r),u=l.x-o.x,c=l.y-o.y,p=d/(h+d),m={x:o.x+u*p,y:o.y+c*p},f=e.x-m.x,v=e.y-m.y;return{controlPoint1:this.point(l.x+f,l.y+v,0),controlPoint2:this.point(o.x+f,o.y+v,0)}},e.prototype.bezierLengthCalc=function(){var t,e,i,s,n,a,r,l,o=0;for(t=0;t<=10;t++)e=t/10,i=this.bezierPointCalc(e,this.startPoint.x,this.controlPoint1.x,this.controlPoint2.x,this.endPoint.x),s=this.bezierPointCalc(e,this.startPoint.y,this.controlPoint1.y,this.controlPoint2.y,this.endPoint.y),t>0&&(r=i-n,l=s-a,o+=Math.sqrt(r*r+l*l)),n=i,a=s;return o},e.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},e.prototype.pointVelocityCalc=function(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0},e.prototype.distanceTo=function(t){return Math.sqrt(Math.pow(this.pointX-t.x,2)+Math.pow(this.pointY-t.y,2))},e.prototype.isRead=function(t){t?s.EventHandler.remove(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler):this.disabled||s.EventHandler.add(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler,this)},e.prototype.enableOrDisable=function(t){this.disabled=t,t?(this.canvasContext.canvas.style.filter="opacity(0.5)",this.isRead(!0)):(this.canvasContext.canvas.style.filter="",this.isRead(!1))},e.prototype.updateSnapCollection=function(t){if(i.i(s.isNullOrUndefined)(this.incStep)?(this.incStep=-1,this.incStep++,this.snapColl=[],this.clearArray=[]):this.incStep++,this.incStep<this.snapColl.length&&(this.snapColl.length=this.incStep),this.incStep>0){var e=this.createElement("canvas",{className:"e-"+this.getModuleName()+"-wrapper"}),n=e.getContext("2d");e.width=this.canvasContext.canvas.width,e.height=this.canvasContext.canvas.height,n.drawImage(this.canvasContext.canvas,0,0,e.width,e.height),this.snapColl.push(e.toDataURL())}else this.snapColl.push(this.canvasContext.canvas.toDataURL());t&&this.clearArray.push(this.incStep)},e.prototype.setBackgroundImage=function(t){var e=this,i=new Image;i.crossOrigin="anonymous",i.src=t,i.onload=function(){e.canvasContext.globalCompositeOperation="source-over",e.canvasContext.drawImage(i,0,0,e.element.width,e.element.height),e.updateSnapCollection(),e.saveBackground(!0)},this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height)},e.prototype.setBackgroundColor=function(t){var e=this.canvasContext;e.strokeStyle=t;var i,s;for(i=1;i<=e.canvas.width;i++)for(s=1;s<=e.canvas.height;s++)e.strokeRect(0,0,i,s);this.updateSnapCollection()},e.prototype.loadPersistedSignature=function(){if(!i.i(s.isNullOrUndefined)(this.signatureValue)){var t=this,e=new Image;e.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}},e.prototype.getBlob=function(t){for(var e=t.split(","),i=e[0].match(/:(.*?);/)[1],s=atob(e[1]),n=s.length,a=new Uint8Array(n);n--;)a[n]=s.charCodeAt(n);return new Blob([a],{type:i})},e.prototype.download=function(t,e){var i=URL.createObjectURL(t),s=document.createElement("a");s.href=i,s.target="_parent",s.download=e,(document.body||document.documentElement).appendChild(s),s.click(),s.parentNode.removeChild(s)},e.prototype.refresh=function(){this.pointColl=[],this.lastVelocity=0,this.lastWidth=(this.minStrokeWidth+this.maxStrokeWidth)/2},e.prototype.clear=function(){var t={actionName:"clear"};this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.refresh(),this.signRatioPointsColl=[],this.updateSnapCollection(!0),this.isSignatureEmpty=!0,this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Clear"):this.trigger("change",t)},e.prototype.undo=function(){var t={actionName:"undo"},e=this;if(this.incStep>0){this.incStep--;var i=new Image;i.src=this.snapColl[this.incStep],i.onload=function(){e.canvasContext.clearRect(0,0,e.element.width,e.element.height),e.canvasContext.drawImage(i,0,0,e.element.width,e.element.height)}}this.isClear(),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Undo"):this.trigger("change",t)},e.prototype.redo=function(){var t={actionName:"redo"},e=this;if(this.incStep<this.snapColl.length-1){this.incStep++;var i=new Image;i.src=this.snapColl[this.incStep],i.onload=function(){e.canvasContext.clearRect(0,0,e.element.width,e.element.height),e.canvasContext.drawImage(i,0,0,e.element.width,e.element.height)}}this.isClear(),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Redo"):this.trigger("change",t)},e.prototype.isClear=function(){if(this.clearArray){for(var t=!1,e=0;e<this.clearArray.length;e++)this.clearArray[e]===this.incStep&&(this.isSignatureEmpty=!0,t=!0);t||(this.isSignatureEmpty=!1)}},e.prototype.isEmpty=function(){return this.isSignatureEmpty},e.prototype.canUndo=function(){return this.incStep>0},e.prototype.canRedo=function(){return this.incStep<this.snapColl.length-1},e.prototype.draw=function(t,e,i){var s={actionName:"draw-text"};this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),e=e||"Arial",i=i||30,this.canvasContext.font=i+"px "+e,this.canvasContext.textAlign="center",this.canvasContext.textBaseline="middle",this.canvasContext.fillText(t,this.element.width/2,this.element.height/2),this.updateSnapCollection(),this.isSignatureEmpty=!1,this.trigger("change",s)},e.prototype.load=function(t,e,i){i=i||this.element.height,e=e||this.element.width,this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height);var s=this,n=new Image;n.src=t,"data"!==t.slice(0,4)&&(n.crossOrigin="anonymous"),n.onload=function(){Promise.all([createImageBitmap(n,0,0,e,i)]).then(function(n){var a=document.createElement("canvas");a.width=e,a.height=i,a.getContext("2d").drawImage(n[0],0,0),"data"!==t.slice(0,4)&&(s.canvasContext.globalCompositeOperation="source-over"),s.canvasContext.drawImage(a,0,0,e,i,0,0,s.element.width,s.element.height),s.updateSnapCollection()})},this.isSignatureEmpty=!1},e.prototype.saveBackground=function(t){var e;if(e=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){var i=this,s=new Image;s.crossOrigin="anonymous",s.src=e,s.onload=function(){i.backgroundLoaded=!0,i.canvasContext.globalCompositeOperation="source-over",i.canvasContext.drawImage(s,0,0,i.element.width,i.element.height),i.save(i.fileType,i.fileName)}}},e.prototype.save=function(t,e){if(this.saveWithBackground&&null==this.backgroundLoaded&&(this.backgroundImage||this.backgroundColor))this.backgroundLoaded=!1,this.fileType=t,this.fileName=e,this.saveBackground(!1);else if("Svg"===t)e=e||"Signature",this.toSVG(e);else if("Jpeg"===t)if(e=e||"Signature",!this.saveWithBackground||this.saveWithBackground&&!this.backgroundImage&&!this.backgroundColor)this.toJPEG(e);else{var i=this.canvasContext.canvas.toDataURL("image/jpeg");this.download(this.getBlob(i),e+".jpeg")}else{e=e||"Signature";var i=this.canvasContext.canvas.toDataURL("image/png");this.download(this.getBlob(i),e+".png")}this.saveWithBackground&&this.backgroundLoaded&&this.resetSnap()},e.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--},e.prototype.toJPEG=function(t){var e=this,i=this.snapColl[this.incStep];this.setBackgroundColor("#ffffff");var s=this,n=new Image;n.crossOrigin="anonymous",n.src=i,n.onload=function(){s.canvasContext.globalCompositeOperation="source-over",s.canvasContext.drawImage(n,0,0,s.element.width,s.element.height);var i=s.canvasContext.canvas.toDataURL("image/jpeg");s.download(s.getBlob(i),t+".jpeg"),s.canvasContext.clearRect(0,0,s.canvasContext.canvas.width,s.canvasContext.canvas.height),e.resizeHandler()},this.snapColl.pop(),this.incStep--},e.prototype.toSVG=function(t){var e=this.canvasContext.canvas.toDataURL(),i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("width",this.canvasContext.canvas.width.toString()),i.setAttribute("height",this.canvasContext.canvas.height.toString());var s=document.createElementNS("http://www.w3.org/2000/svg","image");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);var n='<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+'">',a=i.innerHTML,r=n+a+"</svg>",l="data:image/svg+xml;base64,"+btoa(r);return null==t?l:(this.download(this.getBlob(l),t+".svg"),null)},e.prototype.saveAsBlob=function(){return this.getBlob(this.canvasContext.canvas.toDataURL("image/png"))},e.prototype.getSignature=function(t){if("Jpeg"===t){for(var e=this.canvasContext.getImageData(0,0,this.element.width,this.element.height),i=e.data,s=0;s<i.length;s+=4)i[s+3]<255&&(i[s]=255-i[s],i[s+1]=255-i[s+1],i[s+2]=255-i[s+2],i[s+3]=255-i[s+3]);this.canvasContext.putImageData(e,0,0);var n=this.canvasContext.canvas.toDataURL("image/jpeg");return this.resizeHandler(),n}return"Svg"===t?this.toSVG(null):this.canvasContext.canvas.toDataURL("image/png")},e.prototype.getModuleName=function(){return"signature"},e.prototype.getPersistData=function(){return this.signatureValue=this.snapColl[this.incStep],this.addOnPersist(["signatureValue"])},e.prototype.destroy=function(){"image-editor"!==this.getModuleName()&&(this.unwireEvents(null),i.i(s.removeClass)([this.element],"e-"+this.getModuleName()),this.element.removeAttribute("tabindex"),this.pointColl=null),t.prototype.destroy.call(this)},e.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;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)}},e}(s.Component)},function(t,e,i){"use strict";i.d(e,"b",function(){return l}),i.d(e,"c",function(){return o}),i.d(e,"d",function(){return h}),i.d(e,"e",function(){return d}),i.d(e,"a",function(){return c});var s=i(0),n=(i.n(s),i(2)),a=(i.n(n),this&&this.__extends||function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}()),r=this&&this.__decorate||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;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),r([i.i(s.Property)("None")],e.prototype,"placement",void 0),r([i.i(s.Property)(10)],e.prototype,"largeStep",void 0),r([i.i(s.Property)(1)],e.prototype,"smallStep",void 0),r([i.i(s.Property)(!1)],e.prototype,"showSmallTicks",void 0),r([i.i(s.Property)(null)],e.prototype,"format",void 0),e}(s.ChildProperty),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),r([i.i(s.Property)(null)],e.prototype,"color",void 0),r([i.i(s.Property)(null)],e.prototype,"start",void 0),r([i.i(s.Property)(null)],e.prototype,"end",void 0),e}(s.ChildProperty),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),r([i.i(s.Property)(!1)],e.prototype,"enabled",void 0),r([i.i(s.Property)(null)],e.prototype,"minStart",void 0),r([i.i(s.Property)(null)],e.prototype,"minEnd",void 0),r([i.i(s.Property)(null)],e.prototype,"maxStart",void 0),r([i.i(s.Property)(null)],e.prototype,"maxEnd",void 0),r([i.i(s.Property)(!1)],e.prototype,"startHandleFixed",void 0),r([i.i(s.Property)(!1)],e.prototype,"endHandleFixed",void 0),e}(s.ChildProperty),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),r([i.i(s.Property)("")],e.prototype,"cssClass",void 0),r([i.i(s.Property)("Before")],e.prototype,"placement",void 0),r([i.i(s.Property)("Focus")],e.prototype,"showOn",void 0),r([i.i(s.Property)(!1)],e.prototype,"isVisible",void 0),r([i.i(s.Property)(null)],e.prototype,"format",void 0),e}(s.ChildProperty),u={root:"e-slider",rtl:"e-rtl",sliderHiddenInput:"e-slider-input",controlWrapper:"e-control-wrapper",sliderHandle:"e-handle",rangeBar:"e-range",sliderButton:"e-slider-button",firstButton:"e-first-button",secondButton:"e-second-button",scale:"e-scale",tick:"e-tick",large:"e-large",tickValue:"e-tick-value",sliderTooltip:"e-slider-tooltip",sliderHover:"e-slider-hover",sliderFirstHandle:"e-handle-first",sliderSecondHandle:"e-handle-second",sliderDisabled:"e-disabled",sliderContainer:"e-slider-container",horizontalTooltipBefore:"e-slider-horizontal-before",horizontalTooltipAfter:"e-slider-horizontal-after",verticalTooltipBefore:"e-slider-vertical-before",verticalTooltipAfter:"e-slider-vertical-after",materialTooltip:"e-material-tooltip",materialTooltipOpen:"e-material-tooltip-open",materialTooltipActive:"e-tooltip-active",materialSlider:"e-material-slider",sliderTrack:"e-slider-track",sliderHorizantalColor:"e-slider-horizantal-color",sliderVerticalColor:"e-slider-vertical-color",sliderHandleFocused:"e-handle-focused",verticalSlider:"e-vertical",horizontalSlider:"e-horizontal",sliderHandleStart:"e-handle-start",sliderTooltipStart:"e-material-tooltip-start",sliderTabHandle:"e-tab-handle",sliderButtonIcon:"e-button-icon",sliderSmallSize:"e-small-size",sliderTickPosition:"e-tick-pos",sliderFirstTick:"e-first-tick",sliderLastTick:"e-last-tick",sliderButtonClass:"e-slider-btn",sliderTooltipWrapper:"e-tooltip-wrap",sliderTabTrack:"e-tab-track",sliderTabRange:"e-tab-range",sliderActiveHandle:"e-handle-active",sliderMaterialHandle:"e-material-handle",sliderMaterialRange:"e-material-range",sliderMaterialDefault:"e-material-default",materialTooltipShow:"e-material-tooltip-show",materialTooltipHide:"e-material-tooltip-hide",readonly:"e-read-only",limits:"e-limits",limitBarDefault:"e-limit-bar",limitBarFirst:"e-limit-first",limitBarSecond:"e-limit-second",dragHorizontal:"e-drag-horizontal",dragVertical:"e-drag-vertical"},c=function(t){function e(e,i){var s=t.call(this,e,i)||this;return s.horDir="left",s.verDir="bottom",s.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)"},s.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"},s.scaleTransform="transform .4s cubic-bezier(.25, .8, .25, 1)",s.customAriaText=null,s.drag=!0,s.isDragComplete=!1,s.initialTooltip=!0,s}return a(e,t),e.prototype.preRender=function(){var t={incrementTitle:"Increase",decrementTitle:"Decrease"};this.l10n=new s.L10n("slider",t,this.locale),this.isElementFocused=!1,this.tickElementCollection=[],this.tooltipFormatInfo={},this.ticksFormatInfo={},this.initCultureInfo(),this.initCultureFunc(),this.formChecker()},e.prototype.formChecker=function(){var t=i.i(s.closest)(this.element,"form");t?(this.isForm=!0,i.i(s.isNullOrUndefined)(this.formResetValue)||this.setProperties({value:this.formResetValue},!0),this.formResetValue=this.value,"Range"!==this.type||!i.i(s.isNullOrUndefined)(this.formResetValue)&&"object"==typeof this.formResetValue?i.i(s.isNullOrUndefined)(this.formResetValue)&&(this.formResetValue=parseFloat(i.i(s.formatUnit)(this.min))):this.formResetValue=[parseFloat(i.i(s.formatUnit)(this.min)),parseFloat(i.i(s.formatUnit)(this.max))],this.formElement=t):this.isForm=!1},e.prototype.initCultureFunc=function(){this.internationalization=new s.Internationalization(this.locale)},e.prototype.initCultureInfo=function(){this.tooltipFormatInfo.format=i.i(s.isNullOrUndefined)(this.tooltip.format)?null:this.tooltip.format,this.ticksFormatInfo.format=i.i(s.isNullOrUndefined)(this.ticks.format)?null:this.ticks.format},e.prototype.formatString=function(t,e){var i=null,s=null;if(t||0===t){i=this.formatNumber(t);var n=this.numberOfDecimals(t);s=this.internationalization.getNumberFormat(e)(this.makeRoundNumber(t,n))}return{elementVal:i,formatString:s}},e.prototype.formatNumber=function(t){var e=this.numberOfDecimals(t);return this.internationalization.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(t)},e.prototype.numberOfDecimals=function(t){var e=t.toString().split(".")[1];return e&&e.length?e.length:0},e.prototype.makeRoundNumber=function(t,e){var i=e||0;return Number(t.toFixed(i))},e.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))},e.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)},e.prototype.initialize=function(){i.i(s.addClass)([this.element],u.root),this.setCSSClass()},e.prototype.setElementWidth=function(t){i.i(s.isNullOrUndefined)(t)||("number"==typeof t?this.sliderContainer.style.width=i.i(s.formatUnit)(t):"string"==typeof t&&(this.sliderContainer.style.width=t.match(/px|%|em/)?t:i.i(s.formatUnit)(t)))},e.prototype.setCSSClass=function(t){t&&i.i(s.removeClass)([this.element],t.split(" ")),this.cssClass&&i.i(s.addClass)([this.element],this.cssClass.split(" "))},e.prototype.setEnabled=function(){this.enabled?(i.i(s.removeClass)([this.sliderContainer],[u.sliderDisabled]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.remove(u.sliderDisabled),this.wireEvents()):(i.i(s.addClass)([this.sliderContainer],[u.sliderDisabled]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.add(u.sliderDisabled),this.unwireEvents())},e.prototype.getTheme=function(t){return window.getComputedStyle(t,":after").getPropertyValue("content").replace(/['"]+/g,"")},e.prototype.initRender=function(){this.sliderContainer=this.createElement("div",{className:u.sliderContainer+" "+u.controlWrapper}),this.element.parentNode.insertBefore(this.sliderContainer,this.element),this.sliderContainer.appendChild(this.element),this.sliderTrack=this.createElement("div",{className:u.sliderTrack}),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:i.i(s.isNullOrUndefined)(this.value)?this.min.toString():this.value.toString(),name:this.element.getAttribute("name")||this.element.getAttribute("id")||"_"+(1e3*Math.random()).toFixed(0)+"slider",class:u.sliderHiddenInput}}),this.hiddenInput.tabIndex=-1,this.sliderContainer.appendChild(this.hiddenInput),this.showButtons&&this.setButtons(),this.setEnableRTL(),"Range"===this.type?this.rangeValueUpdate():this.value=i.i(s.isNullOrUndefined)(this.value)?parseFloat(i.i(s.formatUnit)(this.min.toString())):this.value,this.previousVal="Range"!==this.type?this.checkHandleValue(parseFloat(i.i(s.formatUnit)(this.value.toString()))):[this.checkHandleValue(parseFloat(i.i(s.formatUnit)(this.value[0].toString()))),this.checkHandleValue(parseFloat(i.i(s.formatUnit)(this.value[1].toString())))],this.previousChanged=this.previousVal,i.i(s.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?i.i(s.removeClass)([this.sliderContainer],[u.sliderDisabled]):i.i(s.addClass)([this.sliderContainer],[u.sliderDisabled]),this.readonly?i.i(s.addClass)([this.sliderContainer],[u.readonly]):i.i(s.removeClass)([this.sliderContainer],[u.readonly])},e.prototype.getThemeInitialization=function(){this.isMaterial="material"===this.getTheme(this.sliderContainer)||"material-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.isMaterialTooltip=this.isMaterial&&"Range"!==this.type&&this.tooltip.isVisible},e.prototype.createRangeBar=function(){"Default"!==this.type&&(this.rangeBar=this.createElement("div",{attrs:{class:u.rangeBar}}),this.element.appendChild(this.rangeBar),this.drag&&"Range"===this.type&&("Horizontal"===this.orientation?this.rangeBar.classList.add(u.dragHorizontal):this.rangeBar.classList.add(u.dragVertical)))},e.prototype.createLimitBar=function(){var t="Range"!==this.type?u.limitBarDefault:u.limitBarFirst;t+=" "+u.limits,this.limitBarFirst=this.createElement("div",{attrs:{class:t}}),this.element.appendChild(this.limitBarFirst),"Range"===this.type&&(this.limitBarSecond=this.createElement("div",{attrs:{class:u.limitBarSecond+" "+u.limits}}),this.element.appendChild(this.limitBarSecond))},e.prototype.setOrientClass=function(){"Vertical"!==this.orientation?(this.sliderContainer.classList.remove(u.verticalSlider),this.sliderContainer.classList.add(u.horizontalSlider),this.firstHandle.setAttribute("aria-orientation","horizontal"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","horizontal")):(this.sliderContainer.classList.remove(u.horizontalSlider),this.sliderContainer.classList.add(u.verticalSlider),this.firstHandle.setAttribute("aria-orientation","vertical"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","vertical"))},e.prototype.setAriaAttributes=function(t){var e=this,n=this.min,a=this.max;if(!i.i(s.isNullOrUndefined)(this.customValues)&&this.customValues.length>0&&(n=this.customValues[0],a=this.customValues[this.customValues.length-1]),"Range"!==this.type)i.i(s.attributes)(t,{"aria-valuemin":n.toString(),"aria-valuemax":a.toString()});else{(!i.i(s.isNullOrUndefined)(this.customValues)&&this.customValues.length>0?[[n.toString(),this.customValues[this.value[1]].toString()],[this.customValues[this.value[0]].toString(),a.toString()]]:[[n.toString(),this.value[1].toString()],[this.value[0].toString(),a.toString()]]).forEach(function(t,n){var a=0===n?e.firstHandle:e.secondHandle;a&&i.i(s.attributes)(a,{"aria-valuemin":t[0],"aria-valuemax":t[1]})})}},e.prototype.createSecondHandle=function(){this.secondHandle=this.createElement("div",{attrs:{class:u.sliderHandle,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.secondHandle.classList.add(u.sliderSecondHandle),this.element.appendChild(this.secondHandle)},e.prototype.createFirstHandle=function(){this.firstHandle=this.createElement("div",{attrs:{class:u.sliderHandle,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.firstHandle.classList.add(u.sliderFirstHandle),this.element.appendChild(this.firstHandle),this.isMaterialTooltip&&(this.materialHandle=this.createElement("div",{attrs:{class:u.sliderHandle+" "+u.sliderMaterialHandle}}),this.element.appendChild(this.materialHandle))},e.prototype.wireFirstHandleEvt=function(t){t?(s.EventHandler.remove(this.firstHandle,"mousedown touchstart",this.handleFocus),s.EventHandler.remove(this.firstHandle,"transitionend",this.transitionEnd),s.EventHandler.remove(this.firstHandle,"mouseenter touchenter",this.handleOver),s.EventHandler.remove(this.firstHandle,"mouseleave touchend",this.handleLeave)):(s.EventHandler.add(this.firstHandle,"mousedown touchstart",this.handleFocus,this),s.EventHandler.add(this.firstHandle,"transitionend",this.transitionEnd,this),s.EventHandler.add(this.firstHandle,"mouseenter touchenter",this.handleOver,this),s.EventHandler.add(this.firstHandle,"mouseleave touchend",this.handleLeave,this))},e.prototype.wireSecondHandleEvt=function(t){t?(s.EventHandler.remove(this.secondHandle,"mousedown touchstart",this.handleFocus),s.EventHandler.remove(this.secondHandle,"transitionend",this.transitionEnd),s.EventHandler.remove(this.secondHandle,"mouseenter touchenter",this.handleOver),s.EventHandler.remove(this.secondHandle,"mouseleave touchend",this.handleLeave)):(s.EventHandler.add(this.secondHandle,"mousedown touchstart",this.handleFocus,this),s.EventHandler.add(this.secondHandle,"transitionend",this.transitionEnd,this),s.EventHandler.add(this.secondHandle,"mouseenter touchenter",this.handleOver,this),s.EventHandler.add(this.secondHandle,"mouseleave touchend",this.handleLeave,this))},e.prototype.handleStart=function(){"Range"!==this.type&&(this.firstHandle.classList[0===this.handlePos1?"add":"remove"](u.sliderHandleStart),this.isMaterialTooltip&&(this.materialHandle.classList[0===this.handlePos1?"add":"remove"](u.sliderHandleStart),this.tooltipElement&&this.tooltipElement.classList[0===this.handlePos1?"add":"remove"](u.sliderTooltipStart)))},e.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.tooltip.isVisible&&"Default"===this.type&&(this.tooltipElement.style.transition=this.transition.handle),this.tooltipToggle(this.getHandle()),this.closeTooltip())},e.prototype.handleFocusOut=function(){this.firstHandle.classList.contains(u.sliderHandleFocused)&&this.firstHandle.classList.remove(u.sliderHandleFocused),"Range"===this.type&&this.secondHandle.classList.contains(u.sliderHandleFocused)&&this.secondHandle.classList.remove(u.sliderHandleFocused)},e.prototype.handleFocus=function(t){this.focusSliderElement(),this.sliderBarClick(t),t.currentTarget===this.firstHandle?(this.firstHandle.classList.add(u.sliderHandleFocused),this.firstHandle.classList.add(u.sliderTabHandle)):(this.secondHandle.classList.add(u.sliderHandleFocused),this.secondHandle.classList.add(u.sliderTabHandle)),s.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),s.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},e.prototype.handleOver=function(t){this.tooltip.isVisible&&"Hover"===this.tooltip.showOn&&this.tooltipToggle(t.currentTarget),"Default"===this.type&&this.tooltipToggle(this.getHandle())},e.prototype.handleLeave=function(t){!this.tooltip.isVisible||"Hover"!==this.tooltip.showOn||t.currentTarget.classList.contains(u.sliderHandleFocused)||t.currentTarget.classList.contains(u.sliderTabHandle)||this.closeTooltip()},e.prototype.setHandler=function(){this.min>this.max&&(this.min=this.max),this.createFirstHandle(),"Range"===this.type&&this.createSecondHandle()},e.prototype.setEnableRTL=function(){this.enableRtl&&"Vertical"!==this.orientation?i.i(s.addClass)([this.sliderContainer],u.rtl):i.i(s.removeClass)([this.sliderContainer],u.rtl);var t="Vertical"!==this.orientation?this.horDir:this.verDir;this.enableRtl?(this.horDir="right",this.verDir="bottom"):(this.horDir="left",this.verDir="bottom"),t!==("Vertical"!==this.orientation?this.horDir:this.verDir)&&"Horizontal"===this.orientation&&(i.i(s.setStyleAttribute)(this.firstHandle,{right:"",left:"auto"}),"Range"===this.type&&i.i(s.setStyleAttribute)(this.secondHandle,{top:"",left:"auto"})),this.setBarColor()},e.prototype.tooltipValue=function(){var t,e=this,i={value:this.value,text:""};this.initialTooltip&&(this.initialTooltip=!1,this.setTooltipContent(),i.text=t=this.tooltipObj.content,this.trigger("tooltipChange",i,function(i){e.addTooltipClass(i.text),t!==i.text&&(e.customAriaText=i.text,e.tooltipObj.content=i.text,e.setAriaAttrValue(e.firstHandle),"Range"===e.type&&e.setAriaAttrValue(e.secondHandle))}),this.isMaterialTooltip&&this.setPreviousVal("change",this.value))},e.prototype.setTooltipContent=function(){var t;t=this.formatContent(this.tooltipFormatInfo,!1),this.tooltipObj.content=t},e.prototype.formatContent=function(t,e){var n="",a=this.handleVal1,r=this.handleVal2;return!i.i(s.isNullOrUndefined)(this.customValues)&&this.customValues.length>0&&(a=this.customValues[this.handleVal1],r=this.customValues[this.handleVal2]),e?("Range"===this.type?n=this.enableRtl&&"Vertical"!==this.orientation?i.i(s.isNullOrUndefined)(this.tooltip)||i.i(s.isNullOrUndefined)(this.tooltip.format)?r.toString()+" - "+a.toString():this.formatString(r,t).elementVal+" - "+this.formatString(a,t).elementVal:i.i(s.isNullOrUndefined)(this.tooltip)||i.i(s.isNullOrUndefined)(this.tooltip.format)?a.toString()+" - "+r.toString():this.formatString(a,t).elementVal+" - "+this.formatString(r,t).elementVal:i.i(s.isNullOrUndefined)(a)||(n=i.i(s.isNullOrUndefined)(this.tooltip)||i.i(s.isNullOrUndefined)(this.tooltip.format)?a.toString():this.formatString(a,t).elementVal),n):("Range"===this.type?n=this.enableRtl&&"Vertical"!==this.orientation?i.i(s.isNullOrUndefined)(t.format)?r.toString()+" - "+a.toString():this.formatString(r,t).formatString+" - "+this.formatString(a,t).formatString:i.i(s.isNullOrUndefined)(t.format)?a.toString()+" - "+r.toString():this.formatString(a,t).formatString+" - "+this.formatString(r,t).formatString:i.i(s.isNullOrUndefined)(a)||(n=i.i(s.isNullOrUndefined)(t.format)?a.toString():this.formatString(a,t).formatString),n)},e.prototype.addTooltipClass=function(t){if(this.isMaterialTooltip){var e=t.toString().length;if(this.tooltipElement){var i=e>4?{oldCss:u.sliderMaterialDefault,newCss:u.sliderMaterialRange}:{oldCss:u.sliderMaterialRange,newCss:u.sliderMaterialDefault};this.tooltipElement.classList.remove(i.oldCss),this.tooltipElement.classList.contains(i.newCss)||(this.tooltipElement.classList.add(i.newCss),this.tooltipElement.style.transform=e>4?"scale(1)":this.getTooltipTransformProperties(this.previousTooltipClass).rotate)}else{var i=e>4?u.sliderMaterialRange:u.sliderMaterialDefault;this.tooltipObj.cssClass=u.sliderTooltip+" "+i}}},e.prototype.tooltipPlacement=function(){return"Horizontal"===this.orientation?"Before"===this.tooltip.placement?"TopCenter":"BottomCenter":"Before"===this.tooltip.placement?"LeftCenter":"RightCenter"},e.prototype.tooltipBeforeOpen=function(t){this.tooltipElement=t.element,this.tooltip.cssClass&&i.i(s.addClass)([this.tooltipElement],this.tooltip.cssClass.split(" ").filter(function(t){return t})),t.target.removeAttribute("aria-describedby"),this.isMaterialTooltip&&(this.tooltipElement.firstElementChild.classList.add(u.materialTooltipHide),this.handleStart(),this.setTooltipTransform())},e.prototype.tooltipCollision=function(t){if(this.isBootstrap||this.isBootstrap4||this.isMaterial&&!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)}}},e.prototype.materialTooltipEventCallBack=function(t){this.sliderBarClick(t),s.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),s.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},e.prototype.wireMaterialTooltipEvent=function(t){this.isMaterialTooltip&&(t?s.EventHandler.remove(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack):s.EventHandler.add(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack,this))},e.prototype.tooltipPositionCalculation=function(t){var e;switch(t){case"TopCenter":e=u.horizontalTooltipBefore;break;case"BottomCenter":e=u.horizontalTooltipAfter;break;case"LeftCenter":e=u.verticalTooltipBefore;break;case"RightCenter":e=u.verticalTooltipAfter}return e},e.prototype.getTooltipTransformProperties=function(t){var e;if(this.tooltipElement){var i="Horizontal"===this.orientation?this.tooltipElement.clientHeight+14-this.tooltipElement.clientHeight/2:this.tooltipElement.clientWidth+14-this.tooltipElement.clientWidth/2;e="Horizontal"===this.orientation?t===u.horizontalTooltipBefore?{rotate:"rotate(45deg)",translate:"translateY("+i+"px)"}:{rotate:"rotate(225deg)",translate:"translateY("+-i+"px)"}:t===u.verticalTooltipBefore?{rotate:"rotate(-45deg)",translate:"translateX("+i+"px)"}:{rotate:"rotate(-225deg)",translate:"translateX("+-i+"px)"}}return e},e.prototype.openMaterialTooltip=function(){var t=this;if(this.isMaterialTooltip){this.refreshTooltip(this.firstHandle);var e=this.tooltipElement.firstElementChild;e.classList.remove(u.materialTooltipHide),e.classList.add(u.materialTooltipShow),this.firstHandle.style.cursor="default",this.tooltipElement.style.transition=this.scaleTransform,this.tooltipElement.classList.add(u.materialTooltipOpen),this.materialHandle.style.transform="scale(0)",e.innerText.length>4?this.tooltipElement.style.transform="scale(1)":this.tooltipElement.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate,"Default"===this.type?setTimeout(function(){t.tooltipElement.style.transition=t.transition.handle},2500):setTimeout(function(){t.tooltipElement.style.transition="none"},2500)}},e.prototype.closeMaterialTooltip=function(){var t=this;if(this.isMaterialTooltip){var e=this.tooltipElement.firstElementChild;this.tooltipElement.style.transition=this.scaleTransform,e.classList.remove(u.materialTooltipShow),e.classList.add(u.materialTooltipHide),this.firstHandle.style.cursor="-webkit-grab",this.firstHandle.style.cursor="grab",this.materialHandle&&(this.materialHandle.style.transform="scale(1)"),this.tooltipElement.classList.remove(u.materialTooltipOpen),this.setTooltipTransform(),this.tooltipTarget=void 0,setTimeout(function(){t.tooltipElement.style.transition="none"},2500)}},e.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(u.materialTooltipOpen)&&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()},e.prototype.setTooltipTransform=function(){var t=this.getTooltipTransformProperties(this.previousTooltipClass);this.tooltipElement.firstElementChild.innerText.length>4?this.tooltipElement.style.transform=t.translate+" scale(0.01)":this.tooltipElement.style.transform=t.translate+" "+t.rotate+" scale(0.01)"},e.prototype.renderTooltip=function(){this.tooltipObj=new n.Tooltip({showTipPointer:this.isBootstrap||this.isMaterial||this.isBootstrap4||this.isTailwind||this.isBootstrap5||this.isFluent,cssClass:u.sliderTooltip,height:this.isMaterial?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()},e.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){i.i(s.isNullOrUndefined)(t)||(t.style.transition="none")}),this.isMaterialTooltip&&(this.sliderContainer.classList.add(u.materialSlider),this.tooltipValue(),this.tooltipObj.animation.close.effect="None",this.tooltipObj.open(this.firstHandle))},e.prototype.tooltipBeforeClose=function(){this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0},e.prototype.setButtons=function(){this.firstBtn=this.createElement("div",{className:u.sliderButton+" "+u.firstButton}),this.firstBtn.appendChild(this.createElement("span",{className:u.sliderButtonIcon})),this.isTailwind&&this.firstBtn.querySelector("span").classList.add("e-icons"),this.firstBtn.tabIndex=-1,this.secondBtn=this.createElement("div",{className:u.sliderButton+" "+u.secondButton}),this.secondBtn.appendChild(this.createElement("span",{className:u.sliderButtonIcon})),this.isTailwind&&this.secondBtn.querySelector("span").classList.add("e-icons"),this.secondBtn.tabIndex=-1,this.sliderContainer.classList.add(u.sliderButtonClass),this.sliderContainer.appendChild(this.firstBtn),this.sliderContainer.appendChild(this.secondBtn),this.sliderContainer.appendChild(this.element),this.buttonTitle()},e.prototype.buttonTitle=function(){var t=this.enableRtl&&"Vertical"!==this.orientation;this.l10n.setLocale(this.locale);var e=this.l10n.getConstant("decrementTitle"),n=this.l10n.getConstant("incrementTitle");i.i(s.attributes)(t?this.secondBtn:this.firstBtn,{"aria-label":e,title:e}),i.i(s.attributes)(t?this.firstBtn:this.secondBtn,{"aria-label":n,title:n})},e.prototype.buttonFocusOut=function(){this.isMaterial&&this.getHandle().classList.remove("e-large-thumb-size")},e.prototype.repeatButton=function(t){var e,i=this.handleValueUpdate(),s=this.enableRtl&&"Vertical"!==this.orientation;t.target.parentElement.classList.contains(u.firstButton)||t.target.classList.contains(u.firstButton)?e=s?this.add(i,parseFloat(this.step.toString()),!0):this.add(i,parseFloat(this.step.toString()),!1):(t.target.parentElement.classList.contains(u.secondButton)||t.target.classList.contains(u.secondButton))&&(e=s?this.add(i,parseFloat(this.step.toString()),!1):this.add(i,parseFloat(this.step.toString()),!0)),this.limits.enabled&&(e=this.getLimitCorrectedValues(e)),e>=this.min&&e<=this.max&&(this.changeHandleValue(e),this.tooltipToggle(this.getHandle()))},e.prototype.repeatHandlerMouse=function(t){t.preventDefault(),"mousedown"!==t.type&&"touchstart"!==t.type||(this.buttonClick(t),this.repeatInterval=setInterval(this.repeatButton.bind(this),180,t))},e.prototype.materialChange=function(){this.getHandle().classList.contains("e-large-thumb-size")||this.getHandle().classList.add("e-large-thumb-size")},e.prototype.focusHandle=function(){this.getHandle().classList.contains(u.sliderTabHandle)||this.getHandle().classList.add(u.sliderTabHandle)},e.prototype.repeatHandlerUp=function(t){this.changeEvent("changed",t),this.closeTooltip(),clearInterval(this.repeatInterval),this.getHandle().focus()},e.prototype.customTickCounter=function(t){var e=4;return!i.i(s.isNullOrUndefined)(this.customValues)&&this.customValues.length>0&&(t>4&&(e=3),t>7&&(e=2),t>14&&(e=1),t>28&&(e=0)),e},e.prototype.renderScale=function(){var t="Vertical"===this.orientation?"v":"h";this.noOfDecimals=this.numberOfDecimals(this.step),this.ul=this.createElement("ul",{className:u.scale+" e-"+t+"-scale "+u.tick+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation",tabIndex:"-1","aria-hidden":"true"}}),this.ul.style.zIndex="-1",s.Browser.isAndroid&&"h"===t&&this.ul.classList.add(u.sliderTickPosition);var e=this.ticks.smallStep;this.ticks.showSmallTicks?e<=0&&(e=parseFloat(i.i(s.formatUnit)(this.step))):e=this.ticks.largeStep>0?this.ticks.largeStep:parseFloat(i.i(s.formatUnit)(this.max))-parseFloat(i.i(s.formatUnit)(this.min));var n=this.fractionalToInteger(this.min),a=this.fractionalToInteger(this.max),r=this.fractionalToInteger(e),l=!i.i(s.isNullOrUndefined)(this.customValues)&&this.customValues.length>0&&this.customValues.length-1,o=this.customTickCounter(l),h=!i.i(s.isNullOrUndefined)(this.customValues)&&this.customValues.length>0?l*o+l:Math.abs((a-n)/r);this.element.appendChild(this.ul);var d,c=parseFloat(this.min.toString());"v"===t&&(c=parseFloat(this.max.toString()));var p,m=0,f=100/h;f===1/0&&(f=5);for(var v=0,g=!i.i(s.isNullOrUndefined)(this.customValues)&&this.customValues.length>0?this.customValues.length-1:0,y=0;v<=h;v++){if(d=this.createElement("li",{attrs:{class:u.tick,role:"presentation",tabIndex:"-1","aria-hidden":"true"}}),!i.i(s.isNullOrUndefined)(this.customValues)&&this.customValues.length>0)(p=v%(o+1)==0)&&("h"===t?(c=this.customValues[y],y++):(c=this.customValues[g],g--),d.setAttribute("title",c.toString()));else if(d.setAttribute("title",c.toString()),0===this.numberOfDecimals(this.max)&&0===this.numberOfDecimals(this.min)&&0===this.numberOfDecimals(this.step))p="h"===t?(c-parseFloat(this.min.toString()))%this.ticks.largeStep==0:Math.abs(c-parseFloat(this.max.toString()))%this.ticks.largeStep==0;else{var b=this.fractionalToInteger(this.ticks.largeStep),C=this.fractionalToInteger(c);p="h"===t?(C-n)%b==0:Math.abs(C-parseFloat(a.toString()))%b==0}p&&d.classList.add(u.large),"h"===t?d.style.width=f+"%":d.style.height=f+"%";var E=p?"Both"===this.ticks.placement?2:1:0;if(p)for(var S=0;S<E;S++)this.createTick(d,c,f);else i.i(s.isNullOrUndefined)(this.customValues)&&this.formatTicksValue(d,c);this.ul.appendChild(d),this.tickElementCollection.push(d);var x=void 0;i.i(s.isNullOrUndefined)(this.customValues)&&(x=this.numberOfDecimals(e)>this.numberOfDecimals(c)?this.numberOfDecimals(e):this.numberOfDecimals(c),c="h"===t?this.makeRoundNumber(c+e,x):this.makeRoundNumber(c-e,x),m=this.makeRoundNumber(m+e,x))}this.ticksAlignment(t,f)},e.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(u.sliderFirstTick),this.lastChild.classList.add(u.sliderLastTick),this.sliderContainer.classList.add(u.scale+"-"+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+"%");var s={ticksWrapper:this.ul,tickElements:this.tickElementCollection};i&&this.trigger("renderedTicks",s),this.scaleAlignment()},e.prototype.createTick=function(t,e,n){var a=this.createElement("span",{className:u.tickValue+" "+u.tick+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation",tabIndex:"-1","aria-hidden":"true"}});t.appendChild(a),i.i(s.isNullOrUndefined)(this.customValues)?this.formatTicksValue(t,e,a,n):this.enableHtmlSanitizer?a.innerHTML=s.SanitizeHtmlHelper.sanitize(e.toString()):a.innerHTML=e.toString()},e.prototype.formatTicksValue=function(t,e,n,a){var r=this,l=this.formatNumber(e),o=i.i(s.isNullOrUndefined)(this.ticks)||i.i(s.isNullOrUndefined)(this.ticks.format)?l:this.formatString(e,this.ticksFormatInfo).formatString,h={value:e,text:o,tickElement:t};this.trigger("renderingTicks",h,function(e){t.setAttribute("title",e.text.toString()),n&&(r.enableHtmlSanitizer?n.innerHTML=s.SanitizeHtmlHelper.sanitize(e.text.toString()):n.innerHTML=e.text.toString())})},e.prototype.scaleAlignment=function(){this.tickValuePosition();this.orientation;"Vertical"===this.orientation?this.element.getBoundingClientRect().width<=15?this.sliderContainer.classList.add(u.sliderSmallSize):this.sliderContainer.classList.remove(u.sliderSmallSize):this.element.getBoundingClientRect().height<=15?this.sliderContainer.classList.add(u.sliderSmallSize):this.sliderContainer.classList.remove(u.sliderSmallSize)},e.prototype.tickValuePosition=function(){this.firstChild=this.element.querySelector("ul").children[0];var t,e,n=this.firstChild.getBoundingClientRect(),a=this.ticks.smallStep,r=Math.abs(parseFloat(i.i(s.formatUnit)(this.max))-parseFloat(i.i(s.formatUnit)(this.min)))/a;this.firstChild.children.length>0&&(t=this.firstChild.children[0].getBoundingClientRect());var l,o=[this.sliderContainer.querySelectorAll("."+u.tick+"."+u.large+" ."+u.tickValue)];l="Both"===this.ticks.placement?[].slice.call(o[0],2):[].slice.call(o[0],1);for(var h="Vertical"===this.orientation?2*n.height:2*n.width,d=0;d<this.firstChild.children.length;d++)"Vertical"===this.orientation?this.firstChild.children[d].style.top=-t.height/2+"px":this.enableRtl?this.firstChild.children[d].style.left=(h-this.firstChild.children[d].getBoundingClientRect().width)/2+"px":this.firstChild.children[d].style.left=-t.width/2+"px";for(var d=0;d<l.length;d++)e=l[d].getBoundingClientRect(),"Vertical"===this.orientation?i.i(s.setStyleAttribute)(l[d],{top:(h-e.height)/2+"px"}):i.i(s.setStyleAttribute)(l[d],{left:(h-e.width)/2+"px"});this.enableRtl&&this.lastChild.children.length&&0!==r&&(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===r&&("Horizontal"===this.orientation&&(this.enableRtl?(this.firstChild.classList.remove(u.sliderLastTick),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(u.sliderLastTick),this.firstChild.style.left=this.firstHandle.style.left)),"Vertical"===this.orientation&&this.firstChild.classList.remove(u.sliderLastTick))},e.prototype.setAriaAttrValue=function(t){var e,n=!i.i(s.isNullOrUndefined)(this.ticks)&&!i.i(s.isNullOrUndefined)(this.ticks.format),a=n?this.formatContent(this.tooltipFormatInfo,!1):this.formatContent(this.ticksFormatInfo,!1),r=n?this.formatContent(this.ticksFormatInfo,!0):this.formatContent(this.tooltipFormatInfo,!0);a=this.customAriaText?this.customAriaText:a,e=2===a.split(" - ").length?a.split(" - "):[a,a],this.setAriaAttributes(t),"Range"!==this.type?i.i(s.attributes)(t,{"aria-valuenow":r,"aria-valuetext":a}):this.enableRtl?t===this.firstHandle?i.i(s.attributes)(t,{"aria-valuenow":r.split(" - ")[1],"aria-valuetext":e[1]}):i.i(s.attributes)(t,{"aria-valuenow":r.split(" - ")[0],"aria-valuetext":e[0]}):t===this.firstHandle?i.i(s.attributes)(t,{"aria-valuenow":r.split(" - ")[0],"aria-valuetext":e[0]}):i.i(s.attributes)(t,{"aria-valuenow":r.split(" - ")[1],"aria-valuetext":e[1]})},e.prototype.handleValueUpdate=function(){return"Range"===this.type?1===this.activeHandle?this.handleVal1:this.handleVal2:this.handleVal1},e.prototype.getLimitCorrectedValues=function(t){return t="MinRange"===this.type||"Default"===this.type?this.getLimitValueAndPosition(t,this.limits.minStart,this.limits.minEnd)[0]:1===this.activeHandle?this.getLimitValueAndPosition(t,this.limits.minStart,this.limits.minEnd)[0]:this.getLimitValueAndPosition(t,this.limits.maxStart,this.limits.maxEnd)[0]},e.prototype.focusSliderElement=function(){this.isElementFocused||(this.element.focus(),this.isElementFocused=!0)},e.prototype.buttonClick=function(t){this.focusSliderElement();var e,i=this.enableRtl&&"Vertical"!==this.orientation,n=this.handleValueUpdate();40===t.keyCode||37===t.keyCode||t.currentTarget.classList.contains(u.firstButton)?e=i?this.add(n,parseFloat(this.step.toString()),!0):this.add(n,parseFloat(this.step.toString()),!1):38===t.keyCode||39===t.keyCode||t.currentTarget.classList.contains(u.secondButton)?e=i?this.add(n,parseFloat(this.step.toString()),!1):this.add(n,parseFloat(this.step.toString()),!0):33===t.keyCode||t.currentTarget.classList.contains(u.firstButton)?e=i?this.add(n,parseFloat(this.ticks.largeStep.toString()),!1):this.add(n,parseFloat(this.ticks.largeStep.toString()),!0):34===t.keyCode||t.currentTarget.classList.contains(u.secondButton)?e=i?this.add(n,parseFloat(this.ticks.largeStep.toString()),!0):this.add(n,parseFloat(this.ticks.largeStep.toString()),!1):36===t.keyCode?e=parseFloat(this.min.toString()):35===t.keyCode&&(e=parseFloat(this.max.toString())),this.limits.enabled&&(e=this.getLimitCorrectedValues(e)),this.changeHandleValue(e),!this.isMaterial||this.tooltip.isVisible||this.getHandle().classList.contains(u.sliderTabHandle)||this.materialChange(),this.tooltipToggle(this.getHandle()),this.getHandle().focus(),this.focusHandle(),t.currentTarget.classList.contains(u.firstButton)&&s.EventHandler.add(this.firstBtn,"mouseup touchend",this.buttonUp,this),t.currentTarget.classList.contains(u.secondButton)&&s.EventHandler.add(this.secondBtn,"mouseup touchend",this.buttonUp,this)},e.prototype.tooltipToggle=function(t){this.isMaterialTooltip?this.tooltipElement.classList.contains(u.materialTooltipOpen)?this.refreshTooltip(this.firstHandle):this.openMaterialTooltip():this.tooltipElement?this.refreshTooltip(t):this.openTooltip(t)},e.prototype.buttonUp=function(t){t.currentTarget.classList.contains(u.firstButton)&&s.EventHandler.remove(this.firstBtn,"mouseup touchend",this.buttonUp),t.currentTarget.classList.contains(u.secondButton)&&s.EventHandler.remove(this.secondBtn,"mouseup touchend",this.buttonUp)},e.prototype.setRangeBar=function(){"Horizontal"===this.orientation?"MinRange"===this.type?(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",i.i(s.setStyleAttribute)(this.rangeBar,{width:i.i(s.isNullOrUndefined)(this.handlePos1)?0:this.handlePos1+"px"})):(this.enableRtl?this.rangeBar.style.right=this.handlePos1+"px":this.rangeBar.style.left=this.handlePos1+"px",i.i(s.setStyleAttribute)(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"})):"MinRange"===this.type?(this.rangeBar.style.bottom="0px",i.i(s.setStyleAttribute)(this.rangeBar,{height:i.i(s.isNullOrUndefined)(this.handlePos1)?0:this.handlePos1+"px"})):(this.rangeBar.style.bottom=this.handlePos1+"px",i.i(s.setStyleAttribute)(this.rangeBar,{height:this.handlePos2-this.handlePos1+"px"}))},e.prototype.checkValidValueAndPos=function(t){return t=this.checkHandleValue(t),t=this.checkHandlePosition(t)},e.prototype.setLimitBarPositions=function(t,e,i,s){"Horizontal"===this.orientation?this.enableRtl?(this.limitBarFirst.style.right=t+"px",this.limitBarFirst.style.width=e-t+"px"):(this.limitBarFirst.style.left=t+"px",this.limitBarFirst.style.width=e-t+"px"):(this.limitBarFirst.style.bottom=t+"px",this.limitBarFirst.style.height=e-t+"px"),"Range"===this.type&&("Horizontal"===this.orientation?this.enableRtl?(this.limitBarSecond.style.right=i+"px",this.limitBarSecond.style.width=s-i+"px"):(this.limitBarSecond.style.left=i+"px",this.limitBarSecond.style.width=s-i+"px"):(this.limitBarSecond.style.bottom=i+"px",this.limitBarSecond.style.height=s-i+"px"))},e.prototype.setLimitBar=function(){if("Default"===this.type||"MinRange"===this.type){var t=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0];t=this.checkValidValueAndPos(t);var e=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0];e=this.checkValidValueAndPos(e),this.setLimitBarPositions(t,e)}else if("Range"===this.type){var i=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0];i=this.checkValidValueAndPos(i);var s=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0];s=this.checkValidValueAndPos(s);var n=this.getLimitValueAndPosition(this.limits.maxStart,this.limits.maxStart,this.limits.maxEnd,!0)[0];n=this.checkValidValueAndPos(n);var a=this.getLimitValueAndPosition(this.limits.maxEnd,this.limits.maxStart,this.limits.maxEnd,!0)[0];a=this.checkValidValueAndPos(a),this.setLimitBarPositions(i,s,n,a)}},e.prototype.getLimitValueAndPosition=function(t,e,n,a){return i.i(s.isNullOrUndefined)(e)&&(e=this.min,i.i(s.isNullOrUndefined)(t)&&a&&(t=e)),i.i(s.isNullOrUndefined)(n)&&(n=this.max,i.i(s.isNullOrUndefined)(t)&&a&&(t=n)),t<e&&(t=e),t>n&&(t=n),[t,this.checkHandlePosition(t)]},e.prototype.setValue=function(){if(!i.i(s.isNullOrUndefined)(this.customValues)&&this.customValues.length>0&&(this.min=0,this.max=this.customValues.length-1,this.setBarColor()),this.setAriaAttributes(this.firstHandle),this.handleVal1=i.i(s.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,i.i(s.isNullOrUndefined)(this.activeHandle)?"Range"===this.type?this.activeHandle=2:this.activeHandle=1:this.activeHandle=this.activeHandle,"Default"===this.type||"MinRange"===this.type){if(this.limits.enabled){var 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)}else this.validateRangeValue();"Default"!==this.type&&this.setRangeBar(),this.limits.enabled&&this.setLimitBar()},e.prototype.rangeValueUpdate=function(){null!==this.value&&"object"==typeof this.value||(this.value=[parseFloat(i.i(s.formatUnit)(this.min)),parseFloat(i.i(s.formatUnit)(this.max))])},e.prototype.validateRangeValue=function(){this.rangeValueUpdate(),this.setRangeValue()},e.prototype.modifyZindex=function(){"Range"===this.type?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+""):this.isMaterialTooltip&&this.tooltipElement&&(this.tooltipElement.style.zIndex=i.i(n.getZindexPartial)(this.element)+"")},e.prototype.setHandlePosition=function(t){var e,i=this,s=1===this.activeHandle?this.handlePos1:this.handlePos2;e=this.isMaterialTooltip?[this.firstHandle,this.materialHandle]:[this.getHandle()],this.handleStart(),e.forEach(function(t){"Horizontal"===i.orientation?i.enableRtl?t.style.right=s+"px":t.style.left=s+"px":t.style.bottom=s+"px"}),this.changeEvent("change",t)},e.prototype.getHandle=function(){return 1===this.activeHandle?this.firstHandle:this.secondHandle},e.prototype.setRangeValue=function(){this.updateRangeValue(),this.activeHandle=1,this.setHandlePosition(null),this.activeHandle=2,this.setHandlePosition(null),this.activeHandle=1},e.prototype.changeEvent=function(t,e){var i="change"===t?this.previousVal:this.previousChanged;if("Range"!==this.type)this.setProperties({value:this.handleVal1},!0),i===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);else{var s=this.value=[this.handleVal1,this.handleVal2];this.setProperties({value:s},!0),(i.length===this.value.length&&this.value[0]!==i[0]||this.value[1]!==i[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()},e.prototype.changeEventArgs=function(t,e){var n;return this.tooltip.isVisible&&this.tooltipObj&&this.initialTooltip?(this.tooltipValue(),n={value:this.value,previousValue:"change"===t?this.previousVal:this.previousChanged,action:t,text:this.tooltipObj.content,isInteracted:!i.i(s.isNullOrUndefined)(e)}):n={value:this.value,previousValue:"change"===t?this.previousVal:this.previousChanged,action:t,text:i.i(s.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:!i.i(s.isNullOrUndefined)(e)},n},e.prototype.setPreviousVal=function(t,e){"change"===t?this.previousVal=e:this.previousChanged=e},e.prototype.updateRangeValue=function(){var t=this.value.toString().split(",").map(Number);if(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.handlePos1>this.handlePos2&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.preHandlePos1=this.handlePos1,this.preHandlePos2=this.handlePos2,this.limits.enabled){this.activeHandle=1;var e=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd);this.handleVal1=e[0],this.handlePos1=e[1],this.preHandlePos1=this.handlePos1,this.activeHandle=2,e=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=e[0],this.handlePos2=e[1],this.preHandlePos2=this.handlePos2}},e.prototype.checkHandlePosition=function(t){var e;return t=100*(t-parseFloat(i.i(s.formatUnit)(this.min)))/(parseFloat(i.i(s.formatUnit)(this.max))-parseFloat(i.i(s.formatUnit)(this.min))),e="Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(t/100):this.element.getBoundingClientRect().height*(t/100),parseFloat(i.i(s.formatUnit)(this.max))===parseFloat(i.i(s.formatUnit)(this.min))&&(e="Horizontal"===this.orientation?this.element.getBoundingClientRect().width:this.element.getBoundingClientRect().height),e},e.prototype.checkHandleValue=function(t){if(this.min>this.max&&(this.min=this.max),this.min===this.max)return parseFloat(i.i(s.formatUnit)(this.max));var e=this.tempStartEnd();return t<e.start?t=e.start:t>e.end&&(t=e.end),t},e.prototype.reposition=function(){var t=this;this.firstHandle.style.transition="none","Default"!==this.type&&(this.rangeBar.style.transition="none"),"Range"===this.type&&(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&&(this.enableRtl?this.materialHandle.style.right=this.handlePos1+"px":this.materialHandle.style.left=this.handlePos1+"px"),"MinRange"===this.type?(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",i.i(s.setStyleAttribute)(this.rangeBar,{width:i.i(s.isNullOrUndefined)(this.handlePos1)?0:this.handlePos1+"px"})):"Range"===this.type&&(this.enableRtl?this.secondHandle.style.right=this.handlePos2+"px":this.secondHandle.style.left=this.handlePos2+"px",this.enableRtl?this.rangeBar.style.right=this.handlePos1+"px":this.rangeBar.style.left=this.handlePos1+"px",i.i(s.setStyleAttribute)(this.rangeBar,{width:this.handlePos2-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="0px",i.i(s.setStyleAttribute)(this.rangeBar,{height:i.i(s.isNullOrUndefined)(this.handlePos1)?0:this.handlePos1+"px"})):"Range"===this.type&&(this.secondHandle.style.bottom=this.handlePos2+"px",this.rangeBar.style.bottom=this.handlePos1+"px",i.i(s.setStyleAttribute)(this.rangeBar,{height: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(){t.firstHandle.style.transition=t.scaleTransform,"Range"===t.type&&(t.secondHandle.style.transition=t.scaleTransform)}),this.refreshTooltip(this.tooltipTarget),this.setBarColor()},e.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.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.handlePos1!==this.preHandlePos1&&(e=this.preHandlePos1=this.handlePos1)),this.modifyZindex()):(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.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))},e.prototype.tempStartEnd=function(){return this.min>this.max?{start:this.max,end:this.min}:{start:this.min,end:this.max}},e.prototype.xyToPosition=function(t){if(this.min===this.max)return 100;if("Horizontal"===this.orientation){var e=t.x-this.element.getBoundingClientRect().left,i=this.element.offsetWidth/100;this.val=e/i}else{var s=t.y-this.element.getBoundingClientRect().top,i=this.element.offsetHeight/100;this.val=100-s/i}var n=this.stepValueCalculation(this.val);return n<0?n=0:n>100&&(n=100),this.enableRtl&&"Vertical"!==this.orientation&&(n=100-n),"Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(n/100):this.element.getBoundingClientRect().height*(n/100)},e.prototype.stepValueCalculation=function(t){0===this.step&&(this.step=1);var e=parseFloat(i.i(s.formatUnit)(this.step))/((parseFloat(i.i(s.formatUnit)(this.max))-parseFloat(i.i(s.formatUnit)(this.min)))/100),n=t%Math.abs(e);return 0!==n&&(e/2>n?t-=n:t+=Math.abs(e)-n),t},e.prototype.add=function(t,e,i){var s=Math.pow(10,3);return i?(Math.round(t*s)+Math.round(e*s))/s:(Math.round(t*s)-Math.round(e*s))/s},e.prototype.positionToValue=function(t){var e,n=parseFloat(i.i(s.formatUnit)(this.max))-parseFloat(i.i(s.formatUnit)(this.min));return e="Horizontal"===this.orientation?t/this.element.getBoundingClientRect().width*n:t/this.element.getBoundingClientRect().height*n,this.add(e,parseFloat(this.min.toString()),!0)},e.prototype.sliderBarClick=function(t){t.preventDefault();var e;"mousedown"===t.type||"mouseup"===t.type||"click"===t.type?e={x:t.clientX,y:t.clientY}:"touchend"!==t.type&&"touchstart"!==t.type||(e={x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY});var i=this.xyToPosition(e),s=this.positionToValue(i);if("Range"===this.type&&this.handlePos2-i<i-this.handlePos1){if(this.activeHandle=2,!this.limits.enabled||!this.limits.endHandleFixed){if(this.limits.enabled){var n=this.getLimitValueAndPosition(s,this.limits.maxStart,this.limits.maxEnd);s=n[0],i=n[1]}this.secondHandle.classList.add(u.sliderActiveHandle),this.handlePos2=this.preHandlePos2=i,this.handleVal2=s}this.modifyZindex(),this.secondHandle.focus()}else{if(this.activeHandle=1,!this.limits.enabled||!this.limits.startHandleFixed){if(this.limits.enabled){var n=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd);s=n[0],i=n[1]}this.firstHandle.classList.add(u.sliderActiveHandle),this.handlePos1=this.preHandlePos1=i,this.handleVal1=s}this.modifyZindex(),this.firstHandle.focus()}this.isMaterialTooltip&&this.tooltipElement.classList.add(u.materialTooltipActive);var a=this.element.querySelector("."+u.sliderTabHandle);a&&this.getHandle()!==a&&a.classList.remove(u.sliderTabHandle);var r,l=1===this.activeHandle?this.firstHandle:this.secondHandle;if(("click"===t.type||"mousedown"===t.type)&&t.target===l){var o=t.clientX,h=t.clientY;r=document.elementFromPoint(o,h)}if(t.target===l&&r!=l)return!this.isMaterial||this.tooltip.isVisible||this.getHandle().classList.contains(u.sliderTabHandle)||this.materialChange(),this.sliderBarUp(t),void this.tooltipToggle(this.getHandle());if(this.checkRepeatedValue(s)){var d=this.isMaterial&&this.tooltip.isVisible?this.transitionOnMaterialTooltip:this.transition;this.getHandle().style.transition=d.handle,"Default"!==this.type&&(this.rangeBar.style.transition=d.rangeBar),this.setHandlePosition(t),this.isMaterialTooltip&&(this.initialTooltip=!1),this.changeEvent("changed",t),"Default"!==this.type&&this.setRangeBar()}},e.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)},e.prototype.dragRangeBarMove=function(t){var e,i;"touchmove"!==t.type&&t.preventDefault(),this.rangeBarDragged=!0;var s;this.rangeBar.style.transition="none",this.firstHandle.style.transition="none",this.secondHandle.style.transition="none";var n,a;if("mousemove"===t.type?(e=[t.clientX,t.clientY],n=e[0],a=e[1]):(i=[t.changedTouches[0].clientX,t.changedTouches[0].clientY],n=i[0],a=i[1]),!(this.limits.enabled&&this.limits.startHandleFixed||this.limits.enabled&&this.limits.endHandleFixed)){if(s=this.enableRtl?{x:n+this.secondPartRemain,y:a+this.secondPartRemain}:{x:n-this.firstPartRemain,y:a+this.secondPartRemain},this.handlePos1=this.xyToPosition(s),this.handleVal1=this.positionToValue(this.handlePos1),s=this.enableRtl?{x:n-this.firstPartRemain,y:a-this.firstPartRemain}:{x:n+this.secondPartRemain,y:a-this.firstPartRemain},this.handlePos2=this.xyToPosition(s),this.handleVal2=this.positionToValue(this.handlePos2),this.limits.enabled){var r=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd);this.handleVal1=r[0],this.handlePos1=r[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),r=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=r[0],this.handlePos2=r[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.max&&this.handleValueAdjust(this.handleVal2,this.max,2),this.handleVal1===this.min&&this.handleValueAdjust(this.handleVal1,this.min,1)}this.activeHandle=1,this.setHandlePosition(t),this.activeHandle=2,this.setHandlePosition(t),this.tooltipToggle(this.rangeBar),this.setRangeBar()},e.prototype.sliderBarUp=function(t){this.changeEvent("changed",t),this.handleFocusOut(),this.firstHandle.classList.remove(u.sliderActiveHandle),"Range"===this.type&&(this.initialTooltip=!1,this.secondHandle.classList.remove(u.sliderActiveHandle)),this.closeTooltip(),this.isMaterial&&(this.getHandle().classList.remove("e-large-thumb-size"),this.isMaterialTooltip&&this.tooltipElement.classList.remove(u.materialTooltipActive)),s.EventHandler.remove(document,"mousemove touchmove",this.sliderBarMove),s.EventHandler.remove(document,"mouseup touchend",this.sliderBarUp)},e.prototype.sliderBarMove=function(t){"touchmove"!==t.type&&t.preventDefault();var e;e="mousemove"===t.type?{x:t.clientX,y:t.clientY}:{x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY};var i=this.xyToPosition(e),s=this.positionToValue(i);if(i=Math.round(i),"Range"!==this.type&&1===this.activeHandle){if(!this.limits.enabled||!this.limits.startHandleFixed){if(this.limits.enabled){var n=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd);i=n[1],s=n[0]}this.handlePos1=i,this.handleVal1=s}this.firstHandle.classList.add(u.sliderActiveHandle)}if("Range"===this.type)if(1===this.activeHandle){if(this.firstHandle.classList.add(u.sliderActiveHandle),!(this.limits.enabled&&this.limits.startHandleFixed||(i>this.handlePos2&&(i=this.handlePos2,s=this.handleVal2),i===this.preHandlePos1))){if(this.limits.enabled){var a=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd);s=a[0],i=a[1]}this.handlePos1=this.preHandlePos1=i,this.handleVal1=s,this.activeHandle=1}}else if(2===this.activeHandle&&(this.secondHandle.classList.add(u.sliderActiveHandle),!(this.limits.enabled&&this.limits.endHandleFixed||(i<this.handlePos1&&(i=this.handlePos1,s=this.handleVal1),i===this.preHandlePos2)))){if(this.limits.enabled){var a=this.getLimitValueAndPosition(s,this.limits.maxStart,this.limits.maxEnd);s=a[0],i=a[1]}this.handlePos2=this.preHandlePos2=i,this.handleVal2=s,this.activeHandle=2}this.checkRepeatedValue(s)&&(this.getHandle().style.transition=this.scaleTransform,"Default"!==this.type&&(this.rangeBar.style.transition="none"),this.setHandlePosition(t),!this.isMaterial||this.tooltip.isVisible||this.getHandle().classList.contains(u.sliderTabHandle)||this.materialChange(),this.tooltipToggle(this.getHandle()),"Default"!==this.type&&this.setRangeBar())},e.prototype.dragRangeBarUp=function(t){this.rangeBarDragged?this.isDragComplete=!0:(this.focusSliderElement(),this.sliderBarClick(t)),this.changeEvent("changed",t),this.closeTooltip(),s.EventHandler.remove(document,"mousemove touchmove",this.dragRangeBarMove),s.EventHandler.remove(document,"mouseup touchend",this.dragRangeBarUp),this.rangeBarDragged=!1},e.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},e.prototype.refreshTooltip=function(t){this.tooltip.isVisible&&this.tooltipObj&&(this.tooltipValue(),t&&(this.tooltipObj.refresh(t),this.tooltipTarget=t))},e.prototype.openTooltip=function(t){this.tooltip.isVisible&&this.tooltipObj&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.open(t),this.tooltipTarget=t)},e.prototype.closeTooltip=function(){this.tooltip.isVisible&&this.tooltipObj&&"Always"!==this.tooltip.showOn&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.close(),this.tooltipTarget=void 0)},e.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)}},e.prototype.wireButtonEvt=function(t){t?(s.EventHandler.remove(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut),s.EventHandler.remove(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut),s.EventHandler.remove(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse),s.EventHandler.remove(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),s.EventHandler.remove(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse),s.EventHandler.remove(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),s.EventHandler.remove(this.firstBtn,"focusout",this.sliderFocusOut),s.EventHandler.remove(this.secondBtn,"focusout",this.sliderFocusOut)):(s.EventHandler.add(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut,this),s.EventHandler.add(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut,this),s.EventHandler.add(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse,this),s.EventHandler.add(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),s.EventHandler.add(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse,this),s.EventHandler.add(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),s.EventHandler.add(this.firstBtn,"focusout",this.sliderFocusOut,this),s.EventHandler.add(this.secondBtn,"focusout",this.sliderFocusOut,this))},e.prototype.rangeBarMousedown=function(t){var e,i;if(t.preventDefault(),this.focusSliderElement(),"Range"===this.type&&this.drag&&t.target===this.rangeBar){var n=void 0,a=void 0;"mousedown"===t.type?(e=[t.clientX,t.clientY],n=e[0],a=e[1]):"touchstart"===t.type&&(i=[t.changedTouches[0].clientX,t.changedTouches[0].clientY],n=i[0],a=i[1]),"Horizontal"===this.orientation?(this.firstPartRemain=n-this.rangeBar.getBoundingClientRect().left,this.secondPartRemain=this.rangeBar.getBoundingClientRect().right-n):(this.firstPartRemain=a-this.rangeBar.getBoundingClientRect().top,this.secondPartRemain=this.rangeBar.getBoundingClientRect().bottom-a),this.minDiff=this.handleVal2-this.handleVal1,this.tooltipToggle(this.rangeBar);var r=this.element.querySelector("."+u.sliderTabHandle);r&&r.classList.remove(u.sliderTabHandle),s.EventHandler.add(document,"mousemove touchmove",this.dragRangeBarMove,this),s.EventHandler.add(document,"mouseup touchend",this.dragRangeBarUp,this)}},e.prototype.elementClick=function(t){if(this.isDragComplete)return void(this.isDragComplete=!1);t.preventDefault(),this.focusSliderElement(),this.sliderBarClick(t),this.focusHandle()},e.prototype.wireEvents=function(){this.onresize=this.reposition.bind(this),window.addEventListener("resize",this.onresize),this.enabled&&!this.readonly&&(s.EventHandler.add(this.element,"click",this.elementClick,this),"Range"===this.type&&this.drag&&s.EventHandler.add(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown,this),s.EventHandler.add(this.sliderContainer,"keydown",this.keyDown,this),s.EventHandler.add(this.sliderContainer,"keyup",this.keyUp,this),s.EventHandler.add(this.element,"focusout",this.sliderFocusOut,this),s.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&&s.EventHandler.add(this.formElement,"reset",this.formResetHandler,this))},e.prototype.unwireEvents=function(){s.EventHandler.remove(this.element,"click",this.elementClick),"Range"===this.type&&this.drag&&s.EventHandler.remove(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown),s.EventHandler.remove(this.sliderContainer,"keydown",this.keyDown),s.EventHandler.remove(this.sliderContainer,"keyup",this.keyUp),s.EventHandler.remove(this.element,"focusout",this.sliderFocusOut),s.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),s.EventHandler.remove(this.element,"reset",this.formResetHandler)},e.prototype.formResetHandler=function(){this.setProperties({value:this.formResetValue},!0),this.setValue()},e.prototype.keyUp=function(t){if(9===t.keyCode&&t.target.classList.contains(u.sliderHandle)&&(this.focusSliderElement(),!t.target.classList.contains(u.sliderTabHandle))){this.element.querySelector("."+u.sliderTabHandle)&&this.element.querySelector("."+u.sliderTabHandle).classList.remove(u.sliderTabHandle),t.target.classList.add(u.sliderTabHandle);var e=t.target.parentElement;e===this.element&&(e.querySelector("."+u.sliderTrack).classList.add(u.sliderTabTrack),"Range"!==this.type&&"MinRange"!==this.type||e.querySelector("."+u.rangeBar).classList.add(u.sliderTabRange)),"Range"===this.type&&(t.target.previousSibling.classList.contains(u.sliderHandle)?this.activeHandle=2:this.activeHandle=1),this.getHandle().focus(),this.tooltipToggle(this.getHandle())}this.closeTooltip(),this.changeEvent("changed",t)},e.prototype.hover=function(t){if(!i.i(s.isNullOrUndefined)(t))if("mouseover"===t.type||"touchmove"===t.type||"mousemove"===t.type||"pointermove"===t.type||"touchstart"===t.type)this.sliderContainer.classList.add(u.sliderHover);else{this.sliderContainer.classList.remove(u.sliderHover);var e=t.currentTarget;this.tooltip.isVisible&&"Always"!==this.tooltip.showOn&&this.tooltipObj&&this.isMaterialTooltip&&!e.classList.contains(u.sliderHandleFocused)&&!e.classList.contains(u.sliderTabHandle)&&this.closeMaterialTooltip()}},e.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("."+u.sliderTabHandle)&&this.element.querySelector("."+u.sliderTabHandle).classList.remove(u.sliderTabHandle),this.element.querySelector("."+u.sliderTabTrack)&&(this.element.querySelector("."+u.sliderTabTrack).classList.remove(u.sliderTabTrack),"Range"!==this.type&&"MinRange"!==this.type||!this.element.querySelector("."+u.sliderTabRange)||this.element.querySelector("."+u.sliderTabRange).classList.remove(u.sliderTabRange)),this.hiddenInput.focus(),this.hiddenInput.blur(),this.isElementFocused=!1)},e.prototype.removeElement=function(t){t.parentNode&&t.parentNode.removeChild(t)},e.prototype.changeSliderType=function(t,e){this.isMaterialTooltip&&this.materialHandle&&(this.sliderContainer.classList.remove(u.materialSlider),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&&!i.i(s.isNullOrUndefined)(this.tooltipObj)&&(this.tooltipObj.destroy(),this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0),this.limits.enabled&&("MinRange"===t||"Default"===t?i.i(s.isNullOrUndefined)(this.limitBarFirst)||(this.removeElement(this.limitBarFirst),this.limitBarFirst=void 0):i.i(s.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(!1),"Range"===this.type&&this.wireSecondHandleEvt(!1),this.setValue(),this.tooltip.isVisible&&(this.renderTooltip(),this.wireMaterialTooltipEvent(!1)),this.setBarColor(),"tooltip"!==e&&this.updateConfig()},e.prototype.changeRtl=function(){if(this.enableRtl||"Range"!==this.type||(this.value=[this.handleVal2,this.handleVal1]),this.updateConfig(),this.tooltip.isVisible&&this.tooltipObj.refresh(this.firstHandle),this.showButtons){var t=this.enableRtl&&"Vertical"!==this.orientation;i.i(s.attributes)(t?this.secondBtn:this.firstBtn,{"aria-label":"Decrease",title:"Decrease"}),i.i(s.attributes)(t?this.firstBtn:this.secondBtn,{"aria-label":"Increase",title:"Increase"})}},e.prototype.changeOrientation=function(){this.changeSliderType(this.type,"null")},e.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()},e.prototype.limitsPropertyChange=function(){this.limits.enabled?(i.i(s.isNullOrUndefined)(this.limitBarFirst)&&"Range"!==this.type&&this.createLimitBar(),i.i(s.isNullOrUndefined)(this.limitBarFirst)&&i.i(s.isNullOrUndefined)(this.limitBarSecond)&&"Range"===this.type&&this.createLimitBar(),this.setLimitBar(),this.setValue()):(i.i(s.isNullOrUndefined)(this.limitBarFirst)||i.i(s.detach)(this.limitBarFirst),i.i(s.isNullOrUndefined)(this.limitBarSecond)||i.i(s.detach)(this.limitBarSecond))},e.prototype.getPersistData=function(){var t=["value"];return this.addOnPersist(t)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.unwireEvents(),window.removeEventListener("resize",this.onresize),i.i(s.removeClass)([this.sliderContainer],[u.sliderDisabled]),this.firstHandle.removeAttribute("aria-orientation"),"Range"===this.type&&this.secondHandle.removeAttribute("aria-orientation"),this.sliderContainer.parentNode.insertBefore(this.element,this.sliderContainer),i.i(s.detach)(this.sliderContainer),this.tooltip.isVisible&&this.tooltipObj.destroy(),this.element.innerHTML=""},e.prototype.onPropertyChanged=function(t,e){for(var n=this,a=0,r=Object.keys(t);a<r.length;a++){var l=r[a];switch(l){case"cssClass":this.setCSSClass(e.cssClass);break;case"value":if(t&&e){var o=i.i(s.isNullOrUndefined)(t.value)?"Range"===this.type?[this.min,this.max]:this.min:t.value;this.setProperties({value:o},!0),i.i(s.isNullOrUndefined)(e.value)||e.value.toString()===o.toString()||(this.setValue(),this.refreshTooltip(this.tooltipTarget),"Range"===this.type&&(i.i(s.isNullOrUndefined)(t.value)||e.value[1]===o[1]?this.activeHandle=1:this.activeHandle=2))}break;case"min":case"step":case"max":this.setMinMaxValue();break;case"tooltip":i.i(s.isNullOrUndefined)(t.tooltip)||i.i(s.isNullOrUndefined)(e.tooltip)||(this.setTooltip(l),this.wireEvents());break;case"type":i.i(s.isNullOrUndefined)(e)||!Object.keys(e).length||i.i(s.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":i.i(s.isNullOrUndefined)(this.sliderContainer.querySelector("."+u.scale))||(i.i(s.detach)(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(t){t.match(/e-scale-/)&&n.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(u.sliderButtonClass),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()}}},e.prototype.setReadOnly=function(){this.readonly?(this.unwireEvents(),this.sliderContainer.classList.add(u.readonly)):(this.wireEvents(),this.sliderContainer.classList.remove(u.readonly))},e.prototype.setMinMaxValue=function(){var t=this;this.setValue(),this.refreshTooltip(this.tooltipTarget),i.i(s.isNullOrUndefined)(this.sliderContainer.querySelector("."+u.scale))||this.ul&&(i.i(s.detach)(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(e){e.match(/e-scale-/)&&t.sliderContainer.classList.remove(e)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex())},e.prototype.setZindex=function(){this.zIndex=6,i.i(s.isNullOrUndefined)(this.ticks)||"None"===this.ticks.placement||(this.ul.style.zIndex=this.zIndex+-7+"",this.element.style.zIndex=this.zIndex+2+""),this.isMaterial||i.i(s.isNullOrUndefined)(this.ticks)||"Both"!==this.ticks.placement||(this.element.style.zIndex=this.zIndex+2+""),this.firstHandle.style.zIndex=this.zIndex+3+"","Range"===this.type&&(this.secondHandle.style.zIndex=this.zIndex+4+"")},e.prototype.setTooltip=function(t){this.changeSliderType(this.type,t)},e.prototype.setBarColor=function(){for(var t,e,n=this.sliderTrack.lastElementChild;n;)this.sliderTrack.removeChild(n),n=this.sliderTrack.lastElementChild;for(var a=0;a<this.colorRange.length;a++)if(!i.i(s.isNullOrUndefined)(this.colorRange[a].start)&&!i.i(s.isNullOrUndefined)(this.colorRange[a].end)&&this.colorRange[a].end>this.colorRange[a].start){this.colorRange[a].start<this.min&&(this.colorRange[a].start=this.min),this.colorRange[a].end>this.max&&(this.colorRange[a].end=this.max);var r=this.checkHandlePosition(this.colorRange[a].start),l=this.checkHandlePosition(this.colorRange[a].end),o=this.createElement("div");o.style.backgroundColor=this.colorRange[a].color,o.style.border="1px solid "+this.colorRange[a].color,"Horizontal"===this.orientation?(e=u.sliderHorizantalColor,t=this.enableRtl?i.i(s.isNullOrUndefined)(this.customValues)?this.checkHandlePosition(this.max)-this.checkHandlePosition(this.colorRange[a].end):this.checkHandlePosition(this.customValues.length-this.colorRange[a].end-1):this.checkHandlePosition(this.colorRange[a].start),o.style.width=l-r+"px",o.style.left=t+"px"):(e=u.sliderVerticalColor,t=this.checkHandlePosition(this.colorRange[a].start),o.style.height=l-r+"px",o.style.bottom=t+"px"),o.classList.add(e),this.sliderTrack.appendChild(o)}},e.prototype.getModuleName=function(){return"slider"},r([i.i(s.Property)(null)],e.prototype,"value",void 0),r([i.i(s.Property)(null)],e.prototype,"customValues",void 0),r([i.i(s.Property)(1)],e.prototype,"step",void 0),r([i.i(s.Property)(null)],e.prototype,"width",void 0),r([i.i(s.Property)(0)],e.prototype,"min",void 0),r([i.i(s.Property)(100)],e.prototype,"max",void 0),r([i.i(s.Property)(!1)],e.prototype,"readonly",void 0),r([i.i(s.Property)("Default")],e.prototype,"type",void 0),r([i.i(s.Collection)([{}],o)],e.prototype,"colorRange",void 0),r([i.i(s.Complex)({},l)],e.prototype,"ticks",void 0),r([i.i(s.Complex)({},h)],e.prototype,"limits",void 0),r([i.i(s.Property)(!0)],e.prototype,"enabled",void 0),r([i.i(s.Complex)({},d)],e.prototype,"tooltip",void 0),r([i.i(s.Property)(!1)],e.prototype,"showButtons",void 0),r([i.i(s.Property)(!0)],e.prototype,"enableAnimation",void 0),r([i.i(s.Property)("Horizontal")],e.prototype,"orientation",void 0),r([i.i(s.Property)("")],e.prototype,"cssClass",void 0),r([i.i(s.Property)(!1)],e.prototype,"enableHtmlSanitizer",void 0),r([i.i(s.Event)()],e.prototype,"created",void 0),r([i.i(s.Event)()],e.prototype,"change",void 0),r([i.i(s.Event)()],e.prototype,"changed",void 0),r([i.i(s.Event)()],e.prototype,"renderingTicks",void 0),r([i.i(s.Event)()],e.prototype,"renderedTicks",void 0),r([i.i(s.Event)()],e.prototype,"tooltipChange",void 0),e=r([s.NotifyPropertyChanges],e)}(s.Component)},function(t,e){t.exports=i},function(t,e,i){"use strict";var s=i(18);i.d(e,"a",function(){return s.a})},function(t,e,i){"use strict";var s=i(6);i.d(e,"a",function(){return s.a})},function(t,e,i){"use strict";var s=i(19);i.d(e,"a",function(){return s.a}),i.d(e,"b",function(){return s.b}),i.d(e,"c",function(){return s.c})},function(t,e,i){"use strict";var s=i(3);i.d(e,"a",function(){return s.a}),i.d(e,"b",function(){return s.b}),i.d(e,"c",function(){return s.c}),i.d(e,"d",function(){return s.d}),i.d(e,"e",function(){return s.e}),i.d(e,"f",function(){return s.f}),i.d(e,"g",function(){return s.g}),i.d(e,"h",function(){return s.h}),i.d(e,"i",function(){return s.i}),i.d(e,"j",function(){return s.j}),i.d(e,"k",function(){return s.k}),i.d(e,"l",function(){return s.l}),i.d(e,"m",function(){return s.m}),i.d(e,"n",function(){return s.n}),i.d(e,"o",function(){return s.o}),i.d(e,"p",function(){return s.p}),i.d(e,"q",function(){return s.q}),i.d(e,"r",function(){return s.r}),i.d(e,"s",function(){return s.s}),i.d(e,"t",function(){return s.t}),i.d(e,"u",function(){return s.u}),i.d(e,"v",function(){return s.v});var n=i(22);i.d(e,"w",function(){return n.a})},function(t,e,i){"use strict";var s=i(25);i.d(e,"a",function(){return s.a}),i.d(e,"b",function(){return s.b}),i.d(e,"c",function(){return s.c})},function(t,e,i){"use strict";var s=i(26);i.d(e,"a",function(){return s.a})},function(t,e,i){"use strict";var s=i(7);i.d(e,"a",function(){return s.b}),i.d(e,"b",function(){return s.c}),i.d(e,"c",function(){return s.d}),i.d(e,"d",function(){return s.e}),i.d(e,"e",function(){return s.a})},function(t,e,i){"use strict";var s=i(27);i.d(e,"a",function(){return s.a})},function(t,e,i){"use strict";var s=i(28);i.d(e,"a",function(){return s.a}),i.d(e,"b",function(){return s.b}),i.d(e,"c",function(){return s.c}),i.d(e,"d",function(){return s.d})},function(t,e,i){"use strict";i.d(e,"a",function(){return O});var s=i(0),n=(i.n(s),i(8)),a=(i.n(n),i(2)),r=(i.n(a),i(4)),l=i(5),o=i(7),h=this&&this.__extends||function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),d=this&&this.__decorate||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;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},u="e-apply",c="e-ctrl-btn",p="e-switch-ctrl-btn",m="e-hide-hex-value",f="e-hide-switchable-value",v="e-hide-value",g="e-hsv-color",y="e-selected-value",b="e-mode-switch-btn",C="e-nocolor-item",E="e-opacity-value",S="e-preview-container",x="e-show-value",T="e-selected",k="e-tile",P={default:["#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"]},O=function(t){function e(e,i){return t.call(this,e,i)||this}return h(e,t),e.prototype.preRender=function(){var t=this.element;this.formElement=i.i(s.closest)(this.element,"form"),this.formElement&&s.EventHandler.add(this.formElement,"reset",this.formResetHandler,this);var e={Apply:"Apply",Cancel:"Cancel",ModeSwitcher:"Switch Mode"};this.l10n=new s.L10n("colorpicker",e,this.locale),t.getAttribute("ejs-for")&&!t.getAttribute("name")&&t.setAttribute("name",t.id)},e.prototype.render=function(){this.initWrapper(),this.inline?this.createWidget():this.createSplitBtn(),this.enableOpacity||i.i(s.addClass)([this.container.parentElement],"e-hide-opacity"),this.renderComplete()},e.prototype.initWrapper=function(){var t=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"});this.element.parentNode.insertBefore(t,this.element),t.appendChild(this.element),i.i(s.attributes)(this.element,{tabindex:"-1",spellcheck:"false","aria-label":"colorpicker"}),this.container=this.createElement("div",{className:"e-container"}),this.getWrapper().appendChild(this.container);var e=this.value?this.roundValue(this.value).toLowerCase():"#008000ff";this.noColor&&"Palette"===this.mode&&""===this.value&&(e="");var n=e.slice(0,7);i.i(s.isNullOrUndefined)(this.initialInputValue)&&(this.initialInputValue=n),this.element.value=n,this.enableOpacity?this.setProperties({value:e},!0):this.setProperties({value:n},!0),this.enableRtl&&t.classList.add("e-rtl"),this.cssClass&&i.i(s.addClass)([t],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.tileRipple=i.i(s.rippleEffect)(this.container,{selector:"."+k}),this.ctrlBtnRipple=i.i(s.rippleEffect)(this.container,{selector:".e-btn"})},e.prototype.getWrapper=function(){return this.element.parentElement},e.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),s.Browser.isDevice&&this.refreshPopupPos()},e.prototype.createSplitBtn=function(){var t=this,e=this.createElement("button",{className:"e-split-colorpicker"});this.getWrapper().appendChild(e),this.splitBtn=new n.SplitButton({iconCss:"e-selected-color",target:this.container,disabled:this.disabled,enableRtl:this.enableRtl,createPopupOnClick:this.createPopupOnClick,open:this.onOpen.bind(this),click:function(){t.trigger("change",{currentValue:{hex:t.value.slice(0,7),rgba:t.convertToRgbString(t.hexToRgb(t.value))},previousValue:{hex:null,rgba:null},value:t.value})}}),this.splitBtn.createElement=this.createElement,this.splitBtn.appendTo(e);var r=this.createElement("span",{className:"e-split-preview"});i.i(s.select)(".e-selected-color",e).appendChild(r),r.style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value));var l=this.getPopupEle();if(i.i(s.addClass)([l],"e-colorpicker-popup"),this.cssClass&&i.i(s.addClass)([l],this.cssClass.replace(/\s+/g," ").trim().split(" ")),s.Browser.isDevice){var o=this.getPopupInst();o.relateTo=document.body,o.position={X:"center",Y:"center"},o.targetType="container",o.collision={X:"fit",Y:"fit"},o.offsetY=4,l.style.zIndex=i.i(a.getZindexPartial)(this.splitBtn.element).toString()}this.bindCallBackEvent()},e.prototype.onOpen=function(){this.trigger("open",{element:this.container})},e.prototype.getPopupInst=function(){return i.i(s.getInstance)(this.getPopupEle(),a.Popup)},e.prototype.bindCallBackEvent=function(){var t=this;this.splitBtn.beforeOpen=function(e){var a=new n.Deferred;return t.trigger("beforeOpen",e,function(n){if(!n.cancel){var r=t.getPopupEle();r.style.top=i.i(s.formatUnit)(0+pageYOffset),r.style.left=i.i(s.formatUnit)(0+pageXOffset),r.style.display="block",t.createWidget(),r.style.display="",s.Browser.isDevice&&(t.modal=t.createElement("div"),t.modal.className="e-"+t.getModuleName()+" e-modal",t.modal.style.display="none",document.body.insertBefore(t.modal,r),document.body.className+=" e-colorpicker-overflow",t.modal.style.display="block",t.modal.style.zIndex=(Number(r.style.zIndex)-1).toString())}e.cancel=n.cancel,a.resolve(n)}),a},this.splitBtn.beforeClose=function(e){var a=new n.Deferred;if(i.i(s.isNullOrUndefined)(e.event))a.resolve(e);else{var r={element:t.container,event:e.event,cancel:!1};t.trigger("beforeClose",r,function(i){s.Browser.isDevice&&e.event.target===t.modal&&(i.cancel=!0),i.cancel||t.onPopupClose(),e.cancel=i.cancel,a.resolve(i)})}return a}},e.prototype.onPopupClose=function(){this.unWireEvents(),this.destroyOtherComp(),this.container.style.width="",i.i(s.select)(".e-split-preview",this.splitBtn.element).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.container.innerHTML="",i.i(s.removeClass)([this.container],["e-color-picker","e-color-palette"]),s.Browser.isDevice&&this.modal&&(i.i(s.removeClass)([document.body],"e-colorpicker-overflow"),this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},e.prototype.createPalette=function(){if(i.i(s.classList)(this.container,["e-color-palette"],["e-color-picker"]),this.presetColors){var t=this.createElement("div",{className:"e-custom-palette"});this.appendElement(t);var e=Object.keys(this.presetColors);if(1===e.length)this.appendPalette(this.presetColors[e[0]],e[0],t);else for(var n=0,a=e.length;n<a;n++)this.appendPalette(this.presetColors[e[n]],e[n],t);i.i(s.selectAll)(".e-row",t).length>10&&i.i(s.addClass)([t],"e-palette-group")}else this.appendPalette(P.default,"default");"Palette"===this.mode&&!this.modeSwitcher&&this.noColor&&this.setNoColor();var r=parseInt(getComputedStyle(this.container).borderBottomWidth,10);this.container.style.width=i.i(s.formatUnit)(this.container.children[0].offsetWidth+r+r),this.rgb=this.hexToRgb(this.roundValue(this.value)),this.hsv=this.rgbToHsv.apply(this,this.rgb)},e.prototype.firstPaletteFocus=function(){i.i(s.select)("."+T,this.container.children[0])||i.i(s.selectAll)(".e-palette",this.container)[0].focus()},e.prototype.appendPalette=function(t,e,i){var s=this.createElement("div",{className:"e-palette",attrs:{tabindex:"0",role:"grid"}});i?i.appendChild(s):this.appendElement(s);for(var n,a,r,l=0,o=t.length;l<o;l++)0!==l&&l%this.columns!=0||(n=this.createElement("div",{className:"e-row",attrs:{role:"row"}}),s.appendChild(n)),r=this.roundValue(t[l]).toLowerCase(),a=this.createElement("span",{className:k,attrs:{role:"gridcell","aria-label":r,"aria-selected":"false",tabindex:"0"}}),this.trigger("beforeTileRender",{element:a,presetName:e,value:t[l]}),n.appendChild(a),this.value===r&&(this.addTileSelection(a),s.focus()),a.style.backgroundColor=this.convertToRgbString(this.hexToRgb(r))},e.prototype.setNoColor=function(){var t=this.container.querySelector(".e-row").children[0];t.classList.add(C),this.value||(t.classList.add(T),i.i(s.closest)(t,".e-palette").focus()),["aria-selected","aria-label"].forEach(function(e){t.removeAttribute(e)}),t.style.backgroundColor=""},e.prototype.appendElement=function(t,e){void 0===e&&(e=0);var i=this.container.children[e];i?this.container.insertBefore(t,i):this.container.appendChild(t)},e.prototype.addTileSelection=function(t){t.classList.add(T),t.setAttribute("aria-selected","true")},e.prototype.createPicker=function(){i.i(s.classList)(this.container,["e-color-picker"],["e-color-palette"]);var t=this.createElement("div",{className:"e-hsv-container"});this.appendElement(t),t.appendChild(this.createElement("div",{className:g}));var e=this.createElement("span",{className:"e-handler",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()},e.prototype.setHsvContainerBg=function(t){void 0===t&&(t=this.hsv[0]),this.getHsvContainer().style.backgroundColor=this.convertToRgbString(this.hsvToRgb(t,100,100,1))},e.prototype.getHsvContainer=function(){return i.i(s.select)(".e-hsv-container",this.container)},e.prototype.setHandlerPosition=function(){var t=this.getDragHandler(),e=i.i(s.select)("."+g,this.container);this.enableRtl?t.style.left=i.i(s.formatUnit)(e.offsetWidth*Math.abs(100-this.hsv[1])/100):t.style.left=i.i(s.formatUnit)(e.offsetWidth*this.hsv[1]/100),t.style.top=i.i(s.formatUnit)(e.offsetHeight*(100-this.hsv[2])/100)},e.prototype.createSlider=function(){var t=this.createElement("div",{className:"e-slider-preview"});this.appendElement(t,1),this.createPreview(t);var e=this.createElement("div",{className:"e-colorpicker-slider"});t.insertBefore(e,t.children[0]);var i=this.createElement("div",{className:"e-hue-slider"});e.appendChild(i),this.hueSlider=new o.a({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(i),this.enableOpacity&&(i=this.createElement("div",{className:"e-opacity-slider"}),e.appendChild(i),this.createOpacitySlider(i))},e.prototype.createOpacitySlider=function(t){this.opacitySlider=new o.a({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()},e.prototype.updateOpacitySliderBg=function(){var t=this.enableRtl?"to left":"to right",e=i.i(s.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%)")},e.prototype.hueChange=function(t){this.hsv[0]=t.value,this.setHsvContainerBg(),this.convertToOtherFormat()},e.prototype.opacityChange=function(t){var e=t.value,i=this.rgbToHex(this.rgb);this.hsv[3]=e/100,this.rgb[3]=e/100;var s=this.rgbToHex(this.rgb);this.updateOpacityInput(e);var n=this.convertToRgbString(this.rgb);this.updatePreview(n),this.triggerEvent(s,i,n)},e.prototype.updateOpacityInput=function(t){if(this.enableOpacity&&!this.getWrapper().classList.contains(v)){var e=i.i(s.getInstance)(i.i(s.select)("."+E,this.container),l.a);e.value=t,e.dataBind()}},e.prototype.createPreview=function(t){var e=this.createElement("div",{className:S});t.appendChild(e);var i=this.createElement("span",{className:"e-preview e-current"});e.appendChild(i);var s=this.convertToRgbString(this.rgb);i.style.backgroundColor=s,i=this.createElement("span",{className:"e-preview e-previous"}),e.appendChild(i),i.style.backgroundColor=s},e.prototype.isPicker=function(){return!this.container.classList.contains("e-color-palette")},e.prototype.getPopupEle=function(){return this.container.parentElement},e.prototype.createNumericInput=function(t,e,i,s){var n=this,a=new l.a({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)}});a.createElement=this.createElement,a.appendTo(t)},e.prototype.createInput=function(){var t=this.isPicker(),e=this.getWrapper();if(t&&!e.classList.contains(v)||!t&&e.classList.contains(x)){var i=this.createElement("div",{className:y});t?this.appendElement(i,2):this.appendElement(i,1);var s=this.createElement("div",{className:"e-input-container"});if(i.appendChild(s),e.classList.contains("e-hide-valueswitcher")||this.appendValueSwitchBtn(i),!e.classList.contains(m)){var n=this.createElement("input",{className:"e-hex",attrs:{maxlength:"7",spellcheck:"false","aria-label":"HEX"}});s.appendChild(n),r.a.createInput({element:n,floatLabelType:"Always",properties:{placeholder:"HEX",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker()}},this.createElement),r.a.setValue(this.value.slice(0,7),n),n.addEventListener("input",this.inputHandler.bind(this))}if(!e.classList.contains(f)){var a=void 0,l=void 0;this.isRgb?(a="RGB",l=this.rgb):(a="HSV",l=this.hsv);for(var o=["rh","gs","bv"],h=0;h<3;h++)this.createNumericInput(s.appendChild(this.createElement("input",{className:"e-"+o[h]+"-value"})),l[h],a[h],255);this.enableOpacity&&this.appendOpacityValue(s)}}},e.prototype.appendOpacityValue=function(t){this.createNumericInput(t.appendChild(this.createElement("input",{className:E})),100*this.rgb[3],"A",100)},e.prototype.appendValueSwitchBtn=function(t){var e=this.createElement("button",{className:"e-icons e-css e-btn e-flat e-icon-btn e-value-switch-btn",attrs:{title:"Toggle format"}});t.appendChild(e),this.isPicker()&&!this.getWrapper().classList.contains(f)&&e.addEventListener("click",this.formatSwitchHandler.bind(this))},e.prototype.createCtrlBtn=function(){if(this.modeSwitcher||this.showButtons){this.l10n.setLocale(this.locale);var t=this.createElement("div",{className:p});if(this.container.appendChild(t),this.showButtons){var e=this.createElement("div",{className:c});t.appendChild(e);var i=this.l10n.getConstant("Apply");e.appendChild(this.createElement("button",{innerHTML:i,className:"e-btn e-css e-flat e-primary e-small "+u,attrs:{title:i}}));var s=this.l10n.getConstant("Cancel");e.appendChild(this.createElement("button",{innerHTML:s,className:"e-btn e-css e-flat e-small e-cancel",attrs:{title:s}}))}this.modeSwitcher&&this.appendModeSwitchBtn()}},e.prototype.appendModeSwitchBtn=function(){var t=this.createElement("button",{className:"e-icons e-btn e-flat e-icon-btn "+b,attrs:{title:this.l10n.getConstant("ModeSwitcher")}});i.i(s.select)("."+p,this.container).insertBefore(t,i.i(s.select)("."+c,this.container))},e.prototype.createDragTooltip=function(){var t=this,e=new a.Tooltip({opensOn:"Custom",showTipPointer:!1,cssClass:"e-color-picker-tooltip",beforeOpen:function(e){t.tooltipEle=e.element},animation:{open:{effect:"None"},close:{effect:"None"}}});e.createElement=this.createElement,e.appendTo(this.container),e.open(this.container),this.tooltipEle.style.zIndex=i.i(a.getZindexPartial)(this.tooltipEle).toString(),i.i(s.select)(".e-tip-content",this.tooltipEle).appendChild(this.createElement("div",{className:"e-tip-transparent"}))},e.prototype.getTooltipInst=function(){return i.i(s.getInstance)(this.container,a.Tooltip)},e.prototype.setTooltipOffset=function(t){this.getTooltipInst().offsetY=t},e.prototype.toggleDisabled=function(t){t?this.getWrapper().classList.add("e-disabled"):this.getWrapper().classList.remove("e-disabled"),this.showButtons&&[].slice.call(i.i(s.selectAll)(".e-btn",this.container)).forEach(function(e){t?i.i(s.attributes)(e,{disabled:""}):e.removeAttribute("disabled")})},e.prototype.convertToRgbString=function(t){return t.length?4===t.length?"rgba("+t.join()+")":"rgb("+t.join()+")":""},e.prototype.convertToHsvString=function(t){return 4===t.length?"hsva("+t.join()+")":"hsv("+t.join()+")"},e.prototype.updateHsv=function(){this.hsv[1]=this.hsv[1]>100?100:this.hsv[1],this.hsv[2]=this.hsv[2]>100?100:this.hsv[2],this.setHandlerPosition()},e.prototype.convertToOtherFormat=function(t){void 0===t&&(t=!1);var e=this.rgbToHex(this.rgb);this.rgb=this.hsvToRgb.apply(this,this.hsv);var i=this.rgbToHex(this.rgb),s=this.convertToRgbString(this.rgb);this.updatePreview(s),this.updateInput(i),this.triggerEvent(i,e,s,t)},e.prototype.updateInput=function(t){var e=this.getWrapper();e.classList.contains(v)||(e.classList.contains(m)||r.a.setValue(t.substr(0,7),i.i(s.select)(".e-hex",this.container)),e.classList.contains(f)||(this.isRgb?this.updateValue(this.rgb,!1):this.updateValue(this.hsv,!1)))},e.prototype.updatePreview=function(t){this.enableOpacity&&this.updateOpacitySliderBg(),i.i(s.select)(".e-tip-transparent",this.tooltipEle).style.backgroundColor=t,i.i(s.select)("."+S+" .e-current",this.container).style.backgroundColor=t,i.i(s.select)("."+S+" .e-previous",this.container).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value))},e.prototype.getDragHandler=function(){return i.i(s.select)(".e-handler",this.container)},e.prototype.removeTileSelection=function(){[].slice.call(i.i(s.selectAll)("."+T,this.container.children[0])).forEach(function(t){t.classList.remove(T),t.setAttribute("aria-selected","false")})},e.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)})},e.prototype.getValue=function(t,e){if(t||(t=this.value),e=e?e.toLowerCase():"hex","r"===t[0]){var i=this.convertRgbToNumberArray(t);if("hex"===e||"hexa"===e){var s=this.rgbToHex(i);return"hex"===e?s.slice(0,7):s}return"hsv"===e?this.convertToHsvString(this.rgbToHsv.apply(this,i.slice(0,3))):"hsva"===e?this.convertToHsvString(this.rgbToHsv.apply(this,i)):"null"}if("h"===t[0]){var i=this.hsvToRgb.apply(this,this.convertRgbToNumberArray(t));if("rgba"===e)return this.convertToRgbString(i);if("hex"===e||"hexa"===e){var s=this.rgbToHex(i);return"hex"===e?s.slice(0,7):s}return"rgb"===e?this.convertToRgbString(i.slice(0,3)):"null"}t=this.roundValue(t);var n=this.hexToRgb(t);return"rgb"!==e&&"hsv"!==e||(n=n.slice(0,3)),"rgba"===e||"rgb"===e?this.convertToRgbString(n):"hsva"===e||"hsv"===e?this.convertToHsvString(this.rgbToHsv.apply(this,n)):"hex"===e?t.slice(0,7):"a"===e?n[3].toString():"null"},e.prototype.toggle=function(){this.container.parentElement.classList.contains("e-popup-close")?this.splitBtn.toggle():this.closePopup(null)},e.prototype.getModuleName=function(){return"colorpicker"},e.prototype.getPersistData=function(){return this.addOnPersist(["value"])},e.prototype.wireEvents=function(){if(this.isPicker()){var t=this.getDragHandler();s.EventHandler.add(t,"keydown",this.pickerKeyDown,this);var e=i.i(s.select)("."+c,this.container);e&&s.EventHandler.add(e,"keydown",this.ctrlBtnKeyDown,this),s.EventHandler.add(this.getHsvContainer(),"mousedown touchstart",this.handlerDown,this),(this.modeSwitcher||this.showButtons)&&this.addCtrlSwitchEvent(),s.EventHandler.add(i.i(s.select)(".e-previous",this.container),"click",this.previewHandler,this)}else s.EventHandler.add(this.container,"click",this.paletteClickHandler,this),s.EventHandler.add(this.container,"keydown",this.paletteKeyDown,this)},e.prototype.formResetHandler=function(){this.value=this.initialInputValue,i.i(s.attributes)(this.element,{value:this.initialInputValue})},e.prototype.addCtrlSwitchEvent=function(){var t=i.i(s.select)("."+p,this.container);t&&s.EventHandler.add(t,"click",this.btnClickHandler,this)},e.prototype.ctrlBtnKeyDown=function(t){if(13===t.keyCode){if(i.i(s.select)("."+u,this.container)){var e=this.rgbToHex(this.rgb);this.triggerChangeEvent(e)}this.splitBtn.element.focus()}},e.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)}},e.prototype.enterKeyHandler=function(t,e){this.triggerChangeEvent(t),this.inline||this.splitBtn.element.focus()},e.prototype.closePopup=function(t){var e=this,i={element:this.container,event:t,cancel:!1};this.trigger("beforeClose",i,function(t){t.cancel||(e.splitBtn.toggle(),e.onPopupClose())})},e.prototype.triggerChangeEvent=function(t){var e=t.slice(0,7);this.trigger("change",{currentValue:{hex:e,rgba:this.convertToRgbString(this.rgb)},previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:this.enableOpacity?t:e}),this.enableOpacity?this.setProperties({value:t},!0):this.setProperties({value:e},!0),this.element.value=e||"#000000"},e.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)},e.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(),this.getDragHandler().focus(),s.EventHandler.add(document,"mousemove touchmove",this.handlerMove,this),s.EventHandler.add(document,"mouseup touchend",this.handlerEnd,this)},e.prototype.handlerMove=function(t){"touchmove"!==t.type&&t.preventDefault();var e,n;"mousemove"===t.type?(e=Math.abs(t.pageX-pageXOffset),n=Math.abs(t.pageY-pageYOffset)):(e=Math.abs(t.changedTouches[0].pageX-pageXOffset),n=Math.abs(t.changedTouches[0].pageY-pageYOffset)),this.setHsv(e,n);var a=this.getDragHandler();this.updateHsv(),this.convertToOtherFormat(),this.getTooltipInst().refresh(a),this.tooltipEle.style.transform||(Math.abs(this.clientX-e)>8||Math.abs(this.clientY-n)>8)&&(i.i(s.select)("."+g,this.container).style.cursor="pointer",a.style.transition="none",this.inline||(this.tooltipEle.style.zIndex=(parseInt(this.getPopupEle().style.zIndex,10)+1).toString()),this.tooltipEle.style.transform="rotate(45deg)",a.classList.add("e-hide-handler"))},e.prototype.setHsv=function(t,e){var n=i.i(s.select)("."+g,this.container),a=n.getBoundingClientRect();t=this.enableRtl?t>a.right?0:Math.abs(t-a.right):t>a.left?Math.abs(t-a.left):0,e=e>a.top?Math.abs(e-a.top):0,this.hsv[2]=Math.round(10*Number(100*(n.offsetHeight-Math.max(0,Math.min(n.offsetHeight,e-n.offsetTop)))/n.offsetHeight))/10,this.hsv[1]=Math.round(10*Number(100*Math.max(0,Math.min(n.offsetWidth,t-n.offsetLeft))/n.offsetWidth))/10},e.prototype.handlerEnd=function(t){"touchend"!==t.type&&t.preventDefault(),s.EventHandler.remove(document,"mousemove touchmove",this.handlerMove),s.EventHandler.remove(document,"mouseup touchend",this.handlerEnd);var e=this.getDragHandler();i.i(s.select)("."+g,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)},e.prototype.btnClickHandler=function(t){var e=t.target;i.i(s.closest)(e,"."+b)?(t.stopPropagation(),this.switchToPalette()):(e.classList.contains(u)||e.classList.contains("e-cancel"))&&this.ctrlBtnClick(e,t)},e.prototype.switchToPalette=function(){this.trigger("beforeModeSwitch",{element:this.container,mode:"Palette"}),this.unWireEvents(),this.destroyOtherComp(),i.i(s.detach)(i.i(s.select)(".e-slider-preview",this.container)),this.getWrapper().classList.contains(v)||i.i(s.remove)(i.i(s.select)("."+y,this.container)),i.i(s.detach)(this.getHsvContainer()),this.createPalette(),this.firstPaletteFocus(),this.createInput(),this.refreshPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Palette"})},e.prototype.refreshPopupPos=function(){if(!this.inline){var t=this.getPopupEle();t.style.left=i.i(s.formatUnit)(0+pageXOffset),t.style.top=i.i(s.formatUnit)(0+pageYOffset),this.getPopupInst().refreshPosition(this.splitBtn.element.parentElement)}},e.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)},e.prototype.updateValue=function(t,e,n,a){for(var r,o=["e-rh-value","e-gs-value","e-bv-value"],h=0,d=o.length;h<d;h++)r=i.i(s.getInstance)(i.i(s.select)("."+o[h],this.container),l.a),r.value=Math.round(t[h]),e&&(r.placeholder=o[h].substr(n,1).toUpperCase(),r.max=a?a[h]:255),r.dataBind()},e.prototype.previewHandler=function(t){var e=t.target,n=this.rgbToHex(this.rgb);this.rgb=this.convertRgbToNumberArray(e.style.backgroundColor),this.rgb[3]||(this.rgb[3]=1);var a=this.rgbToHex(this.rgb),r=this.rgbToHsv.apply(this,this.rgb);r[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:r[0]},!0),this.hueSlider.refresh()),this.setHsvContainerBg(r[0]),this.enableOpacity&&r[3]!==this.hsv[3]&&(this.opacitySlider.setProperties({value:100*r[3]},!0),this.opacitySlider.refresh(),this.updateOpacitySliderBg()),this.hsv=r,this.setHandlerPosition(),this.updateInput(a),i.i(s.select)("."+S+" .e-current",this.container).style.backgroundColor=this.convertToRgbString(this.rgb),this.triggerEvent(a,n,this.convertToRgbString(this.rgb))},e.prototype.paletteClickHandler=function(t){t.preventDefault();var e=t.target;if(e.classList.contains(k)){if(this.removeTileSelection(),this.addTileSelection(e),e.classList.contains(C))this.noColorTile();else{var n=e.getAttribute("aria-label"),a=this.rgbToHex(this.rgb);this.rgb=this.hexToRgb(this.roundValue(n)),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(x)&&this.updateInput(n),this.triggerEvent(n,a,this.convertToRgbString(this.rgb))}this.inline||this.showButtons||this.closePopup(t)}else i.i(s.closest)(e,"."+b)?this.switchToPicker():e.classList.contains(u)||e.classList.contains("e-cancel")?this.ctrlBtnClick(e,t):this.getWrapper().classList.contains(x)&&i.i(s.closest)(e,".e-value-switch-btn")&&this.formatSwitchHandler()},e.prototype.noColorTile=function(t){void 0===t&&(t=!1);var e=this.rgbToHex(this.rgb);this.rgb=[],this.hsv=[],this.triggerEvent("",e,"",t)},e.prototype.switchToPicker=function(){var t=this.getWrapper();this.trigger("beforeModeSwitch",{element:this.container,mode:"Picker"}),this.unWireEvents(),[].slice.call(i.i(s.selectAll)(".e-palette",this.container)).forEach(function(t){i.i(s.detach)(t)}),t.classList.contains(x)&&i.i(s.detach)(i.i(s.select)("."+y,this.container)),this.container.style.width="";var e=i.i(s.select)(".e-custom-palette",this.container);this.presetColors&&i.i(s.remove)(e),this.createPicker(),this.getDragHandler().focus(),this.createInput(),this.refreshPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Picker"})},e.prototype.ctrlBtnClick=function(t,e){if(t.classList.contains(u)){var i=this.rgbToHex(this.rgb);this.triggerChangeEvent(i)}this.inline||(this.closePopup(e),this.splitBtn.element.focus())},e.prototype.paletteKeyDown=function(t){var e,n,a=t.target,r=[].slice.call(i.i(s.selectAll)("."+k,a));!a.classList.contains("e-palette")&&!a.classList.contains("e-tile")||9!==t.keyCode||t.shiftKey?(a.classList.contains("e-palette")||a.classList.contains("e-tile"))&&9===t.keyCode&&t.shiftKey&&this.splitBtn&&(this.splitBtn.element.focus(),t.preventDefault(),t.stopPropagation()):(this.modeSwitcher||this.showButtons)&&(this.getPopupEle().querySelector(".e-btn").focus(),t.preventDefault(),t.stopPropagation());var l=r.filter(function(t){return t.classList.contains("e-selected")}).pop();switch(!t.altKey&&t.keyCode){case 39:t.preventDefault(),e=l?r[this.tilePosition(r,l,this.enableRtl?-1:1)]:r[this.enableRtl?r.length-1:0],this.keySelectionChanges(e);break;case 37:t.preventDefault(),e=l?r[this.tilePosition(r,l,this.enableRtl?1:-1)]:r[this.enableRtl?0:r.length-1],this.keySelectionChanges(e);break;case 38:t.preventDefault(),n=l?this.tilePosition(r,l,-this.columns):0,e=r[n]?r[n]:r[n-this.columns],this.keySelectionChanges(e);break;case 40:t.preventDefault(),n=l?this.tilePosition(r,l,this.columns):r.length-1,r[n]?e=r[n]:(n%=r.length,n+=r[r.length-1].parentElement.childElementCount,e=r[n]),this.keySelectionChanges(e);break;case 13:if(t.preventDefault(),l){var o=l.getAttribute("aria-label");this.enterKeyHandler(o||"",t)}}},e.prototype.keySelectionChanges=function(t){if(this.removeTileSelection(),this.addTileSelection(t),t.classList.contains(C))this.noColorTile(!0);else{var e=t.getAttribute("aria-label"),i=this.rgbToHex(this.rgb);this.rgb=this.hexToRgb(e),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(x)&&this.updateInput(e),this.triggerEvent(e,i,this.convertToRgbString(this.rgb),!0)}},e.prototype.tilePosition=function(t,e,i){t=Array.prototype.slice.call(t);var s=t.length,n=this.columns-t[s-1].parentElement.childElementCount,a=t.indexOf(e);return a+=i,a<0?a+=s+n:a%=s+n,a},e.prototype.inputHandler=function(t){var e=t.target;if(e.value.length){var n,a;switch(i.i(s.select)(".e-float-text",e.parentElement).textContent){case"HEX":var r="";if(("#"===e.value[0]&&5!==e.value.length||"#"!==e.value[0]&&4!==e.value.length)&&(r=this.roundValue(e.value)),9!==r.length)return;a=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(r+r.substr(-2)),this.inputValueChange(this.rgbToHsv.apply(this,this.rgb),a,e.value);break;case"R":this.rgb[0]!==Number(e.value)&&(a=this.rgbToHex(this.rgb),this.rgb[0]=Number(e.value),n=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(n,a));break;case"G":this.rgb[1]!==Number(e.value)&&(a=this.rgbToHex(this.rgb),this.rgb[1]=Number(e.value),n=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(n,a));break;case"B":this.rgb[2]!==Number(e.value)&&(a=this.rgbToHex(this.rgb),this.rgb[2]=Number(e.value),n=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(n,a));break;case"H":this.hueSlider.value=Number(e.value);break;case"S":this.hsv[1]!==Number(e.value)&&(this.hsv[1]=Number(e.value),this.updateHsv(),this.convertToOtherFormat());break;case"V":this.hsv[2]!==Number(e.value)&&(this.hsv[2]=Number(e.value),this.updateHsv(),this.convertToOtherFormat());break;case"A":this.opacitySlider.value=Number(e.value)}}},e.prototype.inputValueChange=function(t,e,i){t[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:t[0]},!0),this.hueSlider.refresh(),this.setHsvContainerBg(t[0])),this.hsv=t;var s=this.rgbToHex(this.rgb);this.setHandlerPosition(),this.updateInput(i||s);var n=this.convertToRgbString(this.rgb);this.updatePreview(n),this.triggerEvent(s,e,n)},e.prototype.triggerEvent=function(t,e,i,s){void 0===s&&(s=!1);var n=t.slice(0,7);this.showButtons||s?this.trigger("select",{currentValue:{hex:n,rgba:i},previousValue:{hex:e.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(e))}}):(this.trigger("change",{currentValue:{hex:n,rgba:i},previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:t}),this.enableOpacity?this.setProperties({value:t},!0):this.setProperties({value:n},!0),this.element.value=n||"#000000")},e.prototype.destroy=function(){var e=this,n=this.getWrapper();t.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&&i.i(s.detach)(this.element.nextElementSibling),n&&(n.parentElement.insertBefore(this.element,n),i.i(s.detach)(n)),this.container=null,this.formElement&&s.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},e.prototype.destroyOtherComp=function(){if(this.isPicker()){for(var t=i.i(s.closest)(this.hueSlider.element,".e-color-picker"),e=t.querySelectorAll(".e-numerictextbox"),n=0;n<e.length;n++)i.i(s.getInstance)(e[n],l.a).destroy();this.hueSlider.destroy(),this.enableOpacity&&(this.opacitySlider.destroy(),this.opacitySlider=null),this.hueSlider=null;var a=this.getTooltipInst();a.close(),a.destroy(),this.tooltipEle=null}},e.prototype.isPopupOpen=function(){return this.getPopupEle().classList.contains("e-popup-open")},e.prototype.unWireEvents=function(){if(this.isPicker()){var t=this.getDragHandler();s.EventHandler.remove(t,"keydown",this.pickerKeyDown);var e=i.i(s.select)("."+c,this.container);e&&s.EventHandler.remove(e,"keydown",this.ctrlBtnKeyDown),s.EventHandler.remove(this.getHsvContainer(),"mousedown touchstart",this.handlerDown),(this.modeSwitcher||this.showButtons)&&s.EventHandler.remove(i.i(s.select)("."+p,this.container),"click",this.btnClickHandler),s.EventHandler.remove(i.i(s.select)(".e-previous",this.container),"click",this.previewHandler)}else s.EventHandler.remove(this.container,"click",this.paletteClickHandler),s.EventHandler.remove(this.container,"keydown",this.paletteKeyDown)},e.prototype.roundValue=function(t){if(!t)return"";"#"!==t[0]&&(t="#"+t);var e=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},e.prototype.hexToRgb=function(t){if(!t)return[];t=t.trim(),9!==t.length&&(t=this.roundValue(t));var e=Number((parseInt(t.slice(-2),16)/255).toFixed(2));t=t.slice(1,7);var i=parseInt(t,16),s=[];return s.push(i>>16&255),s.push(i>>8&255),s.push(255&i),s.push(e),s},e.prototype.rgbToHsv=function(t,e,n,a){if(this.rgb&&!this.rgb.length)return[];t/=255,e/=255,n/=255;var r,l=Math.max(t,e,n),o=Math.min(t,e,n),h=l,d=l-o,u=0===l?0:d/l;if(l===o)r=0;else{switch(l){case t:r=(e-n)/d+(e<n?6:0);break;case e:r=(n-t)/d+2;break;case n:r=(t-e)/d+4}r/=6}var c=[Math.round(360*r),Math.round(1e3*u)/10,Math.round(1e3*h)/10];return i.i(s.isNullOrUndefined)(a)||c.push(a),c},e.prototype.hsvToRgb=function(t,e,n,a){var r,l,o;if(e/=100,n/=100,0===e)return r=l=o=n,[Math.round(255*r),Math.round(255*l),Math.round(255*o),a];t/=60;var h=Math.floor(t),d=t-h,u=n*(1-e),c=n*(1-e*d),p=n*(1-e*(1-d));switch(h){case 0:r=n,l=p,o=u;break;case 1:r=c,l=n,o=u;break;case 2:r=u,l=n,o=p;break;case 3:r=u,l=c,o=n;break;case 4:r=p,l=u,o=n;break;default:r=n,l=u,o=c}var m=[Math.round(255*r),Math.round(255*l),Math.round(255*o)];return i.i(s.isNullOrUndefined)(a)||m.push(a),m},e.prototype.rgbToHex=function(t){return t.length?"#"+this.hex(t[0])+this.hex(t[1])+this.hex(t[2])+(i.i(s.isNullOrUndefined)(t[3])?"":0!==t[3]?(Math.round(255*t[3])+65536).toString(16).substr(-2):"00"):""},e.prototype.hex=function(t){return("0"+t.toString(16)).slice(-2)},e.prototype.changeModeSwitcherProp=function(t){var e=i.i(s.select)("."+p,this.container);t?e?this.appendModeSwitchBtn():(this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):e&&(this.showButtons?i.i(s.detach)(i.i(s.select)("."+b,e)):i.i(s.remove)(e))},e.prototype.changeShowBtnProps=function(t){var e=i.i(s.select)("."+p,this.container);t?(e&&i.i(s.remove)(e),this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):this.modeSwitcher?i.i(s.detach)(i.i(s.select)("."+c,e)):i.i(s.remove)(e)},e.prototype.changeValueProp=function(t){if(this.isPicker())this.rgb=this.hexToRgb(t),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHandlerPosition(),i.i(s.detach)(i.i(s.closest)(this.hueSlider.element,".e-slider-preview")),this.createSlider(),this.setHsvContainerBg(),this.updateInput(t),4===this.rgb.length&&this.updateOpacityInput(100*this.rgb[3]);else{this.removeTileSelection();var e=this.container.querySelector('span[aria-label="'+this.roundValue(t)+'"]');e&&this.addTileSelection(e)}},e.prototype.setInputEleProps=function(){i.i(s.remove)(i.i(s.select)("."+y,this.container)),this.createInput()},e.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())},e.prototype.changeCssClassProps=function(t,e){var n=this.getWrapper(),a=this.getPopupEle();e&&i.i(s.removeClass)([n,a],e.split(" ")),t&&i.i(s.addClass)([n,a],t.replace(/\s+/g," ").trim().split(" "))},e.prototype.changeRtlProps=function(t){t?i.i(s.addClass)([this.getWrapper()],"e-rtl"):i.i(s.removeClass)([this.getWrapper()],"e-rtl")},e.prototype.changePaletteProps=function(){i.i(s.detach)(this.container.children[0]),this.container.style.width="",this.createPalette()},e.prototype.changeOpacityProps=function(t){var e=this.getWrapper();t?(i.i(s.removeClass)([this.container.parentElement],"e-hide-opacity"),this.createOpacitySlider(i.i(s.select)(".e-colorpicker-slider",this.container).appendChild(this.createElement("div",{className:"e-opacity-slider"}))),e.classList.contains(v)||e.classList.contains(f)||this.appendOpacityValue(i.i(s.select)(".e-input-container",this.container))):(i.i(s.addClass)([this.container.parentElement],"e-hide-opacity"),this.opacitySlider.destroy(),i.i(s.remove)(this.opacitySlider.element),this.opacitySlider=null,e.classList.contains(v)||e.classList.contains(f)||i.i(s.remove)(i.i(s.select)("."+E,this.container).parentElement))},e.prototype.onPropertyChanged=function(t,e){var a=this;if(!i.i(s.isNullOrUndefined)(t.value)){var r=this.roundValue(t.value);if(9===r.length){this.element.value=this.roundValue(r).slice(0,7);var l=this.splitBtn&&i.i(s.select)(".e-split-preview",this.splitBtn.element);l&&(l.style.backgroundColor=this.convertToRgbString(this.hexToRgb(t.value)))}else if(this.noColor&&"Palette"===this.mode&&""===this.value){var l=this.splitBtn&&i.i(s.select)(".e-split-preview",this.splitBtn.element);l.style.backgroundColor=""}else this.value=e.value}if(!this.inline&&i.i(s.isNullOrUndefined)(t.inline)){var o=["disabled","enableRtl"];if(this.splitBtn.setProperties(i.i(n.getModel)(t,o)),!this.isPopupOpen())return this.changeCssClassProps(t.cssClass,e.cssClass),void this.changeRtlProps(t.enableRtl)}for(var h=this,d=0,u=Object.keys(t);d<u.length;d++){var c=u[d];!function(n){switch(n){case"inline":t.inline?(h.getWrapper().appendChild(h.container),h.splitBtn.destroy(),i.i(s.detach)(h.element.nextElementSibling),h.container.children.length||h.createWidget()):(h.destroyOtherComp(),h.unWireEvents(),h.container.innerHTML="",h.createSplitBtn());break;case"cssClass":h.changeCssClassProps(t.cssClass,e.cssClass);var r=t.cssClass.split(" ").concat(e.cssClass.split(" "));r=r.reduce(function(t,e){return t.indexOf(e)<0&&t.push(e),t},[]);var l=0;r.forEach(function(t){if(0===l&&(t===v||"e-hide-valueswitcher"===t||t===x||t===m||t===f)){i.i(s.select)("."+y,a.container)&&i.i(s.remove)(i.i(s.select)("."+y,a.container)),a.createInput(),l++}});break;case"enableRtl":h.isPicker()&&(h.hueSlider.enableRtl=t.enableRtl,h.enableOpacity&&(h.opacitySlider.enableRtl=t.enableRtl),h.setInputEleProps()),h.changeRtlProps(t.enableRtl);break;case"disabled":h.changeDisabledProp(t.disabled);break;case"value":h.value!==e.value&&h.changeValueProp(t.value);break;case"showButtons":h.changeShowBtnProps(t.showButtons);break;case"mode":"Picker"===t.mode?h.switchToPicker():h.switchToPalette();break;case"modeSwitcher":h.changeModeSwitcherProp(t.modeSwitcher);break;case"columns":case"presetColors":h.isPicker()||h.changePaletteProps();break;case"noColor":t.noColor?"Palette"!==h.mode||h.modeSwitcher||h.setNoColor():h.changePaletteProps();break;case"enableOpacity":h.changeOpacityProps(t.enableOpacity)}}(c)}},e.prototype.focusIn=function(){this.element.parentElement.focus()},d([i.i(s.Property)("#008000ff")],e.prototype,"value",void 0),d([i.i(s.Property)("")],e.prototype,"cssClass",void 0),d([i.i(s.Property)(!1)],e.prototype,"disabled",void 0),d([i.i(s.Property)("Picker")],e.prototype,"mode",void 0),d([i.i(s.Property)(!0)],e.prototype,"modeSwitcher",void 0),d([i.i(s.Property)(null)],e.prototype,"presetColors",void 0),d([i.i(s.Property)(!0)],e.prototype,"showButtons",void 0),d([i.i(s.Property)(10)],e.prototype,"columns",void 0),d([i.i(s.Property)(!1)],e.prototype,"inline",void 0),d([i.i(s.Property)(!1)],e.prototype,"noColor",void 0),d([i.i(s.Property)(!1)],e.prototype,"enablePersistence",void 0),d([i.i(s.Property)(!0)],e.prototype,"enableOpacity",void 0),d([i.i(s.Property)(!1)],e.prototype,"createPopupOnClick",void 0),d([i.i(s.Event)()],e.prototype,"select",void 0),d([i.i(s.Event)()],e.prototype,"change",void 0),d([i.i(s.Event)()],e.prototype,"beforeTileRender",void 0),d([i.i(s.Event)()],e.prototype,"beforeOpen",void 0),d([i.i(s.Event)()],e.prototype,"open",void 0),d([i.i(s.Event)()],e.prototype,"beforeClose",void 0),d([i.i(s.Event)()],e.prototype,"beforeModeSwitch",void 0),d([i.i(s.Event)()],e.prototype,"onModeSwitch",void 0),d([i.i(s.Event)()],e.prototype,"created",void 0),e=d([s.NotifyPropertyChanges],e)}(s.Component)},function(t,e,i){"use strict";i.d(e,"a",function(){return l}),i.d(e,"b",function(){return s}),i.d(e,"c",function(){return o});var s,n=i(0),a=(i.n(n),this&&this.__extends||function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}()),r=this&&this.__decorate||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;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},l={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}$")};!function(t){t[t.Message=0]="Message",t[t.Label=1]="Label"}(s||(s={}));var o=function(t){function e(e,s){var a=t.call(this,s,e)||this;if(a.validated=[],a.errorRules=[],a.allowSubmit=!1,a.required="required",a.infoElement=null,a.inputElement=null,a.selectQuery="input:not([type=reset]):not([type=button]), select, textarea",a.localyMessage={},a.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===a.rules&&(a.rules={}),a.l10n=new n.L10n("formValidator",a.defaultMessages,a.locale),a.locale&&a.localeFunc(),n.onIntlChange.on("notifyExternalChange",a.afterLocalization,a),e="string"==typeof e?i.i(n.select)(e,document):e,null!=a.element)return a.element.setAttribute("novalidate",""),a.inputElements=i.i(n.selectAll)(a.selectQuery,a.element),a.createHTML5Rules(),a.wireEvents(),a}a(e,t),o=e,e.prototype.addRules=function(t,e){t&&(this.rules.hasOwnProperty(t)?i.i(n.extend)(this.rules[""+t],e,{}):this.rules[""+t]=e)},e.prototype.removeRules=function(t,e){if(t||e)if(this.rules[""+t]&&!e)delete this.rules[""+t];else{if(i.i(n.isNullOrUndefined)(this.rules[""+t]&&e))return;for(var s=0;s<e.length;s++)delete this.rules[""+t][e[parseInt(s.toString())]]}else this.rules={}},e.prototype.validate=function(t){var e=Object.keys(this.rules);if(t&&e.length)return this.validateRules(t),-1!==e.indexOf(t)&&0===this.errorRules.filter(function(e){return e.name===t}).length;this.errorRules=[];for(var i=0,s=e;i<s.length;i++){var n=s[i];this.validateRules(n)}return 0===this.errorRules.length},e.prototype.reset=function(){this.element.reset(),this.clearForm()},e.prototype.getInputElement=function(t){return this.inputElement=i.i(n.select)('[name="'+t+'"]',this.element),this.inputElement},e.prototype.destroy=function(){this.reset(),this.unwireEvents(),this.rules={};for(var e=i.i(n.selectAll)("."+this.errorClass+", ."+this.validClass,this.element),s=0,a=e;s<a.length;s++){var r=a[s];i.i(n.detach)(r)}t.prototype.destroy.call(this),n.onIntlChange.off("notifyExternalChange",this.afterLocalization)},e.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){switch(s[i]){case"locale":this.localeFunc()}}},e.prototype.localeFunc=function(){for(var t=0,e=Object.keys(this.defaultMessages);t<e.length;t++){var i=e[t];this.l10n.setLocale(this.locale);var s=this.l10n.getConstant(i);this.localyMessage[""+i]=s}},e.prototype.getModuleName=function(){return"formValidator"},e.prototype.afterLocalization=function(t){this.locale=t.locale,this.localeFunc()},e.prototype.refresh=function(){this.unwireEvents(),this.inputElements=i.i(n.selectAll)(this.selectQuery,this.element),this.wireEvents()},e.prototype.clearForm=function(){this.errorRules=[],this.validated=[];for(var t=i.i(n.selectAll)(this.selectQuery,this.element),e=0,s=t;e<s.length;e++){var a=s[e],r=a;r.removeAttribute("aria-invalid"),r.classList.remove(this.errorClass),r.name.length>0&&(this.getInputElement(r.name),this.getErrorElement(r.name),this.hideMessage(r.name)),r.classList.remove(this.validClass)}},e.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)}},e.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],l=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(l))switch(l){case"maxlength":this.defRule(t,e,"maxLength",s);break;case"minlength":this.defRule(t,e,"minLength",s);break;case"range":var o=t.getAttribute("data-val-range-min"),h=t.getAttribute("data-val-range-max");this.defRule(t,e,"range",[o,h]);break;case"equalto":var d=t.getAttribute(i).split(".");this.defRule(t,e,"equalTo",d[d.length-1]);break;case"regex":this.defRule(t,e,"regex",s)}},e.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},e.prototype.wireEvents=function(){for(var t=0,e=this.inputElements;t<e.length;t++){var i=e[t];o.isCheckable(i)?n.EventHandler.add(i,"click",this.clickHandler,this):"SELECT"===i.tagName?n.EventHandler.add(i,"change",this.changeHandler,this):(n.EventHandler.add(i,"focusout",this.focusOutHandler,this),n.EventHandler.add(i,"keyup",this.keyUpHandler,this))}n.EventHandler.add(this.element,"submit",this.submitHandler,this),n.EventHandler.add(this.element,"reset",this.resetHandler,this)},e.prototype.unwireEvents=function(){for(var t=0,e=this.inputElements;t<e.length;t++){var i=e[t];n.EventHandler.clearEvents(i)}n.EventHandler.remove(this.element,"submit",this.submitHandler),n.EventHandler.remove(this.element,"reset",this.resetHandler)},e.prototype.focusOutHandler=function(t){this.trigger("focusout",t);var e=t.target;this.rules[e.name]&&(this.rules[e.name][this.required]||e.value.length>0?this.validate(e.name):-1===this.validated.indexOf(e.name)&&this.validated.push(e.name))},e.prototype.keyUpHandler=function(t){this.trigger("keyup",t);var e=t.target,i=[16,17,18,20,35,36,37,38,39,40,45,144,225];(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===i.indexOf(t.which)&&this.validate(e.name)},e.prototype.clickHandler=function(t){this.trigger("click",t);var e=t.target;"submit"!==e.type?this.validate(e.name):null!==e.getAttribute("formnovalidate")&&(this.allowSubmit=!0)},e.prototype.changeHandler=function(t){this.trigger("change",t);var e=t.target;this.validate(e.name)},e.prototype.submitHandler=function(t){this.trigger("submit",t),this.allowSubmit||this.validate()?this.allowSubmit=!1:t.preventDefault()},e.prototype.resetHandler=function(){this.clearForm()},e.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!==a&&(i=!0),-1!==n&&(s=!0),!i||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),d={name:t,message:h},u={inputName:t,element:this.inputElement,message:h};if(!this.isValid(t,o)&&!this.inputElement.classList.contains(this.ignore)){this.removeErrorRules(t),this.errorRules.push(d),this.inputElement.setAttribute("aria-invalid","true"),this.inputElement.setAttribute("aria-describedby",this.inputElement.id+"-info"),this.inputElement.classList.add(this.errorClass),this.inputElement.classList.remove(this.validClass),this.infoElement?this.showMessage(d):this.createErrorElement(t,d.message,this.inputElement),u.errorElement=this.infoElement,u.status="failure",this.inputElement.classList.add(this.errorClass),this.inputElement.classList.remove(this.validClass),this.optionalValidationStatus(t,u),this.trigger("validationComplete",u),"required"===o&&this.inputElement.setAttribute("aria-required","true");break}this.hideMessage(t),u.status="success",this.trigger("validationComplete",u)}}}},e.prototype.optionalValidationStatus=function(t,e){this.rules[""+t][this.required]||this.inputElement.value.length||i.i(n.isNullOrUndefined)(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),e.status="",this.hideMessage(t))},e.prototype.isValid=function(t,e){var s=this.rules[""+t][""+e],a=s instanceof Array&&"string"==typeof s[1]?s[0]:s,r=this.rules[""+t][""+e],l={value:this.inputElement.value,param:a,element:this.inputElement,formElement:this.element};if(this.trigger("validationBegin",l),!l.param&&"required"===e)return!0;if(r&&"function"==typeof r[0]){return r[0].call(this,{element:this.inputElement,value:this.inputElement.value})}return o.isCheckable(this.inputElement)?"required"!==e||i.i(n.selectAll)('input[name="'+t+'"]:checked',this.element).length>0:o.checkValidator[""+e](l)},e.prototype.getErrorMessage=function(t,e){var s=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[""+e]:this.defaultMessages[""+e],a=s.match(/{(\d)}/g);if(!i.i(n.isNullOrUndefined)(a))for(var r=0;r<a.length;r++){var l=t instanceof Array?t[parseInt(r.toString())]:t;s=s.replace(a[parseInt(r.toString())],l)}return s},e.prototype.createErrorElement=function(t,e,a){var r=i.i(n.createElement)(this.errorElement,{className:this.errorClass,innerHTML:e,attrs:{for:t}});if(this.errorOption===s.Message&&(r.classList.remove(this.errorClass),r.classList.add("e-message"),r=i.i(n.createElement)(this.errorContainer,{className:this.errorClass,innerHTML:r.outerHTML})),r.id=this.inputElement.name+"-info",this.element.querySelector('[data-valmsg-for="'+a.id+'"]'))this.element.querySelector('[data-valmsg-for="'+a.id+'"]').appendChild(r);else if(!0===a.hasAttribute("data-msg-containerid")){var l=a.getAttribute("data-msg-containerid"),o=i.i(n.select)("#"+l,this.element);o.appendChild(r)}else null!=this.customPlacement?this.customPlacement.call(this,this.inputElement,r):this.inputElement.parentNode.insertBefore(r,this.inputElement.nextSibling);r.style.display="block",this.getErrorElement(t),this.validated.push(t),this.checkRequired(t)},e.prototype.getErrorElement=function(t){return this.infoElement=i.i(n.select)(this.errorElement+"."+this.errorClass,this.inputElement.parentElement),this.infoElement||(this.infoElement=i.i(n.select)(this.errorElement+"."+this.errorClass+'[for="'+t+'"]',this.element)),this.infoElement},e.prototype.removeErrorRules=function(t){for(var e=0;e<this.errorRules.length;e++){this.errorRules[parseInt(e.toString())].name===t&&this.errorRules.splice(e,1)}},e.prototype.showMessage=function(t){this.infoElement.style.display="block",this.infoElement.innerHTML=t.message,this.checkRequired(t.name)},e.prototype.hideMessage=function(t){this.infoElement&&(this.infoElement.style.display="none",this.removeErrorRules(t),this.inputElement.classList.add(this.validClass),this.inputElement.classList.remove(this.errorClass),this.inputElement.setAttribute("aria-invalid","false"))},e.prototype.checkRequired=function(t){this.rules[""+t][this.required]||this.inputElement.value.length||i.i(n.isNullOrUndefined)(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),this.hideMessage(t))},e.isCheckable=function(t){var e=t.getAttribute("type");return e&&("checkbox"===e||"radio"===e||"submit"===e)};var o;return e.checkValidator={required:function(t){return isNaN(Date.parse(t.value))?t.value.toString().length>0:!isNaN(new Date(t.value).getTime())},email:function(t){return l.EMAIL.test(t.value)},url:function(t){return l.URL.test(t.value)},dateIso:function(t){return l.DATE_ISO.test(t.value)},tel:function(t){return l.PHONE.test(t.value)},creditcard:function(t){return l.CREDITCARD.test(t.value)},number:function(t){return!isNaN(Number(t.value))&&-1===t.value.indexOf(" ")},digits:function(t){return l.DIGITS.test(t.value)},maxLength:function(t){return t.value.length<=t.param},minLength:function(t){return t.value.length>=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){return!isNaN(new Date(t.value).getTime())},max:function(t){return isNaN(Number(t.value))?new Date(t.value).getTime()<=new Date(JSON.parse(JSON.stringify(t.param))).getTime():+t.value<=t.param},min:function(t){if(isNaN(Number(t.value))){if(-1!==t.value.indexOf(",")){var e=t.value.replace(/,/g,"");return parseFloat(e)>=t.param}return new Date(t.value).getTime()>=new Date(JSON.parse(JSON.stringify(t.param))).getTime()}return+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}},r([i.i(n.Property)("")],e.prototype,"locale",void 0),r([i.i(n.Property)("e-hidden")],e.prototype,"ignore",void 0),r([i.i(n.Property)()],e.prototype,"rules",void 0),r([i.i(n.Property)("e-error")],e.prototype,"errorClass",void 0),r([i.i(n.Property)("e-valid")],e.prototype,"validClass",void 0),r([i.i(n.Property)("label")],e.prototype,"errorElement",void 0),r([i.i(n.Property)("div")],e.prototype,"errorContainer",void 0),r([i.i(n.Property)(s.Label)],e.prototype,"errorOption",void 0),r([i.i(n.Event)()],e.prototype,"focusout",void 0),r([i.i(n.Event)()],e.prototype,"keyup",void 0),r([i.i(n.Event)()],e.prototype,"click",void 0),r([i.i(n.Event)()],e.prototype,"change",void 0),r([i.i(n.Event)()],e.prototype,"submit",void 0),r([i.i(n.Event)()],e.prototype,"validationBegin",void 0),r([i.i(n.Event)()],e.prototype,"validationComplete",void 0),r([i.i(n.Event)()],e.prototype,"customPlacement",void 0),e=o=r([n.NotifyPropertyChanges],e)}(n.Base)},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i(5);i.d(e,"NumericTextBox",function(){return s.a});var n=i(12);i.d(e,"regularExpressions",function(){return n.a}),i.d(e,"createMask",function(){return n.b}),i.d(e,"applyMask",function(){return n.c}),i.d(e,"wireEvents",function(){return n.d}),i.d(e,"unwireEvents",function(){return n.e}),i.d(e,"bindClearEvent",function(){return n.f}),i.d(e,"unstrippedValue",function(){return n.g}),i.d(e,"strippedValue",function(){return n.h}),i.d(e,"maskInputMouseDownHandler",function(){return n.i}),i.d(e,"maskInputMouseUpHandler",function(){return n.j}),i.d(e,"maskInputFocusHandler",function(){return n.k}),i.d(e,"triggerFocus",function(){return n.l}),i.d(e,"escapeRegExp",function(){return n.m}),i.d(e,"maskInputBlurHandler",function(){return n.n}),i.d(e,"maskInputDropHandler",function(){return n.o}),i.d(e,"mobileRemoveFunction",function(){return n.p}),i.d(e,"setMaskValue",function(){return n.q}),i.d(e,"setElementValue",function(){return n.r}),i.d(e,"maskInput",function(){return n.s}),i.d(e,"getVal",function(){return n.t}),i.d(e,"getMaskedVal",function(){return n.u}),i.d(e,"MaskUndo",function(){return n.v}),i.d(e,"MaskedTextBox",function(){return n.w});var a=i(4);i.d(e,"Input",function(){return a.a});var r=i(15);i.d(e,"TicksData",function(){return r.a}),i.d(e,"ColorRangeData",function(){return r.b}),i.d(e,"LimitData",function(){return r.c}),i.d(e,"TooltipData",function(){return r.d}),i.d(e,"Slider",function(){return r.e});var l=i(11);i.d(e,"regex",function(){return l.a}),i.d(e,"ErrorOption",function(){return l.b}),i.d(e,"FormValidator",function(){return l.c});var o=i(17);i.d(e,"FilesProp",function(){return o.a}),i.d(e,"ButtonsProps",function(){return o.b}),i.d(e,"AsyncSettings",function(){return o.c}),i.d(e,"Uploader",function(){return o.d});var h=i(9);i.d(e,"ColorPicker",function(){return h.a});var d=i(16);i.d(e,"TextBox",function(){return d.a});var u=i(14);i.d(e,"Signature",function(){return u.a});var c=i(13);i.d(e,"LabelPosition",function(){return c.a}),i.d(e,"PrecisionType",function(){return c.b}),i.d(e,"Rating",function(){return c.c});var p=i(10);i.d(e,"SignatureBase",function(){return p.a})},function(t,e,i){"use strict";function s(){if(i.i(X.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 s=t[e].split("["),n=0;n<s.length;n++)"\\"===s[n][s[n].length-1]&&(s[n]=s[n]+"["),p.call(this,s[n])}else{var s=t[e].split("[");if(s.length>1)for(var a=!1,n=0;n<s.length;n++)"\\"===s[n]?(this.customRegExpCollec.push("["),this.hiddenMask+=s[n]+"["):""===s[n]?a=!0:""!==s[n]&&a||n===s.length-1?(this.customRegExpCollec.push("["+s[n]+"]"),this.hiddenMask+=this.promptChar,a=!1):p.call(this,s[n]);else p.call(this,s[0])}if(this.escapeMaskValue=this.hiddenMask,this.promptMask=this.hiddenMask.replace(/[09?LCAa#&]/g,this.promptChar),!i.i(X.isNullOrUndefined)(this.customCharacters))for(var e=0;e<this.promptMask.length;e++)i.i(X.isNullOrUndefined)(this.customCharacters[this.promptMask[e]])||(this.promptMask=this.promptMask.replace(new RegExp(this.promptMask[e],"g"),this.promptChar));var r=0;if(this.hiddenMask.match(new RegExp(/\\/)))for(var e=0;e<this.hiddenMask.length;e++){var n=0;e>=1&&(n=e),r=this.hiddenMask.length-this.promptMask.length,n-=r,e>0&&"\\"!==this.hiddenMask[e-1]&&(">"===this.hiddenMask[e]||"<"===this.hiddenMask[e]||"|"===this.hiddenMask[e])&&(this.promptMask=this.promptMask.substring(0,n)+this.promptMask.substring(e+1-r,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue.substring(e+1-r,this.escapeMaskValue.length)),"\\"===this.hiddenMask[e]&&(this.promptMask=this.promptMask.substring(0,n)+this.hiddenMask[e+1]+this.promptMask.substring(e+2-r,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue[e+1]+this.escapeMaskValue.substring(e+2-r,this.escapeMaskValue.length))}else this.promptMask=this.promptMask.replace(/[>|<]/g,""),this.escapeMaskValue=this.hiddenMask.replace(/[>|<]/g,"");i.i(X.attributes)(this.element,{"aria-invalid":"false"})}}function n(){D.call(this,this.promptMask),I.call(this,this.value)}function a(){X.EventHandler.add(this.element,"keydown",T,this),X.EventHandler.add(this.element,"keypress",L,this),X.EventHandler.add(this.element,"keyup",H,this),X.EventHandler.add(this.element,"input",x,this),X.EventHandler.add(this.element,"focus",v,this),X.EventHandler.add(this.element,"blur",b,this),X.EventHandler.add(this.element,"paste",C,this),X.EventHandler.add(this.element,"cut",E,this),X.EventHandler.add(this.element,"drop",S,this),X.EventHandler.add(this.element,"mousedown",m,this),X.EventHandler.add(this.element,"mouseup",f,this),this.enabled&&(l.call(this),this.formElement&&X.EventHandler.add(this.formElement,"reset",d,this))}function r(){X.EventHandler.remove(this.element,"keydown",T),X.EventHandler.remove(this.element,"keypress",L),X.EventHandler.remove(this.element,"keyup",H),X.EventHandler.remove(this.element,"input",x),X.EventHandler.remove(this.element,"focus",v),X.EventHandler.remove(this.element,"blur",b),X.EventHandler.remove(this.element,"paste",C),X.EventHandler.remove(this.element,"cut",E),X.EventHandler.remove(this.element,"mousedown",m),X.EventHandler.remove(this.element,"mouseup",f),this.formElement&&X.EventHandler.remove(this.formElement,"reset",d)}function l(){this.showClearButton&&X.EventHandler.add(this.inputObj.clearButton,"mousedown touchstart",o,this)}function o(t){t.preventDefault(),this.inputObj.clearButton.classList.contains("e-clear-icon-hide")&&!this.inputObj.container.classList.contains("e-static-clear")||(h.call(this,t),this.value="")}function h(t){var e=this.element.value;D.call(this,this.promptMask),this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),w.call(this,t,e),this.element.setSelectionRange(0,0)}function d(){"EJS-MASKEDTEXTBOX"===this.element.tagName?D.call(this,this.promptMask):this.value=this.initInputValue}function u(t){return t.value}function c(t,e){var s="",n=0,a=!1,r=i.i(X.isNullOrUndefined)(e)?i.i(X.isNullOrUndefined)(t)||i.i(X.isNullOrUndefined)(this)?e:t.value:e;if(r!==this.promptMask)for(var l=0;l<this.customRegExpCollec.length;l++)a&&(a=!1),">"!==this.customRegExpCollec[n]&&"<"!==this.customRegExpCollec[n]&&"|"!==this.customRegExpCollec[n]&&"\\"!==this.customRegExpCollec[n]||(--l,a=!0),a||r[l]!==this.promptChar&&!i.i(X.isNullOrUndefined)(this.customRegExpCollec[n])&&(this._callPasteHandler||!i.i(X.isNullOrUndefined)(this.regExpCollec[this.customRegExpCollec[n]])||this.customRegExpCollec[n].length>2&&"["===this.customRegExpCollec[n][0]&&"]"===this.customRegExpCollec[n][this.customRegExpCollec[n].length-1]||!i.i(X.isNullOrUndefined)(this.customCharacters)&&!i.i(X.isNullOrUndefined)(this.customCharacters[this.customRegExpCollec[n]]))&&""!==r&&(s+=r[l]),++n;return(null===this.mask||""===this.mask&&void 0!==this.value)&&(s=r),s}function p(t){for(var e=0;e<t.length;e++)this.hiddenMask+=t[e],"\\"!==t[e]&&this.customRegExpCollec.push(t[e])}function m(){this.isClicked=!0}function f(){this.isClicked=!1}function v(t){var e=this,s=this.element,n=0,a=c.call(this,s),r=!1,l=!1,o={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:i.i(X.isNullOrUndefined)(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd};if(this.isClicked||g.call(this,o,s),this.mask&&(null!==a&&""!==a||"Always"===this.floatLabelType||null===this.placeholder||""===this.placeholder||(s.value=this.promptMask),setTimeout(function(){if(s.selectionStart===e.promptMask.length||s.value[s.selectionStart]===e.promptChar)r=!0;else for(var t=s.selectionStart;t<e.promptMask.length;t++){if(s.value[t]===e.promptChar){r=!0;break}if(s.value[t]!==e.promptMask[t]){r=!1;break}}}),setTimeout(function(){var t=s.selectionStart-1;if(t===e.promptMask.length-1||s.value[t]===e.promptChar)l=!0;else for(var i=t;i>=0;i--){if(s.value[i]===e.promptChar){l=!0;break}if(s.value[i]!==e.promptMask[i]){l=!1;break}}}),this.isClicked||"Always"!==this.floatLabelType&&(null===a||""===a)&&null!==this.placeholder&&""!==this.placeholder)){for(n=0;n<this.promptMask.length;n++)if(s.value[n]===this.promptChar){setTimeout(function(){(r||l)&&(s.selectionEnd=n,s.selectionStart=n),o={selectionStart:s.selectionStart,event:t,value:e.value,maskedValue:s.value,container:i.i(X.isNullOrUndefined)(e.inputObj)?e.inputObj:e.inputObj.container,selectionEnd:s.selectionEnd},g.call(e,o,s)},110);break}i.i(X.isNullOrUndefined)(s.value.match(y(this.promptChar)))&&(o={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:i.i(X.isNullOrUndefined)(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd},g.call(this,o,s)),this.isClicked=!1}}function g(t,e){this.trigger("focus",t,function(t){e.selectionStart=t.selectionStart,e.selectionEnd=t.selectionEnd})}function y(t){return i.i(X.isNullOrUndefined)(t)?t:t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function b(t){if(this.blurEventArgs={event:t,value:this.value,maskedValue:this.element.value,container:i.i(X.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)){D.call(this,"");var e=this.element.parentNode.querySelector(".e-float-text");"Auto"===this.floatLabelType&&!i.i(X.isNullOrUndefined)(e)&&e.classList.contains($)&&i.i(X.removeClass)([e],$)}}function C(t){var e=this;if(this.mask&&!this.readonly){var i=this.element.selectionStart,s=this.element.selectionEnd,n=this.element.value;D.call(this,""),this._callPasteHandler=!0,setTimeout(function(){var a=e.element.value.replace(/ /g,"");e.redoCollec.length>0&&e.redoCollec[0].value===e.element.value&&(a=c.call(e,e.element)),D.call(e,n),e.element.selectionStart=i,e.element.selectionEnd=s;var r=0;e.maskKeyPress=!0;do{B.call(e,a[r],!1,null),++r}while(r<a.length);if(e.maskKeyPress=!1,e._callPasteHandler=!1,e.element.value===n){var l=0;e.maskKeyPress=!0;do{B.call(e,a[l],!1,null),++l}while(l<a.length);e.maskKeyPress=!1}else w.call(e,t,n)},1)}}function E(t){var e=this;if(this.mask&&!this.readonly){var i=this.element.value,s=this.element.selectionStart,n=this.element.selectionEnd;this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd});var a=this.element.value.substring(0,s)+this.promptMask.substring(s,n)+this.element.value.substring(n);setTimeout(function(){D.call(e,a),e.element.selectionStart=e.element.selectionEnd=s,e.element.value!==i&&w.call(e,t,null)},0)}}function S(t){t.preventDefault()}function x(t){if(!0!==X.Browser.isIE||""!==this.element.value||"Never"!==this.floatLabelType){var e={ctrlKey:!1,keyCode:229};if(i.i(X.extend)(t,e),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||O.call(this,t),this.element.value.length>this.promptMask.length){var s=this.element.selectionStart,n=this.element.value.length-this.promptMask.length,a=this.element.value.substring(s-n,s);this.maskKeyPress=!1;var r=0;do{B.call(this,a[r],t.ctrlKey,t),++r}while(r<a.length);this.element.value!==this.preEleVal&&w.call(this,t,null)}var l=c.call(this,this.element);this.prevValue=l,this.value=l,""===l&&(D.call(this,this.promptMask),this.element.setSelectionRange(0,0))}}}function T(t){if(this.mask&&!this.readonly){229!==t.keyCode&&(!t.ctrlKey||89!==t.keyCode&&90!==t.keyCode||t.preventDefault(),O.call(this,t));var e=this.element.value;if(t.ctrlKey&&(89===t.keyCode||90===t.keyCode)){var i=void 0;90===t.keyCode&&this.undoCollec.length>0&&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}),D.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&&this.redoCollec.length>0&&e!==this.redoCollec[0].value&&(i=this.redoCollec[0],this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),D.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.redoCollec.splice(0,1))}}}function k(){var t,e=this.element.selectionStart,i=this.element.selectionEnd;this.redoCollec.length>0?(t=this.redoCollec[0],D.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)):(D.call(this,this.promptMask),this.element.selectionStart=this.element.selectionEnd=e)}function P(t,e,i){return"input"===i.type&&(t=!1,e=this.element.value,D.call(this,this.promptMask),I.call(this,e)),t}function O(t){var e,s=!1,n=!1;this.element.value.length<this.promptMask.length&&(s=!0,e=this.element.value,s=P.call(this,s,e,t),k.call(this)),this.element.value.length>=this.promptMask.length&&"input"===t.type&&(s=P.call(this,s,e,t));var a=this.element.selectionStart,r=this.element.selectionEnd,l=this.element.selectionStart,o=this.element.selectionEnd,h=this.hiddenMask.replace(/[>|\\<]/g,""),d=h[l-1],u=this.element.selectionEnd;if(s||8===t.keyCode||46===t.keyCode){this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:o});var c=!1,p=this.element.value;if(l>0||(8===t.keyCode||46===t.keyCode)&&l<this.element.value.length&&this.element.selectionEnd-l!==this.element.value.length){var m=l;l!==o?(l=o,46===t.keyCode&&(c=!0)):46===t.keyCode?++m:--m;for(var f=l;8===t.keyCode||s||c?f>m:f<m;8===t.keyCode||s||c?f--:f++)for(var v=l;8===t.keyCode||s||c?v>0:v<this.element.value.length;8===t.keyCode||s||c?v--:v++){var g=void 0;(8===t.keyCode||c)&&(a!==r&&a!==l||a===r)||s?(d=h[v-1],g=l-1):(d=h[v],g=l,++l);var y=this.element.value[g];if(i.i(X.isNullOrUndefined)(this.regExpCollec[""+d])&&!i.i(X.isNullOrUndefined)(this.customCharacters)&&i.i(X.isNullOrUndefined)(this.customCharacters[""+d])&&this.hiddenMask[g]!==this.promptChar&&"["!==this.customRegExpCollec[g][0]&&"]"!==this.customRegExpCollec[g][this.customRegExpCollec[g].length-1]||this.promptMask[g]!==this.promptChar&&i.i(X.isNullOrUndefined)(this.customCharacters))this.element.selectionStart=this.element.selectionEnd=g,t.preventDefault(),46!==t.keyCode||c||++this.element.selectionStart;else{var b=this.element.value,C=this.promptChar,E=b.substring(0,g)+C+b.substring(l,b.length);D.call(this,E),t.preventDefault(),46!==t.keyCode||c||g++,this.element.selectionStart=this.element.selectionEnd=g,n=!0}if(l=this.element.selectionStart,!n&&8===t.keyCode||c||!n&&46!==t.keyCode?g=l-1:(g=l,n=!1),y=this.element.value[g],a!==r&&this.element.selectionStart===a||this.promptMask[g]===this.promptChar||y!==this.promptMask[g]&&this.promptMask[g]!==this.promptChar&&!i.i(X.isNullOrUndefined)(this.customCharacters))break}}46===t.keyCode&&c&&n&&(this.element.selectionStart=this.element.selectionEnd=u),0===this.element.selectionStart&&this.element.selectionEnd===this.element.value.length&&(D.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!==p&&w.call(this,t,e)}}function L(t){if(this.mask&&!this.readonly){var e=this.element.value;if(!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;var i=t.key;"Spacebar"===i&&(i=String.fromCharCode(t.keyCode)),i?i&&1===i.length&&(B.call(this,i,t.ctrlKey,t),t.preventDefault()):(this.isIosInvalid=!0,B.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&&w.call(this,t,e)}}function w(t,e){var s=this.isProtectedOnChange;if(!i.i(X.isNullOrUndefined)(this.changeEventArgs)&&!this.isInitial){var n={};this.changeEventArgs={value:this.element.value,maskedValue:this.element.value,isInteraction:!1,isInteracted:!1},this.mask&&(this.changeEventArgs.value=c.call(this,this.element)),i.i(X.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,i.i(X.merge)(n,this.changeEventArgs),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",n)}this.preEleVal=this.element.value,this.prevValue=c.call(this,this.element)}function H(t){if(this.mask&&!this.readonly){var e=void 0;if(this.maskKeyPress||229!==t.keyCode)F.call(this);else{var i=void 0;if(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){var s=this.element.selectionStart,n=this.element.value.length-this.promptMask.length,a=this.element.value.substring(s-n,s);if(this.undoCollec.length>0){e=this.undoCollec[this.undoCollec.length-1];var r=this.element.selectionStart;i=e.value;var l=e.value.substring(r-n,r);e=this.redoCollec[0],a=a.trim();var o=X.Browser.isAndroid&&""===a;o||l===a||e.value.substring(r-n,r)===a?o&&R.call(this,t,r-1,this.element.selectionEnd-1,a,t.ctrlKey,!1):B.call(this,a,t.ctrlKey,t)}else i=this.promptMask,B.call(this,a,t.ctrlKey,t);this.maskKeyPress=!1,w.call(this,t,i)}}var h=c.call(this,this.element);(0!==this.element.selectionStart||this.promptMask!==this.element.value||""!==h||""===h&&this.value!==h)&&(this.prevValue=h,this.value=h)}else w.call(this,t);if(0===this.element.selectionStart&&0===this.element.selectionEnd){var d=this.element;setTimeout(function(){d.setSelectionRange(0,0)},0)}}function A(t){if(t.length>1&&this.promptMask.length+t.length<this.element.value.length){var 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);D.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}function N(t){this.maskKeyPress||A.call(this,t)}function B(t,e,s){if(N.call(this,t),!i.i(X.isNullOrUndefined)(this)&&!i.i(X.isNullOrUndefined)(t))for(var n,a,r=this.element.selectionStart,l=r,o=!1,h=this.element.value,d=!1,u=!1,c=0;c<t.length;c++){var p=t[c];if(r=this.element.selectionStart,this.maskKeyPress||l!==r||(r+=c),!this.maskKeyPress||r<this.promptMask.length){for(var m=r;m<this.promptMask.length;m++){var f=this.escapeMaskValue;n=f[r],"\\"===this.hiddenMask[r]&&this.hiddenMask[r+1]===t&&(u=!0),(i.i(X.isNullOrUndefined)(this.regExpCollec[""+n])&&(i.i(X.isNullOrUndefined)(this.customCharacters)||!i.i(X.isNullOrUndefined)(this.customCharacters)&&i.i(X.isNullOrUndefined)(this.customCharacters[""+n]))&&this.hiddenMask[r]!==this.promptChar&&"["!==this.customRegExpCollec[r][0]&&"]"!==this.customRegExpCollec[r][this.customRegExpCollec[r].length-1]||this.promptMask[r]!==this.promptChar&&i.i(X.isNullOrUndefined)(this.customCharacters)||this.promptChar===n&&this.escapeMaskValue===this.mask)&&(this.element.selectionStart=this.element.selectionEnd=r+1,r=this.element.selectionStart,n=this.hiddenMask[r])}if(i.i(X.isNullOrUndefined)(this.customCharacters)||i.i(X.isNullOrUndefined)(this.customCharacters[""+n]))!i.i(X.isNullOrUndefined)(this.regExpCollec[""+n])&&p.match(new RegExp(this.regExpCollec[""+n]))&&this.promptMask[r]===this.promptChar?o=!0:this.promptMask[r]===this.promptChar&&"["===this.customRegExpCollec[r][0]&&"]"===this.customRegExpCollec[r][this.customRegExpCollec[r].length-1]&&p.match(new RegExp(this.customRegExpCollec[r]))&&(o=!0);else for(var v=this.customCharacters[""+n],g=v.split(","),m=0;m<g.length;m++)if(p.match(new RegExp("["+g[m]+"]"))){o=!0;break}if((!this.maskKeyPress||r<this.hiddenMask.length)&&o){if(0===c)if(this.maskKeyPress)this.undoCollec.push({value:h,startIndex:r,endIndex:r});else{var y=this.element.selectionStart,b=this.element.selectionEnd;this.redoCollec.length>0?(a=this.redoCollec[0].value,D.call(this,a),this.undoCollec.push(this.redoCollec[0])):(this.undoCollec.push({value:this.promptMask,startIndex:r,endIndex:r}),a=this.promptMask,D.call(this,a)),this.element.selectionStart=y,this.element.selectionEnd=b}r=this.element.selectionStart,U.call(this,s,r,p,a,u),d=!0,c===t.length-1&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),o=!1}else r=this.element.selectionStart,R.call(this,s,r,l,t,e,d);c!==t.length-1||o||(!X.Browser.isAndroid||X.Browser.isAndroid&&r<this.promptMask.length)&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd})}else 1!==t.length||e||i.i(X.isNullOrUndefined)(s)||V.call(this)}}function U(t,e,i,s,n){if(this.hiddenMask.length>this.promptMask.length&&(i=M.call(this,i,this.element.value)),!n){var a=this.element.value,r=a.substring(0,e)+i+a.substring(e+1,a.length);D.call(this,r),this.element.selectionStart=this.element.selectionEnd=e+1}}function R(t,e,s,n,a,r){if(!this.maskKeyPress){var l=this.element.value;e>=this.promptMask.length?D.call(this,l.substring(0,e)):(s===e?D.call(this,l.substring(0,e)+l.substring(e+1,l.length)):this.promptMask.length===this.element.value.length?D.call(this,l.substring(0,e)+l.substring(e,l.length)):D.call(this,l.substring(0,s)+l.substring(s+1,l.length)),this.element.selectionStart=this.element.selectionEnd=r||this.element.value[s]!==this.promptChar?e:s),V.call(this)}1!==n.length||a||i.i(X.isNullOrUndefined)(t)||V.call(this)}function V(){var t=this,e=this.element.parentNode,s=200;e.classList.contains(Y)||e.classList.contains(G)?i.i(X.addClass)([e],Z):i.i(X.addClass)([this.element],Z),!0===this.isIosInvalid&&(s=400),i.i(X.attributes)(this.element,{"aria-invalid":"true"}),setTimeout(function(){t.maskKeyPress||F.call(t)},s)}function F(){var t=this.element.parentNode;i.i(X.isNullOrUndefined)(t)||i.i(X.removeClass)([t],Z),i.i(X.removeClass)([this.element],Z),i.i(X.attributes)(this.element,{"aria-invalid":"false"})}function M(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(;s>=0&&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}function I(t){if(this.mask&&void 0!==t&&(void 0===this.prevValue||this.prevValue!==t)){if(this.maskKeyPress=!0,D.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++)B.call(this,t[e],!1,null);var s=c.call(this,this.element);this.prevValue=s,this.value=s,w.call(this,null,null),this.maskKeyPress=!1;var n=this.element.parentNode.querySelector(".e-float-text");this.element.value===this.promptMask&&"Auto"===this.floatLabelType&&this.placeholder&&!i.i(X.isNullOrUndefined)(n)&&n.classList.contains($)&&!this.isFocus&&(i.i(X.removeClass)([n],$),i.i(X.addClass)([n],Q),D.call(this,""))}(null===this.mask||""===this.mask&&void 0!==this.value)&&D.call(this,this.value)}function D(t,e){!this.isFocus&&"Auto"===this.floatLabelType&&this.placeholder&&i.i(X.isNullOrUndefined)(this.value)&&(t="");var s=c.call(this,e||this.element,t);null===s||""===s?(K.a.setValue(t,e||this.element,this.floatLabelType,!1),this.showClearButton&&this.inputObj.clearButton.classList.add("e-clear-icon-hide")):K.a.setValue(t,e||this.element,this.floatLabelType,this.showClearButton)}function z(t){var e=q(t);n.call(e);var i=c.call(this,this.element);this.prevValue=i,this.value=i,t.mask&&(r.call(e),a.call(e))}function q(t){i.i(X.addClass)([t.element],J);var e={element:t.element,mask:t.mask,promptMask:"",hiddenMask:"",escapeMaskValue:"",promptChar:t.promptChar?t.promptChar.length>1?t.promptChar=t.promptChar[0]:t.promptChar:"_",value:t.value?t.value:null,regExpCollec:tt,customRegExpCollec:[],customCharacters:t.customCharacters,undoCollec:[],redoCollec:[],maskKeyPress:!1,prevValue:""};return s.call(e),e}function W(t){return c.call(_(t),t.element)}function j(t){return u.call(_(t),t.element)}function _(t){var e;return!i.i(X.isNullOrUndefined)(t)&&t.element.classList.contains(J)&&(e=q(t)),e}i.d(e,"a",function(){return tt}),e.b=s,e.c=n,e.d=a,e.e=r,e.f=l,e.g=u,e.h=c,e.i=m,e.j=f,e.k=v,e.l=g,e.m=y,e.n=b,e.o=S,e.p=k,e.q=I,e.r=D,e.s=z,e.t=W,e.u=j,i.d(e,"v",function(){return et});var X=i(0),K=(i.n(X),i(1)),Z="e-error",Y="e-input-group",G="e-float-input",J="e-utility-mask",$="e-label-top",Q="e-label-bottom",tt={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 ]"},et=function(){function t(){}return t}();new et},function(t,e,i){"use strict";var s=i(23);i.d(e,"a",function(){return s.a})},function(t,e,i){"use strict";i.d(e,"a",function(){return h});var s=i(0),n=(i.n(s),i(1)),a=i(3),r=this&&this.__extends||function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),l=this&&this.__decorate||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;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},o=["title","style","class"],h=function(t){function e(e,i){var s=t.call(this,e,i)||this;return s.initInputValue="",s.isAngular=!1,s.preventChange=!1,s.isClicked=!1,s.maskOptions=e,s}return r(e,t),e.prototype.getModuleName=function(){return"maskedtextbox"},e.prototype.preRender=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.regExpCollec=a.a,this.customRegExpCollec=[],this.undoCollec=[],this.redoCollec=[],this.changeEventArgs={},this.focusEventArgs={},this.blurEventArgs={},this.maskKeyPress=!1,this.isFocus=!1,this.isInitial=!1,this.isIosInvalid=!1;var t=i.i(s.getValue)("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),i.i(s.removeClass)([this.cloneElement],["e-control","e-maskedtextbox","e-lib"]),this.angularTagName=null,this.formElement=i.i(s.closest)(this.element,"form"),"EJS-MASKEDTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;for(var e=this.createElement("input"),n=0;n<this.element.attributes.length;n++)e.setAttribute(this.element.attributes[n].nodeName,this.element.attributes[n].nodeValue),e.innerHTML=this.element.innerHTML;this.element.hasAttribute("id")&&this.element.removeAttribute("id"),this.element.classList.remove("e-control","e-maskedtextbox"),this.element.classList.add("e-mask-container"),this.element.appendChild(e),this.element=e,i.i(s.setValue)("ej2_instances",t,this.element)}this.updateHTMLAttrToElement(),this.checkHtmlAttributes(!1),this.formElement&&(this.initInputValue=this.value)},e.prototype.getPersistData=function(){var t=["value"];return this.addOnPersist(t)},e.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&("Never"===this.floatLabelType&&i.i(s.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,s.Browser.isDevice||"11.0"!==s.Browser.info.version&&"edge"!==s.Browser.info.name||this.element.blur(),s.Browser.isDevice&&s.Browser.isIos&&this.element.blur(),(this.element.getAttribute("value")||this.value)&&this.element.setAttribute("value",this.element.value),!i.i(s.isNullOrUndefined)(i.i(s.closest)(this.element,"fieldset"))&&i.i(s.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete())},e.prototype.updateHTMLAttrToElement=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var n=e[t];o.indexOf(n)<0&&this.element.setAttribute(n,this.htmlAttributes[""+n])}},e.prototype.updateCssClass=function(t,e){n.a.setCssClass(this.getValidClassList(t),[this.inputObj.container],this.getValidClassList(e))},e.prototype.getValidClassList=function(t){var e=t;return i.i(s.isNullOrUndefined)(t)||""===t||(e=t.replace(/\s+/g," ").trim()),e},e.prototype.updateHTMLAttrToWrapper=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var n=e[t];if(o.indexOf(n)>-1)if("class"===n){var a=this.htmlAttributes[""+n].replace(/\s+/g," ").trim();""!==a&&i.i(s.addClass)([this.inputObj.container],a.split(" "))}else if("style"===n){var r=this.inputObj.container.getAttribute(n);r=i.i(s.isNullOrUndefined)(r)?this.htmlAttributes[""+n]:r+this.htmlAttributes[""+n],this.inputObj.container.setAttribute(n,r)}else this.inputObj.container.setAttribute(n,this.htmlAttributes[""+n])}},e.prototype.resetMaskedTextBox=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.customRegExpCollec=[],this.undoCollec=[],this.redoCollec=[],this.promptChar.length>1&&(this.promptChar=this.promptChar[0]),a.b.call(this),a.c.call(this),(null===this.mask||""===this.mask&&void 0!==this.value)&&a.r.call(this,this.value);var t=a.h.call(this,this.element);this.prevValue=t,this.value=t,this.isInitial||a.e.call(this),a.d.call(this)},e.prototype.setMaskPlaceholder=function(t,e){(e||this.placeholder)&&(n.a.setPlaceholder(this.placeholder,this.element),(this.element.value===this.promptMask&&t&&"Always"!==this.floatLabelType||this.element.value===this.promptMask&&"Never"===this.floatLabelType)&&a.r.call(this,""))},e.prototype.setWidth=function(t){if(!i.i(s.isNullOrUndefined)(t))if("number"==typeof t)this.inputObj.container.style.width=i.i(s.formatUnit)(t),this.element.style.width=i.i(s.formatUnit)(t);else if("string"==typeof t){var e=t.match(/px|%|em/)?t:i.i(s.formatUnit)(t);this.inputObj.container.style.width=e,this.element.style.width=e}},e.prototype.checkHtmlAttributes=function(t){for(var e=t?i.i(s.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"],n=0,a=e;n<a.length;n++){var r=a[n];if(!i.i(s.isNullOrUndefined)(this.element.getAttribute(r)))switch(r){case"placeholder":(i.i(s.isNullOrUndefined)(this.maskOptions)||void 0===this.maskOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"disabled":if(i.i(s.isNullOrUndefined)(this.maskOptions)||void 0===this.maskOptions.enabled||t){var l="disabled"!==this.element.getAttribute(r)&&""!==this.element.getAttribute(r)&&"true"!==this.element.getAttribute(r);this.setProperties({enabled:l},!t)}break;case"value":(i.i(s.isNullOrUndefined)(this.maskOptions)||void 0===this.maskOptions.value||t)&&this.setProperties({value:this.element.value},!t);break;case"readonly":if(i.i(s.isNullOrUndefined)(this.maskOptions)||void 0===this.maskOptions.readonly||t){var o="readonly"===this.element.getAttribute(r)||""===this.element.getAttribute(r)||"true"===this.element.getAttribute(r);this.setProperties({readonly:o},!t)}}}},e.prototype.createWrapper=function(){var t=this.cssClass;i.i(s.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(t=this.getValidClassList(this.cssClass)),this.inputObj=n.a.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"))},e.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){switch(s[i]){case"value":a.q.call(this,this.value),this.placeholder&&!this.isFocus&&this.setMaskPlaceholder(!1,!1),""===this.value&&(this.element.selectionStart=0,this.element.selectionEnd=0);break;case"placeholder":this.setMaskPlaceholder(!0,!0);break;case"width":this.setWidth(t.width),n.a.calculateWidth(this.element,this.inputObj.container);break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"enabled":n.a.setEnabled(t.enabled,this.element,this.floatLabelType,this.inputObj.container);break;case"readonly":n.a.setReadonly(t.readonly,this.element);break;case"enableRtl":n.a.setEnableRtl(t.enableRtl,[this.inputObj.container]);break;case"customCharacters":this.customCharacters=t.customCharacters,this.resetMaskedTextBox();break;case"showClearButton":n.a.setClearButton(t.showClearButton,this.element,this.inputObj,void 0,this.createElement),a.f.call(this);break;case"floatLabelType":this.floatLabelType=t.floatLabelType,n.a.removeFloating(this.inputObj),n.a.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement);break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkHtmlAttributes(!0);break;case"mask":var r=this.value;this.mask=t.mask,this.updateValue(r);break;case"promptChar":t.promptChar.length>1&&(t.promptChar=t.promptChar[0]),t.promptChar?this.promptChar=t.promptChar:this.promptChar="_";var l=this.element.value.replace(new RegExp("["+e.promptChar+"]","g"),this.promptChar);this.promptMask===this.element.value&&(l=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=[],a.r.call(this,l)}}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},e.prototype.updateValue=function(t){this.resetMaskedTextBox(),a.q.call(this,t)},e.prototype.getMaskedValue=function(){return a.g.call(this,this.element)},e.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.isFocus=!0,this.element.focus(),i.i(s.addClass)([this.inputObj.container],["e-input-focus"]))},e.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.isFocus=!1,this.element.blur(),i.i(s.removeClass)([this.inputObj.container],["e-input-focus"]))},e.prototype.destroy=function(){a.e.call(this);for(var e=["aria-labelledby","role","autocomplete","aria-readonly","aria-disabled","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-invalid"],r=0;r<e.length;r++)this.element.removeAttribute(e[r]);this.element.classList.remove("e-input"),this.inputObj&&(this.inputObj.container.insertAdjacentElement("afterend",this.element),i.i(s.detach)(this.inputObj.container)),this.blurEventArgs=null,n.a.destroy(),this.changeEventArgs=null,this.inputObj=null,t.prototype.destroy.call(this)},l([i.i(s.Property)(null)],e.prototype,"cssClass",void 0),l([i.i(s.Property)(null)],e.prototype,"width",void 0),l([i.i(s.Property)(null)],e.prototype,"placeholder",void 0),l([i.i(s.Property)("Never")],e.prototype,"floatLabelType",void 0),l([i.i(s.Property)({})],e.prototype,"htmlAttributes",void 0),l([i.i(s.Property)(!0)],e.prototype,"enabled",void 0),l([i.i(s.Property)(!1)],e.prototype,"readonly",void 0),l([i.i(s.Property)(!1)],e.prototype,"showClearButton",void 0),l([i.i(s.Property)(!1)],e.prototype,"enablePersistence",void 0),l([i.i(s.Property)(null)],e.prototype,"mask",void 0),l([i.i(s.Property)("_")],e.prototype,"promptChar",void 0),l([i.i(s.Property)(null)],e.prototype,"value",void 0),l([i.i(s.Property)(null)],e.prototype,"customCharacters",void 0),l([i.i(s.Event)()],e.prototype,"created",void 0),l([i.i(s.Event)()],e.prototype,"destroyed",void 0),l([i.i(s.Event)()],e.prototype,"change",void 0),l([i.i(s.Event)()],e.prototype,"focus",void 0),l([i.i(s.Event)()],e.prototype,"blur",void 0),e=l([s.NotifyPropertyChanges],e)}(s.Component)},function(t,e,i){"use strict";i.d(e,"a",function(){return u});var s=i(0),n=(i.n(s),i(1)),a=this&&this.__extends||function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),r=this&&this.__decorate||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;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},l="e-input-group-icon",o=new RegExp("^(-)?(\\d*)$"),h=["title","style","class"],d=0,u=function(t){function e(e,i){var s=t.call(this,e,i)||this;return s.isVue=!1,s.preventChange=!1,s.isAngular=!1,s.isDynamicChange=!1,s.numericOptions=e,s}return a(e,t),e.prototype.preRender=function(){this.isPrevFocused=!1,this.decimalSeparator=".",this.intRegExp=new RegExp("/^(-)?(d*)$/"),this.isCalled=!1;var t=i.i(s.getValue)("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),i.i(s.removeClass)([this.cloneElement],["e-control","e-numerictextbox","e-lib"]),this.angularTagName=null,this.formEle=i.i(s.closest)(this.element,"form"),"EJS-NUMERICTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;var e=this.createElement("input"),n=0;for(n;n<this.element.attributes.length;n++){var a=this.element.attributes[n].nodeName;"id"!==a&&"class"!==a?(e.setAttribute(this.element.attributes[n].nodeName,this.element.attributes[n].nodeValue),e.innerHTML=this.element.innerHTML):"class"===a&&e.setAttribute(a,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,i.i(s.setValue)("ej2_instances",t,this.element)}i.i(s.attributes)(this.element,{role:"spinbutton",tabindex:"0",autocomplete:"off"});var r={incrementTitle:"Increment value",decrementTitle:"Decrement value",placeholder:this.placeholder};this.l10n=new s.L10n("numerictextbox",r,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",i.i(s.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"),!i.i(s.isNullOrUndefined)(i.i(s.closest)(this.element,"fieldset"))&&i.i(s.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete())},e.prototype.checkAttributes=function(t){for(var e=t?i.i(s.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","step","disabled","readonly","style","name","placeholder"],n=0,a=e;n<a.length;n++){var r=a[n];if(!i.i(s.isNullOrUndefined)(this.element.getAttribute(r)))switch(r){case"disabled":if(i.i(s.isNullOrUndefined)(this.numericOptions)||void 0===this.numericOptions.enabled||t){var l="disabled"!==this.element.getAttribute(r)&&""!==this.element.getAttribute(r)&&"true"!==this.element.getAttribute(r);this.setProperties({enabled:l},!t)}break;case"readonly":if(i.i(s.isNullOrUndefined)(this.numericOptions)||void 0===this.numericOptions.readonly||t){var o="readonly"===this.element.getAttribute(r)||""===this.element.getAttribute(r)||"true"===this.element.getAttribute(r);this.setProperties({readonly:o},!t)}break;case"placeholder":(i.i(s.isNullOrUndefined)(this.numericOptions)||void 0===this.numericOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"value":if(i.i(s.isNullOrUndefined)(this.numericOptions)||void 0===this.numericOptions.value||t){var h=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r));this.setProperties(i.i(s.setValue)(r,h,{}),!t)}break;case"min":if(i.i(s.isNullOrUndefined)(this.numericOptions)||void 0===this.numericOptions.min||t){var d=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r));null===d||isNaN(d)||this.setProperties(i.i(s.setValue)(r,d,{}),!t)}break;case"max":if(i.i(s.isNullOrUndefined)(this.numericOptions)||void 0===this.numericOptions.max||t){var u=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r));null===u||isNaN(u)||this.setProperties(i.i(s.setValue)(r,u,{}),!t)}break;case"step":if(i.i(s.isNullOrUndefined)(this.numericOptions)||void 0===this.numericOptions.step||t){var c=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r));null===c||isNaN(c)||this.setProperties(i.i(s.setValue)(r,c,{}),!t)}break;case"style":this.inputStyle=this.element.getAttribute(r);break;case"name":this.inputName=this.element.getAttribute(r);break;default:var p=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r));(null!==p&&!isNaN(p)||"value"===r)&&this.setProperties(i.i(s.setValue)(r,p,{}),!0)}}},e.prototype.updatePlaceholder=function(){this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0)},e.prototype.initCultureFunc=function(){this.instance=new s.Internationalization(this.locale)},e.prototype.initCultureInfo=function(){this.cultureInfo.format=this.format,null!==i.i(s.getValue)("currency",this)&&(i.i(s.setValue)("currency",this.currency,this.cultureInfo),this.setProperties({currencyCode:this.currency},!0))},e.prototype.createWrapper=function(){var t=this.cssClass;i.i(s.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(t=this.getNumericValidClassList(this.cssClass));var e=n.a.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=e,this.container=e.container,this.container.setAttribute("class","e-control-wrapper e-numeric "+this.container.getAttribute("class")),this.updateHTMLAttrToWrapper(),this.readonly&&i.i(s.attributes)(this.element,{"aria-readonly":"true"}),this.hiddenInput=this.createElement("input",{attrs:{type:"text",validateHidden:"true",class:"e-numeric-hidden"}}),this.inputName=null!==this.inputName?this.inputName:this.element.id,this.element.removeAttribute("name"),this.isAngular&&"EJS-NUMERICTEXTBOX"===this.angularTagName&&this.cloneElement.id.length>0?i.i(s.attributes)(this.hiddenInput,{name:this.cloneElement.id}):i.i(s.attributes)(this.hiddenInput,{name:this.inputName}),this.container.insertBefore(this.hiddenInput,this.container.childNodes[1]),this.updateDataAttribute(!1),null!==this.inputStyle&&i.i(s.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(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var n=e[t];h.indexOf(n)<0&&this.element.setAttribute(n,this.htmlAttributes[""+n])}},e.prototype.updateCssClass=function(t,e){n.a.setCssClass(this.getNumericValidClassList(t),[this.container],this.getNumericValidClassList(e))},e.prototype.getNumericValidClassList=function(t){var e=t;return i.i(s.isNullOrUndefined)(t)||""===t||(e=t.replace(/\s+/g," ").trim()),e},e.prototype.updateHTMLAttrToWrapper=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var n=e[t];if(h.indexOf(n)>-1)if("class"===n){var a=this.getNumericValidClassList(this.htmlAttributes[""+n]);""!==a&&i.i(s.addClass)([this.container],a.split(" "))}else if("style"===n){var r=this.container.getAttribute(n);r=i.i(s.isNullOrUndefined)(r)?this.htmlAttributes[""+n]:r+this.htmlAttributes[""+n],this.container.setAttribute(n,r)}else this.container.setAttribute(n,this.htmlAttributes[""+n])}},e.prototype.setElementWidth=function(t){i.i(s.isNullOrUndefined)(t)||("number"==typeof t?this.container.style.width=i.i(s.formatUnit)(t):"string"==typeof t&&(this.container.style.width=t.match(/px|%|em/)?t:i.i(s.formatUnit)(t)))},e.prototype.spinBtnCreation=function(){this.spinDown=n.a.appendSpan(l+" e-spin-down",this.container,this.createElement),i.i(s.attributes)(this.spinDown,{title:this.l10n.getConstant("decrementTitle")}),this.spinUp=n.a.appendSpan(l+" e-spin-up",this.container,this.createElement),i.i(s.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&&i.i(s.attributes)(this.element,{"aria-valuemin":this.min.toString()}),this.max!==Number.MAX_VALUE&&i.i(s.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?i.i(s.removeClass)([this.container],"e-error"):i.i(s.addClass)([this.container],"e-error"),i.i(s.attributes)(this.element,{"aria-invalid":this.isValidState?"false":"true"})},e.prototype.bindClearEvent=function(){this.showClearButton&&s.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){if(this.setProperties({value:null},!0),this.setElementValue(""),this.hiddenInput.value="",i.i(s.closest)(this.element,"form")){var e=this.element.nextElementSibling,n=document.createEvent("KeyboardEvent");n.initEvent("keyup",!1,!0),e.dispatchEvent(n)}},e.prototype.resetFormHandler=function(){"EJS-NUMERICTEXTBOX"===this.element.tagName?this.updateValue(null):this.updateValue(this.inputEleValue)},e.prototype.setSpinButton=function(){i.i(s.isNullOrUndefined)(this.spinDown)||i.i(s.attributes)(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),i.i(s.isNullOrUndefined)(this.spinUp)||i.i(s.attributes)(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")})},e.prototype.wireEvents=function(){s.EventHandler.add(this.element,"focus",this.focusHandler,this),s.EventHandler.add(this.element,"blur",this.focusOutHandler,this),s.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),s.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),s.EventHandler.add(this.element,"input",this.inputHandler,this),s.EventHandler.add(this.element,"keypress",this.keyPressHandler,this),s.EventHandler.add(this.element,"change",this.changeHandler,this),s.EventHandler.add(this.element,"paste",this.pasteHandler,this),this.enabled&&(this.bindClearEvent(),this.formEle&&s.EventHandler.add(this.formEle,"reset",this.resetFormHandler,this))},e.prototype.wireSpinBtnEvents=function(){s.EventHandler.add(this.spinUp,s.Browser.touchStartEvent,this.mouseDownOnSpinner,this),s.EventHandler.add(this.spinDown,s.Browser.touchStartEvent,this.mouseDownOnSpinner,this),s.EventHandler.add(this.spinUp,s.Browser.touchEndEvent,this.mouseUpOnSpinner,this),s.EventHandler.add(this.spinDown,s.Browser.touchEndEvent,this.mouseUpOnSpinner,this),s.EventHandler.add(this.spinUp,s.Browser.touchMoveEvent,this.touchMoveOnSpinner,this),s.EventHandler.add(this.spinDown,s.Browser.touchMoveEvent,this.touchMoveOnSpinner,this)},e.prototype.unwireEvents=function(){s.EventHandler.remove(this.element,"focus",this.focusHandler),s.EventHandler.remove(this.element,"blur",this.focusOutHandler),s.EventHandler.remove(this.element,"keyup",this.keyUpHandler),s.EventHandler.remove(this.element,"input",this.inputHandler),s.EventHandler.remove(this.element,"keydown",this.keyDownHandler),s.EventHandler.remove(this.element,"keypress",this.keyPressHandler),s.EventHandler.remove(this.element,"change",this.changeHandler),s.EventHandler.remove(this.element,"paste",this.pasteHandler),this.formEle&&s.EventHandler.remove(this.formEle,"reset",this.resetFormHandler)},e.prototype.unwireSpinBtnEvents=function(){s.EventHandler.remove(this.spinUp,s.Browser.touchStartEvent,this.mouseDownOnSpinner),s.EventHandler.remove(this.spinDown,s.Browser.touchStartEvent,this.mouseDownOnSpinner),s.EventHandler.remove(this.spinUp,s.Browser.touchEndEvent,this.mouseUpOnSpinner),s.EventHandler.remove(this.spinDown,s.Browser.touchEndEvent,this.mouseUpOnSpinner),s.EventHandler.remove(this.spinUp,s.Browser.touchMoveEvent,this.touchMoveOnSpinner),s.EventHandler.remove(this.spinDown,s.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){if(this.prevValue!==this.value||this.prevValue!==this.inputValue){var 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),i.i(s.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=this;if(this.enabled&&!this.readonly){var e=this.element.value;setTimeout(function(){t.numericRegex().test(t.element.value)||t.setElementValue(e)})}},e.prototype.preventHandler=function(){var t=this,e=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);setTimeout(function(){if(t.element.selectionStart>0){var n=t.element.selectionStart,a=t.element.selectionStart-1,r=t.element.value.split(""),l=i.i(s.getNumericObject)(t.locale),o=i.i(s.getValue)("decimal",l),h=o.charCodeAt(0);" "===t.element.value[a]&&t.element.selectionStart>0&&!e?(i.i(s.isNullOrUndefined)(t.prevVal)?t.element.value=t.element.value.trim():0!==a?t.element.value=t.prevVal:0===a&&(t.element.value=t.element.value.trim()),t.element.setSelectionRange(a,a)):isNaN(parseFloat(t.element.value[t.element.selectionStart-1]))&&45!==t.element.value[t.element.selectionStart-1].charCodeAt(0)?(r.indexOf(t.element.value[t.element.selectionStart-1])!==r.lastIndexOf(t.element.value[t.element.selectionStart-1])&&t.element.value[t.element.selectionStart-1].charCodeAt(0)===h||t.element.value[t.element.selectionStart-1].charCodeAt(0)!==h)&&(t.element.value=t.element.value.substring(0,a)+t.element.value.substring(n,t.element.value.length),t.element.setSelectionRange(a,a),isNaN(parseFloat(t.element.value[t.element.selectionStart-1]))&&t.element.selectionStart>0&&t.element.value.length&&t.preventHandler()):isNaN(parseFloat(t.element.value[t.element.selectionStart-2]))&&t.element.selectionStart>1&&45!==t.element.value[t.element.selectionStart-2].charCodeAt(0)&&(r.indexOf(t.element.value[t.element.selectionStart-2])!==r.lastIndexOf(t.element.value[t.element.selectionStart-2])&&t.element.value[t.element.selectionStart-2].charCodeAt(0)===h||t.element.value[t.element.selectionStart-2].charCodeAt(0)!==h)&&(t.element.setSelectionRange(a,a),t.nextEle=t.element.value[t.element.selectionStart],t.cursorPosChanged=!0,t.preventHandler()),!0===t.cursorPosChanged&&t.element.value[t.element.selectionStart]===t.nextEle&&isNaN(parseFloat(t.element.value[t.element.selectionStart-1]))&&(t.element.setSelectionRange(t.element.selectionStart+1,t.element.selectionStart+1),t.cursorPosChanged=!1,t.nextEle=null),""===t.element.value.trim()&&t.element.setSelectionRange(0,0),t.element.selectionStart>0&&(45===t.element.value[t.element.selectionStart-1].charCodeAt(0)&&t.element.selectionStart>1&&(i.i(s.isNullOrUndefined)(t.prevVal)?t.element.value=t.element.value:t.element.value=t.prevVal,t.element.setSelectionRange(t.element.selectionStart,t.element.selectionStart)),t.element.value[t.element.selectionStart-1]===o&&0===t.decimals&&t.validateDecimalOnType&&(t.element.value=t.element.value.substring(0,a)+t.element.value.substring(n,t.element.value.length))),t.prevVal=t.element.value}})},e.prototype.keyUpHandler=function(){if(this.enabled&&!this.readonly){!(!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform))&&s.Browser.isDevice&&this.preventHandler();var t=this.instance.getNumberParser({format:"n"})(this.element.value);t=null===t||isNaN(t)?null:t,this.hiddenInput.value=t||0===t?t.toString():null;if(i.i(s.closest)(this.element,"form")){var e=this.element.nextElementSibling,n=document.createEvent("KeyboardEvent");n.initEvent("keyup",!1,!0),e.dispatchEvent(n)}}},e.prototype.inputHandler=function(t){var e=this;if(this.enabled&&!this.readonly){var n=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);if((navigator.userAgent.toLowerCase().indexOf("firefox")>-1||n)&&s.Browser.isDevice&&this.preventHandler(),this.isAngular&&this.element.value!==i.i(s.getValue)("decimal",i.i(s.getNumericObject)(this.locale))&&this.element.value!==i.i(s.getValue)("minusSign",i.i(s.getNumericObject)(this.locale))){var a=this.instance.getNumberParser({format:"n"})(this.element.value);a=isNaN(a)?null:a,e.localChange({value:a}),this.preventChange=!0}if(this.isVue){var r=this.instance.getNumberParser({format:"n"})(this.element.value),l=this.instance.getNumberParser({format:"n"})(this.elementPrevValue);(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])&&(r=this.value);var o={event:t,value:null===r||isNaN(r)?null:r,previousValue:null===l||isNaN(l)?null:l};this.preventChange=!0,this.elementPrevValue=this.element.value,this.trigger("input",o)}}},e.prototype.keyDownHandler=function(t){if(!this.readonly)switch(t.keyCode){case 38:t.preventDefault(),this.action("increment",t);break;case 40:t.preventDefault(),this.action("decrement",t)}},e.prototype.performAction=function(t,e,i){(null===t||isNaN(t))&&(t=0);var s="increment"===i?t+e:t-e;return s=this.correctRounding(t,e,s),this.strictMode?this.trimValue(s):s},e.prototype.correctRounding=function(t,e,i){var s=new RegExp("[,.](.*)"),n=s.test(t.toString()),a=s.test(e.toString());if(n||a){var r=n?s.exec(t.toString())[0].length:0,l=a?s.exec(e.toString())[0].length:0,o=Math.max(r,l);return t=this.roundValue(i,o)}return i},e.prototype.roundValue=function(t,e){e=e||0;var i=Math.pow(10,e);return t*=i,t=Math.round(t)/i},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){i.i(s.setValue)(t,e,this.cultureInfo),this.updateValue(this.value)},e.prototype.changeValue=function(t){if(t||0===t){var e=this.getNumberOfDecimals(t);this.setProperties({value:this.roundNumber(t,e)},!0)}else t=null,this.setProperties({value:t},!0);this.modifyText(),this.strictMode||this.validateState()},e.prototype.modifyText=function(){if(this.value||0===this.value){var t=this.formatNumber(),e=this.isFocused?t:this.instance.getNumberFormat(this.cultureInfo)(this.value);this.setElementValue(e),i.i(s.attributes)(this.element,{"aria-valuenow":t}),this.hiddenInput.value=this.value.toString(),null!==this.value&&this.serverDecimalSeparator&&(this.hiddenInput.value=this.hiddenInput.value.replace(".",this.serverDecimalSeparator))}else this.setElementValue(""),this.element.removeAttribute("aria-valuenow"),this.hiddenInput.value=null},e.prototype.setElementValue=function(t,e){n.a.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,n=new RegExp("[eE][-+]?([0-9]+)"),a=t.toString();if(n.test(a)){var r=n.exec(a);i.i(s.isNullOrUndefined)(r)||(a=t.toFixed(Math.min(parseInt(r[1],10),20)))}var l=a.split(".")[1];return e=l&&l.length?l.length:0,null!==this.decimals&&(e=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 i=t,s=e||0,n=i.toString().split("e");i=Math.round(Number(n[0]+"e"+(n[1]?Number(n[1])+s:s)));var a=i.toString().split("e");return i=Number(a[0]+"e"+(a[1]?Number(a[1])-s:-s)),Number(i.toFixed(s))},e.prototype.cancelEvent=function(t){return t.preventDefault(),!1},e.prototype.keyPressHandler=function(t){if(!this.enabled||this.readonly)return!0;if(!s.Browser.isDevice&&"11.0"===s.Browser.info.version&&13===t.keyCode){var e=this.instance.getNumberParser({format:"n"})(this.element.value);return this.updateValue(e,t),!0}if(0===t.which||t.metaKey||t.ctrlKey||8===t.keyCode||13===t.keyCode)return!0;var n=String.fromCharCode(t.which),a=i.i(s.getValue)("decimal",i.i(s.getNumericObject)(this.locale)),r="NumpadDecimal"===t.code&&n!==a;r&&(n=a);var l=this.element.value;if(l=l.substring(0,this.element.selectionStart)+n+l.substring(this.element.selectionEnd),this.numericRegex().test(l)){if(r){var o=this.element.selectionStart+1;this.element.value=l,this.element.setSelectionRange(o,o),t.preventDefault(),t.stopPropagation()}return!0}return t.preventDefault(),t.stopPropagation(),!1},e.prototype.numericRegex=function(){var t=i.i(s.getNumericObject)(this.locale),e=i.i(s.getValue)("decimal",t),n="*";return"."===e&&(e="\\"+e),0===this.decimals&&this.validateDecimalOnType?o:(this.decimals&&this.validateDecimalOnType&&(n="{0,"+this.decimals+"}"),new RegExp("^(-)?(((\\d+("+e+"\\d"+n+")?)|("+e+"\\d"+n+")))?$"))},e.prototype.mouseWheel=function(t){t.preventDefault();var e,i=t;i.wheelDelta?e=i.wheelDelta/120:i.detail&&(e=-i.detail/3),e>0?this.action("increment",t):e<0&&this.action("decrement",t),this.cancelEvent(t)},e.prototype.focusHandler=function(t){var e=this;if(clearTimeout(d),this.focusEventArgs={event:t,value:this.value,container:this.container},this.trigger("focus",this.focusEventArgs),this.enabled&&!this.readonly){if(this.isFocused=!0,i.i(s.removeClass)([this.container],"e-error"),this.prevValue=this.value,this.value||0===this.value){var n=this.formatNumber();if(this.setElementValue(n),!this.isPrevFocused)if(s.Browser.isDevice||"11.0"!==s.Browser.info.version){var a=s.Browser.isDevice&&s.Browser.isIos?600:0;d=setTimeout(function(){e.element.setSelectionRange(0,n.length)},a)}else this.element.setSelectionRange(0,n.length)}s.Browser.isDevice||s.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this)}},e.prototype.focusOutHandler=function(t){var e=this;if(this.blurEventArgs={event:t,value:this.value,container:this.container},this.trigger("blur",this.blurEventArgs),this.enabled&&!this.readonly){if(this.isPrevFocused){if(t.preventDefault(),s.Browser.isDevice){var n=this.element.value;this.element.focus(),this.isPrevFocused=!1;var a=this.element;setTimeout(function(){e.setElementValue(n,a)},200)}}else{this.isFocused=!1,this.element.value.length||this.setProperties({value:null},!0);var r=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(r),s.Browser.isDevice||s.EventHandler.remove(this.element,"mousewheel DOMMouseScroll",this.mouseWheel)}if(i.i(s.closest)(this.element,"form")){var l=this.element.nextElementSibling,o=document.createEvent("FocusEvent");o.initEvent("focusout",!1,!0),l.dispatchEvent(o)}}},e.prototype.mouseDownOnSpinner=function(t){var e=this;if(this.isFocused&&(this.isPrevFocused=!0,t.preventDefault()),this.getElementData(t)){var i=(this.getElementData(t),t.currentTarget),n=i.classList.contains("e-spin-up")?"increment":"decrement";s.EventHandler.add(i,"mouseleave",this.mouseUpClick,this),this.timeOut=setInterval(function(){e.isCalled=!0,e.action(n,t)},150),s.EventHandler.add(document,"mouseup",this.mouseUpClick,this)}},e.prototype.touchMoveOnSpinner=function(t){var e;if("touchmove"===t.type){var i=t.touches;e=i.length&&document.elementFromPoint(i[0].pageX,i[0].pageY)}else e=document.elementFromPoint(t.clientX,t.clientY);e.classList.contains(l)||clearInterval(this.timeOut)},e.prototype.mouseUpOnSpinner=function(t){if(this.prevValue=this.value,this.isPrevFocused&&(this.element.focus(),s.Browser.isDevice||(this.isPrevFocused=!1)),s.Browser.isDevice||t.preventDefault(),this.getElementData(t)){var e=t.currentTarget,n=e.classList.contains("e-spin-up")?"increment":"decrement";s.EventHandler.remove(e,"mouseleave",this.mouseUpClick),this.isCalled||this.action(n,t),this.isCalled=!1,s.EventHandler.remove(document,"mouseup",this.mouseUpClick);if(i.i(s.closest)(this.element,"form")){var a=this.element.nextElementSibling,r=document.createEvent("KeyboardEvent");r.initEvent("keyup",!1,!0),a.dispatchEvent(r)}}},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(){n.a.removeFloating(this.inputWrapper);var t=this.hiddenInput;this.hiddenInput.remove(),n.a.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,s.EventHandler.remove(this.spinUp,"mouseleave",this.mouseUpClick),s.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,"increment")),this.raiseChangeEvent()},e.prototype.decrement=function(t){void 0===t&&(t=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,t,"decrement")),this.raiseChangeEvent()},e.prototype.destroy=function(){this.unwireEvents(),i.i(s.detach)(this.hiddenInput),this.showSpinButton&&(this.unwireSpinBtnEvents(),i.i(s.detach)(this.spinUp),i.i(s.detach)(this.spinDown));for(var e=["aria-labelledby","role","autocomplete","aria-readonly","aria-disabled","autocapitalize","spellcheck","aria-autocomplete","tabindex","aria-valuemin","aria-valuemax","aria-valuenow","aria-invalid"],a=0;a<e.length;a++)this.element.removeAttribute(e[a]);this.element.classList.remove("e-input"),this.container.insertAdjacentElement("afterend",this.element),i.i(s.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,n.a.destroy(),t.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(),i.i(s.addClass)([this.container],["e-input-focus"]))},e.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),i.i(s.removeClass)([this.container],["e-input-focus"]))},e.prototype.getPersistData=function(){var t=["value"];return this.addOnPersist(t)},e.prototype.onPropertyChanged=function(t,e){for(var a=0,r=Object.keys(t);a<r.length;a++){var l=r[a];switch(l){case"width":this.setElementWidth(t.width),n.a.calculateWidth(this.element,this.container);break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"enabled":n.a.setEnabled(t.enabled,this.element),this.bindClearEvent();break;case"enableRtl":n.a.setEnableRtl(t.enableRtl,[this.container]);break;case"readonly":n.a.setReadonly(t.readonly,this.element),this.readonly?i.i(s.attributes)(this.element,{"aria-readonly":"true"}):this.element.removeAttribute("aria-readonly");break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.updateDataAttribute(!0),this.checkAttributes(!0),n.a.validateInputType(this.container,this.element);break;case"placeholder":n.a.setPlaceholder(t.placeholder,this.element),n.a.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":i.i(s.setValue)(l,i.i(s.getValue)(l,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(),n.a.setPlaceholder(this.placeholder,this.element),this.updateValue(this.value);break;case"currency":var o=i.i(s.getValue)(l,t);this.setProperties({currencyCode:o},!0),this.updateCurrency(l,o);break;case"currencyCode":var h=i.i(s.getValue)(l,t);this.setProperties({currency:h},!0),this.updateCurrency("currency",h);break;case"format":i.i(s.setValue)(l,i.i(s.getValue)(l,t),this),this.initCultureInfo(),this.updateValue(this.value);break;case"decimals":this.decimals=t.decimals,this.updateValue(this.value)}}},e.prototype.updateClearButton=function(t){n.a.setClearButton(t.showClearButton,this.element,this.inputWrapper,void 0,this.createElement),this.bindClearEvent()},e.prototype.updateSpinButton=function(t){t.showSpinButton?this.spinBtnCreation():(i.i(s.detach)(this.spinUp),i.i(s.detach)(this.spinDown))},e.prototype.getModuleName=function(){return"numerictextbox"},r([i.i(s.Property)("")],e.prototype,"cssClass",void 0),r([i.i(s.Property)(null)],e.prototype,"value",void 0),r([i.i(s.Property)(-Number.MAX_VALUE)],e.prototype,"min",void 0),r([i.i(s.Property)(Number.MAX_VALUE)],e.prototype,"max",void 0),r([i.i(s.Property)(1)],e.prototype,"step",void 0),r([i.i(s.Property)(null)],e.prototype,"width",void 0),r([i.i(s.Property)(null)],e.prototype,"placeholder",void 0),r([i.i(s.Property)({})],e.prototype,"htmlAttributes",void 0),r([i.i(s.Property)(!0)],e.prototype,"showSpinButton",void 0),r([i.i(s.Property)(!1)],e.prototype,"readonly",void 0),r([i.i(s.Property)(!0)],e.prototype,"enabled",void 0),r([i.i(s.Property)(!1)],e.prototype,"showClearButton",void 0),r([i.i(s.Property)(!1)],e.prototype,"enablePersistence",void 0),r([i.i(s.Property)("n2")],e.prototype,"format",void 0),r([i.i(s.Property)(null)],e.prototype,"decimals",void 0),r([i.i(s.Property)(null)],e.prototype,"currency",void 0),r([i.i(s.Property)(null)],e.prototype,"currencyCode",void 0),r([i.i(s.Property)(!0)],e.prototype,"strictMode",void 0),r([i.i(s.Property)(!1)],e.prototype,"validateDecimalOnType",void 0),r([i.i(s.Property)("Never")],e.prototype,"floatLabelType",void 0),r([i.i(s.Event)()],e.prototype,"created",void 0),r([i.i(s.Event)()],e.prototype,"destroyed",void 0),r([i.i(s.Event)()],e.prototype,"change",void 0),r([i.i(s.Event)()],e.prototype,"focus",void 0),r([i.i(s.Event)()],e.prototype,"blur",void 0),e=r([s.NotifyPropertyChanges],e)}(s.Component)},function(t,e,i){"use strict";i.d(e,"a",function(){return s}),i.d(e,"b",function(){return h}),i.d(e,"c",function(){return d});var s,n=i(0),a=(i.n(n),i(2)),r=(i.n(a),this&&this.__extends||function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}()),l=this&&this.__decorate||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;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},o="e-rating-icon e-icons e-star-filled";!function(t){t.Top="Top",t.Bottom="Bottom",t.Left="Left",t.Right="Right"}(s||(s={}));var h;!function(t){t.Full="Full",t.Half="Half",t.Quarter="Quarter",t.Exact="Exact"}(h||(h={}));var d=function(t){function e(e,i){var s=t.call(this,e,i)||this;return s.itemElements=[],s}return r(e,t),e.prototype.preRender=function(){this.element.id||(this.element.id=i.i(n.getUniqueID)("e-"+this.getModuleName())),this.keyConfigs={downarrow:"downarrow",leftarrow:"leftarrow",rightarrow:"rightarrow",uparrow:"uparrow",space:"space"},this.tooltipOpen=!1},e.prototype.render=function(){this.initialize(),this.updateMinValue(),this.updateTemplateFunction(),this.triggerChange(null,this.value,!1),this.renderItems(),this.displayLabel()},e.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),i.i(n.attributes)(this.element,{"aria-label":"rating"}),this.renderItemList(),this.updateReset(),this.readOnly&&this.wrapper.classList.add("e-rating-readonly"),this.visible||this.wrapper.classList.add("e-rating-hidden"),this.enableRtl&&this.wrapper.classList.add("e-rtl"),this.enableAnimation&&this.wrapper.classList.add("e-rating-animation"),this.cssClass&&i.i(n.addClass)([this.wrapper],this.cssClass.split(" ")),this.updateTooltip(),this.wireKeyboardEvent(),this.updateDisabled()},e.prototype.updateDisabled=function(){this.wrapper.classList[this.disabled?"add":"remove"]("e-disabled"),i.i(n.attributes)(this.ratingItemList,{tabindex:this.disabled?"-1":"0"}),this.updateResetButton()},e.prototype.updateResetButton=function(){if(this.allowReset){var t=this.value<=this.min||this.disabled;this.resetElement.classList[t?"add":"remove"]("e-disabled"),i.i(n.attributes)(this.resetElement,{tabindex:t?"-1":"0","aria-hidden":t.toString()})}},e.prototype.renderItemList=function(){var t=this;this.ratingItemList=this.createElement("div",{className:"e-rating-item-list",id:this.element.id+"_item-list"}),i.i(n.attributes)(this.ratingItemList,{"aria-label":"rating",role:"slider"}),this.wrapper.appendChild(this.ratingItemList),n.EventHandler.add(this.ratingItemList,"touchmove",function(e){return t.touchMoveHandler(e)},this),n.EventHandler.add(this.ratingItemList,n.Browser.touchEndEvent,this.touchEndHandler,this)},e.prototype.touchMoveHandler=function(t){var e=this.ratingItemList.getBoundingClientRect(),i=t.touches[0].clientX-e.x,s=i/e.width*this.itemsCount;s=this.enableRtl?this.itemsCount-s:s,s=s<this.min?this.min:s>this.itemsCount?this.itemsCount:s,s=this.validateValue(s);var n=0===s?null:this.itemElements[parseInt((Math.ceil(s)-1).toString(),10)];if(s===this.currentValue)return void(this.showTooltip&&n&&this.openRatingTooltip(n,!1));var a=this.currentValue;this.updateCurrentValue(s),this.triggerChange(t,s),this.showTooltip&&(n?(Math.ceil(s)!==Math.ceil(a)&&this.closeRatingTooltip(),this.openRatingTooltip(n,!0)):this.closeRatingTooltip())},e.prototype.touchEndHandler=function(){this.closeRatingTooltip()},e.prototype.updateTemplateFunction=function(){this.emptyTemplateFunction=this.emptyTemplate?this.getTemplateString(this.emptyTemplate):null,this.fullTemplateFunction=this.fullTemplate?this.getTemplateString(this.fullTemplate):null},e.prototype.renderItems=function(){for(var t=this,e=0;e<this.itemsCount;e++){var s=this.createElement("span",{className:"e-rating-item-container"}),a=this.createElement("span",{className:"e-rating-item"}),r=this.getRatingValue(this.value,e);this.renderItemContent(a,r,e,!1),s.appendChild(a),this.wireItemsEvents(s,e+1),this.itemElements.push(s);var l={element:s,value:e+1};this.trigger("beforeItemRender",l,function(e){t.ratingItemList.appendChild(e.element)})}i.i(n.attributes)(this.ratingItemList,{"aria-valuemax":this.itemsCount.toString()}),this.updateItemValue(!1)},e.prototype.renderItemContent=function(t,e,s,a){a&&this.removeItemContent(t),this.fullTemplate&&1===e?(t.classList.add("e-rating-full"),t.append(this.fullTemplateFunction({index:s,ratingValue:e},this,"ratingFullTemplate",this.element.id+"fullTemplate",this.isStringTemplate)[0])):this.emptyTemplate?(t.classList.add("e-rating-empty"),t.append(this.emptyTemplateFunction({index:s,ratingValue:e},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate",this.isStringTemplate)[0])):i.i(n.addClass)([t],o.split(" "))},e.prototype.removeItemContent=function(t){t.classList.remove("e-rating-full","e-rating-empty"),i.i(n.removeClass)([t],o.split(" ")),t.firstChild&&t.removeChild(t.firstChild)},e.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipObj=new a.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)):i.i(n.isNullOrUndefined)(this.tooltipObj)||(this.tooltipObj.destroy(),this.tooltipObj=null)},e.prototype.updateMinValue=function(){this.setProperties({min:this.validateValue(this.min)},!0),this.min>0&&this.value<this.min&&this.triggerChange(null,this.min,!1),i.i(n.attributes)(this.ratingItemList,{"aria-valuemin":this.min.toString()})},e.prototype.validateValue=function(t){return t=t>this.itemsCount?this.itemsCount:t<0?0:this.precision===h.Full||this.enableSingleSelection?Math.round(t):this.precision===h.Half?Math.round(2*t)/2:this.precision===h.Quarter?Math.round(4*t)/4:Math.round(10*t)/10},e.prototype.getRatingValue=function(t,e){return this.enableSingleSelection?t>e&&t<=e+1?1:0:t>=e+1?1:t<e?0:t-e},e.prototype.updateItemValue=function(t){void 0===t&&(t=!0),t&&this.isReact&&this.clearTemplate(["ratingEmptyTemplate","ratingFullTemplate"]);for(var e=0;e<this.itemsCount;e++){var s=this.itemElements[parseInt(e.toString(),10)];s.classList.remove("e-rating-selected","e-rating-intermediate","e-selected-value");var a=this.getRatingValue(this.currentValue,e);1===a?s.classList.add("e-rating-selected"):a>0?s.classList.add("e-rating-intermediate"):this.precision===h.Full&&e+1<=this.value&&!this.enableSingleSelection&&s.classList.add("e-selected-value"),t&&this.updateItemContent(a,e),s.style.setProperty("--rating-value",100*a+"%"),s.classList[0===this.value&&0===e||this.value===e+1||a>0&&a<1?"add":"remove"]("e-rating-focus")}t&&this.renderReactTemplates(),this.updateResetButton(),i.i(n.attributes)(this.ratingItemList,{"aria-valuenow":this.currentValue.toString()}),i.i(n.attributes)(this.element,{value:this.value.toString()})},e.prototype.updateItemContent=function(t,e){if(this.fullTemplate||this.emptyTemplate){var s=this.itemElements[parseInt(e.toString(),10)].querySelector(".e-rating-item");if(this.fullTemplate&&1===t){if(!this.isReact&&s.classList.contains("e-rating-full"))return;this.removeItemContent(s),s.classList.add("e-rating-full"),s.append(this.fullTemplateFunction({ratingValue:t,index:e},this,"ratingFullTemplate",this.element.id+"fullTemplate"+e,this.isStringTemplate)[0])}else if(this.emptyTemplate){if(!this.isReact&&s.classList.contains("e-rating-empty"))return;this.removeItemContent(s),s.classList.add("e-rating-empty"),s.append(this.emptyTemplateFunction({ratingValue:t,index:e},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate"+e,this.isStringTemplate)[0])}else this.removeItemContent(s),i.i(n.addClass)([s],o.split(" "))}},e.prototype.updateTooltipContent=function(t){if(this.showTooltip){this.isReact&&this.clearTemplate(["ratingTooltipTemplate"]);var e=void 0;if(this.tooltipTemplate){e=this.getTemplateString(this.tooltipTemplate)({value:this.currentValue},this,"ratingTooltipTemplate",this.element.id+"tooltipTemplate",this.isStringTemplate)[0]}else e=this.currentValue.toString();this.tooltipObj.setProperties({content:e},t),this.renderReactTemplates()}},e.prototype.getTemplateString=function(t){var e="";try{var s=i.i(n.select)(t);e=s?"SCRIPT"===s.tagName?s.innerHTML:s.outerHTML:t}catch(i){e=t}return i.i(n.compile)(e)},e.prototype.displayLabel=function(){this.showLabel?(this.spanLabel=this.createElement("span",{className:"e-rating-label"}),this.updateLabel(),this.updateLabelPosition()):this.wrapper.contains(this.spanLabel)&&(i.i(n.remove)(this.spanLabel),this.spanLabel=null)},e.prototype.updateLabel=function(){if(this.showLabel)if(this.labelTemplate){this.isReact&&this.clearTemplate(["ratingLabelTemplate"]),this.spanLabel.firstChild&&this.spanLabel.removeChild(this.spanLabel.firstChild);var t=this.getTemplateString(this.labelTemplate);this.spanLabel.append(t({value:this.currentValue},this,"ratingLabelTemplate",this.element.id+"labelTemplate",this.isStringTemplate)[0]),this.renderReactTemplates()}else this.spanLabel.textContent=this.currentValue+" / "+this.itemsCount},e.prototype.updateReset=function(){this.allowReset?(this.resetElement=this.createElement("span",{className:"e-icons e-reset",attrs:{"aria-label":"resetbutton",role:"button"}}),this.updateResetButton(),n.EventHandler.add(this.resetElement,"click",this.resetClicked,this),this.wrapper.insertBefore(this.resetElement,this.ratingItemList)):this.wrapper.contains(this.resetElement)&&(i.i(n.remove)(this.resetElement),this.resetElement=null)},e.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)},e.prototype.clearLabelPosition=function(){var t=this.spanLabel.classList.value.match(/(e-label-[top|bottom|right|left]+)/g);t&&i.i(n.removeClass)([this.spanLabel],t)},e.prototype.wireItemsEvents=function(t,e){var i=this;n.EventHandler.add(t,"click",function(t){return i.clickHandler(t)},this),n.EventHandler.add(t,"mousemove",function(t){return i.mouseMoveHandler(e,t)},this),n.EventHandler.add(t,"mouseleave",this.mouseLeaveHandler,this)},e.prototype.clickHandler=function(t){this.currentValue=this.min>0&&this.currentValue<this.min?this.min:this.currentValue,this.triggerChange(t,this.currentValue),this.updateItemValue(),this.updateLabel(),this.updateResetButton()},e.prototype.updateValueChange=function(t,e,i){void 0===i&&(i=!0),this.triggerChange(t,e,i),this.updateItemValue(),this.updateLabel()},e.prototype.triggerChange=function(t,e,i){if(void 0===i&&(i=!0),e=this.validateValue(e),this.currentValue=e,this.currentValue!==this.value){var s={event:t,isInteracted:i,value:e,previousValue:this.value};this.setProperties({value:e},!0),this.trigger("valueChanged",s)}},e.prototype.mouseMoveHandler=function(t,e){var i=this.calculateCurrentValue(t,e);i=this.validateValue(i);var s=this.itemElements[parseInt((t-1).toString(),10)];if(i===this.currentValue)return void this.openRatingTooltip(s,!1);this.updateCurrentValue(i),this.openRatingTooltip(s,!0);var n={element:s,event:e,value:i};this.trigger("onItemHover",n)},e.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))},e.prototype.closeRatingTooltip=function(){this.tooltipOpen&&(this.tooltipObj.close(),this.tooltipOpen=!1)},e.prototype.updateCurrentValue=function(t){this.currentValue=t,this.updateItemValue(),this.updateLabel()},e.prototype.mouseLeaveHandler=function(){this.closeRatingTooltip(),this.updateCurrentValue(this.value)},e.prototype.calculateCurrentValue=function(t,e){var i=t;return this.enableSingleSelection||this.precision===h.Full||(i=e.offsetX/this.itemElements[t-1].clientWidth,i=this.enableRtl?1-i:i,this.precision===h.Quarter?i=i<=.25?.25:i<=.5?.5:i<.75?.75:1:this.precision===h.Half&&(i=i<=.5?.5:1),i=i+t-1),i},e.prototype.reset=function(){this.resetClicked(null,!1)},e.prototype.resetClicked=function(t,e){void 0===e&&(e=!0),this.updateValueChange(t,this.min,e),this.updateResetButton()},e.prototype.wireKeyboardEvent=function(){this.keyboardModuleRating=new n.KeyboardEvents(this.wrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},e.prototype.keyActionHandler=function(t){if(!this.disabled&&!this.readOnly){if(t.target.classList.contains("e-rating-item-list"))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)}if(this.allowReset&&t.target.classList.contains("e-reset"))switch(t.action){case"space":this.resetClicked(t)}}},e.prototype.handleNavigation=function(t,e){if(!e&&this.value>this.min||e&&this.value<this.itemsCount){var i=this.precision===h.Full||this.enableSingleSelection?1:this.precision===h.Half?.5:this.precision===h.Quarter?.25:Math.round(1)/10;i=e?this.value+i:this.value-i,this.updateValueChange(t,i),this.updateResetButton()}},e.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)}},e.prototype.getModuleName=function(){return"rating"},e.prototype.getPersistData=function(){return this.addOnPersist([])},e.prototype.removeItemElements=function(){for(var t=0;t<this.itemElements.length;t++)i.i(n.remove)(this.itemElements[parseInt(t.toString(),10)]);this.itemElements=[]},e.prototype.destroy=function(){var e=this;t.prototype.destroy.call(this),this.removeItemElements(),this.clearTemplate(),this.spanLabel&&(i.i(n.remove)(this.spanLabel),this.spanLabel=null),this.resetElement&&(i.i(n.remove)(this.resetElement),this.resetElement=null),this.showTooltip&&(this.tooltipObj.destroy(),this.tooltipObj=null),i.i(n.remove)(this.ratingItemList),this.ratingItemList=null,this.wrapper.parentNode.insertBefore(this.element,this.wrapper),i.i(n.remove)(this.wrapper),this.wrapper=null,this.keyboardModuleRating.destroy(),this.keyboardModuleRating=null,["value","aria-label","name"].forEach(function(t){e.element.removeAttribute(t)})},e.prototype.onPropertyChanged=function(t,e){for(var s=0,a=Object.keys(t);s<a.length;s++){switch(a[s]){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"]("e-rating-hidden");break;case"disabled":this.updateDisabled();break;case"readOnly":this.wrapper.classList[this.readOnly?"add":"remove"]("e-rating-readonly");break;case"allowReset":this.updateReset();break;case"enableRtl":this.wrapper.classList[this.enableRtl?"add":"remove"]("e-rtl");break;case"cssClass":e.cssClass&&i.i(n.removeClass)([this.wrapper],e.cssClass.split(" ")),t.cssClass&&i.i(n.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"]("e-rating-animation");break;case"emptyTemplate":case"fullTemplate":this.updateTemplateFunction(),this.updateContent();break;case"labelTemplate":this.updateLabel();break;case"itemsCount":this.removeItemElements(),this.renderItems(),this.updateLabel()}}},l([i.i(n.Property)(!1)],e.prototype,"allowReset",void 0),l([i.i(n.Property)("")],e.prototype,"cssClass",void 0),l([i.i(n.Property)(!1)],e.prototype,"disabled",void 0),l([i.i(n.Property)("")],e.prototype,"emptyTemplate",void 0),l([i.i(n.Property)(!0)],e.prototype,"enableAnimation",void 0),l([i.i(n.Property)(!1)],e.prototype,"enableSingleSelection",void 0),l([i.i(n.Property)("")],e.prototype,"fullTemplate",void 0),l([i.i(n.Property)(5)],e.prototype,"itemsCount",void 0),l([i.i(n.Property)(s.Right)],e.prototype,"labelPosition",void 0),l([i.i(n.Property)("")],e.prototype,"labelTemplate",void 0),l([i.i(n.Property)(0)],e.prototype,"min",void 0),l([i.i(n.Property)(h.Full)],e.prototype,"precision",void 0),l([i.i(n.Property)(!1)],e.prototype,"readOnly",void 0),l([i.i(n.Property)(!1)],e.prototype,"showLabel",void 0),l([i.i(n.Property)(!0)],e.prototype,"showTooltip",void 0),l([i.i(n.Property)("")],e.prototype,"tooltipTemplate",void 0),l([i.i(n.Property)(0)],e.prototype,"value",void 0),l([i.i(n.Property)(!0)],e.prototype,"visible",void 0),l([i.i(n.Event)()],e.prototype,"beforeItemRender",void 0),l([i.i(n.Event)()],e.prototype,"created",void 0),l([i.i(n.Event)()],e.prototype,"onItemHover",void 0),l([i.i(n.Event)()],e.prototype,"valueChanged",void 0),e=l([n.NotifyPropertyChanges],e)}(n.Component)},function(t,e,i){"use strict";i.d(e,"a",function(){return l});var s=i(0),n=(i.n(s),i(6)),a=this&&this.__extends||function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),r=this&&this.__decorate||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;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},l=function(t){function e(e,i){return t.call(this,e,i)||this}return a(e,t),e.prototype.preRender=function(){},e.prototype.render=function(){this.initialize()},e.prototype.initialize=function(){i.i(s.addClass)([this.element],"e-"+this.getModuleName()),t.prototype.initialize.call(this,this.element),this.enablePersistence&&this.loadPersistedSignature()},e.prototype.getModuleName=function(){return"signature"},e.prototype.getPersistData=function(){return this.addOnPersist(["signatureValue"])},e.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++){var a=n[s];switch(a){case"backgroundColor":t.prototype.propertyChanged.call(this,a,e.backgroundColor);break;case"backgroundImage":t.prototype.propertyChanged.call(this,a,e.backgroundImage);break;case"strokeColor":e.strokeColor!==i.strokeColor&&t.prototype.propertyChanged.call(this,a,e.strokeColor);break;case"saveWithBackground":t.prototype.propertyChanged.call(this,a,e.saveWithBackground);break;case"isReadOnly":t.prototype.propertyChanged.call(this,a,e.isReadOnly);break;case"disabled":t.prototype.propertyChanged.call(this,a,e.disabled)}}},r([i.i(s.Property)("")],e.prototype,"backgroundColor",void 0),r([i.i(s.Property)("")],e.prototype,"backgroundImage",void 0),r([i.i(s.Property)(!1)],e.prototype,"disabled",void 0),r([i.i(s.Property)(!1)],e.prototype,"isReadOnly",void 0),r([i.i(s.Property)(!0)],e.prototype,"saveWithBackground",void 0),r([i.i(s.Property)("#000000")],e.prototype,"strokeColor",void 0),r([i.i(s.Property)(.5)],e.prototype,"minStrokeWidth",void 0),r([i.i(s.Property)(2)],e.prototype,"maxStrokeWidth",void 0),r([i.i(s.Property)(.7)],e.prototype,"velocity",void 0),r([i.i(s.Property)("en-US")],e.prototype,"locale",void 0),r([i.i(s.Property)(!1)],e.prototype,"enableRtl",void 0),r([i.i(s.Property)(!1)],e.prototype,"enablePersistence",void 0),r([i.i(s.Event)()],e.prototype,"beforeSave",void 0),r([i.i(s.Event)()],e.prototype,"change",void 0),r([i.i(s.Event)()],e.prototype,"created",void 0),e=r([s.NotifyPropertyChanges],e)}(n.a)},function(t,e,i){"use strict";i.d(e,"a",function(){return o});var s=i(0),n=(i.n(s),i(1)),a=this&&this.__extends||function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),r=this&&this.__decorate||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;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},l=["title","style","class"],o=function(t){function e(e,i){var s=t.call(this,e,i)||this;return s.previousValue=null,s.isAngular=!1,s.isHiddenInput=!1,s.isForm=!1,s.inputPreviousValue=null,s.isVue=!1,s.textboxOptions=e,s}return a(e,t),e.prototype.onPropertyChanged=function(t,e){for(var a=0,r=Object.keys(t);a<r.length;a++){switch(r[a]){case"floatLabelType":n.a.removeFloating(this.textboxWrapper),n.a.addFloating(this.respectiveElement,this.floatLabelType,this.placeholder);break;case"enabled":n.a.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container),this.bindClearEvent();break;case"width":n.a.setWidth(t.width,this.textboxWrapper.container);break;case"value":var l=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.isBlank(this.value)||(this.value=this.value.toString()),this.isProtectedOnChange=l,n.a.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):(i.i(s.isNullOrUndefined)(this.isAngular)||!this.isAngular||this.isAngular&&!this.preventChange||this.isAngular&&i.i(s.isNullOrUndefined)(this.preventChange))&&this.raiseChangeEvent();break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkAttributes(!0),this.multiline&&!i.i(s.isNullOrUndefined)(this.textarea)?n.a.validateInputType(this.textboxWrapper.container,this.textarea):n.a.validateInputType(this.textboxWrapper.container,this.element);break;case"readonly":n.a.setReadonly(this.readonly,this.respectiveElement);break;case"type":"TEXTAREA"!==this.respectiveElement.tagName&&(this.respectiveElement.setAttribute("type",this.type),n.a.validateInputType(this.textboxWrapper.container,this.element),this.raiseChangeEvent());break;case"showClearButton":"TEXTAREA"!==this.respectiveElement.tagName&&(n.a.setClearButton(this.showClearButton,this.respectiveElement,this.textboxWrapper),this.bindClearEvent());break;case"enableRtl":n.a.setEnableRtl(this.enableRtl,[this.textboxWrapper.container]);break;case"placeholder":n.a.setPlaceholder(this.placeholder,this.respectiveElement),n.a.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":this.updateCssClass(t.cssClass,e.cssClass);break;case"locale":this.globalize=new s.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),n.a.setPlaceholder(this.placeholder,this.respectiveElement)}}},e.prototype.getModuleName=function(){return"textbox"},e.prototype.isBlank=function(t){return!t||/^\s*$/.test(t)},e.prototype.preRender=function(){if(this.cloneElement=this.element.cloneNode(!0),this.formElement=i.i(s.closest)(this.element,"form"),i.i(s.isNullOrUndefined)(this.formElement)||(this.isForm=!0),"EJS-TEXTBOX"===this.element.tagName){var t=i.i(s.getValue)("ej2_instances",this.element),e=this.multiline?this.createElement("textarea"):this.createElement("input"),n=0;for(n;n<this.element.attributes.length;n++){var a=this.element.attributes[n].nodeName;"id"!==a&&"class"!==a?(e.setAttribute(a,this.element.attributes[n].nodeValue),e.innerHTML=this.element.innerHTML,"name"===a&&this.element.removeAttribute("name")):"class"===a&&e.setAttribute(a,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "))}this.element.appendChild(e),this.element=e,i.i(s.setValue)("ej2_instances",t,this.element)}this.updateHTMLAttrToElement(),this.checkAttributes(!1),!i.i(s.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&&this.element.setAttribute("role","textbox"),this.globalize=new s.Internationalization(this.locale);var r={placeholder:this.placeholder};if(this.l10n=new s.L10n("textbox",r,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",i.i(s.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",i.i(s.getUniqueID)("textarea"));for(var o=["placeholder","disabled","value","readonly","type","autocomplete"],n=0;n<this.element.attributes.length;n++){var a=this.element.attributes[n].nodeName;this.element.hasAttribute(a)&&l.indexOf(a)<0&&"id"!==a&&"type"!==a&&"e-mappinguid"!==a&&(this.textarea.setAttribute(a,this.element.attributes[n].nodeValue),o.indexOf(a)<0&&(this.element.removeAttribute(a),n--))}}},e.prototype.checkAttributes=function(t){for(var e=t?i.i(s.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly","type","autocomplete"],n=0,a=e;n<a.length;n++){var r=a[n];if(!i.i(s.isNullOrUndefined)(this.element.getAttribute(r)))switch(r){case"disabled":if(i.i(s.isNullOrUndefined)(this.textboxOptions)||void 0===this.textboxOptions.enabled||t){var l="disabled"!==this.element.getAttribute(r)&&""!==this.element.getAttribute(r)&&"true"!==this.element.getAttribute(r);this.setProperties({enabled:l},!t)}break;case"readonly":if(i.i(s.isNullOrUndefined)(this.textboxOptions)||void 0===this.textboxOptions.readonly||t){var o="readonly"===this.element.getAttribute(r)||""===this.element.getAttribute(r)||"true"===this.element.getAttribute(r);this.setProperties({readonly:o},!t)}break;case"placeholder":(i.i(s.isNullOrUndefined)(this.textboxOptions)||void 0===this.textboxOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"autocomplete":if(i.i(s.isNullOrUndefined)(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||t){var h="off"===this.element.autocomplete?"off":"on";this.setProperties({autocomplete:h},!t)}break;case"value":(i.i(s.isNullOrUndefined)(this.textboxOptions)||void 0===this.textboxOptions.value||t)&&""!==this.element.value&&this.setProperties({value:this.element.value},!t);break;case"type":(i.i(s.isNullOrUndefined)(this.textboxOptions)||void 0===this.textboxOptions.type||t)&&this.setProperties({type:this.element.type},!t)}}},e.prototype.render=function(){var t=this.cssClass;i.i(s.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(t=this.getInputValidClassList(this.cssClass)),this.respectiveElement=this.isHiddenInput?this.textarea:this.element,this.textboxWrapper=n.a.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.updateHTMLAttrToWrapper(),this.isHiddenInput&&this.respectiveElement.parentNode.insertBefore(this.element,this.respectiveElement),this.wireEvents(),i.i(s.isNullOrUndefined)(this.value)||(n.a.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value)),i.i(s.isNullOrUndefined)(this.value)||(this.initialValue=this.value,this.setInitialValue()),"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:i.i(s.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,n.a.setWidth(this.width,this.textboxWrapper.container),!i.i(s.isNullOrUndefined)(i.i(s.closest)(this.element,"fieldset"))&&i.i(s.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete()},e.prototype.updateHTMLAttrToWrapper=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var n=e[t];if(l.indexOf(n)>-1)if("class"===n){var a=this.getInputValidClassList(this.htmlAttributes[""+n]);""!==a&&i.i(s.addClass)([this.textboxWrapper.container],a.split(" "))}else if("style"===n){var r=this.textboxWrapper.container.getAttribute(n);r=i.i(s.isNullOrUndefined)(r)?this.htmlAttributes[""+n]:r+this.htmlAttributes[""+n],this.textboxWrapper.container.setAttribute(n,r)}else this.textboxWrapper.container.setAttribute(n,this.htmlAttributes[""+n])}},e.prototype.updateHTMLAttrToElement=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var n=e[t];l.indexOf(n)<0&&(this.multiline&&!i.i(s.isNullOrUndefined)(this.textarea)?this.textarea.setAttribute(n,this.htmlAttributes[""+n]):this.element.setAttribute(n,this.htmlAttributes[""+n]))}},e.prototype.updateCssClass=function(t,e){n.a.setCssClass(this.getInputValidClassList(t),[this.textboxWrapper.container],this.getInputValidClassList(e))},e.prototype.getInputValidClassList=function(t){var e=t;return i.i(s.isNullOrUndefined)(t)||""===t||(e=t.replace(/\s+/g," ").trim()),e},e.prototype.setInitialValue=function(){this.isAngular||this.respectiveElement.setAttribute("value",this.initialValue)},e.prototype.wireEvents=function(){s.EventHandler.add(this.respectiveElement,"focus",this.focusHandler,this),s.EventHandler.add(this.respectiveElement,"blur",this.focusOutHandler,this),s.EventHandler.add(this.respectiveElement,"input",this.inputHandler,this),s.EventHandler.add(this.respectiveElement,"change",this.changeHandler,this),this.isForm&&s.EventHandler.add(this.formElement,"reset",this.resetForm,this),this.bindClearEvent(),!i.i(s.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")&&s.EventHandler.add(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler,this)},e.prototype.animationHandler=function(){this.textboxWrapper.container.classList.add("e-valid-input");var t=this.textboxWrapper.container.querySelector(".e-float-text");i.i(s.isNullOrUndefined)(t)||(t.classList.add("e-label-top"),t.classList.contains("e-label-bottom")&&t.classList.remove("e-label-bottom"))},e.prototype.resetValue=function(t){var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.value=t,this.isProtectedOnChange=e},e.prototype.resetForm=function(){if(this.isAngular?this.resetValue(""):this.resetValue(this.initialValue),!i.i(s.isNullOrUndefined)(this.textboxWrapper)){var t=this.textboxWrapper.container.querySelector(".e-float-text");i.i(s.isNullOrUndefined)(t)||"Always"===this.floatLabelType||(i.i(s.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")))}},e.prototype.focusHandler=function(t){var e={container:this.textboxWrapper.container,event:t,value:this.value};this.trigger("focus",e)},e.prototype.focusOutHandler=function(t){null===this.previousValue&&null===this.value&&""===this.respectiveElement.value||this.previousValue===this.value||this.raiseChangeEvent(t,!0);var e={container:this.textboxWrapper.container,event:t,value:this.value};this.trigger("blur",e)},e.prototype.inputHandler=function(t){var e=this,i={event:t,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};this.inputPreviousValue=this.respectiveElement.value,this.isAngular&&(e.localChange({value:this.respectiveElement.value}),this.preventChange=!0),this.isVue&&(this.preventChange=!0),this.trigger("input",i),t.stopPropagation()},e.prototype.changeHandler=function(t){this.setProperties({value:this.respectiveElement.value},!0),this.previousValue!=this.value&&this.raiseChangeEvent(t,!0),t.stopPropagation()},e.prototype.raiseChangeEvent=function(t,e){var i={event:t,value:this.value,previousValue:this.previousValue,container:this.textboxWrapper.container,isInteraction:e||!1,isInteracted:e||!1};this.preventChange=!1,this.trigger("change",i),this.previousValue=this.value,"INPUT"===this.element.tagName&&this.multiline&&"mozilla"===s.Browser.info.name&&(this.element.value=this.respectiveElement.value)},e.prototype.bindClearEvent=function(){this.showClearButton&&"TEXTAREA"!==this.respectiveElement.tagName&&(this.enabled?s.EventHandler.add(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler,this):s.EventHandler.remove(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler))},e.prototype.resetInputHandler=function(t){if(t.preventDefault(),!this.textboxWrapper.clearButton.classList.contains("e-clear-icon-hide")||this.textboxWrapper.container.classList.contains("e-static-clear")){n.a.setValue("",this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.setProperties({value:this.respectiveElement.value},!0);var e={event:t,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};if(this.trigger("input",e),this.inputPreviousValue=this.respectiveElement.value,this.raiseChangeEvent(t,!0),i.i(s.closest)(this.element,"form")){var a=this.element,r=document.createEvent("KeyboardEvent");r.initEvent("keyup",!1,!0),a.dispatchEvent(r)}}},e.prototype.unWireEvents=function(){s.EventHandler.remove(this.respectiveElement,"focus",this.focusHandler),s.EventHandler.remove(this.respectiveElement,"blur",this.focusOutHandler),s.EventHandler.remove(this.respectiveElement,"input",this.inputHandler),s.EventHandler.remove(this.respectiveElement,"change",this.changeHandler),this.isForm&&s.EventHandler.remove(this.formElement,"reset",this.resetForm),!i.i(s.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")&&s.EventHandler.remove(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler)},e.prototype.destroy=function(){this.unWireEvents(),"INPUT"===this.element.tagName&&this.multiline&&(i.i(s.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"]),i.i(s.isNullOrUndefined)(this.textboxWrapper)||(this.textboxWrapper.container.insertAdjacentElement("afterend",this.respectiveElement),i.i(s.detach)(this.textboxWrapper.container)),this.textboxWrapper=null,n.a.destroy(),t.prototype.destroy.call(this)},e.prototype.addIcon=function(t,e){n.a.addIcon(t,e,this.textboxWrapper.container,this.respectiveElement,this.createElement)},e.prototype.getPersistData=function(){var t=["value"];return this.addOnPersist(t)},e.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),n.a.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===s?(this.setProperties({readonly:!0},!0),n.a.setReadonly(this.readonly,this.respectiveElement)):"class"===s?this.respectiveElement.classList.add(t[""+s]):"placeholder"===s?(this.setProperties({placeholder:t[""+s]},!0),n.a.setPlaceholder(this.placeholder,this.respectiveElement)):("rows"===s&&this.respectiveElement.tagName,this.respectiveElement.setAttribute(s,t[""+s]))}},e.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),n.a.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===s?(this.setProperties({readonly:!1},!0),n.a.setReadonly(this.readonly,this.respectiveElement)):"placeholder"===s?(this.setProperties({placeholder:null},!0),n.a.setPlaceholder(this.placeholder,this.respectiveElement)):this.respectiveElement.removeAttribute(s)}},e.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"))&&i.i(s.addClass)([this.textboxWrapper.container],["e-input-focus"]))},e.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"))&&i.i(s.removeClass)([this.textboxWrapper.container],["e-input-focus"]))},r([i.i(s.Property)("text")],e.prototype,"type",void 0),r([i.i(s.Property)(!1)],e.prototype,"readonly",void 0),r([i.i(s.Property)(null)],e.prototype,"value",void 0),r([i.i(s.Property)("Never")],e.prototype,"floatLabelType",void 0),r([i.i(s.Property)("")],e.prototype,"cssClass",void 0),r([i.i(s.Property)(null)],e.prototype,"placeholder",void 0),r([i.i(s.Property)("on")],e.prototype,"autocomplete",void 0),r([i.i(s.Property)({})],e.prototype,"htmlAttributes",void 0),r([i.i(s.Property)(!1)],e.prototype,"multiline",void 0),r([i.i(s.Property)(!0)],e.prototype,"enabled",void 0),r([i.i(s.Property)(!1)],e.prototype,"showClearButton",void 0),r([i.i(s.Property)(!1)],e.prototype,"enablePersistence",void 0),r([i.i(s.Property)(null)],e.prototype,"width",void 0),r([i.i(s.Event)()],e.prototype,"created",void 0),r([i.i(s.Event)()],e.prototype,"destroyed",void 0),r([i.i(s.Event)()],e.prototype,"change",void 0),r([i.i(s.Event)()],e.prototype,"blur",void 0),r([i.i(s.Event)()],e.prototype,"focus",void 0),r([i.i(s.Event)()],e.prototype,"input",void 0),e=r([s.NotifyPropertyChanges],e)}(s.Component)},function(t,e,i){"use strict";i.d(e,"a",function(){return b}),i.d(e,"b",function(){return C}),i.d(e,"c",function(){return E}),i.d(e,"d",function(){return S});var s=i(0),n=(i.n(s),i(2)),a=(i.n(n),this&&this.__extends||function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}()),r=this&&this.__decorate||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;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},l="e-upload-file-list",o="e-file-status",h="e-file-remove-btn",d="e-file-delete-btn",u="e-file-abort-btn",c="e-file-reload-btn",p="e-upload-progress-wrap",m="e-upload-progress-bar",f="e-upload-success",v="e-upload-fails",g="e-file-pause-btn",y=["title","style","class"],b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),r([i.i(s.Property)("")],e.prototype,"name",void 0),r([i.i(s.Property)(null)],e.prototype,"size",void 0),r([i.i(s.Property)("")],e.prototype,"type",void 0),e}(s.ChildProperty),C=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),r([i.i(s.Property)("Browse...")],e.prototype,"browse",void 0),r([i.i(s.Property)("Upload")],e.prototype,"upload",void 0),r([i.i(s.Property)("Clear")],e.prototype,"clear",void 0),e}(s.ChildProperty),E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),r([i.i(s.Property)("")],e.prototype,"saveUrl",void 0),r([i.i(s.Property)("")],e.prototype,"removeUrl",void 0),r([i.i(s.Property)(0)],e.prototype,"chunkSize",void 0),r([i.i(s.Property)(3)],e.prototype,"retryCount",void 0),r([i.i(s.Property)(500)],e.prototype,"retryAfterDelay",void 0),e}(s.ChildProperty),S=function(t){function e(e,i){var s=t.call(this,e,i)||this;return s.initialAttr={accept:null,multiple:!1,disabled:!1},s.uploadedFilesData=[],s.base64String=[],s.isForm=!1,s.allTypes=!1,s.pausedData=[],s.uploadMetaData=[],s.tabIndex="0",s.btnTabIndex="0",s.disableKeyboardNavigation=!1,s.count=-1,s.actionCompleteCount=0,s.flag=!0,s.selectedFiles=[],s.uploaderName="UploadFiles",s.fileStreams=[],s.newFileRef=0,s.isFirstFileOnSelection=!1,s.dragCounter=0,s.isAngular=!1,s.fileList=[],s.filesData=[],s.uploaderOptions=e,s}return a(e,t),e.prototype.onPropertyChanged=function(t,e){for(var n=0,a=Object.keys(t);n<a.length;n++){switch(a[n]){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=i.i(s.isNullOrUndefined)(this.buttons.browse)?"":this.buttons.browse,this.buttons.clear=i.i(s.isNullOrUndefined)(this.buttons.clear)?"":this.buttons.clear,this.buttons.upload=i.i(s.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":i.i(s.getValue)("ej2_instances",this.element)[0].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=i.i(s.getValue)("currentLocale",this.l10n);break;case"cssClass":this.setCSSClass(e.cssClass)}}},e.prototype.setLocalizedTexts=function(){i.i(s.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&&!i.i(s.isNullOrUndefined)(this.uploadWrapper.querySelector(".e-file-drop"))&&(this.uploadWrapper.querySelector(".e-file-drop").innerHTML=this.localizedTexts("dropFilesHint"))),this.updateFileList())},e.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},e.prototype.updateFileList=function(){var t;if(this.fileList.length>0&&!i.i(s.isNullOrUndefined)(this.uploadWrapper.querySelector(".e-upload-files")))for(var e=0;e<this.fileList.length;e++)t=this.fileList[e].querySelector(".e-file-status"),t.innerHTML=this.localizedTexts(this.getKeyValue(this.filesData[e].status)),this.filesData[e].status=this.localizedTexts(this.getKeyValue(this.filesData[e].status)),this.fileList[e].classList.contains(f)&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("delete")),this.fileList[e].querySelector(".e-file-play-btn")&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("resume")),this.fileList[e].querySelector(".e-file-remove-btn")&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("remove")),this.fileList[e].querySelector(".e-file-reload-btn")&&this.fileList[e].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")))},e.prototype.reRenderFileList=function(){this.listParent&&(i.i(s.detach)(this.listParent),this.listParent=null,this.fileList=[],this.createFileList(this.filesData),this.actionButtons&&(this.removeActionButtons(),this.renderActionButtons(),this.checkActionButtonStatus()))},e.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 s.L10n("uploader",this.localeText,this.locale),this.preLocaleObj=i.i(s.getValue)("currentLocale",this.l10n),this.formRendered(),this.updateHTMLAttrToElement(),this.checkHTMLAttributes(!1);var t=i.i(s.getValue)("ej2_instances",this.element);if("EJS-UPLOADER"===this.element.tagName){var e=this.createElement("input",{attrs:{type:"file"}}),n=0;for(n;n<this.element.attributes.length;n++)"id"!==this.element.attributes[n].nodeName?e.setAttribute(this.element.attributes[n].nodeName,this.element.attributes[n].nodeValue):"id"===this.element.attributes[n].nodeName&&e.setAttribute(this.element.attributes[n].nodeName,i.i(s.getUniqueID)("uploader")),e.innerHTML=this.element.innerHTML;e.hasAttribute("name")||e.setAttribute("name","UploadFiles"),this.element.appendChild(e),this.element=e,i.i(s.setValue)("ej2_instances",t,this.element)}t[0].isPureReactComponent&&(i.i(s.isNullOrUndefined)(t[0].props.name)?!i.i(s.isNullOrUndefined)(t[0].props.id)&&i.i(s.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)),i.i(s.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=s.Browser.info.name,this.uploaderName=this.element.getAttribute("name")},e.prototype.formRendered=function(){var t=i.i(s.closest)(this.element,"form");if(!i.i(s.isNullOrUndefined)(t))for(;t&&t!==document.documentElement;t=t.parentElement)"FORM"===t.tagName&&(this.isForm=!0,this.formElement=t,t.setAttribute("enctype","multipart/form-data"),t.setAttribute("encoding","multipart/form-data"))},e.prototype.getPersistData=function(){return this.addOnPersist(["filesData"])},e.prototype.getModuleName=function(){return"uploader"},e.prototype.updateDirectoryAttributes=function(){this.directoryUpload?(this.element.setAttribute("directory","true"),this.element.setAttribute("webkitdirectory","true")):(this.element.removeAttribute("directory"),this.element.removeAttribute("webkitdirectory"))},e.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()},e.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")},e.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}}),this.clearButton=this.createElement("button",{className:"e-file-clear-btn e-css e-btn e-flat",attrs:{type:"button",tabindex:this.btnTabIndex}}),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()},e.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())},e.prototype.wireActionButtonEvents=function(){s.EventHandler.add(this.uploadButton,"click",this.uploadButtonClick,this),s.EventHandler.add(this.clearButton,"click",this.clearButtonClick,this)},e.prototype.unwireActionButtonEvents=function(){s.EventHandler.remove(this.uploadButton,"click",this.uploadButtonClick),s.EventHandler.remove(this.clearButton,"click",this.clearButtonClick)},e.prototype.removeActionButtons=function(){this.actionButtons&&(this.unwireActionButtonEvents(),i.i(s.detach)(this.actionButtons),this.actionButtons=null)},e.prototype.renderButtonTemplates=function(){if("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){var t=i.i(s.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))}if(this.clearButton){var e=i.i(s.isNullOrUndefined)(this.buttons.clear)?"Clear":this.buttons.clear;this.buttons.clear=e,"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))}},e.prototype.initializeUpload=function(){this.element.setAttribute("tabindex","-1");var t=this.createElement("span",{className:"e-file-select"});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()},e.prototype.renderPreLoadFiles=function(){if(this.files.length){if(this.enablePersistence&&this.filesData.length)return void this.createFileList(this.filesData);if(i.i(s.isNullOrUndefined)(this.files[0].size))return;this.isPreloadFiles=!0;var t=[].slice.call(this.files),e=[];this.multiple||(this.clearData(),t=[t[0]]);for(var n=0,a=t;n<a.length;n++){var r=a[n],l={name:r.name+"."+r.type.split(".")[r.type.split(".").length-1],rawFile:"",size:r.size,status:this.localizedTexts("uploadSuccessMessage"),type:r.type,validationMessages:{minSize:"",maxSize:""},statusCode:"2"};e.push(l),this.filesData.push(l)}this.createFileList(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}},e.prototype.checkActionButtonStatus=function(){if(this.actionButtons){var t=this.uploadWrapper.querySelectorAll(".e-validation-fails").length+this.uploadWrapper.querySelectorAll(".e-upload-fails:not(.e-upload-progress)").length+this.uploadWrapper.querySelectorAll("span."+f).length+this.uploadWrapper.querySelectorAll("span.e-upload-progress").length;t>0&&t===this.uploadWrapper.querySelectorAll("li").length?this.uploadButton.setAttribute("disabled","disabled"):this.uploadButton.removeAttribute("disabled")}},e.prototype.setDropArea=function(){var t=this.dropAreaWrapper.querySelector(".e-file-drop");if(this.dropArea){this.dropZoneElement="string"!=typeof this.dropArea?this.dropArea:i.i(s.select)(this.dropArea,document);for(var e=this.element,n=!1;e.parentNode;)(e=e.parentNode)===this.dropZoneElement&&(n=!0,t?t.innerHTML=this.localizedTexts("dropFilesHint"):this.createDropTextHint());!n&&t&&i.i(s.remove)(t)}else i.i(s.isNullOrUndefined)(this.uploaderOptions)||void 0!==this.uploaderOptions.dropArea||(this.createDropTextHint(),this.dropZoneElement=this.uploadWrapper,this.setProperties({dropArea:this.uploadWrapper},!0));this.bindDropEvents()},e.prototype.updateDropArea=function(){if(this.dropArea)this.setDropArea();else{this.dropZoneElement=null;var t=this.dropAreaWrapper.querySelector(".e-file-drop");t&&i.i(s.remove)(t)}},e.prototype.createDropTextHint=function(){var t=this.createElement("span",{className:"e-file-drop"});t.innerHTML=this.localizedTexts("dropFilesHint"),this.dropAreaWrapper.appendChild(t)},e.prototype.updateHTMLAttrToElement=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var n=e[t];y.indexOf(n)<0&&this.element.setAttribute(n,this.htmlAttributes[""+n])}},e.prototype.updateHTMLAttrToWrapper=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var n=e[t];if(y.indexOf(n)>-1)if("class"===n){var a=this.htmlAttributes[""+n].replace(/\s+/g," ").trim();""!==a&&i.i(s.addClass)([this.uploadWrapper],a.split(" "))}else if("style"===n){var r=this.uploadWrapper.getAttribute(n);r=i.i(s.isNullOrUndefined)(r)?this.htmlAttributes[""+n]:r+this.htmlAttributes[""+n],this.uploadWrapper.setAttribute(n,r)}else this.uploadWrapper.setAttribute(n,this.htmlAttributes[""+n])}},e.prototype.setMultipleSelection=function(){if(this.multiple&&!this.element.hasAttribute("multiple")){var t=document.createAttribute("multiple");t.value="multiple",this.element.setAttributeNode(t)}else this.multiple||this.element.removeAttribute("multiple")},e.prototype.checkAutoUpload=function(t){this.autoUpload?(this.sequentialUpload?this.sequenceUpload(t):this.upload(t),this.removeActionButtons()):this.actionButtons||this.renderActionButtons(),this.checkActionButtonStatus()},e.prototype.sequenceUpload=function(t){if(this.filesData.length-t.length==0||"1"!==this.filesData[this.filesData.length-t.length-1].statusCode){(this.multiple||this.count<0)&&++this.count;var 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}},e.prototype.setCSSClass=function(t){var e=t;i.i(s.isNullOrUndefined)(t)||(e=t.replace(/\s+/g," ").trim()),i.i(s.isNullOrUndefined)(t)||""===e||i.i(s.removeClass)([this.uploadWrapper],e.split(" "));var n=this.cssClass;i.i(s.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(n=this.cssClass.replace(/\s+/g," ").trim()),i.i(s.isNullOrUndefined)(this.cssClass)||""===n||i.i(s.addClass)([this.uploadWrapper],n.split(n.indexOf(",")>-1?",":" "))},e.prototype.wireEvents=function(){s.EventHandler.add(this.browseButton,"click",this.browseButtonClick,this),s.EventHandler.add(this.element,"change",this.onSelectFiles,this),s.EventHandler.add(document,"click",this.removeFocus,this),this.keyboardModule=new s.KeyboardEvents(this.uploadWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.isForm&&s.EventHandler.add(this.formElement,"reset",this.resetForm,this)},e.prototype.unWireEvents=function(){s.EventHandler.remove(this.browseButton,"click",this.browseButtonClick),s.EventHandler.remove(this.element,"change",this.onSelectFiles),s.EventHandler.remove(document,"click",this.removeFocus),this.isForm&&s.EventHandler.remove(this.formElement,"reset",this.resetForm),this.keyboardModule&&this.keyboardModule.destroy()},e.prototype.resetForm=function(){this.clearAll()},e.prototype.keyActionHandler=function(t){var e=t.target;switch(t.action){case"enter":if(t.target===this.clearButton)this.clearButtonClick();else if(t.target===this.uploadButton)this.uploadButtonClick();else if(t.target===this.browseButton)this.browseButtonClick();else if(e.classList.contains(g)){var n=this.getCurrentMetaData(null,t);n.file.statusCode="4",n.file.status=this.localizedTexts("pauseUpload"),this.abortUpload(n,!1)}else if(e.classList.contains("e-file-play-btn"))this.resumeUpload(this.getCurrentMetaData(null,t),t);else if(e.classList.contains(c)){var n=this.getCurrentMetaData(null,t);if(i.i(s.isNullOrUndefined)(n)){var a=t.target.parentElement,r=this.filesData[this.fileList.indexOf(a)];this.retry(r)}else n.file.statusCode="1",n.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(n.file)}else this.removeFiles(t),e.classList.contains(u)||this.browseButton.focus();t.preventDefault(),t.stopPropagation()}},e.prototype.getCurrentMetaData=function(t,e){var n,a;if(i.i(s.isNullOrUndefined)(t)){var r=e.target.parentElement;n=this.filesData[this.fileList.indexOf(r)]}else n=t;for(var l=0;l<this.uploadMetaData.length;l++)this.uploadMetaData[l].file.name===n.name&&(a=this.uploadMetaData[l]);return a},e.prototype.removeFocus=function(){this.uploadWrapper&&this.listParent&&this.listParent.querySelector(".e-clear-icon-focus")&&(document.activeElement.blur(),this.listParent.querySelector(".e-clear-icon-focus").classList.remove("e-clear-icon-focus"))},e.prototype.browseButtonClick=function(){this.element.click()},e.prototype.uploadButtonClick=function(){this.sequentialUpload?this.sequenceUpload(this.filesData):this.upload(this.filesData)},e.prototype.clearButtonClick=function(){this.clearAll(),this.sequentialUpload&&(this.count=-1),this.actionCompleteCount=0},e.prototype.bindDropEvents=function(){this.dropZoneElement&&(s.EventHandler.add(this.dropZoneElement,"drop",this.dropElement,this),s.EventHandler.add(this.dropZoneElement,"dragover",this.dragHover,this),s.EventHandler.add(this.dropZoneElement,"dragleave",this.onDragLeave,this),s.EventHandler.add(this.dropZoneElement,"paste",this.onPasteFile,this),s.EventHandler.add(this.dropZoneElement,"dragenter",this.onDragEnter,this))},e.prototype.unBindDropEvents=function(){this.dropZoneElement&&(s.EventHandler.remove(this.dropZoneElement,"drop",this.dropElement),s.EventHandler.remove(this.dropZoneElement,"dragover",this.dragHover),s.EventHandler.remove(this.dropZoneElement,"dragleave",this.onDragLeave),s.EventHandler.remove(this.dropZoneElement,"dragenter",this.onDragEnter))},e.prototype.onDragEnter=function(t){this.enabled&&(this.dropZoneElement.classList.add("e-upload-drag-hover"),this.dragCounter=this.dragCounter+1,t.preventDefault(),t.stopPropagation())},e.prototype.onDragLeave=function(){this.enabled&&(this.dragCounter=this.dragCounter-1,this.dragCounter||this.dropZoneElement.classList.remove("e-upload-drag-hover"))},e.prototype.dragHover=function(t){this.enabled&&("Default"!==this.dropEffect&&(t.dataTransfer.dropEffect=this.dropEffect.toLowerCase()),t.preventDefault(),t.stopPropagation())},e.prototype.dropElement=function(t){this.dragCounter=0,this.dropZoneElement.classList.remove("e-upload-drag-hover"),this.onSelectFiles(t),t.preventDefault(),t.stopPropagation()},e.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){var i=[].slice.call(e)[0];"file"===i.kind&&i.type.match("^image/")&&this.renderSelectedFiles(t,[i.getAsFile()],!1,!0)}},e.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},e.prototype.removeFiles=function(t){if(this.enabled){var e=t.target.parentElement,a=this.fileList.indexOf(e),r=this.fileList[a],l=this.isFormUpload(),o=l?this.getSelectedFiles(a):this.getFilesInArray(this.filesData[a]);if(!i.i(s.isNullOrUndefined)(o)){if(t.target.classList.contains(u)&&!l){if(o[0].statusCode="5",!i.i(s.isNullOrUndefined)(r)){var h=r.querySelector("."+u);i.i(n.createSpinner)({target:h,width:"20px"}),i.i(n.showSpinner)(h)}this.sequentialUpload&&this.uploadSequential(),r.classList.contains("e-restrict-retry")||this.checkActionComplete(!0)}else i.i(s.closest)(t.target,".e-spinner-pane")||this.remove(o,!1,!1,!0,t);this.checkActionButtonStatus()}}},e.prototype.removeFilesData=function(t,e){var n;if(e)return void(this.showFileList||(n=this.filesData.indexOf(t),this.filesData.splice(n,1)));var a=this.getLiElement(t);i.i(s.isNullOrUndefined)(a)||(this.element.value="",i.i(s.detach)(a),n=this.fileList.indexOf(a),this.fileList.splice(n,1),this.filesData.splice(n,1),0!==this.fileList.length||i.i(s.isNullOrUndefined)(this.listParent)||(i.i(s.detach)(this.listParent),this.listParent=null,this.removeActionButtons()),this.sequentialUpload&&n<=this.count&&--this.count)},e.prototype.removeUploadedFile=function(t,e,i,n){var a=this,r=t,l=new s.Ajax(this.asyncSettings.removeUrl,"POST",!0,null);l.emitError=!1;var o=new FormData;l.beforeSend=function(s){e.currentRequest=l.httpRequest,i?a.removingEventCallback(e,o,r,t):a.trigger("removing",e,function(e){e.cancel?s.cancel=!0:a.removingEventCallback(e,o,r,t)})},l.onLoad=function(t){return a.removeCompleted(t,r,n),{}},l.onError=function(t){return a.removeFailed(t,r,n),{}},l.send(o)},e.prototype.removingEventCallback=function(t,e,a,r){var l=this.element.getAttribute("name"),o=this.getLiElement(r);if(!(i.i(s.isNullOrUndefined)(o)||i.i(s.isNullOrUndefined)(o.querySelector("."+d))&&i.i(s.isNullOrUndefined)(o.querySelector("."+h)))){var u=o.querySelector("."+d)?o.querySelector("."+d):o.querySelector("."+h);i.i(n.createSpinner)({target:u,width:"20px"}),i.i(n.showSpinner)(u)}t.postRawFile&&!i.i(s.isNullOrUndefined)(a.rawFile)&&""!==a.rawFile?e.append(l,a.rawFile,a.name):e.append(l,a.name),this.updateFormData(e,t.customFormData)},e.prototype.updateFormData=function(t,e){if(e.length>0&&e[0])for(var i=0;i<e.length;i++)!function(i){var s=e[i],n=Object.keys(s).map(function(t){return s[""+t]});t.append(Object.keys(s)[0],n)}(i)},e.prototype.updateCustomheader=function(t,e){if(e.length>0&&e[0])for(var i=0;i<e.length;i++)!function(i){var s=e[i],n=Object.keys(s).map(function(t){return s[""+t]});t.setRequestHeader(Object.keys(s)[0],n)}(i)},e.prototype.removeCompleted=function(t,e,i){var s=t&&t.currentTarget?this.getResponse(t):null,n=t.target;if(4===n.readyState&&n.status>=200&&n.status<=299){var a={e:t,response:s,operation:"remove",file:this.updateStatus(e,this.localizedTexts("removedSuccessMessage"),"2")};this.trigger("success",a),this.removeFilesData(e,i);var r=this.uploadedFilesData.indexOf(e);this.uploadedFilesData.splice(r,1),this.trigger("change",{files:this.uploadedFilesData})}else this.removeFailed(t,e,i)},e.prototype.removeFailed=function(t,e,a){var r=t&&t.currentTarget?this.getResponse(t):null,l={e:t,response:r,operation:"remove",file:this.updateStatus(e,this.localizedTexts("removedFailedMessage"),"0")};if(!a){var h=this.filesData.indexOf(e),u=this.fileList[h];if(u){u.classList.remove(f),u.classList.add(v);var c=u.querySelector("."+o);c&&(c.classList.remove(f),c.classList.add(v))}this.checkActionButtonStatus()}this.trigger("failure",l);var p=this.getLiElement(e);if(!i.i(s.isNullOrUndefined)(p)&&!i.i(s.isNullOrUndefined)(p.querySelector("."+d))){var m=p.querySelector("."+d);i.i(n.hideSpinner)(m),i.i(s.detach)(p.querySelector(".e-spinner-pane"))}},e.prototype.getFilesFromFolder=function(t){this.filesEntries=[];var e=this.multiple?t.dataTransfer.items:[t.dataTransfer.items[0]];if(this.checkDirectoryUpload(e))for(var i=this,s=0;s<e.length;s++)!function(s){var n=e[s].webkitGetAsEntry();if(n.isFile){var a=[];n.file(function(t){var e=n.fullPath;a.push({path:e,file:t})}),i.renderSelectedFiles(t,a,!0)}else n.isDirectory&&i.traverseFileTree(n,t)}(s)},e.prototype.checkDirectoryUpload=function(t){for(var e=0;t&&e<t.length;e++){if(t[e].webkitGetAsEntry().isDirectory)return!0}return!1},e.prototype.traverseFileTree=function(t,e){if(t.isFile)this.filesEntries.push(t);else if(t.isDirectory){var i=t.createReader();this.readFileFromDirectory(i,e)}},e.prototype.readFileFromDirectory=function(t,e){var i=this;t.readEntries(function(s){for(var n=0;n<s.length;n++)i.traverseFileTree(s[n],e);i.pushFilesEntries(e),s.length&&i.readFileFromDirectory(t)})},e.prototype.pushFilesEntries=function(t){for(var e=this,i=[],s=this,n=0;n<this.filesEntries.length;n++)!function(n){s.filesEntries[n].file(function(s){if(e.filesEntries.length){var a=e.filesEntries[n].fullPath;i.push({path:a,file:s}),n===e.filesEntries.length-1&&(e.filesEntries=[],e.renderSelectedFiles(t,i,!0))}})}(n)},e.prototype.onSelectFiles=function(t){if(this.enabled){var e;if("drop"===t.type)if(this.directoryUpload)this.getFilesFromFolder(t);else{var i=this.sortFilesList=t.dataTransfer.files;"msie"!==this.browserName&&"edge"!==this.browserName&&"safari"!==this.browserName&&(this.element.files=i),i.length>0&&(e=this.multiple?this.sortFileList(i):[i[0]],this.renderSelectedFiles(t,e))}else e=[].slice.call(t.target.files),this.renderSelectedFiles(t,e);this.isAngular&&t.stopPropagation()}},e.prototype.getBase64=function(t){return new Promise(function(e,i){var s=new FileReader;s.readAsDataURL(t),s.onload=function(){return e(s.result)},s.onerror=function(t){return i(t)}})},e.prototype.renderSelectedFiles=function(t,e,i,n){var a=this;this.base64String=[];var r={event:t,cancel:!1,filesData:[],isModified:!1,modifiedFilesData:[],progressInterval:"",isCanceled:!1,currentRequest:null,customFormData:null};if(e.length<1)return r.isCanceled=!0,void this.trigger("selected",r);this.flag=!0;var l=[];this.multiple||(this.clearData(!0),e=[e[0]]);for(var o=0;o<e.length;o++){var h=i?e[o].file:e[o];this.updateInitialFileDetails(t,e,h,o,l,i,n)}if(r.filesData=l,this.allowedExtensions.indexOf("*")>-1&&(this.allTypes=!0),this.enableHtmlSanitizer)for(var o=0;o<l.length;o++){var d=s.SanitizeHtmlHelper.beforeSanitize(),u=s.SanitizeHtmlHelper.serializeValue(d,l[parseInt(o.toString())].name);if(u!==l[parseInt(o.toString())].name){var c=e[parseInt(o.toString())].name.replace(/[\u00A0-\u9999<>\&]/g,function(t){return"&#"+t.charCodeAt(0)+";"});l[parseInt(o.toString())].name=c,l[parseInt(o.toString())].status=this.localizedTexts("invalidFileName"),l[parseInt(o.toString())].statusCode="0"}}this.allTypes||(l=this.checkExtension(l)),this.trigger("selected",r,function(t){a._internalRenderSelect(t,l)})},e.prototype.updateInitialFileDetails=function(t,e,n,a,r,l,o){var h=l?e[a].path.substring(1,e[a].path.length):o?i.i(s.getUniqueID)(n.name.substring(0,n.name.lastIndexOf(".")))+"."+this.getFileType(n.name):this.directoryUpload?e[a].webkitRelativePath:n.name,d={name:h,rawFile:n,size:n.size,status:this.localizedTexts("readyToUploadMessage"),type:this.getFileType(n.name),validationMessages:this.validatedFileSize(n.size),statusCode:"1",id:i.i(s.getUniqueID)(n.name.substring(0,n.name.lastIndexOf(".")))+"."+this.getFileType(n.name)};o&&(d.fileSource="paste"),d.status=""!==d.validationMessages.minSize?this.localizedTexts("invalidMinFileSize"):""!==d.validationMessages.maxSize?this.localizedTexts("invalidMaxFileSize"):d.status,""===d.validationMessages.minSize&&""===d.validationMessages.maxSize||(d.statusCode="0"),r.push(d)},e.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&&t.modifiedFilesData.length>0){for(var n=0;n<t.modifiedFilesData.length;n++)for(var a=0;a<e.length;a++)t.modifiedFilesData[n].id===e[a].id&&(t.modifiedFilesData[n].rawFile=e[a].rawFile);var r=this.allTypes?t.modifiedFilesData:this.checkExtension(t.modifiedFilesData);this.updateSortedFileList(r),this.filesData=r,this.isForm&&!this.allowUpload()||this.checkAutoUpload(r)}else this.createFileList(e,!0),this.isForm&&!this.allowUpload()||this.checkAutoUpload(e);i.i(s.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}},e.prototype.allowUpload=function(){var t=!1;return this.isForm&&!i.i(s.isNullOrUndefined)(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl&&(t=!0),t},e.prototype.isFormUpload=function(){var t=!1;return!this.isForm||!i.i(s.isNullOrUndefined)(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl||!i.i(s.isNullOrUndefined)(this.asyncSettings.removeUrl)&&""!==this.asyncSettings.removeUrl||(t=!0),t},e.prototype.clearData=function(t){i.i(s.isNullOrUndefined)(this.listParent)||(i.i(s.detach)(this.listParent),this.listParent=null),"msie"===this.browserName||t||(this.element.value=""),this.fileList=[],this.filesData=[],this.removeActionButtons()},e.prototype.updateSortedFileList=function(t){var e,n=this.createElement("div",{id:"clonewrapper"}),a=-1;if(this.listParent){for(var r=0;r<this.listParent.querySelectorAll("li").length;r++){var l=this.listParent.querySelectorAll("li")[r];n.appendChild(l.cloneNode(!0))}e=this.listParent.querySelectorAll("li");for(var o=0,h=e;o<h.length;o++){var d=h[o];i.i(s.detach)(d)}this.removeActionButtons();var u=[].slice.call(n.childNodes);i.i(s.detach)(this.listParent),this.listParent=null,this.fileList=[],this.createParentUL();for(var c=0;c<t.length;c++){for(var p=0;p<this.filesData.length;p++)this.filesData[p].name===t[c].name&&(this.listParent.appendChild(u[p]),s.EventHandler.add(u[p].querySelector(".e-icons"),"click",this.removeFiles,this),this.fileList.push(u[p]),a=c);a!==c&&this.createFileList([t[c]])}}else this.createFileList(t)},e.prototype.isBlank=function(t){return!t||/^\s*$/.test(t)},e.prototype.checkExtension=function(t){var e=t;if(!this.isBlank(this.allowedExtensions)){for(var i=[],s=this.allowedExtensions.split(","),n=0,a=s;n<a.length;n++){var r=a[n];i.push(r.trim().toLocaleLowerCase())}for(var l=0;l<t.length;l++)-1===i.indexOf(("."+t[l].type).toLocaleLowerCase())&&(t[l].status=this.localizedTexts("invalidFileType"),t[l].statusCode="0")}return e},e.prototype.validatedFileSize=function(t){var e="",i="";return t<this.minFileSize?e=this.localizedTexts("invalidMinFileSize"):t>this.maxFileSize?i=this.localizedTexts("invalidMaxFileSize"):(e="",i=""),{minSize:e,maxSize:i}},e.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},e.prototype.createCustomfileList=function(t){this.createParentUL();for(var e=0,n=t;e<n.length;e++){var a=n[e],r=this.createElement("li",{className:l,attrs:{"data-file-name":a.name}});this.uploadTemplateFn=this.templateComplier(this.template);var o=this.uploadTemplateFn(a,this,"template",this.element.id+"Template",this.isStringTemplate,null,r);if(o){var h=[].slice.call(o);i.i(s.append)(h,r)}var d=t.indexOf(a),u={element:r,fileInfo:a,index:d,isPreload:this.isPreLoadFile(a)},c={element:r,fileInfo:a,index:d,isPreload:this.isPreLoadFile(a)};this.trigger("rendering",u),this.trigger("fileListRendering",c),this.listParent.appendChild(r),this.fileList.push(r)}this.renderReactTemplates()},e.prototype.createParentUL=function(){i.i(s.isNullOrUndefined)(this.listParent)&&(this.listParent=this.createElement("ul",{className:"e-upload-files"}),this.uploadWrapper.appendChild(this.listParent))},e.prototype.formFileList=function(t,e){var n=this.createElement("li",{className:l});n.setAttribute("data-files-count",t.length+"");for(var a,r=this.createElement("span",{className:"e-file-container"}),d=0,u=t;d<u.length;d++){var c=u[d],p=this.createElement("span",{className:"e-file-name"});p.innerHTML=this.getFileNameOnly(c.name);var m=this.createElement("span",{className:"e-file-type"}),f=this.getFileType(c.name);if(m.innerHTML="."+f,f||m.classList.add("e-hidden"),this.enableRtl){var v=this.createElement("span",{className:"e-rtl-container"});v.appendChild(m),v.appendChild(p),r.appendChild(v)}else r.appendChild(p),r.appendChild(m);this.truncateName(p),a=this.formValidateFileInfo(c,n)}n.appendChild(r),this.setListToFileInfo(t,n);var g=this.listParent.querySelectorAll("li").length,y=this.createElement("span");if(n.classList.contains("e-file-invalid")?(y.classList.add(o),y.classList.add("e-file-invalid"),y.innerText=t.length>1?this.localizedTexts("invalidFileSelection"):a):(y.classList.add(t.length>1?"e-file-information":"e-file-size"),y.innerText=t.length>1?this.localizedTexts("totalFiles")+": "+t.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(t)):this.bytesToSize(t[0].size),this.createFormInput(t)),r.appendChild(y),i.i(s.isNullOrUndefined)(n.querySelector(".e-icons"))){var b=this.createElement("span",{className:"e-icons",attrs:{tabindex:this.btnTabIndex}});"msie"===this.browserName&&b.classList.add("e-msie"),b.setAttribute("title",this.localizedTexts("remove")),n.appendChild(r),n.appendChild(b),s.EventHandler.add(b,"click",this.removeFiles,this),b.classList.add(h)}var C={element:n,fileInfo:this.mergeFileInfo(t,n),index:g,isPreload:this.isPreLoadFile(this.mergeFileInfo(t,n))},E={element:n,fileInfo:this.mergeFileInfo(t,n),index:g,isPreload:this.isPreLoadFile(this.mergeFileInfo(t,n))};this.trigger("rendering",C),this.trigger("fileListRendering",E),this.listParent.appendChild(n),this.fileList.push(n)},e.prototype.formValidateFileInfo=function(t,e){var i=t.status,s=this.validatedFileSize(t.size);""===s.minSize&&""===s.maxSize||(this.addInvalidClass(e),i=""!==s.minSize?this.localizedTexts("invalidMinFileSize"):""!==s.maxSize?this.localizedTexts("invalidMaxFileSize"):i);var n=this.checkExtension(this.getFilesInArray(t))[0].status;return n===this.localizedTexts("invalidFileType")&&(this.addInvalidClass(e),i=n),i},e.prototype.addInvalidClass=function(t){t.classList.add("e-file-invalid")},e.prototype.createFormInput=function(t){if("safari"!==this.browserName){var e=this.element.cloneNode(!0);e.classList.add("e-hidden-file-input");for(var n=0,a=t;n<a.length;n++){a[n].input=e}e.setAttribute("id",i.i(s.getUniqueID)("hiddenUploader")),e.setAttribute("name",this.uploaderName),this.uploadWrapper.querySelector(".e-file-select").appendChild(e),"msie"!==this.browserName&&"edge"!==this.browserName&&(this.element.value="")}},e.prototype.getFileSize=function(t){for(var e=0,i=0,s=t;i<s.length;i++){e+=s[i].size}return e},e.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},e.prototype.statusForFormUpload=function(t,e){for(var i,s=!0,n=0,a=t;n<a.length;n++){var r=a[n];i=r.status;var l=this.validatedFileSize(r.size);""===l.minSize&&""===l.maxSize||(s=!1,i=""!==l.minSize?this.localizedTexts("invalidMinFileSize"):""!==l.maxSize?this.localizedTexts("invalidMaxFileSize"):i);var o=this.checkExtension(this.getFilesInArray(r))[0].status;o===this.localizedTexts("invalidFileType")&&(s=!1,i=o)}return s?i=this.localizedTexts("totalFiles")+": "+t.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(t)):(e.classList.add("e-file-invalid"),i=t.length>1?this.localizedTexts("invalidFileSelection"):i),i},e.prototype.formCustomFileList=function(t,e){this.createParentUL();var n=this.createElement("li",{className:l});n.setAttribute("data-files-count",t.length+""),this.setListToFileInfo(t,n);var a=this.mergeFileInfo(t,n);n.setAttribute("data-file-name",a.name),this.uploadTemplateFn=this.templateComplier(this.template);var r=this.uploadTemplateFn(a,this,"template",this.element.id+"Template",this.isStringTemplate,null,n);if(r){var o=[].slice.call(r);i.i(s.append)(o,n)}var h=this.listParent.querySelectorAll("li").length;n.classList.contains("e-file-invalid")||this.createFormInput(t);var d={element:n,fileInfo:a,index:h,isPreload:this.isPreLoadFile(a)},u={element:n,fileInfo:a,index:h,isPreload:this.isPreLoadFile(a)};this.trigger("rendering",d),this.trigger("fileListRendering",u),this.listParent.appendChild(n),this.fileList.push(n),this.renderReactTemplates()},e.prototype.createFileList=function(t,e){if(this.createParentUL(),this.filesData=e?this.filesData.concat(t):t,""===this.template||i.i(s.isNullOrUndefined)(this.template))if(this.isFormUpload())this.uploadWrapper.classList.add("e-form-upload"),this.formFileList(t,this.element.files);else for(var n=0,a=t;n<a.length;n++){var r=a[n],u=this.createElement("li",{className:l,attrs:{"data-file-name":r.name,"data-files-count":"1"}}),c=this.createElement("span",{className:"e-file-container"}),p=this.createElement("span",{className:"e-file-name",attrs:{title:r.name}});p.innerHTML=this.getFileNameOnly(r.name);var m=this.createElement("span",{className:"e-file-type"}),v=this.getFileType(r.name);if(m.innerHTML="."+v,v||m.classList.add("e-hidden"),this.enableRtl){var g=this.createElement("span",{className:"e-rtl-container"});g.appendChild(m),g.appendChild(p),c.appendChild(g)}else c.appendChild(p),c.appendChild(m);var y=this.createElement("span",{className:"e-file-size"});y.innerHTML=this.bytesToSize(r.size),c.appendChild(y);var b=this.createElement("span",{className:o});c.appendChild(b),b.innerHTML=r.status,u.appendChild(c);var C=this.createElement("span",{className:" e-icons",attrs:{tabindex:this.btnTabIndex}});"msie"===this.browserName&&C.classList.add("e-msie"),C.setAttribute("title",this.localizedTexts("remove")),u.appendChild(C),s.EventHandler.add(C,"click",this.removeFiles,this),"2"===r.statusCode?(b.classList.add(f),C.classList.add(d),C.setAttribute("title",this.localizedTexts("delete"))):"1"!==r.statusCode&&(b.classList.remove(f),b.classList.add("e-validation-fails")),this.autoUpload&&"1"===r.statusCode&&""!==this.asyncSettings.saveUrl&&(b.innerHTML=""),C.classList.contains(d)||C.classList.add(h);var E=t.indexOf(r),S={element:u,fileInfo:r,index:E,isPreload:this.isPreLoadFile(r)},x={element:u,fileInfo:r,index:E,isPreload:this.isPreLoadFile(r)};this.trigger("rendering",S),this.trigger("fileListRendering",x),this.listParent.appendChild(u),this.fileList.push(u),this.truncateName(p);var T=this.flag;this.isPreLoadFile(r)&&(this.flag=!1,this.checkActionComplete(!0),this.flag=T)}else this.isFormUpload()?(this.uploadWrapper.classList.add("e-form-upload"),this.formCustomFileList(t,this.element.files)):this.createCustomfileList(t)},e.prototype.getSlicedName=function(t){var e=t.textContent;t.dataset.tail=e.slice(e.length-10)},e.prototype.setListToFileInfo=function(t,e){for(var i=0,s=t;i<s.length;i++){s[i].list=e}},e.prototype.truncateName=function(t){var e=t;"edge"!==this.browserName&&e.offsetWidth<e.scrollWidth?this.getSlicedName(e):e.offsetWidth+1<e.scrollWidth&&this.getSlicedName(e)},e.prototype.getFileType=function(t){var e,i=t.lastIndexOf(".");return i>=0&&(e=t.substring(i+1)),e||""},e.prototype.getFileNameOnly=function(t){var e=this.getFileType(t);return e=t.split("."+e)[0]},e.prototype.setInitialAttributes=function(){if(this.initialAttr.accept&&this.element.setAttribute("accept",this.initialAttr.accept),this.initialAttr.disabled&&this.element.setAttribute("disabled","disabled"),this.initialAttr.multiple){var t=document.createAttribute("multiple");this.element.setAttributeNode(t)}},e.prototype.filterfileList=function(t){for(var e,i=[],s=0;s<t.length;s++)e=this.getLiElement(t[s]),e.classList.contains(f)||i.push(t[s]);return i},e.prototype.updateStatus=function(t,e,n,a){if(void 0===a&&(a=!0),""===e||i.i(s.isNullOrUndefined)(e)||""===n||i.i(s.isNullOrUndefined)(n)||(t.status=e,t.statusCode=n),a){var r=this.getLiElement(t);i.i(s.isNullOrUndefined)(r)||i.i(s.isNullOrUndefined)(r.querySelector("."+o))||""===e||i.i(s.isNullOrUndefined)(e)||(r.querySelector("."+o).textContent=e)}return t},e.prototype.getLiElement=function(t){for(var e,n=0;n<this.filesData.length;n++)i.i(s.isNullOrUndefined)(t)||(i.i(s.isNullOrUndefined)(this.filesData[n].id)||i.i(s.isNullOrUndefined)(t.id)?this.filesData[n].name!==t.name:this.filesData[n].name!==t.name||this.filesData[n].id!==t.id)||(e=n);return this.fileList[e]},e.prototype.createProgressBar=function(t){var e=this.createElement("span",{className:p}),i=this.createElement("progressbar",{className:m,attrs:{value:"0",max:"100"}}),s=this.createElement("span",{className:"e-progress-inner-wrap"});i.setAttribute("style","width: 0%");var n=this.createElement("span",{className:"e-progress-bar-text"});n.textContent="0%",s.appendChild(i),e.appendChild(s),e.appendChild(n),t.querySelector(".e-file-container").appendChild(e)},e.prototype.updateProgressbar=function(t,e){if(!isNaN(Math.round(t.loaded/t.total*100))&&!i.i(s.isNullOrUndefined)(e.querySelector("."+m)))if(i.i(s.isNullOrUndefined)(this.progressInterval)||""===this.progressInterval)this.changeProgressValue(e,Math.round(t.loaded/t.total*100).toString()+"%");else{var n=Math.round(t.loaded/t.total*100)%parseInt(this.progressInterval,10);0!==n&&100!==n||this.changeProgressValue(e,Math.round(t.loaded/t.total*100).toString()+"%")}},e.prototype.changeProgressValue=function(t,e){t.querySelector("."+m).setAttribute("style","width:"+e),t.querySelector(".e-progress-bar-text").textContent=e},e.prototype.uploadInProgress=function(t,e,n,a){var r=this.getLiElement(e);if(!i.i(s.isNullOrUndefined)(r)||n){if(i.i(s.isNullOrUndefined)(r))this.cancelUploadingFile(e,t,a);else{"5"===e.statusCode&&this.cancelUploadingFile(e,t,a,r),r.querySelectorAll("."+p).length>0||!r.querySelector("."+o)||(r.querySelector("."+o).classList.add("e-upload-progress"),this.createProgressBar(r),this.updateProgressBarClasses(r,"e-upload-progress"),r.querySelector("."+o).classList.remove(v)),this.updateProgressbar(t,r);var l=r.querySelector("."+h);i.i(s.isNullOrUndefined)(l)||(l.classList.add(u,"e-upload-progress"),l.setAttribute("title",this.localizedTexts("abort")),l.classList.remove(h))}var d={e:t,operation:"upload",file:this.updateStatus(e,this.localizedTexts("inProgress"),"3")};this.trigger("progress",d)}},e.prototype.cancelUploadingFile=function(t,e,a,r){var l=this;if("5"===t.statusCode){var o={event:e,fileData:t,cancel:!1,customFormData:[]};this.trigger("canceling",o,function(e){if(e.cancel){if(t.statusCode="3",!i.i(s.isNullOrUndefined)(r)){var o=r.querySelector("."+u);i.i(s.isNullOrUndefined)(o)||(i.i(n.hideSpinner)(o),i.i(s.detach)(r.querySelector(".e-spinner-pane")))}}else{a.emitError=!1,a.httpRequest.abort();var h=new FormData;if("5"===t.statusCode){var d=l.element.getAttribute("name");h.append(d,t.name),h.append("cancel-uploading",t.name),l.updateFormData(h,e.customFormData);var c=new s.Ajax(l.asyncSettings.removeUrl,"POST",!0,null);c.emitError=!1,c.onLoad=function(e){return l.removecanceledFile(e,t),{}},c.send(h)}}})}},e.prototype.removecanceledFile=function(t,e){var a=this.getLiElement(e);if(!(i.i(s.isNullOrUndefined)(a)||a.querySelector("."+c)||i.i(s.isNullOrUndefined)(a.querySelector("."+u)))){this.updateStatus(e,this.localizedTexts("fileUploadCancel"),"5"),this.renderFailureState(t,e,a);var r=a.querySelector("."+h);i.i(s.isNullOrUndefined)(a)||(i.i(n.hideSpinner)(r),i.i(s.isNullOrUndefined)(a.querySelector(".e-spinner-pane"))||i.i(s.detach)(a.querySelector(".e-spinner-pane")));var l=t&&t.currentTarget?this.getResponse(t):null,o={event:t,response:l,operation:"cancel",file:e};this.trigger("success",o)}},e.prototype.renderFailureState=function(t,e,n){var a=this;this.updateProgressBarClasses(n,v),this.removeProgressbar(n,"failure"),i.i(s.isNullOrUndefined)(n.querySelector(".e-file-status"))||n.querySelector(".e-file-status").classList.add(v);var r=n.querySelector("."+u);if(!i.i(s.isNullOrUndefined)(r)){r.classList.remove(u,"e-upload-progress"),r.classList.add(h),r.setAttribute("title",this.localizedTexts("remove")),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}}),r.parentElement.insertBefore(this.pauseButton,r),this.pauseButton.setAttribute("title",this.localizedTexts("retry"));n.querySelector("."+c).addEventListener("click",function(t){a.reloadcanceledFile(t,e,n,!1)},!1)}},e.prototype.reloadcanceledFile=function(t,e,n,a){e.statusCode="1",e.status=this.localizedTexts("readyToUploadMessage"),a||(i.i(s.isNullOrUndefined)(n.querySelector("."+o))||n.querySelector("."+o).classList.remove(v),i.i(s.isNullOrUndefined)(n.querySelector("."+c))||i.i(s.detach)(n.querySelector("."+c)),this.pauseButton=null),i.i(s.isNullOrUndefined)(n)||n.classList.add("e-restrict-retry"),this.upload([e])},e.prototype.uploadComplete=function(t,e,n){var a=t.target;if(4===a.readyState&&a.status>=200&&a.status<=299){var r=this.getLiElement(e);if(i.i(s.isNullOrUndefined)(r)&&(!n||i.i(s.isNullOrUndefined)(n)))return;if(!i.i(s.isNullOrUndefined)(r)){this.updateProgressBarClasses(r,f),this.removeProgressbar(r,"success");var l=r.querySelector("."+u);i.i(s.isNullOrUndefined)(l)||(l.classList.add(d),l.setAttribute("title",this.localizedTexts("delete")),l.classList.remove(u),l.classList.remove("e-upload-progress"))}this.raiseSuccessEvent(t,e)}else this.uploadFailed(t,e)},e.prototype.getResponse=function(t){var e=t.currentTarget;return{readyState:e.readyState,statusCode:e.status,statusText:e.statusText,headers:e.getAllResponseHeaders(),withCredentials:e.withCredentials}},e.prototype.raiseSuccessEvent=function(t,e){var a=this,r=t&&t.currentTarget?this.getResponse(t):null,l=this.localizedTexts("uploadSuccessMessage"),o={e:t,response:r,operation:"upload",file:this.updateStatus(e,l,"2",!1),statusText:l},h=this.getLiElement(e);if(!i.i(s.isNullOrUndefined)(h)){var d=h.querySelector(".e-spinner-pane");i.i(s.isNullOrUndefined)(d)||(i.i(n.hideSpinner)(h),i.i(s.detach)(d))}this.trigger("success",o,function(t){a.updateStatus(e,t.statusText,"2"),a.uploadedFilesData.push(e),a.trigger("change",{file:a.uploadedFilesData}),a.checkActionButtonStatus(),a.fileList.length>0&&(a.getLiElement(e).classList.contains("e-restrict-retry")?a.getLiElement(e).classList.remove("e-restrict-retry"):(a.uploadSequential(),a.checkActionComplete(!0)))})},e.prototype.uploadFailed=function(t,e){var n=this,a=this.getLiElement(e),r=t&&t.currentTarget?this.getResponse(t):null,l=this.localizedTexts("uploadFailedMessage"),o={e:t,response:r,operation:"upload",file:this.updateStatus(e,l,"0",!1),statusText:l};i.i(s.isNullOrUndefined)(a)||this.renderFailureState(t,e,a),this.trigger("failure",o,function(t){n.updateStatus(e,t.statusText,"0"),n.checkActionButtonStatus(),n.uploadSequential(),n.checkActionComplete(!0)})},e.prototype.uploadSequential=function(){this.sequentialUpload&&(this.autoUpload?this.checkAutoUpload(this.filesData):this.uploadButtonClick())},e.prototype.checkActionComplete=function(t){t?++this.actionCompleteCount:--this.actionCompleteCount,this.raiseActionComplete()},e.prototype.raiseActionComplete=function(){if(this.filesData.length===this.actionCompleteCount&&this.flag){this.flag=!1;var t={fileData:[]};t.fileData=this.getSelectedFileStatus(this.selectedFiles),this.trigger("actionComplete",t)}},e.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++)this.filesData[a].name===n.name&&this.filesData[a].status===n.status&&(e[i]=this.filesData[a],++i);return e},e.prototype.updateProgressBarClasses=function(t,e){var n=t.querySelector("."+m);i.i(s.isNullOrUndefined)(n)||n.classList.add(e)},e.prototype.removeProgressbar=function(t,e){var n=this;i.i(s.isNullOrUndefined)(t.querySelector("."+p))||(this.progressAnimation=new s.Animation({duration:1250}),this.progressAnimation.animate(t.querySelector("."+p),{name:"FadeOut"}),this.progressAnimation.animate(t.querySelector(".e-progress-bar-text"),{name:"FadeOut"}),setTimeout(function(){n.animateProgressBar(t,e)},750))},e.prototype.animateProgressBar=function(t,e){"success"===e?(t.classList.add(f),i.i(s.isNullOrUndefined)(t.querySelector("."+o))||(t.querySelector("."+o).classList.remove("e-upload-progress"),this.progressAnimation.animate(t.querySelector("."+o),{name:"FadeIn"}),t.querySelector("."+o).classList.add(f))):i.i(s.isNullOrUndefined)(t.querySelector("."+o))||(t.querySelector("."+o).classList.remove("e-upload-progress"),this.progressAnimation.animate(t.querySelector("."+o),{name:"FadeIn"}),t.querySelector("."+o).classList.add(v)),t.querySelector("."+p)&&i.i(s.detach)(t.querySelector("."+p))},e.prototype.setExtensions=function(t){""===t||i.i(s.isNullOrUndefined)(t)?this.element.removeAttribute("accept"):this.element.setAttribute("accept",t)},e.prototype.templateComplier=function(t){if(t)try{return i.i(s.selectAll)(t,document).length?i.i(s.compile)(i.i(s.select)(t,document).innerHTML.trim()):i.i(s.compile)(t)}catch(e){return i.i(s.compile)(t)}},e.prototype.setRTL=function(){this.enableRtl?i.i(s.addClass)([this.uploadWrapper],"e-rtl"):i.i(s.removeClass)([this.uploadWrapper],"e-rtl")},e.prototype.localizedTexts=function(t){return this.l10n.setLocale(this.locale),this.l10n.getConstant(t)},e.prototype.setControlStatus=function(){this.enabled?(this.uploadWrapper.classList.contains("e-disabled")&&this.uploadWrapper.classList.remove("e-disabled"),!i.i(s.isNullOrUndefined)(this.browseButton)&&this.element.hasAttribute("disabled")&&(this.element.removeAttribute("disabled"),this.browseButton.removeAttribute("disabled")),!i.i(s.isNullOrUndefined)(this.clearButton)&&this.clearButton.hasAttribute("disabled")&&this.clearButton.removeAttribute("disabled"),!i.i(s.isNullOrUndefined)(this.uploadButton)&&this.uploadButton.hasAttribute("disabled")&&this.uploadButton.hasAttribute("disabled")):(this.uploadWrapper.classList.add("e-disabled"),this.element.setAttribute("disabled","disabled"),this.browseButton.setAttribute("disabled","disabled"),i.i(s.isNullOrUndefined)(this.clearButton)||this.clearButton.setAttribute("disabled","disabled"),i.i(s.isNullOrUndefined)(this.uploadButton)||this.uploadButton.setAttribute("disabled","disabled"))},e.prototype.checkHTMLAttributes=function(t){for(var e=t?i.i(s.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["accept","multiple","disabled"],n=0,a=e;n<a.length;n++){var r=a[n];if(!i.i(s.isNullOrUndefined)(this.element.getAttribute(r)))switch(r){case"accept":(i.i(s.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":if(i.i(s.isNullOrUndefined)(this.uploaderOptions)||void 0===this.uploaderOptions.multiple||t){var l="multiple"===this.element.getAttribute(r)||""===this.element.getAttribute(r)||"true"===this.element.getAttribute(r);this.setProperties({multiple:l},!t),this.initialAttr.multiple=!0}break;case"disabled":if(i.i(s.isNullOrUndefined)(this.uploaderOptions)||void 0===this.uploaderOptions.enabled||t){var o="disabled"!==this.element.getAttribute(r)&&""!==this.element.getAttribute(r)&&"true"!==this.element.getAttribute(r);this.setProperties({enabled:o},!t),this.initialAttr.disabled=!0}}}},e.prototype.chunkUpload=function(t,e,i){var s=Math.min(this.asyncSettings.chunkSize,t.size),n=t.rawFile.slice(0,s),a={chunkIndex:0,blob:n,file:t,start:0,end:s,retryCount:0,request:null};this.sendRequest(t,a,e,i)},e.prototype.sendRequest=function(t,e,i,n){var a=this,r=new FormData,l=t.rawFile.slice(e.start,e.end);r.append(this.uploaderName,l,t.name),r.append("chunk-index",e.chunkIndex.toString()),r.append("chunkIndex",e.chunkIndex.toString());var o=Math.max(Math.ceil(t.size/this.asyncSettings.chunkSize),1);r.append("total-chunk",o.toString()),r.append("totalChunk",o.toString());var h=new s.Ajax({url:this.asyncSettings.saveUrl,type:"POST",async:!0,contentType:null});h.emitError=!1,h.onLoad=function(t){return a.chunkUploadComplete(t,e,i),{}},h.onUploadProgress=function(t){return a.chunkUploadInProgress(t,e,i),{}};var d={fileData:t,customFormData:[],cancel:!1,chunkSize:0===this.asyncSettings.chunkSize?null:this.asyncSettings.chunkSize};h.beforeSend=function(i){d.currentRequest=h.httpRequest,d.currentChunkIndex=e.chunkIndex,0===d.currentChunkIndex?a.trigger("uploading",d,function(e){a.uploadingEventCallback(r,e,i,t)}):a.trigger("chunkUploading",d,function(e){a.uploadingEventCallback(r,e,i,t)})},h.onError=function(t){return a.chunkUploadFailed(t,e,i),{}},h.send(r),e.request=h},e.prototype.uploadingEventCallback=function(t,e,i,s){e.cancel?this.eventCancelByArgs(i,e,s):this.updateFormData(t,e.customFormData)},e.prototype.eventCancelByArgs=function(t,e,n){var a=this;if(t.cancel=!0,"5"!==e.fileData.statusCode){e.fileData.statusCode="5",e.fileData.status=this.localizedTexts("fileUploadCancel");var r=this.getLiElement(e.fileData);if(r){i.i(s.isNullOrUndefined)(r.querySelector("."+o))||(r.querySelector("."+o).innerHTML=this.localizedTexts("fileUploadCancel"),r.querySelector("."+o).classList.add(v)),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}});var l=r.querySelector("."+h);l&&l.parentElement.insertBefore(this.pauseButton,l),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),this.pauseButton.addEventListener("click",function(t){a.reloadcanceledFile(t,n,r)},!1),this.checkActionButtonStatus()}}},e.prototype.checkChunkUpload=function(){return!(this.asyncSettings.chunkSize<=0||i.i(s.isNullOrUndefined)(this.asyncSettings.chunkSize))},e.prototype.chunkUploadComplete=function(t,e,a){var r,l=this,o=t.target;if(4===o.readyState&&o.status>=200&&o.status<300){var h=t&&t.currentTarget?this.getResponse(t):null,d=Math.max(Math.ceil(e.file.size/this.asyncSettings.chunkSize),1),c={event:t,file:e.file,chunkIndex:e.chunkIndex,totalChunk:d,chunkSize:this.asyncSettings.chunkSize,response:h};if(this.trigger("chunkSuccess",c),!i.i(s.isNullOrUndefined)(a)&&a||(r=this.getLiElement(e.file)),this.updateMetaData(e),e.end===e.file.size&&(e.file.statusCode="3"),"5"===e.file.statusCode){var p={event:t,fileData:e.file,cancel:!1,customFormData:[]};this.trigger("canceling",p,function(t){if(t.cancel){e.file.statusCode="3";var h=r.querySelector("."+u);i.i(s.isNullOrUndefined)(r)||i.i(s.isNullOrUndefined)(h)||(i.i(n.hideSpinner)(h),i.i(s.detach)(r.querySelector(".e-spinner-pane"))),l.sendNextRequest(e)}else{e.request.emitError=!1,o.abort();var d=new FormData,c=l.element.getAttribute("name");d.append(c,e.file.name),d.append("cancel-uploading",e.file.name),d.append("cancelUploading",e.file.name),l.updateFormData(d,t.customFormData);var p=new s.Ajax(l.asyncSettings.removeUrl,"POST",!0,null);p.emitError=!1,p.onLoad=function(t){return l.removeChunkFile(t,e,a),{}},p.send(d)}})}else{if(d-1===e.chunkIndex&&d>e.chunkIndex){var m=this.pausedData.indexOf(e);return m>=0&&this.pausedData.splice(m,1),i.i(s.isNullOrUndefined)(this.template)&&(i.i(s.isNullOrUndefined)(a)||!a)&&r&&(r&&!i.i(s.isNullOrUndefined)(r.querySelector("."+g))&&i.i(s.detach)(r.querySelector("."+g)),this.removeChunkProgressBar(e)),void this.raiseSuccessEvent(t,e.file)}"4"!==e.file.statusCode&&this.sendNextRequest(e)}}else this.chunkUploadFailed(t,e)},e.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)},e.prototype.removeChunkFile=function(t,e,a){if(i.i(s.isNullOrUndefined)(this.template)&&i.i(s.isNullOrUndefined)(a)&&!a){var r=this.getLiElement(e.file),l=r.querySelector("."+u),o=l;this.updateStatus(e.file,this.localizedTexts("fileUploadCancel"),"5"),this.updateProgressBarClasses(r,v),this.removeProgressbar(r,"failure"),l&&l.classList.remove(u),l&&l.classList.add(h),l&&l.setAttribute("title",this.localizedTexts("remove"));var d=r.querySelector("."+g);d&&d.classList.add(c),d&&d.classList.remove(g),d&&d.setAttribute("title",this.localizedTexts("retry")),i.i(s.isNullOrUndefined)(r)||i.i(s.isNullOrUndefined)(l)||i.i(s.isNullOrUndefined)(r.querySelector(".e-spinner-pane"))||(i.i(n.hideSpinner)(o),i.i(s.detach)(r.querySelector(".e-spinner-pane")))}},e.prototype.pauseUpload=function(t,e,i){t.file.statusCode="4",t.file.status=this.localizedTexts("pause"),this.updateMetaData(t);var s={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,s)},e.prototype.abortUpload=function(t,e,n){"4"!==t.file.statusCode&&(t.request.emitError=!1,t.request.httpRequest.abort());var a=this.getLiElement(t.file);if(i.i(s.isNullOrUndefined)(this.template)&&(i.i(s.isNullOrUndefined)(e)||!e)){var r=a.querySelector("."+g);r.classList.remove(g),r.classList.add("e-file-play-btn"),r.setAttribute("title",this.localizedTexts("resume")),r.nextElementSibling.classList.add(h),r.nextElementSibling.classList.remove(u),r.nextElementSibling.setAttribute("title",this.localizedTexts("remove"))}for(var l=0;l<this.pausedData.length;l++)this.pausedData[l].file.name===t.file.name&&this.pausedData.splice(l,1);this.pausedData.push(t),this.trigger("pausing",n)},e.prototype.resumeUpload=function(t,e,n){var a,r=this.getLiElement(t.file);i.i(s.isNullOrUndefined)(r)||(a=r.querySelector(".e-file-play-btn")),i.i(s.isNullOrUndefined)(a)||!i.i(s.isNullOrUndefined)(n)&&n||(a.classList.remove("e-file-play-btn"),a.classList.add(g),a.setAttribute("title",this.localizedTexts("pause")),a.nextElementSibling.classList.remove(h),a.nextElementSibling.classList.add(u),a.nextElementSibling.setAttribute("title",this.localizedTexts("abort"))),t.file.status=this.localizedTexts("inProgress"),t.file.statusCode="3",this.updateMetaData(t);var l={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",l);for(var o=0;o<this.pausedData.length;o++)this.pausedData[o].end===this.pausedData[o].file.size?this.chunkUploadComplete(e,t,n):this.pausedData[o].file.name===t.file.name&&(this.pausedData[o].start=this.pausedData[o].end,this.pausedData[o].end=this.pausedData[o].end+this.asyncSettings.chunkSize,this.pausedData[o].end=Math.min(this.pausedData[o].end,this.pausedData[o].file.size),this.pausedData[o].chunkIndex=this.pausedData[o].chunkIndex+1,this.sendRequest(this.pausedData[o].file,this.pausedData[o],n))},e.prototype.updateMetaData=function(t){-1===this.uploadMetaData.indexOf(t)?this.uploadMetaData.push(t):(this.uploadMetaData.splice(this.uploadMetaData.indexOf(t),1),this.uploadMetaData.push(t))},e.prototype.removeChunkProgressBar=function(t){var e=this.getLiElement(t.file);if(!i.i(s.isNullOrUndefined)(e)){this.updateProgressBarClasses(e,f),this.removeProgressbar(e,"success");var n=e.querySelector("."+u);i.i(s.isNullOrUndefined)(n)||(n.classList.add(d),n.setAttribute("title",this.localizedTexts("delete")),n.classList.remove(u,"e-upload-progress"))}},e.prototype.chunkUploadFailed=function(t,e,n){var a,r=this,l=Math.max(Math.ceil(e.file.size/this.asyncSettings.chunkSize),1);!i.i(s.isNullOrUndefined)(this.template)||!i.i(s.isNullOrUndefined)(n)&&n||(a=this.getLiElement(e.file));var o=t&&t.currentTarget?this.getResponse(t):null,p={event:t,file:e.file,chunkIndex:e.chunkIndex,totalChunk:l,chunkSize:this.asyncSettings.chunkSize,cancel:!1,response:o};this.trigger("chunkFailure",p,function(l){if(!l.cancel)if(e.retryCount<r.asyncSettings.retryCount)setTimeout(function(){r.retryRequest(a,e,n)},r.asyncSettings.retryAfterDelay);else{if(!i.i(s.isNullOrUndefined)(a)){var p=a.querySelector("."+g)?a.querySelector("."+g):a.querySelector(".e-file-play-btn");i.i(s.isNullOrUndefined)(p)||(p.classList.add(c),p.classList.remove(g,"e-file-play-btn")),r.updateProgressBarClasses(a,v),r.removeProgressbar(a,"failure"),a.querySelector(".e-icons").classList.remove("e-upload-progress");var m=a.querySelector("."+u)?a.querySelector("."+u):a.querySelector("."+h);m.classList.remove(u),i.i(s.isNullOrUndefined)(a.querySelector("."+g))||i.i(s.detach)(a.querySelector("."+g)),e.start>0?(m.classList.add(d),m.setAttribute("title",r.localizedTexts("delete"))):(m.classList.add(h),m.setAttribute("title",r.localizedTexts("remove")))}e.retryCount=0;var f=e.file,y=r.localizedTexts("uploadFailedMessage"),b={e:t,response:o,operation:"upload",file:r.updateStatus(f,y,"0",!1),statusText:y};r.trigger("failure",b,function(t){r.updateStatus(f,t.statusText,"0"),r.uploadSequential(),r.checkActionComplete(!0)})}})},e.prototype.retryRequest=function(t,e,n){i.i(s.isNullOrUndefined)(this.template)&&(i.i(s.isNullOrUndefined)(n)||!n)&&t&&this.updateProgressBarClasses(t,v),e.retryCount+=1,this.sendRequest(e.file,e)},e.prototype.checkPausePlayAction=function(t){var e=t.target,i=t.target.parentElement,s=this.fileList.indexOf(i),n=this.filesData[s],a=this.getCurrentMetaData(n);e.classList.contains(g)?this.pauseUpload(a,t):e.classList.contains("e-file-play-btn")?this.resumeUpload(a,t):e.classList.contains(c)&&(a.file.status===this.localizedTexts("fileUploadCancel")?this.retryUpload(a,!1):this.retryUpload(a,!0))},e.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("e-restrict-retry")},e.prototype.chunkUploadInProgress=function(t,e,n){var a=this;if("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);var r=this.getLiElement(e.file);if(!i.i(s.isNullOrUndefined)(r)){var l=r.querySelector("."+c);if(i.i(s.isNullOrUndefined)(l)||(l.classList.add(g),l.setAttribute("title",this.localizedTexts("pause")),l.classList.remove(c)),!i.i(s.isNullOrUndefined)(r)){if(!(r.querySelectorAll("."+p).length>0)){var m=r.querySelector("."+o);i.i(s.isNullOrUndefined)(this.template)&&(m.classList.add("e-upload-progress"),m.classList.remove(v),this.createProgressBar(r),this.updateProgressBarClasses(r,"e-upload-progress"));var f=r.querySelector("."+h)?r.querySelector("."+h):r.querySelector("."+d);i.i(s.isNullOrUndefined)(f)||(f.classList.add(u),f.setAttribute("title",this.localizedTexts("abort")),f.classList.remove(h))}if(!isNaN(Math.round(t.loaded/t.total*100))&&i.i(s.isNullOrUndefined)(this.template)&&"4"!==e.file.statusCode){var y=void 0,b=Math.ceil(e.file.size/this.asyncSettings.chunkSize)-1;this.asyncSettings.chunkSize&&b&&(y=Math.round(e.chunkIndex/b*100),this.changeProgressValue(r,y.toString()+"%"))}0===e.chunkIndex&&this.checkActionButtonStatus()}if(i.i(s.isNullOrUndefined)(r.querySelector("."+g))&&i.i(s.isNullOrUndefined)(this.template)&&i.i(s.isNullOrUndefined)(r.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");var C=r.querySelector("."+u);C.parentElement.insertBefore(this.pauseButton,C),this.pauseButton.setAttribute("title",this.localizedTexts("pause")),this.pauseButton.addEventListener("click",function(t){a.checkPausePlayAction(t)},!1)}}}},e.prototype.bytesToSize=function(t){var e=-1;if(!t)return"0.0 KB";do{t/=1024,e++}while(t>99);return e>=2&&(t*=1024,e=1),Math.max(t,0).toFixed(1)+" "+["KB","MB"][e]},e.prototype.sortFileList=function(t){t=t||this.sortFilesList;for(var e=t,i=[],s=0;s<e.length;s++)i.push(e[s].name);for(var n=i.sort(),a=[],r=0,l=n;r<l.length;r++)for(var o=l[r],s=0;s<e.length;s++)o===e[s].name&&a.push(e[s]);return a},e.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 e=["aria-label","directory","webkitdirectory","tabindex"],n=0,a=e;n<a.length;n++){var r=a[n];this.element.removeAttribute(r)}i.i(s.isNullOrUndefined)(this.uploadWrapper)||(this.uploadWrapper.parentElement.appendChild(this.element),i.i(s.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,t.prototype.destroy.call(this)},e.prototype.upload=function(t,e){var i=this;if(t=t||this.filesData,this.sequentialUpload&&(this.isFirstFileOnSelection||e))this.sequenceUpload(t);else{var s=this.getFilesInArray(t),n={customFormData:[],currentRequest:null,cancel:!1};this.trigger("beforeUpload",n,function(t){t.cancel||i.uploadFiles(s,e)})}},e.prototype.getFilesInArray=function(t){var e=[];return t instanceof Array?e=t:e.push(t),e},e.prototype.serverReadFileBase64=function(t,e,i){var s=this;return new Promise(function(n,a){var r=s.fileStreams[t].rawFile;try{var l=new FileReader;l.onload=function(t){return function(){try{var e=t.result,i=e?e.split(";base64,")[1]:null;n(i)}catch(t){a(t)}}}(l),l.readAsDataURL(r.slice(e,e+i))}catch(t){a(t)}})},e.prototype.uploadFileCount=function(t){var e=this.filesData;return e&&0!==e.length?e.length:-1},e.prototype.getFileRead=function(t,e){var i=this.filesData;if(!i||0===i.length)return-1;var s=i[t],n=this.newFileRef++;return this.fileStreams[n]=s,n},e.prototype.getFileInfo=function(t,e){var i=this.filesData;return i&&0!==i.length&&i[t]?this.filesData[t]:null},e.prototype.uploadFiles=function(t,e){var n=[];if(""!==this.asyncSettings.saveUrl&&!i.i(s.isNullOrUndefined)(this.asyncSettings.saveUrl)){if(!e||i.i(s.isNullOrUndefined)(e))if(this.multiple)n=this.filterfileList(t);else{var a=[];a.push(t[0]),n=this.filterfileList(a)}else n=t;for(var r=0;r<n.length;r++)this.uploadFilesRequest(n,r,e)}},e.prototype.uploadFilesRequest=function(t,e,i){var n=this,a=this.checkChunkUpload(),r=new s.Ajax(this.asyncSettings.saveUrl,"POST",!0,null);r.emitError=!1;var l={fileData:t[e],customFormData:[],cancel:!1},o=new FormData;if(r.beforeSend=function(i){l.currentRequest=r.httpRequest,n.trigger("uploading",l,function(s){s.cancel&&n.eventCancelByArgs(i,s,t[e]),n.updateFormData(o,s.customFormData)})},"1"===t[e].statusCode){var h=this.element.getAttribute("name");o.append(h,t[e].rawFile,t[e].name),a&&t[e].size>this.asyncSettings.chunkSize?this.chunkUpload(t[e],i,e):(r.onLoad=function(s){return l.cancel?{}:(n.uploadComplete(s,t[e],i),{})},r.onUploadProgress=function(s){return l.cancel?{}:(n.uploadInProgress(s,t[e],i,r),{})},r.onError=function(i){return n.uploadFailed(i,t[e]),{}},r.send(o))}},e.prototype.spliceFiles=function(t){for(var e=this.fileList[t],i=this.getFilesData(),s=+e.getAttribute("data-files-count"),n=0,a=0;a<t;a++)n+=+this.fileList[a].getAttribute("data-files-count");for(var r=n+s-1,l=r;l>=n;l--)i.splice(l,1)},e.prototype.remove=function(t,e,n,a,r){var l=this;i.i(s.isNullOrUndefined)(a)&&(a=!0);var o={event:r,cancel:!1,filesData:[],customFormData:[],postRawFile:a,currentRequest:null},d={cancel:!1,customFormData:[],currentRequest:null};this.trigger("beforeRemove",d,function(a){if(!a.cancel)if(l.isFormUpload())o.filesData=t,l.trigger("removing",o,function(e){if(!e.cancel)for(var n=l.getFilesInArray(t),a=!1,r=void 0,o=0,h=n;o<h.length;o++){var d=h[o];if(a||(r=l.fileList.indexOf(d.list)),r>-1){var u=i.i(s.isNullOrUndefined)(d.input)?null:d.input;u&&i.i(s.detach)(u),l.spliceFiles(r),i.i(s.detach)(l.fileList[r]),l.fileList.splice(r,1),a=!0,r=-1}}});else if(l.isForm&&(i.i(s.isNullOrUndefined)(l.asyncSettings.removeUrl)||""===l.asyncSettings.removeUrl))o.filesData=l.getFilesData(),l.trigger("removing",o,function(t){t.cancel||l.clearAll()});else{var d=[];t=i.i(s.isNullOrUndefined)(t)?l.filesData:t,t instanceof Array?d=t:d.push(t),o.filesData=d;for(var u=l.asyncSettings.removeUrl,c=""!==u&&!i.i(s.isNullOrUndefined)(u),p=0,m=d;p<m.length;p++){var f=m[p];!function(t){var i=l.uploadedFilesData.indexOf(t);("2"===t.statusCode||"4"===t.statusCode||"0"===t.statusCode&&-1!==i)&&c?l.removeUploadedFile(t,o,n,e):n?l.removeFilesData(t,e):l.trigger("removing",o,function(i){i.cancel||l.removeFilesData(t,e)}),r&&!r.target.classList.contains(h)&&l.checkActionComplete(!1)}(f)}}})},e.prototype.clearAll=function(){var t=this;if(i.i(s.isNullOrUndefined)(this.listParent))return"msie"!==this.browserName&&(this.element.value=""),void(this.filesData=[]);var e={cancel:!1,filesData:this.filesData};this.trigger("clearing",e,function(e){e.cancel||(t.clearData(),t.actionCompleteCount=0,t.count=-1)})},e.prototype.getFilesData=function(t){return i.i(s.isNullOrUndefined)(t)?this.filesData:this.getSelectedFiles(t)},e.prototype.pause=function(t,e){t=t||this.filesData;var i=this.getFilesInArray(t);this.pauseUploading(i,e)},e.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)},e.prototype.getFiles=function(t){var e=[];return i.i(s.isNullOrUndefined)(t)||t instanceof Array?e=t:e.push(t),e},e.prototype.resume=function(t,e){t=t||this.filesData;var i=this.getFilesInArray(t);this.resumeFiles(i,e)},e.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)},e.prototype.retry=function(t,e,i){t=t||this.filesData;var s=this.getFilesInArray(t);this.sequentialUpload&&this.isFirstFileOnSelection&&(this.isFirstFileOnSelection=!1),this.retryFailedFiles(s,e,i)},e.prototype.retryFailedFiles=function(t,e,i){for(var s=this.getFiles(t),n=0;n<s.length;n++)if("5"===s[n].statusCode||"0"===s[n].statusCode)if(this.asyncSettings.chunkSize>0&&this.getCurrentMetaData(s[n],null))this.retryUpload(this.getCurrentMetaData(s[n],null),e);else{var a=void 0;i||(a=this.fileList[this.filesData.indexOf(s[n])]),this.reloadcanceledFile(null,s[n],a,i)}},e.prototype.cancel=function(t){t=t||this.filesData;var e=this.getFilesInArray(t);this.cancelUpload(e)},e.prototype.cancelUpload=function(t){var e=this.getFiles(t);if(this.asyncSettings.chunkSize>0){for(var i=0;i<e.length;i++)if("3"===e[i].statusCode){var s=this.getCurrentMetaData(e[i],null);s.file.statusCode="5",s.file.status=this.localizedTexts("fileUploadCancel"),this.updateMetaData(s),this.showHideUploadSpinner(e[i])}}else for(var i=0;i<e.length;i++)"3"===e[i].statusCode&&(e[i].statusCode="5",e[i].status=this.localizedTexts("fileUploadCancel"),this.showHideUploadSpinner(e[i]))},e.prototype.showHideUploadSpinner=function(t){var e=this.getLiElement(t);if(!i.i(s.isNullOrUndefined)(e)&&i.i(s.isNullOrUndefined)(this.template)){var a=e.querySelector("."+u);i.i(n.createSpinner)({target:a,width:"20px"}),i.i(n.showSpinner)(a)}},r([i.i(s.Complex)({saveUrl:"",removeUrl:""},E)],e.prototype,"asyncSettings",void 0),r([i.i(s.Property)(!1)],e.prototype,"sequentialUpload",void 0),r([i.i(s.Property)({})],e.prototype,"htmlAttributes",void 0),r([i.i(s.Property)("")],e.prototype,"cssClass",void 0),r([i.i(s.Property)(!0)],e.prototype,"enabled",void 0),r([i.i(s.Property)(null)],e.prototype,"template",void 0),r([i.i(s.Property)(!0)],e.prototype,"multiple",void 0),r([i.i(s.Property)(!0)],e.prototype,"autoUpload",void 0),r([i.i(s.Property)(!0)],e.prototype,"enableHtmlSanitizer",void 0),r([i.i(s.Complex)({},C)],e.prototype,"buttons",void 0),r([i.i(s.Property)("")],e.prototype,"allowedExtensions",void 0),r([i.i(s.Property)(0)],e.prototype,"minFileSize",void 0),r([i.i(s.Property)(3e7)],e.prototype,"maxFileSize",void 0),r([i.i(s.Property)(null)],e.prototype,"dropArea",void 0),r([i.i(s.Collection)([{}],b)],e.prototype,"files",void 0),r([i.i(s.Property)(!0)],e.prototype,"showFileList",void 0),r([i.i(s.Property)(!1)],e.prototype,"directoryUpload",void 0),r([i.i(s.Property)("Default")],e.prototype,"dropEffect",void 0),r([i.i(s.Event)()],e.prototype,"created",void 0),r([i.i(s.Event)()],e.prototype,"actionComplete",void 0),r([i.i(s.Event)()],e.prototype,"rendering",void 0),r([i.i(s.Event)()],e.prototype,"beforeUpload",void 0),r([i.i(s.Event)()],e.prototype,"fileListRendering",void 0),r([i.i(s.Event)()],e.prototype,"selected",void 0),r([i.i(s.Event)()],e.prototype,"uploading",void 0),r([i.i(s.Event)()],e.prototype,"success",void 0),r([i.i(s.Event)()],e.prototype,"failure",void 0),r([i.i(s.Event)()],e.prototype,"removing",void 0),r([i.i(s.Event)()],e.prototype,"beforeRemove",void 0),r([i.i(s.Event)()],e.prototype,"clearing",void 0),r([i.i(s.Event)()],e.prototype,"progress",void 0),r([i.i(s.Event)()],e.prototype,"change",void 0),r([i.i(s.Event)()],e.prototype,"chunkSuccess",void 0),r([i.i(s.Event)()],e.prototype,"chunkFailure",void 0),r([i.i(s.Event)()],e.prototype,"chunkUploading",void 0),r([i.i(s.Event)()],e.prototype,"canceling",void 0),r([i.i(s.Event)()],e.prototype,"pausing",void 0),r([i.i(s.Event)()],e.prototype,"resuming",void 0),e=r([s.NotifyPropertyChanges],e)}(s.Component)}])});
|
|
10
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("SyncfusionBase"),require("SyncfusionPopups"),require("SyncfusionSplitbuttons")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionPopups","SyncfusionSplitbuttons"],e):"object"==typeof exports?exports.SyncfusionInputs=e(require("SyncfusionBase"),require("SyncfusionPopups"),require("SyncfusionSplitbuttons")):t.SyncfusionInputs=e(t.SyncfusionBase,t.SyncfusionPopups,t.SyncfusionSplitbuttons)}(this,function(t,e,i){return function(t){function e(s){if(i[s])return i[s].exports;var n=i[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var i={};return e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,s){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:s})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=20)}([function(e,i){e.exports=t},function(t,e,i){"use strict";i.d(e,"a",function(){return s});var s,n=i(0),a=(i.n(n),{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"});!function(t){function e(t,e){var r=i.i(n.isNullOrUndefined)(e)?n.createElement:e,l={container:null,buttons:[],clearButton:null};if(K=t.floatLabelType,Y=t.bindClearAction,i.i(n.isNullOrUndefined)(t.floatLabelType)||"Never"===t.floatLabelType?(l.container=E(t,a.INPUTGROUP,a.INPUTCUSTOMTAG,"span",r),t.element.parentNode.insertBefore(l.container,t.element),i.i(n.addClass)([t.element],a.INPUT),l.container.appendChild(t.element)):u(t,l,r),s(t),i.i(n.isNullOrUndefined)(t.properties)||i.i(n.isNullOrUndefined)(t.properties.showClearButton)||!t.properties.showClearButton||(A(t.properties.showClearButton,t.element,l,!0,r),l.clearButton.setAttribute("role","button"),l.container.classList.contains(a.FLOATINPUT)&&i.i(n.addClass)([l.container],a.INPUTGROUP)),!i.i(n.isNullOrUndefined)(t.buttons))for(var o=0;o<t.buttons.length;o++)l.buttons.push(_(t.buttons[o],l.container,r));return i.i(n.isNullOrUndefined)(t.element)||"TEXTAREA"!==t.element.tagName||i.i(n.addClass)([l.container],a.TEXTAREA),X(l.container,t.element),l=p(t,l),V(l.container,r),Z=l,l}function s(e){r(e.floatLabelType,e.element),e.element.addEventListener("focus",function(){var i=v(this);(i.classList.contains("e-input-group")||i.classList.contains("e-outline")||i.classList.contains("e-filled"))&&i.classList.add("e-input-focus"),"Auto"===e.floatLabelType&&setTimeout(function(){t.calculateWidth(e.element,i)},80)}),e.element.addEventListener("blur",function(){var i=v(this);(i.classList.contains("e-input-group")||i.classList.contains("e-outline")||i.classList.contains("e-filled"))&&i.classList.remove("e-input-focus"),"Auto"===e.floatLabelType&&""===e.element.value&&setTimeout(function(){t.calculateWidth(e.element,i)},80)}),e.element.addEventListener("input",function(){r(K,e.element)})}function r(t,e){var s=e.value;""!==s&&!i.i(n.isNullOrUndefined)(s)&&e.parentElement?e.parentElement.classList.add("e-valid-input"):"Always"!==t&&e.parentElement&&e.parentElement.classList.remove("e-valid-input")}function l(){var t=v(this).getElementsByClassName("e-float-text")[0];i.i(n.isNullOrUndefined)(t)||(i.i(n.addClass)([t],a.LABELTOP),t.classList.contains(a.LABELBOTTOM)&&i.i(n.removeClass)([t],a.LABELBOTTOM))}function o(){var t=v(this);if(t.getElementsByTagName("textarea")[0]?""===t.getElementsByTagName("textarea")[0].value:""===t.getElementsByTagName("input")[0].value){var e=t.getElementsByClassName("e-float-text")[0];i.i(n.isNullOrUndefined)(e)||(e.classList.contains(a.LABELTOP)&&i.i(n.removeClass)([e],a.LABELTOP),i.i(n.addClass)([e],a.LABELBOTTOM))}}function h(t){t.addEventListener("focus",l),t.addEventListener("blur",o)}function d(t){t.removeEventListener("focus",l),t.removeEventListener("blur",o)}function u(t,e,s){var r=i.i(n.isNullOrUndefined)(s)?n.createElement:s;"Auto"===t.floatLabelType&&h(t.element),i.i(n.isNullOrUndefined)(e.container)?(e.container=E(t,a.FLOATINPUT,a.FLOATCUSTOMTAG,"div",r),e.container.classList.add(a.INPUTGROUP),t.element.parentNode&&t.element.parentNode.insertBefore(e.container,t.element)):(i.i(n.isNullOrUndefined)(t.customTag)||e.container.classList.add(a.FLOATCUSTOMTAG),e.container.classList.add(a.FLOATINPUT));var l=r("span",{className:a.FLOATLINE}),o=r("label",{className:a.FLOATTEXT});if(i.i(n.isNullOrUndefined)(t.element.id)||""===t.element.id||(o.id="label_"+t.element.id.replace(/ /g,"_"),i.i(n.attributes)(t.element,{"aria-labelledby":o.id})),i.i(n.isNullOrUndefined)(t.element.placeholder)||""===t.element.placeholder||(o.innerText=x(t.element.placeholder),t.element.removeAttribute("placeholder")),i.i(n.isNullOrUndefined)(t.properties)||i.i(n.isNullOrUndefined)(t.properties.placeholder)||""===t.properties.placeholder||(o.innerText=x(t.properties.placeholder)),o.innerText||e.container.classList.add(a.NOFLOATLABEL),e.container.classList.contains("e-float-icon-left")){var d=e.container.querySelector(".e-input-in-wrap");d.appendChild(t.element),d.appendChild(l),d.appendChild(o)}else e.container.appendChild(t.element),e.container.appendChild(l),e.container.appendChild(o);f(t.element.value,o),"Always"===t.floatLabelType&&(o.classList.contains(a.LABELBOTTOM)&&i.i(n.removeClass)([o],a.LABELBOTTOM),i.i(n.addClass)([o],a.LABELTOP)),"Auto"===t.floatLabelType&&(t.element.addEventListener("input",function(e){f(t.element.value,o,t.element)}),t.element.addEventListener("blur",function(e){f(t.element.value,o)})),i.i(n.isNullOrUndefined)(t.element.getAttribute("id"))||o.setAttribute("for",t.element.getAttribute("id"))}function c(t,e){"Always"===t&&e.classList.contains("e-outline")&&e.classList.add("e-valid-input")}function p(t,e){if(!i.i(n.isNullOrUndefined)(t.properties))for(var s=0,a=Object.keys(t.properties);s<a.length;s++){var r=a[s];switch(r){case"cssClass":T(t.properties.cssClass,[e.container]),c(t.floatLabelType,e.container);break;case"enabled":H(t.properties.enabled,t.element,t.floatLabelType,e.container);break;case"enableRtl":w(t.properties.enableRtl,[e.container]);break;case"placeholder":O(t.properties.placeholder,t.element);break;case"readonly":L(t.properties.readonly,t.element)}}return e}function m(t,e,s){i.i(n.isNullOrUndefined)(e)||(t&&!s?i.i(n.removeClass)([e],a.CLEARICONHIDE):i.i(n.addClass)([e],a.CLEARICONHIDE))}function f(t,e,s){if(void 0===s&&(s=null),t)i.i(n.addClass)([e],a.LABELTOP),e.classList.contains(a.LABELBOTTOM)&&i.i(n.removeClass)([e],a.LABELBOTTOM);else{(null==s||s!==document.activeElement)&&(e.classList.contains(a.LABELTOP)&&i.i(n.removeClass)([e],a.LABELTOP),i.i(n.addClass)([e],a.LABELBOTTOM))}}function v(t){var e=i.i(n.isNullOrUndefined)(t.parentNode)?t:t.parentNode;return e&&e.classList.contains("e-input-in-wrap")&&(e=e.parentNode),e}function g(t,e,s,r){var l=i.i(n.isNullOrUndefined)(r)?n.createElement:r,o=l("span",{className:a.CLEARICON}),h=e.container;if(i.i(n.isNullOrUndefined)(s)){(e.container.classList.contains(a.FLOATINPUT)?e.container.querySelector("."+a.FLOATTEXT):t).insertAdjacentElement("afterend",o)}else h.appendChild(o);return i.i(n.addClass)([o],a.CLEARICONHIDE),y(t,o,h),o.setAttribute("aria-label","close"),o}function y(t,e,s){(void 0===Y||Y)&&e.addEventListener("click",function(s){t.classList.contains(a.DISABLE)||t.readOnly||(s.preventDefault(),t!==document.activeElement&&t.focus(),t.value="",i.i(n.addClass)([e],a.CLEARICONHIDE))}),t.addEventListener("input",function(i){m(t.value,e)}),t.addEventListener("focus",function(i){m(t.value,e,t.readOnly)}),t.addEventListener("blur",function(s){setTimeout(function(){i.i(n.isNullOrUndefined)(e)||(i.i(n.addClass)([e],a.CLEARICONHIDE),e=!i.i(n.isNullOrUndefined)(t)&&t.classList.contains("e-combobox")?null:e)},200)})}function b(){Z=null}function C(t,e){if(v(t).classList.contains(a.FLOATINPUT)&&"Auto"===e){var i=v(t).getElementsByClassName("e-float-text")[0];f(t.value,i,t)}}function E(t,e,s,a,r){var l,o=i.i(n.isNullOrUndefined)(r)?n.createElement:r;return i.i(n.isNullOrUndefined)(t.customTag)?l=o(a,{className:e}):(l=o(t.customTag,{className:e}),l.classList.add(s)),l.classList.add("e-control-wrapper"),l}function x(t){var e="";if(!i.i(n.isNullOrUndefined)(t)&&""!==t){var s=document.createElement("span");s.innerHTML='<input placeholder="'+t+'"/>';e=s.children[0].placeholder}return e}function S(t,e,s,l){if(e.value=t,"Auto"===s&&""===t&&k(e,e.parentElement),i.i(n.isNullOrUndefined)(s)||"Auto"!==s||C(e,s),!i.i(n.isNullOrUndefined)(l)&&l){var o=v(e);if(!i.i(n.isNullOrUndefined)(o)){var h=o.getElementsByClassName(a.CLEARICON)[0];i.i(n.isNullOrUndefined)(h)||(e.value&&!i.i(n.isNullOrUndefined)(o)&&o.classList.contains("e-input-focus")?i.i(n.removeClass)([h],a.CLEARICONHIDE):i.i(n.addClass)([h],a.CLEARICONHIDE))}}r(s,e)}function T(t,e,s){i.i(n.isNullOrUndefined)(s)||""===s||i.i(n.removeClass)(e,s.split(" ")),i.i(n.isNullOrUndefined)(t)||""===t||i.i(n.addClass)(e,t.split(" "))}function k(t,e,s){var a="multiselect"===s?t:t.clientWidth-parseInt(getComputedStyle(t,null).getPropertyValue("padding-left"),10);i.i(n.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"),(a<e.getElementsByClassName("e-float-text-content")[0].clientWidth||a===e.getElementsByClassName("e-float-text-content")[0].clientWidth)&&e.getElementsByClassName("e-float-text-content")[0].classList.add("e-float-text-overflow"))}function P(t,e){"number"==typeof t?e.style.width=i.i(n.formatUnit)(t):"string"==typeof t&&(e.style.width=t.match(/px|%|em/)?t:i.i(n.formatUnit)(t)),k(e.firstChild,e)}function O(t,e){t=x(t);var s=v(e);s.classList.contains(a.FLOATINPUT)?i.i(n.isNullOrUndefined)(t)||""===t?(s.classList.add(a.NOFLOATLABEL),s.getElementsByClassName("e-float-text-content")[0]?s.getElementsByClassName(a.FLOATTEXT)[0].children[0].textContent="":s.getElementsByClassName(a.FLOATTEXT)[0].textContent=""):(s.getElementsByClassName("e-float-text-content")[0]?s.getElementsByClassName(a.FLOATTEXT)[0].children[0].textContent=t:s.getElementsByClassName(a.FLOATTEXT)[0].textContent=t,s.classList.remove(a.NOFLOATLABEL),e.removeAttribute("placeholder")):i.i(n.isNullOrUndefined)(t)||""===t?e.removeAttribute("placeholder"):i.i(n.attributes)(e,{placeholder:t})}function L(t,e,s){t?i.i(n.attributes)(e,{readonly:""}):e.removeAttribute("readonly"),i.i(n.isNullOrUndefined)(s)||C(e,s)}function w(t,e){t?i.i(n.addClass)(e,a.RTL):i.i(n.removeClass)(e,a.RTL)}function H(t,e,s,r){var l={disabled:"disabled","aria-disabled":"true"},o=!i.i(n.isNullOrUndefined)(r);t?(e.classList.remove(a.DISABLE),N(l,e),o&&i.i(n.removeClass)([r],a.DISABLE)):(e.classList.add(a.DISABLE),B(l,e),o&&i.i(n.addClass)([r],a.DISABLE)),i.i(n.isNullOrUndefined)(s)||C(e,s)}function A(t,e,s,a,r){var l=i.i(n.isNullOrUndefined)(r)?n.createElement:r;t?s.clearButton=g(e,s,a,l):(i.i(n.remove)(s.clearButton),s.clearButton=null)}function N(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],r=v(e);"disabled"===n&&e.classList.remove(a.DISABLE),"disabled"===n&&r.classList.contains(a.INPUTGROUP)&&r.classList.remove(a.DISABLE),"placeholder"===n&&r.classList.contains(a.FLOATINPUT)?r.getElementsByClassName(a.FLOATTEXT)[0].textContent="":e.removeAttribute(n)}}function B(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],r=v(e);"disabled"===n&&e.classList.add(a.DISABLE),"disabled"===n&&r.classList.contains(a.INPUTGROUP)&&r.classList.add(a.DISABLE),"placeholder"===n&&r.classList.contains(a.FLOATINPUT)?r.getElementsByClassName(a.FLOATTEXT)[0].textContent=t[""+n]:e.setAttribute(n,t[""+n])}}function U(t){var e=t.container;if(!i.i(n.isNullOrUndefined)(e)&&e.classList.contains(a.FLOATINPUT)){var s=e.querySelector("textarea")?e.querySelector("textarea"):e.querySelector("input"),r=e.querySelector("."+a.FLOATTEXT).textContent,l=null!==e.querySelector(".e-clear-icon");i.i(n.detach)(e.querySelector("."+a.FLOATLINE)),i.i(n.detach)(e.querySelector("."+a.FLOATTEXT)),i.i(n.classList)(e,[a.INPUTGROUP],[a.FLOATINPUT]),d(s),i.i(n.attributes)(s,{placeholder:r}),s.classList.add(a.INPUT),l||"INPUT"!==s.tagName||s.removeAttribute("required")}}function R(t,e,s,r){var l=i.i(n.isNullOrUndefined)(r)?n.createElement:r,o=i.i(n.closest)(t,"."+a.INPUTGROUP);if(K=e,"Never"!==e){var h=o.tagName;h="DIV"!==h&&"SPAN"!==h?h:null;var d={element:t,floatLabelType:e,customTag:h,properties:{placeholder:s}},p=o.querySelector(".e-clear-icon"),m={container:o};t.classList.remove(a.INPUT),u(d,m,l),V(m.container,l),k(d.element,m.container);var f=o.classList.contains("e-float-icon-left");if(i.i(n.isNullOrUndefined)(p))if(f){var v=o.querySelector(".e-input-in-wrap");p=v.querySelector(".e-input-group-icon")}else p=o.querySelector(".e-input-group-icon");if(i.i(n.isNullOrUndefined)(p))f&&(p=o.querySelector(".e-input-group-icon"));else{var g=o.querySelector("."+a.FLOATLINE),y=o.querySelector("."+a.FLOATTEXT),b=f?o.querySelector(".e-input-in-wrap"):o;b.insertBefore(t,p),b.insertBefore(g,p),b.insertBefore(y,p)}}c(e,t.parentElement)}function V(t,e){if(t.classList.contains("e-outline")&&t.getElementsByClassName("e-float-text")[0]){var i=e("span",{className:a.FLOATTEXTCONTENT});i.innerHTML=t.getElementsByClassName("e-float-text")[0].innerHTML,t.getElementsByClassName("e-float-text")[0].innerHTML="",t.getElementsByClassName("e-float-text")[0].appendChild(i)}}function F(t,e){for(var i=0;i<e.length;i++)M(t,e[parseInt(i.toString())].container)}function M(t,e,s){var a=[];a.push(s);var r=i.i(n.isNullOrUndefined)(s)?e.querySelectorAll(".e-input-group-icon"):a;if(t&&r.length>0)for(var l=0;l<r.length;l++)r[parseInt(l.toString())].addEventListener("mousedown",D,!1),r[parseInt(l.toString())].addEventListener("mouseup",z,!1);else if(r.length>0)for(var l=0;l<r.length;l++)r[parseInt(l.toString())].removeEventListener("mousedown",D,this),r[parseInt(l.toString())].removeEventListener("mouseup",z,this)}function I(t,e){t.classList.contains("e-disabled")||t.querySelector("input").readOnly||e.classList.add("e-input-btn-ripple")}function D(){for(var t=this,e=this.parentElement;!e.classList.contains("e-input-group");)e=e.parentElement;I(e,t)}function z(){var t=this;setTimeout(function(){t.classList.remove("e-input-btn-ripple")},500)}function q(t,e){var i=e("span",{className:t});return i.classList.add("e-input-group-icon"),i}function W(t,e,i,s,n){var a="string"==typeof e?e.split(","):e;if("append"===t.toLowerCase())for(var r=0,l=a;r<l.length;r++){var o=l[r];_(o,i,n)}else for(var h=0,d=a;h<d.length;h++){var o=d[h];j(o,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")}function j(t,e,s,a){var r=i.i(n.isNullOrUndefined)(a)?n.createElement:a,l=q(t,r);e.classList.add("e-float-icon-left");var o=e.querySelector(".e-input-in-wrap");if(i.i(n.isNullOrUndefined)(o)){o=r("span",{className:"e-input-in-wrap"}),s.parentNode.insertBefore(o,s);var h=e.querySelectorAll(s.tagName+" ~ *");o.appendChild(s);for(var d=0;d<h.length;d++)o.appendChild(h[parseInt(d.toString())])}return o.parentNode.insertBefore(l,o),M(!0,e,l),l}function _(t,e,s){var a=i.i(n.isNullOrUndefined)(s)?n.createElement:s,r=q(t,a);return(e.classList.contains("e-float-icon-left")?e.querySelector(".e-input-in-wrap"):e).appendChild(r),M(!0,e,r),r}function X(t,e){"hidden"===e.type?t.classList.add("e-hidden"):t.classList.contains("e-hidden")&&t.classList.remove("e-hidden")}var K,Z={container:null,buttons:[],clearButton:null},Y=!0;t.createInput=e,t.bindInitialEvent=s,t.wireFloatingEvents=h,t.wireClearBtnEvents=y,t.destroy=b,t.setValue=S,t.setCssClass=T,t.calculateWidth=k,t.setWidth=P,t.setPlaceholder=O,t.setReadonly=L,t.setEnableRtl=w,t.setEnabled=H,t.setClearButton=A,t.removeAttributes=N,t.addAttributes=B,t.removeFloating=U,t.addFloating=R,t.createSpanElement=V,t.setRipple=F,t.addIcon=W,t.prependSpan=j,t.appendSpan=_,t.validateInputType=X}(s||(s={}))},function(t,i){t.exports=e},function(t,e,i){"use strict";var s=i(21);i.d(e,"a",function(){return s.a}),i.d(e,"b",function(){return s.b}),i.d(e,"c",function(){return s.c}),i.d(e,"d",function(){return s.d}),i.d(e,"e",function(){return s.e}),i.d(e,"f",function(){return s.f}),i.d(e,"g",function(){return s.g}),i.d(e,"h",function(){return s.h}),i.d(e,"i",function(){return s.i}),i.d(e,"j",function(){return s.j}),i.d(e,"k",function(){return s.k}),i.d(e,"l",function(){return s.l}),i.d(e,"m",function(){return s.m}),i.d(e,"n",function(){return s.n}),i.d(e,"o",function(){return s.o}),i.d(e,"p",function(){return s.p}),i.d(e,"q",function(){return s.q}),i.d(e,"r",function(){return s.r}),i.d(e,"s",function(){return s.s}),i.d(e,"t",function(){return s.t}),i.d(e,"u",function(){return s.u}),i.d(e,"v",function(){return s.v})},function(t,e,i){"use strict";var s=i(1);i.d(e,"a",function(){return s.a})},function(t,e,i){"use strict";var s=i(24);i.d(e,"a",function(){return s.a})},function(t,e,i){"use strict";i.d(e,"a",function(){return a});var s=i(0),n=(i.n(s),this&&this.__extends||function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}()),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.minDistance=5,e.previous=0,e.interval=30,e.timeout=null,e.isSignatureEmpty=!0,e.backgroundLoaded=null,e.clearArray=[],e.isBlazor=!1,e.isResponsive=!1,e.signPointsColl=[],e.signRatioPointsColl=[],e}return n(e,t),e.prototype.initialize=function(t,e){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(),i.i(s.isNullOrUndefined)(this.signatureValue)&&this.updateSnapCollection(!0),this.wireEvents(),this.isBlazor||this.trigger("created",null)},e.prototype.wireEvents=function(){!i.i(s.isNullOrUndefined)(this.pointColl)||this.isReadOnly||this.disabled?this.pointColl&&(s.EventHandler.add(this.canvasContext.canvas,"mousemove touchmove",this.mouseMoveHandler,this),s.EventHandler.add(this.canvasContext.canvas,"mouseup touchend",this.mouseUpHandler,this),s.EventHandler.add(document,"mouseup",this.mouseUpHandler,this)):(s.EventHandler.add(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler,this),s.EventHandler.add(this.canvasContext.canvas,"keydown",this.keyboardHandler,this),window.addEventListener("resize",this.resizeHandler.bind(this)))},e.prototype.unwireEvents=function(t){"mouseup"===t||"touchend"===t?(s.EventHandler.remove(this.canvasContext.canvas,"mousemove touchmove",this.mouseMoveHandler),s.EventHandler.remove(this.canvasContext.canvas,"mouseup touchend",this.mouseUpHandler),s.EventHandler.remove(document,"mouseup",this.mouseUpHandler)):(s.EventHandler.remove(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler),s.EventHandler.remove(this.canvasContext.canvas,"keydown",this.keyboardHandler),window.removeEventListener("resize",this.resizeHandler))},e.prototype.setHTMLProperties=function(){150===this.element.height&&300===this.element.width?(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||(this.element.height=this.element.offsetHeight,this.element.width=this.element.offsetWidth),this.canvasContext.scale(1,1),this.canvasContext.fillStyle=this.strokeColor,this.backgroundImage?(this.canvasContext.canvas.style.backgroundImage="url("+this.backgroundImage+")",this.canvasContext.canvas.style.backgroundRepeat="no-repeat"):this.backgroundColor&&(this.canvasContext.canvas.style.backgroundColor=this.backgroundColor)},e.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())},e.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))},e.prototype.mouseUpHandler=function(t){var e={actionName:"strokeUpdate"};"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",e),this.signatureValue=this.snapColl[this.incStep];for(var i=0;i<this.signPointsColl.length;i++)this.signRatioPointsColl.push({x:this.signPointsColl[i].x/this.canvasContext.canvas.width,y:this.signPointsColl[i].y/this.canvasContext.canvas.height});this.signPointsColl=[]},e.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()}},e.prototype.resizeHandler=function(){var t=this;if(this.isResponsive){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)}}},e.prototype.beginStroke=function(t){this.refresh(),this.updateStroke(t)},e.prototype.updateStroke=function(t){var e=this.createPoint(t);this.addPoint(e)},e.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))},e.prototype.delay=function(){this.previous=Date.now(),this.timeout=null,this.updateStroke(this.storedArgs),this.timeout||(this.storedArgs=null)},e.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())},e.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}},e.prototype.addPoint=function(t){var e,i,s=this.pointColl,n=s.length>0&&s[s.length-1],a=!!n&&this.distanceTo(n)<=this.minDistance;n&&n&&a||(s.push(t),s.length>2&&(3===s.length&&s.unshift(s[0]),e=this.calculateCurveControlPoints(s[0],s[1],s[2]).controlPoint2,i=this.calculateCurveControlPoints(s[1],s[2],s[3]).controlPoint1,this.startPoint=s[1],this.controlPoint1=e,this.controlPoint2=i,this.endPoint=s[2],this.startDraw(),s.shift()))},e.prototype.startDraw=function(){var t;t=this.pointVelocityCalc(this.startPoint),t=this.velocity*t+(1-this.velocity)*this.lastVelocity;var e=Math.max(this.maxStrokeWidth/(t+1),this.minStrokeWidth);this.curveDraw(this.lastWidth,e),this.lastVelocity=t,this.lastWidth=e},e.prototype.endDraw=function(){var t=this.pointColl.length>2,e=this.pointColl[0];!t&&e&&this.strokeDraw(e)},e.prototype.curveDraw=function(t,e){var i,s,n,a,r,l,o,h,d,u,c=this.canvasContext,p=e-t,m=this.bezierLengthCalc(),f=2*Math.ceil(m);for(c.beginPath(),s=0;s<f;s++)n=s/f,a=n*n,r=a*n,l=1-n,o=l*l,h=o*l,d=h*this.startPoint.x,d+=3*o*n*this.controlPoint1.x,d+=3*l*a*this.controlPoint2.x,d+=r*this.endPoint.x,u=h*this.startPoint.y,u+=3*o*n*this.controlPoint1.y,u+=3*l*a*this.controlPoint2.y,u+=r*this.endPoint.y,i=Math.min(t+r*p,this.maxStrokeWidth),this.arcDraw(d,u,i);c.closePath(),c.fill(),this.isSignatureEmpty=!1},e.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},e.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)},e.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={x:(t.x+e.x)/2,y:(t.y+e.y)/2},o={x:(e.x+i.x)/2,y:(e.y+i.y)/2},h=Math.sqrt(s*s+n*n),d=Math.sqrt(a*a+r*r),u=l.x-o.x,c=l.y-o.y,p=d/(h+d),m={x:o.x+u*p,y:o.y+c*p},f=e.x-m.x,v=e.y-m.y;return{controlPoint1:this.point(l.x+f,l.y+v,0),controlPoint2:this.point(o.x+f,o.y+v,0)}},e.prototype.bezierLengthCalc=function(){var t,e,i,s,n,a,r,l,o=0;for(t=0;t<=10;t++)e=t/10,i=this.bezierPointCalc(e,this.startPoint.x,this.controlPoint1.x,this.controlPoint2.x,this.endPoint.x),s=this.bezierPointCalc(e,this.startPoint.y,this.controlPoint1.y,this.controlPoint2.y,this.endPoint.y),t>0&&(r=i-n,l=s-a,o+=Math.sqrt(r*r+l*l)),n=i,a=s;return o},e.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},e.prototype.pointVelocityCalc=function(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0},e.prototype.distanceTo=function(t){return Math.sqrt(Math.pow(this.pointX-t.x,2)+Math.pow(this.pointY-t.y,2))},e.prototype.isRead=function(t){t?s.EventHandler.remove(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler):this.disabled||s.EventHandler.add(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler,this)},e.prototype.enableOrDisable=function(t){this.disabled=t,t?(this.canvasContext.canvas.style.filter="opacity(0.5)",this.isRead(!0)):(this.canvasContext.canvas.style.filter="",this.isRead(!1))},e.prototype.updateSnapCollection=function(t){if(i.i(s.isNullOrUndefined)(this.incStep)?(this.incStep=-1,this.incStep++,this.snapColl=[],this.clearArray=[]):this.incStep++,this.incStep<this.snapColl.length&&(this.snapColl.length=this.incStep),this.incStep>0){var e=this.createElement("canvas",{className:"e-"+this.getModuleName()+"-wrapper"}),n=e.getContext("2d");e.width=this.canvasContext.canvas.width,e.height=this.canvasContext.canvas.height,n.drawImage(this.canvasContext.canvas,0,0,e.width,e.height),this.snapColl.push(e.toDataURL())}else this.snapColl.push(this.canvasContext.canvas.toDataURL());t&&this.clearArray.push(this.incStep)},e.prototype.setBackgroundImage=function(t){var e=this,i=new Image;i.crossOrigin="anonymous",i.src=t,i.onload=function(){e.canvasContext.globalCompositeOperation="source-over",e.canvasContext.drawImage(i,0,0,e.element.width,e.element.height),e.updateSnapCollection(),e.saveBackground(!0)},this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height)},e.prototype.setBackgroundColor=function(t){var e=this.canvasContext;e.strokeStyle=t;var i,s;for(i=1;i<=e.canvas.width;i++)for(s=1;s<=e.canvas.height;s++)e.strokeRect(0,0,i,s);this.updateSnapCollection()},e.prototype.loadPersistedSignature=function(){if(!i.i(s.isNullOrUndefined)(this.signatureValue)){var t=this,e=new Image;e.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}},e.prototype.getBlob=function(t){for(var e=t.split(","),i=e[0].match(/:(.*?);/)[1],s=atob(e[1]),n=s.length,a=new Uint8Array(n);n--;)a[n]=s.charCodeAt(n);return new Blob([a],{type:i})},e.prototype.download=function(t,e){var i=URL.createObjectURL(t),s=document.createElement("a");s.href=i,s.target="_parent",s.download=e,(document.body||document.documentElement).appendChild(s),s.click(),s.parentNode.removeChild(s)},e.prototype.refresh=function(){this.pointColl=[],this.lastVelocity=0,this.lastWidth=(this.minStrokeWidth+this.maxStrokeWidth)/2},e.prototype.clear=function(){var t={actionName:"clear"};this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.refresh(),this.signRatioPointsColl=[],this.updateSnapCollection(!0),this.isSignatureEmpty=!0,this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Clear"):this.trigger("change",t)},e.prototype.undo=function(){var t={actionName:"undo"},e=this;if(this.incStep>0){this.incStep--;var i=new Image;i.src=this.snapColl[this.incStep],i.onload=function(){e.canvasContext.clearRect(0,0,e.element.width,e.element.height),e.canvasContext.drawImage(i,0,0,e.element.width,e.element.height)}}this.isClear(),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Undo"):this.trigger("change",t)},e.prototype.redo=function(){var t={actionName:"redo"},e=this;if(this.incStep<this.snapColl.length-1){this.incStep++;var i=new Image;i.src=this.snapColl[this.incStep],i.onload=function(){e.canvasContext.clearRect(0,0,e.element.width,e.element.height),e.canvasContext.drawImage(i,0,0,e.element.width,e.element.height)}}this.isClear(),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Redo"):this.trigger("change",t)},e.prototype.isClear=function(){if(this.clearArray){for(var t=!1,e=0;e<this.clearArray.length;e++)this.clearArray[e]===this.incStep&&(this.isSignatureEmpty=!0,t=!0);t||(this.isSignatureEmpty=!1)}},e.prototype.isEmpty=function(){return this.isSignatureEmpty},e.prototype.canUndo=function(){return this.incStep>0},e.prototype.canRedo=function(){return this.incStep<this.snapColl.length-1},e.prototype.draw=function(t,e,i){var s={actionName:"draw-text"};this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),e=e||"Arial",i=i||30,this.canvasContext.font=i+"px "+e,this.canvasContext.textAlign="center",this.canvasContext.textBaseline="middle",this.canvasContext.fillText(t,this.element.width/2,this.element.height/2),this.updateSnapCollection(),this.isSignatureEmpty=!1,this.trigger("change",s)},e.prototype.load=function(t,e,i){i=i||this.element.height,e=e||this.element.width,this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height);var s=this,n=new Image;n.src=t,"data"!==t.slice(0,4)&&(n.crossOrigin="anonymous"),n.onload=function(){Promise.all([createImageBitmap(n,0,0,e,i)]).then(function(n){var a=document.createElement("canvas");a.width=e,a.height=i,a.getContext("2d").drawImage(n[0],0,0),"data"!==t.slice(0,4)&&(s.canvasContext.globalCompositeOperation="source-over"),s.canvasContext.drawImage(a,0,0,e,i,0,0,s.element.width,s.element.height),s.updateSnapCollection()})},this.isSignatureEmpty=!1},e.prototype.saveBackground=function(t){var e;if(e=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){var i=this,s=new Image;s.crossOrigin="anonymous",s.src=e,s.onload=function(){i.backgroundLoaded=!0,i.canvasContext.globalCompositeOperation="source-over",i.canvasContext.drawImage(s,0,0,i.element.width,i.element.height),i.save(i.fileType,i.fileName)}}},e.prototype.save=function(t,e){if(this.saveWithBackground&&null==this.backgroundLoaded&&(this.backgroundImage||this.backgroundColor))this.backgroundLoaded=!1,this.fileType=t,this.fileName=e,this.saveBackground(!1);else if("Svg"===t)e=e||"Signature",this.toSVG(e);else if("Jpeg"===t)if(e=e||"Signature",!this.saveWithBackground||this.saveWithBackground&&!this.backgroundImage&&!this.backgroundColor)this.toJPEG(e);else{var i=this.canvasContext.canvas.toDataURL("image/jpeg");this.download(this.getBlob(i),e+".jpeg")}else{e=e||"Signature";var i=this.canvasContext.canvas.toDataURL("image/png");this.download(this.getBlob(i),e+".png")}this.saveWithBackground&&this.backgroundLoaded&&this.resetSnap()},e.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--},e.prototype.toJPEG=function(t){var e=this,i=this.snapColl[this.incStep];this.setBackgroundColor("#ffffff");var s=this,n=new Image;n.crossOrigin="anonymous",n.src=i,n.onload=function(){s.canvasContext.globalCompositeOperation="source-over",s.canvasContext.drawImage(n,0,0,s.element.width,s.element.height);var i=s.canvasContext.canvas.toDataURL("image/jpeg");s.download(s.getBlob(i),t+".jpeg"),s.canvasContext.clearRect(0,0,s.canvasContext.canvas.width,s.canvasContext.canvas.height),e.resizeHandler()},this.snapColl.pop(),this.incStep--},e.prototype.toSVG=function(t){var e=this.canvasContext.canvas.toDataURL(),i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("width",this.canvasContext.canvas.width.toString()),i.setAttribute("height",this.canvasContext.canvas.height.toString());var s=document.createElementNS("http://www.w3.org/2000/svg","image");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);var n='<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+'">',a=i.innerHTML,r=n+a+"</svg>",l="data:image/svg+xml;base64,"+btoa(r);return null==t?l:(this.download(this.getBlob(l),t+".svg"),null)},e.prototype.saveAsBlob=function(){return this.getBlob(this.canvasContext.canvas.toDataURL("image/png"))},e.prototype.getSignature=function(t){if("Jpeg"===t){for(var e=this.canvasContext.getImageData(0,0,this.element.width,this.element.height),i=e.data,s=0;s<i.length;s+=4)i[s+3]<255&&(i[s]=255-i[s],i[s+1]=255-i[s+1],i[s+2]=255-i[s+2],i[s+3]=255-i[s+3]);this.canvasContext.putImageData(e,0,0);var n=this.canvasContext.canvas.toDataURL("image/jpeg");return this.resizeHandler(),n}return"Svg"===t?this.toSVG(null):this.canvasContext.canvas.toDataURL("image/png")},e.prototype.getModuleName=function(){return"signature"},e.prototype.getPersistData=function(){return this.signatureValue=this.snapColl[this.incStep],this.addOnPersist(["signatureValue"])},e.prototype.destroy=function(){"image-editor"!==this.getModuleName()&&(this.unwireEvents(null),i.i(s.removeClass)([this.element],"e-"+this.getModuleName()),this.element.removeAttribute("tabindex"),this.pointColl=null),t.prototype.destroy.call(this)},e.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;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)}},e}(s.Component)},function(t,e,i){"use strict";i.d(e,"b",function(){return l}),i.d(e,"c",function(){return o}),i.d(e,"d",function(){return h}),i.d(e,"e",function(){return d}),i.d(e,"a",function(){return c});var s=i(0),n=(i.n(s),i(2)),a=(i.n(n),this&&this.__extends||function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}()),r=this&&this.__decorate||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;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),r([i.i(s.Property)("None")],e.prototype,"placement",void 0),r([i.i(s.Property)(10)],e.prototype,"largeStep",void 0),r([i.i(s.Property)(1)],e.prototype,"smallStep",void 0),r([i.i(s.Property)(!1)],e.prototype,"showSmallTicks",void 0),r([i.i(s.Property)(null)],e.prototype,"format",void 0),e}(s.ChildProperty),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),r([i.i(s.Property)(null)],e.prototype,"color",void 0),r([i.i(s.Property)(null)],e.prototype,"start",void 0),r([i.i(s.Property)(null)],e.prototype,"end",void 0),e}(s.ChildProperty),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),r([i.i(s.Property)(!1)],e.prototype,"enabled",void 0),r([i.i(s.Property)(null)],e.prototype,"minStart",void 0),r([i.i(s.Property)(null)],e.prototype,"minEnd",void 0),r([i.i(s.Property)(null)],e.prototype,"maxStart",void 0),r([i.i(s.Property)(null)],e.prototype,"maxEnd",void 0),r([i.i(s.Property)(!1)],e.prototype,"startHandleFixed",void 0),r([i.i(s.Property)(!1)],e.prototype,"endHandleFixed",void 0),e}(s.ChildProperty),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),r([i.i(s.Property)("")],e.prototype,"cssClass",void 0),r([i.i(s.Property)("Before")],e.prototype,"placement",void 0),r([i.i(s.Property)("Focus")],e.prototype,"showOn",void 0),r([i.i(s.Property)(!1)],e.prototype,"isVisible",void 0),r([i.i(s.Property)(null)],e.prototype,"format",void 0),e}(s.ChildProperty),u={root:"e-slider",rtl:"e-rtl",sliderHiddenInput:"e-slider-input",controlWrapper:"e-control-wrapper",sliderHandle:"e-handle",rangeBar:"e-range",sliderButton:"e-slider-button",firstButton:"e-first-button",secondButton:"e-second-button",scale:"e-scale",tick:"e-tick",large:"e-large",tickValue:"e-tick-value",sliderTooltip:"e-slider-tooltip",sliderHover:"e-slider-hover",sliderFirstHandle:"e-handle-first",sliderSecondHandle:"e-handle-second",sliderDisabled:"e-disabled",sliderContainer:"e-slider-container",horizontalTooltipBefore:"e-slider-horizontal-before",horizontalTooltipAfter:"e-slider-horizontal-after",verticalTooltipBefore:"e-slider-vertical-before",verticalTooltipAfter:"e-slider-vertical-after",materialTooltip:"e-material-tooltip",materialTooltipOpen:"e-material-tooltip-open",materialTooltipActive:"e-tooltip-active",materialSlider:"e-material-slider",sliderTrack:"e-slider-track",sliderHorizantalColor:"e-slider-horizantal-color",sliderVerticalColor:"e-slider-vertical-color",sliderHandleFocused:"e-handle-focused",verticalSlider:"e-vertical",horizontalSlider:"e-horizontal",sliderHandleStart:"e-handle-start",sliderTooltipStart:"e-material-tooltip-start",sliderTabHandle:"e-tab-handle",sliderButtonIcon:"e-button-icon",sliderSmallSize:"e-small-size",sliderTickPosition:"e-tick-pos",sliderFirstTick:"e-first-tick",sliderLastTick:"e-last-tick",sliderButtonClass:"e-slider-btn",sliderTooltipWrapper:"e-tooltip-wrap",sliderTabTrack:"e-tab-track",sliderTabRange:"e-tab-range",sliderActiveHandle:"e-handle-active",sliderMaterialHandle:"e-material-handle",sliderMaterialRange:"e-material-range",sliderMaterialDefault:"e-material-default",materialTooltipShow:"e-material-tooltip-show",materialTooltipHide:"e-material-tooltip-hide",readonly:"e-read-only",limits:"e-limits",limitBarDefault:"e-limit-bar",limitBarFirst:"e-limit-first",limitBarSecond:"e-limit-second",dragHorizontal:"e-drag-horizontal",dragVertical:"e-drag-vertical"},c=function(t){function e(e,i){var s=t.call(this,e,i)||this;return s.horDir="left",s.verDir="bottom",s.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)"},s.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"},s.scaleTransform="transform .4s cubic-bezier(.25, .8, .25, 1)",s.customAriaText=null,s.drag=!0,s.isDragComplete=!1,s.initialTooltip=!0,s}return a(e,t),e.prototype.preRender=function(){var t={incrementTitle:"Increase",decrementTitle:"Decrease"};this.l10n=new s.L10n("slider",t,this.locale),this.isElementFocused=!1,this.tickElementCollection=[],this.tooltipFormatInfo={},this.ticksFormatInfo={},this.initCultureInfo(),this.initCultureFunc(),this.formChecker()},e.prototype.formChecker=function(){var t=i.i(s.closest)(this.element,"form");t?(this.isForm=!0,i.i(s.isNullOrUndefined)(this.formResetValue)||this.setProperties({value:this.formResetValue},!0),this.formResetValue=this.value,"Range"!==this.type||!i.i(s.isNullOrUndefined)(this.formResetValue)&&"object"==typeof this.formResetValue?i.i(s.isNullOrUndefined)(this.formResetValue)&&(this.formResetValue=parseFloat(i.i(s.formatUnit)(this.min))):this.formResetValue=[parseFloat(i.i(s.formatUnit)(this.min)),parseFloat(i.i(s.formatUnit)(this.max))],this.formElement=t):this.isForm=!1},e.prototype.initCultureFunc=function(){this.internationalization=new s.Internationalization(this.locale)},e.prototype.initCultureInfo=function(){this.tooltipFormatInfo.format=i.i(s.isNullOrUndefined)(this.tooltip.format)?null:this.tooltip.format,this.ticksFormatInfo.format=i.i(s.isNullOrUndefined)(this.ticks.format)?null:this.ticks.format},e.prototype.formatString=function(t,e){var i=null,s=null;if(t||0===t){i=this.formatNumber(t);var n=this.numberOfDecimals(t);s=this.internationalization.getNumberFormat(e)(this.makeRoundNumber(t,n))}return{elementVal:i,formatString:s}},e.prototype.formatNumber=function(t){var e=this.numberOfDecimals(t);return this.internationalization.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(t)},e.prototype.numberOfDecimals=function(t){var e=t.toString().split(".")[1];return e&&e.length?e.length:0},e.prototype.makeRoundNumber=function(t,e){var i=e||0;return Number(t.toFixed(i))},e.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))},e.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)},e.prototype.initialize=function(){i.i(s.addClass)([this.element],u.root),this.setCSSClass()},e.prototype.setElementWidth=function(t){i.i(s.isNullOrUndefined)(t)||("number"==typeof t?this.sliderContainer.style.width=i.i(s.formatUnit)(t):"string"==typeof t&&(this.sliderContainer.style.width=t.match(/px|%|em/)?t:i.i(s.formatUnit)(t)))},e.prototype.setCSSClass=function(t){t&&i.i(s.removeClass)([this.element],t.split(" ")),this.cssClass&&i.i(s.addClass)([this.element],this.cssClass.split(" "))},e.prototype.setEnabled=function(){this.enabled?(i.i(s.removeClass)([this.sliderContainer],[u.sliderDisabled]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.remove(u.sliderDisabled),this.wireEvents()):(i.i(s.addClass)([this.sliderContainer],[u.sliderDisabled]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.add(u.sliderDisabled),this.unwireEvents())},e.prototype.getTheme=function(t){return window.getComputedStyle(t,":after").getPropertyValue("content").replace(/['"]+/g,"")},e.prototype.initRender=function(){this.sliderContainer=this.createElement("div",{className:u.sliderContainer+" "+u.controlWrapper}),this.element.parentNode.insertBefore(this.sliderContainer,this.element),this.sliderContainer.appendChild(this.element),this.sliderTrack=this.createElement("div",{className:u.sliderTrack}),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:i.i(s.isNullOrUndefined)(this.value)?this.min.toString():this.value.toString(),name:this.element.getAttribute("name")||this.element.getAttribute("id")||"_"+(1e3*Math.random()).toFixed(0)+"slider",class:u.sliderHiddenInput}}),this.hiddenInput.tabIndex=-1,this.sliderContainer.appendChild(this.hiddenInput),this.showButtons&&this.setButtons(),this.setEnableRTL(),"Range"===this.type?this.rangeValueUpdate():this.value=i.i(s.isNullOrUndefined)(this.value)?parseFloat(i.i(s.formatUnit)(this.min.toString())):this.value,this.previousVal="Range"!==this.type?this.checkHandleValue(parseFloat(i.i(s.formatUnit)(this.value.toString()))):[this.checkHandleValue(parseFloat(i.i(s.formatUnit)(this.value[0].toString()))),this.checkHandleValue(parseFloat(i.i(s.formatUnit)(this.value[1].toString())))],this.previousChanged=this.previousVal,i.i(s.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?i.i(s.removeClass)([this.sliderContainer],[u.sliderDisabled]):i.i(s.addClass)([this.sliderContainer],[u.sliderDisabled]),this.readonly?i.i(s.addClass)([this.sliderContainer],[u.readonly]):i.i(s.removeClass)([this.sliderContainer],[u.readonly])},e.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.isMaterialTooltip=(this.isMaterial||this.isMaterial3)&&"Range"!==this.type&&this.tooltip.isVisible},e.prototype.createRangeBar=function(){"Default"!==this.type&&(this.rangeBar=this.createElement("div",{attrs:{class:u.rangeBar}}),this.element.appendChild(this.rangeBar),this.drag&&"Range"===this.type&&("Horizontal"===this.orientation?this.rangeBar.classList.add(u.dragHorizontal):this.rangeBar.classList.add(u.dragVertical)))},e.prototype.createLimitBar=function(){var t="Range"!==this.type?u.limitBarDefault:u.limitBarFirst;t+=" "+u.limits,this.limitBarFirst=this.createElement("div",{attrs:{class:t}}),this.element.appendChild(this.limitBarFirst),"Range"===this.type&&(this.limitBarSecond=this.createElement("div",{attrs:{class:u.limitBarSecond+" "+u.limits}}),this.element.appendChild(this.limitBarSecond))},e.prototype.setOrientClass=function(){"Vertical"!==this.orientation?(this.sliderContainer.classList.remove(u.verticalSlider),this.sliderContainer.classList.add(u.horizontalSlider),this.firstHandle.setAttribute("aria-orientation","horizontal"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","horizontal")):(this.sliderContainer.classList.remove(u.horizontalSlider),this.sliderContainer.classList.add(u.verticalSlider),this.firstHandle.setAttribute("aria-orientation","vertical"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","vertical"))},e.prototype.setAriaAttributes=function(t){var e=this,n=this.min,a=this.max;if(!i.i(s.isNullOrUndefined)(this.customValues)&&this.customValues.length>0&&(n=this.customValues[0],a=this.customValues[this.customValues.length-1]),"Range"!==this.type)i.i(s.attributes)(t,{"aria-valuemin":n.toString(),"aria-valuemax":a.toString()});else{(!i.i(s.isNullOrUndefined)(this.customValues)&&this.customValues.length>0?[[n.toString(),this.customValues[this.value[1]].toString()],[this.customValues[this.value[0]].toString(),a.toString()]]:[[n.toString(),this.value[1].toString()],[this.value[0].toString(),a.toString()]]).forEach(function(t,n){var a=0===n?e.firstHandle:e.secondHandle;a&&i.i(s.attributes)(a,{"aria-valuemin":t[0],"aria-valuemax":t[1]})})}},e.prototype.createSecondHandle=function(){this.secondHandle=this.createElement("div",{attrs:{class:u.sliderHandle,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.secondHandle.classList.add(u.sliderSecondHandle),this.element.appendChild(this.secondHandle)},e.prototype.createFirstHandle=function(){this.firstHandle=this.createElement("div",{attrs:{class:u.sliderHandle,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.firstHandle.classList.add(u.sliderFirstHandle),this.element.appendChild(this.firstHandle),this.isMaterialTooltip&&(this.materialHandle=this.createElement("div",{attrs:{class:u.sliderHandle+" "+u.sliderMaterialHandle}}),this.element.appendChild(this.materialHandle))},e.prototype.wireFirstHandleEvt=function(t){t?(s.EventHandler.remove(this.firstHandle,"mousedown touchstart",this.handleFocus),s.EventHandler.remove(this.firstHandle,"transitionend",this.transitionEnd),s.EventHandler.remove(this.firstHandle,"mouseenter touchenter",this.handleOver),s.EventHandler.remove(this.firstHandle,"mouseleave touchend",this.handleLeave)):(s.EventHandler.add(this.firstHandle,"mousedown touchstart",this.handleFocus,this),s.EventHandler.add(this.firstHandle,"transitionend",this.transitionEnd,this),s.EventHandler.add(this.firstHandle,"mouseenter touchenter",this.handleOver,this),s.EventHandler.add(this.firstHandle,"mouseleave touchend",this.handleLeave,this))},e.prototype.wireSecondHandleEvt=function(t){t?(s.EventHandler.remove(this.secondHandle,"mousedown touchstart",this.handleFocus),s.EventHandler.remove(this.secondHandle,"transitionend",this.transitionEnd),s.EventHandler.remove(this.secondHandle,"mouseenter touchenter",this.handleOver),s.EventHandler.remove(this.secondHandle,"mouseleave touchend",this.handleLeave)):(s.EventHandler.add(this.secondHandle,"mousedown touchstart",this.handleFocus,this),s.EventHandler.add(this.secondHandle,"transitionend",this.transitionEnd,this),s.EventHandler.add(this.secondHandle,"mouseenter touchenter",this.handleOver,this),s.EventHandler.add(this.secondHandle,"mouseleave touchend",this.handleLeave,this))},e.prototype.handleStart=function(){"Range"!==this.type&&(this.firstHandle.classList[0===this.handlePos1?"add":"remove"](u.sliderHandleStart),this.isMaterialTooltip&&(this.materialHandle.classList[0===this.handlePos1?"add":"remove"](u.sliderHandleStart),this.tooltipElement&&this.tooltipElement.classList[0===this.handlePos1?"add":"remove"](u.sliderTooltipStart)))},e.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())},e.prototype.handleFocusOut=function(){this.firstHandle.classList.contains(u.sliderHandleFocused)&&this.firstHandle.classList.remove(u.sliderHandleFocused),"Range"===this.type&&this.secondHandle.classList.contains(u.sliderHandleFocused)&&this.secondHandle.classList.remove(u.sliderHandleFocused)},e.prototype.handleFocus=function(t){this.focusSliderElement(),this.sliderBarClick(t),t.currentTarget===this.firstHandle?(this.firstHandle.classList.add(u.sliderHandleFocused),this.firstHandle.classList.add(u.sliderTabHandle)):(this.secondHandle.classList.add(u.sliderHandleFocused),this.secondHandle.classList.add(u.sliderTabHandle)),s.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),s.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},e.prototype.handleOver=function(t){this.tooltip.isVisible&&"Hover"===this.tooltip.showOn&&this.tooltipToggle(t.currentTarget),"Default"===this.type&&this.tooltipToggle(this.getHandle())},e.prototype.handleLeave=function(t){!this.tooltip.isVisible||"Hover"!==this.tooltip.showOn||t.currentTarget.classList.contains(u.sliderHandleFocused)||t.currentTarget.classList.contains(u.sliderTabHandle)||this.closeTooltip()},e.prototype.setHandler=function(){this.createFirstHandle(),"Range"===this.type&&this.createSecondHandle()},e.prototype.setEnableRTL=function(){this.enableRtl&&"Vertical"!==this.orientation?i.i(s.addClass)([this.sliderContainer],u.rtl):i.i(s.removeClass)([this.sliderContainer],u.rtl);var t="Vertical"!==this.orientation?this.horDir:this.verDir;this.enableRtl?(this.horDir="right",this.verDir="bottom"):(this.horDir="left",this.verDir="bottom"),t!==("Vertical"!==this.orientation?this.horDir:this.verDir)&&"Horizontal"===this.orientation&&(i.i(s.setStyleAttribute)(this.firstHandle,{right:"",left:"auto"}),"Range"===this.type&&i.i(s.setStyleAttribute)(this.secondHandle,{top:"",left:"auto"})),this.setBarColor()},e.prototype.tooltipValue=function(){var t,e=this,n={value:this.value,text:""};this.initialTooltip&&(this.initialTooltip=!1,this.setTooltipContent(),n.text=t="function"==typeof this.tooltipObj.content?this.tooltipObj.content():this.tooltipObj.content,this.trigger("tooltipChange",n,function(n){if(e.addTooltipClass(n.text),t!==n.text){e.customAriaText=n.text,e.enableHtmlSanitizer?n.text=s.SanitizeHtmlHelper.sanitize(n.text.toString()):n.text=n.text.toString();var a=function(){return n.text};e.tooltipObj.content=i.i(s.initializeCSPTemplate)(a),e.setAriaAttrValue(e.firstHandle),"Range"===e.type&&e.setAriaAttrValue(e.secondHandle)}}),this.isMaterialTooltip&&this.setPreviousVal("change",this.value))},e.prototype.setTooltipContent=function(){var t;t=this.formatContent(this.tooltipFormatInfo,!1);var e=function(){return t};this.tooltipObj.content=i.i(s.initializeCSPTemplate)(e)},e.prototype.formatContent=function(t,e){var n="",a=this.handleVal1,r=this.handleVal2;return!i.i(s.isNullOrUndefined)(this.customValues)&&this.customValues.length>0&&(a=this.customValues[this.handleVal1],r=this.customValues[this.handleVal2]),e?("Range"===this.type?n=this.enableRtl&&"Vertical"!==this.orientation?i.i(s.isNullOrUndefined)(this.tooltip)||i.i(s.isNullOrUndefined)(this.tooltip.format)?r.toString()+" - "+a.toString():this.formatString(r,t).elementVal+" - "+this.formatString(a,t).elementVal:i.i(s.isNullOrUndefined)(this.tooltip)||i.i(s.isNullOrUndefined)(this.tooltip.format)?a.toString()+" - "+r.toString():this.formatString(a,t).elementVal+" - "+this.formatString(r,t).elementVal:i.i(s.isNullOrUndefined)(a)||(n=i.i(s.isNullOrUndefined)(this.tooltip)||i.i(s.isNullOrUndefined)(this.tooltip.format)?a.toString():this.formatString(a,t).elementVal),n):("Range"===this.type?n=this.enableRtl&&"Vertical"!==this.orientation?i.i(s.isNullOrUndefined)(t.format)?r.toString()+" - "+a.toString():this.formatString(r,t).formatString+" - "+this.formatString(a,t).formatString:i.i(s.isNullOrUndefined)(t.format)?a.toString()+" - "+r.toString():this.formatString(a,t).formatString+" - "+this.formatString(r,t).formatString:i.i(s.isNullOrUndefined)(a)||(n=i.i(s.isNullOrUndefined)(t.format)?a.toString():this.formatString(a,t).formatString),n)},e.prototype.addTooltipClass=function(t){if(this.isMaterialTooltip){var e=t.toString().length;if(this.tooltipElement){var i=e>4?{oldCss:u.sliderMaterialDefault,newCss:u.sliderMaterialRange}:{oldCss:u.sliderMaterialRange,newCss:u.sliderMaterialDefault};this.tooltipElement.classList.remove(i.oldCss),this.tooltipElement.classList.contains(i.newCss)||(this.tooltipElement.classList.add(i.newCss),this.tooltipElement.style.transform=e>4?"scale(1)":this.getTooltipTransformProperties(this.previousTooltipClass).rotate)}else{var i=e>4?u.sliderMaterialRange:u.sliderMaterialDefault;this.tooltipObj.cssClass=u.sliderTooltip+" "+i}}},e.prototype.tooltipPlacement=function(){return"Horizontal"===this.orientation?"Before"===this.tooltip.placement?"TopCenter":"BottomCenter":"Before"===this.tooltip.placement?"LeftCenter":"RightCenter"},e.prototype.tooltipBeforeOpen=function(t){this.tooltipElement=t.element,this.tooltip.cssClass&&i.i(s.addClass)([this.tooltipElement],this.tooltip.cssClass.split(" ").filter(function(t){return t})),t.target.removeAttribute("aria-describedby"),this.isMaterialTooltip&&(this.tooltipElement.firstElementChild.classList.add(u.materialTooltipHide),this.handleStart(),this.setTooltipTransform())},e.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)}}},e.prototype.materialTooltipEventCallBack=function(t){this.sliderBarClick(t),s.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),s.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},e.prototype.wireMaterialTooltipEvent=function(t){this.isMaterialTooltip&&(t?s.EventHandler.remove(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack):s.EventHandler.add(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack,this))},e.prototype.tooltipPositionCalculation=function(t){var e;switch(t){case"TopCenter":e=u.horizontalTooltipBefore;break;case"BottomCenter":e=u.horizontalTooltipAfter;break;case"LeftCenter":e=u.verticalTooltipBefore;break;case"RightCenter":e=u.verticalTooltipAfter}return e},e.prototype.getTooltipTransformProperties=function(t){var e;if(this.tooltipElement){var i="Horizontal"===this.orientation?this.tooltipElement.clientHeight+14-this.tooltipElement.clientHeight/2:this.tooltipElement.clientWidth+14-this.tooltipElement.clientWidth/2;e="Horizontal"===this.orientation?t===u.horizontalTooltipBefore?{rotate:"rotate(45deg)",translate:"translateY("+i+"px)"}:{rotate:"rotate(225deg)",translate:"translateY("+-i+"px)"}:t===u.verticalTooltipBefore?{rotate:"rotate(-45deg)",translate:"translateX("+i+"px)"}:{rotate:"rotate(-225deg)",translate:"translateX("+-i+"px)"}}return e},e.prototype.openMaterialTooltip=function(){var t=this;if(this.isMaterialTooltip){this.refreshTooltip(this.firstHandle);var e=this.tooltipElement.firstElementChild;e.classList.remove(u.materialTooltipHide),e.classList.add(u.materialTooltipShow),this.firstHandle.style.cursor="default",this.tooltipElement.style.transition=this.scaleTransform,this.tooltipElement.classList.add(u.materialTooltipOpen),this.materialHandle.style.transform="scale(0)",e.innerText.length>4?this.tooltipElement.style.transform="scale(1)":this.tooltipElement.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate,"Default"===this.type?setTimeout(function(){t.tooltipElement.style.transition=t.transition.handle},2500):setTimeout(function(){t.tooltipElement.style.transition="none"},2500)}},e.prototype.closeMaterialTooltip=function(){var t=this;if(this.isMaterialTooltip){var e=this.tooltipElement.firstElementChild;this.tooltipElement.style.transition=this.scaleTransform,e.classList.remove(u.materialTooltipShow),e.classList.add(u.materialTooltipHide),this.firstHandle.style.cursor="-webkit-grab",this.firstHandle.style.cursor="grab",this.materialHandle&&(this.materialHandle.style.transform="scale(1)"),this.tooltipElement.classList.remove(u.materialTooltipOpen),this.setTooltipTransform(),this.tooltipTarget=void 0,setTimeout(function(){t.tooltipElement.style.transition="none"},2500)}},e.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(u.materialTooltipOpen)&&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()},e.prototype.setTooltipTransform=function(){var t=this.getTooltipTransformProperties(this.previousTooltipClass);this.tooltipElement.firstElementChild.innerText.length>4?this.tooltipElement.style.transform=t.translate+" scale(0.01)":this.tooltipElement.style.transform=t.translate+" "+t.rotate+" scale(0.01)"},e.prototype.renderTooltip=function(){this.tooltipObj=new n.Tooltip({showTipPointer:this.isBootstrap||this.isMaterial||this.isMaterial3||this.isBootstrap4||this.isTailwind||this.isBootstrap5||this.isFluent,cssClass:u.sliderTooltip,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()},e.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){i.i(s.isNullOrUndefined)(t)||(t.style.transition="none")}),this.isMaterialTooltip&&(this.sliderContainer.classList.add(u.materialSlider),this.tooltipValue(),this.tooltipObj.animation.close.effect="None",this.tooltipObj.open(this.firstHandle))},e.prototype.tooltipBeforeClose=function(){this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0},e.prototype.setButtons=function(){this.firstBtn=this.createElement("div",{className:u.sliderButton+" "+u.firstButton}),this.firstBtn.appendChild(this.createElement("span",{className:u.sliderButtonIcon})),this.isTailwind&&this.firstBtn.querySelector("span").classList.add("e-icons"),this.firstBtn.tabIndex=-1,this.secondBtn=this.createElement("div",{className:u.sliderButton+" "+u.secondButton}),this.secondBtn.appendChild(this.createElement("span",{className:u.sliderButtonIcon})),this.isTailwind&&this.secondBtn.querySelector("span").classList.add("e-icons"),this.secondBtn.tabIndex=-1,this.sliderContainer.classList.add(u.sliderButtonClass),this.sliderContainer.appendChild(this.firstBtn),this.sliderContainer.appendChild(this.secondBtn),this.sliderContainer.appendChild(this.element),this.buttonTitle()},e.prototype.buttonTitle=function(){var t=this.enableRtl&&"Vertical"!==this.orientation;this.l10n.setLocale(this.locale);var e=this.l10n.getConstant("decrementTitle"),n=this.l10n.getConstant("incrementTitle");i.i(s.attributes)(t?this.secondBtn:this.firstBtn,{"aria-label":e,title:e}),i.i(s.attributes)(t?this.firstBtn:this.secondBtn,{"aria-label":n,title:n})},e.prototype.buttonFocusOut=function(){(this.isMaterial||this.isMaterial3)&&this.getHandle().classList.remove("e-large-thumb-size")},e.prototype.repeatButton=function(t){var e,i=this.handleValueUpdate(),s=this.enableRtl&&"Vertical"!==this.orientation;t.target.parentElement.classList.contains(u.firstButton)||t.target.classList.contains(u.firstButton)?e=s?this.add(i,parseFloat(this.step.toString()),!0):this.add(i,parseFloat(this.step.toString()),!1):(t.target.parentElement.classList.contains(u.secondButton)||t.target.classList.contains(u.secondButton))&&(e=s?this.add(i,parseFloat(this.step.toString()),!1):this.add(i,parseFloat(this.step.toString()),!0)),this.limits.enabled&&(e=this.getLimitCorrectedValues(e)),e>=this.min&&e<=this.max&&(this.changeHandleValue(e),this.tooltipToggle(this.getHandle()))},e.prototype.repeatHandlerMouse=function(t){t.preventDefault(),"mousedown"!==t.type&&"touchstart"!==t.type||(this.buttonClick(t),this.repeatInterval=setInterval(this.repeatButton.bind(this),180,t))},e.prototype.materialChange=function(){this.getHandle().classList.contains("e-large-thumb-size")||this.getHandle().classList.add("e-large-thumb-size")},e.prototype.focusHandle=function(){this.getHandle().classList.contains(u.sliderTabHandle)||this.getHandle().classList.add(u.sliderTabHandle)},e.prototype.repeatHandlerUp=function(t){this.changeEvent("changed",t),this.closeTooltip(),clearInterval(this.repeatInterval),this.getHandle().focus()},e.prototype.customTickCounter=function(t){var e=4;return!i.i(s.isNullOrUndefined)(this.customValues)&&this.customValues.length>0&&(t>4&&(e=3),t>7&&(e=2),t>14&&(e=1),t>28&&(e=0)),e},e.prototype.renderScale=function(){var t="Vertical"===this.orientation?"v":"h";this.noOfDecimals=this.numberOfDecimals(this.step),this.ul=this.createElement("ul",{className:u.scale+" e-"+t+"-scale "+u.tick+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation",tabIndex:"-1","aria-hidden":"true"}}),this.ul.style.zIndex="-1",s.Browser.isAndroid&&"h"===t&&this.ul.classList.add(u.sliderTickPosition);var e=this.ticks.smallStep;this.ticks.showSmallTicks?e<=0&&(e=parseFloat(i.i(s.formatUnit)(this.step))):e=this.ticks.largeStep>0?this.ticks.largeStep:parseFloat(i.i(s.formatUnit)(this.max))-parseFloat(i.i(s.formatUnit)(this.min));var n=this.fractionalToInteger(this.min),a=this.fractionalToInteger(this.max),r=this.fractionalToInteger(e),l=!i.i(s.isNullOrUndefined)(this.customValues)&&this.customValues.length>0&&this.customValues.length-1,o=this.customTickCounter(l),h=!i.i(s.isNullOrUndefined)(this.customValues)&&this.customValues.length>0?l*o+l:Math.abs((a-n)/r);this.element.appendChild(this.ul);var d,c=parseFloat(this.min.toString());"v"===t&&(c=parseFloat(this.max.toString()));var p,m=0,f=100/h;f===1/0&&(f=5);for(var v=0,g=!i.i(s.isNullOrUndefined)(this.customValues)&&this.customValues.length>0?this.customValues.length-1:0,y=0;v<=h;v++){if(d=this.createElement("li",{attrs:{class:u.tick,role:"presentation",tabIndex:"-1","aria-hidden":"true"}}),!i.i(s.isNullOrUndefined)(this.customValues)&&this.customValues.length>0)(p=v%(o+1)==0)&&("h"===t?(c=this.customValues[y],y++):(c=this.customValues[g],g--),d.setAttribute("title",c.toString()));else if(d.setAttribute("title",c.toString()),0===this.numberOfDecimals(this.max)&&0===this.numberOfDecimals(this.min)&&0===this.numberOfDecimals(this.step))p="h"===t?(c-parseFloat(this.min.toString()))%this.ticks.largeStep==0:Math.abs(c-parseFloat(this.max.toString()))%this.ticks.largeStep==0;else{var b=this.fractionalToInteger(this.ticks.largeStep),C=this.fractionalToInteger(c);p="h"===t?(C-n)%b==0:Math.abs(C-parseFloat(a.toString()))%b==0}p&&d.classList.add(u.large),"h"===t?d.style.width=f+"%":d.style.height=f+"%";var E=p?"Both"===this.ticks.placement?2:1:0;if(p)for(var x=0;x<E;x++)this.createTick(d,c,f);else i.i(s.isNullOrUndefined)(this.customValues)&&this.formatTicksValue(d,c);this.ul.appendChild(d),this.tickElementCollection.push(d);var S=void 0;i.i(s.isNullOrUndefined)(this.customValues)&&(S=this.numberOfDecimals(e)>this.numberOfDecimals(c)?this.numberOfDecimals(e):this.numberOfDecimals(c),c="h"===t?this.makeRoundNumber(c+e,S):this.min>this.max?this.makeRoundNumber(c+e,S):this.makeRoundNumber(c-e,S),m=this.makeRoundNumber(m+e,S))}this.ticksAlignment(t,f)},e.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(u.sliderFirstTick),this.lastChild.classList.add(u.sliderLastTick),this.sliderContainer.classList.add(u.scale+"-"+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+"%");var s={ticksWrapper:this.ul,tickElements:this.tickElementCollection};i&&this.trigger("renderedTicks",s),this.scaleAlignment()},e.prototype.createTick=function(t,e,n){var a=this.createElement("span",{className:u.tickValue+" "+u.tick+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation",tabIndex:"-1","aria-hidden":"true"}});t.appendChild(a),i.i(s.isNullOrUndefined)(this.customValues)?this.formatTicksValue(t,e,a,n):this.enableHtmlSanitizer?a.innerHTML=s.SanitizeHtmlHelper.sanitize(e.toString()):a.innerHTML=e.toString()},e.prototype.formatTicksValue=function(t,e,n,a){var r=this,l=this.formatNumber(e),o=i.i(s.isNullOrUndefined)(this.ticks)||i.i(s.isNullOrUndefined)(this.ticks.format)?l:this.formatString(e,this.ticksFormatInfo).formatString,h={value:e,text:o,tickElement:t};this.trigger("renderingTicks",h,function(e){t.setAttribute("title",e.text.toString()),n&&(r.enableHtmlSanitizer?n.innerHTML=s.SanitizeHtmlHelper.sanitize(e.text.toString()):n.innerHTML=e.text.toString())})},e.prototype.scaleAlignment=function(){this.tickValuePosition();this.orientation;"Vertical"===this.orientation?this.element.getBoundingClientRect().width<=15?this.sliderContainer.classList.add(u.sliderSmallSize):this.sliderContainer.classList.remove(u.sliderSmallSize):this.element.getBoundingClientRect().height<=15?this.sliderContainer.classList.add(u.sliderSmallSize):this.sliderContainer.classList.remove(u.sliderSmallSize)},e.prototype.tickValuePosition=function(){this.firstChild=this.element.querySelector("ul").children[0];var t,e,n=this.firstChild.getBoundingClientRect(),a=this.ticks.smallStep,r=Math.abs(parseFloat(i.i(s.formatUnit)(this.max))-parseFloat(i.i(s.formatUnit)(this.min)))/a;this.firstChild.children.length>0&&(t=this.firstChild.children[0].getBoundingClientRect());var l,o=[this.sliderContainer.querySelectorAll("."+u.tick+"."+u.large+" ."+u.tickValue)];l="Both"===this.ticks.placement?[].slice.call(o[0],2):[].slice.call(o[0],1);for(var h="Vertical"===this.orientation?2*n.height:2*n.width,d=0;d<this.firstChild.children.length;d++)"Vertical"===this.orientation?this.firstChild.children[d].style.top=-t.height/2+"px":this.enableRtl?this.firstChild.children[d].style.left=(h-this.firstChild.children[d].getBoundingClientRect().width)/2+"px":this.firstChild.children[d].style.left=-t.width/2+"px";for(var d=0;d<l.length;d++)e=l[d].getBoundingClientRect(),"Vertical"===this.orientation?i.i(s.setStyleAttribute)(l[d],{top:(h-e.height)/2+"px"}):i.i(s.setStyleAttribute)(l[d],{left:(h-e.width)/2+"px"});this.enableRtl&&this.lastChild.children.length&&0!==r&&(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===r&&("Horizontal"===this.orientation&&(this.enableRtl?(this.firstChild.classList.remove(u.sliderLastTick),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(u.sliderLastTick),this.firstChild.style.left=this.firstHandle.style.left)),"Vertical"===this.orientation&&this.firstChild.classList.remove(u.sliderLastTick))},e.prototype.setAriaAttrValue=function(t){var e,n=!i.i(s.isNullOrUndefined)(this.ticks)&&!i.i(s.isNullOrUndefined)(this.ticks.format),a=n?this.formatContent(this.tooltipFormatInfo,!1):this.formatContent(this.ticksFormatInfo,!1),r=n?this.formatContent(this.ticksFormatInfo,!0):this.formatContent(this.tooltipFormatInfo,!0);a=this.customAriaText?this.customAriaText:a,e=2===a.split(" - ").length?a.split(" - "):[a,a],this.setAriaAttributes(t),"Range"!==this.type?i.i(s.attributes)(t,{"aria-valuenow":r,"aria-valuetext":a}):this.enableRtl?t===this.firstHandle?i.i(s.attributes)(t,{"aria-valuenow":r.split(" - ")[1],"aria-valuetext":e[1]}):i.i(s.attributes)(t,{"aria-valuenow":r.split(" - ")[0],"aria-valuetext":e[0]}):t===this.firstHandle?i.i(s.attributes)(t,{"aria-valuenow":r.split(" - ")[0],"aria-valuetext":e[0]}):i.i(s.attributes)(t,{"aria-valuenow":r.split(" - ")[1],"aria-valuetext":e[1]})},e.prototype.handleValueUpdate=function(){return"Range"===this.type?1===this.activeHandle?this.handleVal1:this.handleVal2:this.handleVal1},e.prototype.getLimitCorrectedValues=function(t){return t="MinRange"===this.type||"Default"===this.type?this.getLimitValueAndPosition(t,this.limits.minStart,this.limits.minEnd)[0]:1===this.activeHandle?this.getLimitValueAndPosition(t,this.limits.minStart,this.limits.minEnd)[0]:this.getLimitValueAndPosition(t,this.limits.maxStart,this.limits.maxEnd)[0]},e.prototype.focusSliderElement=function(){this.isElementFocused||(this.element.focus(),this.isElementFocused=!0)},e.prototype.buttonClick=function(t){this.focusSliderElement();var e,i=this.enableRtl&&"Vertical"!==this.orientation,n=this.handleValueUpdate();40===t.keyCode||37===t.keyCode||t.currentTarget.classList.contains(u.firstButton)?e=i?this.add(n,parseFloat(this.step.toString()),!0):this.add(n,parseFloat(this.step.toString()),!1):38===t.keyCode||39===t.keyCode||t.currentTarget.classList.contains(u.secondButton)?e=i?this.add(n,parseFloat(this.step.toString()),!1):this.add(n,parseFloat(this.step.toString()),!0):33===t.keyCode||t.currentTarget.classList.contains(u.firstButton)?e=i?this.add(n,parseFloat(this.ticks.largeStep.toString()),!1):this.add(n,parseFloat(this.ticks.largeStep.toString()),!0):34===t.keyCode||t.currentTarget.classList.contains(u.secondButton)?e=i?this.add(n,parseFloat(this.ticks.largeStep.toString()),!0):this.add(n,parseFloat(this.ticks.largeStep.toString()),!1):36===t.keyCode?e=parseFloat(this.min<this.max?this.min.toString():this.max.toString()):35===t.keyCode&&(e=parseFloat(this.min<this.max?this.max.toString():this.min.toString())),this.limits.enabled&&(e=this.getLimitCorrectedValues(e)),this.changeHandleValue(e),!this.isMaterial&&!this.isMaterial3||this.tooltip.isVisible||this.getHandle().classList.contains(u.sliderTabHandle)||this.materialChange(),this.tooltipToggle(this.getHandle()),this.getHandle().focus(),this.focusHandle(),t.currentTarget.classList.contains(u.firstButton)&&s.EventHandler.add(this.firstBtn,"mouseup touchend",this.buttonUp,this),t.currentTarget.classList.contains(u.secondButton)&&s.EventHandler.add(this.secondBtn,"mouseup touchend",this.buttonUp,this)},e.prototype.tooltipToggle=function(t){this.isMaterialTooltip?this.tooltipElement.classList.contains(u.materialTooltipOpen)?this.refreshTooltip(this.firstHandle):this.openMaterialTooltip():this.tooltipElement?this.refreshTooltip(t):this.openTooltip(t)},e.prototype.buttonUp=function(t){t.currentTarget.classList.contains(u.firstButton)&&s.EventHandler.remove(this.firstBtn,"mouseup touchend",this.buttonUp),t.currentTarget.classList.contains(u.secondButton)&&s.EventHandler.remove(this.secondBtn,"mouseup touchend",this.buttonUp)},e.prototype.setRangeBar=function(){"Horizontal"===this.orientation?"MinRange"===this.type?(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",i.i(s.setStyleAttribute)(this.rangeBar,{width:i.i(s.isNullOrUndefined)(this.handlePos1)?0:this.handlePos1+"px"})):(this.enableRtl?this.rangeBar.style.right=this.handlePos1+"px":this.rangeBar.style.left=this.handlePos1+"px",i.i(s.setStyleAttribute)(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"})):"MinRange"===this.type?(this.rangeBar.style.bottom=this.min>this.max?this.handlePos1+"px":"0px",i.i(s.setStyleAttribute)(this.rangeBar,{height:i.i(s.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",i.i(s.setStyleAttribute)(this.rangeBar,{height:this.min>this.max?this.handlePos1-this.handlePos2+"px":this.handlePos2-this.handlePos1+"px"}))},e.prototype.checkValidValueAndPos=function(t){return t=this.checkHandleValue(t),t=this.checkHandlePosition(t)},e.prototype.setLimitBarPositions=function(t,e,i,s){"Horizontal"===this.orientation?this.enableRtl?(this.limitBarFirst.style.right=t+"px",this.limitBarFirst.style.width=e-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.width=s-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"))},e.prototype.setLimitBar=function(){if("Default"===this.type||"MinRange"===this.type){var t=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0];t=this.checkValidValueAndPos(t);var e=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0];e=this.checkValidValueAndPos(e),this.setLimitBarPositions(t,e)}else if("Range"===this.type){var i=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0];i=this.checkValidValueAndPos(i);var s=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0];s=this.checkValidValueAndPos(s);var n=this.getLimitValueAndPosition(this.limits.maxStart,this.limits.maxStart,this.limits.maxEnd,!0)[0];n=this.checkValidValueAndPos(n);var a=this.getLimitValueAndPosition(this.limits.maxEnd,this.limits.maxStart,this.limits.maxEnd,!0)[0];a=this.checkValidValueAndPos(a),this.setLimitBarPositions(i,s,n,a)}},e.prototype.getLimitValueAndPosition=function(t,e,n,a){return i.i(s.isNullOrUndefined)(e)&&(e=this.min<this.max?this.min:this.max,i.i(s.isNullOrUndefined)(t)&&a&&(t=e)),i.i(s.isNullOrUndefined)(n)&&(n=this.min<this.max?this.max:this.min,i.i(s.isNullOrUndefined)(t)&&a&&(t=n)),t<e&&(t=e),t>n&&(t=n),[t,this.checkHandlePosition(t)]},e.prototype.setValue=function(){if(!i.i(s.isNullOrUndefined)(this.customValues)&&this.customValues.length>0&&(this.min=0,this.max=this.customValues.length-1,this.setBarColor()),this.setAriaAttributes(this.firstHandle),this.handleVal1=i.i(s.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,i.i(s.isNullOrUndefined)(this.activeHandle)?"Range"===this.type?this.activeHandle=2:this.activeHandle=1:this.activeHandle=this.activeHandle,"Default"===this.type||"MinRange"===this.type){if(this.limits.enabled){var 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)}else this.validateRangeValue();"Default"!==this.type&&this.setRangeBar(),this.limits.enabled&&this.setLimitBar()},e.prototype.rangeValueUpdate=function(){null!==this.value&&"object"==typeof this.value||(this.value=[parseFloat(i.i(s.formatUnit)(this.min)),parseFloat(i.i(s.formatUnit)(this.max))])},e.prototype.validateRangeValue=function(){this.rangeValueUpdate(),this.setRangeValue()},e.prototype.modifyZindex=function(){"Range"===this.type?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+""):this.isMaterialTooltip&&this.tooltipElement&&(this.tooltipElement.style.zIndex=i.i(n.getZindexPartial)(this.element)+"")},e.prototype.setHandlePosition=function(t){var e,i=this,s=1===this.activeHandle?this.handlePos1:this.handlePos2;e=this.isMaterialTooltip?[this.firstHandle,this.materialHandle]:[this.getHandle()],this.handleStart(),e.forEach(function(t){"Horizontal"===i.orientation?i.enableRtl?t.style.right=s+"px":t.style.left=s+"px":t.style.bottom=s+"px"}),this.changeEvent("change",t)},e.prototype.getHandle=function(){return 1===this.activeHandle?this.firstHandle:this.secondHandle},e.prototype.setRangeValue=function(){this.updateRangeValue(),this.activeHandle=1,this.setHandlePosition(null),this.activeHandle=2,this.setHandlePosition(null),this.activeHandle=1},e.prototype.changeEvent=function(t,e){var i="change"===t?this.previousVal:this.previousChanged;if("Range"!==this.type)this.setProperties({value:this.handleVal1},!0),i===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);else{var s=this.value=[this.handleVal1,this.handleVal2];this.setProperties({value:s},!0),(i.length===this.value.length&&this.value[0]!==i[0]||this.value[1]!==i[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()},e.prototype.changeEventArgs=function(t,e){var n;return this.tooltip.isVisible&&this.tooltipObj&&this.initialTooltip?(this.tooltipValue(),n={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:!i.i(s.isNullOrUndefined)(e)}):n={value:this.value,previousValue:"change"===t?this.previousVal:this.previousChanged,action:t,text:i.i(s.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:!i.i(s.isNullOrUndefined)(e)},n},e.prototype.setPreviousVal=function(t,e){"change"===t?this.previousVal=e:this.previousChanged=e},e.prototype.updateRangeValue=function(){var t=this.value.toString().split(",").map(Number);if(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;var e=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd);this.handleVal1=e[0],this.handlePos1=e[1],this.preHandlePos1=this.handlePos1,this.activeHandle=2,e=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=e[0],this.handlePos2=e[1],this.preHandlePos2=this.handlePos2}},e.prototype.checkHandlePosition=function(t){var e;return t=100*(t-parseFloat(i.i(s.formatUnit)(this.min)))/(parseFloat(i.i(s.formatUnit)(this.max))-parseFloat(i.i(s.formatUnit)(this.min))),e="Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(t/100):this.element.getBoundingClientRect().height*(t/100),parseFloat(i.i(s.formatUnit)(this.max))===parseFloat(i.i(s.formatUnit)(this.min))&&(e="Horizontal"===this.orientation?this.element.getBoundingClientRect().width:this.element.getBoundingClientRect().height),e},e.prototype.checkHandleValue=function(t){if(this.min===this.max)return parseFloat(i.i(s.formatUnit)(this.max));var e=this.tempStartEnd();return t<e.start?t=e.start:t>e.end&&(t=e.end),t},e.prototype.reposition=function(){var t=this;this.firstHandle.style.transition="none","Default"!==this.type&&(this.rangeBar.style.transition="none"),"Range"===this.type&&(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&&(this.enableRtl?this.materialHandle.style.right=this.handlePos1+"px":this.materialHandle.style.left=this.handlePos1+"px"),"MinRange"===this.type?(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",i.i(s.setStyleAttribute)(this.rangeBar,{width:i.i(s.isNullOrUndefined)(this.handlePos1)?0:this.handlePos1+"px"})):"Range"===this.type&&(this.enableRtl?this.secondHandle.style.right=this.handlePos2+"px":this.secondHandle.style.left=this.handlePos2+"px",this.enableRtl?this.rangeBar.style.right=this.handlePos1+"px":this.rangeBar.style.left=this.handlePos1+"px",i.i(s.setStyleAttribute)(this.rangeBar,{width:this.handlePos2-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",i.i(s.setStyleAttribute)(this.rangeBar,{height:i.i(s.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",i.i(s.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(){t.firstHandle.style.transition=t.scaleTransform,"Range"===t.type&&(t.secondHandle.style.transition=t.scaleTransform)}),this.refreshTooltip(this.tooltipTarget),this.setBarColor()},e.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.modifyZindex()):(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))},e.prototype.tempStartEnd=function(){return this.min>this.max?{start:this.max,end:this.min}:{start:this.min,end:this.max}},e.prototype.xyToPosition=function(t){if(this.min===this.max)return 100;if("Horizontal"===this.orientation){var e=t.x-this.element.getBoundingClientRect().left,i=this.element.offsetWidth/100;this.val=e/i}else{var s=t.y-this.element.getBoundingClientRect().top,i=this.element.offsetHeight/100;this.val=100-s/i}var n=this.stepValueCalculation(this.val);return n<0?n=0:n>100&&(n=100),this.enableRtl&&"Vertical"!==this.orientation&&(n=100-n),"Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(n/100):this.element.getBoundingClientRect().height*(n/100)},e.prototype.stepValueCalculation=function(t){0===this.step&&(this.step=1);var e=parseFloat(i.i(s.formatUnit)(this.step))/((parseFloat(i.i(s.formatUnit)(this.max))-parseFloat(i.i(s.formatUnit)(this.min)))/100),n=t%Math.abs(e);return 0!==n&&(e/2>n?t-=n:t+=Math.abs(e)-n),t},e.prototype.add=function(t,e,i){var s=Math.pow(10,3);return i?(Math.round(t*s)+Math.round(e*s))/s:(Math.round(t*s)-Math.round(e*s))/s},e.prototype.positionToValue=function(t){var e,n=parseFloat(i.i(s.formatUnit)(this.max))-parseFloat(i.i(s.formatUnit)(this.min));return e="Horizontal"===this.orientation?t/this.element.getBoundingClientRect().width*n:t/this.element.getBoundingClientRect().height*n,this.add(e,parseFloat(this.min.toString()),!0)},e.prototype.sliderBarClick=function(t){t.preventDefault();var e;"mousedown"===t.type||"mouseup"===t.type||"click"===t.type?e={x:t.clientX,y:t.clientY}:"touchend"!==t.type&&"touchstart"!==t.type||(e={x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY});var i=this.xyToPosition(e),s=this.positionToValue(i);if("Range"===this.type&&(this.min<this.max&&this.handlePos2-i<i-this.handlePos1||this.min>this.max&&this.handlePos1-i>i-this.handlePos2)){if(this.activeHandle=2,!this.limits.enabled||!this.limits.endHandleFixed){if(this.limits.enabled){var n=this.getLimitValueAndPosition(s,this.limits.maxStart,this.limits.maxEnd);s=n[0],i=n[1]}this.secondHandle.classList.add(u.sliderActiveHandle),this.handlePos2=this.preHandlePos2=i,this.handleVal2=s}this.modifyZindex(),this.secondHandle.focus()}else{if(this.activeHandle=1,!this.limits.enabled||!this.limits.startHandleFixed){if(this.limits.enabled){var n=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd);s=n[0],i=n[1]}this.firstHandle.classList.add(u.sliderActiveHandle),this.handlePos1=this.preHandlePos1=i,this.handleVal1=s}this.modifyZindex(),this.firstHandle.focus()}this.isMaterialTooltip&&this.tooltipElement.classList.add(u.materialTooltipActive);var a=this.element.querySelector("."+u.sliderTabHandle);a&&this.getHandle()!==a&&a.classList.remove(u.sliderTabHandle);var r,l=1===this.activeHandle?this.firstHandle:this.secondHandle;if(("click"===t.type||"mousedown"===t.type)&&t.target===l){var o=t.clientX,h=t.clientY;r=document.elementFromPoint(o,h)}if(t.target===l&&r!=l)return!this.isMaterial&&!this.isMaterial3||this.tooltip.isVisible||this.getHandle().classList.contains(u.sliderTabHandle)||this.materialChange(),this.sliderBarUp(t),void this.tooltipToggle(this.getHandle());if(this.checkRepeatedValue(s)){var d=(this.isMaterial||this.isMaterial3)&&this.tooltip.isVisible?this.transitionOnMaterialTooltip:this.transition;this.getHandle().style.transition=d.handle,"Default"!==this.type&&(this.rangeBar.style.transition=d.rangeBar),this.setHandlePosition(t),this.isMaterialTooltip&&(this.initialTooltip=!1),this.changeEvent("changed",t),"Default"!==this.type&&this.setRangeBar()}},e.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)},e.prototype.dragRangeBarMove=function(t){var e,i;"touchmove"!==t.type&&t.preventDefault(),this.rangeBarDragged=!0;var s;this.rangeBar.style.transition="none",this.firstHandle.style.transition="none",this.secondHandle.style.transition="none";var n,a;if("mousemove"===t.type?(e=[t.clientX,t.clientY],n=e[0],a=e[1]):(i=[t.changedTouches[0].clientX,t.changedTouches[0].clientY],n=i[0],a=i[1]),!(this.limits.enabled&&this.limits.startHandleFixed||this.limits.enabled&&this.limits.endHandleFixed)){if(s=this.enableRtl?{x:n+this.secondPartRemain,y:a+this.secondPartRemain}:{x:n-this.firstPartRemain,y:a+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:n-this.firstPartRemain,y:a-this.firstPartRemain}:{x:n+this.secondPartRemain,y:a-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){var r=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd);this.handleVal1=r[0],this.handlePos1=r[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),r=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=r[0],this.handlePos2=r[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()},e.prototype.sliderBarUp=function(t){this.changeEvent("changed",t),this.handleFocusOut(),this.firstHandle.classList.remove(u.sliderActiveHandle),"Range"===this.type&&(this.initialTooltip=!1,this.secondHandle.classList.remove(u.sliderActiveHandle)),this.closeTooltip(),(this.isMaterial||this.isMaterial3)&&(this.getHandle().classList.remove("e-large-thumb-size"),this.isMaterialTooltip&&this.tooltipElement.classList.remove(u.materialTooltipActive)),s.EventHandler.remove(document,"mousemove touchmove",this.sliderBarMove),s.EventHandler.remove(document,"mouseup touchend",this.sliderBarUp)},e.prototype.sliderBarMove=function(t){"touchmove"!==t.type&&t.preventDefault();var e;e="mousemove"===t.type?{x:t.clientX,y:t.clientY}:{x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY};var i=this.xyToPosition(e),s=this.positionToValue(i);if(i=Math.round(i),"Range"!==this.type&&1===this.activeHandle){if(!this.limits.enabled||!this.limits.startHandleFixed){if(this.limits.enabled){var n=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd);i=n[1],s=n[0]}this.handlePos1=i,this.handleVal1=s}this.firstHandle.classList.add(u.sliderActiveHandle)}if("Range"===this.type)if(1===this.activeHandle){if(this.firstHandle.classList.add(u.sliderActiveHandle),!(this.limits.enabled&&this.limits.startHandleFixed||((this.min<this.max&&i>this.handlePos2||this.min>this.max&&i<this.handlePos2)&&(i=this.handlePos2,s=this.handleVal2),i===this.preHandlePos1))){if(this.limits.enabled){var a=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd);s=a[0],i=a[1]}this.handlePos1=this.preHandlePos1=i,this.handleVal1=s,this.activeHandle=1}}else if(2===this.activeHandle&&(this.secondHandle.classList.add(u.sliderActiveHandle),!(this.limits.enabled&&this.limits.endHandleFixed||((this.min<this.max&&i<this.handlePos1||this.min>this.max&&i>this.handlePos1)&&(i=this.handlePos1,s=this.handleVal1),i===this.preHandlePos2)))){if(this.limits.enabled){var a=this.getLimitValueAndPosition(s,this.limits.maxStart,this.limits.maxEnd);s=a[0],i=a[1]}this.handlePos2=this.preHandlePos2=i,this.handleVal2=s,this.activeHandle=2}this.checkRepeatedValue(s)&&(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(u.sliderTabHandle)||this.materialChange(),this.tooltipToggle(this.getHandle()),"Default"!==this.type&&this.setRangeBar())},e.prototype.dragRangeBarUp=function(t){this.rangeBarDragged?this.isDragComplete=!0:(this.focusSliderElement(),this.sliderBarClick(t)),this.changeEvent("changed",t),this.closeTooltip(),s.EventHandler.remove(document,"mousemove touchmove",this.dragRangeBarMove),s.EventHandler.remove(document,"mouseup touchend",this.dragRangeBarUp),this.rangeBarDragged=!1},e.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},e.prototype.refreshTooltip=function(t){this.tooltip.isVisible&&this.tooltipObj&&(this.tooltipValue(),t&&(this.tooltipObj.refresh(t),this.tooltipTarget=t))},e.prototype.openTooltip=function(t){this.tooltip.isVisible&&this.tooltipObj&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.open(t),this.tooltipTarget=t)},e.prototype.closeTooltip=function(){this.tooltip.isVisible&&this.tooltipObj&&"Always"!==this.tooltip.showOn&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.close(),this.tooltipTarget=void 0)},e.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)}},e.prototype.wireButtonEvt=function(t){t?(s.EventHandler.remove(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut),s.EventHandler.remove(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut),s.EventHandler.remove(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse),s.EventHandler.remove(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),s.EventHandler.remove(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse),s.EventHandler.remove(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),s.EventHandler.remove(this.firstBtn,"focusout",this.sliderFocusOut),s.EventHandler.remove(this.secondBtn,"focusout",this.sliderFocusOut)):(s.EventHandler.add(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut,this),s.EventHandler.add(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut,this),s.EventHandler.add(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse,this),s.EventHandler.add(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),s.EventHandler.add(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse,this),s.EventHandler.add(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),s.EventHandler.add(this.firstBtn,"focusout",this.sliderFocusOut,this),s.EventHandler.add(this.secondBtn,"focusout",this.sliderFocusOut,this))},e.prototype.rangeBarMousedown=function(t){var e,i;if(t.preventDefault(),this.focusSliderElement(),"Range"===this.type&&this.drag&&t.target===this.rangeBar){var n=void 0,a=void 0;"mousedown"===t.type?(e=[t.clientX,t.clientY],n=e[0],a=e[1]):"touchstart"===t.type&&(i=[t.changedTouches[0].clientX,t.changedTouches[0].clientY],n=i[0],a=i[1]),"Horizontal"===this.orientation?(this.firstPartRemain=n-this.rangeBar.getBoundingClientRect().left,this.secondPartRemain=this.rangeBar.getBoundingClientRect().right-n):(this.firstPartRemain=a-this.rangeBar.getBoundingClientRect().top,this.secondPartRemain=this.rangeBar.getBoundingClientRect().bottom-a),this.minDiff=this.handleVal2-this.handleVal1,this.tooltipToggle(this.rangeBar);var r=this.element.querySelector("."+u.sliderTabHandle);r&&r.classList.remove(u.sliderTabHandle),s.EventHandler.add(document,"mousemove touchmove",this.dragRangeBarMove,this),s.EventHandler.add(document,"mouseup touchend",this.dragRangeBarUp,this)}},e.prototype.elementClick=function(t){if(this.isDragComplete)return void(this.isDragComplete=!1);t.preventDefault(),this.focusSliderElement(),this.sliderBarClick(t),this.focusHandle()},e.prototype.wireEvents=function(){this.onresize=this.reposition.bind(this),window.addEventListener("resize",this.onresize),this.enabled&&!this.readonly&&(s.EventHandler.add(this.element,"click",this.elementClick,this),"Range"===this.type&&this.drag&&s.EventHandler.add(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown,this),s.EventHandler.add(this.sliderContainer,"keydown",this.keyDown,this),s.EventHandler.add(this.sliderContainer,"keyup",this.keyUp,this),s.EventHandler.add(this.element,"focusout",this.sliderFocusOut,this),s.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&&s.EventHandler.add(this.formElement,"reset",this.formResetHandler,this))},e.prototype.unwireEvents=function(){s.EventHandler.remove(this.element,"click",this.elementClick),"Range"===this.type&&this.drag&&s.EventHandler.remove(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown),s.EventHandler.remove(this.sliderContainer,"keydown",this.keyDown),s.EventHandler.remove(this.sliderContainer,"keyup",this.keyUp),s.EventHandler.remove(this.element,"focusout",this.sliderFocusOut),s.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),s.EventHandler.remove(this.element,"reset",this.formResetHandler)},e.prototype.formResetHandler=function(){this.setProperties({value:this.formResetValue},!0),this.setValue()},e.prototype.keyUp=function(t){if(9===t.keyCode&&t.target.classList.contains(u.sliderHandle)&&(this.focusSliderElement(),!t.target.classList.contains(u.sliderTabHandle))){this.element.querySelector("."+u.sliderTabHandle)&&this.element.querySelector("."+u.sliderTabHandle).classList.remove(u.sliderTabHandle),t.target.classList.add(u.sliderTabHandle);var e=t.target.parentElement;e===this.element&&(e.querySelector("."+u.sliderTrack).classList.add(u.sliderTabTrack),"Range"!==this.type&&"MinRange"!==this.type||e.querySelector("."+u.rangeBar).classList.add(u.sliderTabRange)),"Range"===this.type&&(t.target.previousSibling.classList.contains(u.sliderHandle)?this.activeHandle=2:this.activeHandle=1),this.getHandle().focus(),this.tooltipToggle(this.getHandle())}this.closeTooltip(),this.changeEvent("changed",t)},e.prototype.hover=function(t){if(!i.i(s.isNullOrUndefined)(t))if("mouseover"===t.type||"touchmove"===t.type||"mousemove"===t.type||"pointermove"===t.type||"touchstart"===t.type)this.sliderContainer.classList.add(u.sliderHover);else{this.sliderContainer.classList.remove(u.sliderHover);var e=t.currentTarget;this.tooltip.isVisible&&"Always"!==this.tooltip.showOn&&this.tooltipObj&&this.isMaterialTooltip&&!e.classList.contains(u.sliderHandleFocused)&&!e.classList.contains(u.sliderTabHandle)&&this.closeMaterialTooltip()}},e.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("."+u.sliderTabHandle)&&this.element.querySelector("."+u.sliderTabHandle).classList.remove(u.sliderTabHandle),this.element.querySelector("."+u.sliderTabTrack)&&(this.element.querySelector("."+u.sliderTabTrack).classList.remove(u.sliderTabTrack),"Range"!==this.type&&"MinRange"!==this.type||!this.element.querySelector("."+u.sliderTabRange)||this.element.querySelector("."+u.sliderTabRange).classList.remove(u.sliderTabRange)),this.hiddenInput.focus(),this.hiddenInput.blur(),this.isElementFocused=!1)},e.prototype.removeElement=function(t){t.parentNode&&t.parentNode.removeChild(t)},e.prototype.changeSliderType=function(t,e){this.isMaterialTooltip&&this.materialHandle&&(this.sliderContainer.classList.remove(u.materialSlider),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&&!i.i(s.isNullOrUndefined)(this.tooltipObj)&&(this.tooltipObj.destroy(),this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0),this.limits.enabled&&("MinRange"===t||"Default"===t?i.i(s.isNullOrUndefined)(this.limitBarFirst)||(this.removeElement(this.limitBarFirst),this.limitBarFirst=void 0):i.i(s.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(!1),"Range"===this.type&&this.wireSecondHandleEvt(!1),this.setValue(),this.tooltip.isVisible&&(this.renderTooltip(),this.wireMaterialTooltipEvent(!1)),this.setBarColor(),"tooltip"!==e&&this.updateConfig()},e.prototype.changeRtl=function(){if(this.enableRtl||"Range"!==this.type||(this.value=[this.handleVal2,this.handleVal1]),this.updateConfig(),this.tooltip.isVisible&&this.tooltipObj.refresh(this.firstHandle),this.showButtons){var t=this.enableRtl&&"Vertical"!==this.orientation;i.i(s.attributes)(t?this.secondBtn:this.firstBtn,{"aria-label":"Decrease",title:"Decrease"}),i.i(s.attributes)(t?this.firstBtn:this.secondBtn,{"aria-label":"Increase",title:"Increase"})}},e.prototype.changeOrientation=function(){this.changeSliderType(this.type,"null")},e.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()},e.prototype.limitsPropertyChange=function(){this.limits.enabled?(i.i(s.isNullOrUndefined)(this.limitBarFirst)&&"Range"!==this.type&&this.createLimitBar(),i.i(s.isNullOrUndefined)(this.limitBarFirst)&&i.i(s.isNullOrUndefined)(this.limitBarSecond)&&"Range"===this.type&&this.createLimitBar(),this.setLimitBar(),this.setValue()):(i.i(s.isNullOrUndefined)(this.limitBarFirst)||i.i(s.detach)(this.limitBarFirst),i.i(s.isNullOrUndefined)(this.limitBarSecond)||i.i(s.detach)(this.limitBarSecond))},e.prototype.getPersistData=function(){var t=["value"];return this.addOnPersist(t)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.unwireEvents(),window.removeEventListener("resize",this.onresize),i.i(s.removeClass)([this.sliderContainer],[u.sliderDisabled]),this.firstHandle.removeAttribute("aria-orientation"),"Range"===this.type&&this.secondHandle.removeAttribute("aria-orientation"),this.sliderContainer.parentNode.insertBefore(this.element,this.sliderContainer),i.i(s.detach)(this.sliderContainer),this.tooltip.isVisible&&this.tooltipObj.destroy(),this.element.innerHTML=""},e.prototype.onPropertyChanged=function(t,e){for(var n=this,a=0,r=Object.keys(t);a<r.length;a++){var l=r[a];switch(l){case"cssClass":this.setCSSClass(e.cssClass);break;case"value":if(t&&e){var o=i.i(s.isNullOrUndefined)(t.value)?"Range"===this.type?[this.min,this.max]:this.min:t.value;this.setProperties({value:o},!0),i.i(s.isNullOrUndefined)(e.value)||e.value.toString()===o.toString()||(this.setValue(),this.refreshTooltip(this.tooltipTarget),"Range"===this.type&&(i.i(s.isNullOrUndefined)(t.value)||e.value[1]===o[1]?this.activeHandle=1:this.activeHandle=2))}break;case"min":case"step":case"max":this.setMinMaxValue();break;case"tooltip":i.i(s.isNullOrUndefined)(t.tooltip)||i.i(s.isNullOrUndefined)(e.tooltip)||(this.setTooltip(l),this.showButtons||this.wireEvents());break;case"type":i.i(s.isNullOrUndefined)(e)||!Object.keys(e).length||i.i(s.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":i.i(s.isNullOrUndefined)(this.sliderContainer.querySelector("."+u.scale))||(i.i(s.detach)(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(t){t.match(/e-scale-/)&&n.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(u.sliderButtonClass),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()}}},e.prototype.setReadOnly=function(){this.readonly?(this.unwireEvents(),this.sliderContainer.classList.add(u.readonly)):(this.wireEvents(),this.sliderContainer.classList.remove(u.readonly))},e.prototype.setMinMaxValue=function(){var t=this;this.setValue(),this.refreshTooltip(this.tooltipTarget),i.i(s.isNullOrUndefined)(this.sliderContainer.querySelector("."+u.scale))||this.ul&&(i.i(s.detach)(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(e){e.match(/e-scale-/)&&t.sliderContainer.classList.remove(e)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex())},e.prototype.setZindex=function(){this.zIndex=6,i.i(s.isNullOrUndefined)(this.ticks)||"None"===this.ticks.placement||(this.ul.style.zIndex=this.zIndex+-7+"",this.element.style.zIndex=this.zIndex+2+""),this.isMaterial||this.isMaterial3||i.i(s.isNullOrUndefined)(this.ticks)||"Both"!==this.ticks.placement||(this.element.style.zIndex=this.zIndex+2+""),this.firstHandle.style.zIndex=this.zIndex+3+"","Range"===this.type&&(this.secondHandle.style.zIndex=this.zIndex+4+"")},e.prototype.setTooltip=function(t){this.changeSliderType(this.type,t)},e.prototype.setBarColor=function(){for(var t,e,n=this.sliderTrack.lastElementChild;n;)this.sliderTrack.removeChild(n),n=this.sliderTrack.lastElementChild;for(var a=0;a<this.colorRange.length;a++)if(!i.i(s.isNullOrUndefined)(this.colorRange[a].start)&&!i.i(s.isNullOrUndefined)(this.colorRange[a].end)&&this.colorRange[a].end>this.colorRange[a].start){this.colorRange[a].start<this.min&&(this.colorRange[a].start=this.min),this.colorRange[a].end>this.max&&(this.colorRange[a].end=this.max);var r=this.checkHandlePosition(this.colorRange[a].start),l=this.checkHandlePosition(this.colorRange[a].end),o=this.createElement("div");o.style.backgroundColor=this.colorRange[a].color,o.style.border="1px solid "+this.colorRange[a].color,"Horizontal"===this.orientation?(e=u.sliderHorizantalColor,t=this.enableRtl?i.i(s.isNullOrUndefined)(this.customValues)?this.checkHandlePosition(this.max)-this.checkHandlePosition(this.colorRange[a].end):this.checkHandlePosition(this.customValues.length-this.colorRange[a].end-1):this.checkHandlePosition(this.colorRange[a].start),o.style.width=l-r+"px",o.style.left=t+"px"):(e=u.sliderVerticalColor,t=this.checkHandlePosition(this.colorRange[a].start),o.style.height=l-r+"px",o.style.bottom=t+"px"),o.classList.add(e),this.sliderTrack.appendChild(o)}},e.prototype.getModuleName=function(){return"slider"},r([i.i(s.Property)(null)],e.prototype,"value",void 0),r([i.i(s.Property)(null)],e.prototype,"customValues",void 0),r([i.i(s.Property)(1)],e.prototype,"step",void 0),r([i.i(s.Property)(null)],e.prototype,"width",void 0),r([i.i(s.Property)(0)],e.prototype,"min",void 0),r([i.i(s.Property)(100)],e.prototype,"max",void 0),r([i.i(s.Property)(!1)],e.prototype,"readonly",void 0),r([i.i(s.Property)("Default")],e.prototype,"type",void 0),r([i.i(s.Collection)([{}],o)],e.prototype,"colorRange",void 0),r([i.i(s.Complex)({},l)],e.prototype,"ticks",void 0),r([i.i(s.Complex)({},h)],e.prototype,"limits",void 0),r([i.i(s.Property)(!0)],e.prototype,"enabled",void 0),r([i.i(s.Complex)({},d)],e.prototype,"tooltip",void 0),r([i.i(s.Property)(!1)],e.prototype,"showButtons",void 0),r([i.i(s.Property)(!0)],e.prototype,"enableAnimation",void 0),r([i.i(s.Property)("Horizontal")],e.prototype,"orientation",void 0),r([i.i(s.Property)("")],e.prototype,"cssClass",void 0),r([i.i(s.Property)(!1)],e.prototype,"enableHtmlSanitizer",void 0),r([i.i(s.Event)()],e.prototype,"created",void 0),r([i.i(s.Event)()],e.prototype,"change",void 0),r([i.i(s.Event)()],e.prototype,"changed",void 0),r([i.i(s.Event)()],e.prototype,"renderingTicks",void 0),r([i.i(s.Event)()],e.prototype,"renderedTicks",void 0),r([i.i(s.Event)()],e.prototype,"tooltipChange",void 0),e=r([s.NotifyPropertyChanges],e)}(s.Component)},function(t,e){t.exports=i},function(t,e,i){"use strict";var s=i(18);i.d(e,"a",function(){return s.a})},function(t,e,i){"use strict";var s=i(6);i.d(e,"a",function(){return s.a})},function(t,e,i){"use strict";var s=i(19);i.d(e,"a",function(){return s.a}),i.d(e,"b",function(){return s.b}),i.d(e,"c",function(){return s.c})},function(t,e,i){"use strict";var s=i(3);i.d(e,"a",function(){return s.a}),i.d(e,"b",function(){return s.b}),i.d(e,"c",function(){return s.c}),i.d(e,"d",function(){return s.d}),i.d(e,"e",function(){return s.e}),i.d(e,"f",function(){return s.f}),i.d(e,"g",function(){return s.g}),i.d(e,"h",function(){return s.h}),i.d(e,"i",function(){return s.i}),i.d(e,"j",function(){return s.j}),i.d(e,"k",function(){return s.k}),i.d(e,"l",function(){return s.l}),i.d(e,"m",function(){return s.m}),i.d(e,"n",function(){return s.n}),i.d(e,"o",function(){return s.o}),i.d(e,"p",function(){return s.p}),i.d(e,"q",function(){return s.q}),i.d(e,"r",function(){return s.r}),i.d(e,"s",function(){return s.s}),i.d(e,"t",function(){return s.t}),i.d(e,"u",function(){return s.u}),i.d(e,"v",function(){return s.v});var n=i(22);i.d(e,"w",function(){return n.a})},function(t,e,i){"use strict";var s=i(25);i.d(e,"a",function(){return s.a}),i.d(e,"b",function(){return s.b}),i.d(e,"c",function(){return s.c})},function(t,e,i){"use strict";var s=i(26);i.d(e,"a",function(){return s.a})},function(t,e,i){"use strict";var s=i(7);i.d(e,"a",function(){return s.b}),i.d(e,"b",function(){return s.c}),i.d(e,"c",function(){return s.d}),i.d(e,"d",function(){return s.e}),i.d(e,"e",function(){return s.a})},function(t,e,i){"use strict";var s=i(27);i.d(e,"a",function(){return s.a})},function(t,e,i){"use strict";var s=i(28);i.d(e,"a",function(){return s.a}),i.d(e,"b",function(){return s.b}),i.d(e,"c",function(){return s.c}),i.d(e,"d",function(){return s.d})},function(t,e,i){"use strict";i.d(e,"a",function(){return O});var s=i(0),n=(i.n(s),i(8)),a=(i.n(n),i(2)),r=(i.n(a),i(4)),l=i(5),o=i(7),h=this&&this.__extends||function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),d=this&&this.__decorate||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;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},u="e-apply",c="e-ctrl-btn",p="e-switch-ctrl-btn",m="e-hide-hex-value",f="e-hide-switchable-value",v="e-hide-value",g="e-hsv-color",y="e-selected-value",b="e-mode-switch-btn",C="e-nocolor-item",E="e-opacity-value",x="e-preview-container",S="e-show-value",T="e-selected",k="e-tile",P={default:["#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"]},O=function(t){function e(e,i){return t.call(this,e,i)||this}return h(e,t),e.prototype.preRender=function(){var t=this.element;this.formElement=i.i(s.closest)(this.element,"form"),this.formElement&&s.EventHandler.add(this.formElement,"reset",this.formResetHandler,this);var e={Apply:"Apply",Cancel:"Cancel",ModeSwitcher:"Switch Mode"};this.l10n=new s.L10n("colorpicker",e,this.locale),t.getAttribute("ejs-for")&&!t.getAttribute("name")&&t.setAttribute("name",t.id)},e.prototype.render=function(){this.initWrapper(),this.inline?this.createWidget():this.createSplitBtn(),this.enableOpacity||i.i(s.addClass)([this.container.parentElement],"e-hide-opacity"),this.renderComplete()},e.prototype.initWrapper=function(){var t=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"});this.element.parentNode.insertBefore(t,this.element),t.appendChild(this.element),i.i(s.attributes)(this.element,{tabindex:"-1",spellcheck:"false","aria-label":"colorpicker"}),this.container=this.createElement("div",{className:"e-container"}),this.getWrapper().appendChild(this.container);var e=this.value?this.roundValue(this.value).toLowerCase():"#008000ff";this.noColor&&"Palette"===this.mode&&""===this.value&&(e="");var n=e.slice(0,7);i.i(s.isNullOrUndefined)(this.initialInputValue)&&(this.initialInputValue=n),this.element.value=n,this.enableOpacity?this.setProperties({value:e},!0):this.setProperties({value:n},!0),this.enableRtl&&t.classList.add("e-rtl"),this.cssClass&&i.i(s.addClass)([t],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.tileRipple=i.i(s.rippleEffect)(this.container,{selector:"."+k}),this.ctrlBtnRipple=i.i(s.rippleEffect)(this.container,{selector:".e-btn"})},e.prototype.getWrapper=function(){return this.element.parentElement},e.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),s.Browser.isDevice&&this.refreshPopupPos()},e.prototype.createSplitBtn=function(){var t=this,e=this.createElement("button",{className:"e-split-colorpicker"});this.getWrapper().appendChild(e),this.splitBtn=new n.SplitButton({iconCss:"e-selected-color",target:this.container,disabled:this.disabled,enableRtl:this.enableRtl,createPopupOnClick:this.createPopupOnClick,open:this.onOpen.bind(this),click:function(){t.trigger("change",{currentValue:{hex:t.value.slice(0,7),rgba:t.convertToRgbString(t.hexToRgb(t.value))},previousValue:{hex:null,rgba:null},value:t.value})}}),this.splitBtn.createElement=this.createElement,this.splitBtn.appendTo(e);var r=this.createElement("span",{className:"e-split-preview"});i.i(s.select)(".e-selected-color",e).appendChild(r),r.style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value));var l=this.getPopupEle();if(i.i(s.addClass)([l],"e-colorpicker-popup"),this.cssClass&&i.i(s.addClass)([l],this.cssClass.replace(/\s+/g," ").trim().split(" ")),s.Browser.isDevice){var o=this.getPopupInst();o.relateTo=document.body,o.position={X:"center",Y:"center"},o.targetType="container",o.collision={X:"fit",Y:"fit"},o.offsetY=4,l.style.zIndex=i.i(a.getZindexPartial)(this.splitBtn.element).toString()}this.bindCallBackEvent()},e.prototype.onOpen=function(){this.trigger("open",{element:this.container})},e.prototype.getPopupInst=function(){return i.i(s.getInstance)(this.getPopupEle(),a.Popup)},e.prototype.bindCallBackEvent=function(){var t=this;this.splitBtn.beforeOpen=function(e){var a=new n.Deferred;return t.trigger("beforeOpen",e,function(n){if(!n.cancel){var r=t.getPopupEle();r.style.top=i.i(s.formatUnit)(0+pageYOffset),r.style.left=i.i(s.formatUnit)(0+pageXOffset),r.style.display="block",t.createWidget(),r.style.display="",s.Browser.isDevice&&(t.modal=t.createElement("div"),t.modal.className="e-"+t.getModuleName()+" e-modal",t.modal.style.display="none",document.body.insertBefore(t.modal,r),document.body.className+=" e-colorpicker-overflow",t.modal.style.display="block",t.modal.style.zIndex=(Number(r.style.zIndex)-1).toString())}e.cancel=n.cancel,a.resolve(n)}),a},this.splitBtn.beforeClose=function(e){var a=new n.Deferred;if(i.i(s.isNullOrUndefined)(e.event))a.resolve(e);else{var r={element:t.container,event:e.event,cancel:!1};t.trigger("beforeClose",r,function(i){s.Browser.isDevice&&e.event.target===t.modal&&(i.cancel=!0),i.cancel||t.onPopupClose(),e.cancel=i.cancel,a.resolve(i)})}return a}},e.prototype.onPopupClose=function(){this.unWireEvents(),this.destroyOtherComp(),this.container.style.width="",i.i(s.select)(".e-split-preview",this.splitBtn.element).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.container.innerHTML="",i.i(s.removeClass)([this.container],["e-color-picker","e-color-palette"]),s.Browser.isDevice&&this.modal&&(i.i(s.removeClass)([document.body],"e-colorpicker-overflow"),this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},e.prototype.createPalette=function(){if(i.i(s.classList)(this.container,["e-color-palette"],["e-color-picker"]),this.presetColors){var t=this.createElement("div",{className:"e-custom-palette"});this.appendElement(t);var e=Object.keys(this.presetColors);if(1===e.length)this.appendPalette(this.presetColors[e[0]],e[0],t);else for(var n=0,a=e.length;n<a;n++)this.appendPalette(this.presetColors[e[n]],e[n],t);i.i(s.selectAll)(".e-row",t).length>10&&i.i(s.addClass)([t],"e-palette-group")}else this.appendPalette(P.default,"default");"Palette"===this.mode&&!this.modeSwitcher&&this.noColor&&this.setNoColor();var r=parseInt(getComputedStyle(this.container).borderBottomWidth,10);this.container.style.width=i.i(s.formatUnit)(this.container.children[0].offsetWidth+r+r),this.rgb=this.hexToRgb(this.roundValue(this.value)),this.hsv=this.rgbToHsv.apply(this,this.rgb)},e.prototype.firstPaletteFocus=function(){i.i(s.select)("."+T,this.container.children[0])||i.i(s.selectAll)(".e-palette",this.container)[0].focus()},e.prototype.appendPalette=function(t,e,i){var s=this.createElement("div",{className:"e-palette",attrs:{tabindex:"0",role:"grid"}});i?i.appendChild(s):this.appendElement(s);for(var n,a,r,l=0,o=t.length;l<o;l++)0!==l&&l%this.columns!=0||(n=this.createElement("div",{className:"e-row",attrs:{role:"row"}}),s.appendChild(n)),r=this.roundValue(t[l]).toLowerCase(),a=this.createElement("span",{className:k,attrs:{role:"gridcell","aria-label":r,"aria-selected":"false",tabindex:"0"}}),this.trigger("beforeTileRender",{element:a,presetName:e,value:t[l]}),n.appendChild(a),this.value===r&&(this.addTileSelection(a),s.focus()),a.style.backgroundColor=this.convertToRgbString(this.hexToRgb(r))},e.prototype.setNoColor=function(){var t=this.container.querySelector(".e-row").children[0];t.classList.add(C),this.value||(t.classList.add(T),i.i(s.closest)(t,".e-palette").focus()),["aria-selected","aria-label"].forEach(function(e){t.removeAttribute(e)}),t.style.backgroundColor=""},e.prototype.appendElement=function(t,e){void 0===e&&(e=0);var i=this.container.children[e];i?this.container.insertBefore(t,i):this.container.appendChild(t)},e.prototype.addTileSelection=function(t){t.classList.add(T),t.setAttribute("aria-selected","true")},e.prototype.createPicker=function(){i.i(s.classList)(this.container,["e-color-picker"],["e-color-palette"]);var t=this.createElement("div",{className:"e-hsv-container"});this.appendElement(t),t.appendChild(this.createElement("div",{className:g}));var e=this.createElement("span",{className:"e-handler",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()},e.prototype.setHsvContainerBg=function(t){void 0===t&&(t=this.hsv[0]),this.getHsvContainer().style.backgroundColor=this.convertToRgbString(this.hsvToRgb(t,100,100,1))},e.prototype.getHsvContainer=function(){return i.i(s.select)(".e-hsv-container",this.container)},e.prototype.setHandlerPosition=function(){var t=this.getDragHandler(),e=i.i(s.select)("."+g,this.container);this.enableRtl?t.style.left=i.i(s.formatUnit)(e.offsetWidth*Math.abs(100-this.hsv[1])/100):t.style.left=i.i(s.formatUnit)(e.offsetWidth*this.hsv[1]/100),t.style.top=i.i(s.formatUnit)(e.offsetHeight*(100-this.hsv[2])/100)},e.prototype.createSlider=function(){var t=this.createElement("div",{className:"e-slider-preview"});this.appendElement(t,1),this.createPreview(t);var e=this.createElement("div",{className:"e-colorpicker-slider"});t.insertBefore(e,t.children[0]);var i=this.createElement("div",{className:"e-hue-slider"});e.appendChild(i),this.hueSlider=new o.a({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(i),this.enableOpacity&&(i=this.createElement("div",{className:"e-opacity-slider"}),e.appendChild(i),this.createOpacitySlider(i))},e.prototype.createOpacitySlider=function(t){this.opacitySlider=new o.a({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()},e.prototype.updateOpacitySliderBg=function(){var t=this.enableRtl?"to left":"to right",e=i.i(s.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%)")},e.prototype.hueChange=function(t){this.hsv[0]=t.value,this.setHsvContainerBg(),this.convertToOtherFormat()},e.prototype.opacityChange=function(t){var e=t.value,i=this.rgbToHex(this.rgb);this.hsv[3]=e/100,this.rgb[3]=e/100;var s=this.rgbToHex(this.rgb);this.updateOpacityInput(e);var n=this.convertToRgbString(this.rgb);this.updatePreview(n),this.triggerEvent(s,i,n)},e.prototype.updateOpacityInput=function(t){if(this.enableOpacity&&!this.getWrapper().classList.contains(v)){var e=i.i(s.getInstance)(i.i(s.select)("."+E,this.container),l.a);e.value=t,e.dataBind()}},e.prototype.createPreview=function(t){var e=this.createElement("div",{className:x});t.appendChild(e);var i=this.createElement("span",{className:"e-preview e-current"});e.appendChild(i);var s=this.convertToRgbString(this.rgb);i.style.backgroundColor=s,i=this.createElement("span",{className:"e-preview e-previous"}),e.appendChild(i),i.style.backgroundColor=s},e.prototype.isPicker=function(){return!this.container.classList.contains("e-color-palette")},e.prototype.getPopupEle=function(){return this.container.parentElement},e.prototype.createNumericInput=function(t,e,i,s){var n=this,a=new l.a({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)}});a.createElement=this.createElement,a.appendTo(t)},e.prototype.createInput=function(){var t=this.isPicker(),e=this.getWrapper();if(t&&!e.classList.contains(v)||!t&&e.classList.contains(S)){var i=this.createElement("div",{className:y});t?this.appendElement(i,2):this.appendElement(i,1);var s=this.createElement("div",{className:"e-input-container"});if(i.appendChild(s),e.classList.contains("e-hide-valueswitcher")||this.appendValueSwitchBtn(i),!e.classList.contains(m)){var n=this.createElement("input",{className:"e-hex",attrs:{maxlength:"7",spellcheck:"false","aria-label":"HEX"}});s.appendChild(n),r.a.createInput({element:n,floatLabelType:"Always",properties:{placeholder:"HEX",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker()}},this.createElement),r.a.setValue(this.value.slice(0,7),n),n.addEventListener("input",this.inputHandler.bind(this))}if(!e.classList.contains(f)){var a=void 0,l=void 0;this.isRgb?(a="RGB",l=this.rgb):(a="HSV",l=this.hsv);for(var o=["rh","gs","bv"],h=0;h<3;h++)this.createNumericInput(s.appendChild(this.createElement("input",{className:"e-"+o[h]+"-value"})),l[h],a[h],255);this.enableOpacity&&this.appendOpacityValue(s)}}},e.prototype.appendOpacityValue=function(t){this.createNumericInput(t.appendChild(this.createElement("input",{className:E})),100*this.rgb[3],"A",100)},e.prototype.appendValueSwitchBtn=function(t){var e=this.createElement("button",{className:"e-icons e-css e-btn e-flat e-icon-btn e-value-switch-btn",attrs:{title:"Toggle format"}});t.appendChild(e),this.isPicker()&&!this.getWrapper().classList.contains(f)&&e.addEventListener("click",this.formatSwitchHandler.bind(this))},e.prototype.createCtrlBtn=function(){if(this.modeSwitcher||this.showButtons){this.l10n.setLocale(this.locale);var t=this.createElement("div",{className:p});if(this.container.appendChild(t),this.showButtons){var e=this.createElement("div",{className:c});t.appendChild(e);var i=this.l10n.getConstant("Apply");e.appendChild(this.createElement("button",{innerHTML:i,className:"e-btn e-css e-flat e-primary e-small "+u,attrs:{title:i}}));var s=this.l10n.getConstant("Cancel");e.appendChild(this.createElement("button",{innerHTML:s,className:"e-btn e-css e-flat e-small e-cancel",attrs:{title:s}}))}this.modeSwitcher&&this.appendModeSwitchBtn()}},e.prototype.appendModeSwitchBtn=function(){var t=this.createElement("button",{className:"e-icons e-btn e-flat e-icon-btn "+b,attrs:{title:this.l10n.getConstant("ModeSwitcher")}});i.i(s.select)("."+p,this.container).insertBefore(t,i.i(s.select)("."+c,this.container))},e.prototype.createDragTooltip=function(){var t=this,e=new a.Tooltip({opensOn:"Custom",showTipPointer:!1,cssClass:"e-color-picker-tooltip",beforeOpen:function(e){t.tooltipEle=e.element},animation:{open:{effect:"None"},close:{effect:"None"}}});e.createElement=this.createElement,e.appendTo(this.container),e.open(this.container),this.tooltipEle.style.zIndex=i.i(a.getZindexPartial)(this.tooltipEle).toString(),i.i(s.select)(".e-tip-content",this.tooltipEle).appendChild(this.createElement("div",{className:"e-tip-transparent"}))},e.prototype.getTooltipInst=function(){return i.i(s.getInstance)(this.container,a.Tooltip)},e.prototype.setTooltipOffset=function(t){this.getTooltipInst().offsetY=t},e.prototype.toggleDisabled=function(t){t?this.getWrapper().classList.add("e-disabled"):this.getWrapper().classList.remove("e-disabled"),this.showButtons&&[].slice.call(i.i(s.selectAll)(".e-btn",this.container)).forEach(function(e){t?i.i(s.attributes)(e,{disabled:""}):e.removeAttribute("disabled")})},e.prototype.convertToRgbString=function(t){return t.length?4===t.length?"rgba("+t.join()+")":"rgb("+t.join()+")":""},e.prototype.convertToHsvString=function(t){return 4===t.length?"hsva("+t.join()+")":"hsv("+t.join()+")"},e.prototype.updateHsv=function(){this.hsv[1]=this.hsv[1]>100?100:this.hsv[1],this.hsv[2]=this.hsv[2]>100?100:this.hsv[2],this.setHandlerPosition()},e.prototype.convertToOtherFormat=function(t){void 0===t&&(t=!1);var e=this.rgbToHex(this.rgb);this.rgb=this.hsvToRgb.apply(this,this.hsv);var i=this.rgbToHex(this.rgb),s=this.convertToRgbString(this.rgb);this.updatePreview(s),this.updateInput(i),this.triggerEvent(i,e,s,t)},e.prototype.updateInput=function(t){var e=this.getWrapper();e.classList.contains(v)||(e.classList.contains(m)||r.a.setValue(t.substr(0,7),i.i(s.select)(".e-hex",this.container)),e.classList.contains(f)||(this.isRgb?this.updateValue(this.rgb,!1):this.updateValue(this.hsv,!1)))},e.prototype.updatePreview=function(t){this.enableOpacity&&this.updateOpacitySliderBg(),i.i(s.select)(".e-tip-transparent",this.tooltipEle).style.backgroundColor=t,i.i(s.select)("."+x+" .e-current",this.container).style.backgroundColor=t,i.i(s.select)("."+x+" .e-previous",this.container).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value))},e.prototype.getDragHandler=function(){return i.i(s.select)(".e-handler",this.container)},e.prototype.removeTileSelection=function(){[].slice.call(i.i(s.selectAll)("."+T,this.container.children[0])).forEach(function(t){t.classList.remove(T),t.setAttribute("aria-selected","false")})},e.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)})},e.prototype.getValue=function(t,e){if(t||(t=this.value),e=e?e.toLowerCase():"hex","r"===t[0]){var i=this.convertRgbToNumberArray(t);if("hex"===e||"hexa"===e){var s=this.rgbToHex(i);return"hex"===e?s.slice(0,7):s}return"hsv"===e?this.convertToHsvString(this.rgbToHsv.apply(this,i.slice(0,3))):"hsva"===e?this.convertToHsvString(this.rgbToHsv.apply(this,i)):"null"}if("h"===t[0]){var i=this.hsvToRgb.apply(this,this.convertRgbToNumberArray(t));if("rgba"===e)return this.convertToRgbString(i);if("hex"===e||"hexa"===e){var s=this.rgbToHex(i);return"hex"===e?s.slice(0,7):s}return"rgb"===e?this.convertToRgbString(i.slice(0,3)):"null"}t=this.roundValue(t);var n=this.hexToRgb(t);return"rgb"!==e&&"hsv"!==e||(n=n.slice(0,3)),"rgba"===e||"rgb"===e?this.convertToRgbString(n):"hsva"===e||"hsv"===e?this.convertToHsvString(this.rgbToHsv.apply(this,n)):"hex"===e?t.slice(0,7):"a"===e?n[3].toString():"null"},e.prototype.toggle=function(){this.container.parentElement.classList.contains("e-popup-close")?this.splitBtn.toggle():this.closePopup(null)},e.prototype.getModuleName=function(){return"colorpicker"},e.prototype.getPersistData=function(){return this.addOnPersist(["value"])},e.prototype.wireEvents=function(){if(this.isPicker()){var t=this.getDragHandler();s.EventHandler.add(t,"keydown",this.pickerKeyDown,this);var e=i.i(s.select)("."+c,this.container);e&&s.EventHandler.add(e,"keydown",this.ctrlBtnKeyDown,this),s.EventHandler.add(this.getHsvContainer(),"mousedown touchstart",this.handlerDown,this),(this.modeSwitcher||this.showButtons)&&this.addCtrlSwitchEvent(),s.EventHandler.add(i.i(s.select)(".e-previous",this.container),"click",this.previewHandler,this)}else s.EventHandler.add(this.container,"click",this.paletteClickHandler,this),s.EventHandler.add(this.container,"keydown",this.paletteKeyDown,this)},e.prototype.formResetHandler=function(){this.value=this.initialInputValue,i.i(s.attributes)(this.element,{value:this.initialInputValue})},e.prototype.addCtrlSwitchEvent=function(){var t=i.i(s.select)("."+p,this.container);t&&s.EventHandler.add(t,"click",this.btnClickHandler,this)},e.prototype.ctrlBtnKeyDown=function(t){if(13===t.keyCode){if(i.i(s.select)("."+u,this.container)){var e=this.rgbToHex(this.rgb);this.triggerChangeEvent(e)}this.splitBtn.element.focus()}},e.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)}},e.prototype.enterKeyHandler=function(t,e){this.triggerChangeEvent(t),this.inline||this.splitBtn.element.focus()},e.prototype.closePopup=function(t){var e=this,i={element:this.container,event:t,cancel:!1};this.trigger("beforeClose",i,function(t){t.cancel||(e.splitBtn.toggle(),e.onPopupClose())})},e.prototype.triggerChangeEvent=function(t){var e=t.slice(0,7);this.trigger("change",{currentValue:{hex:e,rgba:this.convertToRgbString(this.rgb)},previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:this.enableOpacity?t:e}),this.enableOpacity?this.setProperties({value:t},!0):this.setProperties({value:e},!0),this.element.value=e||"#000000"},e.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)},e.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(),this.getDragHandler().focus(),s.EventHandler.add(document,"mousemove touchmove",this.handlerMove,this),s.EventHandler.add(document,"mouseup touchend",this.handlerEnd,this)},e.prototype.handlerMove=function(t){"touchmove"!==t.type&&t.preventDefault();var e,n;"mousemove"===t.type?(e=Math.abs(t.pageX-pageXOffset),n=Math.abs(t.pageY-pageYOffset)):(e=Math.abs(t.changedTouches[0].pageX-pageXOffset),n=Math.abs(t.changedTouches[0].pageY-pageYOffset)),this.setHsv(e,n);var a=this.getDragHandler();this.updateHsv(),this.convertToOtherFormat(),this.getTooltipInst().refresh(a),this.tooltipEle.style.transform||(Math.abs(this.clientX-e)>8||Math.abs(this.clientY-n)>8)&&(i.i(s.select)("."+g,this.container).style.cursor="pointer",a.style.transition="none",this.inline||(this.tooltipEle.style.zIndex=(parseInt(this.getPopupEle().style.zIndex,10)+1).toString()),this.tooltipEle.style.transform="rotate(45deg)",a.classList.add("e-hide-handler"))},e.prototype.setHsv=function(t,e){var n=i.i(s.select)("."+g,this.container),a=n.getBoundingClientRect();t=this.enableRtl?t>a.right?0:Math.abs(t-a.right):t>a.left?Math.abs(t-a.left):0,e=e>a.top?Math.abs(e-a.top):0,this.hsv[2]=Math.round(10*Number(100*(n.offsetHeight-Math.max(0,Math.min(n.offsetHeight,e-n.offsetTop)))/n.offsetHeight))/10,this.hsv[1]=Math.round(10*Number(100*Math.max(0,Math.min(n.offsetWidth,t-n.offsetLeft))/n.offsetWidth))/10},e.prototype.handlerEnd=function(t){"touchend"!==t.type&&t.preventDefault(),s.EventHandler.remove(document,"mousemove touchmove",this.handlerMove),s.EventHandler.remove(document,"mouseup touchend",this.handlerEnd);var e=this.getDragHandler();i.i(s.select)("."+g,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)},e.prototype.btnClickHandler=function(t){var e=t.target;i.i(s.closest)(e,"."+b)?(t.stopPropagation(),this.switchToPalette()):(e.classList.contains(u)||e.classList.contains("e-cancel"))&&this.ctrlBtnClick(e,t)},e.prototype.switchToPalette=function(){this.trigger("beforeModeSwitch",{element:this.container,mode:"Palette"}),this.unWireEvents(),this.destroyOtherComp(),i.i(s.detach)(i.i(s.select)(".e-slider-preview",this.container)),this.getWrapper().classList.contains(v)||i.i(s.remove)(i.i(s.select)("."+y,this.container)),i.i(s.detach)(this.getHsvContainer()),this.createPalette(),this.firstPaletteFocus(),this.createInput(),this.refreshPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Palette"})},e.prototype.refreshPopupPos=function(){if(!this.inline){var t=this.getPopupEle();t.style.left=i.i(s.formatUnit)(0+pageXOffset),t.style.top=i.i(s.formatUnit)(0+pageYOffset),this.getPopupInst().refreshPosition(this.splitBtn.element.parentElement)}},e.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)},e.prototype.updateValue=function(t,e,n,a){for(var r,o=["e-rh-value","e-gs-value","e-bv-value"],h=0,d=o.length;h<d;h++)r=i.i(s.getInstance)(i.i(s.select)("."+o[h],this.container),l.a),r.value=Math.round(t[h]),e&&(r.placeholder=o[h].substr(n,1).toUpperCase(),r.max=a?a[h]:255),r.dataBind()},e.prototype.previewHandler=function(t){var e=t.target,n=this.rgbToHex(this.rgb);this.rgb=this.convertRgbToNumberArray(e.style.backgroundColor),this.rgb[3]||(this.rgb[3]=1);var a=this.rgbToHex(this.rgb),r=this.rgbToHsv.apply(this,this.rgb);r[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:r[0]},!0),this.hueSlider.refresh()),this.setHsvContainerBg(r[0]),this.enableOpacity&&r[3]!==this.hsv[3]&&(this.opacitySlider.setProperties({value:100*r[3]},!0),this.opacitySlider.refresh(),this.updateOpacitySliderBg()),this.hsv=r,this.setHandlerPosition(),this.updateInput(a),i.i(s.select)("."+x+" .e-current",this.container).style.backgroundColor=this.convertToRgbString(this.rgb),this.triggerEvent(a,n,this.convertToRgbString(this.rgb))},e.prototype.paletteClickHandler=function(t){t.preventDefault();var e=t.target;if(e.classList.contains(k)){if(this.removeTileSelection(),this.addTileSelection(e),e.classList.contains(C))this.noColorTile();else{var n=e.getAttribute("aria-label"),a=this.rgbToHex(this.rgb);this.rgb=this.hexToRgb(this.roundValue(n)),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(S)&&this.updateInput(n),this.triggerEvent(n,a,this.convertToRgbString(this.rgb))}this.inline||this.showButtons||this.closePopup(t)}else i.i(s.closest)(e,"."+b)?this.switchToPicker():e.classList.contains(u)||e.classList.contains("e-cancel")?this.ctrlBtnClick(e,t):this.getWrapper().classList.contains(S)&&i.i(s.closest)(e,".e-value-switch-btn")&&this.formatSwitchHandler()},e.prototype.noColorTile=function(t){void 0===t&&(t=!1);var e=this.rgbToHex(this.rgb);this.rgb=[],this.hsv=[],this.triggerEvent("",e,"",t)},e.prototype.switchToPicker=function(){var t=this.getWrapper();this.trigger("beforeModeSwitch",{element:this.container,mode:"Picker"}),this.unWireEvents(),[].slice.call(i.i(s.selectAll)(".e-palette",this.container)).forEach(function(t){i.i(s.detach)(t)}),t.classList.contains(S)&&i.i(s.detach)(i.i(s.select)("."+y,this.container)),this.container.style.width="";var e=i.i(s.select)(".e-custom-palette",this.container);this.presetColors&&i.i(s.remove)(e),this.createPicker(),this.getDragHandler().focus(),this.createInput(),this.refreshPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Picker"})},e.prototype.ctrlBtnClick=function(t,e){if(t.classList.contains(u)){var i=this.rgbToHex(this.rgb);this.triggerChangeEvent(i)}this.inline||(this.closePopup(e),this.splitBtn.element.focus())},e.prototype.paletteKeyDown=function(t){var e=t.target;if(e.classList.contains("e-palette")){var n,a,r=[].slice.call(i.i(s.selectAll)("."+k,e)),l=r.filter(function(t){return t.classList.contains("e-selected")}).pop();switch(!t.altKey&&t.keyCode){case 39:t.preventDefault(),n=l?r[this.tilePosition(r,l,this.enableRtl?-1:1)]:r[this.enableRtl?r.length-1:0],this.keySelectionChanges(n);break;case 37:t.preventDefault(),n=l?r[this.tilePosition(r,l,this.enableRtl?1:-1)]:r[this.enableRtl?0:r.length-1],this.keySelectionChanges(n);break;case 38:t.preventDefault(),a=l?this.tilePosition(r,l,-this.columns):0,n=r[a]?r[a]:r[a-this.columns],this.keySelectionChanges(n);break;case 40:t.preventDefault(),a=l?this.tilePosition(r,l,this.columns):r.length-1,r[a]?n=r[a]:(a%=r.length,a+=r[r.length-1].parentElement.childElementCount,n=r[a]),this.keySelectionChanges(n);break;case 13:if(t.preventDefault(),l){var o=l.getAttribute("aria-label");this.enterKeyHandler(o||"",t)}}}},e.prototype.keySelectionChanges=function(t){if(this.removeTileSelection(),this.addTileSelection(t),t.classList.contains(C))this.noColorTile(!0);else{var e=t.getAttribute("aria-label"),i=this.rgbToHex(this.rgb);this.rgb=this.hexToRgb(e),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(S)&&this.updateInput(e),this.triggerEvent(e,i,this.convertToRgbString(this.rgb),!0)}},e.prototype.tilePosition=function(t,e,i){t=Array.prototype.slice.call(t);var s=t.length,n=this.columns-t[s-1].parentElement.childElementCount,a=t.indexOf(e);return a+=i,a<0?a+=s+n:a%=s+n,a},e.prototype.inputHandler=function(t){var e=t.target;if(e.value.length){var n,a;switch(i.i(s.select)(".e-float-text",e.parentElement).textContent){case"HEX":var r="";if(("#"===e.value[0]&&5!==e.value.length||"#"!==e.value[0]&&4!==e.value.length)&&(r=this.roundValue(e.value)),9!==r.length)return;a=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(r+r.substr(-2)),this.inputValueChange(this.rgbToHsv.apply(this,this.rgb),a,e.value);break;case"R":this.rgb[0]!==Number(e.value)&&(a=this.rgbToHex(this.rgb),this.rgb[0]=Number(e.value),n=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(n,a));break;case"G":this.rgb[1]!==Number(e.value)&&(a=this.rgbToHex(this.rgb),this.rgb[1]=Number(e.value),n=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(n,a));break;case"B":this.rgb[2]!==Number(e.value)&&(a=this.rgbToHex(this.rgb),this.rgb[2]=Number(e.value),n=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(n,a));break;case"H":this.hueSlider.value=Number(e.value);break;case"S":this.hsv[1]!==Number(e.value)&&(this.hsv[1]=Number(e.value),this.updateHsv(),this.convertToOtherFormat());break;case"V":this.hsv[2]!==Number(e.value)&&(this.hsv[2]=Number(e.value),this.updateHsv(),this.convertToOtherFormat());break;case"A":this.opacitySlider.value=Number(e.value)}}},e.prototype.inputValueChange=function(t,e,i){t[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:t[0]},!0),this.hueSlider.refresh(),this.setHsvContainerBg(t[0])),this.hsv=t;var s=this.rgbToHex(this.rgb);this.setHandlerPosition(),this.updateInput(i||s);var n=this.convertToRgbString(this.rgb);this.updatePreview(n),this.triggerEvent(s,e,n)},e.prototype.triggerEvent=function(t,e,i,s){void 0===s&&(s=!1);var n=t.slice(0,7);this.showButtons||s?this.trigger("select",{currentValue:{hex:n,rgba:i},previousValue:{hex:e.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(e))}}):(this.trigger("change",{currentValue:{hex:n,rgba:i},previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:t}),this.enableOpacity?this.setProperties({value:t},!0):this.setProperties({value:n},!0),this.element.value=n||"#000000")},e.prototype.destroy=function(){var e=this,n=this.getWrapper();t.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&&i.i(s.detach)(this.element.nextElementSibling),n&&(n.parentElement.insertBefore(this.element,n),i.i(s.detach)(n)),this.container=null,this.formElement&&s.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},e.prototype.destroyOtherComp=function(){if(this.isPicker()){for(var t=i.i(s.closest)(this.hueSlider.element,".e-color-picker"),e=t.querySelectorAll(".e-numerictextbox"),n=0;n<e.length;n++)i.i(s.getInstance)(e[n],l.a).destroy();this.hueSlider.destroy(),this.enableOpacity&&(this.opacitySlider.destroy(),this.opacitySlider=null),this.hueSlider=null;var a=this.getTooltipInst();a.close(),a.destroy(),this.tooltipEle=null}},e.prototype.isPopupOpen=function(){return this.getPopupEle().classList.contains("e-popup-open")},e.prototype.unWireEvents=function(){if(this.isPicker()){var t=this.getDragHandler();s.EventHandler.remove(t,"keydown",this.pickerKeyDown);var e=i.i(s.select)("."+c,this.container);e&&s.EventHandler.remove(e,"keydown",this.ctrlBtnKeyDown),s.EventHandler.remove(this.getHsvContainer(),"mousedown touchstart",this.handlerDown),(this.modeSwitcher||this.showButtons)&&s.EventHandler.remove(i.i(s.select)("."+p,this.container),"click",this.btnClickHandler),s.EventHandler.remove(i.i(s.select)(".e-previous",this.container),"click",this.previewHandler)}else s.EventHandler.remove(this.container,"click",this.paletteClickHandler),s.EventHandler.remove(this.container,"keydown",this.paletteKeyDown)},e.prototype.roundValue=function(t){if(!t)return"";"#"!==t[0]&&(t="#"+t);var e=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},e.prototype.hexToRgb=function(t){if(!t)return[];t=t.trim(),9!==t.length&&(t=this.roundValue(t));var e=Number((parseInt(t.slice(-2),16)/255).toFixed(2));t=t.slice(1,7);var i=parseInt(t,16),s=[];return s.push(i>>16&255),s.push(i>>8&255),s.push(255&i),s.push(e),s},e.prototype.rgbToHsv=function(t,e,n,a){if(this.rgb&&!this.rgb.length)return[];t/=255,e/=255,n/=255;var r,l=Math.max(t,e,n),o=Math.min(t,e,n),h=l,d=l-o,u=0===l?0:d/l;if(l===o)r=0;else{switch(l){case t:r=(e-n)/d+(e<n?6:0);break;case e:r=(n-t)/d+2;break;case n:r=(t-e)/d+4}r/=6}var c=[Math.round(360*r),Math.round(1e3*u)/10,Math.round(1e3*h)/10];return i.i(s.isNullOrUndefined)(a)||c.push(a),c},e.prototype.hsvToRgb=function(t,e,n,a){var r,l,o;if(e/=100,n/=100,0===e)return r=l=o=n,[Math.round(255*r),Math.round(255*l),Math.round(255*o),a];t/=60;var h=Math.floor(t),d=t-h,u=n*(1-e),c=n*(1-e*d),p=n*(1-e*(1-d));switch(h){case 0:r=n,l=p,o=u;break;case 1:r=c,l=n,o=u;break;case 2:r=u,l=n,o=p;break;case 3:r=u,l=c,o=n;break;case 4:r=p,l=u,o=n;break;default:r=n,l=u,o=c}var m=[Math.round(255*r),Math.round(255*l),Math.round(255*o)];return i.i(s.isNullOrUndefined)(a)||m.push(a),m},e.prototype.rgbToHex=function(t){return t.length?"#"+this.hex(t[0])+this.hex(t[1])+this.hex(t[2])+(i.i(s.isNullOrUndefined)(t[3])?"":0!==t[3]?(Math.round(255*t[3])+65536).toString(16).substr(-2):"00"):""},e.prototype.hex=function(t){return("0"+t.toString(16)).slice(-2)},e.prototype.changeModeSwitcherProp=function(t){var e=i.i(s.select)("."+p,this.container);t?e?this.appendModeSwitchBtn():(this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):e&&(this.showButtons?i.i(s.detach)(i.i(s.select)("."+b,e)):i.i(s.remove)(e))},e.prototype.changeShowBtnProps=function(t){var e=i.i(s.select)("."+p,this.container);t?(e&&i.i(s.remove)(e),this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):this.modeSwitcher?i.i(s.detach)(i.i(s.select)("."+c,e)):i.i(s.remove)(e)},e.prototype.changeValueProp=function(t){if(this.isPicker())this.rgb=this.hexToRgb(t),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHandlerPosition(),i.i(s.detach)(i.i(s.closest)(this.hueSlider.element,".e-slider-preview")),this.createSlider(),this.setHsvContainerBg(),this.updateInput(t),4===this.rgb.length&&this.updateOpacityInput(100*this.rgb[3]);else{this.removeTileSelection();var e=this.container.querySelector('span[aria-label="'+this.roundValue(t)+'"]');e&&this.addTileSelection(e)}},e.prototype.setInputEleProps=function(){i.i(s.remove)(i.i(s.select)("."+y,this.container)),this.createInput()},e.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())},e.prototype.changeCssClassProps=function(t,e){var n=this.getWrapper(),a=this.getPopupEle();e&&i.i(s.removeClass)([n,a],e.split(" ")),t&&i.i(s.addClass)([n,a],t.replace(/\s+/g," ").trim().split(" "))},e.prototype.changeRtlProps=function(t){t?i.i(s.addClass)([this.getWrapper()],"e-rtl"):i.i(s.removeClass)([this.getWrapper()],"e-rtl")},e.prototype.changePaletteProps=function(){i.i(s.detach)(this.container.children[0]),this.container.style.width="",this.createPalette()},e.prototype.changeOpacityProps=function(t){var e=this.getWrapper();t?(i.i(s.removeClass)([this.container.parentElement],"e-hide-opacity"),this.createOpacitySlider(i.i(s.select)(".e-colorpicker-slider",this.container).appendChild(this.createElement("div",{className:"e-opacity-slider"}))),e.classList.contains(v)||e.classList.contains(f)||this.appendOpacityValue(i.i(s.select)(".e-input-container",this.container))):(i.i(s.addClass)([this.container.parentElement],"e-hide-opacity"),this.opacitySlider.destroy(),i.i(s.remove)(this.opacitySlider.element),this.opacitySlider=null,e.classList.contains(v)||e.classList.contains(f)||i.i(s.remove)(i.i(s.select)("."+E,this.container).parentElement))},e.prototype.onPropertyChanged=function(t,e){var a=this;if(!i.i(s.isNullOrUndefined)(t.value)){var r=this.roundValue(t.value);if(9===r.length){this.element.value=this.roundValue(r).slice(0,7);var l=this.splitBtn&&i.i(s.select)(".e-split-preview",this.splitBtn.element);l&&(l.style.backgroundColor=this.convertToRgbString(this.hexToRgb(t.value)))}else if(this.noColor&&"Palette"===this.mode&&""===this.value){var l=this.splitBtn&&i.i(s.select)(".e-split-preview",this.splitBtn.element);l.style.backgroundColor=""}else this.value=e.value}if(!this.inline&&i.i(s.isNullOrUndefined)(t.inline)){var o=["disabled","enableRtl"];if(this.splitBtn.setProperties(i.i(n.getModel)(t,o)),!this.isPopupOpen())return this.changeCssClassProps(t.cssClass,e.cssClass),void this.changeRtlProps(t.enableRtl)}for(var h=this,d=0,u=Object.keys(t);d<u.length;d++){var c=u[d];!function(n){switch(n){case"inline":t.inline?(h.getWrapper().appendChild(h.container),h.splitBtn.destroy(),i.i(s.detach)(h.element.nextElementSibling),h.container.children.length||h.createWidget()):(h.destroyOtherComp(),h.unWireEvents(),h.container.innerHTML="",h.createSplitBtn());break;case"cssClass":h.changeCssClassProps(t.cssClass,e.cssClass);var r=t.cssClass.split(" ").concat(e.cssClass.split(" "));r=r.reduce(function(t,e){return t.indexOf(e)<0&&t.push(e),t},[]);var l=0;r.forEach(function(t){if(0===l&&(t===v||"e-hide-valueswitcher"===t||t===S||t===m||t===f)){i.i(s.select)("."+y,a.container)&&i.i(s.remove)(i.i(s.select)("."+y,a.container)),a.createInput(),l++}});break;case"enableRtl":h.isPicker()&&(h.hueSlider.enableRtl=t.enableRtl,h.enableOpacity&&(h.opacitySlider.enableRtl=t.enableRtl),h.setInputEleProps()),h.changeRtlProps(t.enableRtl);break;case"disabled":h.changeDisabledProp(t.disabled);break;case"value":h.value!==e.value&&h.changeValueProp(t.value);break;case"showButtons":h.changeShowBtnProps(t.showButtons);break;case"mode":"Picker"===t.mode?h.switchToPicker():h.switchToPalette();break;case"modeSwitcher":h.changeModeSwitcherProp(t.modeSwitcher);break;case"columns":case"presetColors":h.isPicker()||h.changePaletteProps();break;case"noColor":t.noColor?"Palette"!==h.mode||h.modeSwitcher||h.setNoColor():h.changePaletteProps();break;case"enableOpacity":h.changeOpacityProps(t.enableOpacity)}}(c)}},e.prototype.focusIn=function(){this.element.parentElement.focus()},d([i.i(s.Property)("#008000ff")],e.prototype,"value",void 0),d([i.i(s.Property)("")],e.prototype,"cssClass",void 0),d([i.i(s.Property)(!1)],e.prototype,"disabled",void 0),d([i.i(s.Property)("Picker")],e.prototype,"mode",void 0),d([i.i(s.Property)(!0)],e.prototype,"modeSwitcher",void 0),d([i.i(s.Property)(null)],e.prototype,"presetColors",void 0),d([i.i(s.Property)(!0)],e.prototype,"showButtons",void 0),d([i.i(s.Property)(10)],e.prototype,"columns",void 0),d([i.i(s.Property)(!1)],e.prototype,"inline",void 0),d([i.i(s.Property)(!1)],e.prototype,"noColor",void 0),d([i.i(s.Property)(!1)],e.prototype,"enablePersistence",void 0),d([i.i(s.Property)(!0)],e.prototype,"enableOpacity",void 0),d([i.i(s.Property)(!1)],e.prototype,"createPopupOnClick",void 0),d([i.i(s.Event)()],e.prototype,"select",void 0),d([i.i(s.Event)()],e.prototype,"change",void 0),d([i.i(s.Event)()],e.prototype,"beforeTileRender",void 0),d([i.i(s.Event)()],e.prototype,"beforeOpen",void 0),d([i.i(s.Event)()],e.prototype,"open",void 0),d([i.i(s.Event)()],e.prototype,"beforeClose",void 0),d([i.i(s.Event)()],e.prototype,"beforeModeSwitch",void 0),d([i.i(s.Event)()],e.prototype,"onModeSwitch",void 0),d([i.i(s.Event)()],e.prototype,"created",void 0),e=d([s.NotifyPropertyChanges],e)}(s.Component)},function(t,e,i){"use strict";i.d(e,"a",function(){return l}),i.d(e,"b",function(){return s}),i.d(e,"c",function(){return o});var s,n=i(0),a=(i.n(n),this&&this.__extends||function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}()),r=this&&this.__decorate||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;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},l={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}$")};!function(t){t[t.Message=0]="Message",t[t.Label=1]="Label"}(s||(s={}));var o=function(t){function e(e,s){var a=t.call(this,s,e)||this;if(a.validated=[],a.errorRules=[],a.allowSubmit=!1,a.required="required",a.infoElement=null,a.inputElement=null,a.selectQuery="input:not([type=reset]):not([type=button]), select, textarea",a.localyMessage={},a.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===a.rules&&(a.rules={}),a.l10n=new n.L10n("formValidator",a.defaultMessages,a.locale),a.locale&&a.localeFunc(),n.onIntlChange.on("notifyExternalChange",a.afterLocalization,a),e="string"==typeof e?i.i(n.select)(e,document):e,null!=a.element)return a.element.setAttribute("novalidate",""),a.inputElements=i.i(n.selectAll)(a.selectQuery,a.element),a.createHTML5Rules(),a.wireEvents(),a}a(e,t),o=e,e.prototype.addRules=function(t,e){t&&(this.rules.hasOwnProperty(t)?i.i(n.extend)(this.rules[""+t],e,{}):this.rules[""+t]=e)},e.prototype.removeRules=function(t,e){if(t||e)if(this.rules[""+t]&&!e)delete this.rules[""+t];else{if(i.i(n.isNullOrUndefined)(this.rules[""+t]&&e))return;for(var s=0;s<e.length;s++)delete this.rules[""+t][e[parseInt(s.toString())]]}else this.rules={}},e.prototype.validate=function(t){var e=Object.keys(this.rules);if(t&&e.length)return this.validateRules(t),-1!==e.indexOf(t)&&0===this.errorRules.filter(function(e){return e.name===t}).length;this.errorRules=[];for(var i=0,s=e;i<s.length;i++){var n=s[i];this.validateRules(n)}return 0===this.errorRules.length},e.prototype.reset=function(){this.element.reset(),this.clearForm()},e.prototype.getInputElement=function(t){return this.inputElement=i.i(n.select)('[name="'+t+'"]',this.element),this.inputElement},e.prototype.destroy=function(){this.reset(),this.unwireEvents(),this.rules={};for(var e=i.i(n.selectAll)("."+this.errorClass+", ."+this.validClass,this.element),s=0,a=e;s<a.length;s++){var r=a[s];i.i(n.detach)(r)}t.prototype.destroy.call(this),n.onIntlChange.off("notifyExternalChange",this.afterLocalization)},e.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){switch(s[i]){case"locale":this.localeFunc()}}},e.prototype.localeFunc=function(){for(var t=0,e=Object.keys(this.defaultMessages);t<e.length;t++){var i=e[t];this.l10n.setLocale(this.locale);var s=this.l10n.getConstant(i);this.localyMessage[""+i]=s}},e.prototype.getModuleName=function(){return"formValidator"},e.prototype.afterLocalization=function(t){this.locale=t.locale,this.localeFunc()},e.prototype.refresh=function(){this.unwireEvents(),this.inputElements=i.i(n.selectAll)(this.selectQuery,this.element),this.wireEvents()},e.prototype.clearForm=function(){this.errorRules=[],this.validated=[];for(var t=i.i(n.selectAll)(this.selectQuery,this.element),e=0,s=t;e<s.length;e++){var a=s[e],r=a;r.removeAttribute("aria-invalid"),r.classList.remove(this.errorClass),r.name.length>0&&(this.getInputElement(r.name),this.getErrorElement(r.name),this.hideMessage(r.name)),r.classList.remove(this.validClass)}},e.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)}},e.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],l=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(l))switch(l){case"maxlength":this.defRule(t,e,"maxLength",s);break;case"minlength":this.defRule(t,e,"minLength",s);break;case"range":var o=t.getAttribute("data-val-range-min"),h=t.getAttribute("data-val-range-max");this.defRule(t,e,"range",[o,h]);break;case"equalto":var d=t.getAttribute(i).split(".");this.defRule(t,e,"equalTo",d[d.length-1]);break;case"regex":this.defRule(t,e,"regex",s)}},e.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},e.prototype.wireEvents=function(){for(var t=0,e=this.inputElements;t<e.length;t++){var i=e[t];o.isCheckable(i)?n.EventHandler.add(i,"click",this.clickHandler,this):"SELECT"===i.tagName?n.EventHandler.add(i,"change",this.changeHandler,this):(n.EventHandler.add(i,"focusout",this.focusOutHandler,this),n.EventHandler.add(i,"keyup",this.keyUpHandler,this))}n.EventHandler.add(this.element,"submit",this.submitHandler,this),n.EventHandler.add(this.element,"reset",this.resetHandler,this)},e.prototype.unwireEvents=function(){for(var t=0,e=this.inputElements;t<e.length;t++){var i=e[t];n.EventHandler.clearEvents(i)}n.EventHandler.remove(this.element,"submit",this.submitHandler),n.EventHandler.remove(this.element,"reset",this.resetHandler)},e.prototype.focusOutHandler=function(t){this.trigger("focusout",t);var e=t.target;this.rules[e.name]&&(this.rules[e.name][this.required]||e.value.length>0?this.validate(e.name):-1===this.validated.indexOf(e.name)&&this.validated.push(e.name))},e.prototype.keyUpHandler=function(t){this.trigger("keyup",t);var e=t.target,i=[16,17,18,20,35,36,37,38,39,40,45,144,225];(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===i.indexOf(t.which)&&this.validate(e.name)},e.prototype.clickHandler=function(t){this.trigger("click",t);var e=t.target;"submit"!==e.type?this.validate(e.name):null!==e.getAttribute("formnovalidate")&&(this.allowSubmit=!0)},e.prototype.changeHandler=function(t){this.trigger("change",t);var e=t.target;this.validate(e.name)},e.prototype.submitHandler=function(t){this.trigger("submit",t),this.allowSubmit||this.validate()?this.allowSubmit=!1:t.preventDefault()},e.prototype.resetHandler=function(){this.clearForm()},e.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!==a&&(i=!0),-1!==n&&(s=!0),!i||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),d={name:t,message:h},u={inputName:t,element:this.inputElement,message:h};if(!this.isValid(t,o)&&!this.inputElement.classList.contains(this.ignore)){this.removeErrorRules(t),this.errorRules.push(d),this.inputElement.setAttribute("aria-invalid","true"),this.inputElement.setAttribute("aria-describedby",this.inputElement.id+"-info"),this.inputElement.classList.add(this.errorClass),this.inputElement.classList.remove(this.validClass),this.infoElement?this.showMessage(d):this.createErrorElement(t,d.message,this.inputElement),u.errorElement=this.infoElement,u.status="failure",this.inputElement.classList.add(this.errorClass),this.inputElement.classList.remove(this.validClass),this.optionalValidationStatus(t,u),this.trigger("validationComplete",u),"required"===o&&this.inputElement.setAttribute("aria-required","true");break}this.hideMessage(t),u.status="success",this.trigger("validationComplete",u)}}}},e.prototype.optionalValidationStatus=function(t,e){this.rules[""+t][this.required]||this.inputElement.value.length||i.i(n.isNullOrUndefined)(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),e.status="",this.hideMessage(t))},e.prototype.isValid=function(t,e){var s=this.rules[""+t][""+e],a=s instanceof Array&&"string"==typeof s[1]?s[0]:s,r=this.rules[""+t][""+e],l={value:this.inputElement.value,param:a,element:this.inputElement,formElement:this.element};if(this.trigger("validationBegin",l),!l.param&&"required"===e)return!0;if(r&&"function"==typeof r[0]){return r[0].call(this,{element:this.inputElement,value:this.inputElement.value})}return o.isCheckable(this.inputElement)?"required"!==e||i.i(n.selectAll)('input[name="'+t+'"]:checked',this.element).length>0:o.checkValidator[""+e](l)},e.prototype.getErrorMessage=function(t,e){var s=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[""+e]:this.defaultMessages[""+e],a=s.match(/{(\d)}/g);if(!i.i(n.isNullOrUndefined)(a))for(var r=0;r<a.length;r++){var l=t instanceof Array?t[parseInt(r.toString())]:t;s=s.replace(a[parseInt(r.toString())],l)}return s},e.prototype.createErrorElement=function(t,e,a){var r=i.i(n.createElement)(this.errorElement,{className:this.errorClass,innerHTML:e,attrs:{for:t}});if(this.errorOption===s.Message&&(r.classList.remove(this.errorClass),r.classList.add("e-message"),r=i.i(n.createElement)(this.errorContainer,{className:this.errorClass,innerHTML:r.outerHTML})),r.id=this.inputElement.name+"-info",this.element.querySelector('[data-valmsg-for="'+a.id+'"]'))this.element.querySelector('[data-valmsg-for="'+a.id+'"]').appendChild(r);else if(!0===a.hasAttribute("data-msg-containerid")){var l=a.getAttribute("data-msg-containerid"),o=i.i(n.select)("#"+l,this.element);o.appendChild(r)}else if(null!=this.customPlacement)this.customPlacement.call(this,this.inputElement,r);else{var h=this.inputElement.parentElement,d=h.parentElement;h.classList.contains("e-control-wrapper")||h.classList.contains("e-wrapper")?d.insertBefore(r,h.nextSibling):d.classList.contains("e-control-wrapper")||d.classList.contains("e-wrapper")?d.parentElement.insertBefore(r,d.nextSibling):h.insertBefore(r,this.inputElement.nextSibling)}r.style.display="block",this.getErrorElement(t),this.validated.push(t),this.checkRequired(t)},e.prototype.getErrorElement=function(t){return this.infoElement=i.i(n.select)(this.errorElement+"."+this.errorClass,this.inputElement.parentElement),this.infoElement||(this.infoElement=i.i(n.select)(this.errorElement+"."+this.errorClass+'[for="'+t+'"]',this.element)),this.infoElement},e.prototype.removeErrorRules=function(t){for(var e=0;e<this.errorRules.length;e++){this.errorRules[parseInt(e.toString())].name===t&&this.errorRules.splice(e,1)}},e.prototype.showMessage=function(t){this.infoElement.style.display="block",this.infoElement.innerHTML=t.message,this.checkRequired(t.name)},e.prototype.hideMessage=function(t){this.infoElement&&(this.infoElement.style.display="none",this.removeErrorRules(t),this.inputElement.classList.add(this.validClass),this.inputElement.classList.remove(this.errorClass),this.inputElement.setAttribute("aria-invalid","false"))},e.prototype.checkRequired=function(t){this.rules[""+t][this.required]||this.inputElement.value.length||i.i(n.isNullOrUndefined)(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),this.hideMessage(t))},e.isCheckable=function(t){var e=t.getAttribute("type");return e&&("checkbox"===e||"radio"===e||"submit"===e)};var o;return e.checkValidator={required:function(t){return isNaN(Date.parse(t.value))?t.value.toString().length>0:!isNaN(new Date(t.value).getTime())},email:function(t){return l.EMAIL.test(t.value)},url:function(t){return l.URL.test(t.value)},dateIso:function(t){return l.DATE_ISO.test(t.value)},tel:function(t){return l.PHONE.test(t.value)},creditcard:function(t){return l.CREDITCARD.test(t.value)},number:function(t){return!isNaN(Number(t.value))&&-1===t.value.indexOf(" ")},digits:function(t){return l.DIGITS.test(t.value)},maxLength:function(t){return t.value.length<=t.param},minLength:function(t){return t.value.length>=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){if(i.i(n.isNullOrUndefined)(t.param)||"string"!=typeof t.param||""===t.param)return!isNaN(new Date(t.value).getTime());var e=new n.Internationalization,s={format:t.param.toString(),type:"dateTime",skeleton:"yMd"},a=e.parseDate(t.value,s);return!i.i(n.isNullOrUndefined)(a)&&a instanceof Date&&!isNaN(+a)},max:function(t){return isNaN(Number(t.value))?new Date(t.value).getTime()<=new Date(JSON.parse(JSON.stringify(t.param))).getTime():+t.value<=t.param},min:function(t){if(isNaN(Number(t.value))){if(-1!==t.value.indexOf(",")){var e=t.value.replace(/,/g,"");return parseFloat(e)>=t.param}return new Date(t.value).getTime()>=new Date(JSON.parse(JSON.stringify(t.param))).getTime()}return+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}},r([i.i(n.Property)("")],e.prototype,"locale",void 0),r([i.i(n.Property)("e-hidden")],e.prototype,"ignore",void 0),r([i.i(n.Property)()],e.prototype,"rules",void 0),r([i.i(n.Property)("e-error")],e.prototype,"errorClass",void 0),r([i.i(n.Property)("e-valid")],e.prototype,"validClass",void 0),r([i.i(n.Property)("label")],e.prototype,"errorElement",void 0),r([i.i(n.Property)("div")],e.prototype,"errorContainer",void 0),r([i.i(n.Property)(s.Label)],e.prototype,"errorOption",void 0),r([i.i(n.Event)()],e.prototype,"focusout",void 0),r([i.i(n.Event)()],e.prototype,"keyup",void 0),r([i.i(n.Event)()],e.prototype,"click",void 0),r([i.i(n.Event)()],e.prototype,"change",void 0),r([i.i(n.Event)()],e.prototype,"submit",void 0),r([i.i(n.Event)()],e.prototype,"validationBegin",void 0),r([i.i(n.Event)()],e.prototype,"validationComplete",void 0),r([i.i(n.Event)()],e.prototype,"customPlacement",void 0),e=o=r([n.NotifyPropertyChanges],e)}(n.Base)},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i(5);i.d(e,"NumericTextBox",function(){return s.a});var n=i(12);i.d(e,"regularExpressions",function(){return n.a}),i.d(e,"createMask",function(){return n.b}),i.d(e,"applyMask",function(){return n.c}),i.d(e,"wireEvents",function(){return n.d}),i.d(e,"unwireEvents",function(){return n.e}),i.d(e,"bindClearEvent",function(){return n.f}),i.d(e,"unstrippedValue",function(){return n.g}),i.d(e,"strippedValue",function(){return n.h}),i.d(e,"maskInputMouseDownHandler",function(){return n.i}),i.d(e,"maskInputMouseUpHandler",function(){return n.j}),i.d(e,"maskInputFocusHandler",function(){return n.k}),i.d(e,"triggerFocus",function(){return n.l}),i.d(e,"escapeRegExp",function(){return n.m}),i.d(e,"maskInputBlurHandler",function(){return n.n}),i.d(e,"maskInputDropHandler",function(){return n.o}),i.d(e,"mobileRemoveFunction",function(){return n.p}),i.d(e,"setMaskValue",function(){return n.q}),i.d(e,"setElementValue",function(){return n.r}),i.d(e,"maskInput",function(){return n.s}),i.d(e,"getVal",function(){return n.t}),i.d(e,"getMaskedVal",function(){return n.u}),i.d(e,"MaskUndo",function(){return n.v}),i.d(e,"MaskedTextBox",function(){return n.w});var a=i(4);i.d(e,"Input",function(){return a.a});var r=i(15);i.d(e,"TicksData",function(){return r.a}),i.d(e,"ColorRangeData",function(){return r.b}),i.d(e,"LimitData",function(){return r.c}),i.d(e,"TooltipData",function(){return r.d}),i.d(e,"Slider",function(){return r.e});var l=i(11);i.d(e,"regex",function(){return l.a}),i.d(e,"ErrorOption",function(){return l.b}),i.d(e,"FormValidator",function(){return l.c});var o=i(17);i.d(e,"FilesProp",function(){return o.a}),i.d(e,"ButtonsProps",function(){return o.b}),i.d(e,"AsyncSettings",function(){return o.c}),i.d(e,"Uploader",function(){return o.d});var h=i(9);i.d(e,"ColorPicker",function(){return h.a});var d=i(16);i.d(e,"TextBox",function(){return d.a});var u=i(14);i.d(e,"Signature",function(){return u.a});var c=i(13);i.d(e,"LabelPosition",function(){return c.a}),i.d(e,"PrecisionType",function(){return c.b}),i.d(e,"Rating",function(){return c.c});var p=i(10);i.d(e,"SignatureBase",function(){return p.a})},function(t,e,i){"use strict";function s(){if(i.i(X.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 s=t[e].split("["),n=0;n<s.length;n++)"\\"===s[n][s[n].length-1]&&(s[n]=s[n]+"["),p.call(this,s[n])}else{var s=t[e].split("[");if(s.length>1)for(var a=!1,n=0;n<s.length;n++)"\\"===s[n]?(this.customRegExpCollec.push("["),this.hiddenMask+=s[n]+"["):""===s[n]?a=!0:""!==s[n]&&a||n===s.length-1?(this.customRegExpCollec.push("["+s[n]+"]"),this.hiddenMask+=this.promptChar,a=!1):p.call(this,s[n]);else p.call(this,s[0])}if(this.escapeMaskValue=this.hiddenMask,this.promptMask=this.hiddenMask.replace(/[09?LCAa#&]/g,this.promptChar),!i.i(X.isNullOrUndefined)(this.customCharacters))for(var e=0;e<this.promptMask.length;e++)i.i(X.isNullOrUndefined)(this.customCharacters[this.promptMask[e]])||(this.promptMask=this.promptMask.replace(new RegExp(this.promptMask[e],"g"),this.promptChar));var r=0;if(this.hiddenMask.match(new RegExp(/\\/)))for(var e=0;e<this.hiddenMask.length;e++){var n=0;e>=1&&(n=e),r=this.hiddenMask.length-this.promptMask.length,n-=r,e>0&&"\\"!==this.hiddenMask[e-1]&&(">"===this.hiddenMask[e]||"<"===this.hiddenMask[e]||"|"===this.hiddenMask[e])&&(this.promptMask=this.promptMask.substring(0,n)+this.promptMask.substring(e+1-r,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue.substring(e+1-r,this.escapeMaskValue.length)),"\\"===this.hiddenMask[e]&&(this.promptMask=this.promptMask.substring(0,n)+this.hiddenMask[e+1]+this.promptMask.substring(e+2-r,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue[e+1]+this.escapeMaskValue.substring(e+2-r,this.escapeMaskValue.length))}else this.promptMask=this.promptMask.replace(/[>|<]/g,""),this.escapeMaskValue=this.hiddenMask.replace(/[>|<]/g,"");i.i(X.attributes)(this.element,{"aria-invalid":"false"})}}function n(){D.call(this,this.promptMask),I.call(this,this.value)}function a(){X.EventHandler.add(this.element,"keydown",T,this),X.EventHandler.add(this.element,"keypress",L,this),X.EventHandler.add(this.element,"keyup",H,this),X.EventHandler.add(this.element,"input",S,this),X.EventHandler.add(this.element,"focus",v,this),X.EventHandler.add(this.element,"blur",b,this),X.EventHandler.add(this.element,"paste",C,this),X.EventHandler.add(this.element,"cut",E,this),X.EventHandler.add(this.element,"drop",x,this),X.EventHandler.add(this.element,"mousedown",m,this),X.EventHandler.add(this.element,"mouseup",f,this),this.enabled&&(l.call(this),this.formElement&&X.EventHandler.add(this.formElement,"reset",d,this))}function r(){X.EventHandler.remove(this.element,"keydown",T),X.EventHandler.remove(this.element,"keypress",L),X.EventHandler.remove(this.element,"keyup",H),X.EventHandler.remove(this.element,"input",S),X.EventHandler.remove(this.element,"focus",v),X.EventHandler.remove(this.element,"blur",b),X.EventHandler.remove(this.element,"paste",C),X.EventHandler.remove(this.element,"cut",E),X.EventHandler.remove(this.element,"mousedown",m),X.EventHandler.remove(this.element,"mouseup",f),this.formElement&&X.EventHandler.remove(this.formElement,"reset",d)}function l(){this.showClearButton&&X.EventHandler.add(this.inputObj.clearButton,"mousedown touchstart",o,this)}function o(t){t.preventDefault(),this.inputObj.clearButton.classList.contains("e-clear-icon-hide")&&!this.inputObj.container.classList.contains("e-static-clear")||(h.call(this,t),this.value="")}function h(t){var e=this.element.value;D.call(this,this.promptMask),this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),w.call(this,t,e),this.element.setSelectionRange(0,0)}function d(){"EJS-MASKEDTEXTBOX"===this.element.tagName?D.call(this,this.promptMask):this.value=this.initInputValue}function u(t){return t.value}function c(t,e){var s="",n=0,a=!1,r=i.i(X.isNullOrUndefined)(e)?i.i(X.isNullOrUndefined)(t)||i.i(X.isNullOrUndefined)(this)?e:t.value:e;if(r!==this.promptMask)for(var l=0;l<this.customRegExpCollec.length;l++)a&&(a=!1),">"!==this.customRegExpCollec[n]&&"<"!==this.customRegExpCollec[n]&&"|"!==this.customRegExpCollec[n]&&"\\"!==this.customRegExpCollec[n]||(--l,a=!0),a||r[l]!==this.promptChar&&!i.i(X.isNullOrUndefined)(this.customRegExpCollec[n])&&(this._callPasteHandler||!i.i(X.isNullOrUndefined)(this.regExpCollec[this.customRegExpCollec[n]])||this.customRegExpCollec[n].length>2&&"["===this.customRegExpCollec[n][0]&&"]"===this.customRegExpCollec[n][this.customRegExpCollec[n].length-1]||!i.i(X.isNullOrUndefined)(this.customCharacters)&&!i.i(X.isNullOrUndefined)(this.customCharacters[this.customRegExpCollec[n]]))&&""!==r&&(s+=r[l]),++n;return(null===this.mask||""===this.mask&&void 0!==this.value)&&(s=r),s}function p(t){for(var e=0;e<t.length;e++)this.hiddenMask+=t[e],"\\"!==t[e]&&this.customRegExpCollec.push(t[e])}function m(){this.isClicked=!0}function f(){this.isClicked=!1}function v(t){var e=this,s=this.element,n=0,a=c.call(this,s),r=!1,l=!1,o={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:i.i(X.isNullOrUndefined)(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd};if(this.isClicked||g.call(this,o,s),this.mask&&(null!==a&&""!==a||"Always"===this.floatLabelType||null===this.placeholder||""===this.placeholder||(s.value=this.promptMask),setTimeout(function(){if(s.selectionStart===e.promptMask.length||s.value[s.selectionStart]===e.promptChar)r=!0;else for(var t=s.selectionStart;t<e.promptMask.length;t++){if(s.value[t]===e.promptChar){r=!0;break}if(s.value[t]!==e.promptMask[t]){r=!1;break}}}),setTimeout(function(){var t=s.selectionStart-1;if(t===e.promptMask.length-1||s.value[t]===e.promptChar)l=!0;else for(var i=t;i>=0;i--){if(s.value[i]===e.promptChar){l=!0;break}if(s.value[i]!==e.promptMask[i]){l=!1;break}}}),this.isClicked||"Always"!==this.floatLabelType&&(null===a||""===a)&&null!==this.placeholder&&""!==this.placeholder)){for(n=0;n<this.promptMask.length;n++)if(s.value[n]===this.promptChar){setTimeout(function(){(r||l)&&(s.selectionEnd=n,s.selectionStart=n),o={selectionStart:s.selectionStart,event:t,value:e.value,maskedValue:s.value,container:i.i(X.isNullOrUndefined)(e.inputObj)?e.inputObj:e.inputObj.container,selectionEnd:s.selectionEnd},g.call(e,o,s)},110);break}i.i(X.isNullOrUndefined)(s.value.match(y(this.promptChar)))&&(o={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:i.i(X.isNullOrUndefined)(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd},g.call(this,o,s)),this.isClicked=!1}}function g(t,e){this.trigger("focus",t,function(t){e.selectionStart=t.selectionStart,e.selectionEnd=t.selectionEnd})}function y(t){return i.i(X.isNullOrUndefined)(t)?t:t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function b(t){if(this.blurEventArgs={event:t,value:this.value,maskedValue:this.element.value,container:i.i(X.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)){D.call(this,"");var e=this.element.parentNode.querySelector(".e-float-text");"Auto"===this.floatLabelType&&!i.i(X.isNullOrUndefined)(e)&&e.classList.contains($)&&i.i(X.removeClass)([e],$)}}function C(t){var e=this;if(this.mask&&!this.readonly){var i=this.element.selectionStart,s=this.element.selectionEnd,n=this.element.value;D.call(this,""),this._callPasteHandler=!0,setTimeout(function(){var a=e.element.value.replace(/ /g,"");e.redoCollec.length>0&&e.redoCollec[0].value===e.element.value&&(a=c.call(e,e.element)),D.call(e,n),e.element.selectionStart=i,e.element.selectionEnd=s;var r=0;e.maskKeyPress=!0;do{B.call(e,a[r],!1,null),++r}while(r<a.length);if(e.maskKeyPress=!1,e._callPasteHandler=!1,e.element.value===n){var l=0;e.maskKeyPress=!0;do{B.call(e,a[l],!1,null),++l}while(l<a.length);e.maskKeyPress=!1}else w.call(e,t,n)},1)}}function E(t){var e=this;if(this.mask&&!this.readonly){var i=this.element.value,s=this.element.selectionStart,n=this.element.selectionEnd;this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd});var a=this.element.value.substring(0,s)+this.promptMask.substring(s,n)+this.element.value.substring(n);setTimeout(function(){D.call(e,a),e.element.selectionStart=e.element.selectionEnd=s,e.element.value!==i&&w.call(e,t,null)},0)}}function x(t){t.preventDefault()}function S(t){if(!0!==X.Browser.isIE||""!==this.element.value||"Never"!==this.floatLabelType){var e={ctrlKey:!1,keyCode:229};if(i.i(X.extend)(t,e),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||O.call(this,t),this.element.value.length>this.promptMask.length){var s=this.element.selectionStart,n=this.element.value.length-this.promptMask.length,a=this.element.value.substring(s-n,s);this.maskKeyPress=!1;var r=0;do{B.call(this,a[r],t.ctrlKey,t),++r}while(r<a.length);this.element.value!==this.preEleVal&&w.call(this,t,null)}var l=c.call(this,this.element);this.prevValue=l,this.value=l,""===l&&(D.call(this,this.promptMask),this.element.setSelectionRange(0,0))}}}function T(t){if(this.mask&&!this.readonly){229!==t.keyCode&&(!t.ctrlKey||89!==t.keyCode&&90!==t.keyCode||t.preventDefault(),O.call(this,t));var e=this.element.value;if(t.ctrlKey&&(89===t.keyCode||90===t.keyCode)){var i=void 0;90===t.keyCode&&this.undoCollec.length>0&&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}),D.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&&this.redoCollec.length>0&&e!==this.redoCollec[0].value&&(i=this.redoCollec[0],this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),D.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.redoCollec.splice(0,1))}}}function k(){var t,e=this.element.selectionStart,i=this.element.selectionEnd;this.redoCollec.length>0?(t=this.redoCollec[0],D.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)):(D.call(this,this.promptMask),this.element.selectionStart=this.element.selectionEnd=e)}function P(t,e,i){return"input"===i.type&&(t=!1,e=this.element.value,D.call(this,this.promptMask),I.call(this,e)),t}function O(t){var e,s=!1,n=!1;this.element.value.length<this.promptMask.length&&(s=!0,e=this.element.value,s=P.call(this,s,e,t),k.call(this)),this.element.value.length>=this.promptMask.length&&"input"===t.type&&(s=P.call(this,s,e,t));var a=this.element.selectionStart,r=this.element.selectionEnd,l=this.element.selectionStart,o=this.element.selectionEnd,h=this.hiddenMask.replace(/[>|\\<]/g,""),d=h[l-1],u=this.element.selectionEnd;if(s||8===t.keyCode||46===t.keyCode){this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:o});var c=!1,p=this.element.value;if(l>0||(8===t.keyCode||46===t.keyCode)&&l<this.element.value.length&&this.element.selectionEnd-l!==this.element.value.length){var m=l;l!==o?(l=o,46===t.keyCode&&(c=!0)):46===t.keyCode?++m:--m;for(var f=l;8===t.keyCode||s||c?f>m:f<m;8===t.keyCode||s||c?f--:f++)for(var v=l;8===t.keyCode||s||c?v>0:v<this.element.value.length;8===t.keyCode||s||c?v--:v++){var g=void 0;(8===t.keyCode||c)&&(a!==r&&a!==l||a===r)||s?(d=h[v-1],g=l-1):(d=h[v],g=l,++l);var y=this.element.value[g];if(i.i(X.isNullOrUndefined)(this.regExpCollec[""+d])&&!i.i(X.isNullOrUndefined)(this.customCharacters)&&i.i(X.isNullOrUndefined)(this.customCharacters[""+d])&&this.hiddenMask[g]!==this.promptChar&&"["!==this.customRegExpCollec[g][0]&&"]"!==this.customRegExpCollec[g][this.customRegExpCollec[g].length-1]||this.promptMask[g]!==this.promptChar&&i.i(X.isNullOrUndefined)(this.customCharacters))this.element.selectionStart=this.element.selectionEnd=g,t.preventDefault(),46!==t.keyCode||c||++this.element.selectionStart;else{var b=this.element.value,C=this.promptChar,E=b.substring(0,g)+C+b.substring(l,b.length);D.call(this,E),t.preventDefault(),46!==t.keyCode||c||g++,this.element.selectionStart=this.element.selectionEnd=g,n=!0}if(l=this.element.selectionStart,!n&&8===t.keyCode||c||!n&&46!==t.keyCode?g=l-1:(g=l,n=!1),y=this.element.value[g],a!==r&&this.element.selectionStart===a||this.promptMask[g]===this.promptChar||y!==this.promptMask[g]&&this.promptMask[g]!==this.promptChar&&!i.i(X.isNullOrUndefined)(this.customCharacters))break}}46===t.keyCode&&c&&n&&(this.element.selectionStart=this.element.selectionEnd=u),0===this.element.selectionStart&&this.element.selectionEnd===this.element.value.length&&(D.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!==p&&w.call(this,t,e)}}function L(t){if(this.mask&&!this.readonly){var e=this.element.value;if(!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;var i=t.key;"Spacebar"===i&&(i=String.fromCharCode(t.keyCode)),i?i&&1===i.length&&(B.call(this,i,t.ctrlKey,t),t.preventDefault()):(this.isIosInvalid=!0,B.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&&w.call(this,t,e)}}function w(t,e){var s=this.isProtectedOnChange;if(!i.i(X.isNullOrUndefined)(this.changeEventArgs)&&!this.isInitial){var n={};this.changeEventArgs={value:this.element.value,maskedValue:this.element.value,isInteraction:!1,isInteracted:!1},this.mask&&(this.changeEventArgs.value=c.call(this,this.element)),i.i(X.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,i.i(X.merge)(n,this.changeEventArgs),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",n)}this.preEleVal=this.element.value,this.prevValue=c.call(this,this.element)}function H(t){if(this.mask&&!this.readonly){var e=void 0;if(this.maskKeyPress||229!==t.keyCode)F.call(this);else{var i=void 0;if(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){var s=this.element.selectionStart,n=this.element.value.length-this.promptMask.length,a=this.element.value.substring(s-n,s);if(this.undoCollec.length>0){e=this.undoCollec[this.undoCollec.length-1];var r=this.element.selectionStart;i=e.value;var l=e.value.substring(r-n,r);e=this.redoCollec[0],a=a.trim();var o=X.Browser.isAndroid&&""===a;o||l===a||e.value.substring(r-n,r)===a?o&&R.call(this,t,r-1,this.element.selectionEnd-1,a,t.ctrlKey,!1):B.call(this,a,t.ctrlKey,t)}else i=this.promptMask,B.call(this,a,t.ctrlKey,t);this.maskKeyPress=!1,w.call(this,t,i)}}var h=c.call(this,this.element);(0!==this.element.selectionStart||this.promptMask!==this.element.value||""!==h||""===h&&this.value!==h)&&(this.prevValue=h,this.value=h)}else w.call(this,t);if(0===this.element.selectionStart&&0===this.element.selectionEnd){var d=this.element;setTimeout(function(){d.setSelectionRange(0,0)},0)}}function A(t){if(t.length>1&&this.promptMask.length+t.length<this.element.value.length){var 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);D.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}function N(t){this.maskKeyPress||A.call(this,t)}function B(t,e,s){if(N.call(this,t),!i.i(X.isNullOrUndefined)(this)&&!i.i(X.isNullOrUndefined)(t))for(var n,a,r=this.element.selectionStart,l=r,o=!1,h=this.element.value,d=!1,u=!1,c=0;c<t.length;c++){var p=t[c];if(r=this.element.selectionStart,this.maskKeyPress||l!==r||(r+=c),!this.maskKeyPress||r<this.promptMask.length){for(var m=r;m<this.promptMask.length;m++){var f=this.escapeMaskValue;n=f[r],"\\"===this.hiddenMask[r]&&this.hiddenMask[r+1]===t&&(u=!0),(i.i(X.isNullOrUndefined)(this.regExpCollec[""+n])&&(i.i(X.isNullOrUndefined)(this.customCharacters)||!i.i(X.isNullOrUndefined)(this.customCharacters)&&i.i(X.isNullOrUndefined)(this.customCharacters[""+n]))&&this.hiddenMask[r]!==this.promptChar&&"["!==this.customRegExpCollec[r][0]&&"]"!==this.customRegExpCollec[r][this.customRegExpCollec[r].length-1]||this.promptMask[r]!==this.promptChar&&i.i(X.isNullOrUndefined)(this.customCharacters)||this.promptChar===n&&this.escapeMaskValue===this.mask)&&(this.element.selectionStart=this.element.selectionEnd=r+1,r=this.element.selectionStart,n=this.hiddenMask[r])}if(i.i(X.isNullOrUndefined)(this.customCharacters)||i.i(X.isNullOrUndefined)(this.customCharacters[""+n]))!i.i(X.isNullOrUndefined)(this.regExpCollec[""+n])&&p.match(new RegExp(this.regExpCollec[""+n]))&&this.promptMask[r]===this.promptChar?o=!0:this.promptMask[r]===this.promptChar&&"["===this.customRegExpCollec[r][0]&&"]"===this.customRegExpCollec[r][this.customRegExpCollec[r].length-1]&&p.match(new RegExp(this.customRegExpCollec[r]))&&(o=!0);else for(var v=this.customCharacters[""+n],g=v.split(","),m=0;m<g.length;m++)if(p.match(new RegExp("["+g[m]+"]"))){o=!0;break}if((!this.maskKeyPress||r<this.hiddenMask.length)&&o){if(0===c)if(this.maskKeyPress)this.undoCollec.push({value:h,startIndex:r,endIndex:r});else{var y=this.element.selectionStart,b=this.element.selectionEnd;this.redoCollec.length>0?(a=this.redoCollec[0].value,D.call(this,a),this.undoCollec.push(this.redoCollec[0])):(this.undoCollec.push({value:this.promptMask,startIndex:r,endIndex:r}),a=this.promptMask,D.call(this,a)),this.element.selectionStart=y,this.element.selectionEnd=b}r=this.element.selectionStart,U.call(this,s,r,p,a,u),d=!0,c===t.length-1&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),o=!1}else r=this.element.selectionStart,R.call(this,s,r,l,t,e,d);c!==t.length-1||o||(!X.Browser.isAndroid||X.Browser.isAndroid&&r<this.promptMask.length)&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd})}else 1!==t.length||e||i.i(X.isNullOrUndefined)(s)||V.call(this)}}function U(t,e,i,s,n){if(this.hiddenMask.length>this.promptMask.length&&(i=M.call(this,i,this.element.value)),!n){var a=this.element.value,r=a.substring(0,e)+i+a.substring(e+1,a.length);D.call(this,r),this.element.selectionStart=this.element.selectionEnd=e+1}}function R(t,e,s,n,a,r){if(!this.maskKeyPress){var l=this.element.value;e>=this.promptMask.length?D.call(this,l.substring(0,e)):(s===e?D.call(this,l.substring(0,e)+l.substring(e+1,l.length)):this.promptMask.length===this.element.value.length?D.call(this,l.substring(0,e)+l.substring(e,l.length)):D.call(this,l.substring(0,s)+l.substring(s+1,l.length)),this.element.selectionStart=this.element.selectionEnd=r||this.element.value[s]!==this.promptChar?e:s),V.call(this)}1!==n.length||a||i.i(X.isNullOrUndefined)(t)||V.call(this)}function V(){var t=this,e=this.element.parentNode,s=200;e.classList.contains(Y)||e.classList.contains(G)?i.i(X.addClass)([e],Z):i.i(X.addClass)([this.element],Z),!0===this.isIosInvalid&&(s=400),i.i(X.attributes)(this.element,{"aria-invalid":"true"}),setTimeout(function(){t.maskKeyPress||F.call(t)},s)}function F(){var t=this.element.parentNode;i.i(X.isNullOrUndefined)(t)||i.i(X.removeClass)([t],Z),i.i(X.removeClass)([this.element],Z),i.i(X.attributes)(this.element,{"aria-invalid":"false"})}function M(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(;s>=0&&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}function I(t){if(this.mask&&void 0!==t&&(void 0===this.prevValue||this.prevValue!==t)){if(this.maskKeyPress=!0,D.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++)B.call(this,t[e],!1,null);var s=c.call(this,this.element);this.prevValue=s,this.value=s,w.call(this,null,null),this.maskKeyPress=!1;var n=this.element.parentNode.querySelector(".e-float-text");this.element.value===this.promptMask&&"Auto"===this.floatLabelType&&this.placeholder&&!i.i(X.isNullOrUndefined)(n)&&n.classList.contains($)&&!this.isFocus&&(i.i(X.removeClass)([n],$),i.i(X.addClass)([n],Q),D.call(this,""))}(null===this.mask||""===this.mask&&void 0!==this.value)&&D.call(this,this.value)}function D(t,e){!this.isFocus&&"Auto"===this.floatLabelType&&this.placeholder&&i.i(X.isNullOrUndefined)(this.value)&&(t="");var s=c.call(this,e||this.element,t);null===s||""===s?(K.a.setValue(t,e||this.element,this.floatLabelType,!1),this.showClearButton&&this.inputObj.clearButton.classList.add("e-clear-icon-hide")):K.a.setValue(t,e||this.element,this.floatLabelType,this.showClearButton)}function z(t){var e=q(t);n.call(e);var i=c.call(this,this.element);this.prevValue=i,this.value=i,t.mask&&(r.call(e),a.call(e))}function q(t){i.i(X.addClass)([t.element],J);var e={element:t.element,mask:t.mask,promptMask:"",hiddenMask:"",escapeMaskValue:"",promptChar:t.promptChar?t.promptChar.length>1?t.promptChar=t.promptChar[0]:t.promptChar:"_",value:t.value?t.value:null,regExpCollec:tt,customRegExpCollec:[],customCharacters:t.customCharacters,undoCollec:[],redoCollec:[],maskKeyPress:!1,prevValue:""};return s.call(e),e}function W(t){return c.call(_(t),t.element)}function j(t){return u.call(_(t),t.element)}function _(t){var e;return!i.i(X.isNullOrUndefined)(t)&&t.element.classList.contains(J)&&(e=q(t)),e}i.d(e,"a",function(){return tt}),e.b=s,e.c=n,e.d=a,e.e=r,e.f=l,e.g=u,e.h=c,e.i=m,e.j=f,e.k=v,e.l=g,e.m=y,e.n=b,e.o=x,e.p=k,e.q=I,e.r=D,e.s=z,e.t=W,e.u=j,i.d(e,"v",function(){return et});var X=i(0),K=(i.n(X),i(1)),Z="e-error",Y="e-input-group",G="e-float-input",J="e-utility-mask",$="e-label-top",Q="e-label-bottom",tt={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 ]"},et=function(){function t(){}return t}();new et},function(t,e,i){"use strict";var s=i(23);i.d(e,"a",function(){return s.a})},function(t,e,i){"use strict";i.d(e,"a",function(){return h});var s=i(0),n=(i.n(s),i(1)),a=i(3),r=this&&this.__extends||function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),l=this&&this.__decorate||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;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},o=["title","style","class"],h=function(t){function e(e,i){var s=t.call(this,e,i)||this;return s.initInputValue="",s.isAngular=!1,s.preventChange=!1,s.isClicked=!1,s.maskOptions=e,s}return r(e,t),e.prototype.getModuleName=function(){return"maskedtextbox"},e.prototype.preRender=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.regExpCollec=a.a,this.customRegExpCollec=[],this.undoCollec=[],this.redoCollec=[],this.changeEventArgs={},this.focusEventArgs={},this.blurEventArgs={},this.maskKeyPress=!1,this.isFocus=!1,this.isInitial=!1,this.isIosInvalid=!1;var t=i.i(s.getValue)("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),i.i(s.removeClass)([this.cloneElement],["e-control","e-maskedtextbox","e-lib"]),this.angularTagName=null,this.formElement=i.i(s.closest)(this.element,"form"),"EJS-MASKEDTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;for(var e=this.createElement("input"),n=0;n<this.element.attributes.length;n++)e.setAttribute(this.element.attributes[n].nodeName,this.element.attributes[n].nodeValue),e.innerHTML=this.element.innerHTML;this.element.hasAttribute("id")&&this.element.removeAttribute("id"),this.element.classList.remove("e-control","e-maskedtextbox"),this.element.classList.add("e-mask-container"),this.element.appendChild(e),this.element=e,i.i(s.setValue)("ej2_instances",t,this.element)}this.updateHTMLAttrToElement(),this.checkHtmlAttributes(!1),this.formElement&&(this.initInputValue=this.value)},e.prototype.getPersistData=function(){var t=["value"];return this.addOnPersist(t)},e.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&("Never"===this.floatLabelType&&i.i(s.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,s.Browser.isDevice||"11.0"!==s.Browser.info.version&&"edge"!==s.Browser.info.name||this.element.blur(),s.Browser.isDevice&&s.Browser.isIos&&this.element.blur(),(this.element.getAttribute("value")||this.value)&&this.element.setAttribute("value",this.element.value),!i.i(s.isNullOrUndefined)(i.i(s.closest)(this.element,"fieldset"))&&i.i(s.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete())},e.prototype.updateHTMLAttrToElement=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var n=e[t];o.indexOf(n)<0&&this.element.setAttribute(n,this.htmlAttributes[""+n])}},e.prototype.updateCssClass=function(t,e){n.a.setCssClass(this.getValidClassList(t),[this.inputObj.container],this.getValidClassList(e))},e.prototype.getValidClassList=function(t){var e=t;return i.i(s.isNullOrUndefined)(t)||""===t||(e=t.replace(/\s+/g," ").trim()),e},e.prototype.updateHTMLAttrToWrapper=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var n=e[t];if(o.indexOf(n)>-1)if("class"===n){var a=this.htmlAttributes[""+n].replace(/\s+/g," ").trim();""!==a&&i.i(s.addClass)([this.inputObj.container],a.split(" "))}else if("style"===n){var r=this.inputObj.container.getAttribute(n);r=i.i(s.isNullOrUndefined)(r)?this.htmlAttributes[""+n]:r+this.htmlAttributes[""+n],this.inputObj.container.setAttribute(n,r)}else this.inputObj.container.setAttribute(n,this.htmlAttributes[""+n])}},e.prototype.resetMaskedTextBox=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.customRegExpCollec=[],this.undoCollec=[],this.redoCollec=[],this.promptChar.length>1&&(this.promptChar=this.promptChar[0]),a.b.call(this),a.c.call(this),(null===this.mask||""===this.mask&&void 0!==this.value)&&a.r.call(this,this.value);var t=a.h.call(this,this.element);this.prevValue=t,this.value=t,this.isInitial||a.e.call(this),a.d.call(this)},e.prototype.setMaskPlaceholder=function(t,e){(e||this.placeholder)&&(n.a.setPlaceholder(this.placeholder,this.element),(this.element.value===this.promptMask&&t&&"Always"!==this.floatLabelType||this.element.value===this.promptMask&&"Never"===this.floatLabelType)&&a.r.call(this,""))},e.prototype.setWidth=function(t){if(!i.i(s.isNullOrUndefined)(t))if("number"==typeof t)this.inputObj.container.style.width=i.i(s.formatUnit)(t),this.element.style.width=i.i(s.formatUnit)(t);else if("string"==typeof t){var e=t.match(/px|%|em/)?t:i.i(s.formatUnit)(t);this.inputObj.container.style.width=e,this.element.style.width=e}},e.prototype.checkHtmlAttributes=function(t){for(var e=t?i.i(s.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"],n=0,a=e;n<a.length;n++){var r=a[n];if(!i.i(s.isNullOrUndefined)(this.element.getAttribute(r)))switch(r){case"placeholder":(i.i(s.isNullOrUndefined)(this.maskOptions)||void 0===this.maskOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"disabled":if(i.i(s.isNullOrUndefined)(this.maskOptions)||void 0===this.maskOptions.enabled||t){var l="disabled"!==this.element.getAttribute(r)&&""!==this.element.getAttribute(r)&&"true"!==this.element.getAttribute(r);this.setProperties({enabled:l},!t)}break;case"value":(i.i(s.isNullOrUndefined)(this.maskOptions)||void 0===this.maskOptions.value||t)&&this.setProperties({value:this.element.value},!t);break;case"readonly":if(i.i(s.isNullOrUndefined)(this.maskOptions)||void 0===this.maskOptions.readonly||t){var o="readonly"===this.element.getAttribute(r)||""===this.element.getAttribute(r)||"true"===this.element.getAttribute(r);this.setProperties({readonly:o},!t)}}}},e.prototype.createWrapper=function(){var t=this.cssClass;i.i(s.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(t=this.getValidClassList(this.cssClass)),this.inputObj=n.a.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"))},e.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){switch(s[i]){case"value":a.q.call(this,this.value),this.placeholder&&!this.isFocus&&this.setMaskPlaceholder(!1,!1),""===this.value&&(this.element.selectionStart=0,this.element.selectionEnd=0);break;case"placeholder":this.setMaskPlaceholder(!0,!0);break;case"width":this.setWidth(t.width),n.a.calculateWidth(this.element,this.inputObj.container);break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"enabled":n.a.setEnabled(t.enabled,this.element,this.floatLabelType,this.inputObj.container);break;case"readonly":n.a.setReadonly(t.readonly,this.element);break;case"enableRtl":n.a.setEnableRtl(t.enableRtl,[this.inputObj.container]);break;case"customCharacters":this.customCharacters=t.customCharacters,this.resetMaskedTextBox();break;case"showClearButton":n.a.setClearButton(t.showClearButton,this.element,this.inputObj,void 0,this.createElement),a.f.call(this);break;case"floatLabelType":this.floatLabelType=t.floatLabelType,n.a.removeFloating(this.inputObj),n.a.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement);break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkHtmlAttributes(!0);break;case"mask":var r=this.value;this.mask=t.mask,this.updateValue(r);break;case"promptChar":t.promptChar.length>1&&(t.promptChar=t.promptChar[0]),t.promptChar?this.promptChar=t.promptChar:this.promptChar="_";var l=this.element.value.replace(new RegExp("["+e.promptChar+"]","g"),this.promptChar);this.promptMask===this.element.value&&(l=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=[],a.r.call(this,l)}}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},e.prototype.updateValue=function(t){this.resetMaskedTextBox(),a.q.call(this,t)},e.prototype.getMaskedValue=function(){return a.g.call(this,this.element)},e.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.isFocus=!0,this.element.focus(),i.i(s.addClass)([this.inputObj.container],["e-input-focus"]))},e.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.isFocus=!1,this.element.blur(),i.i(s.removeClass)([this.inputObj.container],["e-input-focus"]))},e.prototype.destroy=function(){a.e.call(this);for(var e=["aria-labelledby","role","autocomplete","aria-readonly","aria-disabled","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-invalid"],r=0;r<e.length;r++)this.element.removeAttribute(e[r]);this.element.classList.remove("e-input"),this.inputObj&&(this.inputObj.container.insertAdjacentElement("afterend",this.element),i.i(s.detach)(this.inputObj.container)),this.blurEventArgs=null,n.a.destroy(),this.changeEventArgs=null,this.inputObj=null,t.prototype.destroy.call(this)},l([i.i(s.Property)(null)],e.prototype,"cssClass",void 0),l([i.i(s.Property)(null)],e.prototype,"width",void 0),l([i.i(s.Property)(null)],e.prototype,"placeholder",void 0),l([i.i(s.Property)("Never")],e.prototype,"floatLabelType",void 0),l([i.i(s.Property)({})],e.prototype,"htmlAttributes",void 0),l([i.i(s.Property)(!0)],e.prototype,"enabled",void 0),l([i.i(s.Property)(!1)],e.prototype,"readonly",void 0),l([i.i(s.Property)(!1)],e.prototype,"showClearButton",void 0),l([i.i(s.Property)(!1)],e.prototype,"enablePersistence",void 0),l([i.i(s.Property)(null)],e.prototype,"mask",void 0),l([i.i(s.Property)("_")],e.prototype,"promptChar",void 0),l([i.i(s.Property)(null)],e.prototype,"value",void 0),l([i.i(s.Property)(null)],e.prototype,"customCharacters",void 0),l([i.i(s.Event)()],e.prototype,"created",void 0),l([i.i(s.Event)()],e.prototype,"destroyed",void 0),l([i.i(s.Event)()],e.prototype,"change",void 0),l([i.i(s.Event)()],e.prototype,"focus",void 0),l([i.i(s.Event)()],e.prototype,"blur",void 0),e=l([s.NotifyPropertyChanges],e)}(s.Component)},function(t,e,i){"use strict";i.d(e,"a",function(){return u});var s=i(0),n=(i.n(s),i(1)),a=this&&this.__extends||function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),r=this&&this.__decorate||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;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},l="e-input-group-icon",o=new RegExp("^(-)?(\\d*)$"),h=["title","style","class"],d=0,u=function(t){function e(e,i){var s=t.call(this,e,i)||this;return s.isVue=!1,s.preventChange=!1,s.isAngular=!1,s.isDynamicChange=!1,s.numericOptions=e,s}return a(e,t),e.prototype.preRender=function(){this.isPrevFocused=!1,this.decimalSeparator=".",this.intRegExp=new RegExp("/^(-)?(d*)$/"),this.isCalled=!1;var t=i.i(s.getValue)("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),i.i(s.removeClass)([this.cloneElement],["e-control","e-numerictextbox","e-lib"]),this.angularTagName=null,this.formEle=i.i(s.closest)(this.element,"form"),"EJS-NUMERICTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;var e=this.createElement("input"),n=0;for(n;n<this.element.attributes.length;n++){var a=this.element.attributes[n].nodeName;"id"!==a&&"class"!==a?(e.setAttribute(this.element.attributes[n].nodeName,this.element.attributes[n].nodeValue),e.innerHTML=this.element.innerHTML):"class"===a&&e.setAttribute(a,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,i.i(s.setValue)("ej2_instances",t,this.element)}i.i(s.attributes)(this.element,{role:"spinbutton",tabindex:"0",autocomplete:"off"});var r={incrementTitle:"Increment value",decrementTitle:"Decrement value",placeholder:this.placeholder};this.l10n=new s.L10n("numerictextbox",r,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",i.i(s.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"),!i.i(s.isNullOrUndefined)(i.i(s.closest)(this.element,"fieldset"))&&i.i(s.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete())},e.prototype.checkAttributes=function(t){for(var e=t?i.i(s.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","step","disabled","readonly","style","name","placeholder"],n=0,a=e;n<a.length;n++){var r=a[n];if(!i.i(s.isNullOrUndefined)(this.element.getAttribute(r)))switch(r){case"disabled":if(i.i(s.isNullOrUndefined)(this.numericOptions)||void 0===this.numericOptions.enabled||t){var l="disabled"!==this.element.getAttribute(r)&&""!==this.element.getAttribute(r)&&"true"!==this.element.getAttribute(r);this.setProperties({enabled:l},!t)}break;case"readonly":if(i.i(s.isNullOrUndefined)(this.numericOptions)||void 0===this.numericOptions.readonly||t){var o="readonly"===this.element.getAttribute(r)||""===this.element.getAttribute(r)||"true"===this.element.getAttribute(r);this.setProperties({readonly:o},!t)}break;case"placeholder":(i.i(s.isNullOrUndefined)(this.numericOptions)||void 0===this.numericOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"value":if(i.i(s.isNullOrUndefined)(this.numericOptions)||void 0===this.numericOptions.value||t){var h=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r));this.setProperties(i.i(s.setValue)(r,h,{}),!t)}break;case"min":if(i.i(s.isNullOrUndefined)(this.numericOptions)||void 0===this.numericOptions.min||t){var d=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r));null===d||isNaN(d)||this.setProperties(i.i(s.setValue)(r,d,{}),!t)}break;case"max":if(i.i(s.isNullOrUndefined)(this.numericOptions)||void 0===this.numericOptions.max||t){var u=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r));null===u||isNaN(u)||this.setProperties(i.i(s.setValue)(r,u,{}),!t)}break;case"step":if(i.i(s.isNullOrUndefined)(this.numericOptions)||void 0===this.numericOptions.step||t){var c=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r));null===c||isNaN(c)||this.setProperties(i.i(s.setValue)(r,c,{}),!t)}break;case"style":this.inputStyle=this.element.getAttribute(r);break;case"name":this.inputName=this.element.getAttribute(r);break;default:var p=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r));(null!==p&&!isNaN(p)||"value"===r)&&this.setProperties(i.i(s.setValue)(r,p,{}),!0)}}},e.prototype.updatePlaceholder=function(){this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0)},e.prototype.initCultureFunc=function(){this.instance=new s.Internationalization(this.locale)},e.prototype.initCultureInfo=function(){this.cultureInfo.format=this.format,null!==i.i(s.getValue)("currency",this)&&(i.i(s.setValue)("currency",this.currency,this.cultureInfo),this.setProperties({currencyCode:this.currency},!0))},e.prototype.createWrapper=function(){var t=this.cssClass;i.i(s.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(t=this.getNumericValidClassList(this.cssClass));var e=n.a.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=e,this.container=e.container,this.container.setAttribute("class","e-control-wrapper e-numeric "+this.container.getAttribute("class")),this.updateHTMLAttrToWrapper(),this.readonly&&i.i(s.attributes)(this.element,{"aria-readonly":"true"}),this.hiddenInput=this.createElement("input",{attrs:{type:"text",validateHidden:"true",class:"e-numeric-hidden"}}),this.inputName=null!==this.inputName?this.inputName:this.element.id,this.element.removeAttribute("name"),this.isAngular&&"EJS-NUMERICTEXTBOX"===this.angularTagName&&this.cloneElement.id.length>0?i.i(s.attributes)(this.hiddenInput,{name:this.cloneElement.id}):i.i(s.attributes)(this.hiddenInput,{name:this.inputName}),this.container.insertBefore(this.hiddenInput,this.container.childNodes[1]),this.updateDataAttribute(!1),null!==this.inputStyle&&i.i(s.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(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var n=e[t];h.indexOf(n)<0&&this.element.setAttribute(n,this.htmlAttributes[""+n])}},e.prototype.updateCssClass=function(t,e){n.a.setCssClass(this.getNumericValidClassList(t),[this.container],this.getNumericValidClassList(e))},e.prototype.getNumericValidClassList=function(t){var e=t;return i.i(s.isNullOrUndefined)(t)||""===t||(e=t.replace(/\s+/g," ").trim()),e},e.prototype.updateHTMLAttrToWrapper=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var n=e[t];if(h.indexOf(n)>-1)if("class"===n){var a=this.getNumericValidClassList(this.htmlAttributes[""+n]);""!==a&&i.i(s.addClass)([this.container],a.split(" "))}else if("style"===n){var r=this.container.getAttribute(n);r=i.i(s.isNullOrUndefined)(r)?this.htmlAttributes[""+n]:r+this.htmlAttributes[""+n],this.container.setAttribute(n,r)}else this.container.setAttribute(n,this.htmlAttributes[""+n])}},e.prototype.setElementWidth=function(t){i.i(s.isNullOrUndefined)(t)||("number"==typeof t?this.container.style.width=i.i(s.formatUnit)(t):"string"==typeof t&&(this.container.style.width=t.match(/px|%|em/)?t:i.i(s.formatUnit)(t)))},e.prototype.spinBtnCreation=function(){this.spinDown=n.a.appendSpan(l+" e-spin-down",this.container,this.createElement),i.i(s.attributes)(this.spinDown,{title:this.l10n.getConstant("decrementTitle")}),this.spinUp=n.a.appendSpan(l+" e-spin-up",this.container,this.createElement),i.i(s.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&&i.i(s.attributes)(this.element,{"aria-valuemin":this.min.toString()}),this.max!==Number.MAX_VALUE&&i.i(s.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?i.i(s.removeClass)([this.container],"e-error"):i.i(s.addClass)([this.container],"e-error"),i.i(s.attributes)(this.element,{"aria-invalid":this.isValidState?"false":"true"})},e.prototype.bindClearEvent=function(){this.showClearButton&&s.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){if(this.setProperties({value:null},!0),this.setElementValue(""),this.hiddenInput.value="",i.i(s.closest)(this.element,"form")){var e=this.element.nextElementSibling,n=document.createEvent("KeyboardEvent");n.initEvent("keyup",!1,!0),e.dispatchEvent(n)}},e.prototype.resetFormHandler=function(){"EJS-NUMERICTEXTBOX"===this.element.tagName?this.updateValue(null):this.updateValue(this.inputEleValue)},e.prototype.setSpinButton=function(){i.i(s.isNullOrUndefined)(this.spinDown)||i.i(s.attributes)(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),i.i(s.isNullOrUndefined)(this.spinUp)||i.i(s.attributes)(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")})},e.prototype.wireEvents=function(){s.EventHandler.add(this.element,"focus",this.focusHandler,this),s.EventHandler.add(this.element,"blur",this.focusOutHandler,this),s.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),s.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),s.EventHandler.add(this.element,"input",this.inputHandler,this),s.EventHandler.add(this.element,"keypress",this.keyPressHandler,this),s.EventHandler.add(this.element,"change",this.changeHandler,this),s.EventHandler.add(this.element,"paste",this.pasteHandler,this),this.enabled&&(this.bindClearEvent(),this.formEle&&s.EventHandler.add(this.formEle,"reset",this.resetFormHandler,this))},e.prototype.wireSpinBtnEvents=function(){s.EventHandler.add(this.spinUp,s.Browser.touchStartEvent,this.mouseDownOnSpinner,this),s.EventHandler.add(this.spinDown,s.Browser.touchStartEvent,this.mouseDownOnSpinner,this),s.EventHandler.add(this.spinUp,s.Browser.touchEndEvent,this.mouseUpOnSpinner,this),s.EventHandler.add(this.spinDown,s.Browser.touchEndEvent,this.mouseUpOnSpinner,this),s.EventHandler.add(this.spinUp,s.Browser.touchMoveEvent,this.touchMoveOnSpinner,this),s.EventHandler.add(this.spinDown,s.Browser.touchMoveEvent,this.touchMoveOnSpinner,this)},e.prototype.unwireEvents=function(){s.EventHandler.remove(this.element,"focus",this.focusHandler),s.EventHandler.remove(this.element,"blur",this.focusOutHandler),s.EventHandler.remove(this.element,"keyup",this.keyUpHandler),s.EventHandler.remove(this.element,"input",this.inputHandler),s.EventHandler.remove(this.element,"keydown",this.keyDownHandler),s.EventHandler.remove(this.element,"keypress",this.keyPressHandler),s.EventHandler.remove(this.element,"change",this.changeHandler),s.EventHandler.remove(this.element,"paste",this.pasteHandler),this.formEle&&s.EventHandler.remove(this.formEle,"reset",this.resetFormHandler)},e.prototype.unwireSpinBtnEvents=function(){s.EventHandler.remove(this.spinUp,s.Browser.touchStartEvent,this.mouseDownOnSpinner),s.EventHandler.remove(this.spinDown,s.Browser.touchStartEvent,this.mouseDownOnSpinner),s.EventHandler.remove(this.spinUp,s.Browser.touchEndEvent,this.mouseUpOnSpinner),s.EventHandler.remove(this.spinDown,s.Browser.touchEndEvent,this.mouseUpOnSpinner),s.EventHandler.remove(this.spinUp,s.Browser.touchMoveEvent,this.touchMoveOnSpinner),s.EventHandler.remove(this.spinDown,s.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){if(this.prevValue!==this.value||this.prevValue!==this.inputValue){var 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),i.i(s.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=this;if(this.enabled&&!this.readonly){var e=this.element.value;setTimeout(function(){t.numericRegex().test(t.element.value)||t.setElementValue(e)})}},e.prototype.preventHandler=function(){var t=this,e=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);setTimeout(function(){if(t.element.selectionStart>0){var n=t.element.selectionStart,a=t.element.selectionStart-1,r=t.element.value.split(""),l=i.i(s.getNumericObject)(t.locale),o=i.i(s.getValue)("decimal",l),h=o.charCodeAt(0);" "===t.element.value[a]&&t.element.selectionStart>0&&!e?(i.i(s.isNullOrUndefined)(t.prevVal)?t.element.value=t.element.value.trim():0!==a?t.element.value=t.prevVal:0===a&&(t.element.value=t.element.value.trim()),t.element.setSelectionRange(a,a)):isNaN(parseFloat(t.element.value[t.element.selectionStart-1]))&&45!==t.element.value[t.element.selectionStart-1].charCodeAt(0)?(r.indexOf(t.element.value[t.element.selectionStart-1])!==r.lastIndexOf(t.element.value[t.element.selectionStart-1])&&t.element.value[t.element.selectionStart-1].charCodeAt(0)===h||t.element.value[t.element.selectionStart-1].charCodeAt(0)!==h)&&(t.element.value=t.element.value.substring(0,a)+t.element.value.substring(n,t.element.value.length),t.element.setSelectionRange(a,a),isNaN(parseFloat(t.element.value[t.element.selectionStart-1]))&&t.element.selectionStart>0&&t.element.value.length&&t.preventHandler()):isNaN(parseFloat(t.element.value[t.element.selectionStart-2]))&&t.element.selectionStart>1&&45!==t.element.value[t.element.selectionStart-2].charCodeAt(0)&&(r.indexOf(t.element.value[t.element.selectionStart-2])!==r.lastIndexOf(t.element.value[t.element.selectionStart-2])&&t.element.value[t.element.selectionStart-2].charCodeAt(0)===h||t.element.value[t.element.selectionStart-2].charCodeAt(0)!==h)&&(t.element.setSelectionRange(a,a),t.nextEle=t.element.value[t.element.selectionStart],t.cursorPosChanged=!0,t.preventHandler()),!0===t.cursorPosChanged&&t.element.value[t.element.selectionStart]===t.nextEle&&isNaN(parseFloat(t.element.value[t.element.selectionStart-1]))&&(t.element.setSelectionRange(t.element.selectionStart+1,t.element.selectionStart+1),t.cursorPosChanged=!1,t.nextEle=null),""===t.element.value.trim()&&t.element.setSelectionRange(0,0),t.element.selectionStart>0&&(45===t.element.value[t.element.selectionStart-1].charCodeAt(0)&&t.element.selectionStart>1&&(i.i(s.isNullOrUndefined)(t.prevVal)?t.element.value=t.element.value:t.element.value=t.prevVal,t.element.setSelectionRange(t.element.selectionStart,t.element.selectionStart)),t.element.value[t.element.selectionStart-1]===o&&0===t.decimals&&t.validateDecimalOnType&&(t.element.value=t.element.value.substring(0,a)+t.element.value.substring(n,t.element.value.length))),t.prevVal=t.element.value}})},e.prototype.keyUpHandler=function(){if(this.enabled&&!this.readonly){!(!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform))&&s.Browser.isDevice&&this.preventHandler();var t=this.instance.getNumberParser({format:"n"})(this.element.value);t=null===t||isNaN(t)?null:t,this.hiddenInput.value=t||0===t?t.toString():null;if(i.i(s.closest)(this.element,"form")){var e=this.element.nextElementSibling,n=document.createEvent("KeyboardEvent");n.initEvent("keyup",!1,!0),e.dispatchEvent(n)}}},e.prototype.inputHandler=function(t){var e=this;if(this.enabled&&!this.readonly){var n=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);if((navigator.userAgent.toLowerCase().indexOf("firefox")>-1||n)&&s.Browser.isDevice&&this.preventHandler(),this.isAngular&&this.element.value!==i.i(s.getValue)("decimal",i.i(s.getNumericObject)(this.locale))&&this.element.value!==i.i(s.getValue)("minusSign",i.i(s.getNumericObject)(this.locale))){var a=this.instance.getNumberParser({format:"n"})(this.element.value);a=isNaN(a)?null:a,e.localChange({value:a}),this.preventChange=!0}if(this.isVue){var r=this.instance.getNumberParser({format:"n"})(this.element.value),l=this.instance.getNumberParser({format:"n"})(this.elementPrevValue);(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])&&(r=this.value);var o={event:t,value:null===r||isNaN(r)?null:r,previousValue:null===l||isNaN(l)?null:l};this.preventChange=!0,this.elementPrevValue=this.element.value,this.trigger("input",o)}}},e.prototype.keyDownHandler=function(t){if(!this.readonly)switch(t.keyCode){case 38:t.preventDefault(),this.action("increment",t);break;case 40:t.preventDefault(),this.action("decrement",t)}},e.prototype.performAction=function(t,e,i){(null===t||isNaN(t))&&(t=0);var s="increment"===i?t+e:t-e;return s=this.correctRounding(t,e,s),this.strictMode?this.trimValue(s):s},e.prototype.correctRounding=function(t,e,i){var s=new RegExp("[,.](.*)"),n=s.test(t.toString()),a=s.test(e.toString());if(n||a){var r=n?s.exec(t.toString())[0].length:0,l=a?s.exec(e.toString())[0].length:0,o=Math.max(r,l);return t=this.roundValue(i,o)}return i},e.prototype.roundValue=function(t,e){e=e||0;var i=Math.pow(10,e);return t*=i,t=Math.round(t)/i},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){i.i(s.setValue)(t,e,this.cultureInfo),this.updateValue(this.value)},e.prototype.changeValue=function(t){if(t||0===t){var e=this.getNumberOfDecimals(t);this.setProperties({value:this.roundNumber(t,e)},!0)}else t=null,this.setProperties({value:t},!0);this.modifyText(),this.strictMode||this.validateState()},e.prototype.modifyText=function(){if(this.value||0===this.value){var t=this.formatNumber(),e=this.isFocused?t:this.instance.getNumberFormat(this.cultureInfo)(this.value);this.setElementValue(e),i.i(s.attributes)(this.element,{"aria-valuenow":t}),this.hiddenInput.value=this.value.toString(),null!==this.value&&this.serverDecimalSeparator&&(this.hiddenInput.value=this.hiddenInput.value.replace(".",this.serverDecimalSeparator))}else this.setElementValue(""),this.element.removeAttribute("aria-valuenow"),this.hiddenInput.value=null},e.prototype.setElementValue=function(t,e){n.a.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,n=new RegExp("[eE][-+]?([0-9]+)"),a=t.toString();if(n.test(a)){var r=n.exec(a);i.i(s.isNullOrUndefined)(r)||(a=t.toFixed(Math.min(parseInt(r[1],10),20)))}var l=a.split(".")[1];return e=l&&l.length?l.length:0,null!==this.decimals&&(e=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 i=t,s=e||0,n=i.toString().split("e");i=Math.round(Number(n[0]+"e"+(n[1]?Number(n[1])+s:s)));var a=i.toString().split("e");return i=Number(a[0]+"e"+(a[1]?Number(a[1])-s:-s)),Number(i.toFixed(s))},e.prototype.cancelEvent=function(t){return t.preventDefault(),!1},e.prototype.keyPressHandler=function(t){if(!this.enabled||this.readonly)return!0;if(!s.Browser.isDevice&&"11.0"===s.Browser.info.version&&13===t.keyCode){var e=this.instance.getNumberParser({format:"n"})(this.element.value);return this.updateValue(e,t),!0}if(0===t.which||t.metaKey||t.ctrlKey||8===t.keyCode||13===t.keyCode)return!0;var n=String.fromCharCode(t.which),a=i.i(s.getValue)("decimal",i.i(s.getNumericObject)(this.locale)),r="NumpadDecimal"===t.code&&n!==a;r&&(n=a);var l=this.element.value;if(l=l.substring(0,this.element.selectionStart)+n+l.substring(this.element.selectionEnd),this.numericRegex().test(l)){if(r){var o=this.element.selectionStart+1;this.element.value=l,this.element.setSelectionRange(o,o),t.preventDefault(),t.stopPropagation()}return!0}return t.preventDefault(),t.stopPropagation(),!1},e.prototype.numericRegex=function(){var t=i.i(s.getNumericObject)(this.locale),e=i.i(s.getValue)("decimal",t),n="*";return"."===e&&(e="\\"+e),0===this.decimals&&this.validateDecimalOnType?o:(this.decimals&&this.validateDecimalOnType&&(n="{0,"+this.decimals+"}"),new RegExp("^(-)?(((\\d+("+e+"\\d"+n+")?)|("+e+"\\d"+n+")))?$"))},e.prototype.mouseWheel=function(t){t.preventDefault();var e,i=t;i.wheelDelta?e=i.wheelDelta/120:i.detail&&(e=-i.detail/3),e>0?this.action("increment",t):e<0&&this.action("decrement",t),this.cancelEvent(t)},e.prototype.focusHandler=function(t){var e=this;if(clearTimeout(d),this.focusEventArgs={event:t,value:this.value,container:this.container},this.trigger("focus",this.focusEventArgs),this.enabled&&!this.readonly){if(this.isFocused=!0,i.i(s.removeClass)([this.container],"e-error"),this.prevValue=this.value,this.value||0===this.value){var n=this.formatNumber();if(this.setElementValue(n),!this.isPrevFocused)if(s.Browser.isDevice||"11.0"!==s.Browser.info.version){var a=s.Browser.isDevice&&s.Browser.isIos?600:0;d=setTimeout(function(){e.element.setSelectionRange(0,n.length)},a)}else this.element.setSelectionRange(0,n.length)}s.Browser.isDevice||s.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this)}},e.prototype.focusOutHandler=function(t){var e=this;if(this.blurEventArgs={event:t,value:this.value,container:this.container},this.trigger("blur",this.blurEventArgs),this.enabled&&!this.readonly){if(this.isPrevFocused){if(t.preventDefault(),s.Browser.isDevice){var n=this.element.value;this.element.focus(),this.isPrevFocused=!1;var a=this.element;setTimeout(function(){e.setElementValue(n,a)},200)}}else{this.isFocused=!1,this.element.value.length||this.setProperties({value:null},!0);var r=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(r),s.Browser.isDevice||s.EventHandler.remove(this.element,"mousewheel DOMMouseScroll",this.mouseWheel)}if(i.i(s.closest)(this.element,"form")){var l=this.element.nextElementSibling,o=document.createEvent("FocusEvent");o.initEvent("focusout",!1,!0),l.dispatchEvent(o)}}},e.prototype.mouseDownOnSpinner=function(t){var e=this;if(this.isFocused&&(this.isPrevFocused=!0,t.preventDefault()),this.getElementData(t)){var i=(this.getElementData(t),t.currentTarget),n=i.classList.contains("e-spin-up")?"increment":"decrement";s.EventHandler.add(i,"mouseleave",this.mouseUpClick,this),this.timeOut=setInterval(function(){e.isCalled=!0,e.action(n,t)},150),s.EventHandler.add(document,"mouseup",this.mouseUpClick,this)}},e.prototype.touchMoveOnSpinner=function(t){var e;if("touchmove"===t.type){var i=t.touches;e=i.length&&document.elementFromPoint(i[0].pageX,i[0].pageY)}else e=document.elementFromPoint(t.clientX,t.clientY);e.classList.contains(l)||clearInterval(this.timeOut)},e.prototype.mouseUpOnSpinner=function(t){if(this.prevValue=this.value,this.isPrevFocused&&(this.element.focus(),s.Browser.isDevice||(this.isPrevFocused=!1)),s.Browser.isDevice||t.preventDefault(),this.getElementData(t)){var e=t.currentTarget,n=e.classList.contains("e-spin-up")?"increment":"decrement";s.EventHandler.remove(e,"mouseleave",this.mouseUpClick),this.isCalled||this.action(n,t),this.isCalled=!1,s.EventHandler.remove(document,"mouseup",this.mouseUpClick);if(i.i(s.closest)(this.element,"form")){var a=this.element.nextElementSibling,r=document.createEvent("KeyboardEvent");r.initEvent("keyup",!1,!0),a.dispatchEvent(r)}}},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(){n.a.removeFloating(this.inputWrapper);var t=this.hiddenInput;this.hiddenInput.remove(),n.a.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&&s.EventHandler.remove(this.spinUp,"mouseleave",this.mouseUpClick),this.spinDown&&s.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,"increment")),this.raiseChangeEvent()},e.prototype.decrement=function(t){void 0===t&&(t=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,t,"decrement")),this.raiseChangeEvent()},e.prototype.destroy=function(){this.unwireEvents(),i.i(s.detach)(this.hiddenInput),this.showSpinButton&&(this.unwireSpinBtnEvents(),i.i(s.detach)(this.spinUp),i.i(s.detach)(this.spinDown));for(var e=["aria-labelledby","role","autocomplete","aria-readonly","aria-disabled","autocapitalize","spellcheck","aria-autocomplete","tabindex","aria-valuemin","aria-valuemax","aria-valuenow","aria-invalid"],a=0;a<e.length;a++)this.element.removeAttribute(e[a]);this.element.classList.remove("e-input"),this.container.insertAdjacentElement("afterend",this.element),i.i(s.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,n.a.destroy(),t.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(),i.i(s.addClass)([this.container],["e-input-focus"]))},e.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),i.i(s.removeClass)([this.container],["e-input-focus"]))},e.prototype.getPersistData=function(){var t=["value"];return this.addOnPersist(t)},e.prototype.onPropertyChanged=function(t,e){for(var a=0,r=Object.keys(t);a<r.length;a++){var l=r[a];switch(l){case"width":this.setElementWidth(t.width),n.a.calculateWidth(this.element,this.container);break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"enabled":n.a.setEnabled(t.enabled,this.element),this.bindClearEvent();break;case"enableRtl":n.a.setEnableRtl(t.enableRtl,[this.container]);break;case"readonly":n.a.setReadonly(t.readonly,this.element),this.readonly?i.i(s.attributes)(this.element,{"aria-readonly":"true"}):this.element.removeAttribute("aria-readonly");break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.updateDataAttribute(!0),this.checkAttributes(!0),n.a.validateInputType(this.container,this.element);break;case"placeholder":n.a.setPlaceholder(t.placeholder,this.element),n.a.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":i.i(s.setValue)(l,i.i(s.getValue)(l,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(),n.a.setPlaceholder(this.placeholder,this.element),this.updateValue(this.value);break;case"currency":var o=i.i(s.getValue)(l,t);this.setProperties({currencyCode:o},!0),this.updateCurrency(l,o);break;case"currencyCode":var h=i.i(s.getValue)(l,t);this.setProperties({currency:h},!0),this.updateCurrency("currency",h);break;case"format":i.i(s.setValue)(l,i.i(s.getValue)(l,t),this),this.initCultureInfo(),this.updateValue(this.value);break;case"decimals":this.decimals=t.decimals,this.updateValue(this.value)}}},e.prototype.updateClearButton=function(t){n.a.setClearButton(t.showClearButton,this.element,this.inputWrapper,void 0,this.createElement),this.bindClearEvent()},e.prototype.updateSpinButton=function(t){t.showSpinButton?this.spinBtnCreation():(i.i(s.detach)(this.spinUp),i.i(s.detach)(this.spinDown))},e.prototype.getModuleName=function(){return"numerictextbox"},r([i.i(s.Property)("")],e.prototype,"cssClass",void 0),r([i.i(s.Property)(null)],e.prototype,"value",void 0),r([i.i(s.Property)(-Number.MAX_VALUE)],e.prototype,"min",void 0),r([i.i(s.Property)(Number.MAX_VALUE)],e.prototype,"max",void 0),r([i.i(s.Property)(1)],e.prototype,"step",void 0),r([i.i(s.Property)(null)],e.prototype,"width",void 0),r([i.i(s.Property)(null)],e.prototype,"placeholder",void 0),r([i.i(s.Property)({})],e.prototype,"htmlAttributes",void 0),r([i.i(s.Property)(!0)],e.prototype,"showSpinButton",void 0),r([i.i(s.Property)(!1)],e.prototype,"readonly",void 0),r([i.i(s.Property)(!0)],e.prototype,"enabled",void 0),r([i.i(s.Property)(!1)],e.prototype,"showClearButton",void 0),r([i.i(s.Property)(!1)],e.prototype,"enablePersistence",void 0),r([i.i(s.Property)("n2")],e.prototype,"format",void 0),r([i.i(s.Property)(null)],e.prototype,"decimals",void 0),r([i.i(s.Property)(null)],e.prototype,"currency",void 0),r([i.i(s.Property)(null)],e.prototype,"currencyCode",void 0),r([i.i(s.Property)(!0)],e.prototype,"strictMode",void 0),r([i.i(s.Property)(!1)],e.prototype,"validateDecimalOnType",void 0),r([i.i(s.Property)("Never")],e.prototype,"floatLabelType",void 0),r([i.i(s.Event)()],e.prototype,"created",void 0),r([i.i(s.Event)()],e.prototype,"destroyed",void 0),r([i.i(s.Event)()],e.prototype,"change",void 0),r([i.i(s.Event)()],e.prototype,"focus",void 0),r([i.i(s.Event)()],e.prototype,"blur",void 0),e=r([s.NotifyPropertyChanges],e)}(s.Component)},function(t,e,i){"use strict";i.d(e,"a",function(){return s}),i.d(e,"b",function(){return h}),i.d(e,"c",function(){return d});var s,n=i(0),a=(i.n(n),i(2)),r=(i.n(a),this&&this.__extends||function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}()),l=this&&this.__decorate||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;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},o="e-rating-icon e-icons e-star-filled";!function(t){t.Top="Top",t.Bottom="Bottom",t.Left="Left",t.Right="Right"}(s||(s={}));var h;!function(t){t.Full="Full",t.Half="Half",t.Quarter="Quarter",t.Exact="Exact"}(h||(h={}));var d=function(t){function e(e,i){var s=t.call(this,e,i)||this;return s.itemElements=[],s}return r(e,t),e.prototype.preRender=function(){this.element.id||(this.element.id=i.i(n.getUniqueID)("e-"+this.getModuleName())),this.keyConfigs={downarrow:"downarrow",leftarrow:"leftarrow",rightarrow:"rightarrow",uparrow:"uparrow",space:"space"},this.tooltipOpen=!1},e.prototype.render=function(){this.initialize(),this.updateMinValue(),this.updateTemplateFunction(),this.triggerChange(null,this.value,!1),this.renderItems(),this.displayLabel()},e.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),i.i(n.attributes)(this.element,{"aria-label":"rating"}),this.renderItemList(),this.updateReset(),this.readOnly&&this.wrapper.classList.add("e-rating-readonly"),this.visible||this.wrapper.classList.add("e-rating-hidden"),this.enableRtl&&this.wrapper.classList.add("e-rtl"),this.enableAnimation&&this.wrapper.classList.add("e-rating-animation"),this.cssClass&&i.i(n.addClass)([this.wrapper],this.cssClass.split(" ")),this.updateTooltip(),this.wireKeyboardEvent(),this.updateDisabled()},e.prototype.updateDisabled=function(){this.wrapper.classList[this.disabled?"add":"remove"]("e-disabled"),i.i(n.attributes)(this.ratingItemList,{tabindex:this.disabled?"-1":"0"}),this.updateResetButton()},e.prototype.updateResetButton=function(){if(this.allowReset){var t=this.value<=this.min||this.disabled;this.resetElement.classList[t?"add":"remove"]("e-disabled"),i.i(n.attributes)(this.resetElement,{tabindex:t?"-1":"0","aria-hidden":t.toString()})}},e.prototype.renderItemList=function(){var t=this;this.ratingItemList=this.createElement("div",{className:"e-rating-item-list",id:this.element.id+"_item-list"}),i.i(n.attributes)(this.ratingItemList,{"aria-label":"rating",role:"slider"}),this.wrapper.appendChild(this.ratingItemList),n.EventHandler.add(this.ratingItemList,"touchmove",function(e){return t.touchMoveHandler(e)},this),n.EventHandler.add(this.ratingItemList,n.Browser.touchEndEvent,this.touchEndHandler,this)},e.prototype.touchMoveHandler=function(t){var e=this.ratingItemList.getBoundingClientRect(),i=t.touches[0].clientX-e.x,s=i/e.width*this.itemsCount;s=this.enableRtl?this.itemsCount-s:s,s=s<this.min?this.min:s>this.itemsCount?this.itemsCount:s,s=this.validateValue(s);var n=0===s?null:this.itemElements[parseInt((Math.ceil(s)-1).toString(),10)];if(s===this.currentValue)return void(this.showTooltip&&n&&this.openRatingTooltip(n,!1));var a=this.currentValue;this.triggerChange(t,s),this.updateCurrentValue(s),this.showTooltip&&(n?(Math.ceil(s)!==Math.ceil(a)&&this.closeRatingTooltip(),this.openRatingTooltip(n,!0)):this.closeRatingTooltip())},e.prototype.touchEndHandler=function(){this.closeRatingTooltip()},e.prototype.updateTemplateFunction=function(){this.emptyTemplateFunction=this.emptyTemplate?this.getTemplateString(this.emptyTemplate):null,this.fullTemplateFunction=this.fullTemplate?this.getTemplateString(this.fullTemplate):null},e.prototype.renderItems=function(){for(var t=this,e=0;e<this.itemsCount;e++){var s=this.createElement("span",{className:"e-rating-item-container"}),a=this.createElement("span",{className:"e-rating-item"}),r=this.getRatingValue(this.value,e);this.renderItemContent(a,r,e,!1),s.appendChild(a),this.wireItemsEvents(s,e+1),this.itemElements.push(s);var l={element:s,value:e+1};this.trigger("beforeItemRender",l,function(e){t.ratingItemList.appendChild(e.element)})}i.i(n.attributes)(this.ratingItemList,{"aria-valuemax":this.itemsCount.toString()}),this.updateItemValue(!1)},e.prototype.renderItemContent=function(t,e,s,a){a&&this.removeItemContent(t),this.fullTemplate&&1===e?(t.classList.add("e-rating-full"),i.i(n.append)(this.fullTemplateFunction({index:s,ratingValue:e},this,"ratingFullTemplate",this.element.id+"fullTemplate",this.isStringTemplate),t)):this.emptyTemplate?(t.classList.add("e-rating-empty"),i.i(n.append)(this.emptyTemplateFunction({index:s,ratingValue:e},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate",this.isStringTemplate),t)):i.i(n.addClass)([t],o.split(" "))},e.prototype.removeItemContent=function(t){t.classList.remove("e-rating-full","e-rating-empty"),i.i(n.removeClass)([t],o.split(" ")),t.firstChild&&(t.innerHTML="")},e.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipObj=new a.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)):i.i(n.isNullOrUndefined)(this.tooltipObj)||(this.tooltipObj.destroy(),this.tooltipObj=null)},e.prototype.updateMinValue=function(){this.setProperties({min:this.validateValue(this.min)},!0),this.min>0&&this.value<this.min&&this.triggerChange(null,this.min,!1),i.i(n.attributes)(this.ratingItemList,{"aria-valuemin":this.min.toString()})},e.prototype.validateValue=function(t){return t=t>this.itemsCount?this.itemsCount:t<0?0:this.precision===h.Full||this.enableSingleSelection?Math.round(t):this.precision===h.Half?Math.round(2*t)/2:this.precision===h.Quarter?Math.round(4*t)/4:Math.round(10*t)/10},e.prototype.getRatingValue=function(t,e){return this.enableSingleSelection?t>e&&t<=e+1?1:0:t>=e+1?1:t<e?0:t-e},e.prototype.updateItemValue=function(t){void 0===t&&(t=!0),t&&this.isReact&&this.clearTemplate(["ratingEmptyTemplate","ratingFullTemplate"]);for(var e=0;e<this.itemsCount;e++){var s=this.itemElements[parseInt(e.toString(),10)];s.classList.remove("e-rating-selected","e-rating-intermediate","e-selected-value");var a=this.getRatingValue(this.currentValue,e);1===a?s.classList.add("e-rating-selected"):a>0?s.classList.add("e-rating-intermediate"):this.precision===h.Full&&e+1<=this.value&&!this.enableSingleSelection&&s.classList.add("e-selected-value"),t&&this.updateItemContent(a,e),s.style.setProperty("--rating-value",100*a+"%"),s.classList[0===this.value&&0===e||this.value===e+1||a>0&&a<1?"add":"remove"]("e-rating-focus")}t&&this.renderReactTemplates(),this.updateResetButton(),i.i(n.attributes)(this.ratingItemList,{"aria-valuenow":this.currentValue.toString()}),i.i(n.attributes)(this.element,{value:this.value.toString()})},e.prototype.updateItemContent=function(t,e){if(this.fullTemplate||this.emptyTemplate){var s=this.itemElements[parseInt(e.toString(),10)].querySelector(".e-rating-item");if(this.fullTemplate&&1===t){if(!this.isReact&&s.classList.contains("e-rating-full"))return;this.removeItemContent(s),s.classList.add("e-rating-full"),i.i(n.append)(this.fullTemplateFunction({ratingValue:t,index:e},this,"ratingFullTemplate",this.element.id+"fullTemplate"+e,this.isStringTemplate),s)}else if(this.emptyTemplate){if(!this.isReact&&s.classList.contains("e-rating-empty"))return;this.removeItemContent(s),s.classList.add("e-rating-empty"),i.i(n.append)(this.emptyTemplateFunction({ratingValue:t,index:e},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate"+e,this.isStringTemplate),s)}else this.removeItemContent(s),i.i(n.addClass)([s],o.split(" "))}},e.prototype.updateTooltipContent=function(t){if(this.showTooltip){this.isReact&&this.clearTemplate(["ratingTooltipTemplate"]);var e;if(this.tooltipTemplate){e=this.createElement("span",{className:"e-rating-tooltip-content"});var s=this.getTemplateString(this.tooltipTemplate);i.i(n.append)(s({value:this.currentValue},this,"ratingTooltipTemplate",this.element.id+"tooltipTemplate",this.isStringTemplate),e),this.tooltipObj.setProperties({content:e},t)}else e=this.currentValue.toString(),this.tooltipObj.setProperties({content:i.i(n.initializeCSPTemplate)(function(){return e})},t);this.renderReactTemplates()}},e.prototype.getTemplateString=function(t){var e="";try{if("function"!=typeof t){var s=i.i(n.select)(t);e=s?"SCRIPT"===s.tagName?s.innerHTML:s.outerHTML:t}else e=t}catch(i){e=t}return i.i(n.compile)(e)},e.prototype.displayLabel=function(){this.showLabel?(this.spanLabel=this.createElement("span",{className:"e-rating-label"}),this.updateLabel(),this.updateLabelPosition()):this.wrapper.contains(this.spanLabel)&&(i.i(n.remove)(this.spanLabel),this.spanLabel=null)},e.prototype.updateLabel=function(){if(this.showLabel)if(this.labelTemplate){this.isReact&&this.clearTemplate(["ratingLabelTemplate"]),this.spanLabel.firstChild&&(this.spanLabel.innerHTML="");var t=this.getTemplateString(this.labelTemplate);i.i(n.append)(t({value:this.currentValue},this,"ratingLabelTemplate",this.element.id+"labelTemplate",this.isStringTemplate),this.spanLabel),this.renderReactTemplates()}else this.spanLabel.textContent=this.currentValue+" / "+this.itemsCount},e.prototype.updateReset=function(){this.allowReset?(this.resetElement=this.createElement("span",{className:"e-icons e-reset",attrs:{"aria-label":"resetbutton",role:"button"}}),this.updateResetButton(),n.EventHandler.add(this.resetElement,"click",this.resetClicked,this),this.wrapper.insertBefore(this.resetElement,this.ratingItemList)):this.wrapper.contains(this.resetElement)&&(i.i(n.remove)(this.resetElement),this.resetElement=null)},e.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)},e.prototype.clearLabelPosition=function(){var t=this.spanLabel.classList.value.match(/(e-label-[top|bottom|right|left]+)/g);t&&i.i(n.removeClass)([this.spanLabel],t)},e.prototype.wireItemsEvents=function(t,e){var i=this;n.EventHandler.add(t,"click",function(t){return i.clickHandler(t)},this),n.EventHandler.add(t,"mousemove",function(t){return i.mouseMoveHandler(e,t)},this),n.EventHandler.add(t,"mouseleave",this.mouseLeaveHandler,this)},e.prototype.clickHandler=function(t){this.currentValue=this.min>0&&this.currentValue<this.min?this.min:this.currentValue,this.triggerChange(t,this.currentValue),this.updateItemValue(),this.updateLabel(),this.updateResetButton()},e.prototype.updateValueChange=function(t,e,i){void 0===i&&(i=!0),this.triggerChange(t,e,i),this.updateItemValue(),this.updateLabel()},e.prototype.triggerChange=function(t,e,i){if(void 0===i&&(i=!0),e=this.validateValue(e),this.currentValue=e,this.currentValue!==this.value){var s={event:t,isInteracted:i,value:e,previousValue:this.value};this.setProperties({value:e},!0),this.trigger("valueChanged",s)}},e.prototype.mouseMoveHandler=function(t,e){var i=this.calculateCurrentValue(t,e);i=this.validateValue(i);var s=this.itemElements[parseInt((t-1).toString(),10)];if(i===this.currentValue)return void this.openRatingTooltip(s,!1);this.updateCurrentValue(i),this.openRatingTooltip(s,!0);var n={element:s,event:e,value:i};this.trigger("onItemHover",n)},e.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))},e.prototype.closeRatingTooltip=function(){this.tooltipOpen&&(this.tooltipObj.close(),this.tooltipOpen=!1)},e.prototype.updateCurrentValue=function(t){this.currentValue=t,this.updateItemValue(),this.updateLabel()},e.prototype.mouseLeaveHandler=function(){this.closeRatingTooltip(),this.updateCurrentValue(this.value)},e.prototype.calculateCurrentValue=function(t,e){var i=t;return this.enableSingleSelection||this.precision===h.Full||(i=e.offsetX/this.itemElements[t-1].clientWidth,i=this.enableRtl?1-i:i,this.precision===h.Quarter?i=i<=.25?.25:i<=.5?.5:i<.75?.75:1:this.precision===h.Half&&(i=i<=.5?.5:1),i=i+t-1),i},e.prototype.reset=function(){this.resetClicked(null,!1)},e.prototype.resetClicked=function(t,e){void 0===e&&(e=!0),this.updateValueChange(t,this.min,e),this.updateResetButton()},e.prototype.wireKeyboardEvent=function(){this.keyboardModuleRating=new n.KeyboardEvents(this.wrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},e.prototype.keyActionHandler=function(t){if(!this.disabled&&!this.readOnly){if(t.target.classList.contains("e-rating-item-list"))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)}if(this.allowReset&&t.target.classList.contains("e-reset"))switch(t.action){case"space":this.resetClicked(t)}}},e.prototype.handleNavigation=function(t,e){if(!e&&this.value>this.min||e&&this.value<this.itemsCount){var i=this.precision===h.Full||this.enableSingleSelection?1:this.precision===h.Half?.5:this.precision===h.Quarter?.25:Math.round(1)/10;i=e?this.value+i:this.value-i,this.updateValueChange(t,i),this.updateResetButton()}},e.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)}},e.prototype.getModuleName=function(){return"rating"},e.prototype.getPersistData=function(){return this.addOnPersist([])},e.prototype.removeItemElements=function(){for(var t=0;t<this.itemElements.length;t++)i.i(n.remove)(this.itemElements[parseInt(t.toString(),10)]);this.itemElements=[]},e.prototype.destroy=function(){var e=this;t.prototype.destroy.call(this),this.removeItemElements(),this.clearTemplate(),this.spanLabel&&(i.i(n.remove)(this.spanLabel),this.spanLabel=null),this.resetElement&&(i.i(n.remove)(this.resetElement),this.resetElement=null),this.showTooltip&&(this.tooltipObj.destroy(),this.tooltipObj=null),i.i(n.remove)(this.ratingItemList),this.ratingItemList=null,this.wrapper.parentNode.insertBefore(this.element,this.wrapper),i.i(n.remove)(this.wrapper),this.wrapper=null,this.keyboardModuleRating.destroy(),this.keyboardModuleRating=null,["value","aria-label","name"].forEach(function(t){e.element.removeAttribute(t)})},e.prototype.onPropertyChanged=function(t,e){for(var s=0,a=Object.keys(t);s<a.length;s++){switch(a[s]){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"]("e-rating-hidden");break;case"disabled":this.updateDisabled();break;case"readOnly":this.wrapper.classList[this.readOnly?"add":"remove"]("e-rating-readonly");break;case"allowReset":this.updateReset();break;case"enableRtl":this.wrapper.classList[this.enableRtl?"add":"remove"]("e-rtl");break;case"cssClass":e.cssClass&&i.i(n.removeClass)([this.wrapper],e.cssClass.split(" ")),t.cssClass&&i.i(n.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"]("e-rating-animation");break;case"emptyTemplate":case"fullTemplate":this.updateTemplateFunction(),this.updateContent();break;case"labelTemplate":this.updateLabel();break;case"itemsCount":this.removeItemElements(),this.renderItems(),this.updateLabel()}}},l([i.i(n.Property)(!1)],e.prototype,"allowReset",void 0),l([i.i(n.Property)("")],e.prototype,"cssClass",void 0),l([i.i(n.Property)(!1)],e.prototype,"disabled",void 0),l([i.i(n.Property)("")],e.prototype,"emptyTemplate",void 0),l([i.i(n.Property)(!0)],e.prototype,"enableAnimation",void 0),l([i.i(n.Property)(!1)],e.prototype,"enableSingleSelection",void 0),l([i.i(n.Property)("")],e.prototype,"fullTemplate",void 0),l([i.i(n.Property)(5)],e.prototype,"itemsCount",void 0),l([i.i(n.Property)(s.Right)],e.prototype,"labelPosition",void 0),l([i.i(n.Property)("")],e.prototype,"labelTemplate",void 0),l([i.i(n.Property)(0)],e.prototype,"min",void 0),l([i.i(n.Property)(h.Full)],e.prototype,"precision",void 0),l([i.i(n.Property)(!1)],e.prototype,"readOnly",void 0),l([i.i(n.Property)(!1)],e.prototype,"showLabel",void 0),l([i.i(n.Property)(!0)],e.prototype,"showTooltip",void 0),l([i.i(n.Property)("")],e.prototype,"tooltipTemplate",void 0),l([i.i(n.Property)(0)],e.prototype,"value",void 0),l([i.i(n.Property)(!0)],e.prototype,"visible",void 0),l([i.i(n.Event)()],e.prototype,"beforeItemRender",void 0),l([i.i(n.Event)()],e.prototype,"created",void 0),l([i.i(n.Event)()],e.prototype,"onItemHover",void 0),l([i.i(n.Event)()],e.prototype,"valueChanged",void 0),e=l([n.NotifyPropertyChanges],e)}(n.Component)},function(t,e,i){"use strict";i.d(e,"a",function(){return l});var s=i(0),n=(i.n(s),i(6)),a=this&&this.__extends||function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),r=this&&this.__decorate||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;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},l=function(t){function e(e,i){return t.call(this,e,i)||this}return a(e,t),e.prototype.preRender=function(){},e.prototype.render=function(){this.initialize()},e.prototype.initialize=function(){i.i(s.addClass)([this.element],"e-"+this.getModuleName()),t.prototype.initialize.call(this,this.element),this.enablePersistence&&this.loadPersistedSignature()},e.prototype.getModuleName=function(){return"signature"},e.prototype.getPersistData=function(){return this.addOnPersist(["signatureValue"])},e.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++){var a=n[s];switch(a){case"backgroundColor":t.prototype.propertyChanged.call(this,a,e.backgroundColor);break;case"backgroundImage":t.prototype.propertyChanged.call(this,a,e.backgroundImage);break;case"strokeColor":e.strokeColor!==i.strokeColor&&t.prototype.propertyChanged.call(this,a,e.strokeColor);break;case"saveWithBackground":t.prototype.propertyChanged.call(this,a,e.saveWithBackground);break;case"isReadOnly":t.prototype.propertyChanged.call(this,a,e.isReadOnly);break;case"disabled":t.prototype.propertyChanged.call(this,a,e.disabled)}}},r([i.i(s.Property)("")],e.prototype,"backgroundColor",void 0),r([i.i(s.Property)("")],e.prototype,"backgroundImage",void 0),r([i.i(s.Property)(!1)],e.prototype,"disabled",void 0),r([i.i(s.Property)(!1)],e.prototype,"isReadOnly",void 0),r([i.i(s.Property)(!0)],e.prototype,"saveWithBackground",void 0),r([i.i(s.Property)("#000000")],e.prototype,"strokeColor",void 0),r([i.i(s.Property)(.5)],e.prototype,"minStrokeWidth",void 0),r([i.i(s.Property)(2)],e.prototype,"maxStrokeWidth",void 0),r([i.i(s.Property)(.7)],e.prototype,"velocity",void 0),r([i.i(s.Property)("en-US")],e.prototype,"locale",void 0),r([i.i(s.Property)(!1)],e.prototype,"enableRtl",void 0),r([i.i(s.Property)(!1)],e.prototype,"enablePersistence",void 0),r([i.i(s.Event)()],e.prototype,"beforeSave",void 0),r([i.i(s.Event)()],e.prototype,"change",void 0),r([i.i(s.Event)()],e.prototype,"created",void 0),e=r([s.NotifyPropertyChanges],e)}(n.a)},function(t,e,i){"use strict";i.d(e,"a",function(){return o});var s=i(0),n=(i.n(s),i(1)),a=this&&this.__extends||function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),r=this&&this.__decorate||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;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},l=["title","style","class"],o=function(t){function e(e,i){var s=t.call(this,e,i)||this;return s.previousValue=null,s.isAngular=!1,s.isHiddenInput=!1,s.isForm=!1,s.inputPreviousValue=null,s.isVue=!1,s.textboxOptions=e,s}return a(e,t),e.prototype.onPropertyChanged=function(t,e){for(var a=0,r=Object.keys(t);a<r.length;a++){switch(r[a]){case"floatLabelType":n.a.removeFloating(this.textboxWrapper),n.a.addFloating(this.respectiveElement,this.floatLabelType,this.placeholder);break;case"enabled":n.a.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container),this.bindClearEvent();break;case"width":n.a.setWidth(t.width,this.textboxWrapper.container);break;case"value":var l=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.isBlank(this.value)||(this.value=this.value.toString()),this.isProtectedOnChange=l,n.a.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):(i.i(s.isNullOrUndefined)(this.isAngular)||!this.isAngular||this.isAngular&&!this.preventChange||this.isAngular&&i.i(s.isNullOrUndefined)(this.preventChange))&&this.raiseChangeEvent();break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkAttributes(!0),this.multiline&&!i.i(s.isNullOrUndefined)(this.textarea)?n.a.validateInputType(this.textboxWrapper.container,this.textarea):n.a.validateInputType(this.textboxWrapper.container,this.element);break;case"readonly":n.a.setReadonly(this.readonly,this.respectiveElement);break;case"type":"TEXTAREA"!==this.respectiveElement.tagName&&(this.respectiveElement.setAttribute("type",this.type),n.a.validateInputType(this.textboxWrapper.container,this.element),this.raiseChangeEvent());break;case"showClearButton":n.a.setClearButton(this.showClearButton,this.respectiveElement,this.textboxWrapper),this.bindClearEvent();break;case"enableRtl":n.a.setEnableRtl(this.enableRtl,[this.textboxWrapper.container]);break;case"placeholder":n.a.setPlaceholder(this.placeholder,this.respectiveElement),n.a.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":this.updateCssClass(t.cssClass,e.cssClass);break;case"locale":this.globalize=new s.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),n.a.setPlaceholder(this.placeholder,this.respectiveElement)}}},e.prototype.getModuleName=function(){return"textbox"},e.prototype.isBlank=function(t){return!t||/^\s*$/.test(t)},e.prototype.preRender=function(){if(this.cloneElement=this.element.cloneNode(!0),this.formElement=i.i(s.closest)(this.element,"form"),i.i(s.isNullOrUndefined)(this.formElement)||(this.isForm=!0),"EJS-TEXTBOX"===this.element.tagName){var t=i.i(s.getValue)("ej2_instances",this.element),e=this.multiline?this.createElement("textarea"):this.createElement("input"),n=0;for(n;n<this.element.attributes.length;n++){var a=this.element.attributes[n].nodeName;"id"!==a&&"class"!==a?(e.setAttribute(a,this.element.attributes[n].nodeValue),e.innerHTML=this.element.innerHTML,"name"===a&&this.element.removeAttribute("name")):"class"===a&&e.setAttribute(a,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "))}this.element.appendChild(e),this.element=e,i.i(s.setValue)("ej2_instances",t,this.element)}this.updateHTMLAttrToElement(),this.checkAttributes(!1),!i.i(s.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&&this.element.setAttribute("role","textbox"),this.globalize=new s.Internationalization(this.locale);var r={placeholder:this.placeholder};if(this.l10n=new s.L10n("textbox",r,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",i.i(s.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",i.i(s.getUniqueID)("textarea"));for(var o=["placeholder","disabled","value","readonly","type","autocomplete"],n=0;n<this.element.attributes.length;n++){var a=this.element.attributes[n].nodeName;this.element.hasAttribute(a)&&l.indexOf(a)<0&&"id"!==a&&"type"!==a&&"e-mappinguid"!==a&&(this.textarea.setAttribute(a,this.element.attributes[n].nodeValue),o.indexOf(a)<0&&(this.element.removeAttribute(a),n--))}}},e.prototype.checkAttributes=function(t){for(var e=t?i.i(s.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly","type","autocomplete"],n=0,a=e;n<a.length;n++){var r=a[n];if(!i.i(s.isNullOrUndefined)(this.element.getAttribute(r)))switch(r){case"disabled":if(i.i(s.isNullOrUndefined)(this.textboxOptions)||void 0===this.textboxOptions.enabled||t){var l="disabled"!==this.element.getAttribute(r)&&""!==this.element.getAttribute(r)&&"true"!==this.element.getAttribute(r);this.setProperties({enabled:l},!t)}break;case"readonly":if(i.i(s.isNullOrUndefined)(this.textboxOptions)||void 0===this.textboxOptions.readonly||t){var o="readonly"===this.element.getAttribute(r)||""===this.element.getAttribute(r)||"true"===this.element.getAttribute(r);this.setProperties({readonly:o},!t)}break;case"placeholder":(i.i(s.isNullOrUndefined)(this.textboxOptions)||void 0===this.textboxOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"autocomplete":if(i.i(s.isNullOrUndefined)(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||t){var h="off"===this.element.autocomplete?"off":"on";this.setProperties({autocomplete:h},!t)}break;case"value":(i.i(s.isNullOrUndefined)(this.textboxOptions)||void 0===this.textboxOptions.value||t)&&""!==this.element.value&&this.setProperties({value:this.element.value},!t);break;case"type":(i.i(s.isNullOrUndefined)(this.textboxOptions)||void 0===this.textboxOptions.type||t)&&this.setProperties({type:this.element.type},!t)}}},e.prototype.render=function(){var t=this.cssClass;i.i(s.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(t=this.getInputValidClassList(this.cssClass)),this.respectiveElement=this.isHiddenInput?this.textarea:this.element,this.textboxWrapper=n.a.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.updateHTMLAttrToWrapper(),this.isHiddenInput&&this.respectiveElement.parentNode.insertBefore(this.element,this.respectiveElement),this.wireEvents(),i.i(s.isNullOrUndefined)(this.value)||(n.a.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value)),i.i(s.isNullOrUndefined)(this.value)||(this.initialValue=this.value,this.setInitialValue()),"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:i.i(s.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,n.a.setWidth(this.width,this.textboxWrapper.container),!i.i(s.isNullOrUndefined)(i.i(s.closest)(this.element,"fieldset"))&&i.i(s.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete()},e.prototype.updateHTMLAttrToWrapper=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var n=e[t];if(l.indexOf(n)>-1)if("class"===n){var a=this.getInputValidClassList(this.htmlAttributes[""+n]);""!==a&&i.i(s.addClass)([this.textboxWrapper.container],a.split(" "))}else if("style"===n){var r=this.textboxWrapper.container.getAttribute(n);r=i.i(s.isNullOrUndefined)(r)?this.htmlAttributes[""+n]:r+this.htmlAttributes[""+n],this.textboxWrapper.container.setAttribute(n,r)}else this.textboxWrapper.container.setAttribute(n,this.htmlAttributes[""+n])}},e.prototype.updateHTMLAttrToElement=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var n=e[t];l.indexOf(n)<0&&(this.multiline&&!i.i(s.isNullOrUndefined)(this.textarea)?this.textarea.setAttribute(n,this.htmlAttributes[""+n]):this.element.setAttribute(n,this.htmlAttributes[""+n]))}},e.prototype.updateCssClass=function(t,e){n.a.setCssClass(this.getInputValidClassList(t),[this.textboxWrapper.container],this.getInputValidClassList(e))},e.prototype.getInputValidClassList=function(t){var e=t;return i.i(s.isNullOrUndefined)(t)||""===t||(e=t.replace(/\s+/g," ").trim()),e},e.prototype.setInitialValue=function(){this.isAngular||this.respectiveElement.setAttribute("value",this.initialValue)},e.prototype.wireEvents=function(){s.EventHandler.add(this.respectiveElement,"focus",this.focusHandler,this),s.EventHandler.add(this.respectiveElement,"blur",this.focusOutHandler,this),s.EventHandler.add(this.respectiveElement,"input",this.inputHandler,this),s.EventHandler.add(this.respectiveElement,"change",this.changeHandler,this),this.isForm&&s.EventHandler.add(this.formElement,"reset",this.resetForm,this),this.bindClearEvent(),!i.i(s.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")&&s.EventHandler.add(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler,this)},e.prototype.animationHandler=function(){this.textboxWrapper.container.classList.add("e-valid-input");var t=this.textboxWrapper.container.querySelector(".e-float-text");i.i(s.isNullOrUndefined)(t)||(t.classList.add("e-label-top"),t.classList.contains("e-label-bottom")&&t.classList.remove("e-label-bottom"))},e.prototype.resetValue=function(t){var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.value=t,this.isProtectedOnChange=e},e.prototype.resetForm=function(){if(this.isAngular?this.resetValue(""):this.resetValue(this.initialValue),!i.i(s.isNullOrUndefined)(this.textboxWrapper)){var t=this.textboxWrapper.container.querySelector(".e-float-text");i.i(s.isNullOrUndefined)(t)||"Always"===this.floatLabelType||(i.i(s.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")))}},e.prototype.focusHandler=function(t){var e={container:this.textboxWrapper.container,event:t,value:this.value};this.trigger("focus",e)},e.prototype.focusOutHandler=function(t){null===this.previousValue&&null===this.value&&""===this.respectiveElement.value||this.previousValue===this.value||this.raiseChangeEvent(t,!0);var e={container:this.textboxWrapper.container,event:t,value:this.value};this.trigger("blur",e)},e.prototype.inputHandler=function(t){var e=this,i={event:t,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};this.inputPreviousValue=this.respectiveElement.value,this.isAngular&&(e.localChange({value:this.respectiveElement.value}),this.preventChange=!0),this.isVue&&(this.preventChange=!0),this.trigger("input",i),t.stopPropagation()},e.prototype.changeHandler=function(t){this.setProperties({value:this.respectiveElement.value},!0),this.previousValue!=this.value&&this.raiseChangeEvent(t,!0),t.stopPropagation()},e.prototype.raiseChangeEvent=function(t,e){var i={event:t,value:this.value,previousValue:this.previousValue,container:this.textboxWrapper.container,isInteraction:e||!1,isInteracted:e||!1};this.preventChange=!1,this.trigger("change",i),this.previousValue=this.value,"INPUT"===this.element.tagName&&this.multiline&&"mozilla"===s.Browser.info.name&&(this.element.value=this.respectiveElement.value)},e.prototype.bindClearEvent=function(){this.showClearButton&&(this.enabled?s.EventHandler.add(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler,this):s.EventHandler.remove(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler))},e.prototype.resetInputHandler=function(t){if(t.preventDefault(),!this.textboxWrapper.clearButton.classList.contains("e-clear-icon-hide")||this.textboxWrapper.container.classList.contains("e-static-clear")){n.a.setValue("",this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.setProperties({value:this.respectiveElement.value},!0);var e={event:t,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};if(this.trigger("input",e),this.inputPreviousValue=this.respectiveElement.value,this.raiseChangeEvent(t,!0),i.i(s.closest)(this.element,"form")){var a=this.element,r=document.createEvent("KeyboardEvent");r.initEvent("keyup",!1,!0),a.dispatchEvent(r)}}},e.prototype.unWireEvents=function(){s.EventHandler.remove(this.respectiveElement,"focus",this.focusHandler),s.EventHandler.remove(this.respectiveElement,"blur",this.focusOutHandler),s.EventHandler.remove(this.respectiveElement,"input",this.inputHandler),s.EventHandler.remove(this.respectiveElement,"change",this.changeHandler),this.isForm&&s.EventHandler.remove(this.formElement,"reset",this.resetForm),!i.i(s.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")&&s.EventHandler.remove(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler)},e.prototype.destroy=function(){this.unWireEvents(),"INPUT"===this.element.tagName&&this.multiline&&(i.i(s.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"]),i.i(s.isNullOrUndefined)(this.textboxWrapper)||(this.textboxWrapper.container.insertAdjacentElement("afterend",this.respectiveElement),i.i(s.detach)(this.textboxWrapper.container)),this.textboxWrapper=null,n.a.destroy(),t.prototype.destroy.call(this)},e.prototype.addIcon=function(t,e){n.a.addIcon(t,e,this.textboxWrapper.container,this.respectiveElement,this.createElement)},e.prototype.getPersistData=function(){var t=["value"];return this.addOnPersist(t)},e.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),n.a.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===s?(this.setProperties({readonly:!0},!0),n.a.setReadonly(this.readonly,this.respectiveElement)):"class"===s?this.respectiveElement.classList.add(t[""+s]):"placeholder"===s?(this.setProperties({placeholder:t[""+s]},!0),n.a.setPlaceholder(this.placeholder,this.respectiveElement)):("rows"===s&&this.respectiveElement.tagName,this.respectiveElement.setAttribute(s,t[""+s]))}},e.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),n.a.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===s?(this.setProperties({readonly:!1},!0),n.a.setReadonly(this.readonly,this.respectiveElement)):"placeholder"===s?(this.setProperties({placeholder:null},!0),n.a.setPlaceholder(this.placeholder,this.respectiveElement)):this.respectiveElement.removeAttribute(s)}},e.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"))&&i.i(s.addClass)([this.textboxWrapper.container],["e-input-focus"]))},e.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"))&&i.i(s.removeClass)([this.textboxWrapper.container],["e-input-focus"]))},r([i.i(s.Property)("text")],e.prototype,"type",void 0),r([i.i(s.Property)(!1)],e.prototype,"readonly",void 0),r([i.i(s.Property)(null)],e.prototype,"value",void 0),r([i.i(s.Property)("Never")],e.prototype,"floatLabelType",void 0),r([i.i(s.Property)("")],e.prototype,"cssClass",void 0),r([i.i(s.Property)(null)],e.prototype,"placeholder",void 0),r([i.i(s.Property)("on")],e.prototype,"autocomplete",void 0),r([i.i(s.Property)({})],e.prototype,"htmlAttributes",void 0),r([i.i(s.Property)(!1)],e.prototype,"multiline",void 0),r([i.i(s.Property)(!0)],e.prototype,"enabled",void 0),r([i.i(s.Property)(!1)],e.prototype,"showClearButton",void 0),r([i.i(s.Property)(!1)],e.prototype,"enablePersistence",void 0),r([i.i(s.Property)(null)],e.prototype,"width",void 0),r([i.i(s.Event)()],e.prototype,"created",void 0),r([i.i(s.Event)()],e.prototype,"destroyed",void 0),r([i.i(s.Event)()],e.prototype,"change",void 0),r([i.i(s.Event)()],e.prototype,"blur",void 0),r([i.i(s.Event)()],e.prototype,"focus",void 0),r([i.i(s.Event)()],e.prototype,"input",void 0),e=r([s.NotifyPropertyChanges],e)}(s.Component)},function(t,e,i){"use strict";i.d(e,"a",function(){return b}),i.d(e,"b",function(){return C}),i.d(e,"c",function(){return E}),i.d(e,"d",function(){return x});var s=i(0),n=(i.n(s),i(2)),a=(i.n(n),this&&this.__extends||function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}()),r=this&&this.__decorate||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;l>=0;l--)(n=t[l])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r},l="e-upload-file-list",o="e-file-status",h="e-file-remove-btn",d="e-file-delete-btn",u="e-file-abort-btn",c="e-file-reload-btn",p="e-upload-progress-wrap",m="e-upload-progress-bar",f="e-upload-success",v="e-upload-fails",g="e-file-pause-btn",y=["title","style","class"],b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),r([i.i(s.Property)("")],e.prototype,"name",void 0),r([i.i(s.Property)(null)],e.prototype,"size",void 0),r([i.i(s.Property)("")],e.prototype,"type",void 0),e}(s.ChildProperty),C=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),r([i.i(s.Property)("Browse...")],e.prototype,"browse",void 0),r([i.i(s.Property)("Upload")],e.prototype,"upload",void 0),r([i.i(s.Property)("Clear")],e.prototype,"clear",void 0),e}(s.ChildProperty),E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),r([i.i(s.Property)("")],e.prototype,"saveUrl",void 0),r([i.i(s.Property)("")],e.prototype,"removeUrl",void 0),r([i.i(s.Property)(0)],e.prototype,"chunkSize",void 0),r([i.i(s.Property)(3)],e.prototype,"retryCount",void 0),r([i.i(s.Property)(500)],e.prototype,"retryAfterDelay",void 0),e}(s.ChildProperty),x=function(t){function e(e,i){var s=t.call(this,e,i)||this;return s.initialAttr={accept:null,multiple:!1,disabled:!1},s.uploadedFilesData=[],s.base64String=[],s.isForm=!1,s.allTypes=!1,s.pausedData=[],s.uploadMetaData=[],s.tabIndex="0",s.btnTabIndex="0",s.disableKeyboardNavigation=!1,s.count=-1,s.actionCompleteCount=0,s.flag=!0,s.selectedFiles=[],s.uploaderName="UploadFiles",s.fileStreams=[],s.newFileRef=0,s.isFirstFileOnSelection=!1,s.dragCounter=0,s.isAngular=!1,s.fileList=[],s.filesData=[],s.uploaderOptions=e,s}return a(e,t),e.prototype.onPropertyChanged=function(t,e){for(var n=0,a=Object.keys(t);n<a.length;n++){switch(a[n]){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=i.i(s.isNullOrUndefined)(this.buttons.browse)?"":this.buttons.browse,this.buttons.clear=i.i(s.isNullOrUndefined)(this.buttons.clear)?"":this.buttons.clear,this.buttons.upload=i.i(s.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":i.i(s.getValue)("ej2_instances",this.element)[0].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=i.i(s.getValue)("currentLocale",this.l10n);break;case"cssClass":this.setCSSClass(e.cssClass)}}},e.prototype.setLocalizedTexts=function(){i.i(s.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&&!i.i(s.isNullOrUndefined)(this.uploadWrapper.querySelector(".e-file-drop"))&&(this.uploadWrapper.querySelector(".e-file-drop").innerHTML=this.localizedTexts("dropFilesHint"))),this.updateFileList())},e.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},e.prototype.updateFileList=function(){var t;if(this.fileList.length>0&&!i.i(s.isNullOrUndefined)(this.uploadWrapper.querySelector(".e-upload-files")))for(var e=0;e<this.fileList.length;e++)t=this.fileList[e].querySelector(".e-file-status"),t.innerHTML=this.localizedTexts(this.getKeyValue(this.filesData[e].status)),this.filesData[e].status=this.localizedTexts(this.getKeyValue(this.filesData[e].status)),this.fileList[e].classList.contains(f)&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("delete")),this.fileList[e].querySelector(".e-file-play-btn")&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("resume")),this.fileList[e].querySelector(".e-file-remove-btn")&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("remove")),this.fileList[e].querySelector(".e-file-reload-btn")&&this.fileList[e].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")))},e.prototype.reRenderFileList=function(){this.listParent&&(i.i(s.detach)(this.listParent),this.listParent=null,this.fileList=[],this.internalCreateFileList(this.filesData),this.actionButtons&&(this.removeActionButtons(),this.renderActionButtons(),this.checkActionButtonStatus()))},e.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 s.L10n("uploader",this.localeText,this.locale),this.preLocaleObj=i.i(s.getValue)("currentLocale",this.l10n),this.formRendered(),this.updateHTMLAttrToElement(),this.checkHTMLAttributes(!1);var t=i.i(s.getValue)("ej2_instances",this.element);if("EJS-UPLOADER"===this.element.tagName){var e=this.createElement("input",{attrs:{type:"file"}}),n=0;for(n;n<this.element.attributes.length;n++)"id"!==this.element.attributes[n].nodeName?e.setAttribute(this.element.attributes[n].nodeName,this.element.attributes[n].nodeValue):"id"===this.element.attributes[n].nodeName&&e.setAttribute(this.element.attributes[n].nodeName,i.i(s.getUniqueID)("uploader")),e.innerHTML=this.element.innerHTML;e.hasAttribute("name")||e.setAttribute("name","UploadFiles"),this.element.appendChild(e),this.element=e,i.i(s.setValue)("ej2_instances",t,this.element)}t[0].isPureReactComponent&&(i.i(s.isNullOrUndefined)(t[0].props.name)?!i.i(s.isNullOrUndefined)(t[0].props.id)&&i.i(s.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)),i.i(s.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=s.Browser.info.name,this.uploaderName=this.element.getAttribute("name")},e.prototype.formRendered=function(){var t=i.i(s.closest)(this.element,"form");if(!i.i(s.isNullOrUndefined)(t))for(;t&&t!==document.documentElement;t=t.parentElement)"FORM"===t.tagName&&(this.isForm=!0,this.formElement=t,t.setAttribute("enctype","multipart/form-data"),t.setAttribute("encoding","multipart/form-data"))},e.prototype.getPersistData=function(){return this.addOnPersist(["filesData"])},e.prototype.getModuleName=function(){return"uploader"},e.prototype.updateDirectoryAttributes=function(){this.directoryUpload?(this.element.setAttribute("directory","true"),this.element.setAttribute("webkitdirectory","true")):(this.element.removeAttribute("directory"),this.element.removeAttribute("webkitdirectory"))},e.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()},e.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")},e.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}}),this.clearButton=this.createElement("button",{className:"e-file-clear-btn e-css e-btn e-flat",attrs:{type:"button",tabindex:this.btnTabIndex}}),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()},e.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())},e.prototype.wireActionButtonEvents=function(){s.EventHandler.add(this.uploadButton,"click",this.uploadButtonClick,this),s.EventHandler.add(this.clearButton,"click",this.clearButtonClick,this)},e.prototype.unwireActionButtonEvents=function(){s.EventHandler.remove(this.uploadButton,"click",this.uploadButtonClick),s.EventHandler.remove(this.clearButton,"click",this.clearButtonClick)},e.prototype.removeActionButtons=function(){this.actionButtons&&(this.unwireActionButtonEvents(),i.i(s.detach)(this.actionButtons),this.actionButtons=null)},e.prototype.renderButtonTemplates=function(){if("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){var t=i.i(s.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))}if(this.clearButton){var e=i.i(s.isNullOrUndefined)(this.buttons.clear)?"Clear":this.buttons.clear;this.buttons.clear=e,"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))}},e.prototype.initializeUpload=function(){this.element.setAttribute("tabindex","-1");var t=this.createElement("span",{className:"e-file-select"});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()},e.prototype.renderPreLoadFiles=function(){if(this.files.length){if(this.enablePersistence&&this.filesData.length)return void this.internalCreateFileList(this.filesData);if(i.i(s.isNullOrUndefined)(this.files[0].size))return;this.isPreloadFiles=!0;var t=[].slice.call(this.files),e=[];this.multiple||(this.clearData(),t=[t[0]]);for(var n=0,a=t;n<a.length;n++){var r=a[n],l={name:r.name+"."+r.type.split(".")[r.type.split(".").length-1],rawFile:"",size:r.size,status:this.localizedTexts("uploadSuccessMessage"),type:r.type,validationMessages:{minSize:"",maxSize:""},statusCode:"2"};e.push(l),this.filesData.push(l)}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}},e.prototype.checkActionButtonStatus=function(){if(this.actionButtons){var t=this.uploadWrapper.querySelectorAll(".e-validation-fails").length+this.uploadWrapper.querySelectorAll(".e-upload-fails:not(.e-upload-progress)").length+this.uploadWrapper.querySelectorAll("span."+f).length+this.uploadWrapper.querySelectorAll("span.e-upload-progress").length;t>0&&t===this.uploadWrapper.querySelectorAll("li").length?this.uploadButton.setAttribute("disabled","disabled"):this.uploadButton.removeAttribute("disabled")}},e.prototype.setDropArea=function(){var t=this.dropAreaWrapper.querySelector(".e-file-drop");if(this.dropArea){this.dropZoneElement="string"!=typeof this.dropArea?this.dropArea:i.i(s.select)(this.dropArea,document);for(var e=this.element,n=!1;e.parentNode;)(e=e.parentNode)===this.dropZoneElement&&(n=!0,t?t.innerHTML=this.localizedTexts("dropFilesHint"):this.createDropTextHint());!n&&t&&i.i(s.remove)(t)}else i.i(s.isNullOrUndefined)(this.uploaderOptions)||void 0!==this.uploaderOptions.dropArea||(this.createDropTextHint(),this.dropZoneElement=this.uploadWrapper,this.setProperties({dropArea:this.uploadWrapper},!0));this.bindDropEvents()},e.prototype.updateDropArea=function(){if(this.dropArea)this.setDropArea();else{this.dropZoneElement=null;var t=this.dropAreaWrapper.querySelector(".e-file-drop");t&&i.i(s.remove)(t)}},e.prototype.createDropTextHint=function(){var t=this.createElement("span",{className:"e-file-drop"});t.innerHTML=this.localizedTexts("dropFilesHint"),this.dropAreaWrapper.appendChild(t)},e.prototype.updateHTMLAttrToElement=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var n=e[t];y.indexOf(n)<0&&this.element.setAttribute(n,this.htmlAttributes[""+n])}},e.prototype.updateHTMLAttrToWrapper=function(){if(!i.i(s.isNullOrUndefined)(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var n=e[t];if(y.indexOf(n)>-1)if("class"===n){var a=this.htmlAttributes[""+n].replace(/\s+/g," ").trim();""!==a&&i.i(s.addClass)([this.uploadWrapper],a.split(" "))}else if("style"===n){var r=this.uploadWrapper.getAttribute(n);r=i.i(s.isNullOrUndefined)(r)?this.htmlAttributes[""+n]:r+this.htmlAttributes[""+n],this.uploadWrapper.setAttribute(n,r)}else this.uploadWrapper.setAttribute(n,this.htmlAttributes[""+n])}},e.prototype.setMultipleSelection=function(){if(this.multiple&&!this.element.hasAttribute("multiple")){var t=document.createAttribute("multiple");t.value="multiple",this.element.setAttributeNode(t)}else this.multiple||this.element.removeAttribute("multiple")},e.prototype.checkAutoUpload=function(t){this.autoUpload?(this.sequentialUpload?this.sequenceUpload(t):this.upload(t),this.removeActionButtons()):this.actionButtons||this.renderActionButtons(),this.checkActionButtonStatus()},e.prototype.sequenceUpload=function(t){if(this.filesData.length-t.length==0||"1"!==this.filesData[this.filesData.length-t.length-1].statusCode){(this.multiple||this.count<0)&&++this.count;var 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}},e.prototype.setCSSClass=function(t){var e=t;i.i(s.isNullOrUndefined)(t)||(e=t.replace(/\s+/g," ").trim()),i.i(s.isNullOrUndefined)(t)||""===e||i.i(s.removeClass)([this.uploadWrapper],e.split(" "));var n=this.cssClass;i.i(s.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(n=this.cssClass.replace(/\s+/g," ").trim()),i.i(s.isNullOrUndefined)(this.cssClass)||""===n||i.i(s.addClass)([this.uploadWrapper],n.split(n.indexOf(",")>-1?",":" "))},e.prototype.wireEvents=function(){s.EventHandler.add(this.browseButton,"click",this.browseButtonClick,this),s.EventHandler.add(this.element,"change",this.onSelectFiles,this),s.EventHandler.add(document,"click",this.removeFocus,this),this.keyboardModule=new s.KeyboardEvents(this.uploadWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.isForm&&s.EventHandler.add(this.formElement,"reset",this.resetForm,this)},e.prototype.unWireEvents=function(){s.EventHandler.remove(this.browseButton,"click",this.browseButtonClick),s.EventHandler.remove(this.element,"change",this.onSelectFiles),s.EventHandler.remove(document,"click",this.removeFocus),this.isForm&&s.EventHandler.remove(this.formElement,"reset",this.resetForm),this.keyboardModule&&this.keyboardModule.destroy()},e.prototype.resetForm=function(){this.clearAll()},e.prototype.keyActionHandler=function(t){var e=t.target;switch(t.action){case"enter":if(t.target===this.clearButton)this.clearButtonClick();else if(t.target===this.uploadButton)this.uploadButtonClick();else if(t.target===this.browseButton)this.browseButtonClick();else if(e.classList.contains(g)){var n=this.getCurrentMetaData(null,t);n.file.statusCode="4",n.file.status=this.localizedTexts("pauseUpload"),this.abortUpload(n,!1)}else if(e.classList.contains("e-file-play-btn"))this.resumeUpload(this.getCurrentMetaData(null,t),t);else if(e.classList.contains(c)){var n=this.getCurrentMetaData(null,t);if(i.i(s.isNullOrUndefined)(n)){var a=t.target.parentElement,r=this.filesData[this.fileList.indexOf(a)];this.retry(r)}else n.file.statusCode="1",n.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(n.file)}else this.removeFiles(t),e.classList.contains(u)||this.browseButton.focus();t.preventDefault(),t.stopPropagation()}},e.prototype.getCurrentMetaData=function(t,e){var n,a;if(i.i(s.isNullOrUndefined)(t)){var r=e.target.parentElement;n=this.filesData[this.fileList.indexOf(r)]}else n=t;for(var l=0;l<this.uploadMetaData.length;l++)this.uploadMetaData[l].file.name===n.name&&(a=this.uploadMetaData[l]);return a},e.prototype.removeFocus=function(){this.uploadWrapper&&this.listParent&&this.listParent.querySelector(".e-clear-icon-focus")&&(document.activeElement.blur(),this.listParent.querySelector(".e-clear-icon-focus").classList.remove("e-clear-icon-focus"))},e.prototype.browseButtonClick=function(){this.element.click()},e.prototype.uploadButtonClick=function(){this.sequentialUpload?this.sequenceUpload(this.filesData):this.upload(this.filesData)},e.prototype.clearButtonClick=function(){this.clearAll(),this.sequentialUpload&&(this.count=-1),this.actionCompleteCount=0},e.prototype.bindDropEvents=function(){this.dropZoneElement&&(s.EventHandler.add(this.dropZoneElement,"drop",this.dropElement,this),s.EventHandler.add(this.dropZoneElement,"dragover",this.dragHover,this),s.EventHandler.add(this.dropZoneElement,"dragleave",this.onDragLeave,this),s.EventHandler.add(this.dropZoneElement,"paste",this.onPasteFile,this),s.EventHandler.add(this.dropZoneElement,"dragenter",this.onDragEnter,this))},e.prototype.unBindDropEvents=function(){this.dropZoneElement&&(s.EventHandler.remove(this.dropZoneElement,"drop",this.dropElement),s.EventHandler.remove(this.dropZoneElement,"dragover",this.dragHover),s.EventHandler.remove(this.dropZoneElement,"dragleave",this.onDragLeave),s.EventHandler.remove(this.dropZoneElement,"dragenter",this.onDragEnter))},e.prototype.onDragEnter=function(t){this.enabled&&(this.dropZoneElement.classList.add("e-upload-drag-hover"),this.dragCounter=this.dragCounter+1,t.preventDefault(),t.stopPropagation())},e.prototype.onDragLeave=function(){this.enabled&&(this.dragCounter=this.dragCounter-1,this.dragCounter||this.dropZoneElement.classList.remove("e-upload-drag-hover"))},e.prototype.dragHover=function(t){this.enabled&&("Default"!==this.dropEffect&&(t.dataTransfer.dropEffect=this.dropEffect.toLowerCase()),t.preventDefault(),t.stopPropagation())},e.prototype.dropElement=function(t){this.dragCounter=0,this.dropZoneElement.classList.remove("e-upload-drag-hover"),this.onSelectFiles(t),t.preventDefault(),t.stopPropagation()},e.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){var i=[].slice.call(e)[0];"file"===i.kind&&i.type.match("^image/")&&this.renderSelectedFiles(t,[i.getAsFile()],!1,!0)}},e.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},e.prototype.removeFiles=function(t){if(this.enabled){var e=t.target.parentElement,a=this.fileList.indexOf(e),r=this.fileList[a],l=this.isFormUpload(),o=l?this.getSelectedFiles(a):this.getFilesInArray(this.filesData[a]);if(!i.i(s.isNullOrUndefined)(o)){if(t.target.classList.contains(u)&&!l){if(o[0].statusCode="5",!i.i(s.isNullOrUndefined)(r)){var h=r.querySelector("."+u);i.i(n.createSpinner)({target:h,width:"20px"}),i.i(n.showSpinner)(h)}this.sequentialUpload&&this.uploadSequential(),r.classList.contains("e-restrict-retry")||this.checkActionComplete(!0)}else i.i(s.closest)(t.target,".e-spinner-pane")||this.remove(o,!1,!1,!0,t);this.checkActionButtonStatus()}}},e.prototype.removeFilesData=function(t,e){var n;if(e)return void(this.showFileList||(n=this.filesData.indexOf(t),this.filesData.splice(n,1)));var a=this.getLiElement(t);i.i(s.isNullOrUndefined)(a)||(this.element.value="",i.i(s.detach)(a),n=this.fileList.indexOf(a),this.fileList.splice(n,1),this.filesData.splice(n,1),0!==this.fileList.length||i.i(s.isNullOrUndefined)(this.listParent)||(i.i(s.detach)(this.listParent),this.listParent=null,this.removeActionButtons()),this.sequentialUpload&&n<=this.count&&--this.count)},e.prototype.removeUploadedFile=function(t,e,i,n){var a=this,r=t,l=new s.Ajax(this.asyncSettings.removeUrl,"POST",!0,null);l.emitError=!1;var o=new FormData;l.beforeSend=function(s){e.currentRequest=l.httpRequest,i?a.removingEventCallback(e,o,r,t):a.trigger("removing",e,function(e){e.cancel?s.cancel=!0:a.removingEventCallback(e,o,r,t)})},l.onLoad=function(t){return a.removeCompleted(t,r,n),{}},l.onError=function(t){return a.removeFailed(t,r,n),{}},l.send(o)},e.prototype.removingEventCallback=function(t,e,a,r){var l=this.element.getAttribute("name"),o=this.getLiElement(r);if(!(i.i(s.isNullOrUndefined)(o)||i.i(s.isNullOrUndefined)(o.querySelector("."+d))&&i.i(s.isNullOrUndefined)(o.querySelector("."+h)))){var u=o.querySelector("."+d)?o.querySelector("."+d):o.querySelector("."+h);i.i(n.createSpinner)({target:u,width:"20px"}),i.i(n.showSpinner)(u)}t.postRawFile&&!i.i(s.isNullOrUndefined)(a.rawFile)&&""!==a.rawFile?e.append(l,a.rawFile,a.name):e.append(l,a.name),this.updateFormData(e,t.customFormData)},e.prototype.updateFormData=function(t,e){if(e.length>0&&e[0])for(var i=0;i<e.length;i++)!function(i){var s=e[i],n=Object.keys(s).map(function(t){return s[""+t]});t.append(Object.keys(s)[0],n)}(i)},e.prototype.updateCustomheader=function(t,e){if(e.length>0&&e[0])for(var i=0;i<e.length;i++)!function(i){var s=e[i],n=Object.keys(s).map(function(t){return s[""+t]});t.setRequestHeader(Object.keys(s)[0],n)}(i)},e.prototype.removeCompleted=function(t,e,i){var s=t&&t.currentTarget?this.getResponse(t):null,n=t.target;if(4===n.readyState&&n.status>=200&&n.status<=299){var a={e:t,response:s,operation:"remove",file:this.updateStatus(e,this.localizedTexts("removedSuccessMessage"),"2")};this.trigger("success",a),this.removeFilesData(e,i);var r=this.uploadedFilesData.indexOf(e);this.uploadedFilesData.splice(r,1),this.trigger("change",{files:this.uploadedFilesData})}else this.removeFailed(t,e,i)},e.prototype.removeFailed=function(t,e,a){var r=t&&t.currentTarget?this.getResponse(t):null,l={e:t,response:r,operation:"remove",file:this.updateStatus(e,this.localizedTexts("removedFailedMessage"),"0")};if(!a){var h=this.filesData.indexOf(e),u=this.fileList[h];if(u){u.classList.remove(f),u.classList.add(v);var c=u.querySelector("."+o);c&&(c.classList.remove(f),c.classList.add(v))}this.checkActionButtonStatus()}this.trigger("failure",l);var p=this.getLiElement(e);if(!i.i(s.isNullOrUndefined)(p)&&!i.i(s.isNullOrUndefined)(p.querySelector("."+d))){var m=p.querySelector("."+d);i.i(n.hideSpinner)(m),i.i(s.detach)(p.querySelector(".e-spinner-pane"))}},e.prototype.getFilesFromFolder=function(t){this.filesEntries=[];var e=this.multiple?t.dataTransfer.items:[t.dataTransfer.items[0]];if(this.checkDirectoryUpload(e))for(var i=this,s=0;s<e.length;s++)!function(s){var n=e[s].webkitGetAsEntry();if(n.isFile){var a=[];n.file(function(t){var e=n.fullPath;a.push({path:e,file:t})}),i.renderSelectedFiles(t,a,!0)}else n.isDirectory&&i.traverseFileTree(n,t)}(s)},e.prototype.checkDirectoryUpload=function(t){for(var e=0;t&&e<t.length;e++){if(t[e].webkitGetAsEntry().isDirectory)return!0}return!1},e.prototype.traverseFileTree=function(t,e){if(t.isFile)this.filesEntries.push(t);else if(t.isDirectory){var i=t.createReader();this.readFileFromDirectory(i,e)}},e.prototype.readFileFromDirectory=function(t,e){var i=this;t.readEntries(function(s){for(var n=0;n<s.length;n++)i.traverseFileTree(s[n],e);i.pushFilesEntries(e),s.length&&i.readFileFromDirectory(t)})},e.prototype.pushFilesEntries=function(t){for(var e=this,i=[],s=this,n=0;n<this.filesEntries.length;n++)!function(n){s.filesEntries[n].file(function(s){if(e.filesEntries.length){var a=e.filesEntries[n].fullPath;i.push({path:a,file:s}),n===e.filesEntries.length-1&&(e.filesEntries=[],e.renderSelectedFiles(t,i,!0))}})}(n)},e.prototype.onSelectFiles=function(t){if(this.enabled){var e;if("drop"===t.type)if(this.directoryUpload)this.getFilesFromFolder(t);else{var i=this.sortFilesList=t.dataTransfer.files;"msie"!==this.browserName&&"edge"!==this.browserName&&"safari"!==this.browserName&&(this.element.files=i),i.length>0&&(e=this.multiple?this.sortFileList(i):[i[0]],this.renderSelectedFiles(t,e))}else e=[].slice.call(t.target.files),this.renderSelectedFiles(t,e);this.isAngular&&t.stopPropagation()}},e.prototype.getBase64=function(t){return new Promise(function(e,i){var s=new FileReader;s.readAsDataURL(t),s.onload=function(){return e(s.result)},s.onerror=function(t){return i(t)}})},e.prototype.renderSelectedFiles=function(t,e,i,n){var a=this;this.base64String=[];var r={event:t,cancel:!1,filesData:[],isModified:!1,modifiedFilesData:[],progressInterval:"",isCanceled:!1,currentRequest:null,customFormData:null};if(e.length<1)return r.isCanceled=!0,void this.trigger("selected",r);this.flag=!0;var l=[];this.multiple||(this.clearData(!0),e=[e[0]]);for(var o=0;o<e.length;o++){var h=i?e[o].file:e[o];this.updateInitialFileDetails(t,e,h,o,l,i,n)}if(r.filesData=l,this.allowedExtensions.indexOf("*")>-1&&(this.allTypes=!0),this.enableHtmlSanitizer)for(var o=0;o<l.length;o++){var d=s.SanitizeHtmlHelper.beforeSanitize(),u=s.SanitizeHtmlHelper.serializeValue(d,l[parseInt(o.toString())].name);if(u!==l[parseInt(o.toString())].name){var c=e[parseInt(o.toString())].name.replace(/[\u00A0-\u9999<>\&]/g,function(t){return"&#"+t.charCodeAt(0)+";"});l[parseInt(o.toString())].name=c,l[parseInt(o.toString())].status=this.localizedTexts("invalidFileName"),l[parseInt(o.toString())].statusCode="0"}}this.allTypes||(l=this.checkExtension(l)),this.trigger("selected",r,function(t){a._internalRenderSelect(t,l)})},e.prototype.updateInitialFileDetails=function(t,e,n,a,r,l,o){var h=l?e[a].path.substring(1,e[a].path.length):o?i.i(s.getUniqueID)(n.name.substring(0,n.name.lastIndexOf(".")))+"."+this.getFileType(n.name):this.directoryUpload?e[a].webkitRelativePath:n.name,d={name:h,rawFile:n,size:n.size,status:this.localizedTexts("readyToUploadMessage"),type:this.getFileType(n.name),validationMessages:this.validatedFileSize(n.size),statusCode:"1",id:i.i(s.getUniqueID)(n.name.substring(0,n.name.lastIndexOf(".")))+"."+this.getFileType(n.name)};o&&(d.fileSource="paste"),d.status=""!==d.validationMessages.minSize?this.localizedTexts("invalidMinFileSize"):""!==d.validationMessages.maxSize?this.localizedTexts("invalidMaxFileSize"):d.status,""===d.validationMessages.minSize&&""===d.validationMessages.maxSize||(d.statusCode="0"),r.push(d)},e.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&&t.modifiedFilesData.length>0){for(var n=0;n<t.modifiedFilesData.length;n++)for(var a=0;a<e.length;a++)t.modifiedFilesData[n].id===e[a].id&&(t.modifiedFilesData[n].rawFile=e[a].rawFile);var r=this.allTypes?t.modifiedFilesData:this.checkExtension(t.modifiedFilesData);this.updateSortedFileList(r),this.filesData=this.filesData.concat(r),this.isForm&&!this.allowUpload()||this.checkAutoUpload(r)}else this.internalCreateFileList(e),this.filesData=this.filesData.concat(e),this.isForm&&!this.allowUpload()||this.checkAutoUpload(e);i.i(s.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}},e.prototype.allowUpload=function(){var t=!1;return this.isForm&&!i.i(s.isNullOrUndefined)(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl&&(t=!0),t},e.prototype.isFormUpload=function(){var t=!1;return!this.isForm||!i.i(s.isNullOrUndefined)(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl||!i.i(s.isNullOrUndefined)(this.asyncSettings.removeUrl)&&""!==this.asyncSettings.removeUrl||(t=!0),t},e.prototype.clearData=function(t){i.i(s.isNullOrUndefined)(this.listParent)||(i.i(s.detach)(this.listParent),this.listParent=null),"msie"===this.browserName||t||(this.element.value=""),this.fileList=[],this.filesData=[],this.removeActionButtons()},e.prototype.updateSortedFileList=function(t){var e=this.createElement("div",{id:"clonewrapper"}),i=-1;if(this.listParent){for(var n=0;n<this.listParent.querySelectorAll("li").length;n++){var a=this.listParent.querySelectorAll("li")[n];e.appendChild(a.cloneNode(!0))}this.removeActionButtons();var r=[].slice.call(e.childNodes);this.createParentUL();for(var l=0;l<t.length;l++){for(var o=0;o<this.filesData.length;o++)this.filesData[o].name===t[l].name&&(this.listParent.appendChild(r[o]),s.EventHandler.add(r[o].querySelector(".e-icons"),"click",this.removeFiles,this),this.fileList.push(r[o]),i=l);i!==l&&this.internalCreateFileList([t[l]])}}else this.internalCreateFileList(t)},e.prototype.isBlank=function(t){return!t||/^\s*$/.test(t)},e.prototype.checkExtension=function(t){var e=t;if(!this.isBlank(this.allowedExtensions)){for(var i=[],s=this.allowedExtensions.split(","),n=0,a=s;n<a.length;n++){var r=a[n];i.push(r.trim().toLocaleLowerCase())}for(var l=0;l<t.length;l++)-1===i.indexOf(("."+t[l].type).toLocaleLowerCase())&&(t[l].status=this.localizedTexts("invalidFileType"),t[l].statusCode="0")}return e},e.prototype.validatedFileSize=function(t){var e="",i="";return t<this.minFileSize?e=this.localizedTexts("invalidMinFileSize"):t>this.maxFileSize?i=this.localizedTexts("invalidMaxFileSize"):(e="",i=""),{minSize:e,maxSize:i}},e.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},e.prototype.createCustomfileList=function(t){this.createParentUL();for(var e=0,n=t;e<n.length;e++){var a=n[e],r=this.createElement("li",{className:l,attrs:{"data-file-name":a.name}});this.uploadTemplateFn=this.templateComplier(this.template);var o=this.uploadTemplateFn(a,this,"template",this.element.id+"Template",this.isStringTemplate,null,r);if(o){var h=[].slice.call(o);i.i(s.append)(h,r)}var d=t.indexOf(a),u={element:r,fileInfo:a,index:d,isPreload:this.isPreLoadFile(a)},c={element:r,fileInfo:a,index:d,isPreload:this.isPreLoadFile(a)};this.trigger("rendering",u),this.trigger("fileListRendering",c),this.listParent.appendChild(r),this.fileList.push(r)}this.renderReactTemplates()},e.prototype.createParentUL=function(){i.i(s.isNullOrUndefined)(this.listParent)&&(this.listParent=this.createElement("ul",{className:"e-upload-files"}),this.uploadWrapper.appendChild(this.listParent))},e.prototype.formFileList=function(t,e){var n=this.createElement("li",{className:l});n.setAttribute("data-files-count",t.length+"");for(var a,r=this.createElement("span",{className:"e-file-container"}),d=0,u=t;d<u.length;d++){var c=u[d],p=this.createElement("span",{className:"e-file-name"});p.innerHTML=this.getFileNameOnly(c.name);var m=this.createElement("span",{className:"e-file-type"}),f=this.getFileType(c.name);if(m.innerHTML="."+f,f||m.classList.add("e-hidden"),this.enableRtl){var v=this.createElement("span",{className:"e-rtl-container"});v.appendChild(m),v.appendChild(p),r.appendChild(v)}else r.appendChild(p),r.appendChild(m);this.truncateName(p),a=this.formValidateFileInfo(c,n)}n.appendChild(r),this.setListToFileInfo(t,n);var g=this.listParent.querySelectorAll("li").length,y=this.createElement("span");if(n.classList.contains("e-file-invalid")?(y.classList.add(o),y.classList.add("e-file-invalid"),y.innerText=t.length>1?this.localizedTexts("invalidFileSelection"):a):(y.classList.add(t.length>1?"e-file-information":"e-file-size"),y.innerText=t.length>1?this.localizedTexts("totalFiles")+": "+t.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(t)):this.bytesToSize(t[0].size),this.createFormInput(t)),r.appendChild(y),i.i(s.isNullOrUndefined)(n.querySelector(".e-icons"))){var b=this.createElement("span",{className:"e-icons",attrs:{tabindex:this.btnTabIndex}});"msie"===this.browserName&&b.classList.add("e-msie"),b.setAttribute("title",this.localizedTexts("remove")),n.appendChild(r),n.appendChild(b),s.EventHandler.add(b,"click",this.removeFiles,this),b.classList.add(h)}var C={element:n,fileInfo:this.mergeFileInfo(t,n),index:g,isPreload:this.isPreLoadFile(this.mergeFileInfo(t,n))},E={element:n,fileInfo:this.mergeFileInfo(t,n),index:g,isPreload:this.isPreLoadFile(this.mergeFileInfo(t,n))};this.trigger("rendering",C),this.trigger("fileListRendering",E),this.listParent.appendChild(n),this.fileList.push(n)},e.prototype.formValidateFileInfo=function(t,e){var i=t.status,s=this.validatedFileSize(t.size);""===s.minSize&&""===s.maxSize||(this.addInvalidClass(e),i=""!==s.minSize?this.localizedTexts("invalidMinFileSize"):""!==s.maxSize?this.localizedTexts("invalidMaxFileSize"):i);var n=this.checkExtension(this.getFilesInArray(t))[0].status;return n===this.localizedTexts("invalidFileType")&&(this.addInvalidClass(e),i=n),i},e.prototype.addInvalidClass=function(t){t.classList.add("e-file-invalid")},e.prototype.createFormInput=function(t){if("safari"!==this.browserName){var e=this.element.cloneNode(!0);e.classList.add("e-hidden-file-input");for(var n=0,a=t;n<a.length;n++){a[n].input=e}e.setAttribute("id",i.i(s.getUniqueID)("hiddenUploader")),e.setAttribute("name",this.uploaderName),this.uploadWrapper.querySelector(".e-file-select").appendChild(e),"msie"!==this.browserName&&"edge"!==this.browserName&&(this.element.value="")}},e.prototype.getFileSize=function(t){for(var e=0,i=0,s=t;i<s.length;i++){e+=s[i].size}return e},e.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},e.prototype.statusForFormUpload=function(t,e){for(var i,s=!0,n=0,a=t;n<a.length;n++){var r=a[n];i=r.status;var l=this.validatedFileSize(r.size);""===l.minSize&&""===l.maxSize||(s=!1,i=""!==l.minSize?this.localizedTexts("invalidMinFileSize"):""!==l.maxSize?this.localizedTexts("invalidMaxFileSize"):i);var o=this.checkExtension(this.getFilesInArray(r))[0].status;o===this.localizedTexts("invalidFileType")&&(s=!1,i=o)}return s?i=this.localizedTexts("totalFiles")+": "+t.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(t)):(e.classList.add("e-file-invalid"),i=t.length>1?this.localizedTexts("invalidFileSelection"):i),i},e.prototype.formCustomFileList=function(t,e){this.createParentUL();var n=this.createElement("li",{className:l});n.setAttribute("data-files-count",t.length+""),this.setListToFileInfo(t,n);var a=this.mergeFileInfo(t,n);n.setAttribute("data-file-name",a.name),this.uploadTemplateFn=this.templateComplier(this.template);var r=this.uploadTemplateFn(a,this,"template",this.element.id+"Template",this.isStringTemplate,null,n);if(r){var o=[].slice.call(r);i.i(s.append)(o,n)}var h=this.listParent.querySelectorAll("li").length;n.classList.contains("e-file-invalid")||this.createFormInput(t);var d={element:n,fileInfo:a,index:h,isPreload:this.isPreLoadFile(a)},u={element:n,fileInfo:a,index:h,isPreload:this.isPreLoadFile(a)};this.trigger("rendering",d),this.trigger("fileListRendering",u),this.listParent.appendChild(n),this.fileList.push(n),this.renderReactTemplates()},e.prototype.createFileList=function(t){this.filesData=this.filesData&&this.filesData.length>0?this.filesData.concat(t):t,this.internalCreateFileList(t)},e.prototype.internalCreateFileList=function(t){if(this.createParentUL(),""===this.template||i.i(s.isNullOrUndefined)(this.template))if(this.isFormUpload())this.uploadWrapper.classList.add("e-form-upload"),this.formFileList(t,this.element.files);else for(var e=0,n=t;e<n.length;e++){var a=n[e],r=this.createElement("li",{className:l,attrs:{"data-file-name":a.name,"data-files-count":"1"}}),u=this.createElement("span",{className:"e-file-container"}),c=this.createElement("span",{className:"e-file-name",attrs:{title:a.name}});c.innerHTML=this.getFileNameOnly(a.name);var p=this.createElement("span",{className:"e-file-type"}),m=this.getFileType(a.name);if(p.innerHTML="."+m,m||p.classList.add("e-hidden"),this.enableRtl){var v=this.createElement("span",{className:"e-rtl-container"});v.appendChild(p),v.appendChild(c),u.appendChild(v)}else u.appendChild(c),u.appendChild(p);var g=this.createElement("span",{className:"e-file-size"});g.innerHTML=this.bytesToSize(a.size),u.appendChild(g);var y=this.createElement("span",{className:o});u.appendChild(y),y.innerHTML=a.status,r.appendChild(u);var b=this.createElement("span",{className:" e-icons",attrs:{tabindex:this.btnTabIndex}});"msie"===this.browserName&&b.classList.add("e-msie"),b.setAttribute("title",this.localizedTexts("remove")),r.appendChild(b),s.EventHandler.add(b,"click",this.removeFiles,this),"2"===a.statusCode?(y.classList.add(f),b.classList.add(d),b.setAttribute("title",this.localizedTexts("delete"))):"1"!==a.statusCode&&(y.classList.remove(f),y.classList.add("e-validation-fails")),this.autoUpload&&"1"===a.statusCode&&""!==this.asyncSettings.saveUrl&&(y.innerHTML=""),b.classList.contains(d)||b.classList.add(h);var C=t.indexOf(a),E={element:r,fileInfo:a,index:C,isPreload:this.isPreLoadFile(a)},x={element:r,fileInfo:a,index:C,isPreload:this.isPreLoadFile(a)};this.trigger("rendering",E),this.trigger("fileListRendering",x),this.listParent.appendChild(r),this.fileList.push(r),this.truncateName(c);var S=this.flag;this.isPreLoadFile(a)&&(this.flag=!1,this.checkActionComplete(!0),this.flag=S)}else this.isFormUpload()?(this.uploadWrapper.classList.add("e-form-upload"),this.formCustomFileList(t,this.element.files)):this.createCustomfileList(t)},e.prototype.getSlicedName=function(t){var e=t.textContent;t.dataset.tail=e.slice(e.length-10)},e.prototype.setListToFileInfo=function(t,e){for(var i=0,s=t;i<s.length;i++){s[i].list=e}},e.prototype.truncateName=function(t){var e=t;"edge"!==this.browserName&&e.offsetWidth<e.scrollWidth?this.getSlicedName(e):e.offsetWidth+1<e.scrollWidth&&this.getSlicedName(e)},e.prototype.getFileType=function(t){var e,i=t.lastIndexOf(".");return i>=0&&(e=t.substring(i+1)),e||""},e.prototype.getFileNameOnly=function(t){var e=this.getFileType(t);return e=t.split("."+e)[0]},e.prototype.setInitialAttributes=function(){if(this.initialAttr.accept&&this.element.setAttribute("accept",this.initialAttr.accept),this.initialAttr.disabled&&this.element.setAttribute("disabled","disabled"),this.initialAttr.multiple){var t=document.createAttribute("multiple");this.element.setAttributeNode(t)}},e.prototype.filterfileList=function(t){for(var e,i=[],s=0;s<t.length;s++)e=this.getLiElement(t[s]),e.classList.contains(f)||i.push(t[s]);return i},e.prototype.updateStatus=function(t,e,n,a){if(void 0===a&&(a=!0),""===e||i.i(s.isNullOrUndefined)(e)||""===n||i.i(s.isNullOrUndefined)(n)||(t.status=e,t.statusCode=n),a){var r=this.getLiElement(t);i.i(s.isNullOrUndefined)(r)||i.i(s.isNullOrUndefined)(r.querySelector("."+o))||""===e||i.i(s.isNullOrUndefined)(e)||(r.querySelector("."+o).textContent=e)}return t},e.prototype.getLiElement=function(t){for(var e,n=0;n<this.filesData.length;n++)i.i(s.isNullOrUndefined)(t)||(i.i(s.isNullOrUndefined)(this.filesData[n].id)||i.i(s.isNullOrUndefined)(t.id)?this.filesData[n].name!==t.name:this.filesData[n].name!==t.name||this.filesData[n].id!==t.id)||(e=n);return this.fileList[e]},e.prototype.createProgressBar=function(t){var e=this.createElement("span",{className:p}),i=this.createElement("progressbar",{className:m,attrs:{value:"0",max:"100"}}),s=this.createElement("span",{className:"e-progress-inner-wrap"});i.setAttribute("style","width: 0%");var n=this.createElement("span",{className:"e-progress-bar-text"});n.textContent="0%",s.appendChild(i),e.appendChild(s),e.appendChild(n),t.querySelector(".e-file-container").appendChild(e)},e.prototype.updateProgressbar=function(t,e){if(!isNaN(Math.round(t.loaded/t.total*100))&&!i.i(s.isNullOrUndefined)(e.querySelector("."+m)))if(i.i(s.isNullOrUndefined)(this.progressInterval)||""===this.progressInterval)this.changeProgressValue(e,Math.round(t.loaded/t.total*100).toString()+"%");else{var n=Math.round(t.loaded/t.total*100)%parseInt(this.progressInterval,10);0!==n&&100!==n||this.changeProgressValue(e,Math.round(t.loaded/t.total*100).toString()+"%")}},e.prototype.changeProgressValue=function(t,e){t.querySelector("."+m).setAttribute("style","width:"+e),t.querySelector(".e-progress-bar-text").textContent=e},e.prototype.uploadInProgress=function(t,e,n,a){var r=this.getLiElement(e);if(!i.i(s.isNullOrUndefined)(r)||n){if(i.i(s.isNullOrUndefined)(r))this.cancelUploadingFile(e,t,a);else{"5"===e.statusCode&&this.cancelUploadingFile(e,t,a,r),r.querySelectorAll("."+p).length>0||!r.querySelector("."+o)||(r.querySelector("."+o).classList.add("e-upload-progress"),this.createProgressBar(r),this.updateProgressBarClasses(r,"e-upload-progress"),r.querySelector("."+o).classList.remove(v)),this.updateProgressbar(t,r);var l=r.querySelector("."+h);i.i(s.isNullOrUndefined)(l)||(l.classList.add(u,"e-upload-progress"),l.setAttribute("title",this.localizedTexts("abort")),l.classList.remove(h))}var d={e:t,operation:"upload",file:this.updateStatus(e,this.localizedTexts("inProgress"),"3")};this.trigger("progress",d)}},e.prototype.cancelUploadingFile=function(t,e,a,r){var l=this;if("5"===t.statusCode){var o={event:e,fileData:t,cancel:!1,customFormData:[]};this.trigger("canceling",o,function(e){if(e.cancel){if(t.statusCode="3",!i.i(s.isNullOrUndefined)(r)){var o=r.querySelector("."+u);i.i(s.isNullOrUndefined)(o)||(i.i(n.hideSpinner)(o),i.i(s.detach)(r.querySelector(".e-spinner-pane")))}}else{a.emitError=!1,a.httpRequest.abort();var h=new FormData;if("5"===t.statusCode){var d=l.element.getAttribute("name");h.append(d,t.name),h.append("cancel-uploading",t.name),l.updateFormData(h,e.customFormData);var c=new s.Ajax(l.asyncSettings.removeUrl,"POST",!0,null);c.emitError=!1,c.onLoad=function(e){return l.removecanceledFile(e,t),{}},c.send(h)}}})}},e.prototype.removecanceledFile=function(t,e){var a=this.getLiElement(e);if(!(i.i(s.isNullOrUndefined)(a)||a.querySelector("."+c)||i.i(s.isNullOrUndefined)(a.querySelector("."+u)))){this.updateStatus(e,this.localizedTexts("fileUploadCancel"),"5"),this.renderFailureState(t,e,a);var r=a.querySelector("."+h);i.i(s.isNullOrUndefined)(a)||(i.i(n.hideSpinner)(r),i.i(s.isNullOrUndefined)(a.querySelector(".e-spinner-pane"))||i.i(s.detach)(a.querySelector(".e-spinner-pane")));var l=t&&t.currentTarget?this.getResponse(t):null,o={event:t,response:l,operation:"cancel",file:e};this.trigger("success",o)}},e.prototype.renderFailureState=function(t,e,n){var a=this;this.updateProgressBarClasses(n,v),this.removeProgressbar(n,"failure"),i.i(s.isNullOrUndefined)(n.querySelector(".e-file-status"))||n.querySelector(".e-file-status").classList.add(v);var r=n.querySelector("."+u);if(!i.i(s.isNullOrUndefined)(r)){r.classList.remove(u,"e-upload-progress"),r.classList.add(h),r.setAttribute("title",this.localizedTexts("remove")),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}}),r.parentElement.insertBefore(this.pauseButton,r),this.pauseButton.setAttribute("title",this.localizedTexts("retry"));n.querySelector("."+c).addEventListener("click",function(t){a.reloadcanceledFile(t,e,n,!1)},!1)}},e.prototype.reloadcanceledFile=function(t,e,n,a){e.statusCode="1",e.status=this.localizedTexts("readyToUploadMessage"),a||(i.i(s.isNullOrUndefined)(n.querySelector("."+o))||n.querySelector("."+o).classList.remove(v),i.i(s.isNullOrUndefined)(n.querySelector("."+c))||i.i(s.detach)(n.querySelector("."+c)),this.pauseButton=null),i.i(s.isNullOrUndefined)(n)||n.classList.add("e-restrict-retry"),this.upload([e])},e.prototype.uploadComplete=function(t,e,n){var a=t.target;if(4===a.readyState&&a.status>=200&&a.status<=299){var r=this.getLiElement(e);if(i.i(s.isNullOrUndefined)(r)&&(!n||i.i(s.isNullOrUndefined)(n)))return;if(!i.i(s.isNullOrUndefined)(r)){this.updateProgressBarClasses(r,f),this.removeProgressbar(r,"success");var l=r.querySelector("."+u);i.i(s.isNullOrUndefined)(l)||(l.classList.add(d),l.setAttribute("title",this.localizedTexts("delete")),l.classList.remove(u),l.classList.remove("e-upload-progress"))}this.raiseSuccessEvent(t,e)}else this.uploadFailed(t,e)},e.prototype.getResponse=function(t){var e=t.currentTarget;return{readyState:e.readyState,statusCode:e.status,statusText:e.statusText,headers:e.getAllResponseHeaders(),withCredentials:e.withCredentials}},e.prototype.raiseSuccessEvent=function(t,e){var a=this,r=t&&t.currentTarget?this.getResponse(t):null,l=this.localizedTexts("uploadSuccessMessage"),o={e:t,response:r,operation:"upload",file:this.updateStatus(e,l,"2",!1),statusText:l},h=this.getLiElement(e);if(!i.i(s.isNullOrUndefined)(h)){var d=h.querySelector(".e-spinner-pane");i.i(s.isNullOrUndefined)(d)||(i.i(n.hideSpinner)(h),i.i(s.detach)(d))}this.trigger("success",o,function(t){a.updateStatus(e,t.statusText,"2"),a.uploadedFilesData.push(e),a.trigger("change",{file:a.uploadedFilesData}),a.checkActionButtonStatus(),a.fileList.length>0&&(a.getLiElement(e).classList.contains("e-restrict-retry")?a.getLiElement(e).classList.remove("e-restrict-retry"):(a.uploadSequential(),a.checkActionComplete(!0)))})},e.prototype.uploadFailed=function(t,e){var n=this,a=this.getLiElement(e),r=t&&t.currentTarget?this.getResponse(t):null,l=this.localizedTexts("uploadFailedMessage"),o={e:t,response:r,operation:"upload",file:this.updateStatus(e,l,"0",!1),statusText:l};i.i(s.isNullOrUndefined)(a)||this.renderFailureState(t,e,a),this.trigger("failure",o,function(t){n.updateStatus(e,t.statusText,"0"),n.checkActionButtonStatus(),n.uploadSequential(),n.checkActionComplete(!0)})},e.prototype.uploadSequential=function(){this.sequentialUpload&&(this.autoUpload?this.checkAutoUpload(this.filesData):this.uploadButtonClick())},e.prototype.checkActionComplete=function(t){t?++this.actionCompleteCount:--this.actionCompleteCount,this.raiseActionComplete()},e.prototype.raiseActionComplete=function(){if(this.filesData.length===this.actionCompleteCount&&this.flag){this.flag=!1;var t={fileData:[]};t.fileData=this.getSelectedFileStatus(this.selectedFiles),this.trigger("actionComplete",t)}},e.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++)this.filesData[a].name===n.name&&this.filesData[a].status===n.status&&(e[i]=this.filesData[a],++i);return e},e.prototype.updateProgressBarClasses=function(t,e){var n=t.querySelector("."+m);i.i(s.isNullOrUndefined)(n)||n.classList.add(e)},e.prototype.removeProgressbar=function(t,e){var n=this;i.i(s.isNullOrUndefined)(t.querySelector("."+p))||(this.progressAnimation=new s.Animation({duration:1250}),this.progressAnimation.animate(t.querySelector("."+p),{name:"FadeOut"}),this.progressAnimation.animate(t.querySelector(".e-progress-bar-text"),{name:"FadeOut"}),setTimeout(function(){n.animateProgressBar(t,e)},750))},e.prototype.animateProgressBar=function(t,e){"success"===e?(t.classList.add(f),i.i(s.isNullOrUndefined)(t.querySelector("."+o))||(t.querySelector("."+o).classList.remove("e-upload-progress"),this.progressAnimation.animate(t.querySelector("."+o),{name:"FadeIn"}),t.querySelector("."+o).classList.add(f))):i.i(s.isNullOrUndefined)(t.querySelector("."+o))||(t.querySelector("."+o).classList.remove("e-upload-progress"),this.progressAnimation.animate(t.querySelector("."+o),{name:"FadeIn"}),t.querySelector("."+o).classList.add(v)),t.querySelector("."+p)&&i.i(s.detach)(t.querySelector("."+p))},e.prototype.setExtensions=function(t){""===t||i.i(s.isNullOrUndefined)(t)?this.element.removeAttribute("accept"):this.element.setAttribute("accept",t)},e.prototype.templateComplier=function(t){if(t)try{return"function"!=typeof t&&i.i(s.selectAll)(t,document).length?i.i(s.compile)(i.i(s.select)(t,document).innerHTML.trim()):i.i(s.compile)(t)}catch(e){return i.i(s.compile)(t)}},e.prototype.setRTL=function(){this.enableRtl?i.i(s.addClass)([this.uploadWrapper],"e-rtl"):i.i(s.removeClass)([this.uploadWrapper],"e-rtl")},e.prototype.localizedTexts=function(t){return this.l10n.setLocale(this.locale),this.l10n.getConstant(t)},e.prototype.setControlStatus=function(){this.enabled?(this.uploadWrapper.classList.contains("e-disabled")&&this.uploadWrapper.classList.remove("e-disabled"),!i.i(s.isNullOrUndefined)(this.browseButton)&&this.element.hasAttribute("disabled")&&(this.element.removeAttribute("disabled"),this.browseButton.removeAttribute("disabled")),!i.i(s.isNullOrUndefined)(this.clearButton)&&this.clearButton.hasAttribute("disabled")&&this.clearButton.removeAttribute("disabled"),!i.i(s.isNullOrUndefined)(this.uploadButton)&&this.uploadButton.hasAttribute("disabled")&&this.uploadButton.hasAttribute("disabled")):(this.uploadWrapper.classList.add("e-disabled"),this.element.setAttribute("disabled","disabled"),this.browseButton.setAttribute("disabled","disabled"),i.i(s.isNullOrUndefined)(this.clearButton)||this.clearButton.setAttribute("disabled","disabled"),i.i(s.isNullOrUndefined)(this.uploadButton)||this.uploadButton.setAttribute("disabled","disabled"))},e.prototype.checkHTMLAttributes=function(t){for(var e=t?i.i(s.isNullOrUndefined)(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["accept","multiple","disabled"],n=0,a=e;n<a.length;n++){var r=a[n];if(!i.i(s.isNullOrUndefined)(this.element.getAttribute(r)))switch(r){case"accept":(i.i(s.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":if(i.i(s.isNullOrUndefined)(this.uploaderOptions)||void 0===this.uploaderOptions.multiple||t){var l="multiple"===this.element.getAttribute(r)||""===this.element.getAttribute(r)||"true"===this.element.getAttribute(r);this.setProperties({multiple:l},!t),this.initialAttr.multiple=!0}break;case"disabled":if(i.i(s.isNullOrUndefined)(this.uploaderOptions)||void 0===this.uploaderOptions.enabled||t){var o="disabled"!==this.element.getAttribute(r)&&""!==this.element.getAttribute(r)&&"true"!==this.element.getAttribute(r);this.setProperties({enabled:o},!t),this.initialAttr.disabled=!0}}}},e.prototype.chunkUpload=function(t,e,i){var s=Math.min(this.asyncSettings.chunkSize,t.size),n=t.rawFile.slice(0,s),a={chunkIndex:0,blob:n,file:t,start:0,end:s,retryCount:0,request:null};this.sendRequest(t,a,e,i)},e.prototype.sendRequest=function(t,e,i,n){var a=this,r=new FormData,l=t.rawFile.slice(e.start,e.end);r.append(this.uploaderName,l,t.name),r.append("chunk-index",e.chunkIndex.toString()),r.append("chunkIndex",e.chunkIndex.toString());var o=Math.max(Math.ceil(t.size/this.asyncSettings.chunkSize),1);r.append("total-chunk",o.toString()),r.append("totalChunk",o.toString());var h=new s.Ajax({url:this.asyncSettings.saveUrl,type:"POST",async:!0,contentType:null});h.emitError=!1,h.onLoad=function(t){return a.chunkUploadComplete(t,e,i),{}},h.onUploadProgress=function(t){return a.chunkUploadInProgress(t,e,i),{}};var d={fileData:t,customFormData:[],cancel:!1,chunkSize:0===this.asyncSettings.chunkSize?null:this.asyncSettings.chunkSize};h.beforeSend=function(i){d.currentRequest=h.httpRequest,d.currentChunkIndex=e.chunkIndex,0===d.currentChunkIndex?a.trigger("uploading",d,function(e){a.uploadingEventCallback(r,e,i,t)}):a.trigger("chunkUploading",d,function(e){a.uploadingEventCallback(r,e,i,t)})},h.onError=function(t){return a.chunkUploadFailed(t,e,i),{}},h.send(r),e.request=h},e.prototype.uploadingEventCallback=function(t,e,i,s){e.cancel?this.eventCancelByArgs(i,e,s):this.updateFormData(t,e.customFormData)},e.prototype.eventCancelByArgs=function(t,e,n){var a=this;if(t.cancel=!0,"5"!==e.fileData.statusCode){e.fileData.statusCode="5",e.fileData.status=this.localizedTexts("fileUploadCancel");var r=this.getLiElement(e.fileData);if(r){i.i(s.isNullOrUndefined)(r.querySelector("."+o))||(r.querySelector("."+o).innerHTML=this.localizedTexts("fileUploadCancel"),r.querySelector("."+o).classList.add(v)),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}});var l=r.querySelector("."+h);l&&l.parentElement.insertBefore(this.pauseButton,l),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),this.pauseButton.addEventListener("click",function(t){a.reloadcanceledFile(t,n,r)},!1),this.checkActionButtonStatus()}}},e.prototype.checkChunkUpload=function(){return!(this.asyncSettings.chunkSize<=0||i.i(s.isNullOrUndefined)(this.asyncSettings.chunkSize))},e.prototype.chunkUploadComplete=function(t,e,a){var r,l=this,o=t.target;if(4===o.readyState&&o.status>=200&&o.status<300){var h=t&&t.currentTarget?this.getResponse(t):null,d=Math.max(Math.ceil(e.file.size/this.asyncSettings.chunkSize),1),c={event:t,file:e.file,chunkIndex:e.chunkIndex,totalChunk:d,chunkSize:this.asyncSettings.chunkSize,response:h};if(this.trigger("chunkSuccess",c),!i.i(s.isNullOrUndefined)(a)&&a||(r=this.getLiElement(e.file)),this.updateMetaData(e),e.end===e.file.size&&(e.file.statusCode="3"),"5"===e.file.statusCode){var p={event:t,fileData:e.file,cancel:!1,customFormData:[]};this.trigger("canceling",p,function(t){if(t.cancel){e.file.statusCode="3";var h=r.querySelector("."+u);i.i(s.isNullOrUndefined)(r)||i.i(s.isNullOrUndefined)(h)||(i.i(n.hideSpinner)(h),i.i(s.detach)(r.querySelector(".e-spinner-pane"))),l.sendNextRequest(e)}else{e.request.emitError=!1,o.abort();var d=new FormData,c=l.element.getAttribute("name");d.append(c,e.file.name),d.append("cancel-uploading",e.file.name),d.append("cancelUploading",e.file.name),l.updateFormData(d,t.customFormData);var p=new s.Ajax(l.asyncSettings.removeUrl,"POST",!0,null);p.emitError=!1,p.onLoad=function(t){return l.removeChunkFile(t,e,a),{}},p.send(d)}})}else{if(d-1===e.chunkIndex&&d>e.chunkIndex){var m=this.pausedData.indexOf(e);return m>=0&&this.pausedData.splice(m,1),i.i(s.isNullOrUndefined)(this.template)&&(i.i(s.isNullOrUndefined)(a)||!a)&&r&&(r&&!i.i(s.isNullOrUndefined)(r.querySelector("."+g))&&i.i(s.detach)(r.querySelector("."+g)),this.removeChunkProgressBar(e)),void this.raiseSuccessEvent(t,e.file)}"4"!==e.file.statusCode&&this.sendNextRequest(e)}}else this.chunkUploadFailed(t,e)},e.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)},e.prototype.removeChunkFile=function(t,e,a){if(i.i(s.isNullOrUndefined)(this.template)&&i.i(s.isNullOrUndefined)(a)&&!a){var r=this.getLiElement(e.file),l=r.querySelector("."+u),o=l;this.updateStatus(e.file,this.localizedTexts("fileUploadCancel"),"5"),this.updateProgressBarClasses(r,v),this.removeProgressbar(r,"failure"),l&&l.classList.remove(u),l&&l.classList.add(h),l&&l.setAttribute("title",this.localizedTexts("remove"));var d=r.querySelector("."+g);d&&d.classList.add(c),d&&d.classList.remove(g),d&&d.setAttribute("title",this.localizedTexts("retry")),i.i(s.isNullOrUndefined)(r)||i.i(s.isNullOrUndefined)(l)||i.i(s.isNullOrUndefined)(r.querySelector(".e-spinner-pane"))||(i.i(n.hideSpinner)(o),i.i(s.detach)(r.querySelector(".e-spinner-pane")))}},e.prototype.pauseUpload=function(t,e,i){t.file.statusCode="4",t.file.status=this.localizedTexts("pause"),this.updateMetaData(t);var s={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,s)},e.prototype.abortUpload=function(t,e,n){"4"!==t.file.statusCode&&(t.request.emitError=!1,t.request.httpRequest.abort());var a=this.getLiElement(t.file);if(i.i(s.isNullOrUndefined)(this.template)&&(i.i(s.isNullOrUndefined)(e)||!e)){var r=a.querySelector("."+g);r.classList.remove(g),r.classList.add("e-file-play-btn"),r.setAttribute("title",this.localizedTexts("resume")),r.nextElementSibling.classList.add(h),r.nextElementSibling.classList.remove(u),r.nextElementSibling.setAttribute("title",this.localizedTexts("remove"))}for(var l=0;l<this.pausedData.length;l++)this.pausedData[l].file.name===t.file.name&&this.pausedData.splice(l,1);this.pausedData.push(t),this.trigger("pausing",n)},e.prototype.resumeUpload=function(t,e,n){var a,r=this.getLiElement(t.file);i.i(s.isNullOrUndefined)(r)||(a=r.querySelector(".e-file-play-btn")),i.i(s.isNullOrUndefined)(a)||!i.i(s.isNullOrUndefined)(n)&&n||(a.classList.remove("e-file-play-btn"),a.classList.add(g),a.setAttribute("title",this.localizedTexts("pause")),a.nextElementSibling.classList.remove(h),a.nextElementSibling.classList.add(u),a.nextElementSibling.setAttribute("title",this.localizedTexts("abort"))),t.file.status=this.localizedTexts("inProgress"),t.file.statusCode="3",this.updateMetaData(t);var l={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",l);for(var o=0;o<this.pausedData.length;o++)this.pausedData[o].end===this.pausedData[o].file.size?this.chunkUploadComplete(e,t,n):this.pausedData[o].file.name===t.file.name&&(this.pausedData[o].start=this.pausedData[o].end,this.pausedData[o].end=this.pausedData[o].end+this.asyncSettings.chunkSize,this.pausedData[o].end=Math.min(this.pausedData[o].end,this.pausedData[o].file.size),this.pausedData[o].chunkIndex=this.pausedData[o].chunkIndex+1,this.sendRequest(this.pausedData[o].file,this.pausedData[o],n))},e.prototype.updateMetaData=function(t){-1===this.uploadMetaData.indexOf(t)?this.uploadMetaData.push(t):(this.uploadMetaData.splice(this.uploadMetaData.indexOf(t),1),this.uploadMetaData.push(t))},e.prototype.removeChunkProgressBar=function(t){var e=this.getLiElement(t.file);if(!i.i(s.isNullOrUndefined)(e)){this.updateProgressBarClasses(e,f),this.removeProgressbar(e,"success");var n=e.querySelector("."+u);i.i(s.isNullOrUndefined)(n)||(n.classList.add(d),n.setAttribute("title",this.localizedTexts("delete")),n.classList.remove(u,"e-upload-progress"))}},e.prototype.chunkUploadFailed=function(t,e,n){var a,r=this,l=Math.max(Math.ceil(e.file.size/this.asyncSettings.chunkSize),1);!i.i(s.isNullOrUndefined)(this.template)||!i.i(s.isNullOrUndefined)(n)&&n||(a=this.getLiElement(e.file));var o=t&&t.currentTarget?this.getResponse(t):null,p={event:t,file:e.file,chunkIndex:e.chunkIndex,totalChunk:l,chunkSize:this.asyncSettings.chunkSize,cancel:!1,response:o};this.trigger("chunkFailure",p,function(l){if(!l.cancel)if(e.retryCount<r.asyncSettings.retryCount)setTimeout(function(){r.retryRequest(a,e,n)},r.asyncSettings.retryAfterDelay);else{if(!i.i(s.isNullOrUndefined)(a)){var p=a.querySelector("."+g)?a.querySelector("."+g):a.querySelector(".e-file-play-btn");i.i(s.isNullOrUndefined)(p)||(p.classList.add(c),p.classList.remove(g,"e-file-play-btn")),r.updateProgressBarClasses(a,v),r.removeProgressbar(a,"failure"),a.querySelector(".e-icons").classList.remove("e-upload-progress");var m=a.querySelector("."+u)?a.querySelector("."+u):a.querySelector("."+h);m.classList.remove(u),i.i(s.isNullOrUndefined)(a.querySelector("."+g))||i.i(s.detach)(a.querySelector("."+g)),e.start>0?(m.classList.add(d),m.setAttribute("title",r.localizedTexts("delete"))):(m.classList.add(h),m.setAttribute("title",r.localizedTexts("remove")))}e.retryCount=0;var f=e.file,y=r.localizedTexts("uploadFailedMessage"),b={e:t,response:o,operation:"upload",file:r.updateStatus(f,y,"0",!1),statusText:y};r.trigger("failure",b,function(t){r.updateStatus(f,t.statusText,"0"),r.uploadSequential(),r.checkActionComplete(!0)})}})},e.prototype.retryRequest=function(t,e,n){i.i(s.isNullOrUndefined)(this.template)&&(i.i(s.isNullOrUndefined)(n)||!n)&&t&&this.updateProgressBarClasses(t,v),e.retryCount+=1,this.sendRequest(e.file,e)},e.prototype.checkPausePlayAction=function(t){var e=t.target,i=t.target.parentElement,s=this.fileList.indexOf(i),n=this.filesData[s],a=this.getCurrentMetaData(n);e.classList.contains(g)?this.pauseUpload(a,t):e.classList.contains("e-file-play-btn")?this.resumeUpload(a,t):e.classList.contains(c)&&(a.file.status===this.localizedTexts("fileUploadCancel")?this.retryUpload(a,!1):this.retryUpload(a,!0))},e.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("e-restrict-retry")},e.prototype.chunkUploadInProgress=function(t,e,n){var a=this;if("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);var r=this.getLiElement(e.file);if(!i.i(s.isNullOrUndefined)(r)){var l=r.querySelector("."+c);if(i.i(s.isNullOrUndefined)(l)||(l.classList.add(g),l.setAttribute("title",this.localizedTexts("pause")),l.classList.remove(c)),!i.i(s.isNullOrUndefined)(r)){if(!(r.querySelectorAll("."+p).length>0)){var m=r.querySelector("."+o);i.i(s.isNullOrUndefined)(this.template)&&(m.classList.add("e-upload-progress"),m.classList.remove(v),this.createProgressBar(r),this.updateProgressBarClasses(r,"e-upload-progress"));var f=r.querySelector("."+h)?r.querySelector("."+h):r.querySelector("."+d);i.i(s.isNullOrUndefined)(f)||(f.classList.add(u),f.setAttribute("title",this.localizedTexts("abort")),f.classList.remove(h))}if(!isNaN(Math.round(t.loaded/t.total*100))&&i.i(s.isNullOrUndefined)(this.template)&&"4"!==e.file.statusCode){var y=void 0,b=Math.ceil(e.file.size/this.asyncSettings.chunkSize)-1;this.asyncSettings.chunkSize&&b&&(y=Math.round(e.chunkIndex/b*100),this.changeProgressValue(r,y.toString()+"%"))}0===e.chunkIndex&&this.checkActionButtonStatus()}if(i.i(s.isNullOrUndefined)(r.querySelector("."+g))&&i.i(s.isNullOrUndefined)(this.template)&&i.i(s.isNullOrUndefined)(r.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");var C=r.querySelector("."+u);C.parentElement.insertBefore(this.pauseButton,C),this.pauseButton.setAttribute("title",this.localizedTexts("pause")),this.pauseButton.addEventListener("click",function(t){a.checkPausePlayAction(t)},!1)}}}},e.prototype.bytesToSize=function(t){var e=-1;if(!t)return"0.0 KB";do{t/=1024,e++}while(t>99);return e>=2&&(t*=1024,e=1),Math.max(t,0).toFixed(1)+" "+["KB","MB"][e]},e.prototype.sortFileList=function(t){t=t||this.sortFilesList;for(var e=t,i=[],s=0;s<e.length;s++)i.push(e[s].name);for(var n=i.sort(),a=[],r=0,l=n;r<l.length;r++)for(var o=l[r],s=0;s<e.length;s++)o===e[s].name&&a.push(e[s]);return a},e.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 e=["aria-label","directory","webkitdirectory","tabindex"],n=0,a=e;n<a.length;n++){var r=a[n];this.element.removeAttribute(r)}i.i(s.isNullOrUndefined)(this.uploadWrapper)||(this.uploadWrapper.parentElement.appendChild(this.element),i.i(s.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,t.prototype.destroy.call(this)},e.prototype.upload=function(t,e){var i=this;if(t=t||this.filesData,this.sequentialUpload&&(this.isFirstFileOnSelection||e))this.sequenceUpload(t);else{var s=this.getFilesInArray(t),n={customFormData:[],currentRequest:null,cancel:!1};this.trigger("beforeUpload",n,function(t){t.cancel||i.uploadFiles(s,e)})}},e.prototype.getFilesInArray=function(t){var e=[];return t instanceof Array?e=t:e.push(t),e},e.prototype.serverReadFileBase64=function(t,e,i){var s=this;return new Promise(function(n,a){var r=s.fileStreams[t].rawFile;try{var l=new FileReader;l.onload=function(t){return function(){try{var e=t.result,i=e?e.split(";base64,")[1]:null;n(i)}catch(t){a(t)}}}(l),l.readAsDataURL(r.slice(e,e+i))}catch(t){a(t)}})},e.prototype.uploadFileCount=function(t){var e=this.filesData;return e&&0!==e.length?e.length:-1},e.prototype.getFileRead=function(t,e){var i=this.filesData;if(!i||0===i.length)return-1;var s=i[t],n=this.newFileRef++;return this.fileStreams[n]=s,n},e.prototype.getFileInfo=function(t,e){var i=this.filesData;return i&&0!==i.length&&i[t]?this.filesData[t]:null},e.prototype.uploadFiles=function(t,e){var n=[];if(""!==this.asyncSettings.saveUrl&&!i.i(s.isNullOrUndefined)(this.asyncSettings.saveUrl)){if(!e||i.i(s.isNullOrUndefined)(e))if(this.multiple)n=this.filterfileList(t);else{var a=[];a.push(t[0]),n=this.filterfileList(a)}else n=t;for(var r=0;r<n.length;r++)this.uploadFilesRequest(n,r,e)}},e.prototype.uploadFilesRequest=function(t,e,i){var n=this,a=this.checkChunkUpload(),r=new s.Ajax(this.asyncSettings.saveUrl,"POST",!0,null);r.emitError=!1;var l={fileData:t[e],customFormData:[],cancel:!1},o=new FormData;if(r.beforeSend=function(i){l.currentRequest=r.httpRequest,n.trigger("uploading",l,function(s){s.cancel&&n.eventCancelByArgs(i,s,t[e]),n.updateFormData(o,s.customFormData)})},"1"===t[e].statusCode){var h=this.element.getAttribute("name");o.append(h,t[e].rawFile,t[e].name),a&&t[e].size>this.asyncSettings.chunkSize?this.chunkUpload(t[e],i,e):(r.onLoad=function(s){return l.cancel?{}:(n.uploadComplete(s,t[e],i),{})},r.onUploadProgress=function(s){return l.cancel?{}:(n.uploadInProgress(s,t[e],i,r),{})},r.onError=function(i){return n.uploadFailed(i,t[e]),{}},r.send(o))}},e.prototype.spliceFiles=function(t){for(var e=this.fileList[t],i=this.getFilesData(),s=+e.getAttribute("data-files-count"),n=0,a=0;a<t;a++)n+=+this.fileList[a].getAttribute("data-files-count");for(var r=n+s-1,l=r;l>=n;l--)i.splice(l,1)},e.prototype.remove=function(t,e,n,a,r){var l=this;i.i(s.isNullOrUndefined)(a)&&(a=!0);var o={event:r,cancel:!1,filesData:[],customFormData:[],postRawFile:a,currentRequest:null},d={cancel:!1,customFormData:[],currentRequest:null};this.trigger("beforeRemove",d,function(a){if(!a.cancel)if(l.isFormUpload())o.filesData=t,l.trigger("removing",o,function(e){if(!e.cancel)for(var n=l.getFilesInArray(t),a=!1,r=void 0,o=0,h=n;o<h.length;o++){var d=h[o];if(a||(r=l.fileList.indexOf(d.list)),r>-1){var u=i.i(s.isNullOrUndefined)(d.input)?null:d.input;u&&i.i(s.detach)(u),l.spliceFiles(r),i.i(s.detach)(l.fileList[r]),l.fileList.splice(r,1),a=!0,r=-1}}});else if(l.isForm&&(i.i(s.isNullOrUndefined)(l.asyncSettings.removeUrl)||""===l.asyncSettings.removeUrl))o.filesData=l.getFilesData(),l.trigger("removing",o,function(t){t.cancel||l.clearAll()});else{var d=[];t=i.i(s.isNullOrUndefined)(t)?l.filesData:t,t instanceof Array?d=t:d.push(t),o.filesData=d;for(var u=l.asyncSettings.removeUrl,c=""!==u&&!i.i(s.isNullOrUndefined)(u),p=0,m=d;p<m.length;p++){var f=m[p];!function(t){var i=l.uploadedFilesData.indexOf(t);("2"===t.statusCode||"4"===t.statusCode||"0"===t.statusCode&&-1!==i)&&c?l.removeUploadedFile(t,o,n,e):n?l.removeFilesData(t,e):l.trigger("removing",o,function(i){i.cancel||l.removeFilesData(t,e)}),r&&!r.target.classList.contains(h)&&l.checkActionComplete(!1)}(f)}}})},e.prototype.clearAll=function(){var t=this;if(i.i(s.isNullOrUndefined)(this.listParent))return"msie"!==this.browserName&&(this.element.value=""),void(this.filesData=[]);var e={cancel:!1,filesData:this.filesData};this.trigger("clearing",e,function(e){e.cancel||(t.clearData(),t.actionCompleteCount=0,t.count=-1)})},e.prototype.getFilesData=function(t){return i.i(s.isNullOrUndefined)(t)?this.filesData:this.getSelectedFiles(t)},e.prototype.pause=function(t,e){t=t||this.filesData;var i=this.getFilesInArray(t);this.pauseUploading(i,e)},e.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)},e.prototype.getFiles=function(t){var e=[];return i.i(s.isNullOrUndefined)(t)||t instanceof Array?e=t:e.push(t),e},e.prototype.resume=function(t,e){t=t||this.filesData;var i=this.getFilesInArray(t);this.resumeFiles(i,e)},e.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)},e.prototype.retry=function(t,e,i){t=t||this.filesData;var s=this.getFilesInArray(t);this.sequentialUpload&&this.isFirstFileOnSelection&&(this.isFirstFileOnSelection=!1),this.retryFailedFiles(s,e,i)},e.prototype.retryFailedFiles=function(t,e,i){for(var s=this.getFiles(t),n=0;n<s.length;n++)if("5"===s[n].statusCode||"0"===s[n].statusCode)if(this.asyncSettings.chunkSize>0&&this.getCurrentMetaData(s[n],null))this.retryUpload(this.getCurrentMetaData(s[n],null),e);else{var a=void 0;i||(a=this.fileList[this.filesData.indexOf(s[n])]),this.reloadcanceledFile(null,s[n],a,i)}},e.prototype.cancel=function(t){t=t||this.filesData;var e=this.getFilesInArray(t);this.cancelUpload(e)},e.prototype.cancelUpload=function(t){var e=this.getFiles(t);if(this.asyncSettings.chunkSize>0){for(var i=0;i<e.length;i++)if("3"===e[i].statusCode){var s=this.getCurrentMetaData(e[i],null);s.file.statusCode="5",s.file.status=this.localizedTexts("fileUploadCancel"),this.updateMetaData(s),this.showHideUploadSpinner(e[i])}}else for(var i=0;i<e.length;i++)"3"===e[i].statusCode&&(e[i].statusCode="5",e[i].status=this.localizedTexts("fileUploadCancel"),this.showHideUploadSpinner(e[i]))},e.prototype.showHideUploadSpinner=function(t){var e=this.getLiElement(t);if(!i.i(s.isNullOrUndefined)(e)&&i.i(s.isNullOrUndefined)(this.template)){var a=e.querySelector("."+u);i.i(n.createSpinner)({target:a,width:"20px"}),i.i(n.showSpinner)(a)}},r([i.i(s.Complex)({saveUrl:"",removeUrl:""},E)],e.prototype,"asyncSettings",void 0),r([i.i(s.Property)(!1)],e.prototype,"sequentialUpload",void 0),r([i.i(s.Property)({})],e.prototype,"htmlAttributes",void 0),r([i.i(s.Property)("")],e.prototype,"cssClass",void 0),r([i.i(s.Property)(!0)],e.prototype,"enabled",void 0),r([i.i(s.Property)(null)],e.prototype,"template",void 0),r([i.i(s.Property)(!0)],e.prototype,"multiple",void 0),r([i.i(s.Property)(!0)],e.prototype,"autoUpload",void 0),r([i.i(s.Property)(!0)],e.prototype,"enableHtmlSanitizer",void 0),r([i.i(s.Complex)({},C)],e.prototype,"buttons",void 0),r([i.i(s.Property)("")],e.prototype,"allowedExtensions",void 0),r([i.i(s.Property)(0)],e.prototype,"minFileSize",void 0),r([i.i(s.Property)(3e7)],e.prototype,"maxFileSize",void 0),r([i.i(s.Property)(null)],e.prototype,"dropArea",void 0),r([i.i(s.Collection)([{}],b)],e.prototype,"files",void 0),r([i.i(s.Property)(!0)],e.prototype,"showFileList",void 0),r([i.i(s.Property)(!1)],e.prototype,"directoryUpload",void 0),r([i.i(s.Property)("Default")],e.prototype,"dropEffect",void 0),r([i.i(s.Event)()],e.prototype,"created",void 0),r([i.i(s.Event)()],e.prototype,"actionComplete",void 0),r([i.i(s.Event)()],e.prototype,"rendering",void 0),r([i.i(s.Event)()],e.prototype,"beforeUpload",void 0),r([i.i(s.Event)()],e.prototype,"fileListRendering",void 0),r([i.i(s.Event)()],e.prototype,"selected",void 0),r([i.i(s.Event)()],e.prototype,"uploading",void 0),r([i.i(s.Event)()],e.prototype,"success",void 0),r([i.i(s.Event)()],e.prototype,"failure",void 0),r([i.i(s.Event)()],e.prototype,"removing",void 0),r([i.i(s.Event)()],e.prototype,"beforeRemove",void 0),r([i.i(s.Event)()],e.prototype,"clearing",void 0),r([i.i(s.Event)()],e.prototype,"progress",void 0),r([i.i(s.Event)()],e.prototype,"change",void 0),r([i.i(s.Event)()],e.prototype,"chunkSuccess",void 0),r([i.i(s.Event)()],e.prototype,"chunkFailure",void 0),r([i.i(s.Event)()],e.prototype,"chunkUploading",void 0),r([i.i(s.Event)()],e.prototype,"canceling",void 0),r([i.i(s.Event)()],e.prototype,"pausing",void 0),r([i.i(s.Event)()],e.prototype,"resuming",void 0),e=r([s.NotifyPropertyChanges],e)}(s.Component)}])});
|