@syncfusion/ej2-buttons
Version:
A package of feature-rich Essential JS 2 components such as Button, CheckBox, RadioButton and Switch.
10 lines • 107 kB
JavaScript
/*!
* filename: ej2-buttons.min.js
* version : 30.2.4
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase")):"function"==typeof define&&define.amd?define(["SyncfusionBase"],t):"object"==typeof exports?exports.SyncfusionButtons=t(require("SyncfusionBase")):e.SyncfusionButtons=t(e.SyncfusionBase)}(self,e=>(()=>{"use strict";var t={766:t=>{t.exports=e}},i={};function s(e){var n=i[e];if(void 0!==n)return n.exports;var o=i[e]={exports:{}};return t[e](o,o.exports,s),o.exports}s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{s.r(n),s.d(n,{BeforeChangeEventArgs:()=>d,Button:()=>C,CheckBox:()=>M,Chip:()=>ne,ChipList:()=>se,Fab:()=>ge,FabPosition:()=>m,IconPosition:()=>h,LinearDirection:()=>me,RadialDirection:()=>ve,RadialSettings:()=>ht,RadioButton:()=>V,SmartPasteButton:()=>gt,SpeedDial:()=>ut,SpeedDialAnimationEffect:()=>ye,SpeedDialAnimationSettings:()=>ct,SpeedDialItem:()=>dt,SpeedDialMode:()=>fe,Switch:()=>$,buttonObserver:()=>v,classNames:()=>ie,createCheckBox:()=>l,destroy:()=>o,getTextNode:()=>i,preRender:()=>r,rippleMouseHandler:()=>a,setHiddenInput:()=>p,wrapperInitialize:()=>t});var e=s(766);function t(t,i,s,n,o,r){var l=n;if(n.tagName===i){var a=(0,e.getValue)("ej2_instances",n);l=t("input",{attrs:{type:s}});for(var p=["change","cssClass","label","labelPosition","id"],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);(0,e.attributes)(n,{class:o}),n.appendChild(l),n.classList.add(r),n.classList.remove(r),(0,e.setValue)("ej2_instances",a,l),(0,e.deleteObject)(n,"ej2_instances")}return l}function i(e){for(var t,i=e.childNodes,s=0;s<i.length;s++)if(3===(t=i[s]).nodeType)return t;return null}function o(t,i,s){"INPUT"===s?(i.parentNode.insertBefore(t.element,i),(0,e.detach)(i),t.element.checked=!1,["name","value","disabled"].forEach(function(e){t.element.removeAttribute(e)})):(["role","aria-checked","class"].forEach(function(e){i.removeAttribute(e)}),i.innerHTML="",t.element=i)}function r(i,s,n,o,r){o=t(i.createElement,s,"checkbox",o,n,r),i.element=o,"checkbox"!==i.element.getAttribute("type")&&i.element.setAttribute("type","checkbox"),i.element.id||(i.element.id=(0,e.getUniqueID)("e-"+r))}function l(t,i,s){void 0===i&&(i=!1),void 0===s&&(s={});var n=t("div",{className:"e-checkbox-wrapper e-css"});if(s.cssClass&&(0,e.addClass)([n],s.cssClass.split(" ")),s.enableRtl&&n.classList.add("e-rtl"),i){var o=t("span",{className:"e-ripple-container"});(0,e.rippleEffect)(o,{isCenterRipple:!0,duration:400}),n.appendChild(o)}var r=t("span",{className:"e-frame e-icons"});if(s.checked&&r.classList.add("e-check"),n.appendChild(r),s.label){var l=t("span",{className:"e-label"});s.disableHtmlEncode?l.textContent=s.label:l.innerHTML=s.label,n.appendChild(l)}return n}function a(e,t){if(t){var i=document.createEvent("MouseEvents");i.initEvent(e.type,!1,!0),t.dispatchEvent(i)}}function p(e,t){e.element.getAttribute("ejs-for")&&t.appendChild(e.createElement("input",{attrs:{name:e.name||e.element.name,value:"false",type:"hidden"}}))}var c,h,d=function(){},u=(c=function(e,t){return c=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])},c(e,t)},function(e,t){function i(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),f=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};!function(e){e.Left="Left",e.Right="Right",e.Top="Top",e.Bottom="Bottom"}(h||(h={}));var m,v=new e.Observer,y="e-rtl",g="e-btn",b="e-primary",E="e-icon-btn",C=function(t){function s(e,i){return t.call(this,e,i)||this}return u(s,t),s.prototype.preRender=function(){},s.prototype.render=function(){this.initialize(),this.removeRippleEffect=(0,e.rippleEffect)(this.element,{selector:"."+g}),this.renderComplete()},s.prototype.initialize=function(){if(this.cssClass&&(0,e.addClass)([this.element],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.isPrimary&&this.element.classList.add(b),!(0,e.isBlazor)()||(0,e.isBlazor)()&&"progress-btn"!==this.getModuleName()){if(this.content){var t=this.enableHtmlSanitizer?e.SanitizeHtmlHelper.sanitize(this.content):this.content;this.element.innerHTML=t}this.setIconCss()}this.enableRtl&&this.element.classList.add(y),this.disabled?this.controlStatus(this.disabled):this.wireEvents()},s.prototype.controlStatus=function(e){this.element.disabled=e},s.prototype.setIconCss=function(){if(this.iconCss){var e=this.createElement("span",{className:"e-btn-icon "+this.iconCss});this.element.textContent.trim()?(e.classList.add("e-icon-"+this.iconPosition.toLowerCase()),"Top"!==this.iconPosition&&"Bottom"!==this.iconPosition||this.element.classList.add("e-"+this.iconPosition.toLowerCase()+"-icon-btn")):this.element.classList.add(E);var t=this.element.childNodes[0];!t||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?this.element.appendChild(e):this.element.insertBefore(e,t)}},s.prototype.wireEvents=function(){this.isToggle&&e.EventHandler.add(this.element,"click",this.btnClickHandler,this)},s.prototype.unWireEvents=function(){this.isToggle&&e.EventHandler.remove(this.element,"click",this.btnClickHandler)},s.prototype.btnClickHandler=function(){this.element.classList.contains("e-active")?this.element.classList.remove("e-active"):this.element.classList.add("e-active")},s.prototype.destroy=function(){var i=[b,y,E,"e-success","e-info","e-danger","e-warning","e-flat","e-outline","e-small","e-bigger","e-active","e-round","e-top-icon-btn","e-bottom-icon-btn"];this.cssClass&&(i=i.concat(this.cssClass.split(/\s+/).filter(function(e){return e.length>0}))),t.prototype.destroy.call(this),(0,e.removeClass)([this.element],i),this.element.getAttribute("class")||this.element.removeAttribute("class"),this.disabled&&this.element.removeAttribute("disabled"),this.content&&(this.element.innerHTML=this.element.innerHTML.replace(this.content,""));var s=this.element.querySelector("span.e-btn-icon");s&&(0,e.detach)(s),this.unWireEvents(),e.isRippleEnabled&&this.removeRippleEffect()},s.prototype.getModuleName=function(){return"btn"},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.Inject=function(){},s.prototype.onPropertyChanged=function(t,s){for(var n=this.element.querySelector("span.e-btn-icon"),o=0,r=Object.keys(t);o<r.length;o++){switch(r[o]){case"isPrimary":t.isPrimary?this.element.classList.add(b):this.element.classList.remove(b);break;case"disabled":this.controlStatus(t.disabled);break;case"iconCss":(n=this.element.querySelector("span.e-btn-icon"))?t.iconCss?(n.className="e-btn-icon "+t.iconCss,this.element.textContent.trim()&&("Left"===this.iconPosition?n.classList.add("e-icon-left"):n.classList.add("e-icon-right"))):(0,e.detach)(n):this.setIconCss();break;case"iconPosition":(0,e.removeClass)([this.element],["e-top-icon-btn","e-bottom-icon-btn"]),(n=this.element.querySelector("span.e-btn-icon"))&&(0,e.detach)(n),this.setIconCss();break;case"cssClass":s.cssClass&&(0,e.removeClass)([this.element],s.cssClass.split(/\s+/).filter(function(e){return e.length>0})),t.cssClass&&(0,e.addClass)([this.element],t.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":t.enableRtl?this.element.classList.add(y):this.element.classList.remove(y);break;case"content":i(this.element)||this.element.classList.remove(E),(!(0,e.isBlazor)()||(0,e.isBlazor)()&&!this.isServerRendered&&"progress-btn"!==this.getModuleName())&&(this.enableHtmlSanitizer&&(t.content=e.SanitizeHtmlHelper.sanitize(t.content)),this.element.innerHTML=t.content,this.setIconCss());break;case"isToggle":t.isToggle?e.EventHandler.add(this.element,"click",this.btnClickHandler,this):(e.EventHandler.remove(this.element,"click",this.btnClickHandler),(0,e.removeClass)([this.element],["e-active"]))}}},s.prototype.click=function(){this.element.click()},s.prototype.focusIn=function(){this.element.focus()},f([(0,e.Property)("Left")],s.prototype,"iconPosition",void 0),f([(0,e.Property)("")],s.prototype,"iconCss",void 0),f([(0,e.Property)(!1)],s.prototype,"disabled",void 0),f([(0,e.Property)(!1)],s.prototype,"isPrimary",void 0),f([(0,e.Property)("")],s.prototype,"cssClass",void 0),f([(0,e.Property)("")],s.prototype,"content",void 0),f([(0,e.Property)(!1)],s.prototype,"isToggle",void 0),f([(0,e.Property)()],s.prototype,"locale",void 0),f([(0,e.Property)(!0)],s.prototype,"enableHtmlSanitizer",void 0),f([(0,e.Event)()],s.prototype,"created",void 0),s=f([e.NotifyPropertyChanges],s)}(e.Component),k=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),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},P="e-check",H="e-checkbox-disabled",A="e-frame",w="e-stop",x="e-label",S="e-ripple-container",T="e-ripple-check",R="e-ripple-stop",O="e-rtl",N="e-checkbox-wrapper",I=["title","class","style","disabled","readonly","name","value","id","tabindex","aria-label","required"],M=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.isFocused=!1,s.isMouseClick=!1,s.clickTriggered=!1,s.validCheck=!0,s.type="checkbox",s}return k(s,i),s.prototype.changeState=function(t,i,s){var n=this.getWrapper(),o=null,r=null;n&&(r=n.getElementsByClassName(A)[0],e.isRippleEnabled&&(o=n.getElementsByClassName(S)[0])),"check"===t?(r&&(r.classList.remove(w),r.classList.add(P)),o&&(o.classList.remove(R),o.classList.add(T)),this.element.checked=!0,(this.element.required||(0,e.closest)(this.element,"form")&&(0,e.closest)(this.element,"form").classList.contains("e-formvalidator"))&&this.validCheck&&!i&&s?(this.element.checked=!1,this.validCheck=!1):(this.element.required||(0,e.closest)(this.element,"form")&&(0,e.closest)(this.element,"form").classList.contains("e-formvalidator"))&&(this.validCheck=!0)):"uncheck"===t?(r&&(0,e.removeClass)([r],[P,w]),o&&(0,e.removeClass)([o],[T,R]),this.element.checked=!1,(this.element.required||(0,e.closest)(this.element,"form")&&(0,e.closest)(this.element,"form").classList.contains("e-formvalidator"))&&this.validCheck&&!i&&s?(this.element.checked=!0,this.validCheck=!1):(this.element.required||(0,e.closest)(this.element,"form")&&(0,e.closest)(this.element,"form").classList.contains("e-formvalidator"))&&(this.validCheck=!0)):(r&&(r.classList.remove(P),r.classList.add(w)),o&&(o.classList.remove(T),o.classList.add(R)),this.element.indeterminate=!0,this.indeterminate=!0)},s.prototype.clickHandler=function(t){if("INPUT"===t.target.tagName&&this.clickTriggered)return this.changeState(this.checked?"check":"uncheck"),void(this.clickTriggered=!1);("SPAN"===t.target.tagName||"LABEL"===t.target.tagName||(0,e.closest)(t.target,".e-label"))&&(this.clickTriggered=!0),this.isMouseClick&&(this.focusOutHandler(),this.isMouseClick=!1),this.indeterminate?(this.changeState(this.checked?"check":"uncheck",!1,!0),this.indeterminate=!1,this.element.indeterminate=!1):this.checked?(this.changeState("uncheck",!1,!0),this.checked=!1):(this.changeState("check",!1,!0),this.checked=!0);var i={checked:this.updateVueArrayModel(!1),event:t};this.trigger("change",i),t.stopPropagation()},s.prototype.destroy=function(){var t=this,s=this.getWrapper();i.prototype.destroy.call(this),this.wrapper&&(s=this.wrapper,this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(this.getWrapper()&&s.parentNode&&s.parentNode.insertBefore(this.element,s),(0,e.detach)(s),this.element.checked=!1,this.indeterminate&&(this.element.indeterminate=!1),["name","value","disabled"].forEach(function(e){t.element.removeAttribute(e)})):(["class"].forEach(function(e){s.removeAttribute(e)}),s.innerHTML="",this.element=s,this.refreshing&&(["e-control","e-checkbox","e-lib"].forEach(function(e){t.element.classList.add(e)}),(0,e.setValue)("ej2_instances",[this],this.element))))},s.prototype.focusHandler=function(){this.isFocused=!0},s.prototype.focusOutHandler=function(){var e=this.getWrapper();e&&e.classList.remove("e-focus"),this.isFocused=!1},s.prototype.getModuleName=function(){return"checkbox"},s.prototype.getPersistData=function(){return this.addOnPersist(["checked","indeterminate"])},s.prototype.getWrapper=function(){return this.element&&this.element.parentElement?this.element.parentElement.parentElement:null},s.prototype.getLabel=function(){return this.element?this.element.parentElement:null},s.prototype.initialize=function(){(0,e.isNullOrUndefined)(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.name&&this.element.setAttribute("name",this.name),this.element.setAttribute("tabindex","0"),this.value&&(this.element.setAttribute("value",this.value),this.isVue&&"boolean"==typeof this.value&&!0===this.value&&this.setProperties({checked:!0},!0)),this.checked&&this.changeState("check",!0),this.indeterminate&&this.changeState(),this.disabled&&this.setDisabled()},s.prototype.initWrapper=function(){var t=this.element.parentElement;t.classList.contains(N)||(t=this.createElement("div",{className:N}),this.element.parentNode&&this.element.parentNode.insertBefore(t,this.element));var i=this.createElement("label",{attrs:{for:this.htmlAttributes.id?this.htmlAttributes.id:this.element.id}}),s=this.createElement("span",{className:"e-icons "+A});if(t.classList.add("e-wrapper"),this.enableRtl&&t.classList.add(O),this.cssClass&&(0,e.addClass)([t],this.cssClass.replace(/\s+/g," ").trim().split(" ")),t.appendChild(i),i.appendChild(this.element),p(this,i),i.appendChild(s),e.isRippleEnabled){var n=this.createElement("span",{className:S});"Before"===this.labelPosition?i.appendChild(n):i.insertBefore(n,s),(0,e.rippleEffect)(n,{duration:400,isCenterRipple:!0})}this.label&&this.setText(this.label)},s.prototype.keyUpHandler=function(){this.isFocused&&this.getWrapper().classList.add("e-focus")},s.prototype.labelMouseDownHandler=function(e){this.isMouseClick=!0,a(e,this.getWrapper().getElementsByClassName(S)[0])},s.prototype.labelMouseLeaveHandler=function(e){var t=this.getLabel().getElementsByClassName(S)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element").length-1;i>0;i--)t.removeChild(t.childNodes[i]);a(e,t)}},s.prototype.labelMouseUpHandler=function(e){this.isMouseClick=!0;var t=this.getWrapper().getElementsByClassName(S)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element"),s=0;s<i.length-1;s++)t.removeChild(t.childNodes[s]);a(e,t)}},s.prototype.onPropertyChanged=function(t,i){for(var s=this.getWrapper(),n=0,o=Object.keys(t);n<o.length;n++){switch(o[n]){case"checked":this.indeterminate=!1,this.element.indeterminate=!1,this.changeState(t.checked?"check":"uncheck");break;case"indeterminate":t.indeterminate?this.changeState():(this.element.indeterminate=!1,this.changeState(this.checked?"check":"uncheck"));break;case"disabled":t.disabled?(this.setDisabled(),this.wrapper=this.getWrapper(),this.unWireEvents()):(this.element.disabled=!1,s.classList.remove(H),s.setAttribute("aria-disabled","false"),this.wireEvents());break;case"cssClass":i.cssClass&&(0,e.removeClass)([s],i.cssClass.split(/\s+/).filter(function(e){return e.length>0})),t.cssClass&&(0,e.addClass)([s],t.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":t.enableRtl?s.classList.add(O):s.classList.remove(O);break;case"label":this.setText(t.label);break;case"labelPosition":var r=s.getElementsByClassName(x)[0],l=s.getElementsByTagName("label")[0];(0,e.detach)(r),"After"===t.labelPosition?l.appendChild(r):l.insertBefore(r,s.getElementsByClassName(A)[0]);break;case"name":this.element.setAttribute("name",t.name);break;case"value":if(this.isVue&&"object"==typeof t.value)break;this.element.setAttribute("value",t.value);break;case"htmlAttributes":this.updateHtmlAttributeToWrapper()}}},s.prototype.preRender=function(){var i=this.element;this.tagName=this.element.tagName,i=t(this.createElement,"EJS-CHECKBOX","checkbox",i,N,"checkbox"),this.element=i,"checkbox"!==this.element.getAttribute("type")&&this.element.setAttribute("type","checkbox"),this.element.id||(this.element.id=(0,e.getUniqueID)("e-"+this.getModuleName()))},s.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents(),this.updateHtmlAttributeToWrapper(),this.updateVueArrayModel(!0),this.renderComplete(),this.wrapper=this.getWrapper()},s.prototype.setDisabled=function(){var e=this.getWrapper();this.element.disabled=!0,e.classList.add(H),e.setAttribute("aria-disabled","true")},s.prototype.setText=function(t){var i=this.getWrapper();if(i){var s=i.getElementsByClassName(x)[0];if(s)s.innerHTML=this.enableHtmlSanitizer?e.SanitizeHtmlHelper.sanitize(t):t;else{t=this.enableHtmlSanitizer?e.SanitizeHtmlHelper.sanitize(t):t,s=this.createElement("span",{className:x,innerHTML:t});var n=i.getElementsByTagName("label")[0];"Before"===this.labelPosition?n.insertBefore(s,i.getElementsByClassName(A)[0]):n.appendChild(s)}}},s.prototype.changeHandler=function(e){e.stopPropagation()},s.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,this.element.checked=this.initialCheckedValue},s.prototype.unWireEvents=function(){var t=this.wrapper;if(e.EventHandler.remove(this.element,"keyup",this.keyUpHandler),e.EventHandler.remove(this.element,"focus",this.focusHandler),e.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t){e.EventHandler.remove(t,"click",this.clickHandler);var i=t.getElementsByTagName("label")[0];i&&(e.EventHandler.remove(i,"mousedown",this.labelMouseDownHandler),e.EventHandler.remove(i,"mouseup",this.labelMouseUpHandler),e.EventHandler.remove(i,"mouseleave",this.labelMouseLeaveHandler))}var s=(0,e.closest)(this.element,"form");s&&e.EventHandler.remove(s,"reset",this.formResetHandler),"EJS-CHECKBOX"===this.tagName&&e.EventHandler.remove(this.element,"change",this.changeHandler)},s.prototype.wireEvents=function(){var t=this.getWrapper();e.EventHandler.add(t,"click",this.clickHandler,this),e.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),e.EventHandler.add(this.element,"focus",this.focusHandler,this),e.EventHandler.add(this.element,"focusout",this.focusOutHandler,this);var i=t.getElementsByTagName("label")[0];e.EventHandler.add(i,"mousedown",this.labelMouseDownHandler,this),e.EventHandler.add(i,"mouseup",this.labelMouseUpHandler,this),e.EventHandler.add(i,"mouseleave",this.labelMouseLeaveHandler,this);var s=(0,e.closest)(this.element,"form");s&&e.EventHandler.add(s,"reset",this.formResetHandler,this),"EJS-CHECKBOX"===this.tagName&&e.EventHandler.add(this.element,"change",this.changeHandler,this)},s.prototype.updateVueArrayModel=function(e){if(this.isVue&&"object"==typeof this.value){var t=this.element.value;if(t&&this.value){if(!e){var i=this.value.indexOf(t);return this.checked?i<0&&this.value.push(t):i>-1&&this.value.splice(i,1),this.value}for(var s=0;s<this.value.length;s++)t===this.value[s]&&(this.changeState("check"),this.setProperties({checked:!0},!0))}}return this.validCheck?this.element.checked:!this.element.checked},s.prototype.updateHtmlAttributeToWrapper=function(){if(!(0,e.isNullOrUndefined)(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t],n=this.getWrapper();if(I.indexOf(s)>-1)if("class"===s)(0,e.addClass)([n],this.htmlAttributes[""+s].split(" "));else if("title"===s)n.setAttribute(s,this.htmlAttributes[""+s]);else if("style"===s){this.getWrapper().getElementsByClassName(A)[0].setAttribute(s,this.htmlAttributes[""+s])}else"disabled"===s?("true"===this.htmlAttributes[""+s]&&this.setDisabled(),this.element.setAttribute(s,this.htmlAttributes[""+s])):this.element.setAttribute(s,this.htmlAttributes[""+s]);else n.setAttribute(s,this.htmlAttributes[""+s])}},s.prototype.click=function(){this.element.click()},s.prototype.focusIn=function(){this.element.focus()},L([(0,e.Event)()],s.prototype,"change",void 0),L([(0,e.Event)()],s.prototype,"created",void 0),L([(0,e.Property)(!1)],s.prototype,"checked",void 0),L([(0,e.Property)("")],s.prototype,"cssClass",void 0),L([(0,e.Property)(!1)],s.prototype,"disabled",void 0),L([(0,e.Property)(!1)],s.prototype,"indeterminate",void 0),L([(0,e.Property)("")],s.prototype,"label",void 0),L([(0,e.Property)("After")],s.prototype,"labelPosition",void 0),L([(0,e.Property)("")],s.prototype,"name",void 0),L([(0,e.Property)("")],s.prototype,"value",void 0),L([(0,e.Property)(!0)],s.prototype,"enableHtmlSanitizer",void 0),L([(0,e.Property)({})],s.prototype,"htmlAttributes",void 0),s=L([e.NotifyPropertyChanges],s)}(e.Component),D=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),B=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},j="e-label",F="e-ripple-container",U="e-rtl",W="e-radio-wrapper",_=["title","class","style","disabled","readonly","name","value","id"],V=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.isFocused=!1,s.type="radio",s}var n;return D(s,i),n=s,s.prototype.changeHandler=function(e){this.checked=!0,this.dataBind();var t=this.element.getAttribute("value");t=this.isVue&&t?this.element.value:this.value;var i=typeof this.value;this.isVue&&"boolean"===i&&(t="true"===t),this.trigger("change",{value:t,event:e}),this.isAngular&&e.stopPropagation()},s.prototype.updateChange=function(){for(var t,i,s=this.getRadioGroup(),o=0;o<s.length;o++)(t=s[o])!==this.element&&((i=(0,e.getInstance)(t,n)).checked=!1,"EJS-RADIOBUTTON"===this.tagName&&(i.angularValue=this.value))},s.prototype.destroy=function(){var t=this,s=this.wrapper;i.prototype.destroy.call(this),s&&(this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(s.parentNode&&s.parentNode.insertBefore(this.element,s),(0,e.detach)(s),this.element.checked=!1,["name","value","disabled"].forEach(function(e){t.element.removeAttribute(e)})):(["role","aria-checked","class"].forEach(function(e){s.removeAttribute(e)}),s.innerHTML="",this.element=this.wrapper,this.refreshing&&(["e-control","e-radio","e-lib"].forEach(function(e){t.element.classList.add(e)}),(0,e.setValue)("ej2_instances",[this],this.element))))},s.prototype.focusHandler=function(){this.isFocused=!0},s.prototype.focusOutHandler=function(){var e=this.getLabel();e&&e.classList.remove("e-focus")},s.prototype.getModuleName=function(){return"radio"},s.prototype.getSelectedValue=function(){for(var e,t=this.getRadioGroup(),i=0,s=t.length;i<s;i++)if((e=t[i]).checked)return e.value;return""},s.prototype.getRadioGroup=function(){return document.querySelectorAll('input.e-radio[name="'+this.element.getAttribute("name")+'"]')},s.prototype.getPersistData=function(){return this.addOnPersist(["checked"])},s.prototype.getWrapper=function(){return this.element.parentElement?this.element.parentElement:null},s.prototype.getLabel=function(){return this.element.nextElementSibling?this.element.nextElementSibling:null},s.prototype.initialize=function(){(0,e.isNullOrUndefined)(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.initWrapper(),this.updateHtmlAttribute(),this.name&&this.element.setAttribute("name",this.name);var t=this.element.getAttribute("value"),i=typeof this.value;this.isVue&&"boolean"===i&&(t="true"===t),(this.isVue?this.value&&"boolean"!==i&&!t:this.value)&&this.element.setAttribute("value",this.value),this.checked&&(this.element.checked=!0),this.disabled&&this.setDisabled()},s.prototype.initWrapper=function(){var t,i=this.element.parentElement;i.classList.contains(W)||(i=this.createElement("div",{className:W}),this.element.parentNode&&this.element.parentNode.insertBefore(i,this.element));var s=this.createElement("label",{attrs:{for:this.element.id}});i.appendChild(this.element),i.appendChild(s),e.isRippleEnabled&&(t=this.createElement("span",{className:F}),s.appendChild(t),(0,e.rippleEffect)(t,{duration:400,isCenterRipple:!0})),i.classList.add("e-wrapper"),this.enableRtl&&s.classList.add(U),this.cssClass&&(0,e.addClass)([i],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.label&&this.setText(this.label)},s.prototype.keyUpHandler=function(){this.isFocused&&this.getLabel().classList.add("e-focus")},s.prototype.labelMouseDownHandler=function(e){a(e,this.getLabel().getElementsByClassName(F)[0])},s.prototype.labelMouseLeaveHandler=function(e){var t=this.getLabel().getElementsByClassName(F)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element").length-1;i>0;i--)t.removeChild(t.childNodes[i]);a(e,t)}},s.prototype.labelMouseUpHandler=function(e){var t=this.getLabel().getElementsByClassName(F)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element").length-1;i>0;i--)t.removeChild(t.childNodes[i]);a(e,t)}},s.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,this.initialCheckedValue&&(0,e.attributes)(this.element,{checked:"true"})},s.prototype.onPropertyChanged=function(t,i){for(var s=this.getWrapper(),n=this.getLabel(),o=0,r=Object.keys(t);o<r.length;o++){switch(r[o]){case"checked":t.checked&&this.updateChange(),this.element.checked=t.checked;break;case"disabled":t.disabled?(this.setDisabled(),this.unWireEvents()):(this.element.disabled=!1,this.wireEvents());break;case"cssClass":i.cssClass&&(0,e.removeClass)([s],i.cssClass.split(/\s+/).filter(function(e){return e.length>0})),t.cssClass&&(0,e.addClass)([s],t.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":t.enableRtl?n.classList.add(U):n.classList.remove(U);break;case"label":this.setText(t.label);break;case"labelPosition":"Before"===t.labelPosition?n.classList.add("e-right"):n.classList.remove("e-right");break;case"name":this.element.setAttribute("name",t.name);break;case"value":var l=typeof this.htmlAttributes.value;if(!(0,e.isNullOrUndefined)(this.htmlAttributes)&&(this.htmlAttributes.value||"boolean"===l&&!this.htmlAttributes.value))break;this.element.setAttribute("value",t.value);break;case"htmlAttributes":this.updateHtmlAttribute()}}},s.prototype.preRender=function(){var i=this.element;if(this.formElement=(0,e.closest)(this.element,"form"),this.tagName=this.element.tagName,i=t(this.createElement,"EJS-RADIOBUTTON","radio",i,W,"radio"),this.element=i,"radio"!==this.element.getAttribute("type")&&this.element.setAttribute("type","radio"),this.element.id||(this.element.id=(0,e.getUniqueID)("e-"+this.getModuleName())),"EJS-RADIOBUTTON"===this.tagName){var s=this.element.getAttribute("formcontrolname");s&&(this.setProperties({name:s},!0),this.element.setAttribute("name",s))}},s.prototype.render=function(){this.initialize(),this.disabled||this.wireEvents(),this.renderComplete(),this.wrapper=this.getWrapper()},s.prototype.setDisabled=function(){this.element.disabled=!0},s.prototype.setText=function(t){var i=this.getLabel(),s=i.getElementsByClassName(j)[0];s?s.textContent=t:(t=this.enableHtmlSanitizer?e.SanitizeHtmlHelper.sanitize(t):t,s=this.createElement("span",{className:j,innerHTML:t}),i.appendChild(s)),"Before"===this.labelPosition?this.getLabel().classList.add("e-right"):this.getLabel().classList.remove("e-right")},s.prototype.updateHtmlAttribute=function(){if(!(0,e.isNullOrUndefined)(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t],n=this.element.parentElement;_.indexOf(s)>-1?"class"===s?(0,e.addClass)([n],this.htmlAttributes[""+s].replace(/\s+/g," ").trim().split(" ")):"title"===s||"style"===s?n.setAttribute(s,this.htmlAttributes[""+s]):this.element.setAttribute(s,this.htmlAttributes[""+s]):n.setAttribute(s,this.htmlAttributes[""+s])}},s.prototype.unWireEvents=function(){var t=this.wrapper;if(e.EventHandler.remove(this.element,"change",this.changeHandler),e.EventHandler.remove(this.element,"focus",this.focusHandler),e.EventHandler.remove(this.element,"focusout",this.focusOutHandler),e.EventHandler.remove(this.element,"keyup",this.keyUpHandler),t){var i=t.getElementsByTagName("label")[0];i&&(e.EventHandler.remove(i,"mousedown",this.labelMouseDownHandler),e.EventHandler.remove(i,"mouseup",this.labelMouseUpHandler),e.EventHandler.remove(i,"mouseleave",this.labelMouseLeaveHandler))}this.formElement&&e.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},s.prototype.wireEvents=function(){var t=this.getLabel();e.EventHandler.add(this.element,"change",this.changeHandler,this),e.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),e.EventHandler.add(this.element,"focus",this.focusHandler,this),e.EventHandler.add(this.element,"focusout",this.focusOutHandler,this);var i=t.getElementsByClassName(j)[0];i&&(e.EventHandler.add(i,"mousedown",this.labelMouseDownHandler,this),e.EventHandler.add(i,"mouseup",this.labelMouseUpHandler,this),e.EventHandler.add(i,"mouseleave",this.labelMouseLeaveHandler,this)),this.formElement&&e.EventHandler.add(this.formElement,"reset",this.formResetHandler,this)},s.prototype.click=function(){this.element.click()},s.prototype.focusIn=function(){this.element.focus()},B([(0,e.Event)()],s.prototype,"change",void 0),B([(0,e.Event)()],s.prototype,"created",void 0),B([(0,e.Property)(!1)],s.prototype,"checked",void 0),B([(0,e.Property)("")],s.prototype,"cssClass",void 0),B([(0,e.Property)(!1)],s.prototype,"disabled",void 0),B([(0,e.Property)("")],s.prototype,"label",void 0),B([(0,e.Property)("After")],s.prototype,"labelPosition",void 0),B([(0,e.Property)("")],s.prototype,"name",void 0),B([(0,e.Property)("")],s.prototype,"value",void 0),B([(0,e.Property)(!0)],s.prototype,"enableHtmlSanitizer",void 0),B([(0,e.Property)({})],s.prototype,"htmlAttributes",void 0),s=n=B([e.NotifyPropertyChanges],s)}(e.Component),q=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),z=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},K="e-switch-disabled",X="e-ripple-container",Y="e-ripple-check",J="e-rtl",G="e-switch-wrapper",Z="e-switch-active",Q=["title","class","style","disabled","readonly","name","value","aria-label","id","role","tabindex"],$=function(t){function i(e,i){var s=t.call(this,e,i)||this;return s.isFocused=!1,s.isDrag=!1,s.isWireEvents=!1,s}return q(i,t),i.prototype.changeState=function(t){var i=null,s=this.getWrapper(),n=s.querySelector(".e-switch-inner"),o=s.querySelector(".e-switch-handle");e.isRippleEnabled&&(i=s.getElementsByClassName(X)[0]),t?((0,e.addClass)([n,o],Z),this.element.checked=!0,this.checked=!0,i&&(0,e.addClass)([i],[Y])):((0,e.removeClass)([n,o],Z),this.element.checked=!1,this.checked=!1,i&&(0,e.removeClass)([i],[Y]))},i.prototype.clickHandler=function(e){if(!e||!this.element.closest("label")||e.target===this.element){this.isDrag=!1,this.focusOutHandler();var t={event:e,cancel:!1,checked:this.checked};if(this.trigger("beforeChange",t),!t.cancel){this.changeState(!t.checked),this.element.focus();var i={checked:this.element.checked,event:e};this.trigger("change",i)}}},i.prototype.destroy=function(){var i=this;t.prototype.destroy.call(this),this.disabled||this.unWireEvents(),this.formElement&&e.EventHandler.remove(this.formElement,"reset",this.formResetHandler),this.getWrapper()&&o(this,this.getWrapper(),this.tagName),this.refreshing&&(["e-control","e-switch","e-lib"].forEach(function(e){i.element.classList.add(e)}),(0,e.setValue)("ej2_instances",[this],this.element))},i.prototype.focusHandler=function(){this.isFocused=!0},i.prototype.focusOutHandler=function(){this.getWrapper().classList.remove("e-focus")},i.prototype.getModuleName=function(){return"switch"},i.prototype.getPersistData=function(){return this.addOnPersist(["checked"])},i.prototype.getWrapper=function(){return this.element.parentElement?this.element.parentElement:null},i.prototype.initialize=function(){this.element.setAttribute("role","switch"),(0,e.isNullOrUndefined)(this.initialSwitchCheckedValue)&&(this.initialSwitchCheckedValue=this.checked),this.name&&this.element.setAttribute("name",this.name),this.value&&this.element.setAttribute("value",this.value),this.checked&&this.changeState(!0),this.disabled&&this.setDisabled(),(this.onLabel||this.offLabel)&&this.setLabel(this.onLabel,this.offLabel)},i.prototype.initWrapper=function(){var t=this.element.parentElement;t.classList.contains(G)||(t=this.createElement("div",{className:G}),this.element.parentNode.insertBefore(t,this.element));var i=this.createElement("span",{className:"e-switch-inner"}),s=this.createElement("span",{className:"e-switch-on"}),n=this.createElement("span",{className:"e-switch-off"}),o=this.createElement("span",{className:"e-switch-handle"});if(t.appendChild(this.element),p(this,t),i.appendChild(s),i.appendChild(n),t.appendChild(i),t.appendChild(o),e.isRippleEnabled){var r=this.createElement("span",{className:X});o.appendChild(r),(0,e.rippleEffect)(r,{duration:400,isCenterRipple:!0})}t.classList.add("e-wrapper"),this.enableRtl&&t.classList.add(J),this.cssClass&&(0,e.addClass)([t],this.cssClass.replace(/\s+/g," ").trim().split(" "))},i.prototype.onPropertyChanged=function(t,i){for(var s=this.getWrapper(),n=0,o=Object.keys(t);n<o.length;n++){switch(o[n]){case"checked":this.changeState(t.checked);break;case"disabled":t.disabled?(this.setDisabled(),this.unWireEvents(),this.isWireEvents=!1):(this.element.disabled=!1,s.classList.remove(K),s.setAttribute("aria-disabled","false"),this.isWireEvents||(this.wireEvents(),this.isWireEvents=!0));break;case"value":this.element.setAttribute("value",t.value);break;case"name":this.element.setAttribute("name",t.name);break;case"onLabel":case"offLabel":this.setLabel(t.onLabel,t.offLabel);break;case"enableRtl":t.enableRtl?s.classList.add(J):s.classList.remove(J);break;case"cssClass":i.cssClass&&(0,e.removeClass)([s],i.cssClass.split(/\s+/).filter(function(e){return e.length>0})),t.cssClass&&(0,e.addClass)([s],t.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"htmlAttributes":this.updateHtmlAttribute()}}},i.prototype.preRender=function(){var t=this.element;this.formElement=(0,e.closest)(this.element,"form"),this.tagName=this.element.tagName,r(this,"EJS-SWITCH",G,t,this.getModuleName())},i.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents(),this.formElement&&e.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),this.renderComplete(),this.updateHtmlAttribute()},i.prototype.rippleHandler=function(e){a(e,this.getWrapper().getElementsByClassName(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]);a(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(K),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(!(0,e.isNullOrUndefined)(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t],n=this.getWrapper();Q.indexOf(s)>-1?"class"===s?(0,e.addClass)([n],this.htmlAttributes[""+s].split(" ")):"title"===s||"style"===s?n.setAttribute(s,this.htmlAttributes[""+s]):"disabled"===s?("true"===this.htmlAttributes[""+s]&&this.setDisabled(),this.element.setAttribute(s,this.htmlAttributes[""+s])):this.element.setAttribute(s,this.htmlAttributes[""+s]):n.setAttribute(s,this.htmlAttributes[""+s])}},i.prototype.switchFocusHandler=function(e){this.isFocused&&this.getWrapper().classList.add("e-focus"),e&&"keyup"===e.type&&"Space"===e.code&&this.isAngular&&(this.clickHandler(e),e.stopPropagation(),e.preventDefault())},i.prototype.switchMouseUp=function(e){var t=0,i=0,s=0,n=0,o=e.target;"touchmove"===e.type&&(e.preventDefault(),s=e.changedTouches[0].clientX,t=e.changedTouches[0].clientY,n=this.bTouchX-s,i=this.bTouchY-t,Math.abs(n)<Math.abs(i)?(this.isDrag=!1,this.rippleTouchHandler("mouseup")):this.isDrag=!0),"touchstart"===e.type&&(this.bTouchX=e.changedTouches[0].clientX,this.bTouchY=e.changedTouches[0].clientY,this.isDrag=!0,this.rippleTouchHandler("mousedown")),this.isDrag&&("mouseup"===e.type&&o.className.indexOf("e-switch")<0||"touchend"===e.type)&&(n=this.bTouchX-e.changedTouches[0].clientX,i=this.bTouchY-e.changedTouches[0].clientY,Math.abs(n)>=Math.abs(i)&&(this.clickHandler(e),this.rippleTouchHandler("mouseup"),e.preventDefault()))},i.prototype.formResetHandler=function(){this.checked=this.initialSwitchCheckedValue,this.element.checked=this.initialSwitchCheckedValue},i.prototype.toggle=function(){this.clickHandler()},i.prototype.wireEvents=function(){var t=this.getWrapper();this.delegateMouseUpHandler=this.switchMouseUp.bind(this),this.delegateKeyUpHandler=this.switchFocusHandler.bind(this),e.EventHandler.add(t,"click",this.clickHandler,this),e.EventHandler.add(this.element,"focus",this.focusHandler,this),e.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),e.EventHandler.add(this.element,"mouseup",this.delegateMouseUpHandler,this),e.EventHandler.add(this.element,"keyup",this.delegateKeyUpHandler,this),e.EventHandler.add(t,"mousedown mouseup",this.rippleHandler,this),e.EventHandler.add(t,"mouseleave",this.mouseLeaveHandler,this),e.EventHandler.add(t,"touchstart touchmove touchend",this.switchMouseUp,this)},i.prototype.unWireEvents=function(){var t=this.getWrapper();t&&(e.EventHandler.remove(t,"click",this.clickHandler),e.EventHandler.remove(t,"mousedown mouseup",this.rippleHandler),e.EventHandler.remove(t,"mouseleave",this.mouseLeaveHandler),e.EventHandler.remove(t,"touchstart touchmove touchend",this.switchMouseUp)),this.element&&(e.EventHandler.remove(this.element,"focus",this.focusHandler),e.EventHandler.remove(this.element,"focusout",this.focusOutHandler),e.EventHandler.remove(this.element,"mouseup",this.delegateMouseUpHandler),e.EventHandler.remove(this.element,"keyup",this.delegateKeyUpHandler))},i.prototype.click=function(){this.element.click()},i.prototype.focusIn=function(){this.element.focus()},z([(0,e.Event)()],i.prototype,"beforeChange",void 0),z([(0,e.Event)()],i.prototype,"change",void 0),z([(0,e.Event)()],i.prototype,"created",void 0),z([(0,e.Property)(!1)],i.prototype,"checked",void 0),z([(0,e.Property)("")],i.prototype,"cssClass",void 0),z([(0,e.Property)(!1)],i.prototype,"disabled",void 0),z([(0,e.Property)("")],i.prototype,"name",void 0),z([(0,e.Property)("")],i.prototype,"onLabel",void 0),z([(0,e.Property)("")],i.prototype,"offLabel",void 0),z([(0,e.Property)("")],i.prototype,"value",void 0),z([(0,e.Property)({})],i.prototype,"htmlAttributes",void 0),i=z([e.NotifyPropertyChanges],i)}(e.Component),ee=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),te=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},ie={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"},se=function(t){function i(e,i){var s=t.call(this,e,i)||this;return s.multiSelectedChip=[],s}var s;return ee(i,t),s=i,i.prototype.preRender=function(){},i.prototype.chipType=function(){return this.chips&&this.chips.length&&this.chips.length>0},i.prototype.render=function(){this.type=!(0,e.isNullOrUndefined)(this.chips)&&this.chips.length?"chipset":this.text||this.element.innerText?"chip":"chipset",this.setAttributes(),this.createChip(),this.setRtl(),this.select(this.selectedChips),this.wireEvent(!1),this.rippleFunction=(0,e.rippleEffect)(this.element,{selector:"."+ie.chip}),this.renderComplete(),this.dragCollection=[],this.allowDragAndDrop&&this.enableDraggingChips()},i.prototype.enableDraggingChips=function(){var t,i=this;this.element.querySelectorAll("."+ie.chip).forEach(function(s,n){i.dragObj=new e.Draggable(s,{preventDefault:!1,clone:!0,dragArea:i.dragArea,helper:function(){return(t=s.cloneNode(!0)).classList.add(ie.cloneChip),i.element.appendChild(t),t},dragStart:function(s){i.dragIndicator=i.createElement("div",{className:ie.dragIndicator}),document.body.appendChild(i.dragIndicator);var o=i.find(s.element),r={cancel:!1,event:s.event,draggedItem:s.element,draggedItemData:o,dropTarget:null};i.trigger("dragStart",r,function(){(0,e.isNullOrUndefined)(r.cancel)&&(r.cancel=!1)}),r.cancel?i.dragObj.intDestroy(s.event):t.setAttribute("drag-indicator-index",n.toString())},drag:function(s){var n=i.find(s.element),o={event:s.event,draggedItem:s.element,draggedItemData:n,dropTarget:null};i.trigger("dragging",o);var r=t.querySelector("."+ie.chipDrag);(0,e.isNullOrUndefined)(r)&&(r=i.createElement("span",{className:ie.customIcon+" "+ie.dragAndDrop+" "+ie.chipDrag}),t.prepend(r)),i.allowExternalDragging(s,t,r)},dragStop:function(s){var n=i.find(s.element),o={cancel:!1,event:s.event,draggedItem:s.element,draggedItemData:n,dropTarget:s.target};i.trigger("dragStop",o,function(){(0,e.isNullOrUndefined)(o.cancel)&&(o.cancel=!1)}),o.cancel||i.allowExternalDrop(s,t),(0,e.isNullOrUndefined)(i.dragIndicator)||(0,e.remove)(i.dragIndicator),(0,e.isNullOrUndefined)(t)||t.remove()}}),-1===i.dragCollection.indexOf(i.dragObj)&&i.dragCollection.push(i.dragObj)})},i.prototype.checkInstance=function(t,i){var s=!(0,e.isNullOrUndefined)(t.target.closest("."+ie.chipList))&&t.target.closest("."+ie.chipList).id!==i.element.id;return s&&(this.updatedInstance=t.target.closest("."+ie.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(ie.dragAndDrop),t.classList.add(ie.dropRestricted),s.style.display="none"):(t.classList.add(ie.dragAndDrop),t.classList.remove(ie.dropRestricted),r&&(s.style.display="none"))},i.prototype.allowExternalDragging=function(e,t,i){var s,n=null,o=1/0,r=-1,l=!1;if(this.checkInstance(e,this)){if(this.dragIndicator.style.display="none",(s=this.getCurrentInstance(e)).dragIndicator=this.dragIndicator,!s.allowDragAndDrop)return}else s=this;var a=s.dragIndicator;a.style.display="inline",l=this.dragAreaCheck(this.dragArea,e.target,l,i,a),this.setIcons(s,i,e.target,a,l),s.element.appendChild(t);var p=t.getBoundingClientRect(),c=Array.from(s.element.querySelectorAll("."+ie.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(t,i,s,n,o){if((0,e.isNullOrUndefined)(t))return!1;var r="string"==typeof t,l=t instanceof HTMLElement,a=r?document.querySelector(t):t;return(0,e.isNullOrUndefined)(a)||!r&&!l||a.contains(i)||(s=!0,o.style.display="none",n.classList.add(ie.dropRestricted),n.classList.remove(ie.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(t){var i=t.target.closest("."+ie.chipList);if(!(0,e.isNullOrUndefined)(i)&&!(0,e.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("."+ie.chipDrag),r))){for(var l=r.getBoundingClientRect(),a=Array.from(i.element.querySelectorAll("."+ie.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){var m=void 0;for(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(ie.chipSet),this.element.setAttribute("role","listbox"),"Multiple"===this.selection?(this.element.classList.add(ie.multiSelection),this.element.setAttribute("aria-multiselectable","true")):"Single"===this.selection?(this.element.classList.add(ie.singleSelection),this.element.setAttribute("aria-multiselectable","false")):this.element.setAttribute("aria-multiselectable","false"))},i.prototype.setRtl=function(){this.element.classList[this.enableRtl?"add":"remove"](ie.rtl)},i.prototype.renderTemplates=function(){this.isReact&&this.renderReactTemplates()},i.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?(0,e.compile)(document.querySelector(t).innerHTML.trim()):(0,e.compile)(t)}catch(i){return(0,e.compile)(t)}},i.prototype.chipCreation=function(t){if(!(0,e.isNullOrUndefined)(t)){for(var i=[],s=[],n=0;n<t.length;n++){var o=this.getFieldValues(t[n]),r=o.htmlAttributes;s.push(r);var l=this.elementCreation(o),a=(ie.chip+" "+(o.enabled?" ":ie.disabled)+" "+(o.avatarIconCss||o.avatarText?ie.chipWrapper:o.leadingIconCss?ie.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")),!(0,e.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]])}(0,e.append)(l,p),i.push(p)}else i=l,(0,e.addClass)([this.element],a),this.element.setAttribute("aria-label",o.text),o.value&&this.element.setAttribute("data-value",o.value.toString())}(0,e.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(t){var i=[];if(t.avatarText||t.avatarIconCss){var s=(ie.avatar+" "+t.avatarIconCss).trim(),n=this.createElement("span",{className:s});n.innerText=t.avatarText,i.push(n)}else if(t.leadingIconCss){s=(ie.icon+" "+t.leadingIconCss).trim();var o=this.createElement("span",{className:s});i.push(o)}else if(t.leadingIconUrl){s=(ie.avatar+" image-url").trim();(o=this.createElement("span",{className:s})).style.backgroundImage="url("+t.leadingIconUrl+")",i.push(o)}var r=this.createElement("span",{className:ie.text});if(r.innerText=t.text,i.push(r),t.template){var l=this.createElement("div",{className:ie.template}),a=this.templateParser(t.template)(t,this,"template",this.element.id+"_template",!1);(0,e.append)(a,l),i.push(l),this.renderTemplates()}if(t.trailingIconCss||this.chipType()&&this.enableDelete){s=(ie.delete+" "+(t.trailingIconCss?t.trailingIconCss:ie.deleteIcon)).trim();var p=this.createElement("span",{className:s});i.push(p)}else if(t.trailingIconUrl){s="trailing-icon-url".trim();var c=this.createElement("span",{className:s});c.style.backgroundImage="url("+t.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("."+ie.chip)[e];if(i&&this.chipType()){t.index=Array.prototype.slice.call(this.element.querySelectorAll("."+ie.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("."+ie.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("."+ie.chip),l=0;l<r.length;l++)r[l].setAttribute("aria-selected","false"),r[l].classList.remove(ie.active);var a=e instanceof Array?e:[e];for(l=0;l<a.length;l++){var p=a[l]instanceof HTMLElement?a[l]:this.element.querySelectorAll("."+ie.chip)[a[l]];if("index"!==i)for(var c=0;c<this.chips.length;c++){n=this.element.querySelectorAll("."+ie.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("."+ie.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("."+ie.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("."+ie.chip),s=Array.prototype.slice.call(i).indexOf(e);t.deleteHandler(e,s)})}},i.prototype.getSelectedChips=function(){var t;if(this.chipType()&&"None"!==this.selection){for(var i={texts:[],Indexes:[],data:[],elements:[]},s=this.element.querySelectorAll("."+ie.active),n=0;n<s.length;n++){var o=s[n];i.elements.push(o);var r=Array.prototype.slice.call(this.element.querySelectorAll("."+ie.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]};t=(0,e.isNullOrUndefined)(a.index)?void 0:"Multiple"===this.selection?i:a}return t},i.prototype.wireEvent=function(t){t?(e.EventHandler.remove(this.element,"click",this.clickHandler),e.EventHandler.remove(this.element,"focusout",this.focusOutHandler),e.EventHandler.remove(this.element,"keydown",this.keyHandler),e.EventHandler.remove(this.element,"keyup",this.keyHandler)):(e.EventHandler.add(this.element,"click",this.clickHandler,this),e.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),e.EventHandler.add(this.element,"keydown",this.keyHandler,this),e.EventHandler.add(this.element,"keyup",this.keyHandler,this))},i.prototype.keyHandler=function(e){e.target.classList.contains(ie.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(ie.focused)||e.classList.add(ie.focused)},i.prototype.focusOutHandler=function(t){var i=(0,e.closest)(t.target,"."+ie.chip),s=this.chipType()?this.element.querySelector("."+ie.focused):this.element.classList.contains(ie.focused)?this.element:null;i&&s&&s.classList.remove(ie.focused)},i.prototype.clickHandler=function(t,i){var s=this;void 0===i&&(i=!1);var n=(0,e.closest)(t.target,"."+ie.chip);if(n){var o=void 0;if(this.chipType())o=this.find(n);else{var r=Array.prototype.slice.call(this.element.querySelectorAll("."+ie.chip)).indexOf(n);o={text:this.innerText?this.innerText:this.text,element:n,data:this.text,index:r}}o.event=t,o.cancel=!1,this.trigger("beforeClick",o,function(e){e.cancel||s.clickEventHandler(e.element,t,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(ie.deleteIcon)?t.target:i?e.querySelector("."+ie.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(ie.active);var i=n;s.trigger("click",i);var o=s.element.querySelectorAll("."+ie.chip)[t.index];o&&(o.focus(),s.focusInHandler(o))}})}else if("None"!==this.selection){this.selectionHandler(e),n.selected=e.classList.contains(ie.active);var r=n;this.trigger("click",r)}else{this.focusInHandler(e);var l=n;this.trigger("click",l)}}else{this.focusInHandler(e);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("."+ie.active);t&&t!==e&&(t.classList.remove(ie.active),t.setAttribute("aria-selected","false")),this.setProperties({selectedChips:null},!0)}else this.setProperties({selectedChips:[]},!0);e.classList.contains(ie.active)?(e.classList.remove(ie.active),e.setAttribute("aria-selected","false")):(e.classList.add(ie.active),e.setAttribute("aria-selected","true")),this.updateSelectedChips()},i.prototype.updateSelectedChips=function(){for(var e=this.element.querySelectorAll("."+ie.chip),t=[],i=[],s=null,n=null,o=0;o<e.length;o++){var r=this.element.querySelectorAll("."+ie.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(t,i){var s=this.find(t);this.chips.splice(i,1),this.setProperties({chips:this.chips},!0),(0,e.detach)(t),this.trigger("deleted",s)},i.prototype.destroy=function(){for(var i=0;i<this.dragCollection.length;i++)this.dragCollection[i].destroy();this.dragCollection=[],this.clearTemplate(),(0,e.removeClass)([this.element],[ie.chipSet,ie.chip,ie.rtl,ie.multiSelection,ie.singleSelection,ie.disabled,ie.chipWrapper,ie.iconWrapper,ie.active,ie.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(),t.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(t,i){for(var s=0,n=Object.keys(t);s<n.length;s++){switch(n[s]){case"chips":case"text":case"avatarText":case"avatarIconCss":case"leadingIconCss":case"trailingIconCss":case"selection":case"enableDelete":case"enabled":this.refresh();break;case"cssClass":this.chipType()?this.refresh():((0,e.removeClass)([this.element],i.cssClass.toString().split(" ").filter(function(e){return e})),(0,e.addClass)([this.element],t.cssClass.toString().split(" ").filter(function(e){return e})));break;case"selectedChips":(0,e.removeClass)(this.element.querySelectorAll(".e-active"),"e-active"),"Multiple"===this.selection?(this.multiSelectedChip=[],this.multiSelection(t.selectedChips),this.onSelect(this.multiSelectedChip,!0),this.updateSelectedChips()):this.onSelect(t.selectedChips,!0);break;case"enableRtl":this.setRtl();break;case"allowDragAndDrop":for(var o=0;o<this.dragCollection.length;o++)this.dragCollection[o].destroy();this.dragCollection=[],this.allowDragAndDrop&&this.enableDraggingChips();break;case"dragArea":if(this.allowDragAndDrop)for(o=0;o<this.dragCollection.length;o++)this.dragCollection[o].dragArea=this.dragArea}}},te([(0,e.Property)([])],i.prototype,"chips",void 0),te([(0,e.Property)("")],i.prototype,"text",void 0),te([(0,e.Property)("")],i.prototype,"avatarText",void 0),te([(0,e.Property)("")],i.prototype,"avatarIconCss",void 0),te([(0,e.Property)("")],i.prototype,"htmlAttributes",void 0),te([(0,e.Property)("")],i.prototype,"leadingIconCss",void 0),te([(0,e.Property)("")],i.prototype,"trailingIconCss",void 0),te([(0,e.Property)("")],i.prototype,"leadingIconUrl",void 0),te([(0,e.Property)("")],i.prototype,"trailingIconUrl",void 0),te([(0,e.Property)("")],i.prototype,"cssClass",void 0),te([(0,e.Property)(!0)],i.prototype,"enabled",void 0),te([(0,e.Property)([])],i.prototype,"selectedChips",void 0),te([(0,e.Property)("None")],i.prototype,"selection",void 0),te([(0,e.Property)(!1)],i.prototype,"enableDelete",void 0),te([(0,e.Property)(!1)],i.prototype,"allowDragAndDrop",void 0),te([(0,e.Property)(null)],i.prototype,"dragArea",void 0),te([(0,e.Event)()],i.prototype,"created",void 0),te([(0,e.Event)()],i.prototype,"click",void 0),te([(0,e.Event)()],i.prototype,"beforeClick",void 0),te([(0,e.Event)()],i.prototype,"delete",void 0),te([(0,e.Event)()],i.prototype,"deleted",void 0),te([(0,e.Event)()],i.prototype,"dragStart",void 0),te([(0,e.Event)()],i.prototype,"dragging",void 0),te([(0,e.Event)()],i.prototype,"dragStop",void 0),i=s=te([e.NotifyPropertyChanges],i)}(e.Component),ne=function(){},oe=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),re=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},le="e-fab-fixed",ae="e-fab-top",pe="e-fab-bottom",ce="e-fab-right",he="e-fab-left",de="e-fab-middle",ue="e-fab-center";!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"}(m||(m={}));var fe,me,ve,ye,ge=function(t){function i(e,i){return t.call(this,e,i)||this}return oe(i,t),i.prototype.render=function(){t.prototype.render.call(this),this.initializeFab()},i.prototype.preRender=function(){t.prototype.preRender.call(this),this.element.id||(this.element.id=(0,e.getUniqueID)("e-"+this.getModuleName()))},i.prototype.getPersistData=function(){return t.prototype.getPersistData.call(this),this.addOnPersist([])},i.prototype.getModuleName=function(){return"fab"},i.prototype.initializeFab=function(){this.element.classList.add("e-"+t.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?(0,e.select)(this.target):this.target,this.targetEle&&(this.isFixed=!1,this.targetEle.appendChild(this.element))),this.element.classList[this.isFixed?"add":"remove"](le)},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)?pe:ae);var e=-1!==["TopRight","MiddleRight","BottomRight"].indexOf(this.position);this.element.classList.add(!this.enableRtl&&!e||this.enableRtl&&e?he:ce),-1!==["MiddleLeft","MiddleRight","MiddleCenter"].indexOf(this.position)&&this.element.classList.add(de),-1!==["TopCenter","BottomCenter","MiddleCenter"].indexOf(this.position)&&this.element.classList.add(ue)},i.prototype.clearPosition=function(){this.element.classList.remove(ae,pe,de),this.element.classList.remove(ce,he,ue)},i.prototype.refreshPosition=function(){},i.prototype.destroy=function(){t.prototype.destroy.call(this),this.element.classList.remove("e-"+t.prototype.getModuleName.call(this),le),this.clearPosition()},i.prototype.onPropertyChanged=function(e,i){t.prototype.onPropertyChanged.call(this,e,i);for(var s=0,n=Object.keys(e);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()}}},re([(0,e.Property)("BottomRight")],i.prototype,"position",void 0),re([(0,e.Property)("")],i.prototype,"target",void 0),re([(0,e.Property)(!0)],i.prototype,"visible",void 0),re([(0,e.Property)(!0)],i.prototype,"isPrimary",void 0),i=re([e.NotifyPropertyChanges],i)}(C),be=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Ee=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},Ce=["TopLeft","TopCenter","TopRight"],ke=["BottomLeft","BottomCenter","BottomRight"],Le=["TopLeft","MiddleLeft","BottomLeft"],Pe=["TopRight","MiddleRight","BottomRight"],He="e-speeddial-hidden",Ae="e-speeddial-fixed",we="e-speeddial",xe="e-rtl",Se="e-speeddial-hover-open",Te="e-speeddial-radial",Re="e-speeddial-linear",Oe="e-speeddial-template",Ne="e-speeddial-popup",Ie="e-speeddial-ul",Me="e-speeddial-li",De="e-speeddial-li-active",Be="e-speeddial-li-icon",je="e-disabled",Fe="e-speeddial-vert-bottom",Ue="e-speeddial-vert-right",We="e-speeddial-horz-top",_e="e-speeddial-horz-left",Ve="e-speeddial-horz-right",qe="e-speeddial-overflow",ze="e-speeddial-vert-overflow",Ke="e-speeddial-horz-overflow",Xe="e-speeddial-top",Ye="e-speeddial-bottom",Je="e-speeddial-right",Ge="e-speeddial-left",Ze="e-speeddial-middle",Qe="e-speeddial-center",$e="e-speeddial-top-left",et="e-speeddial-bottom-right",tt="e-speeddial-top-right",it="e-speeddial-bottom-left",st="--speeddialVertDist",nt="--speeddialHorzDist",ot="--speeddialRadialOffset",rt="--speeddialRadialMinHeight",lt="--speeddialRadialMinWidth",at="--speeddialOverflowLimit",pt="--speeddialRadialHorzDist";!function(e){e.Linear="Linear",e.Radial="Radial"}(fe||(fe={})),function(e){e.Up="Up",e.Down="Down",e.Right="Right",e.Left="Left",e.Auto="Auto"}(me||(me={})),function(e){e.Clockwise="Clockwise",e.AntiClockwise="AntiClockwise",e.Auto="Auto"}(ve||(ve={})),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"}(ye||(ye={}));var ct=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return be(i,t),Ee([(0,e.Property)("Fade")],i.prototype,"effect",void 0),Ee([(0,e.Property)(400)],i.prototype,"duration",void 0),Ee([(0,e.Property)(0)],i.prototype,"delay",void 0),i}(e.ChildProperty),ht=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return be(i,t),Ee([(0,e.Property)("Auto")],i.prototype,"direction",void 0),Ee([(0,e.Property)(-1)],i.prototype,"endAngle",void 0),Ee([(0,e.Property)("100px")],i.prototype,"offset",void 0),Ee([(0,e.Property)(-1)],i.prototype,"startAngle",void 0),i}(e.ChildProperty),dt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return be(i,t),Ee([(0,e.Property)("")],i.prototype,"iconCss",void 0),Ee([(0,e.Property)("")],i.prototype,"id",void 0),Ee([(0,e.Property)("")],i.prototype,"text",void 0),Ee([(0,e.Property)("")],i.prototype,"title",void 0),Ee([(0,e.Property)(!1)],i.prototype,"disabled",void 0),i}(e.ChildProperty),ut=function(t){function i(e,i){var s=t.call(this,e,i)||this;return s.isMenuOpen=!1,s.isClock=!0,s.isVertical=!0,s.isControl=!1,s.focusedIndex=-1,s}return be(i,t),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=(0,e.getUniqueID)("e-"+this.getModuleName())),this.fab=new ge({content:this.content,cssClass:this.cssClass?we+" "+this.cssClass:we,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(){e.EventHandler.add(window,"resize",this.resizeHandler,this),e.EventHandler.add(document.body,"click",this.bodyClickHandler,this),this.opensOnHover?this.wireFabHover():this.wireFabClick()},i.prototype.wirePopupEvents=function(){this.removeRippleEffect=(0,e.rippleEffect)(this.popupEle,{selector:"."+Be}),this.keyboardModule=new e.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.popupKeyboardModule=new e.KeyboardEvents(this.popupEle,{keyAction:this.popupKeyActionHandler.bind(this),keyConfigs:{esc:"escape"},eventName:"keydown"}),this.documentKeyboardModule=new e.KeyboardEvents(document.body,{keyAction:this.popupKeyActionHandler.bind(this),keyConfigs:{enter:"enter",space:"space"},eventName:"keydown"}),e.EventHandler.add(this.popupEle,"click",this.popupClick,this),e.EventHandler.add(this.popupEle,"mouseleave",this.popupMouseLeaveHandle,this)},i.prototype.wireFabClick=function(){e.EventHandler.add(this.fab.element,"click",this.fabClick,this)},i.prototype.wireFabHover=function(){this.popupEle.classList.add(Se),e.EventHandler.add(this.fab.element,"mouseover",this.mouseOverHandle,this),e.EventHandler.add(this.element,"mouseleave",this.mouseLeaveHandle,this)},i.prototype.createPopup=function(){var t=Ne+" "+He;t=this.enableRtl?t+" "+xe:t,t=this.cssClass?t+" "+this.cssClass:t,this.popupEle=this.createElement("div",{className:t,id:this.element.id+"_popup"}),this.element.insertAdjacentElement("afterend",this.popupEle),(0,e.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?"":" "+He)+" "+this.cssClass).trim()}),this.element.insertAdjacentElement("beforebegin",this.overlayEle)},i.prototype.popupClick=function(){this.isControl=!0},i.prototype.bodyClickHandler=function(e){this.isControl?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(Te,Re,Oe),this.popupTemplate?(this.popupEle.classList.add(Oe),this.appendTemplate()):(this.popupEle.classList.add("Radial"===this.mode?Te:Re),this.createUl(),this.createItems()),this.renderReactTemplates()},i.prototype.appendTemplate=function(){var t=this.createElement("div",{className:"e-speeddial-template-container"});(0,e.append)([t],this.popupEle);var i=this.getTemplateString(this.popupTemplate);(0,e.append)(i({},this,"fabPopupTemplate",this.element.id+"popupTemplate",this.isStringTemplate),t)},i.prototype.getTemplateString=function(t){var i="";try{var s=(0,e.select)(t);i="function"!=typeof t&&s?"SCRIPT"===s.tagName?s.innerHTML:s.outerHTML:t}catch(e){i=t}return(0,e.compile)(i)},i.prototype.updatePopupTemplate=function(){if(this.popupEle){for(this.popupEle.querySelector("."+Me)&&(this.clearItems(),this.popupEle.classList.remove(Te,Re),this.popupEle.classList.add(Oe));this.popupEle.firstElementChild;)(0,e.remove)(this.popupEle.firstElementChild);this.setPopupContent(),this.updatePositionProperties()}else this.createPopup()},i.prototype.createUl=function(){var e=this.createElement("ul",{className:Ie,id:this.element.id+"_ul",attrs:{role:"menu"}});this.popupEle.appendChild(e)},i.prototype.createItems=function(){var t=this;this.focusedIndex=-1;for(var i=this.popupEle.querySelector("."+Ie),s=function(s){var o=n.items[parseInt(s.toString(),10)],r=n.createElement("li",{className:Me+" "+He,id:o.id?o.id:n.element.id+"_li_"+s,attrs:{role:"menuitem"}});if(o.text&&r.setAttribute("aria-label",o.text),n.itemTemplate){var l=n.getTemplateString(n.itemTemplate);(0,e.append)(l(o,n,"fabItemTemplate",n.element.id+"itemTemplate",n.isStringTemplate),r)}else{if(o.iconCss){var a=n.createElement("span",{className:Be+" "+o.iconCss});r.appendChild(a)}if(o.text){var p=n.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(je),r.setAttribute("aria-disabled","true")):e.EventHandler.add(r,"click",function(e){return t.triggerItemClick(e,o)},n),o.title&&r.setAttribute("title",o.title);var c={element:r,item:o};n.trigger("beforeItemRender",c,function(e){i.appendChild(e.element)})},n=this,o=0;o<this.items.length;o++)s(o)},i.prototype.setRTL=function(){this.popupEle.classList[this.enableRtl?"add":"remove"](xe),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?(0,e.select)(this.target):this.target,this.targetEle&&(this.targetEle.appendChild(this.element),this.isFixed=!1)),this.isFixed?(this.popupEle&&this.popupEle.classList.add(Ae),this.overlayEle&&this.overlayEle.classList.add(Ae)):(this.popupEle&&this.popupEle.classList.remove(Ae),this.overlayEle&&this.overlayEle.classList.remove(Ae))},i.prototype.setVisibility=function(e){this.setProperties({visible:e},!0),this.fab.setProperties({visible:e})},i.prototype.popupMouseLeaveHandle=function(t){var i=t.relatedTarget;!this.opensOnHover||i.classList.contains(we)||(0,e.closest)(i,"."+we)||this.hidePopupEle(t)},i.prototype.mouseOverHandle=function(e){this.showPopupEle(e)},i.prototype.mouseLeaveHandle=function(t){var i=t.relatedTarget;i.classList.contains(Ne)||(0,e.closest)(i,"."+Ne)||this.hidePopupEle(t)},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 t=(0,e.selectAll)("."+Me,this.popupEle),i=0;t[parseInt(i.toString(),10)].classList.contains(je);)if(++i>t.length-1)return;this.setFocus(i,t[parseInt(i.toString(),10)])},i.prototype.focusLastElement=function(){for(var t=(0,e.selectAll)("."+Me,this.popupEle),i=t.length-1;t[parseInt(i.toString(),10)].classList.contains(je);)if(--i<0)return;this.setFocus(i,t[parseInt(i.toString(),10)])},i.prototype.focusLinearElement=function(e){(this.popupEle.classList.contains(Fe)||this.popupEle.classList.contains(Ve))!==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 t=(0,e.selectAll)("."+Me,this.popupEle),i=this.focusedIndex;do{if(--i<0)return void this.setFocus(-1)}while(t[parseInt(i.toString(),10)].classList.contains(je));this.setFocus(i,t[parseInt(i.toString(),10)])},i.prototype.focusNextElement=function(){var t=(0,e.selectAll)("."+Me,this.popupEle),i=this.focusedIndex;do{if(++i>t.length-1)return}while(t[parseInt(i.toString(),10)].classList.contains(je));this.setFocus(i,t[parseInt(i.toString(),10)])},i.prototype.setFocus=function(e,t){this.removeFocus(),t&&t.classList.add(De),this.focusedIndex=e},i.prototype.removeFocus=function(){var t=(0,e.select)("."+De,this.popupEle);t&&t.classList.remove(De)},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!==Ce.indexOf(this.position)?"Auto":"Up";break;case"Down":this.actualLinDirection=-1!==ke.indexOf(this.position)?"Auto":"Down";break;case"Right":this.actualLinDirection=-1!==Pe.indexOf(this.position)?"Auto":"Right";break;case"Left":this.actualLinDirection=-1!==Le.indexOf(this.position)?"Auto":"Left";break;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("."+Ie);this.isVertical?(n="Up"===this.actualLinDirection||"Auto"===this.actualLinDirection&&-1===Ce.indexOf(this.position)?e:i)<o.offsetHeight&&(this.popupEle.classList.add(qe,ze),o.style.setProperty(at,n+"px")):(n=this.enableRtl?"Right"===this.direction?t:s:"Right"===this.direction?s:t)<o.offsetWidth&&(this.popupEle.classList.add(qe,Ke),o.style.setProperty(at,n+"px"))},i.prototype.setLinearPosition=function(){var e=0,t="Down"===this.actualLinDirection||"Auto"===this.actualLinDirection&&-1!==Ce.indexOf(this.position)||!this.isVertical&&-1===ke.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(We)):(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(Fe)),this.popupEle.classList.add(t?Xe:Ye),this.popupEle.style.setProperty(st,e+"px"),this.setLinearHorizontalPosition()},i.prototype.setLinearHorizontalPosition=function(){"Right"===this.actualLinDirection||this.isVertical&&-1===Pe.indexOf(this.position)?(this.enableRtl?this.setRight():this.setLeft(),this.isVertical||this.popupEle.classList.add(_e)):(this.enableRtl?this.setLeft():this.setRight(),this.popupEle.classList.add(this.isVertical?Ue:Ve))},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(nt,i+"px"),this.popupEle.classList.add(Ge)},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(nt,i+"px"),this.popupEle.classList.add(Je)},i.prototype.setPosition=function(){if(-1!==["MiddleLeft","MiddleRight","MiddleCenter"].indexOf(this.position)){this.popupEle.classList.add(Ze);var e=((this.isFixed?window.innerHeight:this.targetEle.clientHeight)-this.popupEle.offsetHeight)/2;this.popupEle.style.setProperty(st,e+"px")}this.popupEle.classList.add(-1===ke.indexOf(this.position)?Xe:Ye),this.setHorizontalPosition()},i.prototype.setHorizontalPosition=function(){if(-1!==["TopCenter","BottomCenter","MiddleCenter"].indexOf(this.position)){this.popupEle.classList.add(Qe);var e=((this.isFixed?window.innerWidth:this.targetEle.clientWidth)-this.popupEle.offsetWidth)/2;this.popupEle.style.setProperty(nt,e+"px")}var t=-1!==Pe.indexOf(this.position);this.popupEle.classList.add(!this.enableRtl&&!t||this.enableRtl&&t?Ge:Je)},i.prototype.setCustomRadialPosition=function(){var e=document.documentElement.clientWidth,t=document.documentElement.clientHeight;if(-1!==["TopLeft","BottomLeft","MiddleLeft"].indexOf(this.position)){var 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(pt,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(pt,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)){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(pt,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 t=this.getActualRange();this.isClock="Clockwise"===t.direction;var i=(0,e.formatUnit)(t.offset),s=(0,e.selectAll)("."+Me,this.popupEle);this.popupEle.style.setProperty(ot,i),this.popupEle.style.setProperty(rt,s[0].offsetHeight+"px"),this.popupEle.style.setProperty(lt,s[0].offsetWidth+"px");for(var n=Math.abs(t.endAngle-t.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=t.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?tt:$e),-1!==["TopRight","TopCenter","MiddleRight","MiddleCenter"].indexOf(this.position)&&this.popupEle.classList.add(this.enableRtl?$e:tt),-1!==["BottomLeft","BottomCenter","MiddleLeft","MiddleCenter"].indexOf(this.position)&&this.popupEle.classList.add(this.enableRtl?et:it),-1!==["BottomRight","BottomCenter","MiddleRight","MiddleCenter"].indexOf(this.position)&&this.popupEle.classList.add(this.enableRtl?it:et)},i.prototype.getActualRange=function(){var t={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,t,n,0,90,!1)):(n="AntiClockwise"!==this.radialSettings.direction,this.checkAngleRange(i,s,t,n,90,180,!1));break;case"TopCenter":n="Clockwise"===this.radialSettings.direction,this.checkAngleRange(i,s,t,n,0,180,!1);break;case"MiddleLeft":case"MiddleRight":if("MiddleLeft"===this.position!==this.enableRtl){n="Clockwise"===this.radialSettings.direction,i=(i=(0,e.isNullOrUndefined)(i)||i<0||i>360||i>90&&i<270?n?270:90:i)<91?i+360:i,s=(s=(0,e.isNullOrUndefined)(s)||s<0||s>360||s>90&&s<270?n?90:270:s)<91?s+360:s;var o=n&&s<i||!n&&s>i;t.startAngle=o?s:i,t.endAngle=o?i:s}else n="AntiClockwise"!==this.radialSettings.direction,this.checkAngleRange(i,s,t,n,90,270,!1);break;case"MiddleCenter":n="AntiClockwise"!==this.radialSettings.direction,i=(0,e.isNullOrUndefined)(i)||i<0||i>360?n?0:360:i,s=(0,e.isNullOrUndefined)(s)||s<0||s>360?n?360:0:s,t.startAngle=!n&&i<=s?i+360:i,t.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,t,n,270,360,!0)):(n="AntiClockwise"!==this.radialSettings.direction,this.checkAngleRange(i,s,t,n,180,270,!0));break;case"BottomCenter":n="AntiClockwise"!==this.radialSettings.direction,this.checkAngleRange(i,s,t,n,180,360,!0)}return t.direction=n?"Clockwise":"AntiClockwise",t},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(t,i,s,n,o){return(0,e.isNullOrUndefined)(t)||t<0||t>360?i?s:n:(t=o?0===t?360:t:360===t?0:t)>=s&&t<=n?t:i?s:n},i.prototype.clearPosition=function(){this.popupEle.style.removeProperty(ot),this.popupEle.style.removeProperty(rt),this.popupEle.style.removeProperty(lt),this.popupEle.classList.remove($e,tt,it,et),this.popupEle.classList.remove(Xe,Ye,Ze),this.popupEle.classList.remove(We,Fe),this.popupEle.style.removeProperty(st),this.clearHorizontalPosition(),this.clearOverflow()},i.prototype.clearHorizontalPosition=function(){this.popupEle.style.removeProperty(nt),this.popupEle.style.removeProperty(pt),this.popupEle.style.removeProperty("top"),this.popupEle.style.removeProperty("bottom"),this.popupEle.classList.remove(Je,Ge,Qe),this.popupEle.classList.remove(Ue,_e,Ve)},i.prototype.clearOverflow=function(){this.popupEle.classList.remove(qe,ze,Ke),this.popupEle.style.removeProperty(at)},i.prototype.hidePopupEle=function(t){var i=this;if(this.popupEle&&this.isMenuOpen){var s={element:this.popupEle,event:t,cancel:!1};this.trigger("beforeClose",s,function(t){if(!t.cancel)if("None"!==i.animation.effect){var s={name:i.animation.effect+"Out",timingFunction:"easeOut"},n=i.popupTemplate?[i.popupEle.firstElementChild]:(0,e.selectAll)("."+Me,i.popupEle),o=i.animation.duration/(n.length+1);s.duration=2*o;var r=function(t){var l=n[parseInt(t.toString(),10)];if(s.delay=t===n.length-1?i.animation.delay:0,s.begin=function(){t===n.length-1&&i.startHide()},s.end=function(){l.classList.add(He),0===t&&i.endHide()},new e.Animation(s).animate(l),0!==t){var a=t-1;setTimeout(function(){r(a)},o)}};r(n.length-1)}else{if(i.startHide(),!i.popupTemplate)(0,e.selectAll)("."+Me,i.popupEle).forEach(function(e){e.classList.add(He)});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(He),this.popupTemplate&&this.setVisibility(!0),this.toggleOverlay(),this.popupTemplate&&this.popupEle.removeAttribute("tabindex"),this.trigger("onClose",{element:this.popupEle})},i.prototype.showPopupEle=function(t){var i=this;if(this.popupEle&&!this.isMenuOpen){this.popupTemplate||"Radial"===this.mode?this.setCustomRadialPosition():this.setLinearPosition();var s={element:this.popupEle,event:t,cancel:!1};this.trigger("beforeOpen",s,function(t){if(!t.cancel)if("None"!==i.animation.effect||"Enable"===e.animationMode&&"None"===i.animation.effect){"Enable"===e.animationMode&&"None"===i.animation.effect&&(i.animation.effect="Fade"),"Enable"===e.animationMode&&0===i.animation.duration&&(i.animation.duration=400);var s={name:i.animation.effect+"In",timingFunction:"easeIn"},n=i.popupTemplate?[i.popupEle.firstElementChild]:(0,e.selectAll)("."+Me,i.popupEle),o=i.animation.duration/(n.length+1);s.duration=2*o;var r=function(t){var l=n[parseInt(t.toString(),10)];if(s.delay=0===t?i.animation.delay:0,s.begin=function(){0===t&&i.startShow(),l.classList.remove(He)},s.end=function(){t===n.length-1&&i.endShow()},new e.Animation(s).animate(l),t!==n.length-1){var a=t+1;setTimeout(function(){r(a)},o)}};r(0)}else{if(i.startShow(),!i.popupTemplate)(0,e.selectAll)("."+Me,i.popupEle).forEach(function(e){e.classList.remove(He)});i.endShow()}})}},i.prototype.startShow=function(){this.element.setAttribute("aria-expanded","true"),this.isMenuOpen=!0,this.toggleOverlay(),this.popupEle.classList.remove(He),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"](He)},i.prototype.removeOverlayEle=function(){this.overlayEle&&((0,e.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(t,i){var s=t.target,n={element:s=s.classList.contains(Me)?s:(0,e.closest)(s,"."+Me),item:i,event:t};this.trigger("clicked",n),this.hidePopupEle(t)},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(){(0,e.selectAll)("."+Me,this.popupEle).forEach(function(t){(0,e.remove)(t)})},i.prototype.unwireEvents=function(){e.EventHandler.remove(window,"resize",this.resizeHandler),e.EventHandler.remove(document.body,"click",this.bodyClickHandler),this.opensOnHover?this.unwireFabHover():this.unwireFabClick()},i.prototype.unwireFabClick=function(){e.EventHandler.remove(this.fab.element,"click",this.fabClick)},i.prototype.unwireFabHover=function(){this.popupEle.classList.remove(Se),e.EventHandler.remove(this.fab.element,"mouseover",this.mouseOverHandle),e.EventHandler.remove(this.element,"mouseleave",this.mouseLeaveHandle)},i.prototype.unwirePopupEvents=function(){e.isRippleEnabled&&this.removeRippleEffect(),this.removeRippleEffect=null,this.keyboardModule.destroy(),this.popupKeyboardModule.destroy(),this.documentKeyboardModule.destroy(),this.keyboardModule=null,this.popupKeyboardModule=null,this.documentKeyboardModule=null,e.EventHandler.remove(this.popupEle,"click",this.popupClick),e.EventHandler.remove(this.popupEle,"mouseleave",this.popupMouseLeaveHandle)},i.prototype.destroy=function(){var i=this;t.prototype.destroy.call(this),this.unwireEvents(),["aria-expanded","aria-haspopup","aria-controls"].forEach(function(e){i.element.removeAttribute(e)}),this.popupEle&&(this.unwirePopupEvents(),(0,e.remove)(this.popupEle),this.popupEle=void 0),this.removeOverlayEle(),this.fab.destroy(),this.fab=void 0},i.prototype.onPropertyChanged=function(t,i){for(var s=["content","cssClass","disabled","enablePersistence","enableRtl","iconPosition","position","target","template","title","visible","isPrimary"],n=(0,e.extend)({},t),o=0,r=Object.keys(n);o<r.length;o++){var l=r[o];s.indexOf(l)<0&&(0,e.deleteObject)(n,l)}this.fab.setProperties(n);for(var a=0,p=Object.keys(t);a<p.length;a++){switch(l=p[a]){case"cssClass":if(!this.popupEle)break;i.cssClass&&(0,e.removeClass)(this.overlayEle?[this.popupEle,this.overlayEle]:[this.popupEle],i.cssClass.split(/\s+/).filter(function(e){return e.length>0})),t.cssClass&&(0,e.addClass)(this.overlayEle?[this.popupEle,this.overlayEle]:[this.popupEle],t.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":t.modal?this.createOverlay():this.removeOverlayEle();break;case"mode":if(!this.popupEle||this.popupTemplate)break;this.popupEle.classList.remove(Te,Re),this.popupEle.classList.add("Radial"===this.mode?Te:Re),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())}}},Ee([(0,e.Complex)({},ct)],i.prototype,"animation",void 0),Ee([(0,e.Property)("")],i.prototype,"content",void 0),Ee([(0,e.Property)("")],i.prototype,"closeIconCss",void 0),Ee([(0,e.Property)("")],i.prototype,"cssClass",void 0),Ee([(0,e.Property)("Auto")],i.prototype,"direction",void 0),Ee([(0,e.Property)(!1)],i.prototype,"disabled",void 0),Ee([(0,e.Property)("Left")],i.prototype,"iconPosition",void 0),Ee([(0,e.Collection)([],dt)],i.prototype,"items",void 0),Ee([(0,e.Property)("")],i.prototype,"itemTemplate",void 0),Ee([(0,e.Property)("Linear")],i.prototype,"mode",void 0),Ee([(0,e.Property)("")],i.prototype,"openIconCss",void 0),Ee([(0,e.Property)(!1)],i.prototype,"opensOnHover",void 0),Ee([(0,e.Property)("BottomRight")],i.prototype,"position",void 0),Ee([(0,e.Property)(!1)],i.prototype,"modal",void 0),Ee([(0,e.Property)("")],i.prototype,"popupTemplate",void 0),Ee([(0,e.Complex)({},ht)],i.prototype,"radialSettings",void 0),Ee([(0,e.Property)("")],i.prototype,"target",void 0),Ee([(0,e.Property)(!0)],i.prototype,"visible",void 0),Ee([(0,e.Property)(!0)],i.prototype,"isPrimary",void 0),Ee([(0,e.Event)()],i.prototype,"beforeClose",void 0),Ee([(0,e.Event)()],i.prototype,"beforeItemRender",void 0),Ee([(0,e.Event)()],i.prototype,"beforeOpen",void 0),Ee([(0,e.Event)()],i.prototype,"created",void 0),Ee([(0,e.Event)()],i.prototype,"clicked",void 0),Ee([(0,e.Event)()],i.prototype,"onClose",void 0),Ee([(0,e.Event)()],i.prototype,"onOpen",void 0),i=Ee([e.NotifyPropertyChanges],i)}(e.Component),ft=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),mt=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},vt=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())})},yt=function(e,t){var i,s,n,o,r={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,s&&(n=2&o[0]?s.return:o[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,o[1])).done)return n;switch(s=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return r.label++,{value:o[1],done:!1};case 5:r.label++,s=o[1],o=[0];continue;case 7:o=r.ops.pop(),r.trys.pop();continue;default:if(!(n=r.trys,(n=n.length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){r=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){r.label=o[1];break}if(6===o[0]&&r.label<n[1]){r.label=n[1],n=o;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(o);break}n[2]&&r.ops.pop(),r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e],s=0}finally{i=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}},gt=function(t){function i(e,i){return t.call(this,e,i)||this}return ft(i,t),i.prototype.wireEvents=function(){e.EventHandler.add(this.element,"click",this.smartPasteBtnClickHandler,this)},i.prototype.unWireEvents=function(){e.EventHandler.remove(this.element,"click",this.smartPasteBtnClickHandler)},i.prototype.smartPasteBtnClickHandler=function(e){return vt(this,void 0,void 0,function(){var t,i,s,n,o,r,l,a;return yt(this,function(p){switch(p.label){case 0:return t=e.target,(i=t.closest("form"))?0===(s=this.getFormFields(i)).length?[2]:[4,this.getClipboardContent().then(function(e){return e})]:[2];case 1:if("Clipboard API not supported"===(n=p.sent())||"Clipboard access failed"===n)return[3,6];p.label=2;case 2:return p.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={messages:[{role:"system",content:r},{role:"user",content:"\nUSER_DATA: "+n+"\n "}],temperature:0,topP:1,maxTokens:2e3,frequencyPenalty:.1,presencePenalty:0,stop:["END_RESPONSE"]},"function"!=typeof this.aiAssistHandler?[3,4]:[4,this.aiAssistHandler(l)];case 3:"string"==typeof(a=p.sent())&&""!==a&&this.setFormFields(i,s,a),p.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="FIELD ",r=null;i.split("\n").forEach(function(e){if(e.startsWith(o)){var t=e.substring(6).split("^^^");2===t.length&&(n[""+t[0]]=t[1],r=t[0])}else r&&(n[""+r]+="\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 vt(this,void 0,void 0,function(){var e,t;return yt(this,function(i){switch(i.label){case 0:return e=navigator,(t=document.getElementById("custom-clipboard"))&&t.value?[2,t.value]:[3,1];case 1:if("undefined"==typeof window||!e.clipboard||!e.clipboard.readText)return[3,6];i.label=2;case 2:return i.trys.push([2,4,,5]),[4,e.clipboard.readText()];case 3:return[2,i.sent()];case 4:return i.sent(),[2,"Clipboard access failed"];case 5:return[3,7];case 6:return[2,"Clipboard API not supported"];case 7:return[2]}})})},mt([(0,e.Property)()],i.prototype,"aiAssistHandler",void 0),i}(C)})(),n})());