UNPKG

@syncfusion/ej2-buttons

Version:

A package of feature-rich Essential JS 2 components such as Button, CheckBox, RadioButton and Switch.

10 lines 113 kB
/*! * filename: ej2-buttons.min.js * version : 34.2.2 * Copyright Syncfusion Inc. 2001 - 2025. 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. */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase")):"function"==typeof define&&define.amd?define(["SyncfusionBase"],t):"object"==typeof exports?exports.SyncfusionButtons=t(require("SyncfusionBase")):e.SyncfusionButtons=t(e.SyncfusionBase)}(self,e=>(()=>{"use strict";var t={766:t=>{t.exports=e}},i={};function s(e){var n=i[e];if(void 0!==n)return n.exports;var o=i[e]={exports:{}};return t[e](o,o.exports,s),o.exports}s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{s.r(n),s.d(n,{BeforeChangeEventArgs:()=>d,Button:()=>C,CheckBox:()=>D,Chip:()=>oe,ChipList:()=>ne,Fab:()=>be,FabPosition:()=>m,IconPosition:()=>c,LinearDirection:()=>ve,RadialDirection:()=>ye,RadialSettings:()=>dt,RadioButton:()=>V,SmartPasteButton:()=>bt,SpeedDial:()=>ft,SpeedDialAnimationEffect:()=>ge,SpeedDialAnimationSettings:()=>ct,SpeedDialItem:()=>ut,SpeedDialMode:()=>me,Switch:()=>ee,buttonObserver:()=>v,classNames:()=>se,createCheckBox:()=>l,destroy:()=>o,getTextNode:()=>i,preRender:()=>r,rippleMouseHandler:()=>a,setHiddenInput:()=>p,wrapperInitialize:()=>t});var e=s(766);function t(t,i,s,n,o,r){var l=n;if(n.tagName===i){var a=(0,e.getValue)("ej2_instances",n);l=t("input",{attrs:{type:s}});for(var p=["change","cssClass","label","labelPosition","id"],h=0,c=n.attributes.length;h<c;h++)-1===p.indexOf(n.attributes[h].nodeName)&&l.setAttribute(n.attributes[h].nodeName,n.attributes[h].nodeValue);(0,e.attributes)(n,{class:o}),n.appendChild(l),n.classList.add(r),n.classList.remove(r),(0,e.setValue)("ej2_instances",a,l),"EJS-CHECKBOX"!==n.tagName&&(0,e.deleteObject)(n,"ej2_instances")}return l}function i(e){for(var t,i=e.childNodes,s=0;s<i.length;s++)if(3===(t=i[s]).nodeType)return t;return null}function o(t,i,s){"INPUT"===s?(i.parentNode.insertBefore(t.element,i),(0,e.detach)(i),t.element.checked=!1,["name","value","disabled"].forEach(function(e){t.element.removeAttribute(e)})):(["role","aria-checked","class"].forEach(function(e){i.removeAttribute(e)}),i.innerHTML="",t.element=i)}function r(i,s,n,o,r){o=t(i.createElement,s,"checkbox",o,n,r),i.element=o,"checkbox"!==i.element.getAttribute("type")&&i.element.setAttribute("type","checkbox"),i.element.id||(i.element.id=(0,e.getUniqueID)("e-"+r))}function l(t,i,s){void 0===i&&(i=!1),void 0===s&&(s={});var n=t("div",{className:"e-checkbox-wrapper e-css"});if(s.cssClass&&(0,e.addClass)([n],s.cssClass.split(" ")),s.enableRtl&&n.classList.add("e-rtl"),i){var o=t("span",{className:"e-ripple-container"});(0,e.rippleEffect)(o,{isCenterRipple:!0,duration:400}),n.appendChild(o)}var r=t("span",{className:"e-frame e-icons"});if(s.checked&&r.classList.add("e-check"),n.appendChild(r),s.label){var l=t("span",{className:"e-label"});s.disableHtmlEncode?l.textContent=s.label:l.innerHTML=s.label,n.appendChild(l)}return n}function a(e,t){if(t){var i=document.createEvent("MouseEvents");i.initEvent(e.type,!1,!0),t.dispatchEvent(i)}}function p(e,t){e.element.getAttribute("ejs-for")&&t.appendChild(e.createElement("input",{attrs:{name:e.name||e.element.name,value:"false",type:"hidden"}}))}var h,c,d=function(){},u=(h=function(e,t){return h=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])},h(e,t)},function(e,t){function i(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),f=function(e,t,i,s){var n,o=arguments.length,r=o<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=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};!function(e){e.Left="Left",e.Right="Right",e.Top="Top",e.Bottom="Bottom"}(c||(c={}));var m,v=new e.Observer,y="e-rtl",g="e-btn",b="e-primary",E="e-icon-btn",C=function(t){function s(e,i){var s=t.call(this,e,i)||this;return s.suppressToggleOnNextClick=!1,s}return u(s,t),s.prototype.preRender=function(){this.repeatPointerDownHandler=this.startRepeat.bind(this),this.repeatPointerUpHandler=this.stopRepeat.bind(this),this.repeatPointerLeaveHandler=this.stopRepeat.bind(this),this.repeatPointerCancelHandler=this.stopRepeat.bind(this),this.repeatKeyDownHandler=this.onRepeatKeyDown.bind(this),this.repeatKeyUpHandler=this.stopRepeat.bind(this),this.repeatBlurHandler=this.stopRepeat.bind(this),this.btnClickHandler=this.onClickToggle.bind(this)},s.prototype.render=function(){this.initialize(),this.removeRippleEffect=(0,e.rippleEffect)(this.element,{selector:"."+g}),this.observeDomAttributeChanges(),this.renderComplete()},s.prototype.observeDomAttributeChanges=function(){var e=this;this.mutationObserver=new MutationObserver(function(t){var i=e.element.hasAttribute("disabled");i!==e.disabled&&(e.disabled=i)}),this.mutationObserver.observe(this.element,{attributes:!0,attributeFilter:["disabled"],subtree:!1})},s.prototype.initialize=function(){if(this.cssClass&&(0,e.addClass)([this.element],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.isPrimary&&this.element.classList.add(b),!(0,e.isBlazor)()||(0,e.isBlazor)()&&"progress-btn"!==this.getModuleName()){if(this.content){var t=this.enableHtmlSanitizer?e.SanitizeHtmlHelper.sanitize(this.content):this.content;this.element.innerHTML=t}this.setIconCss()}this.enableRtl&&this.element.classList.add(y),this.disabled?this.controlStatus(this.disabled):this.wireEvents()},s.prototype.controlStatus=function(e){this.element.disabled=e,e?this.element.classList.add("e-disabled"):this.element.classList.remove("e-disabled")},s.prototype.setIconCss=function(){if(this.iconCss){var e=this.createElement("span",{className:"e-btn-icon "+this.iconCss});this.element.textContent.trim()?(e.classList.add("e-icon-"+this.iconPosition.toLowerCase()),"Top"!==this.iconPosition&&"Bottom"!==this.iconPosition||this.element.classList.add("e-"+this.iconPosition.toLowerCase()+"-icon-btn")):this.element.classList.add(E);var t=this.element.childNodes[0];!t||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?this.element.appendChild(e):this.element.insertBefore(e,t)}},s.prototype.fireClick=function(e,t){this.disabled||(this.isToggle&&!0===t&&(this.suppressToggleOnNextClick=!0),this.element.click(),this.trigger("clicked",{originalEvent:e,isRepeat:t}))},s.prototype.startRepeat=function(e){var t=this;if(0===e.button){this.fireClick(e,!1);var i=this.repeatInterval>0?this.repeatInterval:100;0===this.repeatDelay?this.repeatIntervalTimer=setInterval(function(){t.fireClick(e,!0)},i):this.repeatDelayTimer=setTimeout(function(){t.repeatIntervalTimer=setInterval(function(){t.fireClick(e,!0)},i)},this.repeatDelay)}},s.prototype.stopRepeat=function(){clearTimeout(this.repeatDelayTimer),clearInterval(this.repeatIntervalTimer)},s.prototype.onRepeatKeyDown=function(e){var t=this;" "!==e.key&&"Enter"!==e.key||(e.repeat?0===this.repeatInterval&&this.fireClick(e,!0):(this.fireClick(e,!1),this.repeatInterval>0&&(this.repeatDelayTimer=setTimeout(function(){t.repeatIntervalTimer=setInterval(function(){t.fireClick(e,!0)},t.repeatInterval)},this.repeatDelay))))},s.prototype.wireEvents=function(){this.isToggle&&e.EventHandler.add(this.element,"click",this.btnClickHandler,this),this.enableRepeat&&this.wireRepeatEvents()},s.prototype.wireRepeatEvents=function(){e.EventHandler.add(this.element,"pointerdown",this.repeatPointerDownHandler,this),e.EventHandler.add(this.element,"pointerup",this.repeatPointerUpHandler,this),e.EventHandler.add(this.element,"pointerleave",this.repeatPointerLeaveHandler,this),e.EventHandler.add(this.element,"pointercancel",this.repeatPointerCancelHandler,this),e.EventHandler.add(this.element,"keydown",this.repeatKeyDownHandler,this),e.EventHandler.add(this.element,"keyup",this.repeatKeyUpHandler,this),e.EventHandler.add(this.element,"blur",this.repeatBlurHandler,this)},s.prototype.unwireRepeatEvents=function(){e.EventHandler.remove(this.element,"pointerdown",this.repeatPointerDownHandler),e.EventHandler.remove(this.element,"pointerup",this.repeatPointerUpHandler),e.EventHandler.remove(this.element,"pointerleave",this.repeatPointerLeaveHandler),e.EventHandler.remove(this.element,"pointercancel",this.repeatPointerCancelHandler),e.EventHandler.remove(this.element,"keydown",this.repeatKeyDownHandler),e.EventHandler.remove(this.element,"keyup",this.repeatKeyUpHandler),e.EventHandler.remove(this.element,"blur",this.repeatBlurHandler),this.stopRepeat()},s.prototype.unWireEvents=function(){this.isToggle&&e.EventHandler.remove(this.element,"click",this.btnClickHandler),this.enableRepeat&&this.unwireRepeatEvents()},s.prototype.onClickToggle=function(e){!0!==e&&(this.suppressToggleOnNextClick?this.suppressToggleOnNextClick=!1:this.element.classList.contains("e-active")?this.element.classList.remove("e-active"):this.element.classList.add("e-active"))},s.prototype.destroy=function(){this.stopRepeat();var i=[b,y,E,"e-success","e-info","e-danger","e-warning","e-flat","e-outline","e-small","e-bigger","e-active","e-round","e-top-icon-btn","e-bottom-icon-btn","e-disabled"];this.cssClass&&(i=i.concat(this.cssClass.split(/\s+/).filter(function(e){return e.length>0}))),t.prototype.destroy.call(this),(0,e.removeClass)([this.element],i),this.element.getAttribute("class")||this.element.removeAttribute("class"),this.disabled&&this.element.removeAttribute("disabled"),this.content&&(this.element.textContent="");var s=this.element.querySelector("span.e-btn-icon");s&&(0,e.detach)(s),this.unWireEvents(),this.mutationObserver&&this.mutationObserver.disconnect(),e.isRippleEnabled&&this.removeRippleEffect()},s.prototype.getModuleName=function(){return"btn"},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.Inject=function(){},s.prototype.onPropertyChanged=function(t,s){for(var n=this.element.querySelector("span.e-btn-icon"),o=0,r=Object.keys(t);o<r.length;o++){switch(r[o]){case"isPrimary":t.isPrimary?this.element.classList.add(b):this.element.classList.remove(b);break;case"disabled":t.disabled&&this.stopRepeat(),this.controlStatus(t.disabled);break;case"iconCss":(n=this.element.querySelector("span.e-btn-icon"))?t.iconCss?(n.className="e-btn-icon "+t.iconCss,this.element.textContent.trim()&&("Left"===this.iconPosition?n.classList.add("e-icon-left"):n.classList.add("e-icon-right"))):(0,e.detach)(n):this.setIconCss();break;case"iconPosition":(0,e.removeClass)([this.element],["e-top-icon-btn","e-bottom-icon-btn"]),(n=this.element.querySelector("span.e-btn-icon"))&&(0,e.detach)(n),this.setIconCss();break;case"cssClass":s.cssClass&&(0,e.removeClass)([this.element],s.cssClass.split(/\s+/).filter(function(e){return e.length>0})),t.cssClass&&(0,e.addClass)([this.element],t.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":t.enableRtl?this.element.classList.add(y):this.element.classList.remove(y);break;case"content":i(this.element)||this.element.classList.remove(E),(!(0,e.isBlazor)()||(0,e.isBlazor)()&&!this.isServerRendered&&"progress-btn"!==this.getModuleName())&&(this.enableHtmlSanitizer&&(t.content=e.SanitizeHtmlHelper.sanitize(t.content)),this.element.innerHTML=t.content,this.setIconCss());break;case"isToggle":t.isToggle?e.EventHandler.add(this.element,"click",this.btnClickHandler,this):(e.EventHandler.remove(this.element,"click",this.btnClickHandler),(0,e.removeClass)([this.element],["e-active"]));break;case"enableRepeat":t.enableRepeat?this.wireRepeatEvents():this.unwireRepeatEvents()}}},s.prototype.click=function(){this.element.click()},s.prototype.focusIn=function(){this.element.focus()},f([(0,e.Property)("Left")],s.prototype,"iconPosition",void 0),f([(0,e.Property)("")],s.prototype,"iconCss",void 0),f([(0,e.Property)(!1)],s.prototype,"disabled",void 0),f([(0,e.Property)(!1)],s.prototype,"isPrimary",void 0),f([(0,e.Property)("")],s.prototype,"cssClass",void 0),f([(0,e.Property)("")],s.prototype,"content",void 0),f([(0,e.Property)(!1)],s.prototype,"isToggle",void 0),f([(0,e.Property)(!1)],s.prototype,"enableRepeat",void 0),f([(0,e.Property)(400)],s.prototype,"repeatDelay",void 0),f([(0,e.Property)(0)],s.prototype,"repeatInterval",void 0),f([(0,e.Property)()],s.prototype,"locale",void 0),f([(0,e.Property)(!0)],s.prototype,"enableHtmlSanitizer",void 0),f([(0,e.Event)()],s.prototype,"created",void 0),f([(0,e.Event)()],s.prototype,"clicked",void 0),s=f([e.NotifyPropertyChanges],s)}(e.Component),k=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])},e(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)}}(),H=function(e,t,i,s){var n,o=arguments.length,r=o<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=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},L="e-check",P="e-checkbox-disabled e-disabled",A="e-frame",w="e-stop",x="e-label",R="e-ripple-container",T="e-ripple-check",S="e-ripple-stop",O="e-rtl",I="e-checkbox-wrapper",N=["title","class","style","disabled","readonly","name","value","id","tabindex","aria-label","required"],D=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.isFocused=!1,s.isMouseClick=!1,s.clickTriggered=!1,s.validCheck=!0,s.type="checkbox",s}return k(s,i),s.prototype.changeState=function(t,i,s){var n=this.getWrapper(),o=null,r=null;n&&(r=n.getElementsByClassName(A)[0],e.isRippleEnabled&&(o=n.getElementsByClassName(R)[0])),"check"===t?(r&&(r.classList.remove(w),r.classList.add(L)),o&&(o.classList.remove(S),o.classList.add(T)),this.element.checked=!0,(this.element.required||(0,e.closest)(this.element,"form")&&(0,e.closest)(this.element,"form").classList.contains("e-formvalidator"))&&this.validCheck&&!i&&s?(this.element.checked=!1,this.validCheck=!1):(this.element.required||(0,e.closest)(this.element,"form")&&(0,e.closest)(this.element,"form").classList.contains("e-formvalidator"))&&(this.validCheck=!0)):"uncheck"===t?(r&&(0,e.removeClass)([r],[L,w]),o&&(0,e.removeClass)([o],[T,S]),this.element.checked=!1,(this.element.required||(0,e.closest)(this.element,"form")&&(0,e.closest)(this.element,"form").classList.contains("e-formvalidator"))&&this.validCheck&&!i&&s?(this.element.checked=!0,this.validCheck=!1):(this.element.required||(0,e.closest)(this.element,"form")&&(0,e.closest)(this.element,"form").classList.contains("e-formvalidator"))&&(this.validCheck=!0)):(r&&(r.classList.remove(L),r.classList.add(w)),o&&(o.classList.remove(T),o.classList.add(S)),this.element.indeterminate=!0,this.indeterminate=!0)},s.prototype.clickHandler=function(t){if("INPUT"===t.target.tagName&&this.clickTriggered)return this.changeState(this.checked?"check":"uncheck"),void(this.clickTriggered=!1);("SPAN"===t.target.tagName||"LABEL"===t.target.tagName||(0,e.closest)(t.target,".e-label"))&&(this.clickTriggered=!0),this.isMouseClick&&(this.focusOutHandler(),this.isMouseClick=!1),this.indeterminate?(this.changeState(this.checked?"check":"uncheck",!1,!0),this.indeterminate=!1,this.element.indeterminate=!1):this.checked?(this.changeState("uncheck",!1,!0),this.checked=!1):(this.changeState("check",!1,!0),this.checked=!0);var i={checked:this.updateVueArrayModel(!1),event:t};this.trigger("change",i),t.stopPropagation()},s.prototype.destroy=function(){var t=this,s=this.getWrapper();i.prototype.destroy.call(this),this.wrapper&&(s=this.wrapper,this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(this.getWrapper()&&s.parentNode&&s.parentNode.insertBefore(this.element,s),(0,e.detach)(s),this.element.checked=!1,this.indeterminate&&(this.element.indeterminate=!1),["name","value","disabled"].forEach(function(e){t.element.removeAttribute(e)})):(["class"].forEach(function(e){s.removeAttribute(e)}),s.innerHTML="",this.element=s,this.refreshing&&(["e-control","e-checkbox","e-lib"].forEach(function(e){t.element.classList.add(e)}),(0,e.setValue)("ej2_instances",[this],this.element))),"EJS-CHECKBOX"===this.element.tagName&&(0,e.deleteObject)(this.element,"ej2_instances"))},s.prototype.focusHandler=function(){this.isFocused=!0},s.prototype.focusOutHandler=function(){var e=this.getWrapper();e&&e.classList.remove("e-focus"),this.isFocused=!1},s.prototype.getModuleName=function(){return"checkbox"},s.prototype.getPersistData=function(){return this.addOnPersist(["checked","indeterminate"])},s.prototype.getWrapper=function(){return this.element&&this.element.parentElement?this.element.parentElement.parentElement:null},s.prototype.getLabel=function(){return this.element?this.element.parentElement:null},s.prototype.initialize=function(){(0,e.isNullOrUndefined)(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.name&&this.element.setAttribute("name",this.name),this.element.setAttribute("tabindex","0"),this.value&&(this.element.setAttribute("value",this.value),this.isVue&&"boolean"==typeof this.value&&!0===this.value&&this.setProperties({checked:!0},!0)),this.checked&&this.changeState("check",!0),this.indeterminate&&this.changeState(),this.disabled&&this.setDisabled()},s.prototype.initWrapper=function(){var t=this.element.parentElement;t.classList.contains(I)||(t=this.createElement("div",{className:I}),this.element.parentNode&&this.element.parentNode.insertBefore(t,this.element));var i=this.createElement("label",{attrs:{for:this.htmlAttributes.id?this.htmlAttributes.id:this.element.id}}),s=this.createElement("span",{className:"e-icons "+A});if(t.classList.add("e-wrapper"),this.enableRtl&&t.classList.add(O),this.cssClass&&(0,e.addClass)([t],this.cssClass.replace(/\s+/g," ").trim().split(" ")),t.appendChild(i),i.appendChild(this.element),p(this,i),i.appendChild(s),e.isRippleEnabled){var n=this.createElement("span",{className:R});"Before"===this.labelPosition?i.appendChild(n):i.insertBefore(n,s),(0,e.rippleEffect)(n,{duration:400,isCenterRipple:!0})}this.label&&this.setText(this.label)},s.prototype.keyUpHandler=function(){this.isFocused&&this.getWrapper().classList.add("e-focus")},s.prototype.labelMouseDownHandler=function(e){this.isMouseClick=!0,a(e,this.getWrapper().getElementsByClassName(R)[0])},s.prototype.labelMouseLeaveHandler=function(e){var t=this.getLabel().getElementsByClassName(R)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element").length-1;i>0;i--)t.removeChild(t.childNodes[i]);a(e,t)}},s.prototype.labelMouseUpHandler=function(e){this.isMouseClick=!0;var t=this.getWrapper().getElementsByClassName(R)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element"),s=0;s<i.length-1;s++)t.removeChild(t.childNodes[s]);a(e,t)}},s.prototype.onPropertyChanged=function(t,i){for(var s,n=this.getWrapper(),o=0,r=Object.keys(t);o<r.length;o++){switch(r[o]){case"checked":this.indeterminate=!1,this.element.indeterminate=!1,this.changeState(t.checked?"check":"uncheck");break;case"indeterminate":t.indeterminate?this.changeState():(this.element.indeterminate=!1,this.changeState(this.checked?"check":"uncheck"));break;case"disabled":t.disabled?(this.setDisabled(),this.wrapper=this.getWrapper(),this.unWireEvents()):(this.element.disabled=!1,(s=n.classList).remove.apply(s,P.split(" ")),n.setAttribute("aria-disabled","false"),this.wireEvents());break;case"cssClass":i.cssClass&&(0,e.removeClass)([n],i.cssClass.split(/\s+/).filter(function(e){return e.length>0})),t.cssClass&&(0,e.addClass)([n],t.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":t.enableRtl?n.classList.add(O):n.classList.remove(O);break;case"label":this.setText(t.label);break;case"labelPosition":var l=n.getElementsByClassName(x)[0],a=n.getElementsByTagName("label")[0];(0,e.detach)(l),"After"===t.labelPosition?a.appendChild(l):a.insertBefore(l,n.getElementsByClassName(A)[0]);break;case"name":this.element.setAttribute("name",t.name);break;case"value":if(this.isVue&&"object"==typeof t.value)break;this.element.setAttribute("value",t.value);break;case"htmlAttributes":this.updateHtmlAttributeToWrapper()}}},s.prototype.preRender=function(){var i=this.element;this.tagName=this.element.tagName,i=t(this.createElement,"EJS-CHECKBOX","checkbox",i,I,"checkbox"),this.element.hasAttribute("id")&&this.isAngular&&"EJS-CHECKBOX"===this.element.tagName&&(i.id=this.element.id,this.element.removeAttribute("id")),this.element=i,"checkbox"!==this.element.getAttribute("type")&&this.element.setAttribute("type","checkbox"),this.element.id||(this.element.id=(0,e.getUniqueID)("e-"+this.getModuleName()))},s.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents(),this.updateHtmlAttributeToWrapper(),this.updateVueArrayModel(!0),this.renderComplete(),this.wrapper=this.getWrapper()},s.prototype.setDisabled=function(){var e,t=this.getWrapper();this.element.disabled=!0,(e=t.classList).add.apply(e,P.split(" ")),t.setAttribute("aria-disabled","true")},s.prototype.setText=function(t){var i=this.getWrapper();if(i){var s=i.getElementsByClassName(x)[0];if(s)s.innerHTML=this.enableHtmlSanitizer?e.SanitizeHtmlHelper.sanitize(t):t;else{t=this.enableHtmlSanitizer?e.SanitizeHtmlHelper.sanitize(t):t,s=this.createElement("span",{className:x,innerHTML:t});var n=i.getElementsByTagName("label")[0];"Before"===this.labelPosition?n.insertBefore(s,i.getElementsByClassName(A)[0]):n.appendChild(s)}}},s.prototype.changeHandler=function(e){e.stopPropagation()},s.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,this.element.checked=this.initialCheckedValue},s.prototype.unWireEvents=function(){var t=this.wrapper;if(e.EventHandler.remove(this.element,"keyup",this.keyUpHandler),e.EventHandler.remove(this.element,"focus",this.focusHandler),e.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t){e.EventHandler.remove(t,"click",this.clickHandler);var i=t.getElementsByTagName("label")[0];i&&(e.EventHandler.remove(i,"mousedown",this.labelMouseDownHandler),e.EventHandler.remove(i,"mouseup",this.labelMouseUpHandler),e.EventHandler.remove(i,"mouseleave",this.labelMouseLeaveHandler))}var s=(0,e.closest)(this.element,"form");s&&e.EventHandler.remove(s,"reset",this.formResetHandler),"EJS-CHECKBOX"===this.tagName&&e.EventHandler.remove(this.element,"change",this.changeHandler)},s.prototype.wireEvents=function(){var t=this.getWrapper();e.EventHandler.add(t,"click",this.clickHandler,this),e.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),e.EventHandler.add(this.element,"focus",this.focusHandler,this),e.EventHandler.add(this.element,"focusout",this.focusOutHandler,this);var i=t.getElementsByTagName("label")[0];e.EventHandler.add(i,"mousedown",this.labelMouseDownHandler,this),e.EventHandler.add(i,"mouseup",this.labelMouseUpHandler,this),e.EventHandler.add(i,"mouseleave",this.labelMouseLeaveHandler,this);var s=(0,e.closest)(this.element,"form");s&&e.EventHandler.add(s,"reset",this.formResetHandler,this),"EJS-CHECKBOX"===this.tagName&&e.EventHandler.add(this.element,"change",this.changeHandler,this)},s.prototype.updateVueArrayModel=function(e){if(this.isVue&&"object"==typeof this.value){var t=this.element.value;if(t&&this.value){if(!e){var i=this.value.indexOf(t);return this.checked?i<0&&this.value.push(t):i>-1&&this.value.splice(i,1),this.value}for(var s=0;s<this.value.length;s++)t===this.value[s]&&(this.changeState("check"),this.setProperties({checked:!0},!0))}}return this.validCheck?this.element.checked:!this.element.checked},s.prototype.updateHtmlAttributeToWrapper=function(){if(!(0,e.isNullOrUndefined)(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t],n=this.getWrapper();if(N.indexOf(s)>-1)if("class"===s)(0,e.addClass)([n],this.htmlAttributes[""+s].split(" "));else if("title"===s)n.setAttribute(s,this.htmlAttributes[""+s]);else if("style"===s){this.getWrapper().getElementsByClassName(A)[0].setAttribute(s,this.htmlAttributes[""+s])}else"disabled"===s?("true"===this.htmlAttributes[""+s]&&this.setDisabled(),this.element.setAttribute(s,this.htmlAttributes[""+s])):this.element.setAttribute(s,this.htmlAttributes[""+s]);else n.setAttribute(s,this.htmlAttributes[""+s])}},s.prototype.click=function(){this.element.click()},s.prototype.focusIn=function(){this.element.focus()},H([(0,e.Event)()],s.prototype,"change",void 0),H([(0,e.Event)()],s.prototype,"created",void 0),H([(0,e.Property)(!1)],s.prototype,"checked",void 0),H([(0,e.Property)("")],s.prototype,"cssClass",void 0),H([(0,e.Property)(!1)],s.prototype,"disabled",void 0),H([(0,e.Property)(!1)],s.prototype,"indeterminate",void 0),H([(0,e.Property)("")],s.prototype,"label",void 0),H([(0,e.Property)("After")],s.prototype,"labelPosition",void 0),H([(0,e.Property)("")],s.prototype,"name",void 0),H([(0,e.Property)("")],s.prototype,"value",void 0),H([(0,e.Property)(!0)],s.prototype,"enableHtmlSanitizer",void 0),H([(0,e.Property)({})],s.prototype,"htmlAttributes",void 0),s=H([e.NotifyPropertyChanges],s)}(e.Component),M=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])},e(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)}}(),B=function(e,t,i,s){var n,o=arguments.length,r=o<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=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},j="e-label",U="e-ripple-container",F="e-rtl",W="e-radio-wrapper",_="e-disabled",q=["title","class","style","disabled","readonly","name","value","id"],V=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.isFocused=!1,s.type="radio",s}var n;return M(s,i),n=s,s.prototype.changeHandler=function(e){this.checked=!0,this.dataBind();var t=this.element.getAttribute("value");t=this.isVue&&t?this.element.value:this.value;var i=typeof this.value;this.isVue&&"boolean"===i&&(t="true"===t),this.trigger("change",{value:t,event:e}),this.isAngular&&e.stopPropagation()},s.prototype.updateChange=function(){for(var t,i,s=this.getRadioGroup(),o=0;o<s.length;o++)(t=s[o])!==this.element&&((i=(0,e.getInstance)(t,n)).checked=!1,"EJS-RADIOBUTTON"===this.tagName&&(i.angularValue=this.value))},s.prototype.destroy=function(){var t=this,s=this.wrapper;i.prototype.destroy.call(this),s&&(this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(s.parentNode&&s.parentNode.insertBefore(this.element,s),(0,e.detach)(s),this.element.checked=!1,["name","value","disabled"].forEach(function(e){t.element.removeAttribute(e)})):(["role","aria-checked","class"].forEach(function(e){s.removeAttribute(e)}),s.innerHTML="",this.element=this.wrapper,this.refreshing&&(["e-control","e-radio","e-lib"].forEach(function(e){t.element.classList.add(e)}),(0,e.setValue)("ej2_instances",[this],this.element))),this.mutationObserver&&this.mutationObserver.disconnect())},s.prototype.focusHandler=function(){this.isFocused=!0},s.prototype.focusOutHandler=function(){var e=this.getLabel();e&&e.classList.remove("e-focus")},s.prototype.getModuleName=function(){return"radio"},s.prototype.getSelectedValue=function(){for(var e,t=this.getRadioGroup(),i=0,s=t.length;i<s;i++)if((e=t[i]).checked)return e.value;return""},s.prototype.getRadioGroup=function(){return document.querySelectorAll('input.e-radio[name="'+this.element.getAttribute("name")+'"]')},s.prototype.getPersistData=function(){return this.addOnPersist(["checked"])},s.prototype.getWrapper=function(){return this.element.parentElement?this.element.parentElement:null},s.prototype.getLabel=function(){return this.element.nextElementSibling?this.element.nextElementSibling:null},s.prototype.initialize=function(){(0,e.isNullOrUndefined)(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.initWrapper(),this.updateHtmlAttribute(),this.name&&this.element.setAttribute("name",this.name);var t=this.element.getAttribute("value"),i=typeof this.value;this.isVue&&"boolean"===i&&(t="true"===t),(this.isVue?this.value&&"boolean"!==i&&!t:this.value)&&this.element.setAttribute("value",this.value),this.checked&&(this.element.checked=!0),this.disabled&&this.setDisabled()},s.prototype.initWrapper=function(){var t,i=this.element.parentElement;i.classList.contains(W)||(i=this.createElement("div",{className:W}),this.element.parentNode&&this.element.parentNode.insertBefore(i,this.element));var s=this.createElement("label",{attrs:{for:this.element.id}});i.appendChild(this.element),i.appendChild(s),e.isRippleEnabled&&(t=this.createElement("span",{className:U}),s.appendChild(t),(0,e.rippleEffect)(t,{duration:400,isCenterRipple:!0})),i.classList.add("e-wrapper"),this.enableRtl&&s.classList.add(F),this.cssClass&&(0,e.addClass)([i],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.label&&this.setText(this.label)},s.prototype.keyUpHandler=function(){this.isFocused&&this.getLabel().classList.add("e-focus")},s.prototype.labelMouseDownHandler=function(e){a(e,this.getLabel().getElementsByClassName(U)[0])},s.prototype.labelMouseLeaveHandler=function(e){var t=this.getLabel().getElementsByClassName(U)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element").length-1;i>0;i--)t.removeChild(t.childNodes[i]);a(e,t)}},s.prototype.labelMouseUpHandler=function(e){var t=this.getLabel().getElementsByClassName(U)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element").length-1;i>0;i--)t.removeChild(t.childNodes[i]);a(e,t)}},s.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,this.initialCheckedValue&&(0,e.attributes)(this.element,{checked:"true"})},s.prototype.onPropertyChanged=function(t,i){for(var s=this.getWrapper(),n=this.getLabel(),o=0,r=Object.keys(t);o<r.length;o++){switch(r[o]){case"checked":t.checked&&this.updateChange(),this.element.checked=t.checked;break;case"disabled":t.disabled?(this.setDisabled(),this.unWireEvents()):(this.element.disabled=!1,(0,e.removeClass)([s],[_]),this.wireEvents());break;case"cssClass":i.cssClass&&(0,e.removeClass)([s],i.cssClass.split(/\s+/).filter(function(e){return e.length>0})),t.cssClass&&(0,e.addClass)([s],t.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":t.enableRtl?n.classList.add(F):n.classList.remove(F);break;case"label":this.setText(t.label);break;case"labelPosition":"Before"===t.labelPosition?n.classList.add("e-right"):n.classList.remove("e-right");break;case"name":this.element.setAttribute("name",t.name);break;case"value":var l=typeof this.htmlAttributes.value;if(!(0,e.isNullOrUndefined)(this.htmlAttributes)&&(this.htmlAttributes.value||"boolean"===l&&!this.htmlAttributes.value))break;this.element.setAttribute("value",t.value);break;case"htmlAttributes":this.updateHtmlAttribute()}}},s.prototype.preRender=function(){var i=this.element;if(this.formElement=(0,e.closest)(this.element,"form"),this.tagName=this.element.tagName,i=t(this.createElement,"EJS-RADIOBUTTON","radio",i,W,"radio"),this.element=i,"radio"!==this.element.getAttribute("type")&&this.element.setAttribute("type","radio"),this.element.id||(this.element.id=(0,e.getUniqueID)("e-"+this.getModuleName())),"EJS-RADIOBUTTON"===this.tagName){var s=this.element.getAttribute("formcontrolname");s&&(this.setProperties({name:s},!0),this.element.setAttribute("name",s))}},s.prototype.render=function(){this.initialize(),this.disabled||this.wireEvents(),this.observeDomAttributeChanges(),this.renderComplete(),this.wrapper=this.getWrapper()},s.prototype.observeDomAttributeChanges=function(){var e=this;this.mutationObserver=new MutationObserver(function(t){var i=e.element.hasAttribute("disabled");i!==e.disabled&&(e.disabled=i)}),this.mutationObserver.observe(this.element,{attributes:!0,attributeFilter:["disabled"],subtree:!1})},s.prototype.setDisabled=function(){this.element.disabled=!0;var t=this.getWrapper();t&&(0,e.addClass)([t],[_])},s.prototype.setText=function(t){var i=this.getLabel(),s=i.getElementsByClassName(j)[0];s?s.textContent=t:(t=this.enableHtmlSanitizer?e.SanitizeHtmlHelper.sanitize(t):t,s=this.createElement("span",{className:j,innerHTML:t}),i.appendChild(s)),"Before"===this.labelPosition?this.getLabel().classList.add("e-right"):this.getLabel().classList.remove("e-right")},s.prototype.updateHtmlAttribute=function(){if(!(0,e.isNullOrUndefined)(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t],n=this.element.parentElement;q.indexOf(s)>-1?"class"===s?(0,e.addClass)([n],this.htmlAttributes[""+s].replace(/\s+/g," ").trim().split(" ")):"title"===s||"style"===s?n.setAttribute(s,this.htmlAttributes[""+s]):(this.element.setAttribute(s,this.htmlAttributes[""+s]),"id"===s&&this.getLabel().setAttribute("for",this.htmlAttributes[""+s])):n.setAttribute(s,this.htmlAttributes[""+s])}},s.prototype.unWireEvents=function(){var t=this.wrapper;if(e.EventHandler.remove(this.element,"change",this.changeHandler),e.EventHandler.remove(this.element,"focus",this.focusHandler),e.EventHandler.remove(this.element,"focusout",this.focusOutHandler),e.EventHandler.remove(this.element,"keyup",this.keyUpHandler),t){var i=t.getElementsByTagName("label")[0];i&&(e.EventHandler.remove(i,"mousedown",this.labelMouseDownHandler),e.EventHandler.remove(i,"mouseup",this.labelMouseUpHandler),e.EventHandler.remove(i,"mouseleave",this.labelMouseLeaveHandler))}this.formElement&&e.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},s.prototype.wireEvents=function(){var t=this.getLabel();e.EventHandler.add(this.element,"change",this.changeHandler,this),e.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),e.EventHandler.add(this.element,"focus",this.focusHandler,this),e.EventHandler.add(this.element,"focusout",this.focusOutHandler,this);var i=t.getElementsByClassName(j)[0];i&&(e.EventHandler.add(i,"mousedown",this.labelMouseDownHandler,this),e.EventHandler.add(i,"mouseup",this.labelMouseUpHandler,this),e.EventHandler.add(i,"mouseleave",this.labelMouseLeaveHandler,this)),this.formElement&&e.EventHandler.add(this.formElement,"reset",this.formResetHandler,this)},s.prototype.click=function(){this.element.click()},s.prototype.focusIn=function(){this.element.focus()},B([(0,e.Event)()],s.prototype,"change",void 0),B([(0,e.Event)()],s.prototype,"created",void 0),B([(0,e.Property)(!1)],s.prototype,"checked",void 0),B([(0,e.Property)("")],s.prototype,"cssClass",void 0),B([(0,e.Property)(!1)],s.prototype,"disabled",void 0),B([(0,e.Property)("")],s.prototype,"label",void 0),B([(0,e.Property)("After")],s.prototype,"labelPosition",void 0),B([(0,e.Property)("")],s.prototype,"name",void 0),B([(0,e.Property)("")],s.prototype,"value",void 0),B([(0,e.Property)(!0)],s.prototype,"enableHtmlSanitizer",void 0),B([(0,e.Property)({})],s.prototype,"htmlAttributes",void 0),s=n=B([e.NotifyPropertyChanges],s)}(e.Component),z=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])},e(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)}}(),K=function(e,t,i,s){var n,o=arguments.length,r=o<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=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},X="e-switch-disabled e-disabled",J="e-ripple-container",Y="e-ripple-check",G="e-rtl",Z="e-switch-wrapper",Q="e-switch-active",$=["title","class","style","disabled","readonly","name","value","aria-label","id","role","tabindex"],ee=function(t){function i(e,i){var s=t.call(this,e,i)||this;return s.isFocused=!1,s.isDrag=!1,s.isWireEvents=!1,s}return z(i,t),i.prototype.changeState=function(t){var i=null,s=this.getWrapper(),n=s.querySelector(".e-switch-inner"),o=s.querySelector(".e-switch-handle");e.isRippleEnabled&&(i=s.getElementsByClassName(J)[0]),t?((0,e.addClass)([n,o],Q),this.element.checked=!0,this.checked=!0,i&&(0,e.addClass)([i],[Y])):((0,e.removeClass)([n,o],Q),this.element.checked=!1,this.checked=!1,i&&(0,e.removeClass)([i],[Y]))},i.prototype.clickHandler=function(e){if(!e||!this.element.closest("label")||e.target===this.element){this.isDrag=!1,this.focusOutHandler();var t={event:e,cancel:!1,checked:this.checked};if(this.trigger("beforeChange",t),!t.cancel){this.changeState(!t.checked),this.element.focus();var i={checked:this.element.checked,event:e};this.trigger("change",i)}}},i.prototype.destroy=function(){var i=this;t.prototype.destroy.call(this),this.disabled||this.unWireEvents(),this.formElement&&e.EventHandler.remove(this.formElement,"reset",this.formResetHandler),this.getWrapper()&&o(this,this.getWrapper(),this.tagName),this.refreshing&&(["e-control","e-switch","e-lib"].forEach(function(e){i.element.classList.add(e)}),(0,e.setValue)("ej2_instances",[this],this.element))},i.prototype.focusHandler=function(){this.isFocused=!0},i.prototype.focusOutHandler=function(){this.getWrapper().classList.remove("e-focus")},i.prototype.getModuleName=function(){return"switch"},i.prototype.getPersistData=function(){return this.addOnPersist(["checked"])},i.prototype.getWrapper=function(){return this.element.parentElement?this.element.parentElement:null},i.prototype.initialize=function(){this.element.setAttribute("role","switch"),(0,e.isNullOrUndefined)(this.initialSwitchCheckedValue)&&(this.initialSwitchCheckedValue=this.checked),this.name&&this.element.setAttribute("name",this.name),this.value&&this.element.setAttribute("value",this.value),this.checked&&this.changeState(!0),this.disabled&&this.setDisabled(),(this.onLabel||this.offLabel)&&this.setLabel(this.onLabel,this.offLabel)},i.prototype.initWrapper=function(){var t=this.element.parentElement;t.classList.contains(Z)||(t=this.createElement("div",{className:Z}),this.element.parentNode.insertBefore(t,this.element));var i=this.createElement("span",{className:"e-switch-inner"}),s=this.createElement("span",{className:"e-switch-on"}),n=this.createElement("span",{className:"e-switch-off"}),o=this.createElement("span",{className:"e-switch-handle"});if(t.appendChild(this.element),p(this,t),i.appendChild(s),i.appendChild(n),t.appendChild(i),t.appendChild(o),e.isRippleEnabled){var r=this.createElement("span",{className:J});o.appendChild(r),(0,e.rippleEffect)(r,{duration:400,isCenterRipple:!0})}t.classList.add("e-wrapper"),this.enableRtl&&t.classList.add(G),this.cssClass&&(0,e.addClass)([t],this.cssClass.replace(/\s+/g," ").trim().split(" "))},i.prototype.onPropertyChanged=function(t,i){for(var s,n=this.getWrapper(),o=0,r=Object.keys(t);o<r.length;o++){switch(r[o]){case"checked":this.changeState(t.checked);break;case"disabled":t.disabled?(this.setDisabled(),this.unWireEvents(),this.isWireEvents=!1):(this.element.disabled=!1,(s=n.classList).remove.apply(s,X.split(" ")),n.setAttribute("aria-disabled","false"),this.isWireEvents||(this.wireEvents(),this.isWireEvents=!0));break;case"value":this.element.setAttribute("value",t.value);break;case"name":this.element.setAttribute("name",t.name);break;case"onLabel":case"offLabel":this.setLabel(t.onLabel,t.offLabel);break;case"enableRtl":t.enableRtl?n.classList.add(G):n.classList.remove(G);break;case"cssClass":i.cssClass&&(0,e.removeClass)([n],i.cssClass.split(/\s+/).filter(function(e){return e.length>0})),t.cssClass&&(0,e.addClass)([n],t.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"htmlAttributes":this.updateHtmlAttribute()}}},i.prototype.preRender=function(){var t=this.element;this.formElement=(0,e.closest)(this.element,"form"),this.tagName=this.element.tagName,r(this,"EJS-SWITCH",Z,t,this.getModuleName()),t&&t.hasAttribute("id")&&this.isAngular&&"EJS-SWITCH"===t.tagName&&(this.element.id=t.id,t.removeAttribute("id"))},i.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents(),this.formElement&&e.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),this.renderComplete(),this.updateHtmlAttribute()},i.prototype.rippleHandler=function(e){a(e,this.getWrapper().getElementsByClassName(J)[0]),"mousedown"===e.type&&e.currentTarget.classList.contains("e-switch-wrapper")&&1===e.which&&(this.isDrag=!0,this.isFocused=!1)},i.prototype.mouseLeaveHandler=function(e){var t=this.element.parentElement.getElementsByClassName(J)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element").length-1;i>0;i--)t.removeChild(t.childNodes[i]);a(e,t)}},i.prototype.rippleTouchHandler=function(e){var t=this.getWrapper().getElementsByClassName(J)[0];if(t){var i=document.createEvent("MouseEvents");i.initEvent(e,!1,!0),t.dispatchEvent(i)}},i.prototype.setDisabled=function(){var e,t=this.getWrapper();this.element.disabled=!0,(e=t.classList).add.apply(e,X.split(" ")),t.setAttribute("aria-disabled","true")},i.prototype.setLabel=function(e,t){var i=this.getWrapper();e&&(i.querySelector(".e-switch-on").textContent=e),t&&(i.querySelector(".e-switch-off").textContent=t)},i.prototype.updateHtmlAttribute=function(){if(!(0,e.isNullOrUndefined)(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t],n=this.getWrapper();$.indexOf(s)>-1?"class"===s?(0,e.addClass)([n],this.htmlAttributes[""+s].split(" ")):"title"===s||"style"===s?n.setAttribute(s,this.htmlAttributes[""+s]):"disabled"===s?("true"===this.htmlAttributes[""+s]&&this.setDisabled(),this.element.setAttribute(s,this.htmlAttributes[""+s])):this.element.setAttribute(s,this.htmlAttributes[""+s]):n.setAttribute(s,this.htmlAttributes[""+s])}},i.prototype.switchFocusHandler=function(e){this.isFocused&&this.getWrapper().classList.add("e-focus"),e&&"keyup"===e.type&&"Space"===e.code&&this.isAngular&&(this.clickHandler(e),e.stopPropagation(),e.preventDefault())},i.prototype.switchMouseUp=function(e){var t=0,i=0,s=0,n=0,o=e.target;"touchmove"===e.type&&(e.preventDefault(),s=e.changedTouches[0].clientX,t=e.changedTouches[0].clientY,n=this.bTouchX-s,i=this.bTouchY-t,Math.abs(n)<Math.abs(i)?(this.isDrag=!1,this.rippleTouchHandler("mouseup")):this.isDrag=!0),"touchstart"===e.type&&(this.bTouchX=e.changedTouches[0].clientX,this.bTouchY=e.changedTouches[0].clientY,this.isDrag=!0,this.rippleTouchHandler("mousedown")),this.isDrag&&("mouseup"===e.type&&o.className.indexOf("e-switch")<0||"touchend"===e.type)&&(n=this.bTouchX-e.changedTouches[0].clientX,i=this.bTouchY-e.changedTouches[0].clientY,Math.abs(n)>=Math.abs(i)&&(this.clickHandler(e),this.rippleTouchHandler("mouseup"),e.preventDefault()))},i.prototype.formResetHandler=function(){this.checked=this.initialSwitchCheckedValue,this.element.checked=this.initialSwitchCheckedValue},i.prototype.toggle=function(){this.clickHandler()},i.prototype.wireEvents=function(){var t=this.getWrapper();this.delegateMouseUpHandler=this.switchMouseUp.bind(this),this.delegateKeyUpHandler=this.switchFocusHandler.bind(this),e.EventHandler.add(t,"click",this.clickHandler,this),e.EventHandler.add(this.element,"focus",this.focusHandler,this),e.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),e.EventHandler.add(this.element,"mouseup",this.delegateMouseUpHandler,this),e.EventHandler.add(this.element,"keyup",this.delegateKeyUpHandler,this),e.EventHandler.add(t,"mousedown mouseup",this.rippleHandler,this),e.EventHandler.add(t,"mouseleave",this.mouseLeaveHandler,this),e.EventHandler.add(t,"touchstart touchmove touchend",this.switchMouseUp,this)},i.prototype.unWireEvents=function(){var t=this.getWrapper();t&&(e.EventHandler.remove(t,"click",this.clickHandler),e.EventHandler.remove(t,"mousedown mouseup",this.rippleHandler),e.EventHandler.remove(t,"mouseleave",this.mouseLeaveHandler),e.EventHandler.remove(t,"touchstart touchmove touchend",this.switchMouseUp)),this.element&&(e.EventHandler.remove(this.element,"focus",this.focusHandler),e.EventHandler.remove(this.element,"focusout",this.focusOutHandler),e.EventHandler.remove(this.element,"mouseup",this.delegateMouseUpHandler),e.EventHandler.remove(this.element,"keyup",this.delegateKeyUpHandler))},i.prototype.click=function(){this.element.click()},i.prototype.focusIn=function(){this.element.focus()},K([(0,e.Event)()],i.prototype,"beforeChange",void 0),K([(0,e.Event)()],i.prototype,"change",void 0),K([(0,e.Event)()],i.prototype,"created",void 0),K([(0,e.Property)(!1)],i.prototype,"checked",void 0),K([(0,e.Property)("")],i.prototype,"cssClass",void 0),K([(0,e.Property)(!1)],i.prototype,"disabled",void 0),K([(0,e.Property)("")],i.prototype,"name",void 0),K([(0,e.Property)("")],i.prototype,"onLabel",void 0),K([(0,e.Property)("")],i.prototype,"offLabel",void 0),K([(0,e.Property)("")],i.prototype,"value",void 0),K([(0,e.Property)({})],i.prototype,"htmlAttributes",void 0),i=K([e.NotifyPropertyChanges],i)}(e.Component),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])},e(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)}}(),ie=function(e,t,i,s){var n,o=arguments.length,r=o<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=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},se={chipSet:"e-chip-set",chip:"e-chip",avatar:"e-chip-avatar",text:"e-chip-text",icon:"e-chip-icon",delete:"e-chip-delete",deleteIcon:"e-dlt-btn",multiSelection:"e-multi-selection",singleSelection:"e-selection",active:"e-active",chipWrapper:"e-chip-avatar-wrap",iconWrapper:"e-chip-icon-wrap",focused:"e-focused",disabled:"e-disabled",rtl:"e-rtl",template:"e-chip-template",chipList:"e-chip-list",customIcon:"e-icons",chipDrag:"e-chip-drag",dragAndDrop:"e-drag-and-drop",dropRestricted:"e-error-treeview",cloneChip:"e-clone-chip",dragIndicator:"e-drag-indicator"},ne=function(t){function i(e,i){var s=t.call(this,e,i)||this;return s.multiSelectedChip=[],s}var s;return te(i,t),s=i,i.prototype.preRender=function(){},i.prototype.chipType=function(){return this.chips&&this.chips.length&&this.chips.length>0},i.prototype.render=function(){this.type=!(0,e.isNullOrUndefined)(this.chips)&&this.chips.length?"chipset":this.text||this.element.innerText?"chip":"chipset",this.setAttributes(),this.createChip(),this.setRtl(),this.select(this.selectedChips),this.wireEvent(!1),this.rippleFunction=(0,e.rippleEffect)(this.element,{selector:"."+se.chip}),this.renderComplete(),this.dragCollection=[],this.allowDragAndDrop&&this.enableDraggingChips()},i.prototype.enableDraggingChips=function(){var t,i=this;this.element.querySelectorAll("."+se.chip).forEach(function(s,n){i.dragObj=new e.Draggable(s,{preventDefault:!1,clone:!0,dragArea:i.dragArea,distance:8,helper:function(){return(t=s.cloneNode(!0)).classList.add(se.cloneChip),i.element.appendChild(t),t},dragStart:function(s){i.dragIndicator=i.createElement("div",{className:se.dragIndicator}),document.body.appendChild(i.dragIndicator);var o=i.find(s.element),r={cancel:!1,event:s.event,draggedItem:s.element,draggedItemData:o,dropTarget:null};i.trigger("dragStart",r,function(){(0,e.isNullOrUndefined)(r.cancel)&&(r.cancel=!1)}),r.cancel?i.dragObj.intDestroy(s.event):t.setAttribute("drag-indicator-index",n.toString())},drag:function(s){var n=i.find(s.element),o={event:s.event,draggedItem:s.element,draggedItemData:n,dropTarget:null};i.trigger("dragging",o);var r=t.querySelector("."+se.chipDrag);(0,e.isNullOrUndefined)(r)&&(r=i.createElement("span",{className:se.customIcon+" "+se.dragAndDrop+" "+se.chipDrag}),t.prepend(r)),i.allowExternalDragging(s,t,r)},dragStop:function(s){var n=i.find(s.element),o={cancel:!1,event:s.event,draggedItem:s.element,draggedItemData:n,dropTarget:s.target};i.trigger("dragStop",o,function(){(0,e.isNullOrUndefined)(o.cancel)&&(o.cancel=!1)}),o.cancel||i.allowExternalDrop(s,t),(0,e.isNullOrUndefined)(i.dragIndicator)||(0,e.remove)(i.dragIndicator),(0,e.isNullOrUndefined)(t)||t.remove()}}),-1===i.dragCollection.indexOf(i.dragObj)&&i.dragCollection.push(i.dragObj)})},i.prototype.checkInstance=function(t,i){var s=!(0,e.isNullOrUndefined)(t.target.closest("."+se.chipList))&&t.target.closest("."+se.chipList).id!==i.element.id;return s&&(this.updatedInstance=t.target.closest("."+se.chipList)),s},i.prototype.setIcons=function(e,t,i,s,n){var o=e.element.contains(i),r=i.closest(".e-droppable");!o&&!r||n?(t.classList.remove(se.dragAndDrop),t.classList.add(se.dropRestricted),s.style.display="none"):(t.classList.add(se.dragAndDrop),t.classList.remove(se.dropRestricted),r&&(s.style.display="none"))},i.prototype.allowExternalDragging=function(e,t,i){var s,n=null,o=1/0,r=-1,l=!1;if(this.checkInstance(e,this)){if(this.dragIndicator.style.display="none",(s=this.getCurrentInstance(e)).dragIndicator=this.dragIndicator,!s.allowDragAndDrop)return}else s=this;var a=s.dragIndicator;a.style.display="inline",l=this.dragAreaCheck(this.dragArea,e.target,l,i,a),this.setIcons(s,i,e.target,a,l),s