@syncfusion/ej2-buttons
Version:
A package of feature-rich Essential JS 2 components such as Button, CheckBox, RadioButton and Switch.
12 lines • 107 kB
JavaScript
/*!
* filename: ej2-buttons.min.js
* version : 32.1.21
* 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.
*/
this.ej=this.ej||{},this.ej.buttons=function(e,t){"use strict";function i(e,i,s,n,o,r){var l=n;if(n.tagName===i){var a=t.getValue("ej2_instances",n);l=e("input",{attrs:{type:s}});for(var p=["change","cssClass","label","labelPosition","id"],c=0,h=n.attributes.length;c<h;c++)-1===p.indexOf(n.attributes[c].nodeName)&&l.setAttribute(n.attributes[c].nodeName,n.attributes[c].nodeValue);t.attributes(n,{class:o}),n.appendChild(l),n.classList.add(r),n.classList.remove(r),t.setValue("ej2_instances",a,l),t.deleteObject(n,"ej2_instances")}return l}function s(e){for(var t,i=e.childNodes,s=0;s<i.length;s++)if(3===(t=i[s]).nodeType)return t;return null}function n(e,i,s){"INPUT"===s?(i.parentNode.insertBefore(e.element,i),t.detach(i),e.element.checked=!1,["name","value","disabled"].forEach(function(t){e.element.removeAttribute(t)})):(["role","aria-checked","class"].forEach(function(e){i.removeAttribute(e)}),i.innerHTML="",e.element=i)}function o(e,s,n,o,r){o=i(e.createElement,s,"checkbox",o,n,r),e.element=o,"checkbox"!==e.element.getAttribute("type")&&e.element.setAttribute("type","checkbox"),e.element.id||(e.element.id=t.getUniqueID("e-"+r))}function r(e,i,s){void 0===i&&(i=!1),void 0===s&&(s={});var n=e("div",{className:"e-checkbox-wrapper e-css"});if(s.cssClass&&t.addClass([n],s.cssClass.split(" ")),s.enableRtl&&n.classList.add("e-rtl"),i){var o=e("span",{className:"e-ripple-container"});t.rippleEffect(o,{isCenterRipple:!0,duration:400}),n.appendChild(o)}var r=e("span",{className:"e-frame e-icons"});if(s.checked&&r.classList.add("e-check"),n.appendChild(r),s.label){var l=e("span",{className:"e-label"});s.disableHtmlEncode?l.textContent=s.label:l.innerHTML=s.label,n.appendChild(l)}return n}function l(e,t){if(t){var i=document.createEvent("MouseEvents");i.initEvent(e.type,!1,!0),t.dispatchEvent(i)}}function a(e,t){e.element.getAttribute("ejs-for")&&t.appendChild(e.createElement("input",{attrs:{name:e.name||e.element.name,value:"false",type:"hidden"}}))}var p=function(){function e(){}return e}(),c=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)}}(),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};!function(e){e.Left="Left",e.Right="Right",e.Top="Top",e.Bottom="Bottom"}(e.IconPosition||(e.IconPosition={}));var d=new t.Observer,u={RTL:"e-rtl",BUTTON:"e-btn",PRIMARY:"e-primary",ICONBTN:"e-icon-btn"},f=function(e){function i(t,i){return e.call(this,t,i)||this}return c(i,e),i.prototype.preRender=function(){},i.prototype.render=function(){this.initialize(),this.removeRippleEffect=t.rippleEffect(this.element,{selector:"."+u.BUTTON}),this.renderComplete()},i.prototype.initialize=function(){if(this.cssClass&&t.addClass([this.element],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.isPrimary&&this.element.classList.add(u.PRIMARY),!t.isBlazor()||t.isBlazor()&&"progress-btn"!==this.getModuleName()){if(this.content){var e=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(this.content):this.content;this.element.innerHTML=e}this.setIconCss()}this.enableRtl&&this.element.classList.add(u.RTL),this.disabled?this.controlStatus(this.disabled):this.wireEvents()},i.prototype.controlStatus=function(e){this.element.disabled=e},i.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(u.ICONBTN);var t=this.element.childNodes[0];!t||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?this.element.appendChild(e):this.element.insertBefore(e,t)}},i.prototype.wireEvents=function(){this.isToggle&&t.EventHandler.add(this.element,"click",this.btnClickHandler,this)},i.prototype.unWireEvents=function(){this.isToggle&&t.EventHandler.remove(this.element,"click",this.btnClickHandler)},i.prototype.btnClickHandler=function(){this.element.classList.contains("e-active")?this.element.classList.remove("e-active"):this.element.classList.add("e-active")},i.prototype.destroy=function(){var i=[u.PRIMARY,u.RTL,u.ICONBTN,"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"];this.cssClass&&(i=i.concat(this.cssClass.split(/\s+/).filter(function(e){return e.length>0}))),e.prototype.destroy.call(this),t.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&&t.detach(s),this.unWireEvents(),t.isRippleEnabled&&this.removeRippleEffect()},i.prototype.getModuleName=function(){return"btn"},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.Inject=function(){},i.prototype.onPropertyChanged=function(e,i){for(var n=this.element.querySelector("span.e-btn-icon"),o=0,r=Object.keys(e);o<r.length;o++)switch(r[o]){case"isPrimary":e.isPrimary?this.element.classList.add(u.PRIMARY):this.element.classList.remove(u.PRIMARY);break;case"disabled":this.controlStatus(e.disabled);break;case"iconCss":(n=this.element.querySelector("span.e-btn-icon"))?e.iconCss?(n.className="e-btn-icon "+e.iconCss,this.element.textContent.trim()&&("Left"===this.iconPosition?n.classList.add("e-icon-left"):n.classList.add("e-icon-right"))):t.detach(n):this.setIconCss();break;case"iconPosition":t.removeClass([this.element],["e-top-icon-btn","e-bottom-icon-btn"]),(n=this.element.querySelector("span.e-btn-icon"))&&t.detach(n),this.setIconCss();break;case"cssClass":i.cssClass&&t.removeClass([this.element],i.cssClass.split(/\s+/).filter(function(e){return e.length>0})),e.cssClass&&t.addClass([this.element],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":e.enableRtl?this.element.classList.add(u.RTL):this.element.classList.remove(u.RTL);break;case"content":s(this.element)||this.element.classList.remove(u.ICONBTN),(!t.isBlazor()||t.isBlazor()&&!this.isServerRendered&&"progress-btn"!==this.getModuleName())&&(this.enableHtmlSanitizer&&(e.content=t.SanitizeHtmlHelper.sanitize(e.content)),this.element.innerHTML=e.content,this.setIconCss());break;case"isToggle":e.isToggle?t.EventHandler.add(this.element,"click",this.btnClickHandler,this):(t.EventHandler.remove(this.element,"click",this.btnClickHandler),t.removeClass([this.element],["e-active"]))}},i.prototype.click=function(){this.element.click()},i.prototype.focusIn=function(){this.element.focus()},h([t.Property("Left")],i.prototype,"iconPosition",void 0),h([t.Property("")],i.prototype,"iconCss",void 0),h([t.Property(!1)],i.prototype,"disabled",void 0),h([t.Property(!1)],i.prototype,"isPrimary",void 0),h([t.Property("")],i.prototype,"cssClass",void 0),h([t.Property("")],i.prototype,"content",void 0),h([t.Property(!1)],i.prototype,"isToggle",void 0),h([t.Property()],i.prototype,"locale",void 0),h([t.Property(!0)],i.prototype,"enableHtmlSanitizer",void 0),h([t.Event()],i.prototype,"created",void 0),i=h([t.NotifyPropertyChanges],i)}(t.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])})(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)}}(),v=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},y="e-frame",g="e-ripple-container",b="e-checkbox-wrapper",E=["title","class","style","disabled","readonly","name","value","id","tabindex","aria-label","required"],C=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.isFocused=!1,s.isMouseClick=!1,s.clickTriggered=!1,s.validCheck=!0,s.type="checkbox",s}return m(s,e),s.prototype.changeState=function(e,i,s){var n=this.getWrapper(),o=null,r=null;n&&(r=n.getElementsByClassName(y)[0],t.isRippleEnabled&&(o=n.getElementsByClassName(g)[0])),"check"===e?(r&&(r.classList.remove("e-stop"),r.classList.add("e-check")),o&&(o.classList.remove("e-ripple-stop"),o.classList.add("e-ripple-check")),this.element.checked=!0,(this.element.required||t.closest(this.element,"form")&&t.closest(this.element,"form").classList.contains("e-formvalidator"))&&this.validCheck&&!i&&s?(this.element.checked=!1,this.validCheck=!1):(this.element.required||t.closest(this.element,"form")&&t.closest(this.element,"form").classList.contains("e-formvalidator"))&&(this.validCheck=!0)):"uncheck"===e?(r&&t.removeClass([r],["e-check","e-stop"]),o&&t.removeClass([o],["e-ripple-check","e-ripple-stop"]),this.element.checked=!1,(this.element.required||t.closest(this.element,"form")&&t.closest(this.element,"form").classList.contains("e-formvalidator"))&&this.validCheck&&!i&&s?(this.element.checked=!0,this.validCheck=!1):(this.element.required||t.closest(this.element,"form")&&t.closest(this.element,"form").classList.contains("e-formvalidator"))&&(this.validCheck=!0)):(r&&(r.classList.remove("e-check"),r.classList.add("e-stop")),o&&(o.classList.remove("e-ripple-check"),o.classList.add("e-ripple-stop")),this.element.indeterminate=!0,this.indeterminate=!0)},s.prototype.clickHandler=function(e){if("INPUT"===e.target.tagName&&this.clickTriggered)return this.changeState(this.checked?"check":"uncheck"),void(this.clickTriggered=!1);("SPAN"===e.target.tagName||"LABEL"===e.target.tagName||t.closest(e.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:e};this.trigger("change",i),e.stopPropagation()},s.prototype.destroy=function(){var i=this,s=this.getWrapper();e.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),t.detach(s),this.element.checked=!1,this.indeterminate&&(this.element.indeterminate=!1),["name","value","disabled"].forEach(function(e){i.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){i.element.classList.add(e)}),t.setValue("ej2_instances",[this],this.element))))},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(){t.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 e=this.element.parentElement;e.classList.contains(b)||(e=this.createElement("div",{className:b}),this.element.parentNode&&this.element.parentNode.insertBefore(e,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 "+y});if(e.classList.add("e-wrapper"),this.enableRtl&&e.classList.add("e-rtl"),this.cssClass&&t.addClass([e],this.cssClass.replace(/\s+/g," ").trim().split(" ")),e.appendChild(i),i.appendChild(this.element),a(this,i),i.appendChild(s),t.isRippleEnabled){var n=this.createElement("span",{className:g});"Before"===this.labelPosition?i.appendChild(n):i.insertBefore(n,s),t.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,l(e,this.getWrapper().getElementsByClassName(g)[0])},s.prototype.labelMouseLeaveHandler=function(e){var t=this.getLabel().getElementsByClassName(g)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element").length-1;i>0;i--)t.removeChild(t.childNodes[i]);l(e,t)}},s.prototype.labelMouseUpHandler=function(e){this.isMouseClick=!0;var t=this.getWrapper().getElementsByClassName(g)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element"),s=0;s<i.length-1;s++)t.removeChild(t.childNodes[s]);l(e,t)}},s.prototype.onPropertyChanged=function(e,i){for(var s=this.getWrapper(),n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"checked":this.indeterminate=!1,this.element.indeterminate=!1,this.changeState(e.checked?"check":"uncheck");break;case"indeterminate":e.indeterminate?this.changeState():(this.element.indeterminate=!1,this.changeState(this.checked?"check":"uncheck"));break;case"disabled":e.disabled?(this.setDisabled(),this.wrapper=this.getWrapper(),this.unWireEvents()):(this.element.disabled=!1,s.classList.remove("e-checkbox-disabled"),s.setAttribute("aria-disabled","false"),this.wireEvents());break;case"cssClass":i.cssClass&&t.removeClass([s],i.cssClass.split(/\s+/).filter(function(e){return e.length>0})),e.cssClass&&t.addClass([s],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":e.enableRtl?s.classList.add("e-rtl"):s.classList.remove("e-rtl");break;case"label":this.setText(e.label);break;case"labelPosition":var r=s.getElementsByClassName("e-label")[0],l=s.getElementsByTagName("label")[0];t.detach(r),"After"===e.labelPosition?l.appendChild(r):l.insertBefore(r,s.getElementsByClassName(y)[0]);break;case"name":this.element.setAttribute("name",e.name);break;case"value":if(this.isVue&&"object"==typeof e.value)break;this.element.setAttribute("value",e.value);break;case"htmlAttributes":this.updateHtmlAttributeToWrapper()}},s.prototype.preRender=function(){var e=this.element;this.tagName=this.element.tagName,e=i(this.createElement,"EJS-CHECKBOX","checkbox",e,b,"checkbox"),this.element.hasAttribute("id")&&this.isAngular&&"EJS-CHECKBOX"===this.element.tagName&&(e.id=this.element.id,this.element.removeAttribute("id")),this.element=e,"checkbox"!==this.element.getAttribute("type")&&this.element.setAttribute("type","checkbox"),this.element.id||(this.element.id=t.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=this.getWrapper();this.element.disabled=!0,e.classList.add("e-checkbox-disabled"),e.setAttribute("aria-disabled","true")},s.prototype.setText=function(e){var i=this.getWrapper();if(i){var s=i.getElementsByClassName("e-label")[0];if(s)s.innerHTML=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e):e;else{e=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e):e,s=this.createElement("span",{className:"e-label",innerHTML:e});var n=i.getElementsByTagName("label")[0];"Before"===this.labelPosition?n.insertBefore(s,i.getElementsByClassName(y)[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 e=this.wrapper;if(t.EventHandler.remove(this.element,"keyup",this.keyUpHandler),t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),e){t.EventHandler.remove(e,"click",this.clickHandler);var i=e.getElementsByTagName("label")[0];i&&(t.EventHandler.remove(i,"mousedown",this.labelMouseDownHandler),t.EventHandler.remove(i,"mouseup",this.labelMouseUpHandler),t.EventHandler.remove(i,"mouseleave",this.labelMouseLeaveHandler))}var s=t.closest(this.element,"form");s&&t.EventHandler.remove(s,"reset",this.formResetHandler),"EJS-CHECKBOX"===this.tagName&&t.EventHandler.remove(this.element,"change",this.changeHandler)},s.prototype.wireEvents=function(){var e=this.getWrapper();t.EventHandler.add(e,"click",this.clickHandler,this),t.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this);var i=e.getElementsByTagName("label")[0];t.EventHandler.add(i,"mousedown",this.labelMouseDownHandler,this),t.EventHandler.add(i,"mouseup",this.labelMouseUpHandler,this),t.EventHandler.add(i,"mouseleave",this.labelMouseLeaveHandler,this);var s=t.closest(this.element,"form");s&&t.EventHandler.add(s,"reset",this.formResetHandler,this),"EJS-CHECKBOX"===this.tagName&&t.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(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e],n=this.getWrapper();E.indexOf(s)>-1?"class"===s?t.addClass([n],this.htmlAttributes[""+s].split(" ")):"title"===s?n.setAttribute(s,this.htmlAttributes[""+s]):"style"===s?this.getWrapper().getElementsByClassName(y)[0].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])}},s.prototype.click=function(){this.element.click()},s.prototype.focusIn=function(){this.element.focus()},v([t.Event()],s.prototype,"change",void 0),v([t.Event()],s.prototype,"created",void 0),v([t.Property(!1)],s.prototype,"checked",void 0),v([t.Property("")],s.prototype,"cssClass",void 0),v([t.Property(!1)],s.prototype,"disabled",void 0),v([t.Property(!1)],s.prototype,"indeterminate",void 0),v([t.Property("")],s.prototype,"label",void 0),v([t.Property("After")],s.prototype,"labelPosition",void 0),v([t.Property("")],s.prototype,"name",void 0),v([t.Property("")],s.prototype,"value",void 0),v([t.Property(!0)],s.prototype,"enableHtmlSanitizer",void 0),v([t.Property({})],s.prototype,"htmlAttributes",void 0),s=v([t.NotifyPropertyChanges],s)}(t.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])})(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)}}(),L=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},A="e-ripple-container",P=["title","class","style","disabled","readonly","name","value","id"],H=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.isFocused=!1,s.type="radio",s}k(s,e),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 e,i,s=this.getRadioGroup(),o=0;o<s.length;o++)(e=s[o])!==this.element&&((i=t.getInstance(e,n)).checked=!1,"EJS-RADIOBUTTON"===this.tagName&&(i.angularValue=this.value))},s.prototype.destroy=function(){var i=this,s=this.wrapper;e.prototype.destroy.call(this),s&&(this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(s.parentNode&&s.parentNode.insertBefore(this.element,s),t.detach(s),this.element.checked=!1,["name","value","disabled"].forEach(function(e){i.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){i.element.classList.add(e)}),t.setValue("ej2_instances",[this],this.element))))},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(){t.isNullOrUndefined(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.initWrapper(),this.updateHtmlAttribute(),this.name&&this.element.setAttribute("name",this.name);var e=this.element.getAttribute("value"),i=typeof this.value;this.isVue&&"boolean"===i&&(e="true"===e),(this.isVue?this.value&&"boolean"!==i&&!e:this.value)&&this.element.setAttribute("value",this.value),this.checked&&(this.element.checked=!0),this.disabled&&this.setDisabled()},s.prototype.initWrapper=function(){var e,i=this.element.parentElement;i.classList.contains("e-radio-wrapper")||(i=this.createElement("div",{className:"e-radio-wrapper"}),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),t.isRippleEnabled&&(e=this.createElement("span",{className:A}),s.appendChild(e),t.rippleEffect(e,{duration:400,isCenterRipple:!0})),i.classList.add("e-wrapper"),this.enableRtl&&s.classList.add("e-rtl"),this.cssClass&&t.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){l(e,this.getLabel().getElementsByClassName(A)[0])},s.prototype.labelMouseLeaveHandler=function(e){var t=this.getLabel().getElementsByClassName(A)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element").length-1;i>0;i--)t.removeChild(t.childNodes[i]);l(e,t)}},s.prototype.labelMouseUpHandler=function(e){var t=this.getLabel().getElementsByClassName(A)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element").length-1;i>0;i--)t.removeChild(t.childNodes[i]);l(e,t)}},s.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,this.initialCheckedValue&&t.attributes(this.element,{checked:"true"})},s.prototype.onPropertyChanged=function(e,i){for(var s=this.getWrapper(),n=this.getLabel(),o=0,r=Object.keys(e);o<r.length;o++)switch(r[o]){case"checked":e.checked&&this.updateChange(),this.element.checked=e.checked;break;case"disabled":e.disabled?(this.setDisabled(),this.unWireEvents()):(this.element.disabled=!1,this.wireEvents());break;case"cssClass":i.cssClass&&t.removeClass([s],i.cssClass.split(/\s+/).filter(function(e){return e.length>0})),e.cssClass&&t.addClass([s],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":e.enableRtl?n.classList.add("e-rtl"):n.classList.remove("e-rtl");break;case"label":this.setText(e.label);break;case"labelPosition":"Before"===e.labelPosition?n.classList.add("e-right"):n.classList.remove("e-right");break;case"name":this.element.setAttribute("name",e.name);break;case"value":var l=typeof this.htmlAttributes.value;if(!t.isNullOrUndefined(this.htmlAttributes)&&(this.htmlAttributes.value||"boolean"===l&&!this.htmlAttributes.value))break;this.element.setAttribute("value",e.value);break;case"htmlAttributes":this.updateHtmlAttribute()}},s.prototype.preRender=function(){var e=this.element;if(this.formElement=t.closest(this.element,"form"),this.tagName=this.element.tagName,e=i(this.createElement,"EJS-RADIOBUTTON","radio",e,"e-radio-wrapper","radio"),this.element=e,"radio"!==this.element.getAttribute("type")&&this.element.setAttribute("type","radio"),this.element.id||(this.element.id=t.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.renderComplete(),this.wrapper=this.getWrapper()},s.prototype.setDisabled=function(){this.element.disabled=!0},s.prototype.setText=function(e){var i=this.getLabel(),s=i.getElementsByClassName("e-label")[0];s?s.textContent=e:(e=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e):e,s=this.createElement("span",{className:"e-label",innerHTML:e}),i.appendChild(s)),"Before"===this.labelPosition?this.getLabel().classList.add("e-right"):this.getLabel().classList.remove("e-right")},s.prototype.updateHtmlAttribute=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e],n=this.element.parentElement;P.indexOf(s)>-1?"class"===s?t.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]):n.setAttribute(s,this.htmlAttributes[""+s])}},s.prototype.unWireEvents=function(){var e=this.wrapper;if(t.EventHandler.remove(this.element,"change",this.changeHandler),t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t.EventHandler.remove(this.element,"keyup",this.keyUpHandler),e){var i=e.getElementsByTagName("label")[0];i&&(t.EventHandler.remove(i,"mousedown",this.labelMouseDownHandler),t.EventHandler.remove(i,"mouseup",this.labelMouseUpHandler),t.EventHandler.remove(i,"mouseleave",this.labelMouseLeaveHandler))}this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},s.prototype.wireEvents=function(){var e=this.getLabel();t.EventHandler.add(this.element,"change",this.changeHandler,this),t.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this);var i=e.getElementsByClassName("e-label")[0];i&&(t.EventHandler.add(i,"mousedown",this.labelMouseDownHandler,this),t.EventHandler.add(i,"mouseup",this.labelMouseUpHandler,this),t.EventHandler.add(i,"mouseleave",this.labelMouseLeaveHandler,this)),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this)},s.prototype.click=function(){this.element.click()},s.prototype.focusIn=function(){this.element.focus()};var n;return L([t.Event()],s.prototype,"change",void 0),L([t.Event()],s.prototype,"created",void 0),L([t.Property(!1)],s.prototype,"checked",void 0),L([t.Property("")],s.prototype,"cssClass",void 0),L([t.Property(!1)],s.prototype,"disabled",void 0),L([t.Property("")],s.prototype,"label",void 0),L([t.Property("After")],s.prototype,"labelPosition",void 0),L([t.Property("")],s.prototype,"name",void 0),L([t.Property("")],s.prototype,"value",void 0),L([t.Property(!0)],s.prototype,"enableHtmlSanitizer",void 0),L([t.Property({})],s.prototype,"htmlAttributes",void 0),s=n=L([t.NotifyPropertyChanges],s)}(t.Component),w=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)}}(),R=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-ripple-container",T=["title","class","style","disabled","readonly","name","value","aria-label","id","role","tabindex"],S=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.isFocused=!1,s.isDrag=!1,s.isWireEvents=!1,s}return w(i,e),i.prototype.changeState=function(e){var i=null,s=this.getWrapper(),n=s.querySelector(".e-switch-inner"),o=s.querySelector(".e-switch-handle");t.isRippleEnabled&&(i=s.getElementsByClassName(x)[0]),e?(t.addClass([n,o],"e-switch-active"),this.element.checked=!0,this.checked=!0,i&&t.addClass([i],["e-ripple-check"])):(t.removeClass([n,o],"e-switch-active"),this.element.checked=!1,this.checked=!1,i&&t.removeClass([i],["e-ripple-check"]))},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;e.prototype.destroy.call(this),this.disabled||this.unWireEvents(),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler),this.getWrapper()&&n(this,this.getWrapper(),this.tagName),this.refreshing&&(["e-control","e-switch","e-lib"].forEach(function(e){i.element.classList.add(e)}),t.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"),t.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 e=this.element.parentElement;e.classList.contains("e-switch-wrapper")||(e=this.createElement("div",{className:"e-switch-wrapper"}),this.element.parentNode.insertBefore(e,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(e.appendChild(this.element),a(this,e),i.appendChild(s),i.appendChild(n),e.appendChild(i),e.appendChild(o),t.isRippleEnabled){var r=this.createElement("span",{className:x});o.appendChild(r),t.rippleEffect(r,{duration:400,isCenterRipple:!0})}e.classList.add("e-wrapper"),this.enableRtl&&e.classList.add("e-rtl"),this.cssClass&&t.addClass([e],this.cssClass.replace(/\s+/g," ").trim().split(" "))},i.prototype.onPropertyChanged=function(e,i){for(var s=this.getWrapper(),n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"checked":this.changeState(e.checked);break;case"disabled":e.disabled?(this.setDisabled(),this.unWireEvents(),this.isWireEvents=!1):(this.element.disabled=!1,s.classList.remove("e-switch-disabled"),s.setAttribute("aria-disabled","false"),this.isWireEvents||(this.wireEvents(),this.isWireEvents=!0));break;case"value":this.element.setAttribute("value",e.value);break;case"name":this.element.setAttribute("name",e.name);break;case"onLabel":case"offLabel":this.setLabel(e.onLabel,e.offLabel);break;case"enableRtl":e.enableRtl?s.classList.add("e-rtl"):s.classList.remove("e-rtl");break;case"cssClass":i.cssClass&&t.removeClass([s],i.cssClass.split(/\s+/).filter(function(e){return e.length>0})),e.cssClass&&t.addClass([s],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"htmlAttributes":this.updateHtmlAttribute()}},i.prototype.preRender=function(){var e=this.element;this.formElement=t.closest(this.element,"form"),this.tagName=this.element.tagName,o(this,"EJS-SWITCH","e-switch-wrapper",e,this.getModuleName())},i.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents(),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),this.renderComplete(),this.updateHtmlAttribute()},i.prototype.rippleHandler=function(e){l(e,this.getWrapper().getElementsByClassName(x)[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(x)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element").length-1;i>0;i--)t.removeChild(t.childNodes[i]);l(e,t)}},i.prototype.rippleTouchHandler=function(e){var t=this.getWrapper().getElementsByClassName(x)[0];if(t){var i=document.createEvent("MouseEvents");i.initEvent(e,!1,!0),t.dispatchEvent(i)}},i.prototype.setDisabled=function(){var e=this.getWrapper();this.element.disabled=!0,e.classList.add("e-switch-disabled"),e.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(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e],n=this.getWrapper();T.indexOf(s)>-1?"class"===s?t.addClass([n],this.htmlAttributes[""+s].split(" ")):"title"===s?n.setAttribute(s,this.htmlAttributes[""+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 e=this.getWrapper();this.delegateMouseUpHandler=this.switchMouseUp.bind(this),this.delegateKeyUpHandler=this.switchFocusHandler.bind(this),t.EventHandler.add(e,"click",this.clickHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),t.EventHandler.add(this.element,"mouseup",this.delegateMouseUpHandler,this),t.EventHandler.add(this.element,"keyup",this.delegateKeyUpHandler,this),t.EventHandler.add(e,"mousedown mouseup",this.rippleHandler,this),t.EventHandler.add(e,"mouseleave",this.mouseLeaveHandler,this),t.EventHandler.add(e,"touchstart touchmove touchend",this.switchMouseUp,this)},i.prototype.unWireEvents=function(){var e=this.getWrapper();e&&(t.EventHandler.remove(e,"click",this.clickHandler),t.EventHandler.remove(e,"mousedown mouseup",this.rippleHandler),t.EventHandler.remove(e,"mouseleave",this.mouseLeaveHandler),t.EventHandler.remove(e,"touchstart touchmove touchend",this.switchMouseUp)),this.element&&(t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t.EventHandler.remove(this.element,"mouseup",this.delegateMouseUpHandler),t.EventHandler.remove(this.element,"keyup",this.delegateKeyUpHandler))},i.prototype.click=function(){this.element.click()},i.prototype.focusIn=function(){this.element.focus()},R([t.Event()],i.prototype,"beforeChange",void 0),R([t.Event()],i.prototype,"change",void 0),R([t.Event()],i.prototype,"created",void 0),R([t.Property(!1)],i.prototype,"checked",void 0),R([t.Property("")],i.prototype,"cssClass",void 0),R([t.Property(!1)],i.prototype,"disabled",void 0),R([t.Property("")],i.prototype,"name",void 0),R([t.Property("")],i.prototype,"onLabel",void 0),R([t.Property("")],i.prototype,"offLabel",void 0),R([t.Property("")],i.prototype,"value",void 0),R([t.Property({})],i.prototype,"htmlAttributes",void 0),i=R([t.NotifyPropertyChanges],i)}(t.Component),O=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)}}(),N=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},I={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"},M=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.multiSelectedChip=[],s}O(i,e),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=!t.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=t.rippleEffect(this.element,{selector:"."+I.chip}),this.renderComplete(),this.dragCollection=[],this.allowDragAndDrop&&this.enableDraggingChips()},i.prototype.enableDraggingChips=function(){var e,i=this;this.element.querySelectorAll("."+I.chip).forEach(function(s,n){i.dragObj=new t.Draggable(s,{preventDefault:!1,clone:!0,dragArea:i.dragArea,distance:8,helper:function(){return(e=s.cloneNode(!0)).classList.add(I.cloneChip),i.element.appendChild(e),e},dragStart:function(s){i.dragIndicator=i.createElement("div",{className:I.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(){t.isNullOrUndefined(r.cancel)&&(r.cancel=!1)}),r.cancel?i.dragObj.intDestroy(s.event):e.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=e.querySelector("."+I.chipDrag);t.isNullOrUndefined(r)&&(r=i.createElement("span",{className:I.customIcon+" "+I.dragAndDrop+" "+I.chipDrag}),e.prepend(r)),i.allowExternalDragging(s,e,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(){t.isNullOrUndefined(o.cancel)&&(o.cancel=!1)}),o.cancel||i.allowExternalDrop(s,e),t.isNullOrUndefined(i.dragIndicator)||t.remove(i.dragIndicator),t.isNullOrUndefined(e)||e.remove()}}),-1===i.dragCollection.indexOf(i.dragObj)&&i.dragCollection.push(i.dragObj)})},i.prototype.checkInstance=function(e,i){var s=!t.isNullOrUndefined(e.target.closest("."+I.chipList))&&e.target.closest("."+I.chipList).id!==i.element.id;return s&&(this.updatedInstance=e.target.closest("."+I.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(I.dragAndDrop),t.classList.add(I.dropRestricted),s.style.display="none"):(t.classList.add(I.dragAndDrop),t.classList.remove(I.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),s.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.element.appendChild(t);var p=t.getBoundingClientRect(),c=Array.from(s.element.querySelectorAll("."+I.chip));c.forEach(function(e,i){if(e!==t){var s=e.getBoundingClientRect(),l=Math.sqrt(Math.pow(p.left-s.left,2)+Math.pow(p.top-s.top,2));l<o&&(o=l,n=e,r=i)}}),-1===r&&(r=c.length);var h,d=this.getChipsDistance(s),u=t.getBoundingClientRect();(n||c.length>0)&&(h=(n||c[c.length-1]).getBoundingClientRect(),a.style.top=h.top+window.scrollY+"px",a.style.left=s.enableRtl?h.right+d+"px":h.left-d+window.scrollX+"px"),s.enableRtl?u.left<h.left-h.width/2&&u.top>h.top&&(a.style.left=h.left-d+window.scrollX+"px"):u.left>h.left+h.width/2&&u.top>h.top&&(a.style.left=h.left+h.width+d+window.scrollX+"px")},i.prototype.dragAreaCheck=function(e,i,s,n,o){if(t.isNullOrUndefined(e))return!1;var r="string"==typeof e,l=e instanceof HTMLElement,a=r?document.querySelector(e):e;return t.isNullOrUndefined(a)||!r&&!l||a.contains(i)||(s=!0,o.style.display="none",n.classList.add(I.dropRestricted),n.classList.remove(I.dragAndDrop)),s},i.prototype.getChipsDistance=function(e){if(e.chips.length<=1)return 4;var t=e.find(0).element.getBoundingClientRect(),i=e.find(1).element.getBoundingClientRect(),s=t.left;if(e.enableRtl){var n=i.right;return s<n?4:(s-n)/2}var o=t.width,r=i.left;return r<s+o?4:(r-(s+o))/2},i.prototype.getCurrentInstance=function(e){var i=e.target.closest("."+I.chipList);if(!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(i.ej2_instances))for(var n=0;n<i.ej2_instances.length;n++)if(i.ej2_instances[parseInt(n.toString(),10)]instanceof s)return i.ej2_instances[n];return null},i.prototype.allowExternalDrop=function(e,t){var i,s=parseInt(t.getAttribute("drag-indicator-index"),10),n=!1,o=!1;if(this.checkInstance(e,this)){if(o=!0,!(i=this.getCurrentInstance(e)).allowDragAndDrop)return}else i=this;var r=i.dragIndicator;if(r.style.display="inline",i.element.contains(e.target)&&!(n=this.dragAreaCheck(this.dragArea,e.target,n,t.querySelector("."+I.chipDrag),r))){for(var l=r.getBoundingClientRect(),a=Array.from(i.element.querySelectorAll("."+I.chip)),p=-1,c=!1,h=!1,d=!1,u=0;u<a.length;u++)if(a[u]!==t){var f=a[u].getBoundingClientRect();if(c=l.top<f.top+f.height/2,h=l.left<f.left+f.width/2,d=l.left>f.left+f.width/2,!i.enableRtl&&c&&h||i.enableRtl&&c&&d){p=u,u>s&&!o&&(p=u-1);break}}if(-1===p){for(var m=void 0,u=0;u<a.length;u++)if((f=a[u].getBoundingClientRect()).top>l.top||f.top===l.top&&f.left>l.left){m=u;break}p=m!==a.length?m:a.length}var v=Array.from(this.chips);o?this.dropChip(v,s,i,p,!0):p!==s&&this.dropChip(v,s,i,p,!1)}},i.prototype.dropChip=function(e,t,i,s,n){var o=e.splice(t,1)[0];if(n){var r=Array.from(i.chips);r.splice(s,0,o),i.chips=r}else e.splice(s,0,o),i.chips=e;this.chips=e,i.dataBind(),this.dataBind(),i.enableDraggingChips()},i.prototype.createChip=function(){this.innerText=this.element.innerText&&0!==this.element.innerText.length?this.element.innerText.trim():this.element.innerText,this.element.innerHTML="",this.chipCreation("chip"===this.type?[this.innerText?this.innerText:this.text]:this.chips)},i.prototype.setAttributes=function(){"chip"===this.type?(this.enabled&&(this.element.tabIndex=0),this.element.setAttribute("role","button")):(this.element.classList.add(I.chipSet),this.element.setAttribute("role","listbox"),"Multiple"===this.selection?(this.element.classList.add(I.multiSelection),this.element.setAttribute("aria-multiselectable","true")):"Single"===this.selection?(this.element.classList.add(I.singleSelection),this.element.setAttribute("aria-multiselectable","false")):this.element.setAttribute("aria-multiselectable","false"))},i.prototype.setRtl=function(){this.element.classList[this.enableRtl?"add":"remove"](I.rtl)},i.prototype.renderTemplates=function(){this.isReact&&this.renderReactTemplates()},i.prototype.templateParser=function(e){if(e)try{return"function"!=typeof e&&document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(i){return t.compile(e)}},i.prototype.chipCreation=function(e){if(!t.isNullOrUndefined(e)){for(var i=[],s=[],n=0;n<e.length;n++){var o=this.getFieldValues(e[n]),r=o.htmlAttributes;s.push(r);var l=this.elementCreation(o),a=(I.chip+" "+(o.enabled?" ":I.disabled)+" "+(o.avatarIconCss||o.avatarText?I.chipWrapper:o.leadingIconCss?I.iconWrapper:" ")+" "+o.cssClass).split(" ").filter(function(e){return e});if(this.chipType()&&"chip"!==this.type){var p=this.createElement("DIV",{className:a.join(" "),attrs:{tabIndex:"0",role:"option","aria-label":o.text,"aria-selected":"false"}});if(this.enableDelete&&p.setAttribute("aria-keyshortcuts","Press delete or backspace key to delete"),o.value&&p.setAttribute("data-value",o.value.toString()),o.enabled?p.setAttribute("aria-disabled","false"):(p.removeAttribute("tabindex"),p.setAttribute("aria-disabled","true")),!t.isNullOrUndefined(s[n])&&s.length>n&&Object.keys(s[n]).length){var c=[];c=Object.keys(s[n]);for(var h=0;h<c.length;h++)p.setAttribute(c[h],s[n][c[h]])}t.append(l,p),i.push(p)}else i=l,t.addClass([this.element],a),this.element.setAttribute("aria-label",o.text),o.value&&this.element.setAttribute("data-value",o.value.toString())}t.append(i,this.element)}},i.prototype.getFieldValues=function(e){var t=!("false"===this.enabled.toString());return{text:"object"==typeof e?e.text?e.text.toString():this.text.toString():this.chipType()?e.toString():this.innerText?this.innerText:this.text.toString(),cssClass:"object"==typeof e&&e.cssClass?e.cssClass.toString():this.cssClass.toString(),leadingIconCss:"object"==typeof e&&e.leadingIconCss?e.leadingIconCss.toString():this.leadingIconCss.toString(),avatarIconCss:"object"==typeof e&&e.avatarIconCss?e.avatarIconCss.toString():this.avatarIconCss.toString(),avatarText:"object"==typeof e&&e.avatarText?e.avatarText.toString():this.avatarText.toString(),trailingIconCss:"object"==typeof e&&e.trailingIconCss?e.trailingIconCss.toString():this.trailingIconCss.toString(),enabled:"object"==typeof e&&void 0!==e.enabled?"false"!==e.enabled.toString():t,value:"object"==typeof e&&e.value?e.value.toString():null,leadingIconUrl:"object"==typeof e&&e.leadingIconUrl?e.leadingIconUrl.toString():this.leadingIconUrl,trailingIconUrl:"object"==typeof e&&e.trailingIconUrl?e.trailingIconUrl.toString():this.trailingIconUrl,htmlAttributes:"object"==typeof e&&e.htmlAttributes?e.htmlAttributes:this.htmlAttributes,template:"object"==typeof e&&e.template?e.template:null}},i.prototype.elementCreation=function(e){var i=[];if(e.avatarText||e.avatarIconCss){var s=(I.avatar+" "+e.avatarIconCss).trim(),n=this.createElement("span",{className:s});n.innerText=e.avatarText,i.push(n)}else if(e.leadingIconCss){var s=(I.icon+" "+e.leadingIconCss).trim(),o=this.createElement("span",{className:s});i.push(o)}else if(e.leadingIconUrl){s=(I.avatar+" image-url").trim();(o=this.createElement("span",{className:s})).style.backgroundImage="url("+e.leadingIconUrl+")",i.push(o)}var r=this.createElement("span",{className:I.text});if(r.innerText=e.text,i.push(r),e.template){var l=this.createElement("div",{className:I.template}),a=this.templateParser(e.template)(e,this,"template",this.element.id+"_template",!1);t.append(a,l),i.push(l),this.renderTemplates()}if(e.trailingIconCss||this.chipType()&&this.enableDelete){var s=(I.delete+" "+(e.trailingIconCss?e.trailingIconCss:I.deleteIcon)).trim(),p=this.createElement("span",{className:s});i.push(p)}else if(e.trailingIconUrl){var s="trailing-icon-url".trim(),c=this.createElement("span",{className:s});c.style.backgroundImage="url("+e.trailingIconUrl+")",i.push(c)}return i},i.prototype.find=function(e){var t={text:"",index:-1,element:this.element,data:""},i=e instanceof HTMLElement?e:this.element.querySelectorAll("."+I.chip)[e];if(i&&this.chipType()){t.index=Array.prototype.slice.call(this.element.querySelectorAll("."+I.chip)).indexOf(i);var s=this.chips[t.index];if("object"==typeof s&&null!==s){var n=s;void 0!==n.text&&(t.text=n.text.toString())}else void 0!==s&&(t.text=s.toString());t.data=s,t.element=i}return t},i.prototype.add=function(e){var t;if("chip"!==this.type){var i=e instanceof Array?e:[e];this.chips=(t=[].slice.call(this.chips)).concat.apply(t,i),this.chipCreation(i)}},i.prototype.select=function(e,t){this.onSelect(e,!1,t)},i.prototype.multiSelection=function(e){for(var t=this.element.querySelectorAll("."+I.chip),i=0;i<e.length;i++)if("string"==typeof e[i]){for(var s=0;s<t.length;s++)if(e[i]!==s&&e[i]===t[s].attributes[5].value){this.multiSelectedChip.push(s);break}}else this.multiSelectedChip.push(e[i])},i.prototype.onSelect=function(e,t,i){var s,n,o=null;if(this.chipType()&&"None"!==this.selection){if(t)for(var r=this.element.querySelectorAll("."+I.chip),l=0;l<r.length;l++)r[l].setAttribute("aria-selected","false"),r[l].classList.remove(I.active);for(var a=e instanceof Array?e:[e],l=0;l<a.length;l++){var p=a[l]instanceof HTMLElement?a[l]:this.element.querySelectorAll("."+I.chip)[a[l]];if("index"!==i)for(var c=0;c<this.chips.length;c++){n=this.element.querySelectorAll("."+I.chip)[c];var h=this.getFieldValues(this.chips[c]);"value"===i?null!==h.value&&(o=n.dataset.value):"text"===i&&(o=n.innerText),o===a[l].toString()&&(s=c,p=this.element.querySelectorAll("."+I.chip)[s])}p instanceof HTMLElement&&this.selectionHandler(p)}}},i.prototype.remove=function(e){var t=this;if(this.chipType()){var i=e instanceof Array?e:[e],s=[],n=this.element.querySelectorAll("."+I.chip);i.forEach(function(e){var t=e instanceof HTMLElement?e:n[e];t instanceof HTMLElement&&s.push(t)}),s.forEach(function(e){var i=t.element.querySelectorAll("."+I.chip),s=Array.prototype.slice.call(i).indexOf(e);t.deleteHandler(e,s)})}},i.prototype.getSelectedChips=function(){var e;if(this.chipType()&&"None"!==this.selection){for(var i={texts:[],Indexes:[],data:[],elements:[]},s=this.element.querySelectorAll("."+I.active),n=0;n<s.length;n++){var o=s[n];i.elements.push(o);var r=Array.prototype.slice.call(this.element.querySelectorAll("."+I.chip)).indexOf(o);i.Indexes.push(r),i.data.push(this.chips[r]);var l="object"==typeof this.chips[r]?this.chips[r].text?this.chips[r].text:null:this.chips[r].toString();i.texts.push(l)}var a={text:i.texts[0],index:i.Indexes[0],data:i.data[0],element:i.elements[0]};e=t.isNullOrUndefined(a.index)?void 0:"Multiple"===this.selection?i:a}return e},i.prototype.wireEvent=function(e){e?(t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t.EventHandler.remove(this.element,"keydown",this.keyHandler),t.EventHandler.remove(this.element,"keyup",this.keyHandler)):(t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),t.EventHandler.add(this.element,"keydown",this.keyHandler,this),t.EventHandler.add(this.element,"keyup",this.keyHandler,this))},i.prototype.keyHandler=function(e){e.target.classList.contains(I.chip)&&("keydown"===e.type?13===e.keyCode||32===e.keyCode?this.clickHandler(e):46!==e.keyCode&&8!==e.keyCode||!this.enableDelete||this.clickHandler(e,!0):9===e.keyCode&&this.focusInHandler(e.target))},i.prototype.focusInHandler=function(e){e.classList.contains(I.focused)||e.classList.add(I.focused)},i.prototype.focusOutHandler=function(e){var i=t.closest(e.target,"."+I.chip),s=this.chipType()?this.element.querySelector("."+I.focused):this.element.classList.contains(I.focused)?this.element:null;i&&s&&s.classList.remove(I.focused)},i.prototype.clickHandler=function(e,i){var s=this;void 0===i&&(i=!1);var n=t.closest(e.target,"."+I.chip);if(n){var o=void 0;if(this.chipType())o=this.find(n);else{var r=Array.prototype.slice.call(this.element.querySelectorAll("."+I.chip)).indexOf(n);o={text:this.innerText?this.innerText:this.text,element:n,data:this.text,index:r}}o.event=e,o.cancel=!1,this.trigger("beforeClick",o,function(t){t.cancel||s.clickEventHandler(t.element,e,i)})}},i.prototype.clickEventHandler=function(e,t,i){var s=this;if(this.chipType()){var n=this.find(e);if(n.event=t,(t.target.classList.contains(I.deleteIcon)?t.target:i?e.querySelector("."+I.deleteIcon):void 0)&&this.enableDelete){n.cancel=!1;var o=n;this.trigger("delete",o,function(t){if(!t.cancel){s.deleteHandler(t.element,t.index),s.selectionHandler(e),n.selected=t.element.classList.contains(I.active);var i=n;s.trigger("click",i);var o=s.element.querySelectorAll("."+I.chip)[t.index];o&&(o.focus(),s.focusInHandler(o))}})}else if("None"!==this.selection){this.selectionHandler(e),n.selected=e.classList.contains(I.active);var r=n;this.trigger("click",r)}else{this.focusInHandler(e);l=n;this.trigger("click",l)}}else{this.focusInHandler(e);var l={text:this.innerText?this.innerText:this.text,element:e,data:this.text,event:t};this.trigger("click",l)}},i.prototype.selectionHandler=function(e){if("Single"===this.selection){var t=this.element.querySelector("."+I.active);t&&t!==e&&(t.classList.remove(I.active),t.setAttribute("aria-selected","false")),this.setProperties({selectedChips:null},!0)}else this.setProperties({selectedChips:[]},!0);e.classList.contains(I.active)?(e.classList.remove(I.active),e.setAttribute("aria-selected","false")):(e.classList.add(I.active),e.setAttribute("aria-selected","true")),this.updateSelectedChips()},i.prototype.updateSelectedChips=function(){for(var e=this.element.querySelectorAll("."+I.chip),t=[],i=[],s=null,n=null,o=0;o<e.length;o++){var r=this.element.querySelectorAll("."+I.chip)[o];if("true"===r.getAttribute("aria-selected")){if(n=r.getAttribute("data-value"),"Single"===this.selection&&r.classList.contains("e-active")){s=n||o;break}s=n?i.push(n):t.push(o)}}this.setProperties({selectedChips:"Single"===this.selection?s:n?i:t},!0)},i.prototype.deleteHandler=function(e,i){var s=this.find(e);this.chips.splice(i,1),this.setProperties({chips:this.chips},!0),t.detach(e),this.trigger("deleted",s)},i.prototype.getSelectedChipIndex=function(){for(var e=this.element.querySelectorAll("."+I.chip),t=[],i=0;i<e.length;i++)e[i].classList.contains(I.active)&&t.push(i);return t},i.prototype.destroy=function(){for(var i=0;i<this.dragCollection.length;i++)this.dragCollection[i].destroy();this.dragCollection=[],this.clearTemplate(),t.removeClass([this.element],[I.chipSet,I.chip,I.rtl,I.multiSelection,I.singleSelection,I.disabled,I.chipWrapper,I.iconWrapper,I.active,I.focused].concat(this.cssClass?this.cssClass.toString().split(" ").filter(function(e){return e}):[])),this.removeMultipleAttributes(["tabindex","role","aria-label","aria-multiselectable"],this.element),this.wireEvent(!0),this.rippleFunction(),e.prototype.destroy.call(this),this.element.innerHTML="",this.element.innerText=this.innerText},i.prototype.removeMultipleAttributes=function(e,t){e.forEach(function(e){t.removeAttribute(e)})},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.prototype.getModuleName=function(){return"chip-list"},i.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++){var o=void 0;switch(n[s]){case"chips":case"text":case"avatarText":case"avatarIconCss":case"leadingIconCss":case"trailingIconCss":case"enableDelete":case"enabled":this.refresh();break;case"selection":if(o=this.getSelectedChipIndex(),"Single"===e.selection){var r=null;o&&"number"==typeof o?r=o:o&&Array.isArray(o)&&(r=o.length>0?o[o.length-1]:null),this.setProperties({selectedChips:r},!0)}else if("Multiple"===e.selection){var l=[];l=Array.isArray(o)?o:[o],this.setProperties({selectedChips:l},!0)}this.refresh();break;case"cssClass":this.chipType()?this.refresh():(t.removeClass([this.element],i.cssClass.toString().split(" ").filter(function(e){return e})),t.addClass([this.element],e.cssClass.toString().split(" ").filter(function(e){return e})));break;case"selectedChips":if(t.removeClass(this.element.querySelectorAll(".e-active"),"e-active"),"Multiple"===this.selection){this.multiSelectedChip=[];for(var a=!1,p=[],c=this.element.querySelectorAll("."+I.chip),h=Array.isArray(e.selectedChips)?e.selectedChips:t.isNullOrUndefined(e.selectedChips)?[]:[e.selectedChips],d=0;d<h.length;d++)for(var u=h[d],f=0;f<c.length;f++)c[f].attributes[5].value===String(u)&&(a=!0);if(a)this.multiSelection(e.selectedChips);else{for(d=0;d<h.length;d++)for(var u=h[d],f=0;f<c.length;f++)f===parseInt(String(u),10)&&p.push(f);this.multiSelection(p)}this.onSelect(this.multiSelectedChip,!0),this.updateSelectedChips()}else this.onSelect(e.selectedChips,!0);break;case"enableRtl":this.setRtl();break;case"allowDragAndDrop":for(d=0;d<this.dragCollection.length;d++)this.dragCollection[d].destroy();this.dragCollection=[],this.allowDragAndDrop&&this.enableDraggingChips();break;case"dragArea":if(this.allowDragAndDrop)for(d=0;d<this.dragCollection.length;d++)this.dragCollection[d].dragArea=this.dragArea}}};var s;return N([t.Property([])],i.prototype,"chips",void 0),N([t.Property("")],i.prototype,"text",void 0),N([t.Property("")],i.prototype,"avatarText",void 0),N([t.Property("")],i.prototype,"avatarIconCss",void 0),N([t.Property("")],i.prototype,"htmlAttributes",void 0),N([t.Property("")],i.prototype,"leadingIconCss",void 0),N([t.Property("")],i.prototype,"trailingIconCss",void 0),N([t.Property("")],i.prototype,"leadingIconUrl",void 0),N([t.Property("")],i.prototype,"trailingIconUrl",void 0),N([t.Property("")],i.prototype,"cssClass",void 0),N([t.Property(!0)],i.prototype,"enabled",void 0),N([t.Property([])],i.prototype,"selectedChips",void 0),N([t.Property("None")],i.prototype,"selection",void 0),N([t.Property(!1)],i.prototype,"enableDelete",void 0),N([t.Property(!1)],i.prototype,"allowDragAndDrop",void 0),N([t.Property(null)],i.prototype,"dragArea",void 0),N([t.Event()],i.prototype,"created",void 0),N([t.Event()],i.prototype,"click",void 0),N([t.Event()],i.prototype,"beforeClick",void 0),N([t.Event()],i.prototype,"delete",void 0),N([t.Event()],i.prototype,"deleted",void 0),N([t.Event()],i.prototype,"dragStart",void 0),N([t.Event()],i.prototype,"dragging",void 0),N([t.Event()],i.prototype,"dragStop",void 0),i=s=N([t.NotifyPropertyChanges],i)}(t.Component),D=function(){function e(){}return e}(),B=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)}}(),j=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.TopLeft="TopLeft",e.TopCenter="TopCenter",e.TopRight="TopRight",e.MiddleLeft="MiddleLeft",e.MiddleCenter="MiddleCenter",e.MiddleRight="MiddleRight",e.BottomLeft="BottomLeft",e.BottomCenter="BottomCenter",e.BottomRight="BottomRight"}(e.FabPosition||(e.FabPosition={}));var F=function(e){function i(t,i){return e.call(this,t,i)||this}return B(i,e),i.prototype.render=function(){e.prototype.render.call(this),this.initializeFab()},i.prototype.preRender=function(){e.prototype.preRender.call(this),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName()))},i.prototype.getPersistData=function(){return e.prototype.getPersistData.call(this),this.addOnPersist([])},i.prototype.getModuleName=function(){return"fab"},i.prototype.initializeFab=function(){this.element.classList.add("e-"+e.prototype.getModuleName.call(this)),this.checkTarget(),this.setPosition(),this.setVisibility()},i.prototype.checkTarget=function(){this.isFixed=!0,this.target&&(this.targetEle="string"==typeof this.target?t.select(this.target):this.target,this.targetEle&&(this.isFixed=!1,this.targetEle.appendChild(this.element))),this.element.classList[this.isFixed?"add":"remove"]("e-fab-fixed")},i.prototype.setVisibility=function(){this.element.classList[this.visible?"remove":"add"]("e-fab-hidden")},i.prototype.setPosition=function(){this.element.classList.add(-1!==["BottomLeft","BottomCenter","BottomRight"].indexOf(this.position)?"e-fab-bottom":"e-fab-top");var e=-1!==["TopRight","MiddleRight","BottomRight"].indexOf(this.position);this.element.classList.add(!this.enableRtl&&!e||this.enableRtl&&e?"e-fab-left":"e-fab-right"),-1!==["MiddleLeft","MiddleRight","MiddleCenter"].indexOf(this.position)&&this.element.classList.add("e-fab-middle"),-1!==["TopCenter","BottomCenter","MiddleCenter"].indexOf(this.position)&&this.element.classList.add("e-fab-center")},i.prototype.clearPosition=function(){this.element.classList.remove("e-fab-top","e-fab-bottom","e-fab-middle"),this.element.classList.remove("e-fab-right","e-fab-left","e-fab-center")},i.prototype.refreshPosition=function(){},i.prototype.destroy=function(){e.prototype.destroy.call(this),this.element.classList.remove("e-"+e.prototype.getModuleName.call(this),"e-fab-fixed"),this.clearPosition()},i.prototype.onPropertyChanged=function(t,i){e.prototype.onPropertyChanged.call(this,t,i);for(var s=0,n=Object.keys(t);s<n.length;s++)switch(n[s]){case"enableRtl":case"position":this.clearPosition(),this.setPosition();break;case"visible":this.setVisibility();break;case"target":this.checkTarget(),this.setPosition();break;case"currencyCode":this.refresh()}},j([t.Property("BottomRight")],i.prototype,"position",void 0),j([t.Property("")],i.prototype,"target",void 0),j([t.Property(!0)],i.prototype,"visible",void 0),j([t.Property(!0)],i.prototype,"isPrimary",void 0),i=j([t.NotifyPropertyChanges],i)}(f),U=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)}}(),W=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},_=["TopLeft","TopCenter","TopRight"],z=["BottomLeft","BottomCenter","BottomRight"],V=["TopLeft","MiddleLeft","BottomLeft"],q=["TopRight","MiddleRight","BottomRight"],K="e-speeddial-hidden",X="e-speeddial-fixed",Y="e-speeddial-hover-open",J="e-speeddial-radial",G="e-speeddial-linear",Z="e-speeddial-template",Q="e-speeddial-popup",$="e-speeddial-ul",ee="e-speeddial-li",te="e-speeddial-li-active",ie="e-speeddial-overflow",se="e-speeddial-top",ne="e-speeddial-bottom",oe="e-speeddial-right",re="e-speeddial-left",le="e-speeddial-top-left",ae="e-speeddial-top-right",pe="--speeddialHorzDist";!function(e){e.Linear="Linear",e.Radial="Radial"}(e.SpeedDialMode||(e.SpeedDialMode={})),function(e){e.Up="Up",e.Down="Down",e.Right="Right",e.Left="Left",e.Auto="Auto"}(e.LinearDirection||(e.LinearDirection={})),function(e){e.Clockwise="Clockwise",e.AntiClockwise="AntiClockwise",e.Auto="Auto"}(e.RadialDirection||(e.RadialDirection={})),function(e){e.Fade="Fade",e.FadeZoom="FadeZoom",e.FlipLeftDown="FlipLeftDown",e.FlipLeftUp="FlipLeftUp",e.FlipRightDown="FlipRightDown",e.FlipRightUp="FlipRightUp",e.FlipXDown="FlipXDown",e.FlipXUp="FlipXUp",e.FlipYLeft="FlipYLeft",e.FlipYRight="FlipYRight",e.SlideBottom="SlideBottom",e.SlideLeft="SlideLeft",e.SlideRight="SlideRight",e.SlideTop="SlideTop",e.Zoom="Zoom",e.None="None"}(e.SpeedDialAnimationEffect||(e.SpeedDialAnimationEffect={}));var ce=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return U(i,e),W([t.Property("Fade")],i.prototype,"effect",void 0),W([t.Property(400)],i.prototype,"duration",void 0),W([t.Property(0)],i.prototype,"delay",void 0),i}(t.ChildProperty),he=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return U(i,e),W([t.Property("Auto")],i.prototype,"direction",void 0),W([t.Property(-1)],i.prototype,"endAngle",void 0),W([t.Property("100px")],i.prototype,"offset",void 0),W([t.Property(-1)],i.prototype,"startAngle",void 0),i}(t.ChildProperty),de=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return U(i,e),W([t.Property("")],i.prototype,"iconCss",void 0),W([t.Property("")],i.prototype,"id",void 0),W([t.Property("")],i.prototype,"text",void 0),W([t.Property("")],i.prototype,"title",void 0),W([t.Property(!1)],i.prototype,"disabled",void 0),i}(t.ChildProperty),ue=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.isMenuOpen=!1,s.isClock=!0,s.isVertical=!0,s.isControl=!1,s.focusedIndex=-1,s}return U(i,e),i.prototype.render=function(){this.initialize()},i.prototype.preRender=function(){this.keyConfigs={space:"space",enter:"enter",end:"end",home:"home",moveDown:"downarrow",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",esc:"escape"},this.validateDirection()},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.prototype.getModuleName=function(){return"speed-dial"},i.prototype.initialize=function(){this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName())),this.fab=new F({content:this.content,cssClass:this.cssClass?"e-speeddial "+this.cssClass:"e-speeddial",disabled:this.disabled,enablePersistence:this.enablePersistence,enableRtl:this.enableRtl,iconCss:this.openIconCss,iconPosition:this.iconPosition,position:this.position,target:this.target,visible:this.visible,isPrimary:this.isPrimary}),this.fab.appendTo(this.element),(this.items.length>0||this.popupTemplate)&&this.createPopup(),this.wireEvents()},i.prototype.wireEvents=function(){t.EventHandler.add(window,"resize",this.resizeHandler,this),t.EventHandler.add(document.body,"click",this.bodyClickHandler,this),this.opensOnHover?this.wireFabHover():this.wireFabClick()},i.prototype.wirePopupEvents=function(){this.removeRippleEffect=t.rippleEffect(this.popupEle,{selector:".e-speeddial-li-icon"}),this.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.popupKeyboardModule=new t.KeyboardEvents(this.popupEle,{keyAction:this.popupKeyActionHandler.bind(this),keyConfigs:{esc:"escape"},eventName:"keydown"}),this.documentKeyboardModule=new t.KeyboardEvents(document.body,{keyAction:this.popupKeyActionHandler.bind(this),keyConfigs:{enter:"enter",space:"space"},eventName:"keydown"}),t.EventHandler.add(this.popupEle,"click",this.popupClick,this),t.EventHandler.add(this.popupEle,"mouseleave",this.popupMouseLeaveHandle,this)},i.prototype.wireFabClick=function(){t.EventHandler.add(this.fab.element,"click",this.fabClick,this)},i.prototype.wireFabHover=function(){this.popupEle.classList.add(Y),t.EventHandler.add(this.fab.element,"mouseover",this.mouseOverHandle,this),t.EventHandler.add(this.element,"mouseleave",this.mouseLeaveHandle,this)},i.prototype.createPopup=function(){var e=Q+" "+K;e=this.enableRtl?e+" e-rtl":e,e=this.cssClass?e+" "+this.cssClass:e,this.popupEle=this.createElement("div",{className:e,id:this.element.id+"_popup"}),this.element.insertAdjacentElement("afterend",this.popupEle),t.attributes(this.element,{"aria-expanded":"false","aria-haspopup":"true","aria-controls":this.popupEle.id}),this.setPopupContent(),this.modal&&this.createOverlay(),this.checkTarget(),this.setPositionProps(),this.wirePopupEvents()},i.prototype.createOverlay=function(){this.overlayEle=this.createElement("div",{id:this.element.id+"_overlay",className:("e-speeddial-overlay"+(this.isMenuOpen?"":" "+K)+" "+this.cssClass).trim()}),this.element.insertAdjacentElement("beforebegin",this.overlayEle)},i.prototype.popupClick=function(){this.isControl=!0},i.prototype.bodyClickHandler=function(e){if(this.isControl)return void(this.isControl=!1);this.isMenuOpen&&this.hidePopupEle(e)},i.prototype.fabClick=function(e){this.isControl=!0,this.isMenuOpen?this.hidePopupEle(e):this.showPopupEle(e)},i.prototype.setPopupContent=function(){this.popupEle.classList.remove(J,G,Z),this.popupTemplate?(this.popupEle.classList.add(Z),this.appendTemplate()):(this.popupEle.classList.add("Radial"===this.mode?J:G),this.createUl(),this.createItems()),this.renderReactTemplates()},i.prototype.appendTemplate=function(){var e=this.createElement("div",{className:"e-speeddial-template-container"});t.append([e],this.popupEle);var i=this.getTemplateString(this.popupTemplate);t.append(i({},this,"fabPopupTemplate",this.element.id+"popupTemplate",this.isStringTemplate),e)},i.prototype.getTemplateString=function(e){var i="";try{var s=t.select(e);i="function"!=typeof e&&s?"SCRIPT"===s.tagName?s.innerHTML:s.outerHTML:e}catch(t){i=e}return t.compile(i)},i.prototype.updatePopupTemplate=function(){if(this.popupEle){for(this.popupEle.querySelector("."+ee)&&(this.clearItems(),this.popupEle.classList.remove(J,G),this.popupEle.classList.add(Z));this.popupEle.firstElementChild;)t.remove(this.popupEle.firstElementChild);this.setPopupContent(),this.updatePositionProperties()}else this.createPopup()},i.prototype.createUl=function(){var e=this.createElement("ul",{className:$,id:this.element.id+"_ul",attrs:{role:"menu"}});this.popupEle.appendChild(e)},i.prototype.createItems=function(){var e=this;this.focusedIndex=-1;for(var i=this.popupEle.querySelector("."+$),s=this,n=0;n<this.items.length;n++)!function(n){var o=s.items[parseInt(n.toString(),10)],r=s.createElement("li",{className:ee+" "+K,id:o.id?o.id:s.element.id+"_li_"+n,attrs:{role:"menuitem"}});if(o.text&&r.setAttribute("aria-label",o.text),s.itemTemplate){var l=s.getTemplateString(s.itemTemplate);t.append(l(o,s,"fabItemTemplate",s.element.id+"itemTemplate",s.isStringTemplate),r)}else{if(o.iconCss){var a=s.createElement("span",{className:"e-speeddial-li-icon "+o.iconCss});r.appendChild(a)}if(o.text){var p=s.createElement("span",{className:"e-speeddial-li-text"});p.innerText=o.text,r.appendChild(p),o.iconCss||r.classList.add("e-speeddial-text-li")}}o.disabled?(r.classList.add("e-disabled"),r.setAttribute("aria-disabled","true")):t.EventHandler.add(r,"click",function(t){return e.triggerItemClick(t,o)},s),o.title&&r.setAttribute("title",o.title);var c={element:r,item:o};s.trigger("beforeItemRender",c,function(e){i.appendChild(e.element)})}(n)},i.prototype.setRTL=function(){this.popupEle.classList[this.enableRtl?"add":"remove"]("e-rtl"),this.clearHorizontalPosition(),this.popupTemplate||"Radial"===this.mode?(this.popupTemplate||"Radial"!==this.mode||this.setRadialPosition(),this.setHorizontalPosition()):this.setLinearHorizontalPosition()},i.prototype.checkTarget=function(){this.isFixed=!0,this.target&&(this.targetEle="string"==typeof this.target?t.select(this.target):this.target,this.targetEle&&(this.targetEle.appendChild(this.element),this.isFixed=!1)),this.isFixed?(this.popupEle&&this.popupEle.classList.add(X),this.overlayEle&&this.overlayEle.classList.add(X)):(this.popupEle&&this.popupEle.classList.remove(X),this.overlayEle&&this.overlayEle.classList.remove(X))},i.prototype.setVisibility=function(e){this.setProperties({visible:e},!0),this.fab.setProperties({visible:e})},i.prototype.popupMouseLeaveHandle=function(e){var i=e.relatedTarget;!this.opensOnHover||i.classList.contains("e-speeddial")||t.closest(i,".e-speeddial")||this.hidePopupEle(e)},i.prototype.mouseOverHandle=function(e){this.showPopupEle(e)},i.prototype.mouseLeaveHandle=function(e){var i=e.relatedTarget;i.classList.contains(Q)||t.closest(i,"."+Q)||this.hidePopupEle(e)},i.prototype.popupKeyActionHandler=function(e){switch(e.action){case"esc":this.hidePopupEle(e);break;case"enter":case"space":this.isMenuOpen&&e.target!==this.element&&this.hidePopupEle(e)}},i.prototype.keyActionHandler=function(e){switch(e.preventDefault(),e.action){case"enter":case"space":this.isMenuOpen?-1!==this.focusedIndex?this.triggerItemClick(e,this.items[this.focusedIndex]):this.hidePopupEle(e):this.showPopupEle(e);break;case"esc":this.hidePopupEle(e);break;default:if(this.popupTemplate||!this.isMenuOpen)break;switch(e.action){case"end":this.focusLastElement();break;case"home":this.focusFirstElement();break;case"moveRight":"Radial"===this.mode?this.focusLeftRightElement(!1):this.focusLinearElement(!1);break;case"moveDown":"Radial"===this.mode?this.focusUpDownElement(!1):this.focusLinearElement(!1);break;case"moveLeft":"Radial"===this.mode?this.focusLeftRightElement(!0):this.focusLinearElement(!0);break;case"moveUp":"Radial"===this.mode?this.focusUpDownElement(!0):this.focusLinearElement(!0)}}},i.prototype.focusFirstElement=function(){for(var e=t.selectAll("."+ee,this.popupEle),i=0;e[parseInt(i.toString(),10)].classList.contains("e-disabled");)if(++i>e.length-1)return;this.setFocus(i,e[parseInt(i.toString(),10)])},i.prototype.focusLastElement=function(){for(var e=t.selectAll("."+ee,this.popupEle),i=e.length-1;e[parseInt(i.toString(),10)].classList.contains("e-disabled");)if(--i<0)return;this.setFocus(i,e[parseInt(i.toString(),10)])},i.prototype.focusLinearElement=function(e){(this.popupEle.classList.contains("e-speeddial-vert-bottom")||this.popupEle.classList.contains("e-speeddial-horz-right"))!==e?this.focusPrevElement():this.focusNextElement()},i.prototype.focusLeftRightElement=function(e){var t=-1!==["TopLeft","TopCenter","TopRight","MiddleLeft"].indexOf(this.position);t&&e!==this.isClock||!t&&e===this.isClock?this.focusPrevElement():this.focusNextElement()},i.prototype.focusUpDownElement=function(e){var t=-1!==["TopRight","MiddleRight","BottomRight","BottomCenter"].indexOf(this.position);t&&e!==this.isClock||!t&&e===this.isClock?this.focusPrevElement():this.focusNextElement()},i.prototype.focusPrevElement=function(){var e=t.selectAll("."+ee,this.popupEle),i=this.focusedIndex;do{if(--i<0)return void this.setFocus(-1)}while(e[parseInt(i.toString(),10)].classList.contains("e-disabled"));this.setFocus(i,e[parseInt(i.toString(),10)])},i.prototype.focusNextElement=function(){var e=t.selectAll("."+ee,this.popupEle),i=this.focusedIndex;do{if(++i>e.length-1)return}while(e[parseInt(i.toString(),10)].classList.contains("e-disabled"));this.setFocus(i,e[parseInt(i.toString(),10)])},i.prototype.setFocus=function(e,t){this.removeFocus(),t&&t.classList.add(te),this.focusedIndex=e},i.prototype.removeFocus=function(){var e=t.select("."+te,this.popupEle);e&&e.classList.remove(te)},i.prototype.updatePositionProperties=function(){this.hidePopupEle(),this.clearPosition(),this.validateDirection(),this.setPositionProps()},i.prototype.setPositionProps=function(){this.popupTemplate?this.setPosition():"Radial"===this.mode?(this.setRadialPosition(),this.setPosition()):(this.setLinearPosition(),this.setMaxSize())},i.prototype.validateDirection=function(){switch(this.direction){case"Up":this.actualLinDirection=-1!==_.indexOf(this.position)?"Auto":"Up";break;case"Down":this.actualLinDirection=-1!==z.indexOf(this.position)?"Auto":"Down";break;case"Right":this.actualLinDirection=-1!==q.indexOf(this.position)?"Auto":"Right";break;case"Left":this.actualLinDirection=-1!==V.indexOf(this.position)?"Auto":"Left";break;case"Auto":default:this.actualLinDirection="Auto"}this.isVertical=!("Left"===this.actualLinDirection||"Right"===this.actualLinDirection)},i.prototype.setMaxSize=function(){var e=this.element.offsetTop,t=this.element.offsetLeft,i=(this.isFixed?window.innerHeight:this.targetEle.clientHeight)-this.element.offsetTop-this.element.offsetHeight,s=(this.isFixed?window.innerWidth:this.targetEle.clientWidth)-this.element.offsetLeft-this.element.offsetWidth,n=0,o=this.popupEle.querySelector("."+$);this.isVertical?(n="Up"===this.actualLinDirection||"Auto"===this.actualLinDirection&&-1===_.indexOf(this.position)?e:i)<o.offsetHeight&&(this.popupEle.classList.add(ie,"e-speeddial-vert-overflow"),o.style.setProperty("--speeddialOverflowLimit",n+"px")):(n=this.enableRtl?"Right"===this.direction?t:s:"Right"===this.direction?s:t)<o.offsetWidth&&(this.popupEle.classList.add(ie,"e-speeddial-horz-overflow"),o.style.setProperty("--speeddialOverflowLimit",n+"px"))},i.prototype.setLinearPosition=function(){var e=0,t="Down"===this.actualLinDirection||"Auto"===this.actualLinDirection&&-1!==_.indexOf(this.position)||!this.isVertical&&-1===z.indexOf(this.position),i=this.element.offsetHeight/2,s=-1!==["MiddleRight","MiddleCenter","MiddleLeft"].indexOf(this.position);t?(e=this.element.offsetTop+(this.isVertical?this.element.offsetHeight:0),s&&("Right"!==this.actualLinDirection&&"Left"!==this.actualLinDirection||(e=this.element.offsetTop-i),"Down"===this.actualLinDirection&&(e-=i)),this.isVertical||this.popupEle.classList.add("e-speeddial-horz-top")):(e=(e=this.isFixed?window.document.documentElement.clientHeight:this.targetEle.clientHeight)-this.element.offsetTop-(this.isVertical?0:this.element.offsetHeight),s&&("Auto"!==this.actualLinDirection&&"Up"!==this.actualLinDirection||(e+=i)),this.isVertical&&this.popupEle.classList.add("e-speeddial-vert-bottom")),this.popupEle.classList.add(t?se:ne),this.popupEle.style.setProperty("--speeddialVertDist",e+"px"),this.setLinearHorizontalPosition()},i.prototype.setLinearHorizontalPosition=function(){"Right"===this.actualLinDirection||this.isVertical&&-1===q.indexOf(this.position)?(this.enableRtl?this.setRight():this.setLeft(),this.isVertical||this.popupEle.classList.add("e-speeddial-horz-left")):(this.enableRtl?this.setLeft():this.setRight(),this.popupEle.classList.add(this.isVertical?"e-speeddial-vert-right":"e-speeddial-horz-right"))},i.prototype.setLeft=function(){var e=this.element.offsetWidth/2,t=-1!==["TopCenter","MiddleCenter","BottomCenter"].indexOf(this.position),i=this.element.offsetLeft+(this.isVertical?0:this.element.offsetWidth);t&&(i="Auto"===this.actualLinDirection||"Down"===this.actualLinDirection||"Up"===this.actualLinDirection?this.element.offsetLeft-e:"Right"===this.actualLinDirection?this.element.offsetLeft+e:i+e),this.popupEle.style.setProperty(pe,i+"px"),this.popupEle.classList.add(re)},i.prototype.setRight=function(){var e=this.element.offsetWidth/2,t=-1!==["TopCenter","MiddleCenter","BottomCenter"].indexOf(this.position),i=this.isFixed?window.document.documentElement.clientWidth:this.targetEle.clientWidth;i=i-this.element.offsetLeft-(this.isVertical?this.element.offsetWidth:0),t&&"Left"===this.actualLinDirection&&(i+=e),this.popupEle.classList.contains("e-rtl")&&t&&(i-=e),this.popupEle.style.setProperty(pe,i+"px"),this.popupEle.classList.add(oe)},i.prototype.setPosition=function(){if(-1!==["MiddleLeft","MiddleRight","MiddleCenter"].indexOf(this.position)){this.popupEle.classList.add("e-speeddial-middle");var e=((this.isFixed?window.innerHeight:this.targetEle.clientHeight)-this.popupEle.offsetHeight)/2;this.popupEle.style.setProperty("--speeddialVertDist",e+"px")}this.popupEle.classList.add(-1===z.indexOf(this.position)?se:ne),this.setHorizontalPosition()},i.prototype.setHorizontalPosition=function(){if(-1!==["TopCenter","BottomCenter","MiddleCenter"].indexOf(this.position)){this.popupEle.classList.add("e-speeddial-center");var e=((this.isFixed?window.innerWidth:this.targetEle.clientWidth)-this.popupEle.offsetWidth)/2;this.popupEle.style.setProperty(pe,e+"px")}var t=-1!==q.indexOf(this.position);this.popupEle.classList.add(!this.enableRtl&&!t||this.enableRtl&&t?re:oe)},i.prototype.setCustomRadialPosition=function(){var e=document.documentElement.clientWidth,t=document.documentElement.clientHeight;if(-1!==["TopLeft","BottomLeft","MiddleLeft"].indexOf(this.position)){i=void 0;i=this.enableRtl?this.isFixed?e-(this.element.offsetLeft+this.element.offsetWidth):this.targetEle.clientWidth-(this.element.offsetLeft+this.element.offsetWidth):this.element.offsetLeft,this.popupEle.style.setProperty("--speeddialRadialHorzDist",i+"px")}if(-1!==["TopLeft","TopCenter","TopRight"].indexOf(this.position)&&(this.popupEle.style.top=this.element.offsetTop+"px"),-1!==["TopRight","BottomRight","MiddleRight"].indexOf(this.position)){i=void 0;i=this.enableRtl?this.element.offsetLeft:this.isFixed?e-(this.element.offsetLeft+this.element.offsetWidth):this.targetEle.clientWidth-(this.element.offsetLeft+this.element.offsetWidth),this.popupEle.style.setProperty("--speeddialRadialHorzDist",i+"px")}if(-1!==["BottomLeft","BottomCenter","BottomRight"].indexOf(this.position)&&(this.isFixed?this.popupEle.style.bottom=t-(this.element.offsetTop+this.element.offsetHeight)+"px":this.popupEle.style.bottom=this.targetEle.clientHeight-(this.element.offsetTop+this.element.offsetHeight)+"px"),-1!==["TopCenter","MiddleCenter","BottomCenter"].indexOf(this.position)){var i=void 0;if(this.enableRtl)if(this.isFixed)i=e-(this.element.offsetLeft+this.element.offsetWidth)-this.popupEle.offsetWidth/2;else{var s=this.targetEle.clientWidth,n=this.popupEle.offsetWidth;i=s-(this.element.offsetLeft+this.element.offsetWidth)-n/2}else i=this.element.offsetLeft-this.popupEle.offsetWidth/2;this.popupEle.style.setProperty("--speeddialRadialHorzDist",i+"px")}-1!==["MiddleLeft","MiddleCenter","MiddleRight"].indexOf(this.position)&&(this.popupEle.style.top=this.element.offsetTop-this.popupEle.offsetHeight/2+"px")},i.prototype.setRadialPosition=function(){this.setRadialCorner();var e=this.getActualRange();this.isClock="Clockwise"===e.direction;var i=t.formatUnit(e.offset),s=t.selectAll("."+ee,this.popupEle);this.popupEle.style.setProperty("--speeddialRadialOffset",i),this.popupEle.style.setProperty("--speeddialRadialMinHeight",s[0].offsetHeight+"px"),this.popupEle.style.setProperty("--speeddialRadialMinWidth",s[0].offsetWidth+"px");for(var n=Math.abs(e.endAngle-e.startAngle),o=n/(360===n||0===n?s.length:s.length-1),r=0;r<s.length;r++){var l=s[parseInt(r.toString(),10)],a=e.startAngle,p=this.isClock?a+o*r:a-o*r;p%=360,l.style.setProperty("--speeddialRadialAngle",p+"deg")}},i.prototype.setRadialCorner=function(){-1!==["TopLeft","TopCenter","MiddleLeft","MiddleCenter"].indexOf(this.position)&&this.popupEle.classList.add(this.enableRtl?ae:le),-1!==["TopRight","TopCenter","MiddleRight","MiddleCenter"].indexOf(this.position)&&this.popupEle.classList.add(this.enableRtl?le:ae),-1!==["BottomLeft","BottomCenter","MiddleLeft","MiddleCenter"].indexOf(this.position)&&this.popupEle.classList.add(this.enableRtl?"e-speeddial-bottom-right":"e-speeddial-bottom-left"),-1!==["BottomRight","BottomCenter","MiddleRight","MiddleCenter"].indexOf(this.position)&&this.popupEle.classList.add(this.enableRtl?"e-speeddial-bottom-left":"e-speeddial-bottom-right")},i.prototype.getActualRange=function(){var e={offset:this.radialSettings.offset},i=this.radialSettings.startAngle,s=this.radialSettings.endAngle,n=!1;switch(this.position){case"TopLeft":case"TopRight":"TopLeft"===this.position!==this.enableRtl?(n="Clockwise"===this.radialSettings.direction,this.checkAngleRange(i,s,e,n,0,90,!1)):(n="AntiClockwise"!==this.radialSettings.direction,this.checkAngleRange(i,s,e,n,90,180,!1));break;case"TopCenter":n="Clockwise"===this.radialSettings.direction,this.checkAngleRange(i,s,e,n,0,180,!1);break;case"MiddleLeft":case"MiddleRight":if("MiddleLeft"===this.position!==this.enableRtl){n="Clockwise"===this.radialSettings.direction,i=t.isNullOrUndefined(i)||i<0||i>360||i>90&&i<270?n?270:90:i,s=t.isNullOrUndefined(s)||s<0||s>360||s>90&&s<270?n?90:270:s,i=i<91?i+360:i,s=s<91?s+360:s;var o=n&&s<i||!n&&s>i;e.startAngle=o?s:i,e.endAngle=o?i:s}else n="AntiClockwise"!==this.radialSettings.direction,this.checkAngleRange(i,s,e,n,90,270,!1);break;case"MiddleCenter":n="AntiClockwise"!==this.radialSettings.direction,i=t.isNullOrUndefined(i)||i<0||i>360?n?0:360:i,s=t.isNullOrUndefined(s)||s<0||s>360?n?360:0:s,e.startAngle=!n&&i<=s?i+360:i,e.endAngle=n&&s<=i?s+360:s;break;case"BottomLeft":case"BottomRight":"BottomLeft"===this.position!==this.enableRtl?(n="Clockwise"===this.radialSettings.direction,this.checkAngleRange(i,s,e,n,270,360,!0)):(n="AntiClockwise"!==this.radialSettings.direction,this.checkAngleRange(i,s,e,n,180,270,!0));break;case"BottomCenter":n="AntiClockwise"!==this.radialSettings.direction,this.checkAngleRange(i,s,e,n,180,360,!0)}return e.direction=n?"Clockwise":"AntiClockwise",e},i.prototype.checkAngleRange=function(e,t,i,s,n,o,r){e=this.checkAngle(e,s,n,o,r),t=this.checkAngle(t,!s,n,o,r);var l=s&&t<e||!s&&t>e;i.startAngle=l?t:e,i.endAngle=l?e:t},i.prototype.checkAngle=function(e,i,s,n,o){return t.isNullOrUndefined(e)||e<0||e>360?i?s:n:(e=o?0===e?360:e:360===e?0:e,e>=s&&e<=n?e:i?s:n)},i.prototype.clearPosition=function(){this.popupEle.style.removeProperty("--speeddialRadialOffset"),this.popupEle.style.removeProperty("--speeddialRadialMinHeight"),this.popupEle.style.removeProperty("--speeddialRadialMinWidth"),this.popupEle.classList.remove(le,ae,"e-speeddial-bottom-left","e-speeddial-bottom-right"),this.popupEle.classList.remove(se,ne,"e-speeddial-middle"),this.popupEle.classList.remove("e-speeddial-horz-top","e-speeddial-vert-bottom"),this.popupEle.style.removeProperty("--speeddialVertDist"),this.clearHorizontalPosition(),this.clearOverflow()},i.prototype.clearHorizontalPosition=function(){this.popupEle.style.removeProperty(pe),this.popupEle.style.removeProperty("--speeddialRadialHorzDist"),this.popupEle.style.removeProperty("top"),this.popupEle.style.removeProperty("bottom"),this.popupEle.classList.remove(oe,re,"e-speeddial-center"),this.popupEle.classList.remove("e-speeddial-vert-right","e-speeddial-horz-left","e-speeddial-horz-right")},i.prototype.clearOverflow=function(){this.popupEle.classList.remove(ie,"e-speeddial-vert-overflow","e-speeddial-horz-overflow"),this.popupEle.style.removeProperty("--speeddialOverflowLimit")},i.prototype.hidePopupEle=function(e){var i=this;if(this.popupEle&&this.isMenuOpen){var s={element:this.popupEle,event:e,cancel:!1};this.trigger("beforeClose",s,function(e){if(!e.cancel)if("None"!==i.animation.effect){var s={name:i.animation.effect+"Out",timingFunction:"easeOut"},n=i.popupTemplate?[i.popupEle.firstElementChild]:t.selectAll("."+ee,i.popupEle),o=i.animation.duration/(n.length+1);s.duration=2*o;var r=function(e){var l=n[parseInt(e.toString(),10)];if(s.delay=e===n.length-1?i.animation.delay:0,s.begin=function(){e===n.length-1&&i.startHide()},s.end=function(){l.classList.add(K),0===e&&i.endHide()},new t.Animation(s).animate(l),0!==e){var a=e-1;setTimeout(function(){r(a)},o)}};r(n.length-1)}else i.startHide(),i.popupTemplate||t.selectAll("."+ee,i.popupEle).forEach(function(e){e.classList.add(K)}),i.endHide()})}},i.prototype.startHide=function(){this.element.setAttribute("aria-expanded","false"),this.removeFocus(),this.isMenuOpen=!1},i.prototype.endHide=function(){this.fab.setProperties({iconCss:this.openIconCss}),this.popupEle.classList.add(K),this.popupTemplate&&this.setVisibility(!0),this.toggleOverlay(),this.popupTemplate&&this.popupEle.removeAttribute("tabindex"),this.trigger("onClose",{element:this.popupEle})},i.prototype.showPopupEle=function(e){var i=this;if(this.popupEle&&!this.isMenuOpen){this.popupTemplate||"Radial"===this.mode?this.setCustomRadialPosition():this.setLinearPosition();var s={element:this.popupEle,event:e,cancel:!1};this.trigger("beforeOpen",s,function(e){if(!e.cancel)if("None"!==i.animation.effect||"Enable"===t.animationMode&&"None"===i.animation.effect){"Enable"===t.animationMode&&"None"===i.animation.effect&&(i.animation.effect="Fade"),"Enable"===t.animationMode&&0===i.animation.duration&&(i.animation.duration=400);var s={name:i.animation.effect+"In",timingFunction:"easeIn"},n=i.popupTemplate?[i.popupEle.firstElementChild]:t.selectAll("."+ee,i.popupEle),o=i.animation.duration/(n.length+1);s.duration=2*o;var r=function(e){var l=n[parseInt(e.toString(),10)];if(s.delay=0===e?i.animation.delay:0,s.begin=function(){0===e&&i.startShow(),l.classList.remove(K)},s.end=function(){e===n.length-1&&i.endShow()},new t.Animation(s).animate(l),e!==n.length-1){var a=e+1;setTimeout(function(){r(a)},o)}};r(0)}else i.startShow(),i.popupTemplate||t.selectAll("."+ee,i.popupEle).forEach(function(e){e.classList.remove(K)}),i.endShow()})}},i.prototype.startShow=function(){this.element.setAttribute("aria-expanded","true"),this.isMenuOpen=!0,this.toggleOverlay(),this.popupEle.classList.remove(K),this.popupTemplate&&this.setVisibility(!1)},i.prototype.endShow=function(){this.closeIconCss&&this.fab.setProperties({iconCss:this.closeIconCss}),this.popupTemplate&&(this.popupEle.setAttribute("tabindex","1"),this.popupEle.focus()),this.trigger("onOpen",{element:this.popupEle})},i.prototype.toggleOverlay=function(){this.overlayEle&&this.overlayEle.classList[this.isMenuOpen?"remove":"add"](K)},i.prototype.removeOverlayEle=function(){this.overlayEle&&(t.remove(this.overlayEle),this.overlayEle=void 0)},i.prototype.updatePopupItems=function(){this.popupEle?(this.hidePopupEle(),this.clearItems(),this.createItems(),this.updatePositionProperties()):this.createPopup()},i.prototype.handleResize=function(e){this.popupEle&&(this.hidePopupEle(e),this.clearOverflow(),this.setPositionProps())},i.prototype.triggerItemClick=function(e,i){var s=e.target,n={element:s=s.classList.contains(ee)?s:t.closest(s,"."+ee),item:i,event:e};this.trigger("clicked",n),this.hidePopupEle(e)},i.prototype.show=function(){this.showPopupEle()},i.prototype.hide=function(){this.hidePopupEle()},i.prototype.refreshPosition=function(){this.resizeHandler()},i.prototype.resizeHandler=function(e){this.handleResize(e)},i.prototype.clearItems=function(){t.selectAll("."+ee,this.popupEle).forEach(function(e){t.remove(e)})},i.prototype.unwireEvents=function(){t.EventHandler.remove(window,"resize",this.resizeHandler),t.EventHandler.remove(document.body,"click",this.bodyClickHandler),this.opensOnHover?this.unwireFabHover():this.unwireFabClick()},i.prototype.unwireFabClick=function(){t.EventHandler.remove(this.fab.element,"click",this.fabClick)},i.prototype.unwireFabHover=function(){this.popupEle.classList.remove(Y),t.EventHandler.remove(this.fab.element,"mouseover",this.mouseOverHandle),t.EventHandler.remove(this.element,"mouseleave",this.mouseLeaveHandle)},i.prototype.unwirePopupEvents=function(){t.isRippleEnabled&&this.removeRippleEffect(),this.removeRippleEffect=null,this.keyboardModule.destroy(),this.popupKeyboardModule.destroy(),this.documentKeyboardModule.destroy(),this.keyboardModule=null,this.popupKeyboardModule=null,this.documentKeyboardModule=null,t.EventHandler.remove(this.popupEle,"click",this.popupClick),t.EventHandler.remove(this.popupEle,"mouseleave",this.popupMouseLeaveHandle)},i.prototype.destroy=function(){var i=this;e.prototype.destroy.call(this),this.unwireEvents(),["aria-expanded","aria-haspopup","aria-controls"].forEach(function(e){i.element.removeAttribute(e)}),this.popupEle&&(this.unwirePopupEvents(),t.remove(this.popupEle),this.popupEle=void 0),this.removeOverlayEle(),this.fab.destroy(),this.fab=void 0},i.prototype.onPropertyChanged=function(e,i){for(var s=["content","cssClass","disabled","enablePersistence","enableRtl","iconPosition","position","target","template","title","visible","isPrimary"],n=t.extend({},e),o=0,r=Object.keys(n);o<r.length;o++){var l=r[o];s.indexOf(l)<0&&t.deleteObject(n,l)}this.fab.setProperties(n);for(var a=0,p=Object.keys(e);a<p.length;a++)switch(l=p[a]){case"cssClass":if(!this.popupEle)break;i.cssClass&&t.removeClass(this.overlayEle?[this.popupEle,this.overlayEle]:[this.popupEle],i.cssClass.split(/\s+/).filter(function(e){return e.length>0})),e.cssClass&&t.addClass(this.overlayEle?[this.popupEle,this.overlayEle]:[this.popupEle],e.cssClass.split(/\s+/).filter(function(e){return e.length>0}));break;case"visible":case"disabled":this.hide();break;case"enableRtl":if(!this.popupEle)break;this.setRTL();break;case"openIconCss":this.isMenuOpen||this.fab.setProperties({iconCss:this.openIconCss});break;case"closeIconCss":this.isMenuOpen&&this.fab.setProperties({iconCss:this.closeIconCss});break;case"position":if(!this.popupEle)break;this.updatePositionProperties();break;case"direction":if(!this.popupEle||this.popupTemplate)break;this.updatePositionProperties();break;case"popupTemplate":this.updatePopupTemplate();break;case"target":if(this.hidePopupEle(),this.checkTarget(),this.overlayEle&&this.element.insertAdjacentElement("beforebegin",this.overlayEle),!this.popupEle)break;this.element.insertAdjacentElement("afterend",this.popupEle),this.updatePositionProperties();break;case"items":case"itemTemplate":if(this.popupTemplate)break;this.updatePopupItems();break;case"modal":e.modal?this.createOverlay():this.removeOverlayEle();break;case"mode":if(!this.popupEle||this.popupTemplate)break;this.popupEle.classList.remove(J,G),this.popupEle.classList.add("Radial"===this.mode?J:G),this.updatePositionProperties();break;case"radialSettings":this.popupEle&&"Radial"===this.mode&&!this.popupTemplate&&this.setRadialPosition();break;case"opensOnHover":this.opensOnHover?(this.unwireFabClick(),this.wireFabHover()):(this.unwireFabHover(),this.wireFabClick())}},W([t.Complex({},ce)],i.prototype,"animation",void 0),W([t.Property("")],i.prototype,"content",void 0),W([t.Property("")],i.prototype,"closeIconCss",void 0),W([t.Property("")],i.prototype,"cssClass",void 0),W([t.Property("Auto")],i.prototype,"direction",void 0),W([t.Property(!1)],i.prototype,"disabled",void 0),W([t.Property("Left")],i.prototype,"iconPosition",void 0),W([t.Collection([],de)],i.prototype,"items",void 0),W([t.Property("")],i.prototype,"itemTemplate",void 0),W([t.Property("Linear")],i.prototype,"mode",void 0),W([t.Property("")],i.prototype,"openIconCss",void 0),W([t.Property(!1)],i.prototype,"opensOnHover",void 0),W([t.Property("BottomRight")],i.prototype,"position",void 0),W([t.Property(!1)],i.prototype,"modal",void 0),W([t.Property("")],i.prototype,"popupTemplate",void 0),W([t.Complex({},he)],i.prototype,"radialSettings",void 0),W([t.Property("")],i.prototype,"target",void 0),W([t.Property(!0)],i.prototype,"visible",void 0),W([t.Property(!0)],i.prototype,"isPrimary",void 0),W([t.Event()],i.prototype,"beforeClose",void 0),W([t.Event()],i.prototype,"beforeItemRender",void 0),W([t.Event()],i.prototype,"beforeOpen",void 0),W([t.Event()],i.prototype,"created",void 0),W([t.Event()],i.prototype,"clicked",void 0),W([t.Event()],i.prototype,"onClose",void 0),W([t.Event()],i.prototype,"onOpen",void 0),i=W([t.NotifyPropertyChanges],i)}(t.Component),fe=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)}}(),me=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},ve=function(e,t,i,s){return new(i||(i=Promise))(function(n,o){function r(e){try{a(s.next(e))}catch(e){o(e)}}function l(e){try{a(s.throw(e))}catch(e){o(e)}}function a(e){e.done?n(e.value):new i(function(t){t(e.value)}).then(r,l)}a((s=s.apply(e,t||[])).next())})},ye=function(e,t){function i(e){return function(t){return s([e,t])}}function s(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(r=a.trys,!(r=r.length>0&&r[r.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}var n,o,r,l,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return l={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l},ge=function(e){function i(t,i){return e.call(this,t,i)||this}return fe(i,e),i.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.smartPasteBtnClickHandler,this)},i.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.smartPasteBtnClickHandler)},i.prototype.smartPasteBtnClickHandler=function(e){return ve(this,void 0,void 0,function(){var t,i,s,n,o,r,l,a,p;return ye(this,function(c){switch(c.label){case 0:return t=e.target,(i=t.closest("form"))?(s=this.getFormFields(i),0===s.length?[2]:[4,this.getClipboardContent().then(function(e){return e})]):[2];case 1:if("Clipboard API not supported"===(n=c.sent())||"Clipboard access failed"===n)return[3,6];c.label=2;case 2:return c.trys.push([2,,5,6]),this.disabled=!0,o=s.map(function(e){return{fieldName:e.fieldName,description:e.description,allowedValues:e.allowedValues,type:e.type}}),r="\nCurrent date: "+(new Date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})+"\n\nEach response line matches the following format:\nFIELD identifier^^^value\n\nGive a response with the following lines only, with values inferred from USER_DATA:\n"+this.formatFields(o)+"\nEND_RESPONSE\n\nDo not explain how the values were determined.\nFor fields without any corresponding information in USER_DATA, use value NO_DATA.",l="\nUSER_DATA: "+n+"\n ",a={messages:[{role:"system",content:r},{role:"user",content:l}],temperature:0,topP:1,maxTokens:2e3,frequencyPenalty:.1,presencePenalty:0,stop:["END_RESPONSE"]},"function"!=typeof this.aiAssistHandler?[3,4]:[4,this.aiAssistHandler(a)];case 3:"string"==typeof(p=c.sent())&&""!==p&&this.setFormFields(i,s,p),c.label=4;case 4:return[3,6];case 5:return this.disabled=!1,[7];case 6:return[2]}})})},i.prototype.formatFields=function(e){var t=[];return e.forEach(function(e){var i=[];i.push("\nFIELD "+e.fieldName+"^^^"),e.description&&i.push("The "+e.description),e.allowedValues&&e.allowedValues.length>0?(i.push(" (multiple choice, with allowed values: "),i.push(e.allowedValues.map(function(e){return""+e}).join(",")),i.push(")")):i.push(" of type "+e.type),t.push(i.join(""))}),t.join("")},i.prototype.setFormFields=function(e,t,i){var s=this,n={},o=null;i.split("\n").forEach(function(e){if(e.startsWith("FIELD ")){var t=e.substring("FIELD ".length).split("^^^");2===t.length&&(n[""+t[0]]=t[1],o=t[0])}else o&&(n[""+o]+="\n"+e)}),t.forEach(function(t){var i=n[t.fieldName];if(void 0!==i){if("NO_DATA"===(i=i.trim()))return;if(t.element instanceof HTMLInputElement&&"radio"===t.element.type){var o=s.findRadioButton(e,t.element.name,i);o&&s.updateElementValue(o,"true")}else s.updateElementValue(t.element,i)}})},i.prototype.findRadioButton=function(e,t,i){var s=this,n=Array.from(e.querySelectorAll("input[type=radio]")).filter(function(e){return e instanceof HTMLInputElement&&e.name===t}).map(function(t){return{elem:t,text:s.getElementDescription(e,t)}}),o=n.find(function(e){return e.text===i});if(o)return o.elem;var r=n.filter(function(e){return e.text&&e.text.includes(i)});return 1===r.length?r[0].elem:null},i.prototype.triggerBeforeChange=function(e){e.dispatchEvent(new CustomEvent("beforeinput",{bubbles:!0,detail:{fromSmartComponents:!0}}))},i.prototype.triggerAfterChange=function(e){e.dispatchEvent(new CustomEvent("input",{bubbles:!0,detail:{fromSmartComponents:!0}})),e.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{fromSmartComponents:!0}}))},i.prototype.updateElementValue=function(e,t){var i=e.classList.contains("e-control");if(e instanceof HTMLInputElement&&("radio"===e.type||"checkbox"===e.type)){var s=null==t?void 0:t.toString().toLowerCase(),n="true"===s||"yes"===s||"on"===s;e.checked!==n&&(this.triggerBeforeChange(e),i?e.ej2_instances[0].checked=n:e.checked=n,this.triggerAfterChange(e))}else if(e instanceof HTMLSelectElement){var o=t.toString(),r=null,l=Array.from(e.querySelectorAll("option")),a=l.filter(function(e){return e.textContent===o});if(a.length>0)r=l.indexOf(a[0]);else{var p=l.filter(function(e){return e.textContent&&e.textContent.indexOf(o)>=0});1===p.length&&(r=l.indexOf(p[0]))}null!==r&&e.selectedIndex!==r&&(this.triggerBeforeChange(e),i?e.ej2_instances[0].index=r:e.selectedIndex=r,this.triggerAfterChange(e))}else this.triggerBeforeChange(e),e.classList.contains("e-rating")||e.classList.contains("e-colorpicker")?e.ej2_instances[0].value=t:e.value=t,this.triggerAfterChange(e);e.focus()},i.prototype.getFormFields=function(e){var t=this,i=[],s=0;return e.querySelectorAll("input, select, textarea").forEach(function(n){if((n instanceof HTMLInputElement||n instanceof HTMLSelectElement||n instanceof HTMLTextAreaElement)&&"hidden"!==n.type&&!t.isFieldIgnore(n)){var o="radio"===n.type,r=o?n.name:n.id||n.name||"unidentified_"+ ++s;if(!o||!i.find(function(e){return e.fieldName===r})){var l=null;if(o||(l=t.getElementDescription(e,n))){var a={fieldName:n.name,description:l,element:n,type:"checkbox"===n.type?"boolean":"number"===n.type?"number":"string"};if(n instanceof HTMLSelectElement){var p=Array.from(n.querySelectorAll("option")).filter(function(e){return e.value});a.allowedValues=p.map(function(e){return e.textContent}),a.type="fixed-choices"}else o&&(a.allowedValues=[],a.type="fixed-choices",Array.from(e.querySelectorAll("input[type=radio]")).forEach(function(i){if(i.name===r){var s=t.getElementDescription(e,i);s&&a.allowedValues.push(s)}}));i.push(a)}}}}),i},i.prototype.isFieldIgnore=function(e){return e.hasAttribute("data-smartpaste-ignore")||e.hasAttribute("aria-disabled")&&"true"===e.getAttribute("aria-disabled")||e.hasAttribute("disabled")||e.hasAttribute("readonly")||e.hasAttribute("aria-readonly")&&"true"===e.getAttribute("aria-readonly")||e.hasAttribute("aria-hidden")&&"true"===e.getAttribute("aria-hidden")},i.prototype.getElementDescription=function(e,t){if(t.hasAttribute("data-smartpaste-description"))return t.getAttribute("data-smartpaste-description");if((t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&t.placeholder)return t.placeholder;var i=e.querySelector('label[for="'+t.id+'"]');return i?i.textContent.trim():t.name||t.id},i.prototype.getClipboardContent=function(){return ve(this,void 0,void 0,function(){var e,t,i;return ye(this,function(s){switch(s.label){case 0:return e=navigator,t=document.getElementById("custom-clipboard"),t&&t.value?[2,t.value]:[3,1];case 1:if("undefined"==typeof window||!e.clipboard||!e.clipboard.readText)return[3,6];s.label=2;case 2:return s.trys.push([2,4,,5]),[4,e.clipboard.readText()];case 3:return[2,s.sent()];case 4:return i=s.sent(),[2,"Clipboard access failed"];case 5:return[3,7];case 6:return[2,"Clipboard API not supported"];case 7:return[2]}})})},me([t.Property()],i.prototype,"aiAssistHandler",void 0),i}(f);return e.BeforeChangeEventArgs=p,e.Button=f,e.CheckBox=C,e.Chip=D,e.ChipList=M,e.Fab=F,e.RadialSettings=he,e.RadioButton=H,e.SmartPasteButton=ge,e.SpeedDial=ue,e.SpeedDialAnimationSettings=ce,e.SpeedDialItem=de,e.Switch=S,e.buttonObserver=d,e.classNames=I,e.createCheckBox=r,e.destroy=n,e.getTextNode=s,e.preRender=o,e.rippleMouseHandler=l,e.setHiddenInput=a,e.wrapperInitialize=i,e}({},ej.base),this.ejs=ej;
//# sourceMappingURL=ej2-buttons.min.js.map