/*! * filename: ej2-inputs.min.js * version : 19.1.57 * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ this.ej=this.ej||{},this.ej.inputs=function(e,t,i,s){"use strict";function n(){if(t.attributes(this.element,{role:"textbox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-live":"assertive","aria-valuenow":""}),this.mask){for(var e=this.mask.split("]"),i=0;i1)for(var a=!1,n=0;n=1&&(n=i),n-=r=this.hiddenMask.length-this.promptMask.length,i>0&&"\\"!==this.hiddenMask[i-1]&&(">"===this.hiddenMask[i]||"<"===this.hiddenMask[i]||"|"===this.hiddenMask[i])&&(this.promptMask=this.promptMask.substring(0,n)+this.promptMask.substring(i+1-r,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue.substring(i+1-r,this.escapeMaskValue.length)),"\\"===this.hiddenMask[i]&&(this.promptMask=this.promptMask.substring(0,n)+this.hiddenMask[i+1]+this.promptMask.substring(i+2-r,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue[i+1]+this.escapeMaskValue.substring(i+2-r,this.escapeMaskValue.length))}else this.promptMask=this.promptMask.replace(/[>|<]/g,""),this.escapeMaskValue=this.hiddenMask.replace(/[>|<]/g,"");t.attributes(this.element,{"aria-invalid":"false"})}}function a(){I.call(this,this.promptMask),M.call(this,this.value)}function r(){t.EventHandler.add(this.element,"keydown",T,this),t.EventHandler.add(this.element,"keypress",P,this),t.EventHandler.add(this.element,"keyup",B,this),t.EventHandler.add(this.element,"input",S,this),t.EventHandler.add(this.element,"focus",g,this),t.EventHandler.add(this.element,"blur",y,this),t.EventHandler.add(this.element,"paste",b,this),t.EventHandler.add(this.element,"cut",E,this),t.EventHandler.add(this.element,"drop",C,this),t.EventHandler.add(this.element,"mousedown",v,this),t.EventHandler.add(this.element,"mouseup",f,this),this.enabled&&(o.call(this),this.formElement&&t.EventHandler.add(this.formElement,"reset",u,this))}function l(){t.EventHandler.remove(this.element,"keydown",T),t.EventHandler.remove(this.element,"keypress",P),t.EventHandler.remove(this.element,"keyup",B),t.EventHandler.remove(this.element,"input",S),t.EventHandler.remove(this.element,"focus",g),t.EventHandler.remove(this.element,"blur",y),t.EventHandler.remove(this.element,"paste",b),t.EventHandler.remove(this.element,"cut",E),t.EventHandler.remove(this.element,"mousedown",v),t.EventHandler.remove(this.element,"mouseup",f),this.formElement&&t.EventHandler.remove(this.formElement,"reset",u)}function o(){this.showClearButton&&t.EventHandler.add(this.inputObj.clearButton,"mousedown touchstart",h,this)}function h(e){e.preventDefault(),this.inputObj.clearButton.classList.contains("e-clear-icon-hide")||(d.call(this,e),this.value="")}function d(e){var t=this.element.value;I.call(this,this.promptMask),this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),L.call(this,e,t),this.element.setSelectionRange(0,0)}function u(){"EJS-MASKEDTEXTBOX"===this.element.tagName?I.call(this,this.promptMask):this.value=this.initInputValue}function c(e){return e.value}function p(e,i){var s="",n=0,a=!1,r=t.isNullOrUndefined(i)?t.isNullOrUndefined(e)||t.isNullOrUndefined(this)?i:e.value:i;if(r!==this.promptMask)for(var l=0;l"!==this.customRegExpCollec[n]&&"<"!==this.customRegExpCollec[n]&&"|"!==this.customRegExpCollec[n]&&"\\"!==this.customRegExpCollec[n]||(--l,a=!0),a||r[l]!==this.promptChar&&!t.isNullOrUndefined(this.customRegExpCollec[n])&&(this._callPasteHandler||!t.isNullOrUndefined(this.regExpCollec[this.customRegExpCollec[n]])||this.customRegExpCollec[n].length>2&&"["===this.customRegExpCollec[n][0]&&"]"===this.customRegExpCollec[n][this.customRegExpCollec[n].length-1]||!t.isNullOrUndefined(this.customCharacters)&&!t.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 m(e){for(var t=0;t=0;s--){if(i.value[s]===t.promptChar){r=!0;break}if(i.value[s]!==t.promptMask[s]){r=!1;break}}}),this.isClicked||"Always"!==this.floatLabelType&&(null===n||""===n)&&null!==this.placeholder&&""!==this.placeholder)){for(s=0;s0&&t.redoCollec[0].value===t.element.value&&(a=p.call(t,t.element)),I.call(t,n),t.element.selectionStart=i,t.element.selectionEnd=s;var r=0;t.maskKeyPress=!0;do{N.call(t,a[r],!1,null),++r}while(rthis.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{N.call(this,a[r],e.ctrlKey,e),++r}while(r0&&t!==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}),I.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.undoCollec.splice(this.undoCollec.length-1,1)):89===e.keyCode&&this.redoCollec.length>0&&t!==this.redoCollec[0].value&&(i=this.redoCollec[0],this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),I.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.redoCollec.splice(0,1))}}}function k(){var e,t=this.element.selectionStart,i=this.element.selectionEnd;this.redoCollec.length>0?(e=this.redoCollec[0],I.call(this,e.value),e.startIndex-t==1?(this.element.selectionStart=e.startIndex,this.element.selectionEnd=e.endIndex):(this.element.selectionStart=t+1,this.element.selectionEnd=i+1)):(I.call(this,this.promptMask),this.element.selectionStart=this.element.selectionEnd=t)}function x(e,t,i){return"input"===i.type&&(e=!1,t=this.element.value,I.call(this,this.promptMask),M.call(this,t)),e}function O(e){var i,s=!1,n=!1;this.element.value.length=this.promptMask.length&&"input"===e.type&&(s=x.call(this,s,i,e));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===e.keyCode||46===e.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===e.keyCode||46===e.keyCode)&&lm:v0:fthis.promptMask.length){var n=this.element.selectionStart,a=this.element.value.length-this.promptMask.length,r=this.element.value.substring(n-a,n);if(this.undoCollec.length>0){i=this.undoCollec[this.undoCollec.length-1];var l=this.element.selectionStart;s=i.value;var o=i.value.substring(l-a,l);i=this.redoCollec[0],r=r.trim();var h=t.Browser.isAndroid&&""===r;h||o===r||i.value.substring(l-a,l)===r?h&&U.call(this,e,l-1,this.element.selectionEnd-1,r,e.ctrlKey,!1):N.call(this,r,e.ctrlKey,e)}else s=this.promptMask,N.call(this,r,e.ctrlKey,e);this.maskKeyPress=!1,L.call(this,e,s)}}var d=p.call(this,this.element);(0!==this.element.selectionStart||this.promptMask!==this.element.value||""!==d||""===d&&this.value!==d)&&(this.prevValue=d,this.value=d)}else L.call(this,e);if(0===this.element.selectionStart&&0===this.element.selectionEnd){var u=this.element;setTimeout(function(){u.setSelectionRange(0,0)},0)}}function A(e){if(e.length>1&&this.promptMask.length+e.length0?(a=this.redoCollec[0].value,I.call(this,a),this.undoCollec.push(this.redoCollec[0])):(this.undoCollec.push({value:this.promptMask,startIndex:r,endIndex:r}),a=this.promptMask,I.call(this,a)),this.element.selectionStart=f,this.element.selectionEnd=g}r=this.element.selectionStart,w.call(this,s,r,p,a,u),d=!0,c===e.length-1&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),o=!1}else r=this.element.selectionStart,U.call(this,s,r,l,e,i,d);c!==e.length-1||o||(!t.Browser.isAndroid||t.Browser.isAndroid&&rthis.promptMask.length&&(i=V.call(this,i,this.element.value)),!n){var a=this.element.value,r=a.substring(0,t)+i+a.substring(t+1,a.length);I.call(this,r),this.element.selectionStart=this.element.selectionEnd=t+1}}function U(e,i,s,n,a,r){if(!this.maskKeyPress){var l=this.element.value;i>=this.promptMask.length?I.call(this,l.substring(0,i)):(s===i?I.call(this,l.substring(0,i)+l.substring(i+1,l.length)):this.promptMask.length===this.element.value.length?I.call(this,l.substring(0,i)+l.substring(i,l.length)):I.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?i:s),R.call(this)}1!==n.length||a||t.isNullOrUndefined(e)||R.call(this)}function R(){var e=this,i=this.element.parentNode,s=200;i.classList.contains(ee)||i.classList.contains(te)?t.addClass([i],Q):t.addClass([this.element],Q),!0===this.isIosInvalid&&(s=400),t.attributes(this.element,{"aria-invalid":"true"}),setTimeout(function(){e.maskKeyPress||F.call(e)},s)}function F(){var e=this.element.parentNode;t.isNullOrUndefined(e)||t.removeClass([e],Q),t.removeClass([this.element],Q),t.attributes(this.element,{"aria-invalid":"false"})}function V(e,t){var i,s,n=t,a=0;for(s=0;s"!==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]){e=e.toUpperCase();break}if("<"===i[s]){e=e.toLowerCase();break}if("|"===i[s])break}--s}return e}function M(e){if(this.mask&&void 0!==e&&(void 0===this.prevValue||this.prevValue!==e)){if(this.maskKeyPress=!0,I.call(this,this.promptMask),""===e||null===e&&"Never"===this.floatLabelType&&this.placeholder||(this.element.selectionStart=0,this.element.selectionEnd=0),null!==e)for(var i=0;i1?e.promptChar=e.promptChar[0]:e.promptChar:"_",value:e.value?e.value:null,regExpCollec:ae,customRegExpCollec:[],customCharacters:e.customCharacters,undoCollec:[],redoCollec:[],maskKeyPress:!1,prevValue:""};return n.call(i),i}function q(e){return p.call(j(e),e.element)}function W(e){return c.call(j(e),e.element)}function j(e){var i;return!t.isNullOrUndefined(e)&&e.element.classList.contains(ie)&&(i=z(e)),i}var _={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",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(e){function i(e,i){var n=t.isNullOrUndefined(i)?t.createElement:i,a={container:null,buttons:[],clearButton:null};if(q=e.floatLabelType,t.isNullOrUndefined(e.floatLabelType)||"Never"===e.floatLabelType?(a.container=y(e,_.INPUTGROUP,_.INPUTCUSTOMTAG,"span",n),e.element.parentNode.insertBefore(a.container,e.element),t.addClass([e.element],_.INPUT),a.container.appendChild(e.element)):h(e,a,n),s(e),t.isNullOrUndefined(e.properties)||t.isNullOrUndefined(e.properties.showClearButton)||!e.properties.showClearButton||"TEXTAREA"===e.element.tagName||(P(e.properties.showClearButton,e.element,a,!0,n),a.clearButton.setAttribute("role","button"),a.container.classList.contains(_.FLOATINPUT)&&t.addClass([a.container],_.INPUTGROUP)),!t.isNullOrUndefined(e.buttons)&&"TEXTAREA"!==e.element.tagName)for(var r=0;r',i=s.children[0].placeholder}return i}function E(e,i,s,a){if(i.value=e,t.isNullOrUndefined(s)||"Auto"!==s||g(i,s),!t.isNullOrUndefined(a)&&a){var r=m(i);if(!t.isNullOrUndefined(r)){var l=r.getElementsByClassName(_.CLEARICON)[0];t.isNullOrUndefined(l)||(i.value&&r.classList.contains("e-input-focus")?t.removeClass([l],_.CLEARICONHIDE):t.addClass([l],_.CLEARICONHIDE))}}n(s,i)}function C(e,i,s){t.isNullOrUndefined(s)||""===s||t.removeClass(i,s.split(" ")),t.isNullOrUndefined(e)||""===e||t.addClass(i,e.split(" "))}function S(e,i){"number"==typeof e?i.style.width=t.formatUnit(e):"string"==typeof e&&(i.style.width=e.match(/px|%|em/)?e:t.formatUnit(e))}function T(e,i){e=b(e);var s=m(i);s.classList.contains(_.FLOATINPUT)?t.isNullOrUndefined(e)||""===e?(s.classList.add(_.NOFLOATLABEL),s.getElementsByClassName(_.FLOATTEXT)[0].textContent=""):(s.getElementsByClassName(_.FLOATTEXT)[0].textContent=e,s.classList.remove(_.NOFLOATLABEL),i.removeAttribute("placeholder")):t.isNullOrUndefined(e)||""===e?(i.removeAttribute("placeholder"),i.removeAttribute("aria-placeholder")):t.attributes(i,{placeholder:e,"aria-placeholder":e})}function k(e,i,s){e?t.attributes(i,{readonly:""}):i.removeAttribute("readonly"),t.isNullOrUndefined(s)||g(i,s)}function x(e,i){e?t.addClass(i,_.RTL):t.removeClass(i,_.RTL)}function O(e,i,s,n){var a={disabled:"disabled","aria-disabled":"true"},r=!t.isNullOrUndefined(n);e?(i.classList.remove(_.DISABLE),L(a,i),r&&t.removeClass([n],_.DISABLE)):(i.classList.add(_.DISABLE),B(a,i),r&&t.addClass([n],_.DISABLE)),t.isNullOrUndefined(s)||g(i,s)}function P(e,i,s,n,a){var r=t.isNullOrUndefined(a)?t.createElement:a;e?s.clearButton=v(i,s,n,r):(t.remove(s.clearButton),s.clearButton=null)}function L(e,t){for(var i=0,s=Object.keys(e);i0)for(r=0;r0)for(var r=0;r=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},Z="e-input-group-icon",Y="e-spin-up",G=new RegExp("^(-)?(\\d*)$"),$=["title","style","class"],J=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.isVue=!1,s.preventChange=!1,s.isAngular=!1,s.isDynamicChange=!1,s.numericOptions=e,s}return X(s,i),s.prototype.preRender=function(){this.isPrevFocused=!1,this.decimalSeparator=".",this.intRegExp=new RegExp("/^(-)?(d*)$/"),this.isCalled=!1;var e=t.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),t.removeClass([this.cloneElement],["e-control","e-numerictextbox","e-lib"]),this.angularTagName=null,this.formEle=t.closest(this.element,"form"),"EJS-NUMERICTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;var i=this.createElement("input"),s=0;for(s;s-1)if("class"===s){var n=this.getNumericValidClassList(this.htmlAttributes[s]);""!==n&&t.addClass([this.container],n.split(" "))}else if("style"===s){var a=this.container.getAttribute(s);a=t.isNullOrUndefined(a)?this.htmlAttributes[s]:a+this.htmlAttributes[s],this.container.setAttribute(s,a)}else this.container.setAttribute(s,this.htmlAttributes[s])}},s.prototype.setElementWidth=function(e){t.isNullOrUndefined(e)||("number"==typeof e?this.container.style.width=t.formatUnit(e):"string"==typeof e&&(this.container.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.spinBtnCreation=function(){this.spinDown=e.Input.appendSpan(Z+" e-spin-down",this.container,this.createElement),t.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),this.spinUp=e.Input.appendSpan(Z+" "+Y,this.container,this.createElement),t.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")}),this.wireSpinBtnEvents()},s.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),t.attributes(this.element,{"aria-valuemin":this.min.toString(),"aria-valuemax":this.max.toString()})},s.prototype.formattedValue=function(e,t){return this.instance.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(t)},s.prototype.validateStep=function(){null!==this.decimals&&this.setProperties({step:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.step))},!0)},s.prototype.action=function(e,t){this.isInteract=!0;var i=this.isFocused?this.instance.getNumberParser({format:"n"})(this.element.value):this.value;this.changeValue(this.performAction(i,this.step,e)),this.raiseChangeEvent(t)},s.prototype.checkErrorClass=function(){this.isValidState?t.removeClass([this.container],"e-error"):t.addClass([this.container],"e-error"),t.attributes(this.element,{"aria-invalid":this.isValidState?"false":"true"})},s.prototype.bindClearEvent=function(){this.showClearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},s.prototype.resetHandler=function(e){e.preventDefault(),this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")||this.clear(e),this.isInteract=!0,this.raiseChangeEvent(e)},s.prototype.clear=function(e){if(this.setProperties({value:null},!0),this.setElementValue(""),this.hiddenInput.value="",t.closest(this.element,"form")){var i=this.element.nextElementSibling,s=document.createEvent("KeyboardEvent");s.initEvent("keyup",!1,!0),i.dispatchEvent(s)}},s.prototype.resetFormHandler=function(){"EJS-NUMERICTEXTBOX"===this.element.tagName?this.updateValue(null):this.updateValue(this.inputEleValue)},s.prototype.setSpinButton=function(){t.isNullOrUndefined(this.spinDown)||t.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),t.isNullOrUndefined(this.spinUp)||t.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")})},s.prototype.wireEvents=function(){t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"blur",this.focusOutHandler,this),t.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),t.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.element,"input",this.inputHandler,this),t.EventHandler.add(this.element,"keypress",this.keyPressHandler,this),t.EventHandler.add(this.element,"change",this.changeHandler,this),t.EventHandler.add(this.element,"paste",this.pasteHandler,this),this.enabled&&(this.bindClearEvent(),this.formEle&&t.EventHandler.add(this.formEle,"reset",this.resetFormHandler,this))},s.prototype.wireSpinBtnEvents=function(){t.EventHandler.add(this.spinUp,t.Browser.touchStartEvent,this.mouseDownOnSpinner,this),t.EventHandler.add(this.spinDown,t.Browser.touchStartEvent,this.mouseDownOnSpinner,this),t.EventHandler.add(this.spinUp,t.Browser.touchEndEvent,this.mouseUpOnSpinner,this),t.EventHandler.add(this.spinDown,t.Browser.touchEndEvent,this.mouseUpOnSpinner,this),t.EventHandler.add(this.spinUp,t.Browser.touchMoveEvent,this.touchMoveOnSpinner,this),t.EventHandler.add(this.spinDown,t.Browser.touchMoveEvent,this.touchMoveOnSpinner,this)},s.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"blur",this.focusOutHandler),t.EventHandler.remove(this.element,"keyup",this.keyUpHandler),t.EventHandler.remove(this.element,"input",this.inputHandler),t.EventHandler.remove(this.element,"keydown",this.keyDownHandler),t.EventHandler.remove(this.element,"keypress",this.keyPressHandler),t.EventHandler.remove(this.element,"change",this.changeHandler),t.EventHandler.remove(this.element,"paste",this.pasteHandler),this.formEle&&t.EventHandler.remove(this.formEle,"reset",this.resetFormHandler)},s.prototype.unwireSpinBtnEvents=function(){t.EventHandler.remove(this.spinUp,t.Browser.touchStartEvent,this.mouseDownOnSpinner),t.EventHandler.remove(this.spinDown,t.Browser.touchStartEvent,this.mouseDownOnSpinner),t.EventHandler.remove(this.spinUp,t.Browser.touchEndEvent,this.mouseUpOnSpinner),t.EventHandler.remove(this.spinDown,t.Browser.touchEndEvent,this.mouseUpOnSpinner),t.EventHandler.remove(this.spinUp,t.Browser.touchMoveEvent,this.touchMoveOnSpinner),t.EventHandler.remove(this.spinDown,t.Browser.touchMoveEvent,this.touchMoveOnSpinner)},s.prototype.changeHandler=function(e){e.stopPropagation(),this.element.value.length||this.setProperties({value:null},!0);var t=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(t,e)},s.prototype.raiseChangeEvent=function(e){if(this.prevValue!==this.value){var i={};this.changeEventArgs={value:this.value,previousValue:this.prevValue,isInteracted:this.isInteract,isInteraction:this.isInteract,event:e},e&&(this.changeEventArgs.event=e),void 0===this.changeEventArgs.event&&(this.changeEventArgs.isInteracted=!1,this.changeEventArgs.isInteraction=!1),t.merge(i,this.changeEventArgs),this.prevValue=this.value,this.isInteract=!1,this.elementPrevValue=this.element.value,this.preventChange=!1,this.trigger("change",i)}},s.prototype.pasteHandler=function(){var e=this;if(this.enabled&&!this.readonly){var t=this.element.value;setTimeout(function(){e.numericRegex().test(e.element.value)||e.setElementValue(t)})}},s.prototype.preventHandler=function(){var e=this,i=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);setTimeout(function(){if(e.element.selectionStart>0){var s=e.element.selectionStart,n=e.element.selectionStart-1,a=e.element.value.split(""),r=t.getNumericObject(e.locale),l=t.getValue("decimal",r).charCodeAt(0);" "===e.element.value[n]&&e.element.selectionStart>0&&!i?(t.isNullOrUndefined(e.prevVal)?e.element.value=e.element.value.trim():0!==n?e.element.value=e.prevVal:0===n&&(e.element.value=e.element.value.trim()),e.element.setSelectionRange(n,n)):isNaN(parseFloat(e.element.value[e.element.selectionStart-1]))&&45!==e.element.value[e.element.selectionStart-1].charCodeAt(0)?(a.indexOf(e.element.value[e.element.selectionStart-1])!==a.lastIndexOf(e.element.value[e.element.selectionStart-1])&&e.element.value[e.element.selectionStart-1].charCodeAt(0)===l||e.element.value[e.element.selectionStart-1].charCodeAt(0)!==l)&&(e.element.value=e.element.value.substring(0,n)+e.element.value.substring(s,e.element.value.length),e.element.setSelectionRange(n,n),isNaN(parseFloat(e.element.value[e.element.selectionStart-1]))&&e.element.selectionStart>0&&e.element.value.length&&e.preventHandler()):isNaN(parseFloat(e.element.value[e.element.selectionStart-2]))&&e.element.selectionStart>1&&45!==e.element.value[e.element.selectionStart-2].charCodeAt(0)&&(a.indexOf(e.element.value[e.element.selectionStart-2])!==a.lastIndexOf(e.element.value[e.element.selectionStart-2])&&e.element.value[e.element.selectionStart-2].charCodeAt(0)===l||e.element.value[e.element.selectionStart-2].charCodeAt(0)!==l)&&(e.element.setSelectionRange(n,n),e.nextEle=e.element.value[e.element.selectionStart],e.cursorPosChanged=!0,e.preventHandler()),!0===e.cursorPosChanged&&e.element.value[e.element.selectionStart]===e.nextEle&&isNaN(parseFloat(e.element.value[e.element.selectionStart-1]))&&(e.element.setSelectionRange(e.element.selectionStart+1,e.element.selectionStart+1),e.cursorPosChanged=!1,e.nextEle=null),""===e.element.value.trim()&&e.element.setSelectionRange(0,0),e.element.selectionStart>0&&45===e.element.value[e.element.selectionStart-1].charCodeAt(0)&&e.element.selectionStart>1&&(t.isNullOrUndefined(e.prevVal)?e.element.value=e.element.value:e.element.value=e.prevVal,e.element.setSelectionRange(e.element.selectionStart,e.element.selectionStart)),e.prevVal=e.element.value}})},s.prototype.keyUpHandler=function(){if(this.enabled&&!this.readonly){!(!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform))&&t.Browser.isDevice&&this.preventHandler();var e=this.instance.getNumberParser({format:"n"})(this.element.value);if(e=null===e||isNaN(e)?null:e,this.hiddenInput.value=e||0===e?e.toString():null,t.closest(this.element,"form")){var i=this.element.nextElementSibling,s=document.createEvent("KeyboardEvent");s.initEvent("keyup",!1,!0),i.dispatchEvent(s)}}},s.prototype.inputHandler=function(e){var i=this;if(this.enabled&&!this.readonly){var s=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);if((navigator.userAgent.toLowerCase().indexOf("firefox")>-1||s)&&t.Browser.isDevice&&this.preventHandler(),this.isAngular&&this.element.value!==t.getValue("decimal",t.getNumericObject(this.locale))&&this.element.value!==t.getValue("minusSign",t.getNumericObject(this.locale))){var n=this.instance.getNumberParser({format:"n"})(this.element.value);n=isNaN(n)?null:n,i.localChange({value:n}),this.preventChange=!0}if(this.isVue){var a=this.instance.getNumberParser({format:"n"})(this.element.value),r=this.instance.getNumberParser({format:"n"})(this.elementPrevValue),l={event:e,value:null===a||isNaN(a)?null:a,previousValue:null===r||isNaN(r)?null:r};this.preventChange=!0,this.elementPrevValue=this.element.value,this.trigger("input",l)}}},s.prototype.keyDownHandler=function(e){if(!this.readonly)switch(e.keyCode){case 38:e.preventDefault(),this.action("increment",e);break;case 40:e.preventDefault(),this.action("decrement",e)}},s.prototype.performAction=function(e,t,i){(null===e||isNaN(e))&&(e=0);var s="increment"===i?e+t:e-t;return s=this.correctRounding(e,t,s),this.strictMode?this.trimValue(s):s},s.prototype.correctRounding=function(e,t,i){var s=new RegExp("[,.](.*)"),n=s.test(e.toString()),a=s.test(t.toString());if(n||a){var r=n?s.exec(e.toString())[0].length:0,l=a?s.exec(t.toString())[0].length:0,o=Math.max(r,l);return e=this.roundValue(i,o)}return i},s.prototype.roundValue=function(e,t){t=t||0;var i=Math.pow(10,t);return e*=i,e=Math.round(e)/i},s.prototype.updateValue=function(e,t){t&&(this.isInteract=!0),null===e||isNaN(e)||this.decimals&&(e=this.roundNumber(e,this.decimals)),this.changeValue(null===e||isNaN(e)?null:this.strictMode?this.trimValue(e):e),this.isDynamicChange||this.raiseChangeEvent(t)},s.prototype.updateCurrency=function(e,i){t.setValue(e,i,this.cultureInfo),this.updateValue(this.value)},s.prototype.changeValue=function(e){if(e||0===e){var t=this.getNumberOfDecimals(e);this.setProperties({value:this.roundNumber(e,t)},!0)}else e=null,this.setProperties({value:e},!0);this.modifyText(),this.strictMode||this.validateState()},s.prototype.modifyText=function(){if(this.value||0===this.value){var e=this.formatNumber(),i=this.isFocused?e:this.instance.getNumberFormat(this.cultureInfo)(this.value);this.setElementValue(i),t.attributes(this.element,{"aria-valuenow":e}),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},s.prototype.setElementValue=function(t,i){e.Input.setValue(t,i||this.element,this.floatLabelType,this.showClearButton)},s.prototype.validateState=function(){this.isValidState=!0,(this.value||0===this.value)&&(this.isValidState=!(this.value>this.max||this.valuethis.max?this.max:e0?this.action("increment",e):t<0&&this.action("decrement",e),this.cancelEvent(e)},s.prototype.focusHandler=function(e){var i=this;if(this.focusEventArgs={event:e,value:this.value,container:this.container},this.trigger("focus",this.focusEventArgs),this.enabled&&!this.readonly){if(this.isFocused=!0,t.removeClass([this.container],"e-error"),this.prevValue=this.value,this.value||0===this.value){var s=this.formatNumber();if(this.setElementValue(s),!this.isPrevFocused)if(t.Browser.isDevice||"11.0"!==t.Browser.info.version){var n=t.Browser.isDevice&&t.Browser.isIos?600:0;setTimeout(function(){i.element.setSelectionRange(0,s.length)},n)}else this.element.setSelectionRange(0,s.length)}t.Browser.isDevice||t.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this)}},s.prototype.focusOutHandler=function(e){var i=this;if(this.blurEventArgs={event:e,value:this.value,container:this.container},this.trigger("blur",this.blurEventArgs),this.enabled&&!this.readonly){if(this.isPrevFocused){if(e.preventDefault(),t.Browser.isDevice){var s=this.element.value;this.element.focus(),this.isPrevFocused=!1;var n=this.element;setTimeout(function(){i.setElementValue(s,n)},200)}}else{this.isFocused=!1,this.element.value.length||this.setProperties({value:null},!0);var a=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(a),t.Browser.isDevice||t.EventHandler.remove(this.element,"mousewheel DOMMouseScroll",this.mouseWheel)}if(t.closest(this.element,"form")){var r=this.element.nextElementSibling,l=document.createEvent("FocusEvent");l.initEvent("focusout",!1,!0),r.dispatchEvent(l)}}},s.prototype.mouseDownOnSpinner=function(e){var i=this;if(this.isFocused&&(this.isPrevFocused=!0,e.preventDefault()),this.getElementData(e)){this.getElementData(e);var s=e.currentTarget,n=s.classList.contains(Y)?"increment":"decrement";t.EventHandler.add(s,"mouseleave",this.mouseUpClick,this),this.timeOut=setInterval(function(){i.isCalled=!0,i.action(n,e)},150),t.EventHandler.add(document,"mouseup",this.mouseUpClick,this)}},s.prototype.touchMoveOnSpinner=function(e){document.elementFromPoint(e.clientX,e.clientY).classList.contains(Z)||clearInterval(this.timeOut)},s.prototype.mouseUpOnSpinner=function(e){if(this.isPrevFocused&&(this.element.focus(),t.Browser.isDevice||(this.isPrevFocused=!1)),t.Browser.isDevice||e.preventDefault(),this.getElementData(e)){var i=e.currentTarget,s=i.classList.contains(Y)?"increment":"decrement";if(t.EventHandler.remove(i,"mouseleave",this.mouseUpClick),this.isCalled||this.action(s,e),this.isCalled=!1,t.EventHandler.remove(document,"mouseup",this.mouseUpClick),t.closest(this.element,"form")){var n=this.element.nextElementSibling,a=document.createEvent("KeyboardEvent");a.initEvent("keyup",!1,!0),n.dispatchEvent(a)}}},s.prototype.getElementData=function(e){return!(e.which&&3===e.which||e.button&&2===e.button||!this.enabled||this.readonly)&&(clearInterval(this.timeOut),!0)},s.prototype.floatLabelTypeUpdate=function(){e.Input.removeFloating(this.inputWrapper);var t=this.hiddenInput;this.hiddenInput.remove(),e.Input.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement),this.container.insertBefore(t,this.container.childNodes[1])},s.prototype.mouseUpClick=function(e){e.stopPropagation(),clearInterval(this.timeOut),this.isCalled=!1,t.EventHandler.remove(this.spinUp,"mouseleave",this.mouseUpClick),t.EventHandler.remove(this.spinDown,"mouseleave",this.mouseUpClick)},s.prototype.increment=function(e){void 0===e&&(e=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,e,"increment")),this.raiseChangeEvent()},s.prototype.decrement=function(e){void 0===e&&(e=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,e,"decrement")),this.raiseChangeEvent()},s.prototype.destroy=function(){if(this.unwireEvents(),!t.isBlazor()||!this.isServerRendered){t.detach(this.hiddenInput),this.showSpinButton&&(this.unwireSpinBtnEvents(),t.detach(this.spinUp),t.detach(this.spinDown));for(var e=["aria-labelledby","role","autocomplete","aria-readonly","autocorrect","aria-disabled","aria-placeholder","autocapitalize","spellcheck","aria-autocomplete","tabindex","aria-valuemin","aria-valuemax","aria-live","aria-valuenow","aria-invalid"],s=0;s=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},he=["title","style","class"],de=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.initInputValue="",s.isAngular=!1,s.preventChange=!1,s.isClicked=!1,s.maskOptions=e,s}return le(s,i),s.prototype.getModuleName=function(){return"maskedtextbox"},s.prototype.preRender=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.regExpCollec=ae,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 e=t.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),t.removeClass([this.cloneElement],["e-control","e-maskedtextbox","e-lib"]),this.angularTagName=null,this.formElement=t.closest(this.element,"form"),"EJS-MASKEDTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;for(var i=this.createElement("input"),s=0;s-1)if("class"===s){var n=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==n&&t.addClass([this.inputObj.container],n.split(" "))}else if("style"===s){var a=this.inputObj.container.getAttribute(s);a=t.isNullOrUndefined(a)?this.htmlAttributes[s]:a+this.htmlAttributes[s],this.inputObj.container.setAttribute(s,a)}else this.inputObj.container.setAttribute(s,this.htmlAttributes[s])}},s.prototype.resetMaskedTextBox=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.customRegExpCollec=[],this.undoCollec=[],this.redoCollec=[],this.promptChar.length>1&&(this.promptChar=this.promptChar[0]),n.call(this),a.call(this),(null===this.mask||""===this.mask&&void 0!==this.value)&&I.call(this,this.value);var e=p.call(this,this.element);this.prevValue=e,this.value=e,this.isInitial||l.call(this),r.call(this)},s.prototype.setMaskPlaceholder=function(t,i){(i||this.placeholder)&&(e.Input.setPlaceholder(this.placeholder,this.element),(this.element.value===this.promptMask&&t&&"Always"!==this.floatLabelType||this.element.value===this.promptMask&&"Never"===this.floatLabelType)&&I.call(this,""))},s.prototype.setWidth=function(e){if(!t.isNullOrUndefined(e))if("number"==typeof e)this.inputObj.container.style.width=t.formatUnit(e),this.element.style.width=t.formatUnit(e);else if("string"==typeof e){var i=e.match(/px|%|em/)?e:t.formatUnit(e);this.inputObj.container.style.width=i,this.element.style.width=i}},s.prototype.checkHtmlAttributes=function(e){for(var i=0,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"];i1&&(t.promptChar=t.promptChar[0]),t.promptChar?this.promptChar=t.promptChar:this.promptChar="_";var r=this.element.value.replace(new RegExp("["+i.promptChar+"]","g"),this.promptChar);this.promptMask===this.element.value&&(r=this.promptMask.replace(new RegExp("["+i.promptChar+"]","g"),this.promptChar)),this.promptMask=this.promptMask.replace(new RegExp("["+i.promptChar+"]","g"),this.promptChar),this.undoCollec=this.redoCollec=[],I.call(this,r)}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},s.prototype.updateValue=function(e){this.resetMaskedTextBox(),M.call(this,e)},s.prototype.getMaskedValue=function(){return c.call(this,this.element)},s.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),t.addClass([this.inputObj.container],["e-input-focus"]))},s.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),t.removeClass([this.inputObj.container],["e-input-focus"]))},s.prototype.destroy=function(){l.call(this);for(var e=["aria-labelledby","role","autocomplete","aria-readonly","autocorrect","aria-disabled","aria-placeholder","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-valuenow","aria-invalid"],s=0;s=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ue(i,e),ce([t.Property("None")],i.prototype,"placement",void 0),ce([t.Property(10)],i.prototype,"largeStep",void 0),ce([t.Property(1)],i.prototype,"smallStep",void 0),ce([t.Property(!1)],i.prototype,"showSmallTicks",void 0),ce([t.Property(null)],i.prototype,"format",void 0),i}(t.ChildProperty),me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ue(i,e),ce([t.Property(null)],i.prototype,"color",void 0),ce([t.Property(null)],i.prototype,"start",void 0),ce([t.Property(null)],i.prototype,"end",void 0),i}(t.ChildProperty),ve=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ue(i,e),ce([t.Property(!1)],i.prototype,"enabled",void 0),ce([t.Property(null)],i.prototype,"minStart",void 0),ce([t.Property(null)],i.prototype,"minEnd",void 0),ce([t.Property(null)],i.prototype,"maxStart",void 0),ce([t.Property(null)],i.prototype,"maxEnd",void 0),ce([t.Property(!1)],i.prototype,"startHandleFixed",void 0),ce([t.Property(!1)],i.prototype,"endHandleFixed",void 0),i}(t.ChildProperty),fe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ue(i,e),ce([t.Property("")],i.prototype,"cssClass",void 0),ce([t.Property("Before")],i.prototype,"placement",void 0),ce([t.Property("Focus")],i.prototype,"showOn",void 0),ce([t.Property(!1)],i.prototype,"isVisible",void 0),ce([t.Property(null)],i.prototype,"format",void 0),i}(t.ChildProperty),ge={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"},ye=function(e){function s(t,i){var s=e.call(this,t,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.initialTooltip=!0,s}return ue(s,e),s.prototype.preRender=function(){var e={incrementTitle:"Increase",decrementTitle:"Decrease"};this.l10n=new t.L10n("slider",e,this.locale),this.isElementFocused=!1,this.tickElementCollection=[],this.tooltipFormatInfo={},this.ticksFormatInfo={},this.initCultureInfo(),this.initCultureFunc(),this.formChecker()},s.prototype.formChecker=function(){var e=t.closest(this.element,"form");e?(this.isForm=!0,t.isNullOrUndefined(this.formResetValue)||this.setProperties({value:this.formResetValue},!0),this.formResetValue=this.value,"Range"!==this.type||!t.isNullOrUndefined(this.formResetValue)&&"object"==typeof this.formResetValue?t.isNullOrUndefined(this.formResetValue)&&(this.formResetValue=parseFloat(t.formatUnit(this.min))):this.formResetValue=[parseFloat(t.formatUnit(this.min)),parseFloat(t.formatUnit(this.max))],this.formElement=e):this.isForm=!1},s.prototype.initCultureFunc=function(){this.internationalization=new t.Internationalization(this.locale)},s.prototype.initCultureInfo=function(){this.tooltipFormatInfo.format=t.isNullOrUndefined(this.tooltip.format)?null:this.tooltip.format,this.ticksFormatInfo.format=t.isNullOrUndefined(this.ticks.format)?null:this.ticks.format},s.prototype.formatString=function(e,t){var i=null,s=null;if(e||0===e){i=this.formatNumber(e);var n=this.numberOfDecimals(e);s=this.internationalization.getNumberFormat(t)(this.makeRoundNumber(e,n))}return{elementVal:i,formatString:s}},s.prototype.formatNumber=function(e){var t=this.numberOfDecimals(e);return this.internationalization.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(e)},s.prototype.numberOfDecimals=function(e){var t=e.toString().split(".")[1];return t&&t.length?t.length:0},s.prototype.makeRoundNumber=function(e,t){var i=t||0;return Number(e.toFixed(i))},s.prototype.fractionalToInteger=function(e){e=0===this.numberOfDecimals(e)?Number(e).toFixed(this.noOfDecimals):e;for(var t=1,i=0;i0&&(s=this.customValues[0],n=this.customValues[this.customValues.length-1]),"Range"!==this.type?t.attributes(e,{"aria-valuemin":s.toString(),"aria-valuemax":n.toString()}):(!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0?[[s.toString(),this.customValues[this.value[1]].toString()],[this.customValues[this.value[0]].toString(),n.toString()]]:[[s.toString(),this.value[1].toString()],[this.value[0].toString(),n.toString()]]).forEach(function(e,s){var n=0===s?i.firstHandle:i.secondHandle;n&&t.attributes(n,{"aria-valuemin":e[0],"aria-valuemax":e[1]})})},s.prototype.createSecondHandle=function(){t.isBlazor()&&this.isServerRendered?this.secondHandle=this.element.querySelector(".e-handle-second"):(this.secondHandle=this.createElement("div",{attrs:{class:ge.sliderHandle,role:"slider",tabIndex:"0"}}),this.secondHandle.classList.add(ge.sliderSecondHandle),this.element.appendChild(this.secondHandle))},s.prototype.createFirstHandle=function(){t.isBlazor()&&this.isServerRendered?this.firstHandle=this.element.querySelector(".e-handle-first"):(this.firstHandle=this.createElement("div",{attrs:{class:ge.sliderHandle,role:"slider",tabIndex:"0"}}),this.firstHandle.classList.add(ge.sliderFirstHandle),this.element.appendChild(this.firstHandle)),this.isMaterialTooltip&&(this.materialHandle=this.createElement("div",{attrs:{class:ge.sliderHandle+" "+ge.sliderMaterialHandle}}),this.element.appendChild(this.materialHandle))},s.prototype.wireFirstHandleEvt=function(e){e?(t.EventHandler.remove(this.firstHandle,"mousedown touchstart",this.handleFocus),t.EventHandler.remove(this.firstHandle,"transitionend",this.transitionEnd),t.EventHandler.remove(this.firstHandle,"mouseenter touchenter",this.handleOver),t.EventHandler.remove(this.firstHandle,"mouseleave touchend",this.handleLeave)):(t.EventHandler.add(this.firstHandle,"mousedown touchstart",this.handleFocus,this),t.EventHandler.add(this.firstHandle,"transitionend",this.transitionEnd,this),t.EventHandler.add(this.firstHandle,"mouseenter touchenter",this.handleOver,this),t.EventHandler.add(this.firstHandle,"mouseleave touchend",this.handleLeave,this))},s.prototype.wireSecondHandleEvt=function(e){e?(t.EventHandler.remove(this.secondHandle,"mousedown touchstart",this.handleFocus),t.EventHandler.remove(this.secondHandle,"transitionend",this.transitionEnd),t.EventHandler.remove(this.secondHandle,"mouseenter touchenter",this.handleOver),t.EventHandler.remove(this.secondHandle,"mouseleave touchend",this.handleLeave)):(t.EventHandler.add(this.secondHandle,"mousedown touchstart",this.handleFocus,this),t.EventHandler.add(this.secondHandle,"transitionend",this.transitionEnd,this),t.EventHandler.add(this.secondHandle,"mouseenter touchenter",this.handleOver,this),t.EventHandler.add(this.secondHandle,"mouseleave touchend",this.handleLeave,this))},s.prototype.handleStart=function(){"Range"!==this.type&&(this.firstHandle.classList[0===this.handlePos1?"add":"remove"](ge.sliderHandleStart),this.isMaterialTooltip&&(this.materialHandle.classList[0===this.handlePos1?"add":"remove"](ge.sliderHandleStart),this.tooltipElement&&this.tooltipElement.classList[0===this.handlePos1?"add":"remove"](ge.sliderTooltipStart)))},s.prototype.transitionEnd=function(e){"transform"!==e.propertyName&&(this.handleStart(),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())},s.prototype.handleFocusOut=function(){this.firstHandle.classList.contains(ge.sliderHandleFocused)&&this.firstHandle.classList.remove(ge.sliderHandleFocused),"Range"===this.type&&this.secondHandle.classList.contains(ge.sliderHandleFocused)&&this.secondHandle.classList.remove(ge.sliderHandleFocused)},s.prototype.handleFocus=function(e){this.focusSliderElement(),this.sliderBarClick(e),e.currentTarget===this.firstHandle?this.firstHandle.classList.add(ge.sliderHandleFocused):this.secondHandle.classList.add(ge.sliderHandleFocused),t.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),t.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},s.prototype.handleOver=function(e){this.tooltip.isVisible&&"Hover"===this.tooltip.showOn&&this.tooltipToggle(e.currentTarget),"Default"===this.type&&this.tooltipToggle(this.getHandle())},s.prototype.handleLeave=function(e){!this.tooltip.isVisible||"Hover"!==this.tooltip.showOn||e.currentTarget.classList.contains(ge.sliderHandleFocused)||e.currentTarget.classList.contains(ge.sliderTabHandle)||this.closeTooltip()},s.prototype.setHandler=function(){this.min>this.max&&(this.min=this.max),this.createFirstHandle(),"Range"===this.type&&this.createSecondHandle()},s.prototype.setEnableRTL=function(){if(!t.isBlazor()||!this.isServerRendered){this.enableRtl&&"Vertical"!==this.orientation?t.addClass([this.sliderContainer],ge.rtl):t.removeClass([this.sliderContainer],ge.rtl);var e="Vertical"!==this.orientation?this.horDir:this.verDir;this.enableRtl?(this.horDir="right",this.verDir="bottom"):(this.horDir="left",this.verDir="bottom"),e!==("Vertical"!==this.orientation?this.horDir:this.verDir)&&"Horizontal"===this.orientation&&(t.setStyleAttribute(this.firstHandle,{right:"",left:"auto"}),"Range"===this.type&&t.setStyleAttribute(this.secondHandle,{top:"",left:"auto"}))}this.setBarColor()},s.prototype.tooltipValue=function(){var e,i=this,s={value:this.value,text:""};this.initialTooltip&&(this.initialTooltip=!1,t.isBlazor()&&this.isServerRendered?s.text=this.formatContent(this.tooltipFormatInfo,!1):(this.setTooltipContent(),s.text=e=this.tooltipObj.content),this.trigger("tooltipChange",s,function(t){i.addTooltipClass(t.text),e!==t.text&&(i.customAriaText=t.text,i.tooltipObj.content=t.text,i.setAriaAttrValue(i.firstHandle),"Range"===i.type&&i.setAriaAttrValue(i.secondHandle))}),this.isMaterialTooltip&&this.setPreviousVal("change",this.value))},s.prototype.setTooltipContent=function(){var e;e=this.formatContent(this.tooltipFormatInfo,!1),this.tooltipObj.content=e},s.prototype.formatContent=function(e,i){var s="",n=this.handleVal1,a=this.handleVal2;return!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(n=this.customValues[this.handleVal1],a=this.customValues[this.handleVal2]),i?("Range"===this.type?s=this.enableRtl&&"Vertical"!==this.orientation?t.isNullOrUndefined(this.tooltip)||t.isNullOrUndefined(this.tooltip.format)?a.toString()+" - "+n.toString():this.formatString(a,e).elementVal+" - "+this.formatString(n,e).elementVal:t.isNullOrUndefined(this.tooltip)||t.isNullOrUndefined(this.tooltip.format)?n.toString()+" - "+a.toString():this.formatString(n,e).elementVal+" - "+this.formatString(a,e).elementVal:t.isNullOrUndefined(n)||(s=t.isNullOrUndefined(this.tooltip)||t.isNullOrUndefined(this.tooltip.format)?n.toString():this.formatString(n,e).elementVal),s):("Range"===this.type?s=this.enableRtl&&"Vertical"!==this.orientation?t.isNullOrUndefined(e.format)?a.toString()+" - "+n.toString():this.formatString(a,e).formatString+" - "+this.formatString(n,e).formatString:t.isNullOrUndefined(e.format)?n.toString()+" - "+a.toString():this.formatString(n,e).formatString+" - "+this.formatString(a,e).formatString:t.isNullOrUndefined(n)||(s=t.isNullOrUndefined(e.format)?n.toString():this.formatString(n,e).formatString),s)},s.prototype.addTooltipClass=function(e){if(this.isMaterialTooltip){var t=e.toString().length;if(this.tooltipElement){i=t>4?{oldCss:ge.sliderMaterialDefault,newCss:ge.sliderMaterialRange}:{oldCss:ge.sliderMaterialRange,newCss:ge.sliderMaterialDefault};this.tooltipElement.classList.remove(i.oldCss),this.tooltipElement.classList.contains(i.newCss)||(this.tooltipElement.classList.add(i.newCss),this.tooltipElement.style.transform=t>4?"scale(1)":this.getTooltipTransformProperties(this.previousTooltipClass).rotate)}else{var i=t>4?ge.sliderMaterialRange:ge.sliderMaterialDefault;this.tooltipObj.cssClass=ge.sliderTooltip+" "+i}}},s.prototype.tooltipPlacement=function(){return"Horizontal"===this.orientation?"Before"===this.tooltip.placement?"TopCenter":"BottomCenter":"Before"===this.tooltip.placement?"LeftCenter":"RightCenter"},s.prototype.tooltipBeforeOpen=function(e){this.tooltipElement=e.element,this.tooltip.cssClass&&t.addClass([this.tooltipElement],this.tooltip.cssClass.split(" ").filter(function(e){return e})),e.target.removeAttribute("aria-describedby"),this.isMaterialTooltip&&(this.tooltipElement.firstElementChild.classList.add(ge.materialTooltipHide),this.handleStart(),this.setTooltipTransform())},s.prototype.tooltipCollision=function(e){if(this.isBootstrap||this.isBootstrap4||this.isMaterial&&!this.isMaterialTooltip){var t=this.isBootstrap4?3:6;switch(e){case"TopCenter":this.tooltipObj.setProperties({offsetY:-t},!1);break;case"BottomCenter":this.tooltipObj.setProperties({offsetY:t},!1);break;case"LeftCenter":this.tooltipObj.setProperties({offsetX:-t},!1);break;case"RightCenter":this.tooltipObj.setProperties({offsetX:t},!1)}}},s.prototype.materialTooltipEventCallBack=function(e){this.sliderBarClick(e),t.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),t.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},s.prototype.wireMaterialTooltipEvent=function(e){this.isMaterialTooltip&&(e?t.EventHandler.remove(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack):t.EventHandler.add(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack,this))},s.prototype.tooltipPositionCalculation=function(e){var t;switch(e){case"TopCenter":t=ge.horizontalTooltipBefore;break;case"BottomCenter":t=ge.horizontalTooltipAfter;break;case"LeftCenter":t=ge.verticalTooltipBefore;break;case"RightCenter":t=ge.verticalTooltipAfter}return t},s.prototype.getTooltipTransformProperties=function(e){var t;if(this.tooltipElement){var i="Horizontal"===this.orientation?this.tooltipElement.clientHeight+14-this.tooltipElement.clientHeight/2:this.tooltipElement.clientWidth+14-this.tooltipElement.clientWidth/2;t="Horizontal"===this.orientation?e===ge.horizontalTooltipBefore?{rotate:"rotate(45deg)",translate:"translateY("+i+"px)"}:{rotate:"rotate(225deg)",translate:"translateY("+-i+"px)"}:e===ge.verticalTooltipBefore?{rotate:"rotate(-45deg)",translate:"translateX("+i+"px)"}:{rotate:"rotate(-225deg)",translate:"translateX("+-i+"px)"}}return t},s.prototype.openMaterialTooltip=function(){var e=this;if(this.isMaterialTooltip){this.refreshTooltip(this.firstHandle);var t=this.tooltipElement.firstElementChild;t.classList.remove(ge.materialTooltipHide),t.classList.add(ge.materialTooltipShow),this.firstHandle.style.cursor="default",this.tooltipElement.style.transition=this.scaleTransform,this.tooltipElement.classList.add(ge.materialTooltipOpen),this.materialHandle.style.transform="scale(0)",t.innerText.length>4?this.tooltipElement.style.transform="scale(1)":this.tooltipElement.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate,"Default"===this.type?setTimeout(function(){e.tooltipElement.style.transition=e.transition.handle},2500):setTimeout(function(){e.tooltipElement.style.transition="none"},2500)}},s.prototype.closeMaterialTooltip=function(){var e=this;if(this.isMaterialTooltip){var t=this.tooltipElement.firstElementChild;this.tooltipElement.style.transition=this.scaleTransform,t.classList.remove(ge.materialTooltipShow),t.classList.add(ge.materialTooltipHide),this.firstHandle.style.cursor="-webkit-grab",this.firstHandle.style.cursor="grab",this.materialHandle&&(this.materialHandle.style.transform="scale(1)"),this.tooltipElement.classList.remove(ge.materialTooltipOpen),this.setTooltipTransform(),this.tooltipTarget=void 0,setTimeout(function(){e.tooltipElement.style.transition="none"},2500)}},s.prototype.checkTooltipPosition=function(e){var t=this.tooltipPositionCalculation(e.collidedPosition);void 0!==this.tooltipCollidedPosition&&this.tooltipCollidedPosition===e.collidedPosition&&e.element.classList.contains(t)||(this.isMaterialTooltip&&(void 0!==t&&(e.element.classList.remove(this.previousTooltipClass),e.element.classList.add(t),this.previousTooltipClass=t),e.element.style.transform&&e.element.classList.contains(ge.materialTooltipOpen)&&e.element.firstElementChild.innerText.length<=4&&(e.element.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate)),this.tooltipCollidedPosition=e.collidedPosition),this.isMaterialTooltip&&this.tooltipElement&&-1!==this.tooltipElement.style.transform.indexOf("translate")&&this.setTooltipTransform()},s.prototype.setTooltipTransform=function(){var e=this.getTooltipTransformProperties(this.previousTooltipClass);this.tooltipElement.firstElementChild.innerText.length>4?this.tooltipElement.style.transform=e.translate+" scale(0.01)":this.tooltipElement.style.transform=e.translate+" "+e.rotate+" scale(0.01)"},s.prototype.renderTooltip=function(){this.tooltipObj=new i.Tooltip({showTipPointer:this.isBootstrap||this.isMaterial||this.isBootstrap4,cssClass:ge.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()},s.prototype.initializeTooltipProps=function(){var e=this.isMaterialTooltip?"Always":"Auto"===this.tooltip.showOn?"Hover":this.tooltip.showOn;this.setProperties({tooltip:{showOn:e}},!0),this.tooltipObj.position=this.tooltipPlacement(),this.tooltipCollision(this.tooltipObj.position),[this.firstHandle,this.rangeBar,this.secondHandle].forEach(function(e){t.isNullOrUndefined(e)||(e.style.transition="none")}),this.isMaterialTooltip&&(this.sliderContainer.classList.add(ge.materialSlider),t.isBlazor()||this.tooltipValue(),this.tooltipObj.animation.close.effect="None",this.tooltipObj.open(this.firstHandle))},s.prototype.tooltipBeforeClose=function(){this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0},s.prototype.setButtons=function(){t.isBlazor()&&this.isServerRendered?(this.firstBtn=this.element.parentElement.querySelector(".e-slider-button.e-first-button"),this.secondBtn=this.element.parentElement.querySelector(".e-slider-button.e-second-button")):(this.firstBtn=this.createElement("div",{className:ge.sliderButton+" "+ge.firstButton}),this.firstBtn.appendChild(this.createElement("span",{className:ge.sliderButtonIcon})),this.firstBtn.tabIndex=-1,this.secondBtn=this.createElement("div",{className:ge.sliderButton+" "+ge.secondButton}),this.secondBtn.appendChild(this.createElement("span",{className:ge.sliderButtonIcon})),this.secondBtn.tabIndex=-1,this.sliderContainer.classList.add(ge.sliderButtonClass),this.sliderContainer.appendChild(this.firstBtn),this.sliderContainer.appendChild(this.secondBtn),this.sliderContainer.appendChild(this.element),this.buttonTitle())},s.prototype.buttonTitle=function(){var e=this.enableRtl&&"Vertical"!==this.orientation;this.l10n.setLocale(this.locale);var i=this.l10n.getConstant("decrementTitle"),s=this.l10n.getConstant("incrementTitle");t.attributes(e?this.secondBtn:this.firstBtn,{"aria-label":i,title:i}),t.attributes(e?this.firstBtn:this.secondBtn,{"aria-label":s,title:s})},s.prototype.buttonFocusOut=function(){this.isMaterial&&this.getHandle().classList.remove("e-large-thumb-size")},s.prototype.repeatButton=function(e){var t,i=this.handleValueUpdate(),s=this.enableRtl&&"Vertical"!==this.orientation;e.target.parentElement.classList.contains(ge.firstButton)||e.target.classList.contains(ge.firstButton)?t=s?this.add(i,parseFloat(this.step.toString()),!0):this.add(i,parseFloat(this.step.toString()),!1):(e.target.parentElement.classList.contains(ge.secondButton)||e.target.classList.contains(ge.secondButton))&&(t=s?this.add(i,parseFloat(this.step.toString()),!1):this.add(i,parseFloat(this.step.toString()),!0)),this.limits.enabled&&(t=this.getLimitCorrectedValues(t)),t>=this.min&&t<=this.max&&(this.changeHandleValue(t),this.tooltipToggle(this.getHandle()))},s.prototype.repeatHandlerMouse=function(e){e.preventDefault(),"mousedown"!==e.type&&"touchstart"!==e.type||(this.buttonClick(e),this.repeatInterval=setInterval(this.repeatButton.bind(this),180,e))},s.prototype.materialChange=function(){this.getHandle().classList.contains("e-large-thumb-size")||this.getHandle().classList.add("e-large-thumb-size")},s.prototype.repeatHandlerUp=function(e){this.changeEvent("changed",e),this.closeTooltip(),clearInterval(this.repeatInterval),this.getHandle().focus()},s.prototype.customTickCounter=function(e){var i=4;return!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(e>4&&(i=3),e>7&&(i=2),e>14&&(i=1),e>28&&(i=0)),i},s.prototype.renderScale=function(){var e=0,i="Vertical"===this.orientation?"v":"h";this.noOfDecimals=this.numberOfDecimals(this.step),t.isBlazor()&&this.isServerRendered?this.ul=this.element.querySelector("ul"):this.ul=this.createElement("ul",{className:ge.scale+" e-"+i+"-scale "+ge.tick+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation",tabIndex:"-1","aria-hidden":"true"}}),this.ul.style.zIndex="-1",t.Browser.isAndroid&&"h"===i&&this.ul.classList.add(ge.sliderTickPosition);var s=this.ticks.smallStep;this.ticks.showSmallTicks?s<=0&&(s=parseFloat(t.formatUnit(this.step))):s=this.ticks.largeStep>0?this.ticks.largeStep:parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min));var n=this.fractionalToInteger(this.min),a=this.fractionalToInteger(this.max),r=this.fractionalToInteger(s),l=!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&this.customValues.length-1,o=this.customTickCounter(l),h=!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0?l*o+l:Math.abs((a-n)/r);t.isBlazor()&&this.isServerRendered||this.element.appendChild(this.ul);var d,u=parseFloat(this.min.toString());"v"===i&&(u=parseFloat(this.max.toString()));var c,p=0,m=100/h;m===1/0&&(m=5);for(var v=0,f=!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0?this.customValues.length-1:0,g=0;v<=h;v++){if(d=this.createElement("li",{attrs:{class:ge.tick,role:"presentation",tabIndex:"-1","aria-hidden":"true"}}),!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0)(c=v%(o+1)==0)&&("h"===i?(u=this.customValues[g],g++):(u=this.customValues[f],f--),d.setAttribute("title",u.toString()));else if(d.setAttribute("title",u.toString()),0===this.numberOfDecimals(this.max)&&0===this.numberOfDecimals(this.min)&&0===this.numberOfDecimals(this.step))c="h"===i?(u-parseFloat(this.min.toString()))%this.ticks.largeStep==0:Math.abs(u-parseFloat(this.max.toString()))%this.ticks.largeStep==0;else{var y=this.fractionalToInteger(this.ticks.largeStep),b=this.fractionalToInteger(u);c="h"===i?(b-n)%y==0:Math.abs(b-parseFloat(a.toString()))%y==0}c&&d.classList.add(ge.large),"h"===i?d.style.width=m+"%":d.style.height=m+"%";var E=c?"Both"===this.ticks.placement?2:1:0;if(c){for(var C=0;Cthis.numberOfDecimals(u)?this.numberOfDecimals(s):this.numberOfDecimals(u),u="h"===i?this.makeRoundNumber(u+s,S):this.makeRoundNumber(u-s,S),p=this.makeRoundNumber(p+s,S))}this.ticksAlignment(i,m)},s.prototype.updateTicksValues=function(e,t){if(t.childElementCount>0)for(var i=0;i0&&(e=this.firstChild.children[0].getBoundingClientRect());var r,l=[this.sliderContainer.querySelectorAll("."+ge.tick+"."+ge.large+" ."+ge.tickValue)];r="Both"===this.ticks.placement?[].slice.call(l[0],2):[].slice.call(l[0],1);for(var o="Vertical"===this.orientation?2*s.height:2*s.width,h=0;hs&&(e=s),[e,this.checkHandlePosition(e)]},s.prototype.setValue=function(){if(!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(this.min=0,this.max=this.customValues.length-1,this.setBarColor()),this.setAriaAttributes(this.firstHandle),this.handleVal1=t.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,t.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 e=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd);this.handleVal1=e[0],this.handlePos1=e[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()},s.prototype.rangeValueUpdate=function(){null!==this.value&&"object"==typeof this.value||(this.value=[parseFloat(t.formatUnit(this.min)),parseFloat(t.formatUnit(this.max))])},s.prototype.validateRangeValue=function(){this.rangeValueUpdate(),this.setRangeValue()},s.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.getZindexPartial(this.element)+"")},s.prototype.setHandlePosition=function(e){var i,s=this,n=1===this.activeHandle?this.handlePos1:this.handlePos2;i=this.isMaterialTooltip?[this.firstHandle,this.materialHandle]:[this.getHandle()],this.handleStart(),i.forEach(function(e){"Horizontal"===s.orientation?s.enableRtl?e.style.right=n+"px":e.style.left=n+"px":e.style.bottom=n+"px",t.isBlazor()&&s.isServerRendered&&e.style.removeProperty("visibility")}),this.changeEvent("change",e)},s.prototype.getHandle=function(){return 1===this.activeHandle?this.firstHandle:this.secondHandle},s.prototype.setRangeValue=function(){this.updateRangeValue(),this.activeHandle=1,this.setHandlePosition(null),this.activeHandle=2,this.setHandlePosition(null),this.activeHandle=1},s.prototype.changeEvent=function(e,t){var i="change"===e?this.previousVal:this.previousChanged;if("Range"!==this.type)this.setProperties({value:this.handleVal1},!0),i===this.value||this.isMaterialTooltip&&this.initialTooltip||(this.trigger(e,this.changeEventArgs(e,t)),this.initialTooltip=!0,this.setPreviousVal(e,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(e,this.changeEventArgs(e,t)),this.initialTooltip=!0,this.setPreviousVal(e,this.value)),this.setAriaAttrValue(this.getHandle())}this.hiddenInput.value=this.value.toString()},s.prototype.changeEventArgs=function(e,i){var s;return this.tooltip.isVisible&&this.tooltipObj&&this.initialTooltip?(t.isBlazor()&&this.isServerRendered||this.tooltipValue(),s={value:this.value,previousValue:"change"===e?this.previousVal:this.previousChanged,action:e,text:this.tooltipObj.content,isInteracted:!t.isNullOrUndefined(i)}):s={value:this.value,previousValue:"change"===e?this.previousVal:this.previousChanged,action:e,text:t.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:!t.isNullOrUndefined(i)},s},s.prototype.setPreviousVal=function(e,t){"change"===e?this.previousVal=t:this.previousChanged=t},s.prototype.updateRangeValue=function(){var e=this.value.toString().split(",").map(Number);if(this.enableRtl&&"Vertical"!==this.orientation||this.rtl?this.value=[e[1],e[0]]:this.value=[e[0],e[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 t=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd);this.handleVal1=t[0],this.handlePos1=t[1],this.preHandlePos1=this.handlePos1,this.activeHandle=2,t=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=t[0],this.handlePos2=t[1],this.preHandlePos2=this.handlePos2}},s.prototype.checkHandlePosition=function(e){var i;return e=100*(e-parseFloat(t.formatUnit(this.min)))/(parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min))),i="Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(e/100):this.element.getBoundingClientRect().height*(e/100),parseFloat(t.formatUnit(this.max))===parseFloat(t.formatUnit(this.min))&&(i="Horizontal"===this.orientation?this.element.getBoundingClientRect().width:this.element.getBoundingClientRect().height),i},s.prototype.checkHandleValue=function(e){if(this.min>this.max&&(this.min=this.max),this.min===this.max)return parseFloat(t.formatUnit(this.max));var i=this.tempStartEnd();return ei.end&&(e=i.end),e},s.prototype.reposition=function(){var e=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",t.setStyleAttribute(this.rangeBar,{width:t.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",t.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",t.setStyleAttribute(this.rangeBar,{height:t.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):"Range"===this.type&&(this.secondHandle.style.bottom=this.handlePos2+"px",this.rangeBar.style.bottom=this.handlePos1+"px",t.setStyleAttribute(this.rangeBar,{height:this.handlePos2-this.handlePos1+"px"}))),this.limits.enabled&&this.setLimitBar(),"None"!==this.ticks.placement&&this.ul&&(t.isBlazor()||(this.removeElement(this.ul),this.ul=void 0),this.renderScale(),t.isBlazor()&&this.tickValuePosition()),this.handleStart(),this.tooltip.isVisible||setTimeout(function(){e.firstHandle.style.transition=e.scaleTransform,"Range"===e.type&&(e.secondHandle.style.transition=e.scaleTransform)}),t.isBlazor()&&this.isServerRendered||this.refreshTooltip(this.tooltipTarget),this.setBarColor()},s.prototype.changeHandleValue=function(e){var t=null;1===this.activeHandle?(this.limits.enabled&&this.limits.startHandleFixed||(this.handleVal1=this.checkHandleValue(e),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&&(t=this.preHandlePos1=this.handlePos1)),this.modifyZindex()):(this.limits.enabled&&this.limits.endHandleFixed||(this.handleVal2=this.checkHandleValue(e),this.handlePos2=this.checkHandlePosition(this.handleVal2),"Range"===this.type&&this.handlePos2this.max?{start:this.max,end:this.min}:{start:this.min,end:this.max}},s.prototype.xyToPosition=function(e){if(this.min===this.max)return 100;if("Horizontal"===this.orientation){var t=e.x-this.element.getBoundingClientRect().left,i=this.element.offsetWidth/100;this.val=t/i}else{var s=e.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)},s.prototype.stepValueCalculation=function(e){0===this.step&&(this.step=1);var i=parseFloat(t.formatUnit(this.step))/((parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min)))/100),s=e%Math.abs(i);return 0!==s&&(i/2>s?e-=s:e+=Math.abs(i)-s),e},s.prototype.add=function(e,t,i){var s=Math.pow(10,3);return i?(Math.round(e*s)+Math.round(t*s))/s:(Math.round(e*s)-Math.round(t*s))/s},s.prototype.positionToValue=function(e){var i,s=parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min));return i="Horizontal"===this.orientation?e/this.element.getBoundingClientRect().width*s:e/this.element.getBoundingClientRect().height*s,this.add(i,parseFloat(this.min.toString()),!0)},s.prototype.sliderBarClick=function(e){e.preventDefault();var t;"mousedown"===e.type||"mouseup"===e.type||"click"===e.type?t={x:e.clientX,y:e.clientY}:"touchend"!==e.type&&"touchstart"!==e.type||(t={x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY});var i=this.xyToPosition(t),s=this.positionToValue(i);if("Range"===this.type&&this.handlePos2-ithis.handlePos2&&(i=this.handlePos2,s=this.handleVal2),i!==this.preHandlePos1&&(this.limits.enabled&&(s=(a=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd))[0],i=a[1]),this.handlePos1=this.preHandlePos1=i,this.handleVal1=s,this.activeHandle=1));else if(2===this.activeHandle&&(this.secondHandle.classList.add(ge.sliderActiveHandle),!(this.limits.enabled&&this.limits.endHandleFixed||(ithis.colorRange[n].start){this.colorRange[n].startthis.max&&(this.colorRange[n].end=this.max);var a=this.checkHandlePosition(this.colorRange[n].start),r=this.checkHandlePosition(this.colorRange[n].end),l=this.createElement("div");l.style.backgroundColor=this.colorRange[n].color,l.style.border="1px solid "+this.colorRange[n].color,"Horizontal"===this.orientation?(i=ge.sliderHorizantalColor,e=this.enableRtl?t.isNullOrUndefined(this.customValues)?this.checkHandlePosition(this.max)-this.checkHandlePosition(this.colorRange[n].end):this.checkHandlePosition(this.customValues.length-this.colorRange[n].end-1):this.checkHandlePosition(this.colorRange[n].start),l.style.width=r-a+"px",l.style.left=e+"px"):(i=ge.sliderVerticalColor,e=this.checkHandlePosition(this.colorRange[n].start),l.style.height=r-a+"px",l.style.bottom=e+"px"),l.classList.add(i),this.sliderTrack.appendChild(l)}},s.prototype.getModuleName=function(){return"slider"},ce([t.Property(null)],s.prototype,"value",void 0),ce([t.Property(null)],s.prototype,"customValues",void 0),ce([t.Property(1)],s.prototype,"step",void 0),ce([t.Property(null)],s.prototype,"width",void 0),ce([t.Property(0)],s.prototype,"min",void 0),ce([t.Property(100)],s.prototype,"max",void 0),ce([t.Property(!1)],s.prototype,"readonly",void 0),ce([t.Property("Default")],s.prototype,"type",void 0),ce([t.Collection([{}],me)],s.prototype,"colorRange",void 0),ce([t.Complex({},pe)],s.prototype,"ticks",void 0),ce([t.Complex({},ve)],s.prototype,"limits",void 0),ce([t.Property(!0)],s.prototype,"enabled",void 0),ce([t.Complex({},fe)],s.prototype,"tooltip",void 0),ce([t.Property(!1)],s.prototype,"showButtons",void 0),ce([t.Property(!0)],s.prototype,"enableAnimation",void 0),ce([t.Property("Horizontal")],s.prototype,"orientation",void 0),ce([t.Property("")],s.prototype,"cssClass",void 0),ce([t.Property(!1)],s.prototype,"enableHtmlSanitizer",void 0),ce([t.Event()],s.prototype,"created",void 0),ce([t.Event()],s.prototype,"change",void 0),ce([t.Event()],s.prototype,"changed",void 0),ce([t.Event()],s.prototype,"renderingTicks",void 0),ce([t.Event()],s.prototype,"renderedTicks",void 0),ce([t.Event()],s.prototype,"tooltipChange",void 0),s=ce([t.NotifyPropertyChanges],s)}(t.Component),be=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Ee=function(e,t,i,s){var n,a=arguments.length,r=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},Ce={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(e){e[e.Message=0]="Message",e[e.Label=1]="Label"}(e.ErrorOption||(e.ErrorOption={}));var Se=function(i){function s(e,s){var n=i.call(this,s,e)||this;if(n.validated=[],n.errorRules=[],n.allowSubmit=!1,n.required="required",n.infoElement=null,n.inputElement=null,n.selectQuery="input:not([type=reset]):not([type=button]), select, textarea",n.localyMessage={},n.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===n.rules&&(n.rules={}),n.l10n=new t.L10n("formValidator",n.defaultMessages,n.locale),n.locale&&n.localeFunc(),t.onIntlChange.on("notifyExternalChange",n.afterLocalization,n),e="string"==typeof e?t.select(e,document):e,null!=n.element)return n.element.setAttribute("novalidate",""),n.inputElements=t.selectAll(n.selectQuery,n.element),n.createHTML5Rules(),n.wireEvents(),n}be(s,i),n=s,s.prototype.addRules=function(e,i){e&&(this.rules.hasOwnProperty(e)?t.extend(this.rules[e],i,{}):this.rules[e]=i)},s.prototype.removeRules=function(e,i){if(e||i)if(this.rules[e]&&!i)delete this.rules[e];else{if(t.isNullOrUndefined(this.rules[e]&&i))return;for(var s=0;s0&&(this.getInputElement(s.name),this.getErrorElement(s.name),this.hideMessage(s.name)),s.classList.remove(this.validClass)}},s.prototype.createHTML5Rules=function(){for(var e=["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"],t=["hidden","email","url","date","number","tel"],i=0,s=this.inputElements;i0?this.validate(t.name):-1===this.validated.indexOf(t.name)&&this.validated.push(t.name))},s.prototype.keyUpHandler=function(e){this.trigger("keyup",e);var t=e.target,i=[16,17,18,20,35,36,37,38,39,40,45,144,225];(9!==e.which||this.rules[t.name]&&(!this.rules[t.name]||this.rules[t.name][this.required]))&&-1!==this.validated.indexOf(t.name)&&this.rules[t.name]&&-1===i.indexOf(e.which)&&this.validate(t.name)},s.prototype.clickHandler=function(e){this.trigger("click",e);var t=e.target;"submit"!==t.type?this.validate(t.name):null!==t.getAttribute("formnovalidate")&&(this.allowSubmit=!0)},s.prototype.changeHandler=function(e){this.trigger("change",e);var t=e.target;this.validate(t.name)},s.prototype.submitHandler=function(e){this.trigger("submit",e),this.allowSubmit||this.validate()?this.allowSubmit=!1:e.preventDefault()},s.prototype.resetHandler=function(){this.clearForm()},s.prototype.validateRules=function(e){if(this.rules[e]){var t=Object.keys(this.rules[e]),i=!1,s=!1,n=t.indexOf("validateHidden"),a=t.indexOf("hidden");if(this.getInputElement(e),-1!==a&&(i=!0),-1!==n&&(s=!0),!i||i&&s){-1!==n&&t.splice(n,1),-1!==a&&t.splice(a-1,1),this.getErrorElement(e);for(var r=0,l=t;r0:n.checkValidator[i](l))},s.prototype.getErrorMessage=function(e,i){var s=this.inputElement.getAttribute("data-"+i+"-message")?this.inputElement.getAttribute("data-"+i+"-message"):e instanceof Array&&"string"==typeof e[1]?e[1]:0!==Object.keys(this.localyMessage).length?this.localyMessage[i]:this.defaultMessages[i],n=s.match(/{(\d)}/g);if(!t.isNullOrUndefined(n))for(var a=0;a0:!isNaN(new Date(e.value).getTime())},email:function(e){return Ce.EMAIL.test(e.value)},url:function(e){return Ce.URL.test(e.value)},dateIso:function(e){return Ce.DATE_ISO.test(e.value)},tel:function(e){return Ce.PHONE.test(e.value)},creditcard:function(e){return Ce.CREDITCARD.test(e.value)},number:function(e){return!isNaN(Number(e.value))&&-1===e.value.indexOf(" ")},digits:function(e){return Ce.DIGITS.test(e.value)},maxLength:function(e){return e.value.length<=e.param},minLength:function(e){return e.value.length>=e.param},rangeLength:function(e){var t=e.param;return e.value.length>=t[0]&&e.value.length<=t[1]},range:function(e){var t=e.param;return!isNaN(Number(e.value))&&Number(e.value)>=t[0]&&Number(e.value)<=t[1]},date:function(e){return!isNaN(new Date(e.value).getTime())},max:function(e){return isNaN(Number(e.value))?new Date(e.value).getTime()<=new Date(JSON.parse(JSON.stringify(e.param))).getTime():+e.value<=e.param},min:function(e){if(isNaN(Number(e.value))){if(-1!==e.value.indexOf(",")){var t=e.value.replace(/,/g,"");return parseFloat(t)>=e.param}return new Date(e.value).getTime()>=new Date(JSON.parse(JSON.stringify(e.param))).getTime()}return+e.value>=e.param},regex:function(e){return new RegExp(e.param).test(e.value)},equalTo:function(e){var t=e.formElement.querySelector("#"+e.param);return e.param=t.value,e.param===e.value}},Ee([t.Property("")],s.prototype,"locale",void 0),Ee([t.Property("e-hidden")],s.prototype,"ignore",void 0),Ee([t.Property()],s.prototype,"rules",void 0),Ee([t.Property("e-error")],s.prototype,"errorClass",void 0),Ee([t.Property("e-valid")],s.prototype,"validClass",void 0),Ee([t.Property("label")],s.prototype,"errorElement",void 0),Ee([t.Property("div")],s.prototype,"errorContainer",void 0),Ee([t.Property(e.ErrorOption.Label)],s.prototype,"errorOption",void 0),Ee([t.Event()],s.prototype,"focusout",void 0),Ee([t.Event()],s.prototype,"keyup",void 0),Ee([t.Event()],s.prototype,"click",void 0),Ee([t.Event()],s.prototype,"change",void 0),Ee([t.Event()],s.prototype,"submit",void 0),Ee([t.Event()],s.prototype,"validationBegin",void 0),Ee([t.Event()],s.prototype,"validationComplete",void 0),Ee([t.Event()],s.prototype,"customPlacement",void 0),s=n=Ee([t.NotifyPropertyChanges],s)}(t.Base),Te=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),ke=function(e,t,i,s){var n,a=arguments.length,r=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},xe="e-upload-file-list",Oe="e-file-status",Pe="e-file-remove-btn",Le="e-file-delete-btn",Be="e-file-abort-btn",Ae="e-file-reload-btn",He="e-upload-progress-wrap",Ne="e-upload-progress-bar",we="e-upload-success",Ue="e-upload-fails",Re="e-file-pause-btn",Fe=["title","style","class"],Ve=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Te(i,e),ke([t.Property("")],i.prototype,"name",void 0),ke([t.Property(null)],i.prototype,"size",void 0),ke([t.Property("")],i.prototype,"type",void 0),i}(t.ChildProperty),Me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Te(i,e),ke([t.Property("Browse...")],i.prototype,"browse",void 0),ke([t.Property("Upload")],i.prototype,"upload",void 0),ke([t.Property("Clear")],i.prototype,"clear",void 0),i}(t.ChildProperty),Ie=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Te(i,e),ke([t.Property("")],i.prototype,"saveUrl",void 0),ke([t.Property("")],i.prototype,"removeUrl",void 0),ke([t.Property(0)],i.prototype,"chunkSize",void 0),ke([t.Property(3)],i.prototype,"retryCount",void 0),ke([t.Property(500)],i.prototype,"retryAfterDelay",void 0),i}(t.ChildProperty),De=function(e){function s(t,i){var s=e.call(this,t,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.fileList=[],s.filesData=[],s.uploaderOptions=t,s}return Te(s,e),s.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s0&&!t.isNullOrUndefined(this.uploadWrapper.querySelector(".e-upload-files")))for(var e=0;e0&&e===this.uploadWrapper.querySelectorAll("li").length?this.uploadButton.setAttribute("disabled","disabled"):this.uploadButton.removeAttribute("disabled")}},s.prototype.setDropArea=function(){var e=this.dropAreaWrapper.querySelector(".e-file-drop");if(this.dropArea){this.dropZoneElement="string"!=typeof this.dropArea?this.dropArea:t.select(this.dropArea,document);for(var i=this.element,s=!1;i.parentNode;)(i=i.parentNode)===this.dropZoneElement&&(s=!0,e?this.isServerBlazor||(e.innerHTML=this.localizedTexts("dropFilesHint")):this.createDropTextHint());!s&&e&&t.remove(e)}else t.isNullOrUndefined(this.uploaderOptions)||void 0!==this.uploaderOptions.dropArea||(this.createDropTextHint(),this.dropZoneElement=this.uploadWrapper,this.setProperties({dropArea:this.uploadWrapper},!0));this.bindDropEvents()},s.prototype.updateDropArea=function(){if(this.dropArea)this.setDropArea();else{this.dropZoneElement=null;var e=this.dropAreaWrapper.querySelector(".e-file-drop");e&&t.remove(e)}},s.prototype.createDropTextHint=function(){if(!this.isServerBlazor){var e=this.createElement("span",{className:"e-file-drop"});e.innerHTML=this.localizedTexts("dropFilesHint"),this.dropAreaWrapper.appendChild(e)}},s.prototype.updateHTMLAttrToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e-1)if("class"===s){var n=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==n&&t.addClass([this.uploadWrapper],n.split(" "))}else if("style"===s){var a=this.uploadWrapper.getAttribute(s);a=t.isNullOrUndefined(a)?this.htmlAttributes[s]:a+this.htmlAttributes[s],this.uploadWrapper.setAttribute(s,a)}else this.uploadWrapper.setAttribute(s,this.htmlAttributes[s])}},s.prototype.setMultipleSelection=function(){if(this.multiple&&!this.element.hasAttribute("multiple")){var e=document.createAttribute("multiple");e.value="multiple",this.element.setAttributeNode(e)}else this.multiple||this.element.removeAttribute("multiple")},s.prototype.checkAutoUpload=function(e){this.autoUpload?(this.sequentialUpload?this.sequenceUpload(e):this.upload(e),this.removeActionButtons()):this.actionButtons||this.renderActionButtons(),this.checkActionButtonStatus()},s.prototype.sequenceUpload=function(e){if(this.filesData.length-e.length==0||"1"!==this.filesData[this.filesData.length-e.length-1].statusCode){++this.count;var t=!this.showFileList;"object"==typeof this.filesData[this.count]?(this.isFirstFileOnSelection=!1,this.upload(this.filesData[this.count],t),"0"===this.filesData[this.count].statusCode&&this.sequenceUpload(e)):--this.count}},s.prototype.setCSSClass=function(e){var i=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.cssClass.replace(/\s+/g," ").trim()),t.isNullOrUndefined(this.cssClass)||""===i||t.addClass([this.uploadWrapper],i.split(i.indexOf(",")>-1?",":" "));var s=e;t.isNullOrUndefined(e)||(s=e.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||""===s||t.removeClass([this.uploadWrapper],s.split(" "))},s.prototype.wireEvents=function(){t.EventHandler.add(this.browseButton,"click",this.browseButtonClick,this),t.EventHandler.add(this.element,"change",this.onSelectFiles,this),t.EventHandler.add(document,"click",this.removeFocus,this),this.keyboardModule=new t.KeyboardEvents(this.uploadWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.isForm&&t.EventHandler.add(this.formElement,"reset",this.resetForm,this)},s.prototype.unWireEvents=function(){t.EventHandler.remove(this.browseButton,"click",this.browseButtonClick),t.EventHandler.remove(this.element,"change",this.onSelectFiles),t.EventHandler.remove(document,"click",this.removeFocus),this.isForm&&t.EventHandler.remove(this.formElement,"reset",this.resetForm),this.keyboardModule&&this.keyboardModule.destroy()},s.prototype.resetForm=function(){this.clearAll()},s.prototype.keyActionHandler=function(e){var i=e.target;switch(e.action){case"enter":if(e.target===this.clearButton)this.clearButtonClick();else if(e.target===this.uploadButton)this.uploadButtonClick();else if(e.target===this.browseButton)this.browseButtonClick();else if(i.classList.contains(Re))(s=this.getCurrentMetaData(null,e)).file.statusCode="4",s.file.status=this.localizedTexts("pauseUpload"),this.abortUpload(s,!1);else if(i.classList.contains("e-file-play-btn"))this.resumeUpload(this.getCurrentMetaData(null,e),e);else if(i.classList.contains(Ae)){var s=this.getCurrentMetaData(null,e);if(t.isNullOrUndefined(s)){var n=e.target.parentElement,a=this.filesData[this.fileList.indexOf(n)];this.retry(a)}else s.file.statusCode="1",s.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(s.file)}else this.removeFiles(e),i.classList.contains(Be)||this.browseButton.focus();e.preventDefault(),e.stopPropagation()}},s.prototype.getCurrentMetaData=function(e,i){var s,n;if(t.isNullOrUndefined(e)){var a=i.target.parentElement;s=this.filesData[this.fileList.indexOf(a)]}else s=e;for(var r=0;r0&&t[0])for(var i=0;i0&&t[0])for(var i=0;i=200&&n.status<=299){var a={e:e,response:s,operation:"remove",file:this.updateStatus(t,this.localizedTexts("removedSuccessMessage"),"2")};this.trigger("success",a),this.removeFilesData(t,i);var r=this.uploadedFilesData.indexOf(t);this.uploadedFilesData.splice(r,1),this.trigger("change",{files:this.uploadedFilesData})}else this.removeFailed(e,t,i)},s.prototype.removeFailed=function(e,s,n){var a={e:e,response:e&&e.currentTarget?this.getResponse(e):null,operation:"remove",file:this.updateStatus(s,this.localizedTexts("removedFailedMessage"),"0")};if(!n){var r=this.filesData.indexOf(s),l=this.fileList[r];if(l){l.classList.remove(we),l.classList.add(Ue);var o=l.querySelector("."+Oe);o&&(o.classList.remove(we),o.classList.add(Ue))}this.checkActionButtonStatus()}this.trigger("failure",a);var h=this.getLiElement(s);if(!t.isNullOrUndefined(h)&&!t.isNullOrUndefined(h.querySelector("."+Le))){var d=h.querySelector("."+Le);i.hideSpinner(d),t.detach(h.querySelector(".e-spinner-pane"))}},s.prototype.getFilesFromFolder=function(e){this.filesEntries=[];var t=this.multiple?e.dataTransfer.items:[e.dataTransfer.items[0]];if(this.checkDirectoryUpload(t))for(var i=this,s=0;s0&&(t=this.multiple?this.sortFileList(i):[i[0]],this.renderSelectedFiles(e,t))}else t=[].slice.call(e.target.files),this.renderSelectedFiles(e,t)}},s.prototype.getBase64=function(e){return new Promise(function(t,i){var s=new FileReader;s.readAsDataURL(e),s.onload=function(){return t(s.result)},s.onerror=function(e){return i(e)}})},s.prototype.renderSelectedFiles=function(e,t,i,s){var n=this;this.base64String=[];var a={event:e,cancel:!1,filesData:[],isModified:!1,modifiedFilesData:[],progressInterval:"",isCanceled:!1,currentRequest:null,customFormData:null};if(t.length<1)return a.isCanceled=!0,void this.trigger("selected",a);this.flag=!0;var r=[];this.multiple||(this.clearData(!0),t=[t[0]]);for(var l=0;l-1&&(this.allTypes=!0),this.allTypes||(r=this.checkExtension(r)),this.trigger("selected",a,function(e){n._internalRenderSelect(e,r)})},s.prototype.updateInitialFileDetails=function(e,i,s,n,a,r,l){var o={name:r?i[n].path.substring(1,i[n].path.length):l?t.getUniqueID(s.name.substring(0,s.name.lastIndexOf(".")))+"."+this.getFileType(s.name):this.directoryUpload?i[n].webkitRelativePath:s.name,rawFile:s,size:s.size,status:this.localizedTexts("readyToUploadMessage"),type:this.getFileType(s.name),validationMessages:this.validatedFileSize(s.size),statusCode:"1",id:t.getUniqueID(s.name.substring(0,s.name.lastIndexOf(".")))+"."+this.getFileType(s.name)};l&&(o.fileSource="paste"),o.status=""!==o.validationMessages.minSize?this.localizedTexts("invalidMinFileSize"):""!==o.validationMessages.maxSize?this.localizedTexts("invalidMaxFileSize"):o.status,""===o.validationMessages.minSize&&""===o.validationMessages.maxSize||(o.statusCode="0"),a.push(o)},s.prototype._internalRenderSelect=function(e,i){if(!e.cancel){if(t.isBlazor()&&(this.currentRequestHeader=e.currentRequest,this.customFormDatas=e.customFormData),this.selectedFiles=this.selectedFiles.concat(i),this.btnTabIndex=this.disableKeyboardNavigation?"-1":"0",this.showFileList){if(e.isModified&&e.modifiedFilesData.length>0){for(var s=0;sthis.maxFileSize?i=this.localizedTexts("invalidMaxFileSize"):(t="",i=""),{minSize:t,maxSize:i}},s.prototype.isPreLoadFile=function(e){for(var t=!1,i=0;i1?this.localizedTexts("invalidFileSelection"):n):(m.classList.add(e.length>1?"e-file-information":"e-file-size"),m.innerText=e.length>1?this.localizedTexts("totalFiles")+": "+e.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(e)):this.bytesToSize(e[0].size),this.createFormInput(e)),a.appendChild(m),t.isNullOrUndefined(s.querySelector(".e-icons"))){var v=this.createElement("span",{className:"e-icons",attrs:{tabindex:this.btnTabIndex}});"msie"===this.browserName&&v.classList.add("e-msie"),v.setAttribute("title",this.localizedTexts("remove")),s.appendChild(a),s.appendChild(v),t.EventHandler.add(v,"click",this.removeFiles,this),v.classList.add(Pe)}var f={element:s,fileInfo:this.mergeFileInfo(e,s),index:p,isPreload:this.isPreLoadFile(this.mergeFileInfo(e,s))},g={element:s,fileInfo:this.mergeFileInfo(e,s),index:p,isPreload:this.isPreLoadFile(this.mergeFileInfo(e,s))};this.trigger("rendering",f),this.trigger("fileListRendering",g),this.listParent.appendChild(s),this.fileList.push(s)},s.prototype.formValidateFileInfo=function(e,t){var i=e.status,s=this.validatedFileSize(e.size);""===s.minSize&&""===s.maxSize||(this.addInvalidClass(t),i=""!==s.minSize?this.localizedTexts("invalidMinFileSize"):""!==s.maxSize?this.localizedTexts("invalidMaxFileSize"):i);var n=this.checkExtension(this.getFilesInArray(e))[0].status;return n===this.localizedTexts("invalidFileType")&&(this.addInvalidClass(t),i=n),i},s.prototype.addInvalidClass=function(e){e.classList.add("e-file-invalid")},s.prototype.createFormInput=function(e){var t=this.element.cloneNode(!0);t.classList.add("e-hidden-file-input");for(var i=0,s=e;i1?this.localizedTexts("invalidFileSelection"):i),i},s.prototype.formCustomFileList=function(e,i){this.createParentUL(),t.resetBlazorTemplate(this.element.id+"Template","Template");var s=this.createElement("li",{className:xe});s.setAttribute("data-files-count",e.length+""),this.setListToFileInfo(e,s);var n=this.mergeFileInfo(e,s);s.setAttribute("data-file-name",n.name),this.uploadTemplateFn=this.templateComplier(this.template);var a=this.uploadTemplateFn(n,this,"template",this.element.id+"Template",this.isStringTemplate,null,s);if(a){var r=[].slice.call(a);t.append(r,s)}var l=this.listParent.querySelectorAll("li").length;s.classList.contains("e-file-invalid")||this.createFormInput(e);var o={element:s,fileInfo:n,index:l,isPreload:this.isPreLoadFile(n)},h={element:s,fileInfo:n,index:l,isPreload:this.isPreLoadFile(n)};this.trigger("rendering",o),this.trigger("fileListRendering",h),this.listParent.appendChild(s),this.fileList.push(s),this.renderReactTemplates(),t.updateBlazorTemplate(this.element.id+"Template","Template",this,!1)},s.prototype.createFileList=function(e,i){if(this.isBlazorSaveUrl||this.isBlazorTemplate){var s=i?this.filesData=this.filesData.concat(e):e;this.interopAdaptor.invokeMethodAsync("createFileList",s,this.isForm)}else if(this.createParentUL(),""===this.template||t.isNullOrUndefined(this.template))if(this.isFormUpload())this.uploadWrapper.classList.add("e-form-upload"),this.formFileList(e,this.element.files);else for(var n=0,a=e;n=0&&(t=e.substring(i+1)),t||""},s.prototype.getFileNameOnly=function(e){var t=this.getFileType(e);return t=e.split("."+t)[0]},s.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 e=document.createAttribute("multiple");this.element.setAttributeNode(e)}},s.prototype.filterfileList=function(e){for(var t=[],i=0;i0||!a.querySelector("."+Oe)||(a.querySelector("."+Oe).classList.add("e-upload-progress"),this.createProgressBar(a),this.updateProgressBarClasses(a,"e-upload-progress"),a.querySelector("."+Oe).classList.remove(Ue)),this.updateProgressbar(e,a);var r=a.querySelector("."+Pe);t.isNullOrUndefined(r)||(r.classList.add(Be,"e-upload-progress"),r.setAttribute("title",this.localizedTexts("abort")),r.classList.remove(Pe))}var l={e:e,operation:"upload",file:this.updateStatus(i,this.localizedTexts("inProgress"),"3")};this.trigger("progress",l)}},s.prototype.cancelUploadingFile=function(e,s,n,a){var r=this;if("5"===e.statusCode){var l={event:s,fileData:e,cancel:!1,customFormData:[]};this.trigger("canceling",l,function(s){if(s.cancel){if(e.statusCode="3",!t.isNullOrUndefined(a)){var l=a.querySelector("."+Be);t.isNullOrUndefined(l)||(i.hideSpinner(l),t.detach(a.querySelector(".e-spinner-pane")))}}else{n.emitError=!1,n.httpRequest.abort();var o=new FormData;if("5"===e.statusCode){var h=r.element.getAttribute("name");o.append(h,e.name),o.append("cancel-uploading",e.name),r.updateFormData(o,s.customFormData);var d=new t.Ajax(r.asyncSettings.removeUrl,"POST",!0,null);d.emitError=!1,d.onLoad=function(t){return r.removecanceledFile(t,e),{}},d.send(o)}}})}},s.prototype.removecanceledFile=function(e,s){var n=this.getLiElement(s);if(!n.querySelector("."+Ae)&&!t.isNullOrUndefined(n.querySelector("."+Be))){this.updateStatus(s,this.localizedTexts("fileUploadCancel"),"5"),this.renderFailureState(e,s,n);var a=n.querySelector("."+Pe);t.isNullOrUndefined(n)||(i.hideSpinner(a),t.detach(n.querySelector(".e-spinner-pane")));var r={event:e,response:e&&e.currentTarget?this.getResponse(e):null,operation:"cancel",file:s};this.trigger("success",r)}},s.prototype.renderFailureState=function(e,i,s){var n=this;this.updateProgressBarClasses(s,Ue),this.removeProgressbar(s,"failure"),t.isNullOrUndefined(s.querySelector(".e-file-status"))||s.querySelector(".e-file-status").classList.add(Ue);var a=s.querySelector("."+Be);t.isNullOrUndefined(a)||(a.classList.remove(Be,"e-upload-progress"),a.classList.add(Pe),a.setAttribute("title",this.localizedTexts("remove")),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}}),a.parentElement.insertBefore(this.pauseButton,a),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),s.querySelector("."+Ae).addEventListener("click",function(e){n.reloadcanceledFile(e,i,s,!1)},!1))},s.prototype.reloadcanceledFile=function(e,i,s,n){i.statusCode="1",i.status=this.localizedTexts("readyToUploadMessage"),n||(s.querySelector("."+Oe).classList.remove(Ue),t.isNullOrUndefined(s.querySelector("."+Ae))||t.detach(s.querySelector("."+Ae)),this.pauseButton=null),s.classList.add("e-restrict-retry"),this.upload([i])},s.prototype.uploadComplete=function(e,i,s){var n=e.target;if(4===n.readyState&&n.status>=200&&n.status<=299){var a=this.getLiElement(i);if(t.isNullOrUndefined(a)&&(!s||t.isNullOrUndefined(s)))return;if(!t.isNullOrUndefined(a)){this.updateProgressBarClasses(a,we),this.removeProgressbar(a,"success");var r=a.querySelector("."+Be);t.isNullOrUndefined(r)||(r.classList.add(Le),r.setAttribute("title",this.localizedTexts("delete")),r.classList.remove(Be),r.classList.remove("e-upload-progress"))}this.raiseSuccessEvent(e,i)}else this.uploadFailed(e,i)},s.prototype.getResponse=function(e){var t=e.currentTarget;return{readyState:t.readyState,statusCode:t.status,statusText:t.statusText,headers:t.getAllResponseHeaders(),withCredentials:t.withCredentials}},s.prototype.serverRemoveIconBindEvent=function(){if(this.uploadWrapper&&this.isBlazorSaveUrl)for(var e=[].slice.call(this.uploadWrapper.querySelectorAll("ul li")),i=0;i0&&(n.getLiElement(s).classList.contains("e-restrict-retry")?n.getLiElement(s).classList.remove("e-restrict-retry"):(n.uploadSequential(),n.checkActionComplete(!0)))})},s.prototype.uploadFailed=function(e,i){var s=this,n=this.getLiElement(i),a=e&&e.currentTarget?this.getResponse(e):null,r=this.localizedTexts("uploadFailedMessage"),l={e:e,response:a,operation:"upload",file:this.updateStatus(i,r,"0",!1),statusText:r};t.isNullOrUndefined(n)||this.renderFailureState(e,i,n),this.trigger("failure",l,function(e){s.updateStatus(i,e.statusText,"0"),s.checkActionButtonStatus(),s.uploadSequential(),s.checkActionComplete(!0)})},s.prototype.uploadSequential=function(){this.sequentialUpload&&(this.autoUpload?this.checkAutoUpload(this.filesData):this.uploadButtonClick())},s.prototype.checkActionComplete=function(e){e?++this.actionCompleteCount:--this.actionCompleteCount,this.raiseActionComplete()},s.prototype.raiseActionComplete=function(){if(this.filesData.length===this.actionCompleteCount&&this.flag){this.flag=!1;var e={fileData:[]};e.fileData=this.getSelectedFileStatus(this.selectedFiles),this.trigger("actionComplete",e)}},s.prototype.getSelectedFileStatus=function(e){for(var t=[],i=0,s=0;s=200&&l.status<300){var o=e&&e.currentTarget?this.getResponse(e):null,h=Math.max(Math.ceil(s.file.size/this.asyncSettings.chunkSize),1),d={event:e,file:s.file,chunkIndex:s.chunkIndex,totalChunk:h,chunkSize:this.asyncSettings.chunkSize,response:o};if(this.trigger("chunkSuccess",d),!t.isNullOrUndefined(n)&&n||(a=this.getLiElement(s.file)),this.updateMetaData(s),s.end===s.file.size&&(s.file.statusCode="3"),"5"===s.file.statusCode){var u={event:e,fileData:s.file,cancel:!1,customFormData:[]};this.trigger("canceling",u,function(e){if(e.cancel){s.file.statusCode="3";var o=a.querySelector("."+Be);t.isNullOrUndefined(a)||t.isNullOrUndefined(o)||(i.hideSpinner(o),t.detach(a.querySelector(".e-spinner-pane"))),r.sendNextRequest(s)}else{s.request.emitError=!1,l.abort();var h=new FormData,d=r.element.getAttribute("name");h.append(d,s.file.name),h.append("cancel-uploading",s.file.name),h.append("cancelUploading",s.file.name),r.updateFormData(h,e.customFormData);var u=new t.Ajax(r.asyncSettings.removeUrl,"POST",!0,null);u.emitError=!1,u.onLoad=function(e){return r.removeChunkFile(e,s,n),{}},u.send(h)}})}else{if(h-1===s.chunkIndex&&h>s.chunkIndex){var c=this.pausedData.indexOf(s);return c>=0&&this.pausedData.splice(c,1),t.isNullOrUndefined(this.template)&&(t.isNullOrUndefined(n)||!n)&&a&&(a&&t.detach(a.querySelector("."+Re)),this.removeChunkProgressBar(s)),void this.raiseSuccessEvent(e,s.file)}"4"!==s.file.statusCode&&this.sendNextRequest(s)}}else this.chunkUploadFailed(e,s)},s.prototype.sendNextRequest=function(e){e.start=e.end,e.end+=this.asyncSettings.chunkSize,e.end=Math.min(e.end,e.file.size),e.chunkIndex+=1,this.sendRequest(e.file,e)},s.prototype.removeChunkFile=function(e,s,n){if(t.isNullOrUndefined(this.template)&&t.isNullOrUndefined(n)&&!n){var a=this.getLiElement(s.file),r=a.querySelector("."+Be),l=r;this.updateStatus(s.file,this.localizedTexts("fileUploadCancel"),"5"),this.updateProgressBarClasses(a,Ue),this.removeProgressbar(a,"failure"),r.classList.remove(Be),r.classList.add(Pe),r.setAttribute("title",this.localizedTexts("remove"));var o=a.querySelector("."+Re);o.classList.add(Ae),o.classList.remove(Re),o.setAttribute("title",this.localizedTexts("retry")),t.isNullOrUndefined(a)||t.isNullOrUndefined(r)||(i.hideSpinner(l),t.detach(a.querySelector(".e-spinner-pane")))}},s.prototype.pauseUpload=function(e,t,i){e.file.statusCode="4",e.file.status=this.localizedTexts("pause"),this.updateMetaData(e);var s={event:t||null,file:e.file,chunkIndex:e.chunkIndex,chunkCount:Math.round(e.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize};this.abortUpload(e,i,s)},s.prototype.abortUpload=function(e,i,s){"4"!==e.file.statusCode&&(e.request.emitError=!1,e.request.httpRequest.abort());var n=this.getLiElement(e.file);if(t.isNullOrUndefined(this.template)&&(t.isNullOrUndefined(i)||!i)){var a=n.querySelector("."+Re);a.classList.remove(Re),a.classList.add("e-file-play-btn"),a.setAttribute("title",this.localizedTexts("resume")),a.nextElementSibling.classList.add(Pe),a.nextElementSibling.classList.remove(Be),a.nextElementSibling.setAttribute("title",this.localizedTexts("remove"))}for(var r=0;r0?(h.classList.add(Le),h.setAttribute("title",a.localizedTexts("delete"))):(h.classList.add(Pe),h.setAttribute("title",a.localizedTexts("remove")))}i.retryCount=0;var d=i.file,u=a.localizedTexts("uploadFailedMessage"),c={e:e,response:l,operation:"upload",file:a.updateStatus(d,u,"0",!1),statusText:u};a.trigger("failure",c,function(e){a.updateStatus(d,e.statusText,"0"),a.uploadSequential(),a.checkActionComplete(!0)})}})},s.prototype.retryRequest=function(e,i,s){t.isNullOrUndefined(this.template)&&(t.isNullOrUndefined(s)||!s)&&e&&this.updateProgressBarClasses(e,Ue),i.retryCount+=1,this.sendRequest(i.file,i)},s.prototype.checkPausePlayAction=function(e){var t=e.target,i=e.target.parentElement,s=this.fileList.indexOf(i),n=this.filesData[s],a=this.getCurrentMetaData(n);t.classList.contains(Re)?this.pauseUpload(a,e):t.classList.contains("e-file-play-btn")?this.resumeUpload(a,e):t.classList.contains(Ae)&&(a.file.status===this.localizedTexts("fileUploadCancel")?this.retryUpload(a,!1):this.retryUpload(a,!0))},s.prototype.retryUpload=function(e,t){t?(e.end=e.end+this.asyncSettings.chunkSize,e.start=e.start+this.asyncSettings.chunkSize,this.sendRequest(e.file,e)):(e.file.statusCode="1",e.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(e.file)),this.getLiElement(e.file).classList.add("e-restrict-retry")},s.prototype.chunkUploadInProgress=function(e,i,s){var n=this;if("4"!==i.file.statusCode){"4"!==i.file.statusCode&&"5"!==i.file.statusCode&&(i.file.statusCode="3",i.file.status=this.localizedTexts("inProgress")),this.updateMetaData(i);var a=this.getLiElement(i.file);if(!t.isNullOrUndefined(a)){var r=a.querySelector("."+Ae);if(t.isNullOrUndefined(r)||(r.classList.add(Re),r.setAttribute("title",this.localizedTexts("pause")),r.classList.remove(Ae)),!t.isNullOrUndefined(a)){if(!(a.querySelectorAll("."+He).length>0)){var l=a.querySelector("."+Oe);t.isNullOrUndefined(this.template)&&(l.classList.add("e-upload-progress"),l.classList.remove(Ue),this.createProgressBar(a),this.updateProgressBarClasses(a,"e-upload-progress"));var o=a.querySelector("."+Pe)?a.querySelector("."+Pe):a.querySelector("."+Le);t.isNullOrUndefined(o)||(o.classList.add(Be),o.setAttribute("title",this.localizedTexts("abort")),o.classList.remove(Pe))}if(!isNaN(Math.round(e.loaded/e.total*100))&&t.isNullOrUndefined(this.template)&&"4"!==i.file.statusCode){var h=i.chunkIndex*this.asyncSettings.chunkSize,d=e.loaded;d>this.asyncSettings.chunkSize&&(d=this.asyncSettings.chunkSize);var u=Math.min((h+d)/i.file.size*100,100);this.changeProgressValue(a,Math.round(u).toString()+"%")}0===i.chunkIndex&&this.checkActionButtonStatus()}if(t.isNullOrUndefined(a.querySelector("."+Re))&&t.isNullOrUndefined(this.template)){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=a.querySelector("."+Be);c.parentElement.insertBefore(this.pauseButton,c),this.pauseButton.setAttribute("title",this.localizedTexts("pause")),this.pauseButton.addEventListener("click",function(e){n.checkPausePlayAction(e)},!1)}}}},s.prototype.bytesToSize=function(e){var t=-1;if(!e)return"0.0 KB";do{e/=1024,t++}while(e>99);return t>=2&&(e*=1024,t=1),Math.max(e,0).toFixed(1)+" "+["KB","MB"][t]},s.prototype.sortFileList=function(e){for(var t=e=e||this.sortFilesList,i=[],s=0;s0?e.customFormData:s.customFormDatas),s.uploadFiles(n,i))})}},s.prototype.getFilesInArray=function(e){var t=[];return e instanceof Array?t=e:t.push(e),t},s.prototype.serverReadFileBase64=function(e,t,i){var s=this;return new Promise(function(n,a){var r=s.fileStreams[e].rawFile;try{var l=new FileReader;l.onload=function(e){return function(){try{var t=e.result,i=t?t.split(";base64,")[1]:null;n(i)}catch(e){a(e)}}}(l),l.readAsDataURL(r.slice(t,t+i))}catch(e){a(e)}})},s.prototype.uploadFileCount=function(e){var t=this.filesData;return t&&0!==t.length?t.length:-1},s.prototype.getFileRead=function(e,t){var i=this.filesData;if(!i||0===i.length)return-1;var s=i[e],n=this.newFileRef++;return this.fileStreams[n]=s,n},s.prototype.getFileInfo=function(e,t){var i=this.filesData;return i&&0!==i.length&&i[e]?this.filesData[e]:null},s.prototype.uploadFiles=function(e,i){var s=this,n=[];if(""===this.asyncSettings.saveUrl||t.isNullOrUndefined(this.asyncSettings.saveUrl))return void(this.isServerBlazor&&this.interopAdaptor.invokeMethodAsync("GetFileDetails",e));if(!i||t.isNullOrUndefined(i))if(this.multiple)n=this.filterfileList(e);else{var a=[];a.push(e[0]),n=this.filterfileList(a)}else n=e;for(var r=this,l=0;lthis.asyncSettings.chunkSize?this.chunkUpload(e[i],s,i):(l.onLoad=function(t){return h.cancel&&n.isServerBlazor?{}:(n.uploadComplete(t,e[i],s),{})},l.onUploadProgress=function(t){return h.cancel&&n.isServerBlazor?{}:(n.uploadInProgress(t,e[i],s,l),{})},l.onError=function(t){return n.uploadFailed(t,e[i]),{}},l.send(d))}},s.prototype.spliceFiles=function(e){for(var t=this.fileList[e],i=this.getFilesData(),s=+t.getAttribute("data-files-count"),n=0,a=0;a=n;r--)i.splice(r,1)},s.prototype.remove=function(e,i,s,n,a){var r=this;t.isNullOrUndefined(n)&&(n=!0);var l={event:a,cancel:!1,filesData:[],customFormData:[],postRawFile:n,currentRequest:null},o={cancel:!1,customFormData:[],currentRequest:null};this.trigger("beforeRemove",o,function(n){if(!n.cancel)if(t.isBlazor()&&(r.currentRequestHeader=n.currentRequest,r.customFormDatas=n.customFormData),r.isFormUpload()&&!r.isBlazorSaveUrl)l.filesData=e,r.trigger("removing",l,function(i){if(!i.cancel)for(var s=!1,n=void 0,a=0,l=r.getFilesInArray(e);a-1){var h=t.isNullOrUndefined(o.input)?null:o.input;h&&t.detach(h),r.spliceFiles(n),t.detach(r.fileList[n]),r.fileList.splice(n,1),s=!0,n=-1}}});else if(!r.isForm||!t.isNullOrUndefined(r.asyncSettings.removeUrl)&&""!==r.asyncSettings.removeUrl||r.isBlazorSaveUrl){var o=[];(e=t.isNullOrUndefined(e)?r.filesData:e)instanceof Array?o=e:o.push(e),l.filesData=o;for(var h=r.asyncSettings.removeUrl,d=""!==h&&!t.isNullOrUndefined(h),u=0,c=o;u0)this.retryUpload(this.getCurrentMetaData(s[n],null),t);else{var a=void 0;i||(a=this.fileList[this.filesData.indexOf(s[n])]),this.reloadcanceledFile(null,s[n],a,i)}},s.prototype.cancel=function(e){e=e||this.filesData;var t=this.getFilesInArray(e);this.cancelUpload(t)},s.prototype.cancelUpload=function(e){var t=this.getFiles(e);if(this.asyncSettings.chunkSize>0){for(s=0;s=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},We="e-switch-ctrl-btn",je="e-hide-hex-value",_e="e-hide-switchable-value",Xe="e-hide-value",Ke="e-hsv-color",Ze="e-selected-value",Ye="e-mode-switch-btn",Ge="e-nocolor-item",$e="e-opacity-value",Je="e-preview-container",Qe="e-show-value",et="e-selected",tt="e-tile",it={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"]},st=function(n){function a(e,t){return n.call(this,e,t)||this}return ze(a,n),a.prototype.preRender=function(){var e=this.element;this.formElement=t.closest(this.element,"form"),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this);var i={Apply:"Apply",Cancel:"Cancel",ModeSwitcher:"Switch Mode"};this.l10n=new t.L10n("colorpicker",i,this.locale),e.getAttribute("ejs-for")&&!e.getAttribute("name")&&e.setAttribute("name",e.id)},a.prototype.render=function(){this.initWrapper(),this.inline?this.createWidget():this.createSplitBtn(),this.enableOpacity||t.addClass([this.container.parentElement],"e-hide-opacity"),this.renderComplete()},a.prototype.initWrapper=function(){var e=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"});this.element.parentNode.insertBefore(e,this.element),e.appendChild(this.element),t.attributes(this.element,{tabindex:"-1",spellcheck:"false"}),this.container=this.createElement("div",{className:"e-container"}),this.getWrapper().appendChild(this.container);var i=this.value?this.roundValue(this.value).toLowerCase():"#008000ff";this.noColor&&"Palette"===this.mode&&""===this.value&&(i="");var s=i.slice(0,7);t.isNullOrUndefined(this.initialInputValue)&&(this.initialInputValue=s),this.element.value=s,this.enableOpacity?this.setProperties({value:i},!0):this.setProperties({value:s},!0),this.enableRtl&&e.classList.add("e-rtl"),this.cssClass&&t.addClass([e],this.cssClass.split(" ")),this.tileRipple=t.rippleEffect(this.container,{selector:"."+tt}),this.ctrlBtnRipple=t.rippleEffect(this.container,{selector:".e-btn"})},a.prototype.getWrapper=function(){return this.element.parentElement},a.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),t.Browser.isDevice&&this.refreshPopupPos()},a.prototype.createSplitBtn=function(){var e=this,n=this.createElement("button",{className:"e-split-colorpicker"});this.getWrapper().appendChild(n),this.splitBtn=new s.SplitButton({iconCss:"e-selected-color",target:this.container,disabled:this.disabled,enableRtl:this.enableRtl,open:this.onOpen.bind(this),click:function(t){e.trigger("change",{currentValue:{hex:e.value.slice(0,7),rgba:e.convertToRgbString(e.hexToRgb(e.value))},previousValue:{hex:null,rgba:null},value:e.value})}}),this.splitBtn.createElement=this.createElement,this.splitBtn.appendTo(n);var a=this.createElement("span",{className:"e-split-preview"});t.select(".e-selected-color",n).appendChild(a),a.style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value));var r=this.getPopupEle();if(t.addClass([r],"e-colorpicker-popup"),this.cssClass&&t.addClass([r],this.cssClass.split(" ")),t.Browser.isDevice){var l=this.getPopupInst();l.relateTo=document.body,l.position={X:"center",Y:"center"},l.targetType="container",l.collision={X:"fit",Y:"fit"},l.offsetY=4,r.style.zIndex=i.getZindexPartial(this.splitBtn.element).toString()}this.bindCallBackEvent()},a.prototype.onOpen=function(e){this.trigger("open",{element:this.container})},a.prototype.getPopupInst=function(){return t.getInstance(this.getPopupEle(),i.Popup)},a.prototype.bindCallBackEvent=function(){var e=this;this.splitBtn.beforeOpen=function(i){var n=new s.Deferred;return e.trigger("beforeOpen",i,function(s){if(!s.cancel){var a=e.getPopupEle();a.style.top=t.formatUnit(0+pageYOffset),a.style.left=t.formatUnit(0+pageXOffset),a.style.display="block",e.createWidget(),a.style.display="",t.Browser.isDevice&&(e.modal=e.createElement("div"),e.modal.className="e-"+e.getModuleName()+" e-modal",e.modal.style.display="none",document.body.insertBefore(e.modal,a),document.body.className+=" e-colorpicker-overflow",e.modal.style.display="block",e.modal.style.zIndex=(Number(a.style.zIndex)-1).toString())}i.cancel=s.cancel,n.resolve(s)}),n},this.splitBtn.beforeClose=function(i){var n=new s.Deferred;if(t.isNullOrUndefined(i.event))n.resolve(i);else{var a={element:e.container,event:i.event,cancel:!1};e.trigger("beforeClose",a,function(s){t.Browser.isDevice&&i.event.target===e.modal&&(s.cancel=!0),s.cancel||e.onPopupClose(),i.cancel=s.cancel,n.resolve(s)})}return n}},a.prototype.onPopupClose=function(){this.unWireEvents(),this.destroyOtherComp(),this.container.style.width="",t.select(".e-split-preview",this.splitBtn.element).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.container.innerHTML="",t.removeClass([this.container],["e-color-picker","e-color-palette"]),t.Browser.isDevice&&this.modal&&(t.removeClass([document.body],"e-colorpicker-overflow"),this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},a.prototype.createPalette=function(){if(t.classList(this.container,["e-color-palette"],["e-color-picker"]),this.presetColors){var e=this.createElement("div",{className:"e-custom-palette"});this.appendElement(e);var i=Object.keys(this.presetColors);if(1===i.length)this.appendPalette(this.presetColors[i[0]],i[0],e);else for(var s=0,n=i.length;s10&&t.addClass([e],"e-palette-group")}else this.appendPalette(it.default,"default");"Palette"===this.mode&&!this.modeSwitcher&&this.noColor&&this.setNoColor();var a=parseInt(getComputedStyle(this.container).borderBottomWidth,10);this.container.style.width=t.formatUnit(this.container.children[0].offsetWidth+a+a),this.rgb=this.hexToRgb(this.roundValue(this.value)),this.hsv=this.rgbToHsv.apply(this,this.rgb)},a.prototype.firstPaletteFocus=function(){t.select("."+et,this.container.children[0])||t.selectAll(".e-palette",this.container)[0].focus()},a.prototype.appendPalette=function(e,t,i){var s=this.createElement("div",{className:"e-palette",attrs:{tabindex:"0"}});i?i.appendChild(s):this.appendElement(s);for(var n,a,r,l=0,o=e.length;l100?100:this.hsv[1],this.hsv[2]=this.hsv[2]>100?100:this.hsv[2],this.setHandlerPosition()},a.prototype.convertToOtherFormat=function(e){void 0===e&&(e=!1);var t=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,t,s,e)},a.prototype.updateInput=function(i){var s=this.getWrapper();s.classList.contains(Xe)||(s.classList.contains(je)||e.Input.setValue(i.substr(0,7),t.select(".e-hex",this.container)),s.classList.contains(_e)||(this.isRgb?this.updateValue(this.rgb,!1):this.updateValue(this.hsv,!1)))},a.prototype.updatePreview=function(e){this.enableOpacity&&this.updateOpacitySliderBg(),t.select(".e-tip-transparent",this.tooltipEle).style.backgroundColor=e,t.select("."+Je+" .e-current",this.container).style.backgroundColor=e,t.select("."+Je+" .e-previous",this.container).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value))},a.prototype.getDragHandler=function(){return t.select(".e-handler",this.container)},a.prototype.removeTileSelection=function(){[].slice.call(t.selectAll("."+et,this.container.children[0])).forEach(function(e){e.classList.remove(et),e.setAttribute("aria-selected","false")})},a.prototype.convertRgbToNumberArray=function(e){return e.slice(e.indexOf("(")+1,e.indexOf(")")).split(",").map(function(e,t){return 3!==t?parseInt(e,10):parseFloat(e)})},a.prototype.getValue=function(e,t){if(e||(e=this.value),t=t?t.toLowerCase():"hex","r"===e[0]){i=this.convertRgbToNumberArray(e);if("hex"===t||"hexa"===t){s=this.rgbToHex(i);return"hex"===t?s.slice(0,7):s}return"hsv"===t?this.convertToHsvString(this.rgbToHsv.apply(this,i.slice(0,3))):"hsva"===t?this.convertToHsvString(this.rgbToHsv.apply(this,i)):"null"}if("h"===e[0]){var i=this.hsvToRgb.apply(this,this.convertRgbToNumberArray(e));if("rgba"===t)return this.convertToRgbString(i);if("hex"===t||"hexa"===t){var s=this.rgbToHex(i);return"hex"===t?s.slice(0,7):s}return"rgb"===t?this.convertToRgbString(i.slice(0,3)):"null"}e=this.roundValue(e);var n=this.hexToRgb(e);return"rgb"!==t&&"hsv"!==t||(n=n.slice(0,3)),"rgba"===t||"rgb"===t?this.convertToRgbString(n):"hsva"===t||"hsv"===t?this.convertToHsvString(this.rgbToHsv.apply(this,n)):"hex"===t?e.slice(0,7):"a"===t?n[3].toString():"null"},a.prototype.toggle=function(){this.container.parentElement.classList.contains("e-popup-close")?this.splitBtn.toggle():this.closePopup(null)},a.prototype.getModuleName=function(){return"colorpicker"},a.prototype.getPersistData=function(){return this.addOnPersist(["value"])},a.prototype.wireEvents=function(){if(this.isPicker()){var e=this.getDragHandler();t.EventHandler.add(e,"keydown",this.pickerKeyDown,this),t.EventHandler.add(this.getHsvContainer(),"mousedown touchstart",this.handlerDown,this),(this.modeSwitcher||this.showButtons)&&this.addCtrlSwitchEvent(),t.EventHandler.add(t.select(".e-previous",this.container),"click",this.previewHandler,this)}else t.EventHandler.add(this.container,"click",this.paletteClickHandler,this),t.EventHandler.add(this.container,"keydown",this.paletteKeyDown,this)},a.prototype.formResetHandler=function(){this.value=this.initialInputValue,t.attributes(this.element,{value:this.initialInputValue})},a.prototype.addCtrlSwitchEvent=function(){var e=t.select("."+We,this.container);e&&t.EventHandler.add(e,"click",this.btnClickHandler,this)},a.prototype.pickerKeyDown=function(e){switch(e.keyCode){case 39:this.handlerDragPosition(1,this.enableRtl?-1:1,e);break;case 37:this.handlerDragPosition(1,this.enableRtl?1:-1,e);break;case 38:this.handlerDragPosition(2,1,e);break;case 40:this.handlerDragPosition(2,-1,e);break;case 13:e.preventDefault();var t=this.rgbToHex(this.rgb);this.enterKeyHandler(t,e)}},a.prototype.enterKeyHandler=function(e,t){this.triggerChangeEvent(e),this.inline||(this.closePopup(t),this.splitBtn.element.focus())},a.prototype.closePopup=function(e){var t=this,i={element:this.container,event:e,cancel:!1};this.trigger("beforeClose",i,function(e){e.cancel||(t.splitBtn.toggle(),t.onPopupClose())})},a.prototype.triggerChangeEvent=function(e){var t=e.slice(0,7);this.trigger("change",{currentValue:{hex:t,rgba:this.convertToRgbString(this.rgb)},previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:this.enableOpacity?e:t}),this.enableOpacity?this.setProperties({value:e},!0):this.setProperties({value:t},!0),this.element.value=t||"#000000"},a.prototype.handlerDragPosition=function(e,t,i){i.preventDefault(),this.hsv[e]+=t*(i.ctrlKey?1:3),this.hsv[e]<0&&(this.hsv[e]=0),this.updateHsv(),this.convertToOtherFormat(!0)},a.prototype.handlerDown=function(e){e.preventDefault(),"mousedown"===e.type?(this.clientX=Math.abs(e.pageX-pageXOffset),this.clientY=Math.abs(e.pageY-pageYOffset),this.setTooltipOffset(8)):(this.clientX=Math.abs(e.changedTouches[0].pageX-pageXOffset),this.clientY=Math.abs(e.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(),t.EventHandler.add(document,"mousemove touchmove",this.handlerMove,this),t.EventHandler.add(document,"mouseup touchend",this.handlerEnd,this)},a.prototype.handlerMove=function(e){"touchmove"!==e.type&&e.preventDefault();var i,s;"mousemove"===e.type?(i=Math.abs(e.pageX-pageXOffset),s=Math.abs(e.pageY-pageYOffset)):(i=Math.abs(e.changedTouches[0].pageX-pageXOffset),s=Math.abs(e.changedTouches[0].pageY-pageYOffset)),this.setHsv(i,s);var n=this.getDragHandler();parseInt(n.style.left,10),parseInt(n.style.top,10);this.updateHsv(),this.convertToOtherFormat(),this.getTooltipInst().refresh(n),this.tooltipEle.style.transform||(Math.abs(this.clientX-i)>8||Math.abs(this.clientY-s)>8)&&(t.select("."+Ke,this.container).style.cursor="pointer",n.style.transition="none",this.inline||(this.tooltipEle.style.zIndex=(parseInt(this.getPopupEle().style.zIndex,10)+1).toString()),this.tooltipEle.style.transform="rotate(45deg)",n.classList.add("e-hide-handler"))},a.prototype.setHsv=function(e,i){var s=t.select("."+Ke,this.container),n=s.getBoundingClientRect();e=this.enableRtl?e>n.right?0:Math.abs(e-n.right):e>n.left?Math.abs(e-n.left):0,i=i>n.top?Math.abs(i-n.top):0,this.hsv[2]=Math.round(10*Number(100*(s.offsetHeight-Math.max(0,Math.min(s.offsetHeight,i-s.offsetTop)))/s.offsetHeight))/10,this.hsv[1]=Math.round(10*Number(100*Math.max(0,Math.min(s.offsetWidth,e-s.offsetLeft))/s.offsetWidth))/10},a.prototype.handlerEnd=function(e){"touchend"!==e.type&&e.preventDefault(),t.EventHandler.remove(document,"mousemove touchmove",this.handlerMove),t.EventHandler.remove(document,"mouseup touchend",this.handlerEnd);var i=this.getDragHandler();t.select("."+Ke,this.container).style.cursor="",this.tooltipEle.style.transform&&(this.tooltipEle.style.transform="",i.classList.remove("e-hide-handler")),this.inline||this.showButtons||this.closePopup(e)},a.prototype.btnClickHandler=function(e){var i=e.target;t.closest(i,"."+Ye)?(e.stopPropagation(),this.switchToPalette()):(i.classList.contains("e-apply")||i.classList.contains("e-cancel"))&&this.ctrlBtnClick(i,e)},a.prototype.switchToPalette=function(){this.trigger("beforeModeSwitch",{element:this.container,mode:"Palette"}),this.unWireEvents(),this.destroyOtherComp(),t.detach(t.select(".e-slider-preview",this.container)),this.getWrapper().classList.contains(Xe)||t.remove(t.select("."+Ze,this.container)),t.detach(this.getHsvContainer()),this.createPalette(),this.firstPaletteFocus(),this.createInput(),this.refreshPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Palette"})},a.prototype.refreshPopupPos=function(){if(!this.inline){var e=this.getPopupEle();e.style.left=t.formatUnit(0+pageXOffset),e.style.top=t.formatUnit(0+pageYOffset),this.getPopupInst().refreshPosition(this.splitBtn.element.parentElement)}},a.prototype.formatSwitchHandler=function(e){e.target.parentElement;this.isRgb?(this.updateValue(this.hsv,!0,3,[360,100,100]),this.isRgb=!1):(this.updateValue(this.rgb,!0,2),this.isRgb=!0)},a.prototype.updateValue=function(e,i,s,n){for(var a,r=["e-rh-value","e-gs-value","e-bv-value"],l=0,o=r.length;l>16&255),s.push(i>>8&255),s.push(255&i),s.push(t),s},a.prototype.rgbToHsv=function(e,i,s,n){if(this.rgb&&!this.rgb.length)return[];e/=255,i/=255,s/=255;var a,r=Math.max(e,i,s),l=Math.min(e,i,s),o=r,h=r-l,d=0===r?0:h/r;if(r===l)a=0;else{switch(r){case e:a=(i-s)/h+(i=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},rt=["title","style","class"],lt=function(i){function s(e,t){var s=i.call(this,e,t)||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 nt(s,i),s.prototype.onPropertyChanged=function(i,s){for(var n=0,a=Object.keys(i);n-1)if("class"===s){var n=this.getInputValidClassList(this.htmlAttributes[s]);""!==n&&t.addClass([this.textboxWrapper.container],n.split(" "))}else if("style"===s){var a=this.textboxWrapper.container.getAttribute(s);a=t.isNullOrUndefined(a)?this.htmlAttributes[s]:a+this.htmlAttributes[s],this.textboxWrapper.container.setAttribute(s,a)}else this.textboxWrapper.container.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateHTMLAttrToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e